[PATCH v17 7/8] KVM: arm64: use CAST instruction for swapping guest descriptor
Marc Zyngier
maz at kernel.org
Tue Mar 17 04:04:23 PDT 2026
On Sat, 14 Mar 2026 17:51:32 +0000,
Yeoreum Yun <yeoreum.yun at arm.com> wrote:
>
> Use the CAST instruction to swap the guest descriptor when FEAT_LSUI
> is enabled, avoiding the need to clear the PAN bit.
>
> FEAT_LSUI is introduced in Armv9.6, where FEAT_PAN is mandatory. However,
> this assumption may not always hold:
>
> - Some CPUs may advertise FEAT_LSUI but lack FEAT_PAN.
> - Virtualization or ID register overrides may expose invalid feature
> combinations.
>
> Therefore, instead of disabling FEAT_LSUI when FEAT_PAN is absent, wrap
> LSUI instructions with uaccess_ttbr0_enable()/disable() when
> ARM64_SW_TTBR0_PAN is enabled.
>
> Signed-off-by: Yeoreum Yun <yeoreum.yun at arm.com>
Reviewed-by: Marc Zyngier <maz at kernel.org>
M.
--
Without deviation from the norm, progress is not possible.
More information about the linux-arm-kernel
mailing list