[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c8cd9508-7516-0891-f507-4b869d7e4322@linux.alibaba.com>
Date: Fri, 3 Sep 2021 08:44:53 +0800
From: Lai Jiangshan <laijs@...ux.alibaba.com>
To: Sean Christopherson <seanjc@...gle.com>,
Lai Jiangshan <jiangshanlai@...il.com>
Cc: linux-kernel@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
Marcelo Tosatti <mtosatti@...hat.com>,
Avi Kivity <avi@...hat.com>, kvm@...r.kernel.org
Subject: Re: [PATCH 2/7] KVM: X86: Synchronize the shadow pagetable before
link it
On 2021/9/3 07:54, Sean Christopherson wrote:
>
> trace_get_page:
> diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h
> index 50ade6450ace..5b13918a55c2 100644
> --- a/arch/x86/kvm/mmu/paging_tmpl.h
> +++ b/arch/x86/kvm/mmu/paging_tmpl.h
> @@ -704,6 +704,10 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault,
> access = gw->pt_access[it.level - 2];
> sp = kvm_mmu_get_page(vcpu, table_gfn, fault->addr,
> it.level-1, false, access);
> + if (sp->unsync_children) {
> + kvm_make_all_cpus_request(KVM_REQ_MMU_SYNC, vcpu);
> + return RET_PF_RETRY;
Making KVM_REQ_MMU_SYNC be able remotely is good idea.
But if the sp is not linked, the @sp might not be synced even we
tried many times. So we should continue to link it.
But if we continue to link it, KVM_REQ_MMU_SYNC should be extended to
sync all roots (current root and prev_roots). And maybe add a
KVM_REQ_MMU_SYNC_CURRENT for current root syncing.
It is not going to be a simple. I have a new way to sync pages
and also fix the problem, but that include several non-fix patches.
We need to fix this problem in the simplest way. In my patch
mmu_sync_children() has a @root argument. I think we can disallow
releasing the lock when @root is false. Is it OK?
> + }
> }
>
> /*
> --
>
Powered by blists - more mailing lists