All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Eric Auger <eric.auger@redhat.com>
Cc: eric.auger.pro@gmail.com, qemu-devel@nongnu.org,
	qemu-arm@nongnu.org, maz@kernel.org, oliver.upton@linux.dev,
	sebott@redhat.com, gshan@redhat.com, ddutile@redhat.com,
	peterx@redhat.com, philmd@linaro.org, pbonzini@redhat.com
Subject: Re: [PATCH v6 02/11] target/arm/machine: Improve traces on register mismatch during migration
Date: Mon, 09 Feb 2026 13:51:19 +0100	[thread overview]
Message-ID: <87ldh2rsfs.fsf@redhat.com> (raw)
In-Reply-To: <CAFEAcA8dVLEa9gJ6y=hP94ZZtcNQemRawpfyWo1kLusBdy25kw@mail.gmail.com>

On Fri, Feb 06 2026, Peter Maydell <peter.maydell@linaro.org> wrote:

> On Mon, 26 Jan 2026 at 16:55, Eric Auger <eric.auger@redhat.com> 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 reworks the target/arm/machine code so that it becomes
>> 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.
>
> Improving the diagnostics here is a great idea.
>
>> 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 is no user friendly formatting of the faulting
>> register indexes as with KVM. However the 2 added trace points
>> help to identify the culprit indexes.
>
> Could we move kvm_print_register_name() out of kvm.c and into
> somewhere that the TCG code can use it? (I did think when I
> was reviewing the patch that added that that we might want it
> for TCG too eventually.)

I'm wondering which parts could/should be generalized -- the sysreg
encodings match with the CP_REG_ encodings, but I don't think much else?
Might be worth trying to split those regs off?



  reply	other threads:[~2026-02-09 12:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26 16:52 [PATCH v6 00/11] Mitigation of "failed to load cpu:cpreg_vmstate_array_len" migration failures Eric Auger
2026-01-26 16:53 ` [PATCH v6 01/11] hw/arm/virt: Rename arm_virt_compat into arm_virt_compat_defaults Eric Auger
2026-02-06 14:34   ` Peter Maydell
2026-01-26 16:53 ` [PATCH v6 02/11] target/arm/machine: Improve traces on register mismatch during migration Eric Auger
2026-02-06 14:31   ` Peter Maydell
2026-02-09 12:51     ` Cornelia Huck [this message]
2026-02-09 13:56       ` Eric Auger
2026-02-09 13:42     ` Eric Auger
2026-02-09 15:08   ` Alex Bennée
2026-02-09 15:20     ` Peter Maydell
2026-02-09 16:04     ` Eric Auger
2026-01-26 16:53 ` [PATCH v6 03/11] target/arm/cpu: Allow registers to be hidden Eric Auger
2026-01-27 17:09   ` Cornelia Huck
2026-01-29 10:17     ` Eric Auger
2026-02-04 12:46   ` Eric Auger
2026-01-26 16:53 ` [PATCH v6 04/11] target/arm/machine: Allow extra regs in the incoming stream Eric Auger
2026-01-26 16:53 ` [PATCH v6 05/11] kvm-all: Enforce hidden regs are never accessed Eric Auger
2026-01-26 16:53 ` [PATCH v6 06/11] target/arm/cpu: Implement hide_reg callback() Eric Auger
2026-01-26 16:53 ` [PATCH v6 07/11] target/arm/cpu: Expose x-mig-hidden-regs and x-mig-safe-missing-regs properties Eric Auger
2026-01-26 16:53 ` [PATCH v6 08/11] hw/arm/virt: Declare AArch32 DBGDTRTX as safe to ignore in incoming stream Eric Auger
2026-01-27 17:19   ` Cornelia Huck
2026-01-29 10:23     ` Eric Auger
2026-01-26 16:53 ` [PATCH v6 09/11] Revert "target/arm: Reinstate bogus AArch32 DBGDTRTX register for migration compat" Eric Auger
2026-01-26 16:53 ` [PATCH v6 10/11] hw/arm/virt: Introduce framework to aggregate hidden-regs and safe-missing-regs Eric Auger
2026-01-26 16:53 ` [PATCH v6 11/11] hw/arm/virt: [DO NOT UPSTREAM] Enforce compatibility with older kernels Eric Auger
2026-01-26 17:16 ` [PATCH v6 00/11] Mitigation of "failed to load cpu:cpreg_vmstate_array_len" migration failures Eric Auger
2026-01-27 16:52 ` Sebastian Ott
2026-01-29 10:23   ` Eric Auger
2026-02-06 14:15 ` Peter Maydell
2026-02-09 14:59   ` Alex Bennée
2026-02-09 16:13     ` Eric Auger
2026-02-09 15:13   ` Eric Auger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ldh2rsfs.fsf@redhat.com \
    --to=cohuck@redhat.com \
    --cc=ddutile@redhat.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@redhat.com \
    --cc=gshan@redhat.com \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sebott@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.