arm64: errata: Work around AmpereOne's erratum AC04_CPU_23
authorD Scott Phillips <scott@os.amperecomputing.com>
Tue, 13 May 2025 18:45:14 +0000 (11:45 -0700)
committerMarc Zyngier <maz@kernel.org>
Mon, 19 May 2025 11:46:26 +0000 (12:46 +0100)
commitfed55f49fad181be9dfb93c06efc4ab2b71a72a9
treec9059e72c2dccec0c2e34d5198aa74901a1771da
parent92c749e4aa90cd684d87cb5bde6a9d51e83fe6e3
arm64: errata: Work around AmpereOne's erratum AC04_CPU_23

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.

Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20250513184514.2678288-1-scott@os.amperecomputing.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
17 files changed:
Documentation/arch/arm64/silicon-errata.rst
arch/arm64/Kconfig
arch/arm64/include/asm/el2_setup.h
arch/arm64/include/asm/hardirq.h
arch/arm64/include/asm/sysreg.h
arch/arm64/kernel/cpu_errata.c
arch/arm64/kernel/hyp-stub.S
arch/arm64/kvm/at.c
arch/arm64/kvm/hyp/include/hyp/switch.h
arch/arm64/kvm/hyp/nvhe/host.S
arch/arm64/kvm/hyp/nvhe/hyp-init.S
arch/arm64/kvm/hyp/nvhe/mem_protect.c
arch/arm64/kvm/hyp/nvhe/switch.c
arch/arm64/kvm/hyp/vgic-v3-sr.c
arch/arm64/kvm/hyp/vhe/switch.c
arch/arm64/kvm/hyp/vhe/tlb.c
arch/arm64/tools/cpucaps