On 28/08/2024 1:10 am, Adrian Hunter wrote:
On 27/08/24 10:14, Kai Huang wrote:
"to reflect the spec better" is a bit vague. How about:
x86/virt/tdx: Rename 'struct tdx_tdmr_sysinfo' to 'struct tdx_sys_info_tdmr'
Rename 'struct tdx_tdmr_sysinfo' to 'struct tdx_sys_info_tdmr' to
prepare for adding similar structures that will all be prefixed by
'tdx_sys_info_'.
The TDX module provides a set of "global metadata fields". They report
Since it is a name of something, could capitalize "Global Metadata Fields"
things like TDX module version, supported features, and fields related
to create/run TDX guests and so on.
TDX organizes those metadata fields by "Class"es based on the meaning of
by "Class"es -> into "Classes"
those fields. E.g., for now the kernel only reads "TD Memory Region"
(TDMR) related fields for module initialization. Those fields are
defined under class "TDMR Info".
There are both immediate needs to read more metadata fields for module
initialization and near-future needs for other kernel components like
KVM to run TDX guests. To meet all those requirements, the idea is the
TDX host core-kernel to provide a centralized, canonical, and read-only
structure for the global metadata that comes out from the TDX module for
all kernel components to use.
More specifically, the target is to end up with something like:
struct tdx_sys_info {
struct tdx_sys_info_classA a;
struct tdx_sys_info_classB b;
...
};
Currently the kernel organizes all fields under "TDMR Info" class in
'struct tdx_tdmr_sysinfo'. To prepare for the above target, rename the
structure to 'struct tdx_sys_info_tdmr' to follow the class name better.
No functional change intended.
Signed-off-by: Kai Huang <kai.huang@xxxxxxxxx>
Reviewed-by: Adrian Hunter <adrian.hunter@xxxxxxxxx
Thanks for the review.
All comments above look good to me. Will do.