lkml.org 
[lkml]   [2022]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v8 056/103] KVM: x86/mmu: Let vcpu re-try when faulting page type conflict
Date
From: Xiaoyao Li <xiaoyao.li@intel.com>

When it gets a private page fault on a shared page, or vice verse, let
vcpu retry and vcpu will keep faulting until other vcpu maps the gpa to
matched page type.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
---
arch/x86/kvm/mmu/mmu.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 27deaf44ee80..c9c27945ed44 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -4230,6 +4230,10 @@ static int kvm_faultin_pfn(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault)
return RET_PF_EMULATE;
}

+ if (kvm_gfn_shared_mask(vcpu->kvm) &&
+ (kvm_mem_is_private(vcpu->kvm, fault->gfn) != fault->is_private))
+ return RET_PF_RETRY;
+
async = false;
fault->pfn = __gfn_to_pfn_memslot(slot, fault->gfn, false, &async,
fault->write, &fault->map_writable,
--
2.25.1
\
 
 \ /
  Last update: 2022-08-08 00:06    [W:0.748 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site