[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <328822c580d57d79403513f38a83c50649159ec4.camel@intel.com>
Date: Tue, 30 Sep 2025 18:11:14 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "Zhao, Yan Y" <yan.y.zhao@...el.com>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "linux-coco@...ts.linux.dev"
<linux-coco@...ts.linux.dev>, "Huang, Kai" <kai.huang@...el.com>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"seanjc@...gle.com" <seanjc@...gle.com>, "mingo@...hat.com"
<mingo@...hat.com>, "kas@...nel.org" <kas@...nel.org>, "tglx@...utronix.de"
<tglx@...utronix.de>, "Yamahata, Isaku" <isaku.yamahata@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"pbonzini@...hat.com" <pbonzini@...hat.com>, "Annapurve, Vishal"
<vannapurve@...gle.com>, "Gao, Chao" <chao.gao@...el.com>, "bp@...en8.de"
<bp@...en8.de>, "x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v3 13/16] KVM: TDX: Handle PAMT allocation in fault path
On Tue, 2025-09-30 at 09:09 +0800, Yan Zhao wrote:
> On Thu, Sep 18, 2025 at 04:22:21PM -0700, Rick Edgecombe wrote:
> > @@ -862,6 +863,9 @@ void tdx_vcpu_free(struct kvm_vcpu *vcpu)
> > tdx->vp.tdvpr_page = 0;
> > }
> >
> > + while ((page = get_tdx_prealloc_page(&tdx->prealloc)))
> > + __free_page(page);
> > +
> > tdx->state = VCPU_TD_STATE_UNINITIALIZED;
> > }
> tdx_vcpu_free() may be invoked even if the vcpu ioctl KVM_TDX_INIT_VCPU was
> never called.
>
> > @@ -2966,6 +2999,8 @@ static int tdx_td_vcpu_init(struct kvm_vcpu *vcpu, u64 vcpu_rcx)
> > int ret, i;
> > u64 err;
> >
> > + INIT_LIST_HEAD(&tdx->prealloc.page_list);
> So, need to move this list init to tdx_vcpu_create().
Oh, nice catch. Thanks!
Powered by blists - more mailing lists