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

From: Mark Brown

Date: Wed Jan 14 2026 - 12:27:59 EST


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.

Attachment: signature.asc
Description: PGP signature