From ad3da019904302d9ecfc2cf50dfdd6d672427b5d Mon Sep 17 00:00:00 2001 From: Sona Mathew Date: Tue, 21 May 2024 13:51:31 -0500 Subject: [PATCH] fix(cpus): workaround for CVE-2024-5660 for Neoverse-V3 Implements mitigation for CVE-2024-5660 that affects Neoverse-V3 revisions r0p0, r0p1. The workaround is to disable the hardware page aggregation at EL3 by setting CPUECTLR_EL1[46] = 1'b1. Public Documentation: https://developer.arm.com/Arm%20Security%20Center/Arm%20CPU%20Vulnerability%20CVE-2024-5660 Change-Id: I9ed2590bf1215bf6a692f01dfd351e469ff072f8 Signed-off-by: Sona Mathew --- lib/cpus/aarch64/neoverse_v3.S | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/cpus/aarch64/neoverse_v3.S b/lib/cpus/aarch64/neoverse_v3.S index 01ac38f18..4346d7d44 100644 --- a/lib/cpus/aarch64/neoverse_v3.S +++ b/lib/cpus/aarch64/neoverse_v3.S @@ -26,6 +26,13 @@ wa_cve_2022_23960_bhb_vector_table NEOVERSE_V3_BHB_LOOP_COUNT, neoverse_v3 #endif /* WORKAROUND_CVE_2022_23960 */ +/* Disable hardware page aggregation. Enables mitigation for `CVE-2024-5660` */ +workaround_reset_start neoverse_v3, CVE(2024, 5660), WORKAROUND_CVE_2024_5660 + sysreg_bit_set NEOVERSE_V3_CPUECTLR_EL1, BIT(46) +workaround_reset_end neoverse_v3, CVE(2024, 5660) + +check_erratum_ls neoverse_v3, CVE(2024, 5660), CPU_REV(0, 1) + workaround_reset_start neoverse_v3, CVE(2022,23960), WORKAROUND_CVE_2022_23960 #if IMAGE_BL31 /*