#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/page_types.h>
+#include <asm/nospec-branch.h>
# Copyright 2003, 2008 Pavel Machek <pavel@suse.cz>, distribute under GPLv2
# jump to place where we left off
movl saved_eip, %eax
+ ANNOTATE_RETPOLINE_SAFE
jmp *%eax
bogus_magic:
#include <asm/msr.h>
#include <asm/asm-offsets.h>
#include <asm/frame.h>
+#include <asm/nospec-branch.h>
# Copyright 2003 Pavel Machek <pavel@suse.cz>, distribute under GPLv2
movq saved_rbp, %rbp
movq saved_rip, %rax
+ ANNOTATE_RETPOLINE_SAFE
jmp *%rax
ENDPROC(wakeup_long64)
#include <asm/bootparam.h>
#include <asm/export.h>
#include <asm/pgtable_32.h>
+#include <asm/nospec-branch.h>
/* Physical address */
#define pa(X) ((X) - __PAGE_OFFSET)
movl pa(subarch_entries)(,%eax,4), %eax
subl $__PAGE_OFFSET, %eax
+ ANNOTATE_RETPOLINE_SAFE
jmp *%eax
.Lbad_subarch:
movl setup_once_ref,%eax
andl %eax,%eax
jz 1f # Did we do this already?
+ ANNOTATE_RETPOLINE_SAFE
call *%eax
1:
#include <asm/realmode.h>
#include <asm/x86_init.h>
#include <asm/efi.h>
+#include <asm/nospec-branch.h>
/*
* Power off function, if any
/* Jump to the identity-mapped low memory code */
#ifdef CONFIG_X86_32
- asm volatile("jmpl *%0" : :
+ asm volatile(ANNOTATE_RETPOLINE_SAFE "jmpl *%0" : :
"rm" (real_mode_header->machine_real_restart_asm),
"a" (type));
#else
- asm volatile("ljmpl *%0" : :
+ asm volatile(ANNOTATE_RETPOLINE_SAFE "ljmpl *%0" : :
"m" (real_mode_header->machine_real_restart_asm),
"D" (type));
#endif
#include <asm/page_types.h>
#include <asm/kexec.h>
#include <asm/processor-flags.h>
+#include <asm/nospec-branch.h>
/*
* Must be relocatable PIC code callable as a C function
movl CP_PA_SWAP_PAGE(%edi), %esp
addl $PAGE_SIZE, %esp
2:
+ ANNOTATE_RETPOLINE_SAFE
call *%edx
/* get the re-entry point of the peer system */
#include <asm/kexec.h>
#include <asm/processor-flags.h>
#include <asm/pgtable_types.h>
+#include <asm/nospec-branch.h>
/*
* Must be relocatable PIC code callable as a C function
1:
popq %rdx
leaq PAGE_SIZE(%r10), %rsp
+ ANNOTATE_RETPOLINE_SAFE
call *%rdx
/* get the re-entry point of the peer system */
#include <asm/asm-offsets.h>
#include <asm/processor-flags.h>
#include <asm/frame.h>
+#include <asm/nospec-branch.h>
ENTRY(swsusp_arch_suspend)
movq $saved_context, %rax
/* jump to relocated restore code */
movq relocated_restore_code(%rip), %rcx
+ ANNOTATE_RETPOLINE_SAFE
jmpq *%rcx
/* code below has been relocated to a safe page */
.Ldone:
/* jump to the restore_registers address from the image header */
+ ANNOTATE_RETPOLINE_SAFE
jmpq *%r8
/* code below belongs to the image kernel */
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/page_types.h>
+#include <asm/nospec-branch.h>
#include "realmode.h"
.text
.section ".text32","ax"
.code32
ENTRY(startup_32) # note: also used from wakeup_asm.S
+ ANNOTATE_RETPOLINE_SAFE
jmp *%eax
.bss
#include <asm/boot.h>
#include <asm/processor-flags.h>
#include <asm/msr.h>
+#include <asm/nospec-branch.h>
#include <xen/interface/elfnote.h>
__HEAD
/* startup_64 expects boot_params in %rsi. */
mov $_pa(pvh_bootparams), %rsi
mov $_pa(startup_64), %rax
+ ANNOTATE_RETPOLINE_SAFE
jmp *%rax
#else /* CONFIG_X86_64 */