Re: [PATCH v11 02/20] x86/virt/tdx: Detect TDX during kernel boot

From: Huang, Kai
Date: Mon Jun 19 2023 - 19:58:37 EST


[...]

> > + /*
> > + * Just use the first TDX KeyID as the 'global KeyID' and
> > + * leave the rest for TDX guests.
> > + */
> > + tdx_global_keyid = tdx_keyid_start;
> > + tdx_guest_keyid_start = ++tdx_keyid_start;
> > + tdx_nr_guest_keyids = --nr_tdx_keyids;
>
> tdx_guest_keyid_start = tdx_keyid_start + 1;
> tdx_nr_guest_keyids = nr_tdx_keyids - 1;
>
> Easier to get, because the modified values are unused.

Will do.

>
> I'd probably avoid the "tdx" terminology in the local variables
> ("keid_start", "nr_keyids") to give a better hint what the global
> variables are (tdx_*), but just a personal preference.
>

Yeah in general I agree but I chose to have "tdx_*" because it allows me to
easily distinguish function local variables and static variables, especially
this file contains more than ~1500 LoC (it also makes life easier to name the
local variables). So I'd like to keep the "tdx_*".

>
> Apart from that,
>
> Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>
>

Thanks!