Re: [PATCHv4 05/30] x86/tdx: Extend the confidential computing API to support TDX guests
From: Dave Hansen
Date: Thu Feb 24 2022 - 19:51:45 EST
On 2/24/22 15:54, Kirill A. Shutemov wrote:
>
>> Second, why have the global 'td_info' instead of just declaring it on
>> the stack. It is only used within a single function. Having it on the
>> stack is *REALLY* nice because the code ends up looking like:
>>
>> struct foo foo;
>> get_info(&foo);
>> cc_set_bar(foo.bar);
>>
>> The dependencies and scope are just stupidly obvious if you do that.
> Okay, I will rework it with plain gpa_width on stack and get_info(&gpa_width);
> Attributes will be needed after core enabling, so I will drop it from
> here.
I don't mind the 'struct tdx_info' if there's going to be more stuff in
it soon-ish. Having a single member is fine for now. Just make it
clear that the seamcall returns a bunch of stuff and only a subset of it
is used right now.