On Tue, Nov 18 2025, Eric Auger <[email protected]> wrote: > Currently when the number of KVM registers exposed by the source is > larger than the one exposed on the destination, the migration fails > with: "failed to load cpu:cpreg_vmstate_array_len" > > This gives no information about which registers are causing the trouble. > > This patch rework the target/arm/machine code so that it becomes
s/rework/reworks/ > able to handle an input stream with a larger set of registers than > the destination and print useful information about which registers > are causing the trouble. The migration outcome is unchanged: > - unexpected registers still will fail the migration > - missing ones are printed but will not fail the migration, as done today. > > The input stream can contain MAX_CPREG_VMSTATE_ANOMALIES(10) extra > registers compared to what exists on the target. > > If there are more registers we will still hit the previous > "load cpu:cpreg_vmstate_array_len" error. > > At most, MAX_CPREG_VMSTATE_ANOMALIES missing registers > and MAX_CPREG_VMSTATE_ANOMALIES unexpected registers are printed. > > Example: > > qemu-system-aarch64: kvm_arm_cpu_post_load Missing register in input stream: > 0 0x6030000000160003 fw feat reg 3 > qemu-system-aarch64: kvm_arm_cpu_post_load Unexpected register in input > stream: 0 0x603000000013c103 op0:3 op1:0 crn:2 crm:0 op2:3 > qemu-system-aarch64: kvm_arm_cpu_post_load Unexpected register in input > stream: 1 0x603000000013c512 op0:3 op1:0 crn:10 crm:2 op2:2 > qemu-system-aarch64: kvm_arm_cpu_post_load Unexpected register in input > stream: 2 0x603000000013c513 op0:3 op1:0 crn:10 crm:2 op2:3 > qemu-system-aarch64: error while loading state for instance 0x0 of device > 'cpu' > qemu-system-aarch64: load of migration failed: Operation not permitted > > With TCG there no user friendly formatting of the faulting s/there/there is/ > register indexes as with KVM. However the 2 added trace points > help to identify the culprint indexes. s/culprint/culprit/ ...although "culprint" would make a nice portmanteau :) > > Signed-off-by: Eric Auger <[email protected]> > > --- > > v1 -> v2: > - fixed some type in the commit msg > --- > target/arm/cpu.h | 6 +++++ > target/arm/kvm.c | 23 ++++++++++++++++ > target/arm/machine.c | 58 ++++++++++++++++++++++++++++++++++++----- > target/arm/trace-events | 7 +++++ > 4 files changed, 88 insertions(+), 6 deletions(-) Reviewed-by: Cornelia Huck <[email protected]>
