thebeanogamer / rpms / qemu-kvm

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