]> git.baikalelectronics.ru Git - kernel.git/commit
x86/mm: Make set_pmd_at() paravirt aware
authorJuergen Gross <jgross@suse.com>
Sun, 10 Feb 2019 07:40:56 +0000 (08:40 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 10 Feb 2019 07:47:12 +0000 (08:47 +0100)
commitaad752e79739655c6d38927f974ec482f09be128
treeca777b951cabeb6dd99fdb57eff1848fcde3f953
parenta83536154126b669aed92a253467e7a1ff446c52
x86/mm: Make set_pmd_at() paravirt aware

set_pmd_at() calls native_set_pmd() unconditionally on x86. This was
fine as long as only huge page entries were written via set_pmd_at(),
as Xen pv guests don't support those.

Commit a0cd31714ea4f1 ("mm: speed up mremap by 20x on large regions")
introduced a usage of set_pmd_at() possible on pv guests, leading to
failures like:

BUG: unable to handle kernel paging request at ffff888023e26778
#PF error: [PROT] [WRITE]
RIP: e030:move_page_tables+0x7c1/0xae0
move_vma.isra.3+0xd1/0x2d0
__se_sys_mremap+0x3c6/0x5b0
 do_syscall_64+0x49/0x100
entry_SYSCALL_64_after_hwframe+0x44/0xa9

Make set_pmd_at() paravirt aware by just letting it use set_pmd().

Fixes: a0cd31714ea4f1 ("mm: speed up mremap by 20x on large regions")
Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: xen-devel@lists.xenproject.org
Cc: boris.ostrovsky@oracle.com
Cc: sstabellini@kernel.org
Cc: hpa@zytor.com
Cc: bp@alien8.de
Cc: torvalds@linux-foundation.org
Link: https://lkml.kernel.org/r/20190210074056.11842-1-jgross@suse.com
arch/x86/include/asm/pgtable.h