Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen: set _PAGE_NX in __supported_pte_mask before pagetable construction

Some 64-bit machines don't support the NX flag in ptes.
Check for NX before constructing the kernel pagetables.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>

+6 -1
+6 -1
arch/x86/xen/enlighten.c
··· 42 42 #include <asm/xen/hypervisor.h> 43 43 #include <asm/fixmap.h> 44 44 #include <asm/processor.h> 45 + #include <asm/proto.h> 45 46 #include <asm/msr-index.h> 46 47 #include <asm/setup.h> 47 48 #include <asm/desc.h> ··· 913 912 .emergency_restart = xen_emergency_restart, 914 913 }; 915 914 916 - 917 915 /* First C function to be called on Xen boot */ 918 916 asmlinkage void __init xen_start_kernel(void) 919 917 { ··· 979 979 __supported_pte_mask &= ~_PAGE_GLOBAL; 980 980 if (!xen_initial_domain()) 981 981 __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD); 982 + 983 + #ifdef CONFIG_X86_64 984 + /* Work out if we support NX */ 985 + check_efer(); 986 + #endif 982 987 983 988 /* Don't do the full vcpu_info placement stuff until we have a 984 989 possible map and a non-dummy shared_info. */