Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Sep 2010 20:38:17 -0500
From:      Nathan Whitehorn <nwhitehorn@freebsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   UMA allocations from a specific physical range
Message-ID:  <4C844609.9050505@freebsd.org>

next in thread | raw e-mail | index | archive | help
PowerPC hypervisors typically provided a restricted range on memory when
the MMU is disabled, as it is when initially handling exceptions. In
order to restore virtual memory, the powerpc64 code needs to read a data
structure called the SLB cache, which is currently allocated out of a
UMA zone, and must be mapped into wired memory, ideally 1:1
physical->virtual address. Since this must be accessible in real mode,
it must have a physical address in a certain range. I am trying to
figure out the best way to do this.

My first run at this code uses a custom UMA allocator that calls
vm_phys_alloc_contig() to get a memory page. The trouble I have run into
is that I cannot figure out a way to free the page. Marking the zone
NOFREE is a bad solution, vm_page_free() panics the kernel due to
inconsistent tracking of page wiring, and vm_phys_free_pages() causes
panics in vm_page_alloc() later on ("page is not free"). What is the
correct way to deallocate these pages? Or is there a different approach
I should adopt?
-Nathan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C844609.9050505>