summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott J. Goldman <scottjgo@gmail.com>2026-04-27 16:21:16 -0700
committerMichael Tokarev <mjt@tls.msk.ru>2026-06-24 16:34:52 +0300
commit271af539f55afa4e7e351141c198d8119c37941d (patch)
tree3a79fe00c2ee3d87dff22428e71c8bddaf40be66
parent2fea2615754ea8076e7fc59d2f16c992b255536a (diff)
downloadqemu-271af539f55afa4e7e351141c198d8119c37941d.tar.gz
qemu-271af539f55afa4e7e351141c198d8119c37941d.zip
target/arm/hvf: Stop pre-allocating cpreg_vmstate arrays
Commit ab2ddc7b66 ("target/arm/machine: Use VMSTATE_VARRAY_INT32_ALLOC for cpreg arrays") moved cpreg_vmstate_indexes / cpreg_vmstate_values to be allocated by VMSTATE_VARRAY_INT32_ALLOC and added an assertion in cpu_pre_load() that they are NULL on entry. The same commit dropped the redundant g_renew()/array_len assignments from the kvm, whpx and helper.c cpu init paths, but the hvf cpu init path still pre-allocates them. The result is that loading a snapshot or migration stream into an HVF guest immediately aborts: ERROR:target/arm/machine.c:1043:cpu_pre_load: assertion failed: (!cpu->cpreg_vmstate_indexes) Drop the leftover cpreg_vmstate_indexes / cpreg_vmstate_values allocations and the cpreg_vmstate_array_len assignment from hvf_arch_init_vcpu(), matching what was already done for the other arm accelerators. Signed-off-by: Scott J. Goldman <scottjgo@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> (cherry picked from commit 06fd39e426bbd3a68e50fc847892e7448174ce2f) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r--target/arm/hvf/hvf.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index 5016783062..d8bc85f279 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -1288,12 +1288,6 @@ int hvf_arch_init_vcpu(CPUState *cpu)
sregs_match_len);
arm_cpu->cpreg_values = g_renew(uint64_t, arm_cpu->cpreg_values,
sregs_match_len);
- arm_cpu->cpreg_vmstate_indexes = g_renew(uint64_t,
- arm_cpu->cpreg_vmstate_indexes,
- sregs_match_len);
- arm_cpu->cpreg_vmstate_values = g_renew(uint64_t,
- arm_cpu->cpreg_vmstate_values,
- sregs_match_len);
memset(arm_cpu->cpreg_values, 0, sregs_match_len * sizeof(uint64_t));
@@ -1330,7 +1324,6 @@ int hvf_arch_init_vcpu(CPUState *cpu)
}
}
arm_cpu->cpreg_array_len = sregs_cnt;
- arm_cpu->cpreg_vmstate_array_len = sregs_cnt;
/* cpreg tuples must be in strictly ascending order */
qsort(arm_cpu->cpreg_indexes, sregs_cnt, sizeof(uint64_t), compare_u64);