aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-02-25 17:03:26 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2021-03-15 04:43:30 -0400
commit74fe0f547454a19a033b03ac55cf248e28f11db6 (patch)
tree2795986f3d1a3cda45f2097d8dcef77611f3c046
parentKVM: x86/mmu: Remove spurious TLB flush from TDP MMU's change_pte() hook (diff)
KVM: x86/mmu: WARN if TDP MMU's set_tdp_spte() sees multiple GFNs
WARN if set_tdp_spte() is invoked with multipel GFNs. It is specifically a callback to handle a single host PTE being changed. Consuming the @end parameter also eliminates the confusing 'unused' parameter. Cc: Ben Gardon <bgardon@google.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210226010329.1766033-3-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/mmu/tdp_mmu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
index a31b903cf246..0d7b3f34ebbd 100644
--- a/arch/x86/kvm/mmu/tdp_mmu.c
+++ b/arch/x86/kvm/mmu/tdp_mmu.c
@@ -1020,7 +1020,7 @@ int kvm_tdp_mmu_test_age_hva(struct kvm *kvm, unsigned long hva)
* Returns non-zero if a flush is needed before releasing the MMU lock.
*/
static int set_tdp_spte(struct kvm *kvm, struct kvm_memory_slot *slot,
- struct kvm_mmu_page *root, gfn_t gfn, gfn_t unused,
+ struct kvm_mmu_page *root, gfn_t gfn, gfn_t end,
unsigned long data)
{
struct tdp_iter iter;
@@ -1031,7 +1031,7 @@ static int set_tdp_spte(struct kvm *kvm, struct kvm_memory_slot *slot,
rcu_read_lock();
- WARN_ON(pte_huge(*ptep));
+ WARN_ON(pte_huge(*ptep) || (gfn + 1) != end);
new_pfn = pte_pfn(*ptep);