[PATCH 0/2] KVM: x86/mmu: Fix TLB flushing bugs in TDP MMU

From: Sean Christopherson
Date: Fri Mar 19 2021 - 19:21:17 EST


Two bug fixes involving the TDP MMU. Found by inspection while working on
a series to consolidate MMU notifier memslot walks across architectures,
which I'll hopefully post next week.

Patch 1 fixes a bug where KVM yields, e.g. due to lock contention, without
performing a pending TLB flush that was required from a previous root.

Patch 2 fixes a much more egregious bug where it fails to handle TDP MMU
flushes in NX huge page recovery, as well as a similar bug to patch 1
where KVM can yield without correctly handling a previously triggered
pending TLB flush.

Sean Christopherson (2):
KVM: x86/mmu: Ensure TLBs are flushed when yielding during GFN range
zap
KVM: x86/mmu: Ensure TLBs are flushed when yielding during NX zapping

arch/x86/kvm/mmu/mmu.c | 15 ++++++++++-----
arch/x86/kvm/mmu/tdp_mmu.c | 29 +++++++++++++++--------------
arch/x86/kvm/mmu/tdp_mmu.h | 3 ++-
3 files changed, 27 insertions(+), 20 deletions(-)

--
2.31.0.rc2.261.g7f71774620-goog