Skip to content

Commit d68e3ba

Browse files
wildea01ctmarinas
authored andcommitted
drivers/firmware: Expose psci_get_version through psci_ops structure
Entry into recent versions of ARM Trusted Firmware will invalidate the CPU branch predictor state in order to protect against aliasing attacks. This patch exposes the PSCI "VERSION" function via psci_ops, so that it can be invoked outside of the PSCI driver where necessary. Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 0a0d111 commit d68e3ba

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/firmware/psci.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,8 @@ static void __init psci_init_migrate(void)
496496
static void __init psci_0_2_set_functions(void)
497497
{
498498
pr_info("Using standard PSCI v0.2 function IDs\n");
499+
psci_ops.get_version = psci_get_version;
500+
499501
psci_function_id[PSCI_FN_CPU_SUSPEND] =
500502
PSCI_FN_NATIVE(0_2, CPU_SUSPEND);
501503
psci_ops.cpu_suspend = psci_cpu_suspend;

‎include/linux/psci.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ int psci_cpu_init_idle(unsigned int cpu);
2626
int psci_cpu_suspend_enter(unsigned long index);
2727

2828
struct psci_operations {
29+
u32 (*get_version)(void);
2930
int (*cpu_suspend)(u32 state, unsigned long entry_point);
3031
int (*cpu_off)(u32 state);
3132
int (*cpu_on)(unsigned long cpuid, unsigned long entry_point);

0 commit comments

Comments
 (0)