Skip to content

Commit e21da1c

Browse files
Marc Zyngierctmarinas
authored andcommitted
arm64: Relax ARM_SMCCC_ARCH_WORKAROUND_1 discovery
A recent update to the ARM SMCCC ARCH_WORKAROUND_1 specification allows firmware to return a non zero, positive value to describe that although the mitigation is implemented at the higher exception level, the CPU on which the call is made is not affected. Let's relax the check on the return value from ARCH_WORKAROUND_1 so that we only error out if the returned value is negative. Fixes: b092201 ("arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support") Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent b08e5fd commit e21da1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm64/kernel/cpu_errata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int enable_smccc_arch_workaround_1(void *data)
178178
case PSCI_CONDUIT_HVC:
179179
arm_smccc_1_1_hvc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
180180
ARM_SMCCC_ARCH_WORKAROUND_1, &res);
181-
if (res.a0)
181+
if ((int)res.a0 < 0)
182182
return 0;
183183
cb = call_hvc_arch_workaround_1;
184184
smccc_start = __smccc_workaround_1_hvc_start;
@@ -188,7 +188,7 @@ static int enable_smccc_arch_workaround_1(void *data)
188188
case PSCI_CONDUIT_SMC:
189189
arm_smccc_1_1_smc(ARM_SMCCC_ARCH_FEATURES_FUNC_ID,
190190
ARM_SMCCC_ARCH_WORKAROUND_1, &res);
191-
if (res.a0)
191+
if ((int)res.a0 < 0)
192192
return 0;
193193
cb = call_smc_arch_workaround_1;
194194
smccc_start = __smccc_workaround_1_smc_start;

0 commit comments

Comments
 (0)