[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8ccad4542503eedfcd09eca990ab5bed77dab154.camel@intel.com>
Date: Fri, 24 Oct 2025 07:21:05 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "chenhuacai@...nel.org" <chenhuacai@...nel.org>, "frankja@...ux.ibm.com"
<frankja@...ux.ibm.com>, "maz@...nel.org" <maz@...nel.org>,
"borntraeger@...ux.ibm.com" <borntraeger@...ux.ibm.com>, "pjw@...nel.org"
<pjw@...nel.org>, "aou@...s.berkeley.edu" <aou@...s.berkeley.edu>,
"kas@...nel.org" <kas@...nel.org>, "seanjc@...gle.com" <seanjc@...gle.com>,
"maobibo@...ngson.cn" <maobibo@...ngson.cn>, "pbonzini@...hat.com"
<pbonzini@...hat.com>, "maddy@...ux.ibm.com" <maddy@...ux.ibm.com>,
"palmer@...belt.com" <palmer@...belt.com>, "imbrenda@...ux.ibm.com"
<imbrenda@...ux.ibm.com>, "zhaotianrui@...ngson.cn"
<zhaotianrui@...ngson.cn>, "anup@...infault.org" <anup@...infault.org>,
"oliver.upton@...ux.dev" <oliver.upton@...ux.dev>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "linux-coco@...ts.linux.dev"
<linux-coco@...ts.linux.dev>, "Zhao, Yan Y" <yan.y.zhao@...el.com>,
"michael.roth@....com" <michael.roth@....com>, "binbin.wu@...ux.intel.com"
<binbin.wu@...ux.intel.com>, "Weiny, Ira" <ira.weiny@...el.com>,
"loongarch@...ts.linux.dev" <loongarch@...ts.linux.dev>,
"ackerleytng@...gle.com" <ackerleytng@...gle.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvmarm@...ts.linux.dev" <kvmarm@...ts.linux.dev>,
"kvm-riscv@...ts.infradead.org" <kvm-riscv@...ts.infradead.org>, "Annapurve,
Vishal" <vannapurve@...gle.com>, "linuxppc-dev@...ts.ozlabs.org"
<linuxppc-dev@...ts.ozlabs.org>, "Edgecombe, Rick P"
<rick.p.edgecombe@...el.com>, "linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "linux-mips@...r.kernel.org"
<linux-mips@...r.kernel.org>, "linux-riscv@...ts.infradead.org"
<linux-riscv@...ts.infradead.org>, "x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v3 13/25] KVM: TDX: Fold tdx_mem_page_record_premap_cnt()
into its sole caller
> > + /*
> > + * If the TD isn't finalized/runnable, then userspace is initializing
> > + * the VM image via KVM_TDX_INIT_MEM_REGION. Increment the number of
> > + * pages that need to be mapped and initialized via TDH.MEM.PAGE.ADD.
> > + * KVM_TDX_FINALIZE_VM checks the counter to ensure all mapped pages
> > + * have been added to the image, to prevent running the TD with a
> > + * valid mapping in the mirror EPT, but not in the S-EPT.
> > + */
> > + if (unlikely(kvm_tdx->state != TD_STATE_RUNNABLE)) {
> > + if (KVM_BUG_ON(kvm->arch.pre_fault_allowed, kvm))
> > + return -EIO;
> > +
> > + atomic64_inc(&kvm_tdx->nr_premapped);
>
> Nit: the comment
>
> /* nr_premapped will be decreased when tdh_mem_page_add() is called. */
>
> is lost. I think we can somehow embed it to the big comment above?
Please ignore this. I saw the whole 'nr_premapped' eventually got removed
later in this series so don't bother :-)
Powered by blists - more mailing lists