Blame SOURCES/kvm-ppc-spapr-caps-Disallow-setting-workaround-for-spapr.patch

37e7a1
From cb43b40e88fde117852a7a52506e4421d82c4fc8 Mon Sep 17 00:00:00 2001
37e7a1
From: Suraj Jitindar Singh <sursingh@redhat.com>
37e7a1
Date: Tue, 13 Mar 2018 05:21:30 +0100
37e7a1
Subject: [PATCH 08/17] ppc/spapr-caps: Disallow setting workaround for
37e7a1
 spapr-cap-ibs
37e7a1
37e7a1
RH-Author: Suraj Jitindar Singh <sursingh@redhat.com>
37e7a1
Message-id: <1520918499-27663-3-git-send-email-sursingh@redhat.com>
37e7a1
Patchwork-id: 79252
37e7a1
O-Subject: [RHEL7.5 qemu-kvm-rhev PATCH 02/11] ppc/spapr-caps: Disallow setting workaround for spapr-cap-ibs
37e7a1
Bugzilla: 1554957
37e7a1
RH-Acked-by: David Gibson <dgibson@redhat.com>
37e7a1
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
37e7a1
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
37e7a1
37e7a1
From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
37e7a1
37e7a1
The spapr-cap cap-ibs can only have values broken or fixed as there is
37e7a1
no explicit workaround required. Currently setting the value workaround
37e7a1
for this cap will hit an assert if the guest makes the hcall
37e7a1
h_get_cpu_characteristics.
37e7a1
37e7a1
Report an error when attempting to apply the setting with a more helpful
37e7a1
error message.
37e7a1
37e7a1
Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
37e7a1
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
37e7a1
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
37e7a1
(cherry picked from commit 4f5b039d2bf9bb26b6e26a3dc65da36fe970cba9)
37e7a1
37e7a1
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1548919
37e7a1
37e7a1
Signed-off-by: Suraj Jitindar Singh <sursingh@redhat.com>
37e7a1
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
37e7a1
---
37e7a1
 hw/ppc/spapr_caps.c | 6 ++++--
37e7a1
 1 file changed, 4 insertions(+), 2 deletions(-)
37e7a1
37e7a1
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
37e7a1
index e69d308..99a4b71 100644
37e7a1
--- a/hw/ppc/spapr_caps.c
37e7a1
+++ b/hw/ppc/spapr_caps.c
37e7a1
@@ -205,7 +205,9 @@ static void cap_safe_bounds_check_apply(sPAPRMachineState *spapr, uint8_t val,
37e7a1
 static void cap_safe_indirect_branch_apply(sPAPRMachineState *spapr,
37e7a1
                                            uint8_t val, Error **errp)
37e7a1
 {
37e7a1
-    if (tcg_enabled() && val) {
37e7a1
+    if (val == SPAPR_CAP_WORKAROUND) { /* Can only be Broken or Fixed */
37e7a1
+        error_setg(errp, "Requested safe indirect branch capability level \"workaround\" not valid, try cap-ibs=fixed");
37e7a1
+    } else if (tcg_enabled() && val) {
37e7a1
         /* TODO - for now only allow broken for TCG */
37e7a1
         error_setg(errp, "Requested safe indirect branch capability level not supported by tcg, try a different value for cap-ibs");
37e7a1
     } else if (kvm_enabled() && (val > kvmppc_get_cap_safe_indirect_branch())) {
37e7a1
@@ -263,7 +265,7 @@ sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
37e7a1
     },
37e7a1
     [SPAPR_CAP_IBS] = {
37e7a1
         .name = "ibs",
37e7a1
-        .description = "Indirect Branch Serialisation" VALUE_DESC_TRISTATE,
37e7a1
+        .description = "Indirect Branch Serialisation (broken, fixed)",
37e7a1
         .index = SPAPR_CAP_IBS,
37e7a1
         .get = spapr_cap_get_tristate,
37e7a1
         .set = spapr_cap_set_tristate,
37e7a1
-- 
37e7a1
1.8.3.1
37e7a1