@samitouri / QOSamiQemu / commits / 5e65e7aa4a

target/arm/machine: Handle ToleranceNotOnBothEnds migration tolerances

If there is a mismatch between the cpreg indexes found on both ends, check whether a tolerance was registered for the given kvmidx. If any, silence warning/errors. Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20260420140552.104369-3-eric.auger@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Eric Auger committed Apr 20, 2026 at 16:03 UTC 5e65e7aa4a1b57b1dbfcecec629c9e3fb55e94b1
2 files changed +17 -6
target/arm/machine.c
+15 -6
@@ -1063,25 +1063,34 @@ static void handle_cpreg_missing_in_incoming_stream(ARMCPU *cpu, uint64_t kvmidx
1063 {
1064 g_autofree gchar *name = print_register_name(kvmidx);
1065
1066 + if (arm_cpu_match_cpreg_mig_tolerance(cpu, kvmidx,
1067 + 0, 0, ToleranceNotOnBothEnds)) {
1068 + trace_tolerate_cpreg_missing_in_incoming_stream(name);
1069 + return;
1070 + }
1071 warn_report("%s: %s "
1072 "expected by the destination but not in the incoming stream: "
1073 "skip it", __func__, name);
1074 }
1075
1076 /*
1072 - * Handle the situation where @kvmidx is in the incoming stream
1073 - * but not on destination. This currently fails the migration but
1074 - * we plan to accomodate some exceptions, hence the boolean returned value.
1077 + * Handle the situation where @kvmidx is in the incoming
1078 + * stream but not on destination. This fails the migration if
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)
1083 {
1084 g_autofree gchar *name = print_register_name(kvmidx);
1079 - bool fail = true;
1085
1086 + if (arm_cpu_match_cpreg_mig_tolerance(cpu, kvmidx,
1087 + 0, 0, ToleranceNotOnBothEnds)) {
1088 + trace_tolerate_cpreg_only_in_incoming_stream(name);
1089 + return false;
1090 + }
1091 error_report("%s: %s in the incoming stream but unknown on the "
1092 "destination: fail migration", __func__, name);
1083 -
1084 - return fail;
1093 + return true;
1094 }
1095
1096 static int cpu_post_load(void *opaque, int version_id)
target/arm/trace-events
+2
@@ -29,3 +29,5 @@ arm_psci_call(uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3, uint32_t cpuid
29
30 # machine.c
31 cpu_post_load(uint32_t cpreg_vmstate_array_len, uint32_t cpreg_array_len) "cpreg_vmstate_array_len=%d cpreg_array_len=%d"
32 +tolerate_cpreg_missing_in_incoming_stream(char *name) "%s is missing in incoming stream but this is explicitly tolerated"
33 +tolerate_cpreg_only_in_incoming_stream(char *name) "%s is in incoming stream but not on destination but this is explicitly tolerated"