lkml.org 
[lkml]   [2019]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 11/11] KVM/MMU: Flush tlb in the kvm_age_rmapp()
Date
From: Lan Tianyu <Tianyu.Lan@microsoft.com>

This patch is to flush tlb in the kvm_age_rmapp() when tlb range flush
is available and flush request is true.

Signed-off-by: Lan Tianyu <Tianyu.Lan@microsoft.com>
---
arch/x86/kvm/mmu.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index a5728f51bf7d..bc402a72956a 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1958,10 +1958,17 @@ static int kvm_age_rmapp(struct kvm *kvm, struct kvm_rmap_head *rmap_head,
u64 *sptep;
struct rmap_iterator uninitialized_var(iter);
int young = 0;
+ bool flush = (bool)data;

for_each_rmap_spte(rmap_head, &iter, sptep)
young |= mmu_spte_age(sptep);

+ if (young && flush) {
+ kvm_flush_remote_tlbs_with_address(kvm, gfn,
+ KVM_PAGES_PER_HPAGE(level));
+ young = 0;
+ }
+
trace_kvm_age_page(gfn, level, slot, young);
return young;
}
--
2.14.4
\
 
 \ /
  Last update: 2019-01-04 09:56    [W:0.135 / U:0.960 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site