forked fromtorvalds/linux
- Notifications
You must be signed in to change notification settings - Fork0
Commitc4ad98e
Marc Zyngier
KVM: arm64: Assume write fault on S1PTW permission fault on instruction fetch
KVM currently assumes that an instruction abort can never be a write.This is in general true, except when the abort is triggered bya S1PTW on instruction fetch that tries to update the S1 page tables(to set AF, for example).This can happen if the page tables have been paged out and broughtback in without seeing a direct write to them (they are thus markedread only), and the fault handling code will make the PT executable(!)instead of writable. The guest gets stuck forever.In these conditions, the permission fault must be considered asa write so that the Stage-1 update can take place. This is essentiallythe I-side equivalent of the problem fixed by60e21a0 ("arm64: KVM:Take S1 walks into account when determining S2 write faults").Update kvm_is_write_fault() to return true on IABT+S1PTW, and introducekvm_vcpu_trap_is_exec_fault() that only return true when no faultingon a S1 fault. Additionally, kvm_vcpu_dabt_iss1tw() is renamed tokvm_vcpu_abt_iss1tw(), as the above makes it plain that it isn'tspecific to data abort.Signed-off-by: Marc Zyngier <maz@kernel.org>Reviewed-by: Will Deacon <will@kernel.org>Cc: stable@vger.kernel.orgLink:https://lore.kernel.org/r/20200915104218.1284701-2-maz@kernel.org1 parent7b75cd5 commitc4ad98e
File tree
3 files changed
+13
-5
lines changed- arch/arm64
- include/asm
- kvm
- hyp/include/hyp
3 files changed
+13
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
338 | 343 | | |
339 | 344 | | |
340 | 345 | | |
| |||
372 | 377 | | |
373 | 378 | | |
374 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
375 | 383 | | |
376 | 384 | | |
377 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
| 448 | + | |
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1843 | 1843 | | |
1844 | 1844 | | |
1845 | 1845 | | |
1846 | | - | |
| 1846 | + | |
1847 | 1847 | | |
1848 | 1848 | | |
1849 | 1849 | | |
| |||
2125 | 2125 | | |
2126 | 2126 | | |
2127 | 2127 | | |
2128 | | - | |
| 2128 | + | |
2129 | 2129 | | |
2130 | 2130 | | |
2131 | 2131 | | |
| |||
0 commit comments
Comments
(0)