target/arm/hvf: Sort the cpreg_indexes array

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Richard Henderson 2025-09-16 07:22:09 -07:00 committed by Peter Maydell
parent 98c2af435e
commit bffe756ea1

View file

@ -925,6 +925,9 @@ 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);
assert(write_cpustate_to_list(arm_cpu, false));
/* Set CP_NO_RAW system registers on init */