alistair23-linux/arch/x86/mm
Luis R. Rodriguez cb32edf65b x86/mm/pat: Wrap pat_enabled into a function API
We use pat_enabled in x86-specific code to see if PAT is enabled
or not but we're granting full access to it even though readers
do not need to set it. If, for instance, we granted access to it
to modules later they then could override the variable
setting... no bueno.

This renames pat_enabled to a new static variable __pat_enabled.
Folks are redirected to use pat_enabled() now.

Code that sets this can only be internal to pat.c. Apart from
the early kernel parameter "nopat" to disable PAT, we also have
a few cases that disable it later and make use of a helper
pat_disable(). It is wrapped under an ifdef but since that code
cannot run unless PAT was enabled its not required to wrap it
with ifdefs, unwrap that. Likewise, since "nopat" doesn't really
change non-PAT systems just remove that ifdef as well.

Although we could add and use an early_param_off(), these
helpers don't use __read_mostly but we want to keep
__read_mostly for __pat_enabled as this is a hot path -- upon
boot, for instance, a simple guest may see ~4k accesses to
pat_enabled(). Since __read_mostly early boot params are not
that common we don't add a helper for them just yet.

Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Walls <awalls@md.metrocast.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Kyle McMartin <kyle@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1430425520-22275-3-git-send-email-mcgrof@do-not-panic.com
Link: http://lkml.kernel.org/r/1432628901-18044-13-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-05-27 14:41:01 +02:00
..
kmemcheck x86: Replace __get_cpu_var uses 2014-08-26 13:45:49 -04:00
amdtopology.c
dump_pagetables.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-12-10 13:59:34 -08:00
extable.c
fault.c x86/asm/entry: Change all 'user_mode_vm()' calls to 'user_mode()' 2015-03-23 11:14:17 +01:00
gup.c mm: convert p[te|md]_numa users to p[te|md]_protnone_numa 2015-02-12 18:54:08 -08:00
highmem_32.c
hugetlbpage.c mm/hugetlb: pmd_huge() returns true for non-present hugepage 2015-02-11 17:06:01 -08:00
init.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 13:31:32 -07:00
init_32.c x86: remove the Xen-specific _PAGE_IOMAP PTE flag 2014-09-23 13:36:20 +00:00
init_64.c x86/mm: Use early_param_on_off() for direct_gbpages 2015-03-05 08:02:12 +01:00
iomap_32.c x86/mm/pat: Wrap pat_enabled into a function API 2015-05-27 14:41:01 +02:00
ioremap.c x86/mm/pat: Wrap pat_enabled into a function API 2015-05-27 14:41:01 +02:00
kasan_init_64.c kasan: enable instrumentation of global variables 2015-02-13 21:21:42 -08:00
kmmio.c
Makefile mm: move memtest under mm 2015-04-14 16:49:06 -07:00
mm_internal.h x86: Enable PAT to use cache mode translation tables 2014-11-16 11:04:26 +01:00
mmap.c mm: expose arch_mmap_rnd when available 2015-04-14 16:49:05 -07:00
mmio-mod.c
mpx.c x86, mpx: Explicitly disable 32-bit MPX support on 64-bit kernels 2015-01-22 21:11:06 +01:00
numa.c x86/mm/numa: Fix kernel stack corruption in numa_init()->numa_clear_kernel_node_hotplug() 2015-04-07 16:01:19 +02:00
numa_32.c
numa_64.c
numa_emulation.c
numa_internal.h
pageattr-test.c x86: define _PAGE_NUMA by reusing software bits on the PMD and PTE levels 2014-06-04 16:53:55 -07:00
pageattr.c x86/mm/pat: Wrap pat_enabled into a function API 2015-05-27 14:41:01 +02:00
pat.c x86/mm/pat: Wrap pat_enabled into a function API 2015-05-27 14:41:01 +02:00
pat_internal.h x86/mm/pat: Convert to pr_*() usage 2015-05-27 14:40:59 +02:00
pat_rbtree.c x86/mm/pat: Convert to pr_*() usage 2015-05-27 14:40:59 +02:00
pf_in.c
pf_in.h
pgtable.c x86/mm/mtrr: Enhance MTRR checks in kernel mapping helpers 2015-05-27 14:40:58 +02:00
pgtable_32.c x86: Remove set_pmd_pfn 2014-09-01 10:15:31 +02:00
physaddr.c
physaddr.h
setup_nx.c
srat.c
testmmiotrace.c
tlb.c x86: Store a per-cpu shadow copy of CR4 2015-02-04 12:10:42 +01:00