cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From 4098f7b5aea8871a655bab43d5114d067662e6c5 Mon Sep 17 00:00:00 2001
From: Eric Auger <eric.auger@redhat.com>
Date: Wed, 5 Jan 2022 16:17:10 +0100
Subject: [PATCH 6/6] hw/arm/virt: Check no_tcg_its and minor style changes

RH-Author: Eric Auger <eric.auger@redhat.com>
RH-MergeRequest: 57: hw/arm/virt: Add 9.0 machine type and remove 8.5 one
RH-Commit: [6/6] 4480d569463fd3f637404539d3bd06b59cafbc88 (eauger1/centos-qemu-kvm)
RH-Bugzilla: 2031044
RH-Acked-by: Gavin Shan <gshan@redhat.com>
RH-Acked-by: Andrew Jones <drjones@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>

branch: c9s
Brew: 42213566
Upstream: no

Truly allow TCG ITS instantiation according to the no_tcg_its
class flag. Otherwise it is always set to false.

We also take benefit of this patch to do some minor non
functional style changes to be closer to the upstream code.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
 hw/arm/virt.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index d537706a86..0e691cbe81 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -3163,6 +3163,7 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
                                           "in ACPI table header."
                                           "The string may be up to 6 bytes in size");
 
+
     object_class_property_add_str(oc, "x-oem-table-id",
                                   virt_get_oem_table_id,
                                   virt_set_oem_table_id);
@@ -3170,6 +3171,7 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
                                           "Override the default value of field OEM Table ID "
                                           "in ACPI table header."
                                           "The string may be up to 8 bytes in size");
+
 }
 
 static void rhel_virt_instance_init(Object *obj)
@@ -3194,26 +3196,32 @@ static void rhel_virt_instance_init(Object *obj)
     } else {
         /* Default allows ITS instantiation */
         vms->its = true;
+
+        if (vmc->no_tcg_its) {
+            vms->tcg_its = false;
+        } else {
+            vms->tcg_its = true;
+        }
     }
 
     /* Default disallows iommu instantiation */
     vms->iommu = VIRT_IOMMU_NONE;
 
+    /* The default root bus is attached to iommu by default */
+    vms->default_bus_bypass_iommu = false;
+
     /* Default disallows RAS instantiation and is non-configurable for RHEL */
     vms->ras = false;
 
     /* MTE is disabled by default and non-configurable for RHEL */
     vms->mte = false;
 
-    /* The default root bus is attached to iommu by default */
-    vms->default_bus_bypass_iommu = false;
-
     vms->irqmap = a15irqmap;
 
     virt_flash_create(vms);
+
     vms->oem_id = g_strndup(ACPI_BUILD_APPNAME6, 6);
     vms->oem_table_id = g_strndup(ACPI_BUILD_APPNAME8, 8);
-
 }
 
 static const TypeInfo rhel_machine_info = {
-- 
2.27.0