[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 25/72] Adds migration support for Branch History Rolling Buffe
From: |
Fabiano Rosas |
Subject: |
Re: [PULL 25/72] Adds migration support for Branch History Rolling Buffer (BHRB) internal state. |
Date: |
Fri, 31 May 2024 17:06:07 -0300 |
Nicholas Piggin <npiggin@gmail.com> writes:
> From: Glenn Miles <milesg@linux.vnet.ibm.com>
>
> 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>
> ---
> target/ppc/machine.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/target/ppc/machine.c b/target/ppc/machine.c
> index 6b6c31d903..731dd8df35 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,
Running some tests now that Nick re-enabled ppc for migration tests, I
see that this new state breaks backward migrations:
$ QTEST_TRACE="vmstate_*" \
QTEST_QEMU_BINARY_DST=../build-previous/qemu-system-ppc64 \
QTEST_QEMU_BINARY=./qemu-system-ppc64 \
./tests/qtest/migration-test -p /ppc64/migration/precopy/tcp/plain
...
vmstate_load_state_field cpu/slb:env.slb
vmstate_n_elems env.slb: 64
vmstate_subsection_load cpu/slb
vmstate_subsection_load_bad cpu/slb: cpu/bhrb/(prefix)
vmstate_load_state_end cpu/slb end/0
vmstate_subsection_load_bad cpu: cpu/bhrb/(lookup)
qemu-system-ppc64: error while loading state for instance 0x0 of device 'cpu'
vmstate_downtime_checkpoint dst-precopy-loadvm-completed
qemu-system-ppc64: load of migration failed: No such file or directory
If you want to support backwards migration, then this needs to be
fixed. Otherwise we can ignore it.
- [PULL 28/72] target/ppc: Make checkstop actually stop the system, (continued)
- [PULL 28/72] target/ppc: Make checkstop actually stop the system, Nicholas Piggin, 2024/05/23
- [PULL 23/72] This commit continues adding support for the Branch History Rolling Buffer (BHRB) as is provided starting with the P8 processor and continuing with its successors. This commit is limited to the recording and filtering of taken branches., Nicholas Piggin, 2024/05/23
- [PULL 29/72] target/ppc: improve checkstop logging, Nicholas Piggin, 2024/05/23
- [PULL 27/72] target/ppc: Remove redundant MEMOP_GET_SIZE macro, Nicholas Piggin, 2024/05/23
- [PULL 32/72] target/ppc: Add PPR32 SPR, Nicholas Piggin, 2024/05/23
- [PULL 33/72] target/ppc: add helper to write per-LPAR SPRs, Nicholas Piggin, 2024/05/23
- [PULL 30/72] target/ppc: Implement attn instruction on BookS 64-bit processors, Nicholas Piggin, 2024/05/23
- [PULL 35/72] target/ppc: Add SMT support to PTCR SPR, Nicholas Piggin, 2024/05/23
- [PULL 34/72] target/ppc: Add SMT support to simple SPRs, Nicholas Piggin, 2024/05/23
- [PULL 25/72] Adds migration support for Branch History Rolling Buffer (BHRB) internal state., Nicholas Piggin, 2024/05/23
- Re: [PULL 25/72] Adds migration support for Branch History Rolling Buffer (BHRB) internal state.,
Fabiano Rosas <=
- [PULL 42/72] target/ppc/mmu_common.c: Remove unneeded local variable, Nicholas Piggin, 2024/05/23
- [PULL 36/72] target/ppc: Implement LDBAR, TTR SPRs, Nicholas Piggin, 2024/05/23
- [PULL 37/72] target/ppc: Implement SPRC/SPRD SPRs, Nicholas Piggin, 2024/05/23
- [PULL 31/72] target/ppc: BookE DECAR SPR is 32-bit, Nicholas Piggin, 2024/05/23
- [PULL 38/72] target/ppc: add SMT support to msgsnd broadcast, Nicholas Piggin, 2024/05/23
- [PULL 39/72] target/ppc: Remove unused struct 'mmu_ctx_hash32', Nicholas Piggin, 2024/05/23
- [PULL 40/72] target/ppc: Remove unused helper, Nicholas Piggin, 2024/05/23
- [PULL 48/72] target/ppc/mmu_common.c: Eliminate ret from mmu6xx_get_physical_address(), Nicholas Piggin, 2024/05/23
- [PULL 41/72] target/ppc/mmu_common.c: Move calculation of a value closer to its usage, Nicholas Piggin, 2024/05/23
- [PULL 44/72] target/ppc/mmu_common.c: Drop cases for unimplemented MPC8xx MMU, Nicholas Piggin, 2024/05/23