linux/arch/x86/mm
H. Peter Anvin 4763ed4d45 x86, mm: Clean up and simplify NX enablement
The 32- and 64-bit code used very different mechanisms for enabling
NX, but even the 32-bit code was enabling NX in head_32.S if it is
available.  Furthermore, we had a bewildering collection of tests for
the available of NX.

This patch:

a) merges the 32-bit set_nx() and the 64-bit check_efer() function
   into a single x86_configure_nx() function.  EFER control is left
   to the head code.

b) eliminates the nx_enabled variable entirely.  Things that need to
   test for NX enablement can verify __supported_pte_mask directly,
   and cpu_has_nx gives the supported status of NX.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Vegard Nossum <vegardno@ifi.uio.no>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Chris Wright <chrisw@sous-sol.org>
LKML-Reference: <1258154897-6770-5-git-send-email-hpa@zytor.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2009-11-16 13:44:59 -08:00
..
kmemcheck Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vegard/kmemcheck 2009-09-22 08:07:54 -07:00
dump_pagetables.c x86: remove (null) in /sys kernel_page_tables 2009-04-14 11:50:22 +02:00
extable.c x86: uaccess: introduce try and catch framework 2009-01-23 17:17:36 -08:00
fault.c Merge branch 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6 2009-09-24 07:53:22 -07:00
gup.c Merge branch 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-06-20 11:29:32 -07:00
highmem_32.c Merge branch 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2009-09-14 17:43:43 -07:00
hugetlbpage.c x86: ignore VM_LOCKED when determining if hugetlb-backed page tables can be shared or not 2009-05-29 08:40:03 -07:00
init_32.c x86, cpa: Fix kernel text RO checks in static_protection() 2009-11-02 17:16:35 +01:00
init_64.c x86_64, cpa: Use only text section in set_kernel_text_rw/ro 2009-11-02 17:17:24 +01:00
init.c x86, mm: Clean up and simplify NX enablement 2009-11-16 13:44:59 -08:00
iomap_32.c x86, pat: Add PAT reserve free to io_mapping* APIs 2009-08-26 15:41:16 -07:00
ioremap.c Merge branch 'x86-pat-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-09-15 09:19:38 -07:00
k8topology_64.c x86: Export k8 physical topology 2009-10-12 22:56:45 +02:00
kmmio.c Merge branch 'linus' into tracing/core 2009-05-07 11:17:34 +02:00
Makefile x86: split NX setup into separate file to limit unstack-protected code 2009-09-21 13:56:58 -07:00
memtest.c x86: memtest: use pointers of equal type for comparison 2009-06-11 16:26:35 +02:00
mmap.c x86: Increase MIN_GAP to include randomized stack 2009-09-10 17:00:12 -07:00
mmio-mod.c tracing: x86, mmiotrace: only register for die notifier when tracer active 2009-04-29 11:33:34 +02:00
numa_32.c x86: Export k8 physical topology 2009-10-12 22:56:45 +02:00
numa_64.c x86: Interleave emulated nodes over physical nodes 2009-10-12 22:56:46 +02:00
numa.c cpumask: convert node_to_cpumask_map[] to cpumask_var_t 2009-03-13 14:35:31 +01:00
pageattr-test.c x86: make sure the CPA test code's use of _PAGE_UNUSED1 is obvious 2008-09-05 17:09:57 +02:00
pageattr.c x86, pageattr: Make set_memory_(x|nx) aware of NX support 2009-11-16 13:44:58 -08:00
pat.c x86: Reduce verbosity of "PAT enabled" kernel message 2009-09-24 11:35:19 +02:00
pf_in.c x86: fix mmiotrace 8-bit register decoding 2008-10-14 10:33:50 +02:00
pf_in.h x86 mmiotrace: move files into arch/x86/mm/. 2008-05-24 11:25:37 +02:00
pgtable_32.c x86/32: no need to use set_pte_present in set_pte_vaddr 2009-03-19 14:04:18 +01:00
pgtable.c x86, 32-bit: Fix double accounting in reserve_top_address() 2009-08-04 16:27:29 +02:00
physaddr.c x86: split __phys_addr out into separate file 2009-09-10 11:48:55 -07:00
physaddr.h x86: split __phys_addr out into separate file 2009-09-10 11:48:55 -07:00
setup_nx.c x86, mm: Clean up and simplify NX enablement 2009-11-16 13:44:59 -08:00
srat_32.c x86: Decrease the level of some NUMA messages to KERN_DEBUG 2009-09-06 06:32:23 +02:00
srat_64.c x86: Interleave emulated nodes over physical nodes 2009-10-12 22:56:46 +02:00
testmmiotrace.c x86: add far read test to testmmiotrace 2009-03-02 10:20:35 +01:00
tlb.c cpumask: use mm_cpumask() wrapper: x86 2009-09-24 09:34:52 +09:30