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

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