[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aJLGGoleGIEwb8Ee@yilunxu-OptiPlex-7050>
Date: Wed, 6 Aug 2025 11:03:54 +0800
From: Xu Yilun <yilun.xu@...ux.intel.com>
To: dan.j.williams@...el.com
Cc: Sean Christopherson <seanjc@...gle.com>, Chao Gao <chao.gao@...el.com>,
linux-coco@...ts.linux.dev, x86@...nel.org, kvm@...r.kernel.org,
pbonzini@...hat.com, eddie.dong@...el.com,
kirill.shutemov@...el.com, dave.hansen@...el.com,
kai.huang@...el.com, isaku.yamahata@...el.com,
elena.reshetova@...el.com, rick.p.edgecombe@...el.com,
Farrah Chen <farrah.chen@...el.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 07/20] x86/virt/tdx: Expose SEAMLDR information via
sysfs
On Mon, Aug 04, 2025 at 09:02:51PM -0700, dan.j.williams@...el.com wrote:
> Sean Christopherson wrote:
> > On Mon, Aug 04, 2025, dan.j.williams@...el.com wrote:
> > > Xu Yilun wrote:
> > > > So my idea is to remove tdx_tsm device (thus disables tdx_tsm driver) on
> > > > vmxoff.
> > > >
> > > > KVM TDX core TDX TSM driver
> > > > -----------------------------------------------------
> > > > tdx_disable()
> > > > tdx_tsm dev del
> > > > driver.remove()
> > > > vmxoff()
> > > >
> > > > An alternative is to move vmxon/off management out of KVM, that requires
> > > > a lot of complex work IMHO, Chao & I both prefer not to touch it.
> >
> > Eh, it's complex, but not _that_ complex.
> >
> > > It is fine to require that vmxon/off management remain within KVM, and
> > > tie the lifetime of the device to the lifetime of the kvm_intel module*.
> >
> > Nah, let's do this right. Speaking from experience; horrible, make-your-eyes-bleed
> > experience; playing games with kvm-intel.ko to try to get and keep CPUs post-VMXON
> > will end in tears.
> >
> > And it's not just TDX-feature-of-the-day that needs VMXON to be handled outside
> > of KVM, I'd also like to do so to allow out-of-tree hypervisors to do the "right
> > thing"[*]. Not because I care deeply about out-of-tree hypervisors, but because
> > the lack of proper infrastructure for utilizing virtualization hardware irks me.
> >
> > The basic gist is to extract system-wide resources out of KVM and into a separate
> > module, so that e.g. tdx_tsm or whatever can take a dependency on _that_ module
> > and elevate refcounts as needed. All things considered, there aren't so many
> > system-wide resources that it's an insurmountable task.
> >
> > I can provide some rough patches to kickstart things. It'll probably take me a
> > few weeks to extract them from an old internal branch, and I can't promise they'll
> > compile. But they should be good enough to serve as an RFC.
> >
> > https://lore.kernel.org/all/ZwQjUSOle6sWARsr@google.com
>
> Sounds reasonable to me.
>
> Not clear on how it impacts tdx_tsm implementation. The lifetime of this
> tdx_tsm device can still be bound by tdx_enable() / tdx_cleanup(). The
I assume with VMXON outside of KVM, tdx tsm driver could actively call
tdx_bringup(), which includes VMXON, tdx_enable() and cpuhp handling.
I.e, tdx_tsm device lifetime won't have to be bound to any other
component, it could keep living until tdx_tsm module ends.
> refactor removes the need for the autoprobe hack below. It may also
> preclude async vmxoff cases by pinning? Or does pinning still not solve
not by pinning, by cpuhp handling async vmxoff won't affect seamcall
execution.
> the reasons for bouncing vmx on suspend/shutdown?
Thanks,
Yilun
Powered by blists - more mailing lists