• Juergen Gross's avatar
    mm: don't defer struct page initialization for Xen pv guests · 895f7b8e
    Juergen Gross authored
    Commit f7f99100 ("mm: stop zeroing memory during allocation in
    vmemmap") broke Xen pv domains in some configurations, as the "Pinned"
    information in struct page of early page tables could get lost.
    
    This will lead to the kernel trying to write directly into the page
    tables instead of asking the hypervisor to do so.  The result is a crash
    like the following:
    
      BUG: unable to handle kernel paging request at ffff8801ead19008
      IP: xen_set_pud+0x4e/0xd0
      PGD 1c0a067 P4D 1c0a067 PUD 23a0067 PMD 1e9de0067 PTE 80100001ead19065
      Oops: 0003 [#1] PREEMPT SMP
      Modules linked in:
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.14.0-default+ #271
      Hardware name: Dell Inc. Latitude E6440/0159N7, BIOS A07 06/26/2014
      task: ffffffff81c10480 task.stack: ffffffff81c00000
      RIP: e030:xen_set_pud+0x4e/0xd0
      Call Trace:
       __pmd_alloc+0x128/0x140
       ioremap_page_range+0x3f4/0x410
       __ioremap_caller+0x1c3/0x2e0
       acpi_os_map_iomem+0x175/0x1b0
       acpi_tb_acquire_table+0x39/0x66
       acpi_tb_validate_table+0x44/0x7c
       acpi_tb_verify_temp_table+0x45/0x304
       acpi_reallocate_root_table+0x12d/0x141
       acpi_early_init+0x4d/0x10a
       start_kernel+0x3eb/0x4a1
       xen_start_kernel+0x528/0x532
      Code: 48 01 e8 48 0f 42 15 a2 fd be 00 48 01 d0 48 ba 00 00 00 00 00 ea ff ff 48 c1 e8 0c 48 c1 e0 06 48 01 d0 48 8b 00 f6 c4 02 75 5d <4c> 89 65 00 5b 5d 41 5c c3 65 8b 05 52 9f fe 7e 89 c0 48 0f a3
      RIP: xen_set_pud+0x4e/0xd0 RSP: ffffffff81c03cd8
      CR2: ffff8801ead19008
      ---[ end trace 38eca2e56f1b642e ]---
    
    Avoid this problem by not deferring struct page initialization when
    running as Xen pv guest.
    
    Pavel said:
    
    : This is unique for Xen, so this particular issue won't effect other
    : configurations.  I am going to investigate if there is a way to
    : re-enable deferred page initialization on xen guests.
    
    [akpm@linux-foundation.org: explicitly include xen.h]
    Link: http://lkml.kernel.org/r/20180216154101.22865-1-jgross@suse.com
    Fixes: f7f99100 ("mm: stop zeroing memory during allocation in vmemmap")
    Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
    Reviewed-by: default avatarPavel Tatashin <pasha.tatashin@oracle.com>
    Cc: Steven Sistare <steven.sistare@oracle.com>
    Cc: Daniel Jordan <daniel.m.jordan@oracle.com>
    Cc: Bob Picco <bob.picco@oracle.com>
    Cc: <stable@vger.kernel.org>	[4.15.x]
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    895f7b8e
Name
Last commit
Last update
..
kasan Loading commit data...
Kconfig Loading commit data...
Kconfig.debug Loading commit data...
Makefile Loading commit data...
backing-dev.c Loading commit data...
balloon_compaction.c Loading commit data...
bootmem.c Loading commit data...
cleancache.c Loading commit data...
cma.c Loading commit data...
cma.h Loading commit data...
cma_debug.c Loading commit data...
compaction.c Loading commit data...
debug.c Loading commit data...
debug_page_ref.c Loading commit data...
dmapool.c Loading commit data...
early_ioremap.c Loading commit data...
fadvise.c Loading commit data...
failslab.c Loading commit data...
filemap.c Loading commit data...
frame_vector.c Loading commit data...
frontswap.c Loading commit data...
gup.c Loading commit data...
gup_benchmark.c Loading commit data...
highmem.c Loading commit data...
hmm.c Loading commit data...
huge_memory.c Loading commit data...
hugetlb.c Loading commit data...
hugetlb_cgroup.c Loading commit data...
hwpoison-inject.c Loading commit data...
init-mm.c Loading commit data...
internal.h Loading commit data...
interval_tree.c Loading commit data...
khugepaged.c Loading commit data...
kmemleak-test.c Loading commit data...
kmemleak.c Loading commit data...
ksm.c Loading commit data...
list_lru.c Loading commit data...
maccess.c Loading commit data...
madvise.c Loading commit data...
memblock.c Loading commit data...
memcontrol.c Loading commit data...
memory-failure.c Loading commit data...
memory.c Loading commit data...
memory_hotplug.c Loading commit data...
mempolicy.c Loading commit data...
mempool.c Loading commit data...
memtest.c Loading commit data...
migrate.c Loading commit data...
mincore.c Loading commit data...
mlock.c Loading commit data...
mm_init.c Loading commit data...
mmap.c Loading commit data...
mmu_context.c Loading commit data...
mmu_notifier.c Loading commit data...
mmzone.c Loading commit data...
mprotect.c Loading commit data...
mremap.c Loading commit data...
msync.c Loading commit data...
nobootmem.c Loading commit data...
nommu.c Loading commit data...
oom_kill.c Loading commit data...
page-writeback.c Loading commit data...
page_alloc.c Loading commit data...
page_counter.c Loading commit data...
page_ext.c Loading commit data...
page_idle.c Loading commit data...
page_io.c Loading commit data...
page_isolation.c Loading commit data...
page_owner.c Loading commit data...
page_poison.c Loading commit data...
page_vma_mapped.c Loading commit data...
pagewalk.c Loading commit data...
percpu-internal.h Loading commit data...
percpu-km.c Loading commit data...
percpu-stats.c Loading commit data...
percpu-vm.c Loading commit data...
percpu.c Loading commit data...
pgtable-generic.c Loading commit data...
process_vm_access.c Loading commit data...
quicklist.c Loading commit data...
readahead.c Loading commit data...
rmap.c Loading commit data...
rodata_test.c Loading commit data...
shmem.c Loading commit data...
slab.c Loading commit data...
slab.h Loading commit data...
slab_common.c Loading commit data...
slob.c Loading commit data...
slub.c Loading commit data...
sparse-vmemmap.c Loading commit data...
sparse.c Loading commit data...
swap.c Loading commit data...
swap_cgroup.c Loading commit data...
swap_slots.c Loading commit data...
swap_state.c Loading commit data...
swapfile.c Loading commit data...
truncate.c Loading commit data...
usercopy.c Loading commit data...
userfaultfd.c Loading commit data...
util.c Loading commit data...
vmacache.c Loading commit data...
vmalloc.c Loading commit data...
vmpressure.c Loading commit data...
vmscan.c Loading commit data...
vmstat.c Loading commit data...
workingset.c Loading commit data...
z3fold.c Loading commit data...
zbud.c Loading commit data...
zpool.c Loading commit data...
zsmalloc.c Loading commit data...
zswap.c Loading commit data...