[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aHEeBcn65JocfU8i@google.com>
Date: Fri, 11 Jul 2025 07:21:57 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Ira Weiny <ira.weiny@...el.com>
Cc: Michael Roth <michael.roth@....com>, Yan Zhao <yan.y.zhao@...el.com>, pbonzini@...hat.com,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org, rick.p.edgecombe@...el.com,
kai.huang@...el.com, adrian.hunter@...el.com, reinette.chatre@...el.com,
xiaoyao.li@...el.com, tony.lindgren@...el.com, binbin.wu@...ux.intel.com,
dmatlack@...gle.com, isaku.yamahata@...el.com, vannapurve@...gle.com,
david@...hat.com, ackerleytng@...gle.com, tabba@...gle.com,
chao.p.peng@...el.com
Subject: Re: [RFC PATCH] KVM: TDX: Decouple TDX init mem region from kvm_gmem_populate()
On Thu, Jul 10, 2025, Ira Weiny wrote:
> Sean Christopherson wrote:
> > On Wed, Jul 09, 2025, Michael Roth wrote:
> > > I don't think this hurts anything in the current code, and I don't
> > > personally see any issue with open-coding the population path if it doesn't
> > > fit TDX very well, but there was some effort put into making
> > > kvm_gmem_populate() usable for both TDX/SNP, and if the real issue isn't the
> > > design of the interface itself, but instead just some inflexibility on the
> > > KVM MMU mapping side, then it seems more robust to address the latter if
> > > possible.
> > >
> > > Would something like the below be reasonable?
> >
> > No, polluting the page fault paths is a non-starter for me. TDX really shouldn't
> > be synthesizing a page fault when it has the PFN in hand. And some of the behavior
> > that's desirable for pre-faults looks flat out wrong for TDX. E.g. returning '0'
> > on RET_PF_WRITE_PROTECTED and RET_PF_SPURIOUS (though maybe spurious is fine?).
> >
> > I would much rather special case this path, because it absolutely is a special
> > snowflake. This even eliminates several exports of low level helpers that frankly
> > have no business being used by TDX, e.g. kvm_mmu_reload().
>
> I'm not quite following what the code below is for. Is it an addition to
> Yan's patch to eliminate the use of kvm_gmem_populate() from TDX?
> I don't see how this code helps with the lock invalidation so I think we
> still need Yan's patch, correct?
Dunno, I haven't read through Yan's patch, I was just reacting to Mike's proposal.
Powered by blists - more mailing lists