Blame SOURCES/kvm-hw-arm-virt-Register-iommu-as-a-class-property.patch

495e37
From 545076d67ef27203e08538123d8bc3798caf9505 Mon Sep 17 00:00:00 2001
495e37
From: Eric Auger <eric.auger@redhat.com>
495e37
Date: Mon, 20 Dec 2021 15:50:44 +0100
495e37
Subject: [PATCH 1/6] hw/arm/virt: Register "iommu" as a class property
495e37
495e37
RH-Author: Eric Auger <eric.auger@redhat.com>
495e37
RH-MergeRequest: 57: hw/arm/virt: Add 9.0 machine type and remove 8.5 one
495e37
RH-Commit: [1/6] 2b6a22ebddd2da7505961ff4ffe90424f7489300 (eauger1/centos-qemu-kvm)
495e37
RH-Bugzilla: 2031044
495e37
RH-Acked-by: Gavin Shan <gshan@redhat.com>
495e37
RH-Acked-by: Andrew Jones <drjones@redhat.com>
495e37
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
495e37
495e37
branch: c9s
495e37
Brew: 42213566
495e37
Upstream: no
495e37
495e37
Register the "iommu" option as a class property. This mirrors what
495e37
was done in upstream commit b91def7b ("arm/virt: Register
495e37
most properties as class properties").
495e37
495e37
While we are at it we also move the "x-oem-id" and "x-oem-table-id"
495e37
registrations at the very end of the rhel_machine_class_init()
495e37
function.  This makes our life easier when comparing with upstream.
495e37
495e37
Signed-off-by: Eric Auger <eric.auger@redhat.com>
495e37
---
495e37
 hw/arm/virt.c | 23 ++++++++++++-----------
495e37
 1 file changed, 12 insertions(+), 11 deletions(-)
495e37
495e37
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
495e37
index 6ba9a2c2e1..7e227b1fa4 100644
495e37
--- a/hw/arm/virt.c
495e37
+++ b/hw/arm/virt.c
495e37
@@ -3131,6 +3131,18 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
495e37
                                           "Set GIC version. "
495e37
                                           "Valid values are 2, 3, host and max");
495e37
 
495e37
+    object_class_property_add_str(oc, "iommu", virt_get_iommu, virt_set_iommu);
495e37
+    object_class_property_set_description(oc, "iommu",
495e37
+                                          "Set the IOMMU type. "
495e37
+                                          "Valid values are none and smmuv3");
495e37
+
495e37
+    object_class_property_add_bool(oc, "default_bus_bypass_iommu",
495e37
+                                   virt_get_default_bus_bypass_iommu,
495e37
+                                   virt_set_default_bus_bypass_iommu);
495e37
+    object_class_property_set_description(oc, "default_bus_bypass_iommu",
495e37
+                                          "Set on/off to enable/disable "
495e37
+                                          "bypass_iommu for default root bus");
495e37
+
495e37
     object_class_property_add_str(oc, "x-oem-id",
495e37
                                   virt_get_oem_id,
495e37
                                   virt_set_oem_id);
495e37
@@ -3146,13 +3158,6 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
495e37
                                           "Override the default value of field OEM Table ID "
495e37
                                           "in ACPI table header."
495e37
                                           "The string may be up to 8 bytes in size");
495e37
-    object_class_property_add_bool(oc, "default_bus_bypass_iommu",
495e37
-                                   virt_get_default_bus_bypass_iommu,
495e37
-                                   virt_set_default_bus_bypass_iommu);
495e37
-    object_class_property_set_description(oc, "default_bus_bypass_iommu",
495e37
-                                          "Set on/off to enable/disable "
495e37
-                                          "bypass_iommu for default root bus");
495e37
-
495e37
 }
495e37
 
495e37
 static void rhel_virt_instance_init(Object *obj)
495e37
@@ -3186,10 +3191,6 @@ static void rhel_virt_instance_init(Object *obj)
495e37
 
495e37
     /* Default disallows iommu instantiation */
495e37
     vms->iommu = VIRT_IOMMU_NONE;
495e37
-    object_property_add_str(obj, "iommu", virt_get_iommu, virt_set_iommu);
495e37
-    object_property_set_description(obj, "iommu",
495e37
-                                    "Set the IOMMU type. "
495e37
-                                    "Valid values are none and smmuv3");
495e37
 
495e37
     /* Default disallows RAS instantiation and is non-configurable for RHEL */
495e37
     vms->ras = false;
495e37
-- 
495e37
2.27.0
495e37