Re: [PATCH v9 23/30] KVM: arm64: Context switch SME state for guests

From: Fuad Tabba

Date: Thu Jan 15 2026 - 04:03:09 EST


On Wed, 14 Jan 2026 at 17:28, Mark Brown <broonie@xxxxxxxxxx> wrote:
>
> On Tue, Jan 13, 2026 at 02:24:56PM +0000, Fuad Tabba wrote:
> > On Tue, 23 Dec 2025 at 01:23, Mark Brown <broonie@xxxxxxxxxx> wrote:
>
> > > +#define sme_cond_update_smcr_vq(val, reg) \
> > > + do { \
> > > + u64 __smcr = read_sysreg_s((reg)); \
> > > + u64 __new = __smcr & ~SMCR_ELx_LEN_MASK; \
> > > + __new |= (val) & SMCR_ELx_LEN_MASK; \
>
> > Similar to what I pointed out in patch 15 [1], I think you need to
> > preserve the other bits, since SMCR isn't just about the length.
>
> This does preserve the existing bits? It reads SMCR, masks out and then
> replaces the length.

You're right. Sorry for the noise.

Cheers,
/fuad