aboutsummaryrefslogtreecommitdiff
path: root/target/ppc
diff options
context:
space:
mode:
authorGlenn Miles <milesg@linux.vnet.ibm.com>2024-03-28 20:41:37 +1000
committerNicholas Piggin <npiggin@gmail.com>2024-05-24 09:33:44 +1000
commitdabd6d3c3ae1ba52662d2056a8d59b01d9ee8e24 (patch)
tree9e3c9683f4050c676660bca6296238432e1b2584 /target/ppc
parent6bfcf1dc239dba752307f0312e8a320470c26655 (diff)
downloadqemu-dabd6d3c3ae1ba52662d2056a8d59b01d9ee8e24.zip
qemu-dabd6d3c3ae1ba52662d2056a8d59b01d9ee8e24.tar.gz
qemu-dabd6d3c3ae1ba52662d2056a8d59b01d9ee8e24.tar.bz2
target/ppc: Add migration support for BHRB
Adds migration support for Branch History Rolling Buffer (BHRB) internal state. Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Diffstat (limited to 'target/ppc')
-rw-r--r--target/ppc/machine.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/target/ppc/machine.c b/target/ppc/machine.c
index 6b6c31d..731dd8d 100644
--- a/target/ppc/machine.c
+++ b/target/ppc/machine.c
@@ -711,6 +711,26 @@ static const VMStateDescription vmstate_reservation = {
}
};
+#ifdef TARGET_PPC64
+static bool bhrb_needed(void *opaque)
+{
+ PowerPCCPU *cpu = opaque;
+ return (cpu->env.flags & POWERPC_FLAG_BHRB) != 0;
+}
+
+static const VMStateDescription vmstate_bhrb = {
+ .name = "cpu/bhrb",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = bhrb_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINTTL(env.bhrb_offset, PowerPCCPU),
+ VMSTATE_UINT64_ARRAY(env.bhrb, PowerPCCPU, BHRB_MAX_NUM_ENTRIES),
+ VMSTATE_END_OF_LIST()
+ }
+};
+#endif
+
const VMStateDescription vmstate_ppc_cpu = {
.name = "cpu",
.version_id = 5,
@@ -756,6 +776,7 @@ const VMStateDescription vmstate_ppc_cpu = {
#ifdef TARGET_PPC64
&vmstate_tm,
&vmstate_slb,
+ &vmstate_bhrb,
#endif /* TARGET_PPC64 */
&vmstate_tlb6xx,
&vmstate_tlbemb,