Messages in this thread Patch in this message | | | From | "Hou Wenlong" <> | Subject | [PATCH 1/5] KVM: x86/mmu: Fix wrong gfn range of tlb flushing in validate_direct_spte() | Date | Fri, 24 Jun 2022 11:36:57 +0800 |
| |
The spte pointing to the children SP is dropped, so the whole gfn range covered by the children SP should be flushed.
Fixes: c3134ce240eed ("KVM: Replace old tlb flush function with new one to flush a specified range.") Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com> --- arch/x86/kvm/mmu/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 79c6a821ea0d..b8a1f5b46b9d 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -2333,7 +2333,8 @@ static void validate_direct_spte(struct kvm_vcpu *vcpu, u64 *sptep, return; drop_parent_pte(child, sptep); - kvm_flush_remote_tlbs_with_address(vcpu->kvm, child->gfn, 1); + kvm_flush_remote_tlbs_with_address(vcpu->kvm, child->gfn, + KVM_PAGES_PER_HPAGE(child->role.level + 1)); } } -- 2.31.1
| |