a83cc2
From 170a9c7dc044a0094b48c658e0d57c97c4b854e0 Mon Sep 17 00:00:00 2001
a83cc2
From: Eric Auger <eric.auger@redhat.com>
a83cc2
Date: Wed, 30 Jun 2021 13:38:03 +0200
a83cc2
Subject: [PATCH 03/13] arm/virt: Enable ARM RAS support
a83cc2
a83cc2
RH-Author: Eric Auger <eric.auger@redhat.com>
a83cc2
RH-MergeRequest: 19: arm/virt: Support RAS
a83cc2
RH-Commit: [3/3] 1572368bb0f47463a1f6ffa3f5baa97242440c98 (eauger1/centos-qemu-kvm)
a83cc2
RH-Bugzilla: 1838608
a83cc2
RH-Acked-by: Gavin Shan <gshan@redhat.com>
a83cc2
RH-Acked-by: Andrew Jones <drjones@redhat.com>
a83cc2
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
a83cc2
a83cc2
We want to support ARM RAS (Reliability, Availability & Serviceability).
a83cc2
So let's register the RAS property as a class property. It is
a83cc2
unset by default.
a83cc2
a83cc2
Signed-off-by: Eric Auger <eric.auger@redhat.com>
a83cc2
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
---
a83cc2
 hw/arm/virt.c | 10 ++++++++--
a83cc2
 1 file changed, 8 insertions(+), 2 deletions(-)
a83cc2
a83cc2
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
a83cc2
index fe1111d527..0084935ec8 100644
a83cc2
--- a/hw/arm/virt.c
a83cc2
+++ b/hw/arm/virt.c
a83cc2
@@ -2281,7 +2281,6 @@ static void virt_set_acpi(Object *obj, Visitor *v, const char *name,
a83cc2
     visit_type_OnOffAuto(v, name, &vms->acpi, errp);
a83cc2
 }
a83cc2
 
a83cc2
-#if 0 /* Disabled for Red Hat Enterprise Linux */
a83cc2
 static bool virt_get_ras(Object *obj, Error **errp)
a83cc2
 {
a83cc2
     VirtMachineState *vms = VIRT_MACHINE(obj);
a83cc2
@@ -2296,6 +2295,7 @@ static void virt_set_ras(Object *obj, bool value, Error **errp)
a83cc2
     vms->ras = value;
a83cc2
 }
a83cc2
 
a83cc2
+#if 0 /* Disabled for Red Hat Enterprise Linux */
a83cc2
 static bool virt_get_mte(Object *obj, Error **errp)
a83cc2
 {
a83cc2
     VirtMachineState *vms = VIRT_MACHINE(obj);
a83cc2
@@ -3013,6 +3013,12 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data)
a83cc2
                                           "Set the IOMMU type. "
a83cc2
                                           "Valid values are none and smmuv3");
a83cc2
 
a83cc2
+    object_class_property_add_bool(oc, "ras", virt_get_ras,
a83cc2
+                                   virt_set_ras);
a83cc2
+    object_class_property_set_description(oc, "ras",
a83cc2
+                                          "Set on/off to enable/disable reporting host memory errors "
a83cc2
+                                          "to a KVM guest using ACPI and guest external abort exceptions");
a83cc2
+
a83cc2
     object_class_property_add_bool(oc, "its", virt_get_its,
a83cc2
                                    virt_set_its);
a83cc2
     object_class_property_set_description(oc, "its",
a83cc2
@@ -3063,7 +3069,7 @@ static void rhel_virt_instance_init(Object *obj)
a83cc2
     /* Default disallows iommu instantiation */
a83cc2
     vms->iommu = VIRT_IOMMU_NONE;
a83cc2
 
a83cc2
-    /* Default disallows RAS instantiation and is non-configurable for RHEL */
a83cc2
+    /* Default disallows RAS instantiation */
a83cc2
     vms->ras = false;
a83cc2
 
a83cc2
     /* MTE is disabled by default and non-configurable for RHEL */
a83cc2
-- 
a83cc2
2.27.0
a83cc2