All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Khushit Shah <khushit.shah@nutanix.com>
Cc: "kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
	"oupton@kernel.org" <oupton@kernel.org>,
	"eric.auger@redhat.com" <eric.auger@redhat.com>,
	"cohuck@redhat.com" <cohuck@redhat.com>,
	"peter.maydell@linaro.org" <peter.maydell@linaro.org>,
	"qemu-arm@nongnu.org" <qemu-arm@nongnu.org>,
	Mark Cave-Ayland <mark.caveayland@nutanix.com>,
	Shaju Abraham <shaju.abraham@nutanix.com>,
	Shameer Kolothum <skolothumtho@nvidia.com>,
	Sandesh Patel <sandesh.patel@nutanix.com>
Subject: Re: [RFC] Exposing arm64 ID-register safe_rules semantics to userspace?
Date: Fri, 16 Oct 2026 10:37:46 +0100	[thread overview]
Message-ID: <86fqy60yvp.wl-maz@kernel.org> (raw)
In-Reply-To: <27B87634-9720-438E-8153-1918E6515230@nutanix.com>

On Fri, 16 Oct 2026 10:07:37 +0100,
Khushit Shah <khushit.shah@nutanix.com> wrote:
> 
> I take your point that a named model cannot be a faithful Neoverse V2
> (or any other) TRM view: even on V2 hardware, a KVM guest only gets
> the subset that the architecture and KVM can actually virtualise. We
> are not trying to present a TRM-accurate Neoverse V2 to the guest.
> 
> What we are after is a migration ABI: a fixed guest-visible ID register
> contract that stays identical across all hosts capable of running it.

That ABI exists. It is probably buggy as hell, but it is there at
least in principles.

> In my research so far, I have identified the following pitfalls with
> this approach:
> 
> - Guest errata: errata handling in the guest is driven by MIDR/REVIDR,
>   so if those do not match the real host, the guest can pick the wrong
>   workarounds or skip needed ones.
> 
>   Shameer's errata-management work, where the VMM gives the guest the
>   list of target implementations could address this.
> 
> - PMU: events and counters are core-specific, so they cannot be
>   supported reliably across heterogeneous hosts.
> 
>   We currently leave PMU out of named models for that reason.

This is a deal breaker IMO. Most interesting events are *architected*,
and SW that relies on non-architectural events has bigger problems
anyway (i.e. it is never able to migrate correctly). Removing PMU
support from named models on these grounds is yet another nail on that
coffin.

The "better" thing to do is to list the events you want to support and
use the event filter to reject anything else.

> - IMP-DEF registers: ACTLR_EL1, AMAIR_EL1 and AFSR0/1_EL1 are the
>   trickiest in principle. A named model should only be allowed to boot
>   on hosts where these registers have the same semantics as on the
>   implementation the model's MIDR describes.
> 
>   Would it make sense for KVM to make them RAZ/WI instead? AFAIU, they
>   are rarely used by guests; mainline Linux does not touch them at all.

ACTLR_EL1 is treated as WI already, but will report the value the
physical CPU has. We don't know if it is safe to have anything else.
It may have been yet another early misdesign to do so, but we can't
change this behaviour now.

Trapping the other registers to make them RAZ/WI requires trapping all
VM related registers on CPUs that do not have FEAT_FGT (see the
registers trapped by HCR_EL2.TVM to get an idea). The cost of that is
simply not acceptable.

And to be clear: an implementation that associates non-architectural
behaviours to these registers is not virtualisable, and will break
under migration. There is nothing that SW can do about it, because the
hardware is fundamentally misdesigned when it comes to virtualisation.

But we're pretty far from named models anyway.

	M.

-- 
Without deviation from the norm, progress is not possible.


      reply	other threads:[~2026-10-16  9:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08  9:43 [RFC] Exposing arm64 ID-register safe_rules semantics to userspace? Khushit Shah
2026-06-08 11:10 ` Marc Zyngier
2026-06-08 13:28   ` Khushit Shah
2026-06-08 14:08     ` Marc Zyngier
2026-10-16  9:07       ` Khushit Shah
2026-10-16  9:37         ` Marc Zyngier [this message]

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=86fqy60yvp.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=cohuck@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=khushit.shah@nutanix.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=mark.caveayland@nutanix.com \
    --cc=oupton@kernel.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=sandesh.patel@nutanix.com \
    --cc=shaju.abraham@nutanix.com \
    --cc=skolothumtho@nvidia.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.