From: Cornelia Huck <cohuck@redhat.com>
To: Eric Auger <eric.auger@redhat.com>,
eric.auger.pro@gmail.com, eric.auger@redhat.com,
qemu-devel@nongnu.org, qemu-arm@nongnu.org,
peter.maydell@linaro.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 v4 03/10] target/arm/cpu: Allow registers to be hidden
Date: Tue, 23 Dec 2025 15:24:35 +0100 [thread overview]
Message-ID: <87fr91p97g.fsf@redhat.com> (raw)
In-Reply-To: <20251222134110.3649287-4-eric.auger@redhat.com>
On Mon, Dec 22 2025, Eric Auger <eric.auger@redhat.com> wrote:
> More recent kernels sometimes expose new registers in an
> unconditionnal manner. This situation breaks backward migration
> as qemu notices there are more registers in the input stream
> than supported on the destination host. This leads to a
> "failed to load cpu:cpreg_vmstate_array_len" error.
>
> A good example is the introduction of KVM_REG_ARM_VENDOR_HYP_BMAP_2
> pseudo FW register in v6.16 by commit C0000e58c74e (“KVM: arm64:
> Introduce KVM_REG_ARM_VENDOR_HYP_BMAP_2”). Trying to do backward
> migration from a host kernel that features the commit to a destination
> host that doesn't, fail with above error.
>
> Currently QEMU is not using that feature so ignoring this latter
> is not a problem. An easy way to fix the migration issue is to teach
> qemu we don't care about that register and we can simply ignore it
> when syncing its state during migration.
>
> This patch introduces an array of such hidden registers. Soon it will
> be settable through an array property.
>
> If hidden, the register is moved out of the array of cpreg which is
> built in kvm_arm_init_cpreg_list(). That way their state won't be
> synced.
>
> To extend that functionality to TCG, do the same in add_cpreg_to_list()
> and count_cpreg().
>
> Signed-off-by: Eric Auger <eric.auger@redhat.com>
> Reviewed-by: Sebastian Ott <sebott@redhat.com>
>
> ---
>
> v1 -> v2:
> - Move the property in a separate patch
> - improve the commit msg
> - change the trace point to just print info in
> kvm_arm_init_cpreg_list()
> - improve comment in cpu.h (Connie)
>
> target/arm/helper: Skip hidden registers
>
> In case a cpreg is hidden, skip it when initialing the cpreg
> list.
>
> Signed-off-by: Eric Auger <eric.auger@redhat.com>
>
> ---
>
> v2 -> v3:
> - use kvm_regidx
This looks a bit odd after squashing the patches, maybe edit the patch
description?
Otherwise,
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> ---
> target/arm/cpu.h | 20 ++++++++++++++++++++
> target/arm/helper.c | 12 +++++++++++-
> target/arm/kvm.c | 12 +++++++++++-
> target/arm/trace-events | 2 ++
> 4 files changed, 44 insertions(+), 2 deletions(-)
next prev parent reply other threads:[~2025-12-23 14:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-22 13:39 [PATCH v4 00/10] Mitigation of "failed to load cpu:cpreg_vmstate_array_len" migration failures Eric Auger
2025-12-22 13:39 ` [PATCH v4 01/10] hw/arm/virt: Rename arm_virt_compat into arm_virt_compat_defaults Eric Auger
2025-12-22 13:39 ` [PATCH v4 02/10] target/arm/machine: Improve traces on register mismatch during migration Eric Auger
2025-12-22 13:40 ` [PATCH v4 03/10] target/arm/cpu: Allow registers to be hidden Eric Auger
2025-12-23 14:24 ` Cornelia Huck [this message]
2025-12-22 13:40 ` [PATCH v4 04/10] target/arm/machine: Allow extra regs in the incoming stream Eric Auger
2025-12-22 13:40 ` [PATCH v4 05/10] kvm-all: Enforce hidden regs are never accessed Eric Auger
2025-12-22 13:40 ` [PATCH v4 06/10] target/arm/cpu: Implement hide_reg callback() Eric Auger
2025-12-22 13:40 ` [PATCH v4 07/10] target/arm/cpu: Expose x-mig-hidden-regs and x-mig-safe-missing-regs properties Eric Auger
2025-12-23 14:27 ` Cornelia Huck
2025-12-22 13:40 ` [PATCH v4 08/10] hw/arm/virt: Declare AArch32 DBGDTRTX as safe to ignore in incoming stream Eric Auger
2025-12-23 14:30 ` Cornelia Huck
2026-01-07 17:18 ` Eric Auger
2025-12-22 13:40 ` [PATCH v4 09/10] Revert "target/arm: Reinstate bogus AArch32 DBGDTRTX register for migration compat" Eric Auger
2025-12-22 13:40 ` [PATCH v4 10/10] hw/arm/virt: [DO NOT UPSTREAM] Enforce compatibility with older kernels Eric Auger
2026-01-07 15:02 ` [PATCH v4 00/10] Mitigation of "failed to load cpu:cpreg_vmstate_array_len" migration failures Sebastian Ott
2026-01-07 17:17 ` 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=87fr91p97g.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.