On Sat, 21 Feb 2026 at 07:19, Michael Tokarev <[email protected]> wrote:
>
> On 02.02.2026 16:33, Peter Maydell wrote:
> > In our handling of the boolean 'sme' CPU property, we write this 0/1
> > value directly to ID_AA64PFR1_EL1.SME.  This worked when the only
> > valid values in that field were 0 (for no SME) and 1 (for SME1).
> > However, with the addition of SME2 the SME field can now also read 2.
> > This means that "-cpu max,sme=on" will result in an inconsistent set
> > of ID registers, where ID_AA64PFR1_EL1.SME claims SME1 but
> > ID_AA64SMFR0_EL1.SMEver claims SME2p1.  This isn't a valid thing to
> > report, and confuses Linux into reporting SME2 to userspace but not
> > actually enabling userspace access for it.
> >
> > Fix this bug by having arm_cpu_sme_finalize() fix up the
> > ID_AA64PFR1_EL1.SME field to match ID_AA64SMFR0.SMEver.  This means
> > the "sme" property's semantics are "off" for "no SME" and "on" for
> > "enable at whatever the default SME version this CPU provides is".
> >
> > Update the documentation to clarify what 'sve=on' and 'sme=on' do.
> > (We don't have the equivalent bug for 'sve=on' because
> > ID_AA64PFR0_EL1.SVE only has 0 and 1 as valid values, but the
> > semantics of the property are the same.)
> >
> > Cc: [email protected]
> > Signed-off-by: Peter Maydell <[email protected]>
>
> Hi!
>
> I suppose this change makes sense for 10.0.x (LTS) series to.  There,
> since it lacks idregs conversion which happened during 10.1 development
> cycle, I had to adjust the change.
>
> The result is at
> https://gitlab.com/mjt0k/qemu/-/commit/3c1f1b8065c625040787c2c89d22d5602100aeb4
> (I kept original code fragments - using idregs - in comments).
>
> Please let me know if I should've done something different here, for
> example not picking up this change for 10.0.x :)

Thanks for the ping -- there's nothing technically wrong with your
backport and it would be harmless to have it in 10.0.x, but the
support for the SME2 feature that makes "just write 0" become a bug
only went in from the 10.1 release, so we don't need to backport
the fix any further back than that.

thanks
-- PMM

Reply via email to