Jeremy, hi. This dependency is not documented or explicitly called anywhere
in the mm/init_64.c code. I would have expected to see a big comment near this
kind of code :(
It is not just the NX bit that we change. For DEBUG_PAGEALLOC, we want
use 4k pages instead of large page mappings during the identity mapping
(as this will clean some of the cpa pool code avoiding the cpa and hence
the page allocations for splitting the big pages from interrupt context's).
In this case will will split the static large page mappings.
3. The actual implementation is pretty ugly; adding a global variable
and hopping about with goto does not improve this code.
This is very early init code and I can't be fancy like calling cpa()
which need mm to be up and running.
And also, cpa's on individual chunks
for entire identity mapping will make the boot slow.
it cause real failures? Could we revert this patch and address the
problem some other way? Which app note is this, BTW? The one I have on
hand, "TLBs, Paging-Structure Caches, and Their Invalidation", Apr 2007,
does not seem to mention this restriction.
http://developer.intel.com/design/processor/applnots/317080.pdf
Section 6 page 26
Xen with this code in place (touching this code is always non-trivial).
I haven't looked into it in depth yet, but there's a few stand out "bad
for Xen" pieces of code here. (And I haven't tested 32-bit yet.)
Quick rules for keeping Xen happy here:
1. Xen provides its own initial pagetable; the head_64.S one is
unused when booting under Xen.
2. Xen requires that any pagetable page must always be mapped RO, so
we're careful to not replace an existing mapping with a new one,
in case the existing mapping is a pagetable one.
3. Xen never uses large pages, and the hypervisor will fail any
attempt to do so.
Thanks for this info. Will get back to you tomorrow.