x86/power: Annotate indirect branches as safe
authorJosh Poimboeuf <jpoimboe@redhat.com>
Thu, 21 Jan 2021 21:29:34 +0000 (15:29 -0600)
committerJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 26 Jan 2021 17:33:04 +0000 (11:33 -0600)
These indirect jumps are harmless; annotate them to make objtool's
retpoline validation happy.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/ba7a141c98f2c09c255b19bf78ee4a5f45d4ecb6.1611263462.git.jpoimboe@redhat.com
arch/x86/power/hibernate_asm_64.S

index 7918b8415f132dbb6a8f9fc6f9d5f48b7bef7891..715509d94fa349efb95cdaa2cb8773f8e57e8389 100644 (file)
@@ -21,6 +21,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/processor-flags.h>
 #include <asm/frame.h>
+#include <asm/nospec-branch.h>
 
 SYM_FUNC_START(swsusp_arch_suspend)
        movq    $saved_context, %rax
@@ -66,6 +67,7 @@ SYM_CODE_START(restore_image)
 
        /* jump to relocated restore code */
        movq    relocated_restore_code(%rip), %rcx
+       ANNOTATE_RETPOLINE_SAFE
        jmpq    *%rcx
 SYM_CODE_END(restore_image)
 
@@ -97,6 +99,7 @@ SYM_CODE_START(core_restore_code)
 
 .Ldone:
        /* jump to the restore_registers address from the image header */
+       ANNOTATE_RETPOLINE_SAFE
        jmpq    *%r8
 SYM_CODE_END(core_restore_code)