Commit fa744426 authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Juerg Haefliger

UBUNTU: SAUCE: early/late -- annotate indirect calls in early/late initialisation code

BugLink: http://bugs.launchpad.net/bugs/1758856Signed-off-by: default avatarAndy Whitcroft <apw@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
parent 6f2c371d
......@@ -2,6 +2,7 @@
#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
......@@ -37,6 +38,7 @@ wakeup_pmode_return:
# jump to place where we left off
movl saved_eip, %eax
ANNOTATE_RETPOLINE_SAFE
jmp *%eax
bogus_magic:
......
......@@ -5,6 +5,7 @@
#include <asm/page_types.h>
#include <asm/msr.h>
#include <asm/asm-offsets.h>
#include <asm/nospec-branch.h>
# Copyright 2003 Pavel Machek <pavel@suse.cz>, distribute under GPLv2
......@@ -32,6 +33,7 @@ ENTRY(wakeup_long64)
movq saved_rbp, %rbp
movq saved_rip, %rax
ANNOTATE_RETPOLINE_SAFE
jmp *%rax
ENDPROC(wakeup_long64)
......
......@@ -23,6 +23,7 @@
#include <asm/percpu.h>
#include <asm/nops.h>
#include <asm/bootparam.h>
#include <asm/nospec-branch.h>
/* Physical address */
#define pa(X) ((X) - __PAGE_OFFSET)
......@@ -257,6 +258,7 @@ page_pde_offset = (__PAGE_OFFSET >> 20);
movl pa(subarch_entries)(,%eax,4), %eax
subl $__PAGE_OFFSET, %eax
ANNOTATE_RETPOLINE_SAFE
jmp *%eax
bad_subarch:
......@@ -410,6 +412,7 @@ enable_paging:
movl setup_once_ref,%eax
andl %eax,%eax
jz 1f # Did we do this already?
ANNOTATE_RETPOLINE_SAFE
call *%eax
1:
......
......@@ -30,6 +30,7 @@
#include <asm/realmode.h>
#include <asm/x86_init.h>
#include <asm/efi.h>
#include <asm/nospec-branch.h>
/*
* Power off function, if any
......@@ -114,11 +115,11 @@ void __noreturn machine_real_restart(unsigned int type)
/* 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
......
......@@ -10,6 +10,7 @@
#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
......@@ -167,6 +168,7 @@ identity_mapped:
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 */
......
......@@ -11,6 +11,7 @@
#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
......@@ -172,6 +173,7 @@ identity_mapped:
1:
popq %rdx
leaq PAGE_SIZE(%r10), %rsp
ANNOTATE_RETPOLINE_SAFE
call *%rdx
/* get the re-entry point of the peer system */
......
......@@ -21,6 +21,7 @@
#include <asm/page_types.h>
#include <asm/asm-offsets.h>
#include <asm/processor-flags.h>
#include <asm/nospec-branch.h>
ENTRY(swsusp_arch_suspend)
movq $saved_context, %rax
......@@ -63,6 +64,7 @@ ENTRY(restore_image)
/* 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 */
......@@ -95,6 +97,7 @@ ENTRY(core_restore_code)
.Ldone:
/* jump to the restore_registers address from the image header */
ANNOTATE_RETPOLINE_SAFE
jmpq *%r8
/* code below belongs to the image kernel */
......
......@@ -22,6 +22,7 @@
#include <linux/linkage.h>
#include <asm/segment.h>
#include <asm/page_types.h>
#include <asm/nospec-branch.h>
#include "realmode.h"
.text
......@@ -60,6 +61,7 @@ ENTRY(trampoline_start)
.section ".text32","ax"
.code32
ENTRY(startup_32) # note: also used from wakeup_asm.S
ANNOTATE_RETPOLINE_SAFE
jmp *%eax
.bss
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment