[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <hlif565xmuj4oqdpap3boizepwg5ch3dssb67zzvy7i7smzp3n@x6hzdyc2qk4y>
Date: Wed, 15 May 2024 12:30:56 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Nikolay Borisov <nik.borisov@...e.com>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>, linux-coco@...ts.linux.dev,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCHv4 3/4] x86/tdx: Dynamically disable SEPT violations from
causing #VEs
On Tue, May 14, 2024 at 05:56:21PM +0300, Nikolay Borisov wrote:
> > diff --git a/arch/x86/coco/tdx/tdx.c b/arch/x86/coco/tdx/tdx.c
> > index 1ff571cb9177..ba37f4306f4e 100644
> > --- a/arch/x86/coco/tdx/tdx.c
> > +++ b/arch/x86/coco/tdx/tdx.c
> > @@ -77,6 +77,20 @@ static inline void tdcall(u64 fn, struct tdx_module_args *args)
> > panic("TDCALL %lld failed (Buggy TDX module!)\n", fn);
> > }
> > +/* Read TD-scoped metadata */
> > +static inline u64 tdg_vm_rd(u64 field, u64 *value)
> > +{
> > + struct tdx_module_args args = {
> > + .rdx = field,
> > + };
> > + u64 ret;
> > +
> > + ret = __tdcall_ret(TDG_VM_RD, &args);
> > + *value = args.r8;
> > +
> > + return ret;
> > +}
>
> nit: Perhaps this function can be put in the first patch and the description
> there be made more generic, something along the lines of "introduce
> functions for tdg_rd/tdg_wr" ?
A static function without an user will generate a build warning. I don't
think it is good idea.
--
Kiryl Shutsemau / Kirill A. Shutemov
Powered by blists - more mailing lists