Skip to content

Commit

Permalink
xen: check EFER for NX before setting up GDT mapping
Browse files Browse the repository at this point in the history
x86-64 assumes NX is available by default, so we need to
explicitly check for it before using NX.  Some first-generation
Intel x86-64 processors didn't support NX, and even recent systems
allow it to be disabled in BIOS.

[ Impact: prevent Xen crash on NX-less 64-bit machines ]

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Stable Kernel <stable@kernel.org>
  • Loading branch information
Jeremy Fitzhardinge committed Sep 21, 2009
1 parent 79b520e commit b75fe4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions arch/x86/mm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \
# Make sure __phys_addr has no stackprotector
nostackp := $(call cc-option, -fno-stack-protector)
CFLAGS_physaddr.o := $(nostackp)
CFLAGS_init.o := $(nostackp)

obj-$(CONFIG_SMP) += tlb.o

Expand Down
10 changes: 5 additions & 5 deletions arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,11 @@ asmlinkage void __init xen_start_kernel(void)

__supported_pte_mask |= _PAGE_IOMAP;

#ifdef CONFIG_X86_64
/* Work out if we support NX */
check_efer();
#endif

xen_setup_features();

/* Get mfn list */
Expand Down Expand Up @@ -1123,11 +1128,6 @@ asmlinkage void __init xen_start_kernel(void)

pgd = (pgd_t *)xen_start_info->pt_base;

#ifdef CONFIG_X86_64
/* Work out if we support NX */
check_efer();
#endif

/* Don't do the full vcpu_info placement stuff until we have a
possible map and a non-dummy shared_info. */
per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
Expand Down

0 comments on commit b75fe4e

Please sign in to comment.