Re: [PATCH 3/5] x86/virt/tdx: Unbind global metadata read with 'struct tdx_tdmr_sysinfo'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2024-03-02 at 00:20 +1300, Kai Huang wrote:
> +#define TD_SYSINFO_MAP_TDMR_INFO(_field_id, _member)   \
> +       TD_SYSINFO_MAP(_field_id, struct tdx_tdmr_sysinfo, _member)
>  
>  static int get_tdx_tdmr_sysinfo(struct tdx_tdmr_sysinfo *tdmr_sysinfo)
>  {
>         /* Map TD_SYSINFO fields into 'struct tdx_tdmr_sysinfo': */
>         const struct field_mapping fields[] = {
> -               TD_SYSINFO_MAP(MAX_TDMRS,             max_tdmrs),
> -               TD_SYSINFO_MAP(MAX_RESERVED_PER_TDMR, max_reserved_per_tdmr),
> -               TD_SYSINFO_MAP(PAMT_4K_ENTRY_SIZE,   
> pamt_entry_size[TDX_PS_4K]),
> -               TD_SYSINFO_MAP(PAMT_2M_ENTRY_SIZE,   
> pamt_entry_size[TDX_PS_2M]),
> -               TD_SYSINFO_MAP(PAMT_1G_ENTRY_SIZE,   
> pamt_entry_size[TDX_PS_1G]),
> +               TD_SYSINFO_MAP_TDMR_INFO(MAX_TDMRS,             max_tdmrs),
> +               TD_SYSINFO_MAP_TDMR_INFO(MAX_RESERVED_PER_TDMR,
> max_reserved_per_tdmr),
> +               TD_SYSINFO_MAP_TDMR_INFO(PAMT_4K_ENTRY_SIZE,   
> pamt_entry_size[TDX_PS_4K]),
> +               TD_SYSINFO_MAP_TDMR_INFO(PAMT_2M_ENTRY_SIZE,   
> pamt_entry_size[TDX_PS_2M]),
> +               TD_SYSINFO_MAP_TDMR_INFO(PAMT_1G_ENTRY_SIZE,   
> pamt_entry_size[TDX_PS_1G]),

The creation of TD_SYSINFO_MAP_TDMR_INFO part is not strictly needed, but makes
sense in the context of the signature change in read_sys_metadata_field16(). It
might be worth justifying it in the log.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux