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

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