>-----Original Message-----
>From: Nicolin Chen <nicol...@nvidia.com>
>Subject: Re: [PATCH v2 4/4] vfio/iommufd: Save vendor specific device info
>
>On Fri, May 30, 2025 at 05:35:12PM +0800, Zhenzhong Duan wrote:
>> Some device information returned by ioctl(IOMMU_GET_HW_INFO) are vendor
>> specific. Save them as raw data in a union supporting different vendors,
>> then vendor IOMMU can query the raw data with its fixed format for
>> capability directly.
>>
>> Because IOMMU_GET_HW_INFO is only supported in linux, so declare those
>> capability related structures with CONFIG_LINUX.
>>
>> Suggested-by: Eric Auger <eric.au...@redhat.com>
>> Suggested-by: Nicolin Chen <nicol...@nvidia.com>
>> Signed-off-by: Zhenzhong Duan <zhenzhong.d...@intel.com>
>
>Reviewed-by: Nicolin Chen <nicol...@nvidia.com>
>
>I like this that we eventually moved all vendor stuff back to the
>vendor vIOMMU code.
>
>> +typedef union VendorCaps {
>> + struct iommu_hw_info_vtd vtd;
>> + struct iommu_hw_info_arm_smmuv3 smmuv3;
>> +} VendorCaps;
>
>Nit: can it be just:
>
>typedef union {
> ...
>} VendorCaps;
>
>?
Any special reason?
I didn't see anonymous union is preferred over named union in
docs/devel/style.rst
Thanks
Zhenzhong
>
>> typedef struct HostIOMMUDeviceCaps {
>> uint32_t type;
>> uint64_t hw_caps;
>> + VendorCaps vendor_caps;
>> } HostIOMMUDeviceCaps;
>
>Ditto.