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

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