[PATCH 13/18] arm64: fpsimd: Use opaque type for SVE state
Mark Rutland
mark.rutland at arm.com
Thu May 28 09:25:29 PDT 2026
On Thu, May 28, 2026 at 10:45:25AM +0100, Vladimir Murzin wrote:
> On 5/21/26 14:25, Mark Rutland wrote:
> > diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
> > index 9806fea8fea7c..66d880d081671 100644
> > --- a/arch/arm64/kernel/fpsimd.c
> > +++ b/arch/arm64/kernel/fpsimd.c
> > @@ -425,8 +425,7 @@ static void task_fpsimd_load(void)
> >
> > if (restore_sve_regs) {
> > WARN_ON_ONCE(current->thread.fp_type != FP_STATE_SVE);
> > - sve_load_state(sve_pffr(¤t->thread),
> > - restore_ffr);
> > + sve_load_state(current->thread.sve_state, restore_ffr);
>
> I do not know much about this code, I assume that live VL matches to current
> but having some logic to check that assumption would be handy...
At this point in task_fpsimd_load(), the NSVL and/or SVL have been
configured by earlier writes to ZCR_EL1 and SMCR_EL1 respectively.
I agree it might be good to add a check here, but it's less of a concern
than in fpsimd_save_user_state(), where the check is there to detect
cases where ZCR_EL1 and/or SMCR_EL1 were clobbered since the state
was bound (e.g. since historically there was the potential for KVM to
clobber the host state).
For now I'm not going to add that, but I'll see if it makes sense to do
that as part of any further rework.
Mark.
More information about the linux-arm-kernel
mailing list