mbox series

[0/2] KVM: x86/mmu: Fix write-protection bug in the TDP MMU

Message ID 20220112215801.3502286-1-dmatlack@google.com (mailing list archive)
Headers show
Series KVM: x86/mmu: Fix write-protection bug in the TDP MMU | expand

Message

David Matlack Jan. 12, 2022, 9:57 p.m. UTC
While attempting to understand the big comment in
kvm_mmu_slot_remove_write_access() about TLB flushing, I discovered a
bug in the way the TDP MMU write-protects GFNs. I have not managed to
reproduce the bug as it requires a rather complex set up of live
migrating a VM that is using nested virtualization while the TDP MMU is
enabled.

Patch 1 fixes the bug and patch 2 fixes up the afformentioned comment to
be more readable.

Tested using the kvm-unit-tests and KVM selftests.

David Matlack (2):
  KVM: x86/mmu: Fix write-protection of PTs mapped by the TDP MMU
  KVM: x86/mmu: Improve comment about TLB flush semantics for
    write-protection

 arch/x86/kvm/mmu/mmu.c     | 29 ++++++++++++++++++++---------
 arch/x86/kvm/mmu/tdp_mmu.c | 27 ++++++++++++++++++++-------
 2 files changed, 40 insertions(+), 16 deletions(-)


base-commit: fea31d1690945e6dd6c3e89ec5591490857bc3d4