lkml.org 
[lkml]   [2022]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 09/21] x86/virt/tdx: Get information about TDX module and convertible memory
From
Date
On Fri, 2022-04-29 at 10:47 -0700, Dave Hansen wrote:
> On 4/28/22 16:14, Kai Huang wrote:
> > On Thu, 2022-04-28 at 07:06 -0700, Dave Hansen wrote:
> > > On 4/27/22 17:15, Kai Huang wrote:
> > > > > Couldn't we get rid of that comment if you did something like:
> > > > >
> > > > > ret = tdx_get_sysinfo(&tdx_cmr_array, &tdx_sysinfo);
> > > >
> > > > Yes will do.
> > > >
> > > > > and preferably make the variables function-local.
> > > >
> > > > 'tdx_sysinfo' will be used by KVM too.
> > >
> > > In other words, it's not a part of this series so I can't review whether
> > > this statement is correct or whether there's a better way to hand this
> > > information over to KVM.
> > >
> > > This (minor) nugget influencing the design also isn't even commented or
> > > addressed in the changelog.
> >
> > TDSYSINFO_STRUCT is 1024B and CMR array is 512B, so I don't think it should be
> > in the stack. I can change to use dynamic allocation at the beginning and free
> > it at the end of the function. KVM support patches can change it to static
> > variable in the file.
>
> 2k of stack is big, but it isn't a deal breaker for something that's not
> nested anywhere and that's only called once in a pretty controlled
> setting and not in interrupt context. I wouldn't cry about it.

OK. I'll change to use function local variables for both of them.

--
Thanks,
-Kai


\
 
 \ /
  Last update: 2022-05-02 07:04    [W:2.241 / U:1.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site