Blame SOURCES/kvm-spapr-fix-CAS-generated-reset.patch

9bac43
From bc0dcb3a78edf2eb8df0509d4862bb9ff36c4332 Mon Sep 17 00:00:00 2001
9bac43
From: David Gibson <dgibson@redhat.com>
9bac43
Date: Wed, 4 Oct 2017 05:40:14 +0200
9bac43
Subject: [PATCH 07/34] spapr: fix CAS-generated reset
9bac43
MIME-Version: 1.0
9bac43
Content-Type: text/plain; charset=UTF-8
9bac43
Content-Transfer-Encoding: 8bit
9bac43
9bac43
RH-Author: David Gibson <dgibson@redhat.com>
9bac43
Message-id: <20171004054014.14159-5-dgibson@redhat.com>
9bac43
Patchwork-id: 76802
9bac43
O-Subject: [RHEL-7.5 qemu-kvm-rhev PATCH 4/4] spapr: fix CAS-generated reset
9bac43
Bugzilla: 1448344
9bac43
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
9bac43
RH-Acked-by: Thomas Huth <thuth@redhat.com>
9bac43
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9bac43
9bac43
From: Cédric Le Goater <clg@kaod.org>
9bac43
9bac43
The OV5_MMU_RADIX_300 requires special handling in the CAS negotiation
9bac43
process. It is cleared from the option vector of the guest before
9bac43
evaluating the changes and re-added later. But, when testing for a
9bac43
possible CAS reset :
9bac43
9bac43
    spapr->cas_reboot = spapr_ovec_diff(ov5_updates,
9bac43
                                        ov5_cas_old, spapr->ov5_cas);
9bac43
9bac43
the bit OV5_MMU_RADIX_300 will each time be seen as removed from the
9bac43
previous OV5 set, hence generating a reset loop.
9bac43
9bac43
Fix this problem by also clearing the same bit in the ov5_cas_old set.
9bac43
9bac43
Signed-off-by: Cédric Le Goater <clg@kaod.org>
9bac43
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
9bac43
(cherry picked from commit 30bf9ed1684da582e47ae004f8f3cf14fd6f39dd)
9bac43
9bac43
Signed-off-by: David Gibson <dgibson@redhat.com>
9bac43
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9bac43
---
9bac43
 hw/ppc/spapr_hcall.c | 7 +++++++
9bac43
 1 file changed, 7 insertions(+)
9bac43
9bac43
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
9bac43
index 07b3da8..92f1e21 100644
9bac43
--- a/hw/ppc/spapr_hcall.c
9bac43
+++ b/hw/ppc/spapr_hcall.c
9bac43
@@ -1575,6 +1575,13 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu,
9bac43
      * to worry about this for now.
9bac43
      */
9bac43
     ov5_cas_old = spapr_ovec_clone(spapr->ov5_cas);
9bac43
+
9bac43
+    /* also clear the radix/hash bit from the current ov5_cas bits to
9bac43
+     * be in sync with the newly ov5 bits. Else the radix bit will be
9bac43
+     * seen as being removed and this will generate a reset loop
9bac43
+     */
9bac43
+    spapr_ovec_clear(ov5_cas_old, OV5_MMU_RADIX_300);
9bac43
+
9bac43
     /* full range of negotiated ov5 capabilities */
9bac43
     spapr_ovec_intersect(spapr->ov5_cas, spapr->ov5, ov5_guest);
9bac43
     spapr_ovec_cleanup(ov5_guest);
9bac43
-- 
9bac43
1.8.3.1
9bac43