[PATCH] KVM: arm64: nv: Work around lack of pauth support in old toolchains

Arnd Bergmann arnd at arndb.de
Tue Apr 23 01:24:49 PDT 2024


On Tue, Apr 23, 2024, at 00:48, Marc Zyngier wrote:
> We still support GCC 8.x, and it appears that this toolchain
> does not understand "pauth" as a valid architectural extension.
> After all, it's only been 8 years since ARMv8.3 was released...

Just to clarify: I'm fairly sure that all supported toolchains
support ARMv8.3 and PACGA, the problem with ".arch_extension pauth\n"
seems to be that it was retroactively made an optional
feature for earlier architecture versions a few years after
ARMv8.3, so most binutils versions we support understand
pacga as an armv8.3 feature but reject the pauth name for the
extension.

> This results in the NV ERETAx code breaking the build, as it relies
> on this extention to make use of the PACGA instruction.
>
> Work around it by hand-assembling the instruction using a mind-bending
> trick lifted from an old patch by Will. Magic.
>
> Fixes: e09faab353a6 ("KVM: arm64: nv: Add emulation for ERETAx instructions")
> Reported-by: Linaro Kernel Functional Testing <lkft at linaro.org>
> Signed-off-by: Marc Zyngier <maz at kernel.org>

I usually try to enclose these in a version check like
"#if CONFIG_AS_VERSION >= 22800" so we can be sure we clean them up
whenever the minimum version changes, but I assume you'll remember
this one.

Acked-by: Arnd Bergmann <arnd at arndb.de>



More information about the linux-arm-kernel mailing list