@samitouri / QOSamiQemu / commits / c1eb3ac346

target/sparc: Replace VMSTATE_VARRAY_MULTIPLY -> VMSTATE_UINTTL_ARRAY

VMSTATE_VARRAY_MULTIPLY() seems to be an "optimized" version of VMSTATE_UINTTL_ARRAY(), and is only used once. Prefer the generic macro. Bump the SPARC CPU migration stream version. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20260325211728.89204-10-philmd@linaro.org>

Philippe Mathieu-Daudé committed Mar 25, 2026 at 20:09 UTC c1eb3ac34686c3b9f3061bfd679c92587ca8df59
2 files changed +3 -6
include/migration/cpu.h
-2
@@ -13,7 +13,6 @@
13 VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v)
14 #define VMSTATE_UINTTL_SUB_ARRAY(_f, _s, _start, _num) \
15 VMSTATE_UINT64_SUB_ARRAY(_f, _s, _start, _num)
16 -#define vmstate_info_uinttl vmstate_info_uint64
16 #else
17 #define VMSTATE_UINTTL_V(_f, _s, _v) \
18 VMSTATE_UINT32_V(_f, _s, _v)
@@ -21,7 +20,6 @@
20 VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v)
21 #define VMSTATE_UINTTL_SUB_ARRAY(_f, _s, _start, _num) \
22 VMSTATE_UINT32_SUB_ARRAY(_f, _s, _start, _num)
24 -#define vmstate_info_uinttl vmstate_info_uint32
23 #endif
24
25 #define VMSTATE_UINTTL(_f, _s) \
target/sparc/machine.c
+3 -4
@@ -189,9 +189,9 @@ static int cpu_pre_save(void *opaque)
189 * versions are different.
190 */
191 #ifndef TARGET_SPARC64
192 -#define SPARC_VMSTATE_VER 7
192 +#define SPARC_VMSTATE_VER 8
193 #else
194 -#define SPARC_VMSTATE_VER 9
194 +#define SPARC_VMSTATE_VER 10
195 #endif
196
197 const VMStateDescription vmstate_sparc_cpu = {
@@ -202,8 +202,7 @@ const VMStateDescription vmstate_sparc_cpu = {
202 .fields = (const VMStateField[]) {
203 VMSTATE_UINTTL_ARRAY(env.gregs, SPARCCPU, 8),
204 VMSTATE_UINT32(env.nwindows, SPARCCPU),
205 - VMSTATE_VARRAY_MULTIPLY(env.regbase, SPARCCPU, env.nwindows, 16,
206 - vmstate_info_uinttl, target_ulong),
205 + VMSTATE_UINTTL_ARRAY(env.regbase, SPARCCPU, MAX_NWINDOWS * 16 + 8),
206 VMSTATE_CPUDOUBLE_ARRAY(env.fpr, SPARCCPU, TARGET_DPREGS),
207 VMSTATE_UINTTL(env.pc, SPARCCPU),
208 VMSTATE_UINTTL(env.npc, SPARCCPU),