[PATCH v3 RESEND 3/5] RISC-V: KVM: Remove redundant TLB flush operations
wang.yechao255 at zte.com.cn
wang.yechao255 at zte.com.cn
Wed Jun 24 01:09:33 PDT 2026
From: Wang Yechao <wang.yechao255 at zte.com.cn>
The function kvm_arch_mmu_enable_log_dirty_pt_masked() is called by
kvm_vm_ioctl_reset_dirty_pages() and kvm_clear_dirty_log_protect().
Both callers already perform a TLB flush after enabling dirty logging,
so the TLB flush inside kvm_arch_mmu_enable_log_dirty_pt_masked() is
unnecessary. Remove it.
Signed-off-by: Wang Yechao <wang.yechao255 at zte.com.cn>
---
arch/riscv/kvm/mmu.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/riscv/kvm/mmu.c b/arch/riscv/kvm/mmu.c
index 95e83c50addf5..bc3bad67d507b 100644
--- a/arch/riscv/kvm/mmu.c
+++ b/arch/riscv/kvm/mmu.c
@@ -160,14 +160,10 @@ void kvm_arch_mmu_enable_log_dirty_pt_masked(struct kvm *kvm,
phys_addr_t start = (base_gfn + __ffs(mask)) << PAGE_SHIFT;
phys_addr_t end = (base_gfn + __fls(mask) + 1) << PAGE_SHIFT;
struct kvm_gstage gstage;
- bool flush;
kvm_riscv_gstage_init(&gstage, kvm);
- flush = kvm_riscv_gstage_wp_range(&gstage, start, end);
- if (flush)
- kvm_flush_remote_tlbs_range(kvm, start >> PAGE_SHIFT,
- (end - start) >> PAGE_SHIFT);
+ kvm_riscv_gstage_wp_range(&gstage, start, end);
}
void kvm_arch_sync_dirty_log(struct kvm *kvm, struct kvm_memory_slot *memslot)
--
2.43.5
More information about the kvm-riscv
mailing list