Skip to content

Commit 6bc6db0

Browse files
Lai Jiangshanbonzini
authored andcommitted
KVM: Remove tlbs_dirty
There is no user of tlbs_dirty. Signed-off-by: Lai Jiangshan <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 65855ed commit 6bc6db0

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

include/linux/kvm_host.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,6 @@ struct kvm {
608608
unsigned long mmu_notifier_range_start;
609609
unsigned long mmu_notifier_range_end;
610610
#endif
611-
long tlbs_dirty;
612611
struct list_head devices;
613612
u64 manual_dirty_log_protect;
614613
struct dentry *debugfs_dentry;

virt/kvm/kvm_main.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,8 @@ EXPORT_SYMBOL_GPL(kvm_make_all_cpus_request);
326326
#ifndef CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL
327327
void kvm_flush_remote_tlbs(struct kvm *kvm)
328328
{
329-
/*
330-
* Read tlbs_dirty before setting KVM_REQ_TLB_FLUSH in
331-
* kvm_make_all_cpus_request.
332-
*/
333-
long dirty_count = smp_load_acquire(&kvm->tlbs_dirty);
334-
335329
++kvm->stat.generic.remote_tlb_flush_requests;
330+
336331
/*
337332
* We want to publish modifications to the page tables before reading
338333
* mode. Pairs with a memory barrier in arch-specific code.
@@ -347,7 +342,6 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
347342
if (!kvm_arch_flush_remote_tlb(kvm)
348343
|| kvm_make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH))
349344
++kvm->stat.generic.remote_tlb_flush;
350-
cmpxchg(&kvm->tlbs_dirty, dirty_count, 0);
351345
}
352346
EXPORT_SYMBOL_GPL(kvm_flush_remote_tlbs);
353347
#endif
@@ -552,7 +546,7 @@ static __always_inline int __kvm_handle_hva_range(struct kvm *kvm,
552546
}
553547
}
554548

555-
if (range->flush_on_ret && (ret || kvm->tlbs_dirty))
549+
if (range->flush_on_ret && ret)
556550
kvm_flush_remote_tlbs(kvm);
557551

558552
if (locked)

0 commit comments

Comments
 (0)