Re: [PATCH v2 16/25] KVM: TDX: Get system-wide info about TDX module on initialization
From: Tony Lindgren
Date: Thu Oct 31 2024 - 05:38:21 EST
On Thu, Oct 31, 2024 at 05:23:57PM +0800, Xiaoyao Li wrote:
> here it is to initialize the configurable CPUID bits that get reported to
> userspace. Though TDX module doesn't allow them to be set in TD_PARAM for
> KVM_TDX_INIT_VM, they get set to 0xff because KVM reuse these bits
> EBX[23:16] as the interface for userspace to configure GPAW of TD guest
> (implemented in setup_tdparams_eptp_controls() in patch 19). That's why they
> need to be set as all-1 to allow userspace to configure.
>
> And the comment above it is wrong and vague. we need to change it to
> something like
>
> /*
> * Though TDX module doesn't allow the configuration of guest
> * phys addr bits (EBX[23:16]), KVM uses it as the interface for
> * userspace to configure the GPAW. So need to report these bits
> * as configurable to userspace.
> */
That sounds good to me.
Hmm so care to check if we can also just leave out another "old module"
comment in tdx_read_cpuid()?
Regards,
Tony