qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@redhat.com>
To: eric.auger.pro@gmail.com, eric.auger@redhat.com,
	qemu-devel@nongnu.org, qemu-arm@nongnu.org,
	peter.maydell@linaro.org, cohuck@redhat.com, maz@kernel.org,
	oliver.upton@linux.dev, sebott@redhat.com, gshan@redhat.com
Subject: [RFC 0/3] Mitigation of migration failures accross different host kernels
Date: Thu, 11 Sep 2025 15:40:26 +0200	[thread overview]
Message-ID: <20250911134324.3702720-1-eric.auger@redhat.com> (raw)

When migrating ARM guests accross same machines with different host
kernels we are likely to encounter failures such as:

"failed to load cpu:cpreg_vmstate_array_len"

This is due to the fact KVM exposes a different number of registers
to qemu on source and destination. When trying to migrate a bigger
register set to a smaller one, qemu cannot save the CPU state.

For example, recently we faced such kind of situations with:
- unconditionnal exposure of KVM_REG_ARM_VENDOR_HYP_BMAP_2 FW pseudo
  register from v6.16 onwards. Causes backward migration failure.
- removal of unconditionnal exposure of TCR2_EL1, PIRE0_EL1,  PIR_EL1
  from v6.13 onwards. Causes forward migration failure.

More details can be found in individual patches.

This situation is really problematic for distributions which want to
guarantee forward and backward migration of a given machine type
between different releases.

This small series tries to address that issue by introducing CPU
array properties that list the registers to ignore or to fake according
to the situation. An example is given to illustrate how those props
could be used to apply compats for machine types supposed to "see" the
same register set accross various host kernels.

Obviously this is a last resort situation and this situation should be
avoided as much as possible.

Eric Auger (3):
  target/arm/cpu: Add new CPU property for KVM regs to hide
  target/arm/kvm: Add new CPU property for KVM regs to enforce
  hw/arm/virt: [DO NOT UPSTREAM] Enforce compatibility with older
    kernels

 target/arm/cpu.h        | 15 +++++++
 hw/arm/virt.c           | 19 ++++++++
 target/arm/kvm.c        | 99 +++++++++++++++++++++++++++++++++++++++--
 target/arm/trace-events |  6 +++
 4 files changed, 135 insertions(+), 4 deletions(-)

-- 
2.49.0



             reply	other threads:[~2025-09-11 13:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-11 13:40 Eric Auger [this message]
2025-09-11 13:40 ` [RFC 1/3] target/arm/cpu: Add new CPU property for KVM regs to hide Eric Auger
2025-09-17 14:37   ` Sebastian Ott
2025-09-18 16:16   ` Sebastian Ott
2025-10-03  7:25     ` Eric Auger
2025-10-08 13:49       ` Cornelia Huck
2025-10-14 14:16         ` Eric Auger
2025-10-15 13:12           ` Cornelia Huck
2025-10-16 17:33             ` Eric Auger
2025-10-08 13:43   ` Cornelia Huck
2025-10-14 13:31     ` Eric Auger
2025-09-11 13:40 ` [RFC 2/3] target/arm/kvm: Add new CPU property for KVM regs to enforce Eric Auger
2025-09-11 13:40 ` [RFC 3/3] hw/arm/virt: [DO NOT UPSTREAM] Enforce compatibility with older kernels Eric Auger
2025-10-03  8:10 ` [RFC 0/3] Mitigation of migration failures accross different host kernels 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=20250911134324.3702720-1-eric.auger@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=gshan@redhat.com \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=peter.maydell@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).