Blame SOURCES/kvm-ppc-fix-VTB-migration.patch

4a2fec
From 43f0b133d1312d042fb31bf7f63bb31a642eef26 Mon Sep 17 00:00:00 2001
4a2fec
From: Laurent Vivier <lvivier@redhat.com>
4a2fec
Date: Thu, 23 Nov 2017 16:14:21 +0100
4a2fec
Subject: [PATCH 3/7] ppc: fix VTB migration
4a2fec
4a2fec
RH-Author: Laurent Vivier <lvivier@redhat.com>
4a2fec
Message-id: <20171123161421.30320-1-lvivier@redhat.com>
4a2fec
Patchwork-id: 77796
4a2fec
O-Subject: [RHV7.5 qemu-kvm-rhev PATCH] ppc: fix VTB migration
4a2fec
Bugzilla: 1506882
4a2fec
RH-Acked-by: Serhii Popovych <spopovyc@redhat.com>
4a2fec
RH-Acked-by: David Gibson <dgibson@redhat.com>
4a2fec
RH-Acked-by: Thomas Huth <thuth@redhat.com>
4a2fec
4a2fec
Migration of a system under stress (for example, with
4a2fec
"stress-ng --numa 2") triggers on the destination
4a2fec
some kernel watchdog messages like:
4a2fec
4a2fec
NMI watchdog: BUG: soft lockup - CPU#0 stuck for 3489660870s!
4a2fec
NMI watchdog: BUG: soft lockup - CPU#1 stuck for 3489660884s!
4a2fec
4a2fec
This problem appears with the changes introduced by
4a2fec
    42043e4 spapr: clock should count only if vm is running
4a2fec
4a2fec
I think this commit only triggers the problem.
4a2fec
4a2fec
Kernel computes the soft lockup duration using the
4a2fec
Virtual Timebase register (VTB), not using the Timebase
4a2fec
Register (TBR, the one 42043e4 stops).
4a2fec
4a2fec
It appears VTB is not migrated, so this patch adds it in
4a2fec
the list of the SPRs to migrate, and fixes the problem.
4a2fec
4a2fec
For the migration, I've tested a migration from qemu-2.8.0 and
4a2fec
pseries-2.8.0 to a patched master (qemu-2.11.0-rc1). The received
4a2fec
VTB is 0 (as is it not initialized by qemu-2.8.0), but the value
4a2fec
seems to be ignored by KVM and a non zero VTB is used by the kernel.
4a2fec
I have no explanation for that, but as the original problem appears
4a2fec
only with SMP system under stress I suspect some problems in KVM
4a2fec
(I think because VTB is shared by all threads of a core).
4a2fec
4a2fec
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
4a2fec
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
4a2fec
(cherry picked from commit 6dd836f5d32b989e18c6dda655a26f4d73a52f6a)
4a2fec
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 target/ppc/translate_init.c | 4 ++--
4a2fec
 1 file changed, 2 insertions(+), 2 deletions(-)
4a2fec
4a2fec
diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
4a2fec
index 371bbae..9d38882 100644
4a2fec
--- a/target/ppc/translate_init.c
4a2fec
+++ b/target/ppc/translate_init.c
4a2fec
@@ -8168,10 +8168,10 @@ static void gen_spr_power8_ebb(CPUPPCState *env)
4a2fec
 /* Virtual Time Base */
4a2fec
 static void gen_spr_vtb(CPUPPCState *env)
4a2fec
 {
4a2fec
-    spr_register(env, SPR_VTB, "VTB",
4a2fec
+    spr_register_kvm(env, SPR_VTB, "VTB",
4a2fec
                  SPR_NOACCESS, SPR_NOACCESS,
4a2fec
                  &spr_read_tbl, SPR_NOACCESS,
4a2fec
-                 0x00000000);
4a2fec
+                 KVM_REG_PPC_VTB, 0x00000000);
4a2fec
 }
4a2fec
 
4a2fec
 static void gen_spr_power8_fscr(CPUPPCState *env)
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec