From: Fabiano Rosas <farosas@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: aik@ozlabs.ru, danielhb413@gmail.com, npiggin@gmail.com,
qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au
Subject: [RFC PATCH 1/4] target/ppc: TCG: Migrate tb_offset and decr
Date: Thu, 24 Feb 2022 15:58:14 -0300 [thread overview]
Message-ID: <20220224185817.2207228-2-farosas@linux.ibm.com> (raw)
In-Reply-To: <20220224185817.2207228-1-farosas@linux.ibm.com>
These two were not migrated so the remote end was starting with the
decrementer expired.
I am seeing less frequent crashes with this patch (tested with -smp 4
and -smp 32). It certainly doesn't fix all issues but it looks like it
helps.
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
---
target/ppc/machine.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/target/ppc/machine.c b/target/ppc/machine.c
index 1b63146ed1..7ee1984500 100644
--- a/target/ppc/machine.c
+++ b/target/ppc/machine.c
@@ -9,6 +9,7 @@
#include "qemu/main-loop.h"
#include "kvm_ppc.h"
#include "power8-pmu.h"
+#include "hw/ppc/ppc.h"
static void post_load_update_msr(CPUPPCState *env)
{
@@ -666,6 +667,18 @@ static const VMStateDescription vmstate_compat = {
}
};
+static const VMStateDescription vmstate_tb_env = {
+ .name = "cpu/env/tb_env",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_INT64(tb_offset, ppc_tb_t),
+ VMSTATE_UINT64(decr_next, ppc_tb_t),
+ VMSTATE_TIMER_PTR(decr_timer, ppc_tb_t),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
const VMStateDescription vmstate_ppc_cpu = {
.name = "cpu",
.version_id = 5,
@@ -696,12 +709,16 @@ const VMStateDescription vmstate_ppc_cpu = {
/* Backward compatible internal state */
VMSTATE_UINTTL(env.hflags_compat_nmsr, PowerPCCPU),
+ VMSTATE_STRUCT_POINTER_V(env.tb_env, PowerPCCPU, 1,
+ vmstate_tb_env, ppc_tb_t),
+
/* Sanity checking */
VMSTATE_UINTTL_TEST(mig_msr_mask, PowerPCCPU, cpu_pre_2_8_migration),
VMSTATE_UINT64_TEST(mig_insns_flags, PowerPCCPU, cpu_pre_2_8_migration),
VMSTATE_UINT64_TEST(mig_insns_flags2, PowerPCCPU,
cpu_pre_2_8_migration),
VMSTATE_UINT32_TEST(mig_nb_BATs, PowerPCCPU, cpu_pre_2_8_migration),
+
VMSTATE_END_OF_LIST()
},
.subsections = (const VMStateDescription*[]) {
--
2.34.1
next prev parent reply other threads:[~2022-02-24 19:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 18:58 [RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG) Fabiano Rosas
2022-02-24 18:58 ` Fabiano Rosas [this message]
2022-02-24 20:06 ` [RFC PATCH 1/4] target/ppc: TCG: Migrate tb_offset and decr Richard Henderson
2022-02-25 3:15 ` David Gibson
2022-02-25 16:08 ` Fabiano Rosas
2022-02-28 2:04 ` David Gibson
2022-02-24 18:58 ` [RFC PATCH 2/4] spapr: TCG: Migrate spapr_cpu->prod Fabiano Rosas
2022-02-25 3:17 ` David Gibson
2022-02-25 16:08 ` Fabiano Rosas
2022-02-24 18:58 ` [RFC PATCH 3/4] hw/ppc: Take nested guest into account when saving timebase Fabiano Rosas
2022-02-25 3:21 ` David Gibson
2022-02-25 16:08 ` Fabiano Rosas
2022-02-28 2:06 ` David Gibson
2022-02-24 18:58 ` [RFC PATCH 4/4] spapr: Add KVM-on-TCG migration support Fabiano Rosas
2022-02-25 0:51 ` Nicholas Piggin
2022-02-25 3:42 ` David Gibson
2022-02-25 10:57 ` Nicholas Piggin
2022-02-24 21:00 ` [RFC PATCH 0/4] ppc: nested TCG migration (KVM-on-TCG) Mark Cave-Ayland
2022-02-25 3:54 ` David Gibson
2022-02-25 16:11 ` Fabiano Rosas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220224185817.2207228-2-farosas@linux.ibm.com \
--to=farosas@linux.ibm.com \
--cc=aik@ozlabs.ru \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=npiggin@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).