acrn-kernel/arch
Juergen Gross 4aaf269c76 mm: introduce arch_has_hw_nonleaf_pmd_young()
When running as a Xen PV guests commit eed9a328aa ("mm: x86: add
CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG") can cause a protection violation in
pmdp_test_and_clear_young():

 BUG: unable to handle page fault for address: ffff8880083374d0
 #PF: supervisor write access in kernel mode
 #PF: error_code(0x0003) - permissions violation
 PGD 3026067 P4D 3026067 PUD 3027067 PMD 7fee5067 PTE 8010000008337065
 Oops: 0003 [#1] PREEMPT SMP NOPTI
 CPU: 7 PID: 158 Comm: kswapd0 Not tainted 6.1.0-rc5-20221118-doflr+ #1
 RIP: e030:pmdp_test_and_clear_young+0x25/0x40

This happens because the Xen hypervisor can't emulate direct writes to
page table entries other than PTEs.

This can easily be fixed by introducing arch_has_hw_nonleaf_pmd_young()
similar to arch_has_hw_pte_young() and test that instead of
CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG.

Link: https://lkml.kernel.org/r/20221123064510.16225-1-jgross@suse.com
Fixes: eed9a328aa ("mm: x86: add CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: Yu Zhao <yuzhao@google.com>
Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: David Hildenbrand <david@redhat.com>	[core changes]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-11-30 14:49:41 -08:00
..
alpha asm-generic: arch/alpha regression fix for 6.1 2022-10-14 13:47:42 -07:00
arc ARC: mm: fix leakage of memory allocated for PTE 2022-10-17 16:32:12 -07:00
arm ARM: dts: ux500: Add trips to battery thermal zones 2022-11-01 12:21:17 +01:00
arm64 ARM: 2022-11-06 10:46:59 -08:00
csky
hexagon
ia64
loongarch mm: add dummy pmd_young() for architectures not having it 2022-11-30 14:49:41 -08:00
m68k
microblaze
mips mm: add dummy pmd_young() for architectures not having it 2022-11-30 14:49:41 -08:00
nios2
openrisc OpenRISC 6.1 Updates 2022-10-15 16:47:33 -07:00
parisc parisc: Avoid printing the hardware path twice 2022-10-31 15:37:14 +01:00
powerpc powerpc/32: Select ARCH_SPLIT_ARG64 2022-11-01 15:27:12 +11:00
riscv mm: add dummy pmd_young() for architectures not having it 2022-11-30 14:49:41 -08:00
s390 mm: add dummy pmd_young() for architectures not having it 2022-11-30 14:49:41 -08:00
sh
sparc mm: add dummy pmd_young() for architectures not having it 2022-11-30 14:49:41 -08:00
um Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
x86 mm: introduce arch_has_hw_nonleaf_pmd_young() 2022-11-30 14:49:41 -08:00
xtensa
.gitignore
Kconfig