cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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