Skip to content

Commit 8c1f755

Browse files
jpoimboeIngo Molnar
authored andcommitted
x86/entry/64: Add unwind hint annotations
Add unwind hint annotations to entry_64.S. This will enable the ORC unwinder to unwind through any location in the entry code including syscalls, interrupts, and exceptions. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: live-patching@vger.kernel.org Link: http://lkml.kernel.org/r/b9f6d478aadf68ba57c739dcfac34ec0dc021c4c.1499786555.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 39358a0 commit 8c1f755

File tree

3 files changed

+66
-11
lines changed

3 files changed

+66
-11
lines changed

arch/x86/entry/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Makefile for the x86 low level entry code
33
#
44

5-
OBJECT_FILES_NON_STANDARD_entry_$(BITS).o := y
65
OBJECT_FILES_NON_STANDARD_entry_64_compat.o := y
76

87
CFLAGS_syscall_64.o += $(call cc-option,-Wno-override-init,)

arch/x86/entry/calling.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <linux/jump_label.h>
2+
#include <asm/unwind_hints.h>
23

34
/*
45
@@ -112,6 +113,7 @@ For 32-bit we have the following conventions - kernel is built with
112113
movq %rdx, 12*8+\offset(%rsp)
113114
movq %rsi, 13*8+\offset(%rsp)
114115
movq %rdi, 14*8+\offset(%rsp)
116+
UNWIND_HINT_REGS offset=\offset extra=0
115117
.endm
116118
.macro SAVE_C_REGS offset=0
117119
SAVE_C_REGS_HELPER \offset, 1, 1, 1, 1
@@ -136,6 +138,7 @@ For 32-bit we have the following conventions - kernel is built with
136138
movq %r12, 3*8+\offset(%rsp)
137139
movq %rbp, 4*8+\offset(%rsp)
138140
movq %rbx, 5*8+\offset(%rsp)
141+
UNWIND_HINT_REGS offset=\offset
139142
.endm
140143

141144
.macro RESTORE_EXTRA_REGS offset=0
@@ -145,6 +148,7 @@ For 32-bit we have the following conventions - kernel is built with
145148
movq 3*8+\offset(%rsp), %r12
146149
movq 4*8+\offset(%rsp), %rbp
147150
movq 5*8+\offset(%rsp), %rbx
151+
UNWIND_HINT_REGS offset=\offset extra=0
148152
.endm
149153

150154
.macro RESTORE_C_REGS_HELPER rstor_rax=1, rstor_rcx=1, rstor_r11=1, rstor_r8910=1, rstor_rdx=1
@@ -167,6 +171,7 @@ For 32-bit we have the following conventions - kernel is built with
167171
.endif
168172
movq 13*8(%rsp), %rsi
169173
movq 14*8(%rsp), %rdi
174+
UNWIND_HINT_IRET_REGS offset=16*8
170175
.endm
171176
.macro RESTORE_C_REGS
172177
RESTORE_C_REGS_HELPER 1,1,1,1,1

0 commit comments

Comments
 (0)