linux_dsm_epyc7002/arch/x86/xen
Jeremy Fitzhardinge 5deb30d194 xen: rework pgd_walk to deal with 32/64 bit
Rewrite pgd_walk to deal with 64-bit address spaces.  There are two
notible features of 64-bit workspaces:

 1. The physical address is only 48 bits wide, with the upper 16 bits
    being sign extension; kernel addresses are negative, and userspace is
    positive.

 2. The Xen hypervisor mapping is at the negative-most address, just above
    the sign-extension hole.

1. means that we can't easily use addresses when traversing the space,
since we must deal with sign extension.  This rewrite expresses
everything in terms of pgd/pud/pmd indices, which means we don't need
to worry about the exact configuration of the virtual memory space.
This approach works equally well in 32-bit.

To deal with 2, assume the hole is between the uppermost userspace
address and PAGE_OFFSET.  For 64-bit this skips the Xen mapping hole.
For 32-bit, the hole is zero-sized.

In all cases, the uppermost kernel address is FIXADDR_TOP.

A side-effect of this patch is that the upper boundary is actually
handled properly, exposing a long-standing bug in 32-bit, which failed
to pin kernel pmd page.  The kernel pmd is not shared, and so must be
explicitly pinned, even though the kernel ptes are shared and don't
need pinning.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-16 11:03:59 +02:00
..
enlighten.c xen64: implement xen_load_gs_index() 2008-07-16 11:03:45 +02:00
grant-table.c xen: make grant table arch portable 2008-04-24 23:57:32 +02:00
Kconfig Merge commit 'v2.6.26-rc8' into x86/xen 2008-06-25 12:16:51 +02:00
Makefile xen64: add 64-bit assembler 2008-07-16 10:59:09 +02:00
mmu.c xen: rework pgd_walk to deal with 32/64 bit 2008-07-16 11:03:59 +02:00
mmu.h xen64: add extra pv_mmu_ops 2008-07-16 10:57:16 +02:00
multicalls.c xen: print backtrace on multicall failure 2008-07-16 10:55:21 +02:00
multicalls.h xen: add mechanism to extend existing multicalls 2008-06-25 15:17:34 +02:00
setup.c xen64: register callbacks in arch-independent way 2008-07-16 11:03:01 +02:00
smp.c xen: set num_processors 2008-07-16 11:01:31 +02:00
suspend.c xen: add xen_arch_resume()/xen_timer_resume hook for ia64 support 2008-07-16 10:55:50 +02:00
time.c x86: rename paravirtualized TSC functions 2008-07-09 07:43:28 +02:00
vdso.h i386: move xen 2007-10-11 11:16:51 +02:00
xen-asm_32.S xen64: add 64-bit assembler 2008-07-16 10:59:09 +02:00
xen-asm_64.S xen64: deal with extra words Xen pushes onto exception frames 2008-07-16 11:02:31 +02:00
xen-head.S xen64: add xen-head code to head_64.S 2008-07-16 10:58:41 +02:00
xen-ops.h xen64: deal with extra words Xen pushes onto exception frames 2008-07-16 11:02:31 +02:00