[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH rfcv2 11/18] intel_iommu: Add set/unset_iommu_device callback
From: |
Duan, Zhenzhong |
Subject: |
RE: [PATCH rfcv2 11/18] intel_iommu: Add set/unset_iommu_device callback |
Date: |
Mon, 26 Feb 2024 06:52:28 +0000 |
>-----Original Message-----
>From: Eric Auger <eric.auger@redhat.com>
>Subject: Re: [PATCH rfcv2 11/18] intel_iommu: Add
>set/unset_iommu_device callback
>
>
>
>On 2/1/24 08:28, Zhenzhong Duan wrote:
>> From: Yi Liu <yi.l.liu@intel.com>
>>
>> This adds set/unset_iommu_device() implementation in Intel vIOMMU.
>> In set call, a pointer to host IOMMU device info is stored in hash
>> table indexed by PCI BDF.
>>
>> Signed-off-by: Yi Liu <yi.l.liu@intel.com>
>> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
>> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
>> ---
>> hw/i386/intel_iommu_internal.h | 14 +++++++
>> include/hw/i386/intel_iommu.h | 2 +
>> hw/i386/intel_iommu.c | 74
>++++++++++++++++++++++++++++++++++
>> 3 files changed, 90 insertions(+)
>>
>> diff --git a/hw/i386/intel_iommu_internal.h
>b/hw/i386/intel_iommu_internal.h
>> index f8cf99bddf..3301f54b35 100644
>> --- a/hw/i386/intel_iommu_internal.h
>> +++ b/hw/i386/intel_iommu_internal.h
>> @@ -28,6 +28,8 @@
>> #ifndef HW_I386_INTEL_IOMMU_INTERNAL_H
>> #define HW_I386_INTEL_IOMMU_INTERNAL_H
>> #include "hw/i386/intel_iommu.h"
>> +#include "sysemu/host_iommu_device.h"
>> +#include "hw/vfio/vfio-common.h"
>>
>> /*
>> * Intel IOMMU register specification
>> @@ -537,4 +539,16 @@ typedef struct VTDRootEntry VTDRootEntry;
>> #define VTD_SL_IGN_COM 0xbff0000000000000ULL
>> #define VTD_SL_TM (1ULL << 62)
>>
>> +
>> +typedef struct VTDHostIOMMUDevice {
>> + IntelIOMMUState *iommu_state;
>> + PCIBus *bus;
>> + uint8_t devfn;
>> + union {
>> + HostIOMMUDevice *dev;
>> + IOMMULegacyDevice *ldev;
>> + IOMMUFDDevice *idev;
>> + };
>again this looks really weird to me. Why don't we simply have
>
>HostIOMMUDevice *dev;
Sure, will do.
Thanks
Zhenzhong
- Re: [PATCH rfcv2 07/18] vfio/container: Implement host_iommu_device_init callback in legacy mode, (continued)
- [PATCH rfcv2 08/18] vfio/iommufd: Implement host_iommu_device_init callback in iommufd mode, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 09/18] vfio/pci: Initialize host iommu device instance after attachment, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 10/18] hw/pci: Introduce pci_device_set/unset_iommu_device(), Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 12/18] vfio: Initialize host IOMMU device and pass to vIOMMU, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 11/18] intel_iommu: Add set/unset_iommu_device callback, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 13/18] intel_iommu: Extract out vtd_cap_init to initialize cap/ecap, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 14/18] intel_iommu: Add a framework to check and sync host IOMMU cap/ecap, Zhenzhong Duan, 2024/02/01
- [PATCH rfcv2 18/18] intel_iommu: Block migration if cap is updated, Zhenzhong Duan, 2024/02/01