mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
arm64: Check if PSCI before calling SMCCC
As SMCCC depends on PSCI check if the latter is present before calling the former. This fixes an issue where we may call into SMCCC when there is no PSCI in the system causing a smccc_version assert to fail. Reported by: stevek Reviewed by: emaste, imp, stevek Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42404
This commit is contained in:
parent
2ee649c1dd
commit
5a8417c78f
|
@ -40,6 +40,7 @@
|
|||
|
||||
#include <machine/cpu.h>
|
||||
|
||||
#include <dev/psci/psci.h>
|
||||
#include <dev/psci/smccc.h>
|
||||
|
||||
typedef void (cpu_quirk_install)(void);
|
||||
|
@ -117,6 +118,9 @@ static struct cpu_quirks cpu_quirks[] = {
|
|||
static void
|
||||
install_psci_bp_hardening(void)
|
||||
{
|
||||
/* SMCCC depends on PSCI. If PSCI is missing so is SMCCC */
|
||||
if (!psci_present)
|
||||
return;
|
||||
|
||||
if (smccc_arch_features(SMCCC_ARCH_WORKAROUND_1) != SMCCC_RET_SUCCESS)
|
||||
return;
|
||||
|
@ -140,6 +144,10 @@ install_ssbd_workaround(void)
|
|||
}
|
||||
}
|
||||
|
||||
/* SMCCC depends on PSCI. If PSCI is missing so is SMCCC */
|
||||
if (!psci_present)
|
||||
return;
|
||||
|
||||
/* Enable the workaround on this CPU if it's enabled in the firmware */
|
||||
if (smccc_arch_features(SMCCC_ARCH_WORKAROUND_2) != SMCCC_RET_SUCCESS)
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue