All of lore.kernel.org
 help / color / mirror / Atom feed
* Future of target/arm "max" CPU type
@ 2026-05-01 13:26 Peter Maydell
  2026-05-06 22:17 ` Pierrick Bouvier
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2026-05-01 13:26 UTC (permalink / raw)
  To: QEMU Developers, qemu-arm
  Cc: Alex Bennée, Richard Henderson, Phil Mathieu-Daudé,
	Jim MacArthur, Gustavo Bueno Romero

This is something we've discussed before. I don't think I have a very
solid grip on it and I suspect I may be missing some parts of the
"problem description" (i.e. what are we trying to achieve) and perhaps
some implications of the choice. Overall it feels to me like a "no
obviously correct answer, make a tradeoff" question. I've written this
up to try to clarify my thinking and canvass for opinions and for
people to point out what I'm missing.

For a long time now the arm targets have defined a "max" CPU type
whose definition is roughly "all the features that QEMU
implements". This is helpful for:

 - giving us a way to provide newly emulated CPU features to users
   without having to define a specific named CPU type matching some
   hardware that implements the feature (which might not exist at the
   point we add the emulation, or which might also need some other
   features we don't yet support)
 - giving users a way to say "I just want everything"

Mostly this has worked pretty well, I think. (It can cause problems
for some workloads that break when a new feature is added; TF-A
firmware seems particularly prone to this.)

However, it doesn't work so well if the architecture decides to drop a
feature and mandate that newer implementations may not implement
it. Up til now that hasn't been a big deal, as only a few very niche
items (like FEAT_DoubleLock, an old mechanism for quiescing external
debug before a CPU power-down) have ever been removed.

With the Armv9.0 architecture, a big feature gets removed: support for
running in 32-bit mode at anything above userspace (EL1, EL2, EL3) is
not allowed to be implemented.  We've got away so far with ignoring
that requirement, but as new v9.x features are added, they are
designed under the assumption that there is no 32-bit system mode
code. For instance, the GICv5 CPU interface defines only 64-bit system
registers, and our non-compliant "32-bit is actually there"
implementation would give you a 32-bit OS that couldn't handle
interrupts. Other similar (or harder to spot) issues are likely to
also turn up.

So my suggestion is that we should have two new CPU types:

 v8-max : "all the features we implement that are valid
   for the v8.x architecture"
 v9-max : "all the features we implement that are valid
   for the v9.x architecture"

v9-max would not implement AArch32 EL1/2/3; v8-max wouldn't implement
any feature the architecture says is v9-or-later.

For the existing 'max' CPU:
 - on qemu-system-arm this would be a synonym for v8-max
   (since it must be 32-bit)
 - on qemu-aarch64 and qemu-system-aarch64 this would be a synonym
   for v9-max
 - on qemu-arm it can also be v9-max, since v9 doesn't drop 32-bit
   usermode support. (Though we don't currently implement qemu-arm
   max this way, so it might end up being effectively v8-max until
   we get round to implementing support for selecting AArch64 CPUs in
   qemu-arm.)

I don't think it's worth claiming 'max' as deprecated and dropping it:
as an alias it's trivial to support, and there are a lot of workloads
that won't ever notice this change.

It's possible some workloads currently using "max" will need to switch
to 'v8-max", but I think this will be rare: it would have to be
emulation of an EL2 guest which is itself 64-bit but which runs some
inner-guest VM within itself that is 32-bit. The failure mode will be
that the (outer) guest will report that it can't run a 32-bit (inner)
guest (in whatever way that hypervisor reports that kind of error).

So that's my sketch of a proposal -- what do people think? What
have I forgotten about?

thanks
-- PMM


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-05-07 13:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-01 13:26 Future of target/arm "max" CPU type Peter Maydell
2026-05-06 22:17 ` Pierrick Bouvier
2026-05-07 10:17   ` Philippe Mathieu-Daudé
2026-05-07 10:29     ` Daniel P. Berrangé
2026-05-07 13:20       ` Philippe Mathieu-Daudé
2026-05-07 13:22         ` Daniel P. Berrangé

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.