[PATCH v4] arm64: errata: Work around AmpereOne's erratum AC04_CPU_23
Marc Zyngier
maz at kernel.org
Fri May 23 08:00:06 PDT 2025
On Fri, 23 May 2025 15:15:53 +0100,
Mark Brown <broonie at kernel.org> wrote:
>
> On Tue, May 13, 2025 at 11:45:14AM -0700, D Scott Phillips wrote:
> > On AmpereOne AC04, updates to HCR_EL2 can rarely corrupt simultaneous
> > translations for data addresses initiated by load/store instructions.
> > Only instruction initiated translations are vulnerable, not translations
> > from prefetches for example. A DSB before the store to HCR_EL2 is
> > sufficient to prevent older instructions from hitting the window for
> > corruption, and an ISB after is sufficient to prevent younger
> > instructions from hitting the window for corruption.
>
> This patch, which is in -next as fed55f49fad181be9dfb93c0, breaks the
> build of at least the vDSO selftests:
>
> $ make -C tools/testing/selftests ARCH=arm64 LLVM=1 TARGETS=vDSO
>
> CC vdso_test_chacha
> In file included from vgetrandom-chacha.S:9:
> In file included from ./../../../../arch/arm64/kernel/vdso/vgetrandom-chacha.S:5:
> In file included from /home/broonie/git/bisect/tools/testing/selftests/../../../arch/arm64/include/asm/assembler.h:21:
> In file included from /home/broonie/git/bisect/tools/testing/selftests/../../../arch/arm64/include/asm/cpufeature.h:13:
> /home/broonie/git/bisect/tools/testing/selftests/../../../arch/arm64/include/asm/sysreg.h:1097:5: error: function-like macro 'IS_ENABLED' is not defined
> 1097 | #if IS_ENABLED(CONFIG_AMPERE_ERRATUM_AC04_CPU_23)
> | ^
> 1 error generated.
This:
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index ad63457a05c5b..4389d3916426c 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -13,6 +13,7 @@
#define __ASM_ASSEMBLER_H
#include <linux/export.h>
+#include <linux/kconfig.h>
#include <asm/alternative.h>
#include <asm/asm-bug.h>
should solve it.
But it also outlines that the vdso is getting built using stuff that
is not meant for userspace code.
M.
--
Jazz isn't dead. It just smells funny.
More information about the linux-arm-kernel
mailing list