summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Muellner <christoph.muellner@theobroma-systems.com>2018-05-15 23:44:01 +0200
committerChristoph Muellner <christoph.muellner@theobroma-systems.com>2018-05-16 12:04:02 +0200
commit2edaf4eadf333dbfd7724cfc7269f1b39b5b92b2 (patch)
tree8f285faf7653e00c685939bdd796d6f14bae7f9d
parent99460611802f2b9e1d40d924bfd022c39bedb7b4 (diff)
[NOUPSTREAM] Verification helper for retpoline enablement.arm64-for-upstream-24534b35
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
-rw-r--r--arch/arm64/kernel/cpu_errata.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
index a76b839c0354..507331da387a 100644
--- a/arch/arm64/kernel/cpu_errata.c
+++ b/arch/arm64/kernel/cpu_errata.c
@@ -376,6 +376,19 @@ ssize_t cpu_show_spectre_v2(struct device *dev,
struct device_attribute *attr,
char *buf)
{
+#if 1
+ /* Do not upstream! */
+ /* nop has binary representation d503201f */
+ uint32_t *ptr;
+ size_t i;
+ extern void __aarch64_indirect_thunk_x0(void);
+
+ ptr = (uint32_t*)&__aarch64_indirect_thunk_x0;
+ for (i=0; i<9; i++) {
+ printk("%p: 0x%x\n", ptr, *ptr);
+ ptr++;
+ }
+#endif
return sprintf(buf, "%s%s\n", spectre_v2_strings[spectre_v2_enabled],
spectre_v2_module_string());
}
@@ -387,6 +400,8 @@ enable_retpoline(const struct arm64_cpu_capabilities *entry)
{
spectre_v2_enabled = retp_compiler() ? SPECTRE_V2_RETPOLINE_GENERIC :
SPECTRE_V2_RETPOLINE_MINIMAL;
+
+ printk("Enabling retpoline!\n");
}
#endif