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

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