lkml.org 
[lkml]   [2022]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv4 05/30] x86/tdx: Extend the confidential computing API to support TDX guests
On Thu, Feb 24, 2022 at 09:54:16AM -0800, Dave Hansen wrote:
>
> This left me wondering two things. First, why this bothers storing
> 'gpa_width' when it's only used to generate a mask? Why not just store
> the mask in the structure?

It was needed when tdx_shared_mask() was a thing. It takes a pair of
fresh eyes to break the inertia.

> 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.

--
Kirill A. Shutemov

\
 
 \ /
  Last update: 2022-09-17 16:15    [W:1.718 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site