thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-hw-arm-virt-Check-no_tcg_its-and-minor-style-changes.patch

495e37
From 4098f7b5aea8871a655bab43d5114d067662e6c5 Mon Sep 17 00:00:00 2001
495e37
From: Eric Auger <eric.auger@redhat.com>
495e37
Date: Wed, 5 Jan 2022 16:17:10 +0100
495e37
Subject: [PATCH 6/6] hw/arm/virt: Check no_tcg_its and minor style changes
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: [6/6] 4480d569463fd3f637404539d3bd06b59cafbc88 (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
Truly allow TCG ITS instantiation according to the no_tcg_its
495e37
class flag. Otherwise it is always set to false.
495e37
495e37
We also take benefit of this patch to do some minor non
495e37
functional style changes to be closer to the upstream code.
495e37
495e37
Signed-off-by: Eric Auger <eric.auger@redhat.com>
495e37
---
495e37
 hw/arm/virt.c | 16 ++++++++++++----
495e37
 1 file changed, 12 insertions(+), 4 deletions(-)
495e37
495e37
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
495e37
index d537706a86..0e691cbe81 100644
495e37
--- a/hw/arm/virt.c
495e37
+++ b/hw/arm/virt.c
495e37
@@ -3163,6 +3163,7 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
495e37
                                           "in ACPI table header."
495e37
                                           "The string may be up to 6 bytes in size");
495e37
 
495e37
+
495e37
     object_class_property_add_str(oc, "x-oem-table-id",
495e37
                                   virt_get_oem_table_id,
495e37
                                   virt_set_oem_table_id);
495e37
@@ -3170,6 +3171,7 @@ 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
+
495e37
 }
495e37
 
495e37
 static void rhel_virt_instance_init(Object *obj)
495e37
@@ -3194,26 +3196,32 @@ static void rhel_virt_instance_init(Object *obj)
495e37
     } else {
495e37
         /* Default allows ITS instantiation */
495e37
         vms->its = true;
495e37
+
495e37
+        if (vmc->no_tcg_its) {
495e37
+            vms->tcg_its = false;
495e37
+        } else {
495e37
+            vms->tcg_its = true;
495e37
+        }
495e37
     }
495e37
 
495e37
     /* Default disallows iommu instantiation */
495e37
     vms->iommu = VIRT_IOMMU_NONE;
495e37
 
495e37
+    /* The default root bus is attached to iommu by default */
495e37
+    vms->default_bus_bypass_iommu = false;
495e37
+
495e37
     /* Default disallows RAS instantiation and is non-configurable for RHEL */
495e37
     vms->ras = false;
495e37
 
495e37
     /* MTE is disabled by default and non-configurable for RHEL */
495e37
     vms->mte = false;
495e37
 
495e37
-    /* The default root bus is attached to iommu by default */
495e37
-    vms->default_bus_bypass_iommu = false;
495e37
-
495e37
     vms->irqmap = a15irqmap;
495e37
 
495e37
     virt_flash_create(vms);
495e37
+
495e37
     vms->oem_id = g_strndup(ACPI_BUILD_APPNAME6, 6);
495e37
     vms->oem_table_id = g_strndup(ACPI_BUILD_APPNAME8, 8);
495e37
-
495e37
 }
495e37
 
495e37
 static const TypeInfo rhel_machine_info = {
495e37
-- 
495e37
2.27.0
495e37