@samitouri / QOSamiQemu / commits / 9d2e717da4

target/arm/machine: Handle ToleranceOnlySrcTestValue migration tolerance

Pass the value of the incoming register to handle_cpreg_only_in_incoming_stream and check whether there is a matching ToleranceOnlySrcTestValue tolerance. Signed-off-by: Eric Auger <eric.auger@redhat.com> Message-id: 20260420140552.104369-4-eric.auger@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Eric Auger committed Apr 20, 2026 at 16:03 UTC 9d2e717da4f4822ddb89c1ae78a0afd328a1f554
1 file changed +10 -4
target/arm/machine.c
+10 -4
@@ -1079,12 +1079,15 @@ static void handle_cpreg_missing_in_incoming_stream(ARMCPU *cpu, uint64_t kvmidx
1079 * no cpreg mig tolerance is matched for this @kvmidx
1080 * Return true if the migration should eventually fail
1081 */
1082 -static bool handle_cpreg_only_in_incoming_stream(ARMCPU *cpu, uint64_t kvmidx)
1082 +static bool
1083 +handle_cpreg_only_in_incoming_stream(ARMCPU *cpu, uint64_t kvmidx, uint64_t value)
1084 {
1085 g_autofree gchar *name = print_register_name(kvmidx);
1086
1087 if (arm_cpu_match_cpreg_mig_tolerance(cpu, kvmidx,
1087 - 0, 0, ToleranceNotOnBothEnds)) {
1088 + 0, 0, ToleranceNotOnBothEnds) ||
1089 + arm_cpu_match_cpreg_mig_tolerance(cpu, kvmidx,
1090 + value, 0, ToleranceOnlySrcTestValue)) {
1091 trace_tolerate_cpreg_only_in_incoming_stream(name);
1092 return false;
1093 }
@@ -1137,7 +1140,9 @@ static int cpu_post_load(void *opaque, int version_id)
1140 }
1141 if (cpu->cpreg_vmstate_indexes[v] < cpu->cpreg_indexes[i]) {
1142 fail = handle_cpreg_only_in_incoming_stream(cpu,
1140 - cpu->cpreg_vmstate_indexes[v++]);
1143 + cpu->cpreg_vmstate_indexes[v],
1144 + cpu->cpreg_vmstate_values[v]);
1145 + v++;
1146 continue;
1147 }
1148 /* matching register, copy the value over */
@@ -1160,7 +1165,8 @@ static int cpu_post_load(void *opaque, int version_id)
1165 */
1166 for ( ; v < cpu->cpreg_vmstate_array_len; v++) {
1167 fail = handle_cpreg_only_in_incoming_stream(cpu,
1163 - cpu->cpreg_vmstate_indexes[v]);
1168 + cpu->cpreg_vmstate_indexes[v],
1169 + cpu->cpreg_vmstate_values[v]);
1170 }
1171 if (fail) {
1172 return -1;