aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-mod.c
diff options
context:
space:
mode:
authorVipin Sharma <[email protected]>2023-03-21 15:00:12 -0700
committerSean Christopherson <[email protected]>2023-04-04 12:37:30 -0700
commit89c313f20c1ed30e04cedae735994c902ee93ddb (patch)
treec8ceb623d9e4c7841f7c123f176ed9a0ca9b8cd8 /lib/mpi/mpi-mod.c
parent697c89bed94effde145d84e618142dd89b2b54af (diff)
KVM: x86/mmu: Atomically clear SPTE dirty state in the clear-dirty-log flow
Optimize the clearing of dirty state in TDP MMU SPTEs by doing an atomic-AND (on SPTEs that have volatile bits) instead of the full XCHG that currently ends up being invoked (see kvm_tdp_mmu_write_spte()). Clearing _only_ the bit in question will allow KVM to skip the many irrelevant checks in __handle_changed_spte() by avoiding any collateral damage due to the XCHG writing all SPTE bits, e.g. the XCHG could race with fast_page_fault() setting the W-bit and the CPU setting the D-bit, and thus incorrectly drop the CPU's D-bit update. Link: https://lore.kernel.org/all/Y9hXmz%[email protected] Signed-off-by: Vipin Sharma <[email protected]> Reviewed-by: David Matlack <[email protected]> [sean: split the switch to atomic-AND to a separate patch] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-mod.c')
0 files changed, 0 insertions, 0 deletions