linux-kernel-test/arch/i386/mm
Jeremy Fitzhardinge b239fb2501 [PATCH] i386: PARAVIRT: Hooks to set up initial pagetable
This patch introduces paravirt_ops hooks to control how the kernel's
initial pagetable is set up.

In the case of a native boot, the very early bootstrap code creates a
simple non-PAE pagetable to map the kernel and physical memory.  When
the VM subsystem is initialized, it creates a proper pagetable which
respects the PAE mode, large pages, etc.

When booting under a hypervisor, there are many possibilities for what
paging environment the hypervisor establishes for the guest kernel, so
the constructon of the kernel's pagetable depends on the hypervisor.

In the case of Xen, the hypervisor boots the kernel with a fully
constructed pagetable, which is already using PAE if necessary.  Also,
Xen requires particular care when constructing pagetables to make sure
all pagetables are always mapped read-only.

In order to make this easier, kernel's initial pagetable construction
has been changed to only allocate and initialize a pagetable page if
there's no page already present in the pagetable.  This allows the Xen
paravirt backend to make a copy of the hypervisor-provided pagetable,
allowing the kernel to establish any more mappings it needs while
keeping the existing ones.

A slightly subtle point which is worth highlighting here is that Xen
requires all kernel mappings to share the same pte_t pages between all
pagetables, so that updating a kernel page's mapping in one pagetable
is reflected in all other pagetables.  This makes it possible to
allocate a page and attach it to a pagetable without having to
explicitly enumerate that page's mapping in all pagetables.

And:

+From: "Eric W. Biederman" <ebiederm@xmission.com>

If we don't set the leaf page table entries it is quite possible that
will inherit and incorrect page table entry from the initial boot
page table setup in head.S.  So we need to redo the effort here,
so we pick up PSE, PGE and the like.

Hypervisors like Xen require that their page tables be read-only,
which is slightly incompatible with our low identity mappings, however
I discussed this with Jeremy he has modified the Xen early set_pte
function to avoid problems in this area.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Acked-by: William Irwin <bill.irwin@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
2007-05-02 19:27:13 +02:00
..
boot_ioremap.c [PATCH] paravirt: Add MMU virtualization to paravirt_ops 2006-12-07 02:14:08 +01:00
discontig.c [PATCH] i386: Remove extern declaration from mm/discontig.c, put in header. 2007-02-13 13:26:26 +01:00
extable.c [PATCH] i386: Allow a kernel not to be in ring 0 2006-09-26 10:52:39 +02:00
fault.c [PATCH] i386: adjustments to page table dump during oops (v4) 2007-05-02 19:27:04 +02:00
highmem.c [PATCH] Proper fix for highmem kmap_atomic functions for VMI for 2.6.21 2007-04-08 19:47:55 -07:00
hugetlbpage.c [PATCH] shared page table for hugetlb page 2006-12-07 08:39:21 -08:00
init.c [PATCH] i386: PARAVIRT: Hooks to set up initial pagetable 2007-05-02 19:27:13 +02:00
ioremap.c [PATCH] Generic ioremap_page_range: i386 conversion 2006-10-01 00:39:31 -07:00
Makefile [PATCH] sparsemem memory model for i386 2005-06-23 09:45:05 -07:00
mmap.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pageattr.c [PATCH] x86: Improve handling of kernel mappings in change_page_attr 2007-05-02 19:27:10 +02:00
pgtable.c [PATCH] i386: Relocate VDSO ELF headers to match mapped location with COMPAT_VDSO 2007-05-02 19:27:12 +02:00