From 2edaf4eadf333dbfd7724cfc7269f1b39b5b92b2 Mon Sep 17 00:00:00 2001 From: Christoph Muellner Date: Tue, 15 May 2018 23:44:01 +0200 Subject: [NOUPSTREAM] Verification helper for retpoline enablement. Signed-off-by: Christoph Muellner --- arch/arm64/kernel/cpu_errata.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 -- cgit v1.2.3