提交 6bc6db00 编写于 作者: L Lai Jiangshan 提交者: Paolo Bonzini

KVM: Remove tlbs_dirty

There is no user of tlbs_dirty.
Signed-off-by: NLai Jiangshan <laijs@linux.alibaba.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210918005636.3675-4-jiangshanlai@gmail.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 65855ed8
...@@ -608,7 +608,6 @@ struct kvm { ...@@ -608,7 +608,6 @@ struct kvm {
unsigned long mmu_notifier_range_start; unsigned long mmu_notifier_range_start;
unsigned long mmu_notifier_range_end; unsigned long mmu_notifier_range_end;
#endif #endif
long tlbs_dirty;
struct list_head devices; struct list_head devices;
u64 manual_dirty_log_protect; u64 manual_dirty_log_protect;
struct dentry *debugfs_dentry; struct dentry *debugfs_dentry;
......
...@@ -326,13 +326,8 @@ EXPORT_SYMBOL_GPL(kvm_make_all_cpus_request); ...@@ -326,13 +326,8 @@ EXPORT_SYMBOL_GPL(kvm_make_all_cpus_request);
#ifndef CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL #ifndef CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL
void kvm_flush_remote_tlbs(struct kvm *kvm) void kvm_flush_remote_tlbs(struct kvm *kvm)
{ {
/*
* Read tlbs_dirty before setting KVM_REQ_TLB_FLUSH in
* kvm_make_all_cpus_request.
*/
long dirty_count = smp_load_acquire(&kvm->tlbs_dirty);
++kvm->stat.generic.remote_tlb_flush_requests; ++kvm->stat.generic.remote_tlb_flush_requests;
/* /*
* We want to publish modifications to the page tables before reading * We want to publish modifications to the page tables before reading
* mode. Pairs with a memory barrier in arch-specific code. * mode. Pairs with a memory barrier in arch-specific code.
...@@ -347,7 +342,6 @@ void kvm_flush_remote_tlbs(struct kvm *kvm) ...@@ -347,7 +342,6 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
if (!kvm_arch_flush_remote_tlb(kvm) if (!kvm_arch_flush_remote_tlb(kvm)
|| kvm_make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH)) || kvm_make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH))
++kvm->stat.generic.remote_tlb_flush; ++kvm->stat.generic.remote_tlb_flush;
cmpxchg(&kvm->tlbs_dirty, dirty_count, 0);
} }
EXPORT_SYMBOL_GPL(kvm_flush_remote_tlbs); EXPORT_SYMBOL_GPL(kvm_flush_remote_tlbs);
#endif #endif
...@@ -552,7 +546,7 @@ static __always_inline int __kvm_handle_hva_range(struct kvm *kvm, ...@@ -552,7 +546,7 @@ static __always_inline int __kvm_handle_hva_range(struct kvm *kvm,
} }
} }
if (range->flush_on_ret && (ret || kvm->tlbs_dirty)) if (range->flush_on_ret && ret)
kvm_flush_remote_tlbs(kvm); kvm_flush_remote_tlbs(kvm);
if (locked) if (locked)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册