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