Skip to content

Commit 7614e91

Browse files
Andi KleenKAGA-KOKO
authored andcommitted
x86/retpoline/irq32: Convert assembler indirect jumps
Convert all indirect jumps in 32bit irq inline asm code to use non speculative sequences. Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Arjan van de Ven <[email protected]> Acked-by: Ingo Molnar <[email protected]> Cc: [email protected] Cc: Rik van Riel <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: [email protected] Cc: Peter Zijlstra <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Kees Cook <[email protected]> Cc: Tim Chen <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Paul Turner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 5096732 commit 7614e91

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arch/x86/kernel/irq_32.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/mm.h>
2121

2222
#include <asm/apic.h>
23+
#include <asm/nospec-branch.h>
2324

2425
#ifdef CONFIG_DEBUG_STACKOVERFLOW
2526

@@ -55,11 +56,11 @@ DEFINE_PER_CPU(struct irq_stack *, softirq_stack);
5556
static void call_on_stack(void *func, void *stack)
5657
{
5758
asm volatile("xchgl %%ebx,%%esp \n"
58-
"call *%%edi \n"
59+
CALL_NOSPEC
5960
"movl %%ebx,%%esp \n"
6061
: "=b" (stack)
6162
: "0" (stack),
62-
"D"(func)
63+
[thunk_target] "D"(func)
6364
: "memory", "cc", "edx", "ecx", "eax");
6465
}
6566

@@ -95,11 +96,11 @@ static inline int execute_on_irq_stack(int overflow, struct irq_desc *desc)
9596
call_on_stack(print_stack_overflow, isp);
9697

9798
asm volatile("xchgl %%ebx,%%esp \n"
98-
"call *%%edi \n"
99+
CALL_NOSPEC
99100
"movl %%ebx,%%esp \n"
100101
: "=a" (arg1), "=b" (isp)
101102
: "0" (desc), "1" (isp),
102-
"D" (desc->handle_irq)
103+
[thunk_target] "D" (desc->handle_irq)
103104
: "memory", "cc", "ecx");
104105
return 1;
105106
}

0 commit comments

Comments
 (0)