OSDN Git Service

drivers/firmware: Expose psci_get_version through psci_ops structure
authorWill Deacon <will.deacon@arm.com>
Tue, 2 Jan 2018 21:45:41 +0000 (21:45 +0000)
committerSrinivas Ramana <sramana@codeaurora.org>
Tue, 6 Feb 2018 14:33:53 +0000 (20:03 +0530)
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.

Change-Id: Id6edce067d098ed7aca19ad9321c858c89097966
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-commit: d68e3ba5303f7e1099f51fdcd155f5263da8569b
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
drivers/firmware/psci.c
include/linux/psci.h

index c7382d4..07dc692 100644 (file)
@@ -431,6 +431,8 @@ static void __init psci_init_migrate(void)
 static void __init psci_0_2_set_functions(void)
 {
        pr_info("Using standard PSCI v0.2 function IDs\n");
+       psci_ops.get_version = psci_get_version;
+
        psci_function_id[PSCI_FN_CPU_SUSPEND] =
                                        PSCI_FN_NATIVE(0_2, CPU_SUSPEND);
        psci_ops.cpu_suspend = psci_cpu_suspend;
index 393efe2..66499dd 100644 (file)
@@ -28,6 +28,7 @@ int psci_cpu_init_idle(unsigned int cpu);
 int psci_cpu_suspend_enter(unsigned long index);
 
 struct psci_operations {
+       u32 (*get_version)(void);
        int (*cpu_suspend)(u32 state, unsigned long entry_point);
        int (*cpu_off)(u32 state);
        int (*cpu_on)(unsigned long cpuid, unsigned long entry_point);