Commit 4aaf269
mm: introduce arch_has_hw_nonleaf_pmd_young()
When running as a Xen PV guests commit eed9a32 ("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/[email protected]
Fixes: eed9a32 ("mm: x86: add CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG")
Signed-off-by: Juergen Gross <[email protected]>
Reported-by: Sander Eikelenboom <[email protected]>
Acked-by: Yu Zhao <[email protected]>
Tested-by: Sander Eikelenboom <[email protected]>
Acked-by: David Hildenbrand <[email protected]> [core changes]
Signed-off-by: Andrew Morton <[email protected]>1 parent 6617da8 commit 4aaf269
3 files changed
+24
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1439 | 1439 | | |
1440 | 1440 | | |
1441 | 1441 | | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
1442 | 1450 | | |
1443 | 1451 | | |
1444 | 1452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
270 | 281 | | |
271 | 282 | | |
272 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3987 | 3987 | | |
3988 | 3988 | | |
3989 | 3989 | | |
3990 | | - | |
| 3990 | + | |
3991 | 3991 | | |
3992 | 3992 | | |
3993 | 3993 | | |
| |||
4085 | 4085 | | |
4086 | 4086 | | |
4087 | 4087 | | |
4088 | | - | |
4089 | | - | |
| 4088 | + | |
| 4089 | + | |
4090 | 4090 | | |
4091 | 4091 | | |
4092 | 4092 | | |
4093 | 4093 | | |
4094 | 4094 | | |
4095 | | - | |
| 4095 | + | |
4096 | 4096 | | |
4097 | 4097 | | |
4098 | 4098 | | |
| |||
5392 | 5392 | | |
5393 | 5393 | | |
5394 | 5394 | | |
5395 | | - | |
| 5395 | + | |
5396 | 5396 | | |
5397 | 5397 | | |
5398 | 5398 | | |
| |||
0 commit comments