]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/arm/hvf: Stop pre-allocating cpreg_vmstate arrays
authorScott J. Goldman <scottjgo@gmail.com>
Mon, 27 Apr 2026 23:21:16 +0000 (16:21 -0700)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 15 May 2026 07:57:38 +0000 (08:57 +0100)
commit06fd39e426bbd3a68e50fc847892e7448174ce2f
tree5060db9e8acce00d2ffd6aa09702e5f101fa06d9
parent8d3e31c0d575b3265ae5cacfba10680718ba5a22
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>
target/arm/hvf/hvf.c