[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230717171238.GA25699@ls.amr.corp.intel.com>
Date: Mon, 17 Jul 2023 10:12:38 -0700
From: Isaku Yamahata <isaku.yamahata@...il.com>
To: "Wen, Qian" <qian.wen@...el.com>
Cc: isaku.yamahata@...el.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, isaku.yamahata@...il.com,
Paolo Bonzini <pbonzini@...hat.com>, erdemaktas@...gle.com,
Sean Christopherson <seanjc@...gle.com>,
Sagi Shahar <sagis@...gle.com>,
David Matlack <dmatlack@...gle.com>,
Kai Huang <kai.huang@...el.com>,
Zhi Wang <zhi.wang.linux@...il.com>, chen.bo@...el.com
Subject: Re: [PATCH v14 072/113] KVM: TDX: handle vcpu migration over logical
processor
On Wed, Jul 12, 2023 at 02:08:15PM +0800,
"Wen, Qian" <qian.wen@...el.com> wrote:
> On 5/29/2023 12:19 PM, isaku.yamahata@...el.com wrote:
> > From: Isaku Yamahata <isaku.yamahata@...el.com>
> >
> > For vcpu migration, in the case of VMX, VMCS is flushed on the source pcpu,
> > and load it on the target pcpu. There are corresponding TDX SEAMCALL APIs,
> > call them on vcpu migration. The logic is mostly same as VMX except the
> > TDX SEAMCALLs are used.
> >
> > When shutting down the machine, (VMX or TDX) vcpus needs to be shutdown on
> > each pcpu. Do the similar for TDX with TDX SEAMCALL APIs.
> >
> > Signed-off-by: Isaku Yamahata <isaku.yamahata@...el.com>
> > ---
> > arch/x86/kvm/vmx/main.c | 32 ++++++-
> > arch/x86/kvm/vmx/tdx.c | 168 +++++++++++++++++++++++++++++++++++++
> > arch/x86/kvm/vmx/tdx.h | 2 +
> > arch/x86/kvm/vmx/x86_ops.h | 4 +
> > 4 files changed, 203 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c
> > index 17fb1515e56a..29ebd171dbe3 100644
>
> ...
>
> > @@ -455,6 +606,19 @@ void tdx_vcpu_free(struct kvm_vcpu *vcpu)
> > return;
> > }
> >
> > + /*
> > + * kvm_free_vcpus()
> > + * -> kvm_unload_vcpu_mmu()
> > + *
> > + * does vcpu_load() for every vcpu after they already disassociated
> > + * from the per cpu list when tdx_vm_teardown(). So we need to
> > + * disassociate them again, otherwise the freed vcpu data will be
> > + * accessed when do list_{del,add}() on associated_tdvcpus list
> > + * later.
> > + */
>
> Nit: kvm_free_vcpus() and tdx_vm_teardown() are typos? I don't find these functions.
kvm_free_vcpus() => kvm_destroy_vcpus()
tdx_vm_teardown() => tdx_mmu_release_hkid()
Will fix the comment.
--
Isaku Yamahata <isaku.yamahata@...il.com>
Powered by blists - more mailing lists