[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2969928a501a26c79e0b233e533a3ef5874da824.camel@intel.com>
Date: Thu, 5 Jun 2025 00:14:46 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "Gao, Chao" <chao.gao@...el.com>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "linux-coco@...ts.linux.dev"
<linux-coco@...ts.linux.dev>, "Dong, Eddie" <eddie.dong@...el.com>,
"Shutemov, Kirill" <kirill.shutemov@...el.com>, "Hansen, Dave"
<dave.hansen@...el.com>, "dave.hansen@...ux.intel.com"
<dave.hansen@...ux.intel.com>, "Reshetova, Elena"
<elena.reshetova@...el.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "mingo@...hat.com" <mingo@...hat.com>,
"seanjc@...gle.com" <seanjc@...gle.com>, "pbonzini@...hat.com"
<pbonzini@...hat.com>, "tglx@...utronix.de" <tglx@...utronix.de>, "Yamahata,
Isaku" <isaku.yamahata@...el.com>, "kirill.shutemov@...ux.intel.com"
<kirill.shutemov@...ux.intel.com>, "hpa@...or.com" <hpa@...or.com>, "Chen,
Farrah" <farrah.chen@...el.com>, "Edgecombe, Rick P"
<rick.p.edgecombe@...el.com>, "bp@...en8.de" <bp@...en8.de>, "x86@...nel.org"
<x86@...nel.org>, "Williams, Dan J" <dan.j.williams@...el.com>
Subject: Re: [RFC PATCH 02/20] x86/virt/tdx: Prepare to support P-SEAMLDR
SEAMCALLs
On Wed, 2025-06-04 at 21:14 +0800, Gao, Chao wrote:
> > Given there will be a dedicated seamldr.c, I don't quite like having
> > seamldr_prerr() in "tdx.h" and tdx.c.
> >
> > Now for all SEAMCALLs used by KVM, we have a dedicated wrapper implemented
> > in tdx.c and exported for KVM to use. I think we can move seamcall*() out
> > of <asm/tdx.h> to TDX host local since no other kernel code except the TDX
> > host core is supposed to use seamcall*().
> >
> > This also cleans up <asm/tdx.h> a little bit, which in general makes code
> > cleaner IMHO.
> >
> > E.g., how about we do below patch, and then you can do changes to support
> > P-SEAMLDR on top of it?
>
> looks good to me. I'd like to incorporate this patch into my series if
> Kirill and Dave have no objections to this cleanup. I assume
> seamldr_prerr() can be added to the new seamcall.h
>
> Thanks for this suggestion.
Seems we both think this is a good cleanup. My TDX host kexec series also
conflicts with this so I think I can send this patch out first to see how
things will go. At the meantime, yeah please carry it in your series.
>
> > diff --git a/arch/x86/virt/vmx/tdx/seamcall.h b/arch/x86/virt/vmx/tdx/seamcall.h
> > new file mode 100644
> > index 000000000000..54922f7bda3a
> > --- /dev/null
> > +++ b/arch/x86/virt/vmx/tdx/seamcall.h
> > @@ -0,0 +1,71 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +/* Copyright (C) 2025 Intel Corporation */
> > +#include <asm/tdx.h>
>
> If seamcall.h is intended to provide low-level helpers, including
> <asm/tdx.h>, which is meant to offer high-level APIs for other components
> such as KVM, seems a bit odd to me. But I suppose we can live with this.
Kinda agree, I can remove it and do:
struct tdx_module_args;
explicitly.
But we also need to include <asm/archrandom.h> etc, so I think I will just
leave it as-is until other people coming out to complain.
Powered by blists - more mailing lists