[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCxOB5YEpCkUyHU0@yzhao56-desk.sh.intel.com>
Date: Tue, 20 May 2025 17:40:23 +0800
From: Yan Zhao <yan.y.zhao@...el.com>
To: Binbin Wu <binbin.wu@...ux.intel.com>
CC: <pbonzini@...hat.com>, <seanjc@...gle.com>,
<linux-kernel@...r.kernel.org>, <kvm@...r.kernel.org>, <x86@...nel.org>,
<rick.p.edgecombe@...el.com>, <dave.hansen@...el.com>,
<kirill.shutemov@...el.com>, <tabba@...gle.com>, <ackerleytng@...gle.com>,
<quic_eberman@...cinc.com>, <michael.roth@....com>, <david@...hat.com>,
<vannapurve@...gle.com>, <vbabka@...e.cz>, <jroedel@...e.de>,
<thomas.lendacky@....com>, <pgonda@...gle.com>, <zhiquan1.li@...el.com>,
<fan.du@...el.com>, <jun.miao@...el.com>, <ira.weiny@...el.com>,
<isaku.yamahata@...el.com>, <xiaoyao.li@...el.com>, <chao.p.peng@...el.com>
Subject: Re: [RFC PATCH 15/21] KVM: TDX: Support huge page splitting with
exclusive kvm->mmu_lock
On Tue, May 20, 2025 at 02:18:12PM +0800, Binbin Wu wrote:
>
>
> On 4/24/2025 11:08 AM, Yan Zhao wrote:
> [...]
> > +
> > +int tdx_sept_split_private_spt(struct kvm *kvm, gfn_t gfn, enum pg_level level,
> > + void *private_spt)
> > +{
> > + struct page *page = virt_to_page(private_spt);
> > + int ret;
> > +
> > + if (KVM_BUG_ON(to_kvm_tdx(kvm)->state != TD_STATE_RUNNABLE || level != PG_LEVEL_2M, kvm))
> > + return -EINVAL;
> > +
> > + ret = tdx_sept_zap_private_spte(kvm, gfn, level, page);
> > + if (ret <= 0)
> > + return ret;
> > +
> > + tdx_track(kvm);
>
> It may worth a helper for the zap and track code.
> It's the some code as what in tdx_sept_remove_private_spte().
> So that they can share the code, including the bug check for HKID and the
> comments.
Not sure if it's worthwhile.
But I'm open to it if others also agree.
>
> > +
> > + return tdx_spte_demote_private_spte(kvm, gfn, level, page);
> > +}
> > +
> >
> [...]
Powered by blists - more mailing lists