Re: [RFC PATCH 05/20] x86/virt/tdx: Export tdx module attributes via sysfs
From: Huang, Kai
Date: Mon Jun 02 2025 - 19:50:18 EST
>
> Note changes to tdx_global_metadata.{hc} are auto-generated by following
> the instructions detailed in [1], after modifying "version" to "versions"
> in the TDX_STRUCT of tdx.py to accurately reflect that it is a collection
> of versions.
>
[...]
> +static ssize_t version_show(struct device *dev, struct device_attribute *attr,
> + char *buf)
> +{
> + const struct tdx_sys_info_versions *v = &tdx_sysinfo.versions;
> +
> + return sysfs_emit(buf, "%u.%u.%u\n", v->major_version,
> + v->minor_version,
> + v->update_version);
> +}
> +
> +static DEVICE_ATTR_RO(version);
> +
Then for this attribute, I think it is better to name it 'versions' as well?