OSDN Git Service

arm64: cpufeature: Pass capability structure to ->enable callback
authorWill Deacon <will.deacon@arm.com>
Tue, 2 Jan 2018 21:37:25 +0000 (21:37 +0000)
committerSrinivas Ramana <sramana@codeaurora.org>
Tue, 6 Feb 2018 14:33:49 +0000 (20:03 +0530)
In order to invoke the CPU capability ->matches callback from the ->enable
callback for applying local-CPU workarounds, we need a handle on the
capability structure.

This patch passes a pointer to the capability structure to the ->enable
callback.

Change-Id: Ie9a18c7a5d721dcb3d3d6c6001c74366525cf87e
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Git-commit: 0a0d111d40fd1dc588cc590fab6b55d86ddc71d3
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
arch/arm64/kernel/cpufeature.c

index 766c54c..2666ac2 100644 (file)
@@ -871,7 +871,8 @@ void __init enable_cpu_capabilities(const struct arm64_cpu_capabilities *caps)
                         * uses an IPI, giving us a PSTATE that disappears when
                         * we return.
                         */
-                       stop_machine(caps[i].enable, NULL, cpu_online_mask);
+                       stop_machine(caps[i].enable, (void *)&caps[i],
+                                                       cpu_online_mask);
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
@@ -986,7 +987,7 @@ void verify_local_cpu_capabilities(void)
                if (!feature_matches(__raw_read_system_reg(caps[i].sys_reg), &caps[i]))
                        fail_incapable_cpu("arm64_features", &caps[i]);
                if (caps[i].enable)
-                       caps[i].enable(NULL);
+                       caps[i].enable((void *)&caps[i]);
        }
 
        for (i = 0, caps = arm64_hwcaps; caps[i].matches; i++) {