thebeanogamer / rpms / qemu-kvm

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