aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga/tests/fpga-mgr-test.c
diff options
context:
space:
mode:
authorSean Christopherson <[email protected]>2024-10-09 19:23:44 +0000
committerPaolo Bonzini <[email protected]>2024-10-20 11:31:05 +0000
commit28cf4978810791bf30288e59f1b9dc31eeeb68e6 (patch)
tree0fe47886db570be6d0822a25958ffaa62aec681e /drivers/fpga/tests/fpga-mgr-test.c
parentKVM: x86/mmu: Zap only SPs that shadow gPTEs when deleting memslot (diff)
downloadkernel-28cf4978810791bf30288e59f1b9dc31eeeb68e6.tar.gz
kernel-28cf4978810791bf30288e59f1b9dc31eeeb68e6.zip
KVM: x86/mmu: Add lockdep assert to enforce safe usage of kvm_unmap_gfn_range()
Add a lockdep assertion in kvm_unmap_gfn_range() to ensure that either mmu_invalidate_in_progress is elevated, or that the range is being zapped due to memslot removal (loosely detected by slots_lock being held). Zapping SPTEs without mmu_invalidate_{in_progress,seq} protection is unsafe as KVM's page fault path snapshots state before acquiring mmu_lock, and thus can create SPTEs with stale information if vCPUs aren't forced to retry faults (due to seeing an in-progress or past MMU invalidation). Memslot removal is a special case, as the memslot is retrieved outside of mmu_invalidate_seq, i.e. doesn't use the "standard" protections, and instead relies on SRCU synchronization to ensure any in-flight page faults are fully resolved before zapping SPTEs. Signed-off-by: Sean Christopherson <[email protected]> Message-ID: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'drivers/fpga/tests/fpga-mgr-test.c')
0 files changed, 0 insertions, 0 deletions