From 67128b5b2bc2de2b1c1995e11f4d2f44a57e3b94 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Tue, 20 Mar 2018 12:50:00 +0000 Subject: [PATCH] UBUNTU: SAUCE: early/late -- annotate indirect calls in early/late initialisation code BugLink: http://bugs.launchpad.net/bugs/1758856 Signed-off-by: Andy Whitcroft Signed-off-by: Seth Forshee --- arch/x86/kernel/acpi/wakeup_32.S | 2 ++ arch/x86/kernel/head_32.S | 1 + arch/x86/kernel/reboot.c | 5 +++-- arch/x86/kernel/relocate_kernel_32.S | 1 + arch/x86/realmode/rm/trampoline_32.S | 2 ++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S index cf69081073b5..7534db1d5b4a 100644 --- a/arch/x86/kernel/acpi/wakeup_32.S +++ b/arch/x86/kernel/acpi/wakeup_32.S @@ -3,6 +3,7 @@ #include #include #include +#include # Copyright 2003, 2008 Pavel Machek #include #include +#include /* Physical address */ #define pa(X) ((X) - __PAGE_OFFSET) diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 6bea19d4a0ca..2592f7b46694 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -31,6 +31,7 @@ #include #include #include +#include /* * Power off function, if any @@ -118,11 +119,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 diff --git a/arch/x86/kernel/relocate_kernel_32.S b/arch/x86/kernel/relocate_kernel_32.S index c7c4b1917336..d4d065b6f2f8 100644 --- a/arch/x86/kernel/relocate_kernel_32.S +++ b/arch/x86/kernel/relocate_kernel_32.S @@ -9,6 +9,7 @@ #include #include #include +#include /* * Must be relocatable PIC code callable as a C function, in particular diff --git a/arch/x86/realmode/rm/trampoline_32.S b/arch/x86/realmode/rm/trampoline_32.S index 3fad907a179f..578e8b1e2522 100644 --- a/arch/x86/realmode/rm/trampoline_32.S +++ b/arch/x86/realmode/rm/trampoline_32.S @@ -23,6 +23,7 @@ #include #include #include +#include #include "realmode.h" .text @@ -59,6 +60,7 @@ SYM_CODE_END(trampoline_start) .section ".text32","ax" .code32 SYM_CODE_START(startup_32) # note: also used from wakeup_asm.S + ANNOTATE_RETPOLINE_SAFE jmp *%eax SYM_CODE_END(startup_32)