linux/arch/x86/mm
Suresh Siddha 281ff33b7c x86_64, cpa: Don't work hard in preserving kernel 2M mappings when using 4K already
We currently enforce the !RW mapping for the kernel mapping that maps
holes between different text, rodata and data sections. However, kernel
identity mappings will have different RWX permissions to the pages mapping to
text and to the pages padding (which are freed) the text, rodata sections.
Hence kernel identity mappings will be broken to smaller pages. For 64-bit,
kernel text and kernel identity mappings are different, so we can enable
protection checks that come with CONFIG_DEBUG_RODATA, as well as retain 2MB
large page mappings for kernel text.

Konrad reported a boot failure with the Linux Xen paravirt guest because of
this. In this paravirt guest case, the kernel text mapping and the kernel
identity mapping share the same page-table pages. Thus forcing the !RW mapping
for some of the kernel mappings also cause the kernel identity mappings to be
read-only resulting in the boot failure. Linux Xen paravirt guest also
uses 4k mappings and don't use 2M mapping.

Fix this issue and retain large page performance advantage for native kernels
by not working hard and not enforcing !RW for the kernel text mapping,
if the current mapping is already using small page mapping.

Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <1266522700.2909.34.camel@sbs-t61.sc.intel.com>
Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: stable@kernel.org	[2.6.32, 2.6.33]
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-02-22 15:09:31 -08:00
..
kmemcheck x86, kmemcheck: Use KERN_WARNING for error reporting 2009-12-28 10:28:35 +01:00
Makefile x86: split NX setup into separate file to limit unstack-protected code 2009-09-21 13:56:58 -07:00
dump_pagetables.c x86: remove (null) in /sys kernel_page_tables 2009-04-14 11:50:22 +02:00
extable.c x86, 64-bit: Move K8 B step iret fixup to fault entry asm 2009-10-12 18:29:46 +02:00
fault.c Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-05 15:33:27 -08:00
gup.c x86, doc: Fix minor spelling error in arch/x86/mm/gup.c 2010-02-02 16:00:44 -08: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.c x86, mm: Report state of NX protections during boot 2009-11-16 13:44:59 -08:00
init_32.c mm: make totalhigh_pages unsigned long 2010-01-11 09:34:03 -08: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
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-12-08 13:34:17 -08:00
k8topology_64.c x86: Move find_smp_config() earlier and avoid bootmem usage 2009-11-24 12:10:51 +01:00
kmmio.c hw-breakpoints, perf: Fix broken mmiotrace due to dr6 by reference change 2010-01-17 08:01:44 +01: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 x86: Fix build warning in arch/x86/mm/mmio-mod.c 2009-12-14 08:55:43 +01:00
numa.c cpumask: convert node_to_cpumask_map[] to cpumask_var_t 2009-03-13 14:35:31 +01:00
numa_32.c x86: Export k8 physical topology 2009-10-12 22:56:45 +02:00
numa_64.c x86, numa: Use near(er) online node instead of roundrobin for NUMA 2009-11-23 10:06:24 +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_64, cpa: Don't work hard in preserving kernel 2M mappings when using 4K already 2010-02-22 15:09:31 -08:00
pat.c vfs: Implement proper O_SYNC semantics 2009-12-10 15:02:50 +01: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.c x86, 32-bit: Fix double accounting in reserve_top_address() 2009-08-04 16:27:29 +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
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: Report state of NX protections during boot 2009-11-16 13:44:59 -08:00
srat_32.c x86: Fix checking of SRAT when node 0 ram is not from 0 2009-12-16 16:43:37 -08:00
srat_64.c x86: Set hotpluggable nodes in nodes_possible_map 2010-01-23 06:21:57 +01:00
testmmiotrace.c testmmiotrace.c: Add and use pr_fmt(fmt) 2009-10-12 08:05:41 +02:00
tlb.c x86: Eliminate redundant/contradicting cache line size config options 2009-11-19 04:58:34 +01:00