Skip to contentSkip to conversation

Categorize devices: iommu

PATCH Auger Eric 1 participant 1 message Apr 1, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20190327170518.GA16887@erokenlabserver

Auger Eric

author
#1 lore raw

Hi Ernest,

Quoted 29 lines · Ernest Esene

Set category and description for iommu devices

---
v2:
* split into separate patches

---
 hw/i386/amd_iommu.c   | 2 ++
 hw/i386/intel_iommu.c | 2 ++
 2 files changed, 4 insertions(+)
hw/i386/amd_iommu.c +2 -0
index 6eabdf9917..4a4e2c7fd4 100644
@@ -1601,6 +1601,8 @@ static void amdvi_class_init(ObjectClass *klass, void* data)
     dc_class->int_remap = amdvi_int_remap;
     /* Supported by the pc-q35-* machine types */
     dc->user_creatable = true;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    dc->desc = "AMD IOMMU (AMD-Vi) DMA Remapping device";
 }
 
 static const TypeInfo amdvi = {
hw/i386/intel_iommu.c +0 -0
index b90de6c664..4d0e60423c 100644

hw/i386/intel_iommu.c static void vtd_class_init(ObjectClass *klass, void *data) · line 3707

Quoted 6 lines
hw/i386/intel_iommu.c +2 -0
@@ -3702,6 +3702,8 @@ static void vtd_class_init(ObjectClass *klass, void *data)
     x86_class->int_remap = vtd_int_remap;
     /* Supported by the pc-q35-* machine types */
     dc->user_creatable = true;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    dc->desc = "Intel IOMMU (VT-d) DMA Remapping device";
 }

The same can be done as well for ARM IOMMU, aka SMMUv3 (hw/arm/smmuv3.c, smmuv3_class_init).

Thanks

Eric

Quoted 3 lines
hw/i386/intel_iommu.c +0 -0
 static const TypeInfo vtd_info = {