]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Check for present SPTE when clearing dirty bit in TDP MMU
authorSean Christopherson <seanjc@google.com>
Sat, 26 Feb 2022 00:15:20 +0000 (00:15 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Mar 2022 14:31:17 +0000 (09:31 -0500)
commitb197692cea986a51d2743c851cc3ab88aaad4371
treeb01dcfa6f7ab94d3eccabc9661d800bcc886b364
parentc92df34afd875ea05c5044bec175f2b90f2aed0a
KVM: x86/mmu: Check for present SPTE when clearing dirty bit in TDP MMU

Explicitly check for present SPTEs when clearing dirty bits in the TDP
MMU.  This isn't strictly required for correctness, as setting the dirty
bit in a defunct SPTE will not change the SPTE from !PRESENT to PRESENT.
However, the guarded MMU_WARN_ON() in spte_ad_need_write_protect() would
complain if anyone actually turned on KVM's MMU debugging.

Fixes: 679d4157b88d ("kvm: x86/mmu: Support dirty logging for the TDP MMU")
Cc: Ben Gardon <bgardon@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Ben Gardon <bgardon@google.com>
Message-Id: <20220226001546.360188-3-seanjc@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/tdp_mmu.c