Re: [PATCH] KVM: arm64: Constrain the host to the maximum shared SVE VL with pKVM

From: Mark Brown
Date: Wed Sep 11 2024 - 09:42:38 EST


On Wed, Sep 11, 2024 at 01:02:16PM +0100, Fuad Tabba wrote:
> On Tue, 10 Sept 2024 at 21:26, Mark Brown <broonie@xxxxxxxxxx> wrote:

> The crash is triggered by arch/arm64/kernel/fpsimd.c:487
> (fpsimd_save_user_state(): if (WARN_ON(sve_get_vl() != vl)) ...) ,
> which ends up issuing a SIGKILL.

> The easiest way to consistently reproduce the crash is with a host and
> a guest both running the sve stress test (the one in the arm64
> selftests).

Hrm, I'm not able to reproduce that...

> I think the issue is that this patch doesn't cover all the cases that
> are setting or assuming ZCR_ELx_LEN_MASK as the vector length.

We can't ever assume that VL is ZCR_ELx_LEN_MASK since that might not be
physically supported, and hopefully for a symmetric system the number
read back from RDVL should end up being the same. Though trying to make
the change you suggested *is* triggering something which is fun.

Attachment: signature.asc
Description: PGP signature