[PATCH v1 3/8] KVM: arm64: Enable LS64 instructions when supported by guest

Fuad Tabba tabba at google.com
Tue Nov 4 07:31:02 PST 2025


On Tue, 4 Nov 2025 at 15:26, Marc Zyngier <maz at kernel.org> wrote:
>
> On Tue, 04 Nov 2025 12:59:01 +0000,
> Fuad Tabba <tabba at google.com> wrote:
> >
> > The FEAT_LS64* family (FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA)
> > enables support for LD64B, ST64B, and their variants. If a guest is
> > advertised these features, KVM should not trap accesses to these
> > instructions to EL2.
> >
> > This is controlled by the HCRX_EL2_EnASR, HCRX_EL2_EnALS, and
> > HCRX_EL2_EnAS0 bits. When clear, these bits trap the corresponding
> > instructions. KVM did not set them, which would cause guest-supported
> > instructions to trap.
> >
> > This also created a state mismatch for nested virtualization, which
> > validates its own HCRX_EL2 value against the features advertised in the
> > guest's ID_AA64ISAR1_EL1 (in handle_other()).
> >
> > Fix this by checking for each FEAT_LS64* variant in
> > vcpu_set_hcrx() and setting the corresponding HCRX_EL2 enable
> > bit if the guest supports the feature.
> >
> > Signed-off-by: Fuad Tabba <tabba at google.com>
>
> Please see 20240815125959.2097734-1-maz at kernel.org, which has a large
> portion of what is required for this to work. Just flipping the bits
> isn't quite enough.

I see that now. Thanks.
/fuad

> Thanks,
>
>         M.
>
> --
> Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list