diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2015-02-26 17:40:25 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-03-04 16:50:49 -0500 |
commit | 49db46a67bec9ca9e29ece4729a876195877af50 (patch) | |
tree | 9c20f9fa210d1befe2ea2346b8cd9452bcef0517 /arch/x86/include/asm/calling.h | |
parent | 69e8544cd0056e02965ffb5e8414fb7501a2ee2e (diff) |
x86/asm: Introduce push/pop macros which generate CFI_REL_OFFSET and CFI_RESTORE
Sequences:
pushl_cfi %reg
CFI_REL_OFFSET reg, 0
and:
popl_cfi %reg
CFI_RESTORE reg
happen quite often. This patch adds macros which generate them.
No assembly changes (verified with objdump -dr vmlinux.o).
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Will Drewry <wad@chromium.org>
Link: http://lkml.kernel.org/r/1421017655-25561-1-git-send-email-dvlasenk@redhat.com
Link: http://lkml.kernel.org/r/2202eb90f175cf45d1b2d1c64dbb5676a8ad07ad.1424989793.git.luto@amacapital.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/calling.h')
-rw-r--r-- | arch/x86/include/asm/calling.h | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/arch/x86/include/asm/calling.h b/arch/x86/include/asm/calling.h index 1f1297b46f83..3c711f2ab236 100644 --- a/arch/x86/include/asm/calling.h +++ b/arch/x86/include/asm/calling.h | |||
@@ -210,37 +210,23 @@ For 32-bit we have the following conventions - kernel is built with | |||
210 | */ | 210 | */ |
211 | 211 | ||
212 | .macro SAVE_ALL | 212 | .macro SAVE_ALL |
213 | pushl_cfi %eax | 213 | pushl_cfi_reg eax |
214 | CFI_REL_OFFSET eax, 0 | 214 | pushl_cfi_reg ebp |
215 | pushl_cfi %ebp | 215 | pushl_cfi_reg edi |
216 | CFI_REL_OFFSET ebp, 0 | 216 | pushl_cfi_reg esi |
217 | pushl_cfi %edi | 217 | pushl_cfi_reg edx |
218 | CFI_REL_OFFSET edi, 0 | 218 | pushl_cfi_reg ecx |
219 | pushl_cfi %esi | 219 | pushl_cfi_reg ebx |
220 | CFI_REL_OFFSET esi, 0 | ||
221 | pushl_cfi %edx | ||
222 | CFI_REL_OFFSET edx, 0 | ||
223 | pushl_cfi %ecx | ||
224 | CFI_REL_OFFSET ecx, 0 | ||
225 | pushl_cfi %ebx | ||
226 | CFI_REL_OFFSET ebx, 0 | ||
227 | .endm | 220 | .endm |
228 | 221 | ||
229 | .macro RESTORE_ALL | 222 | .macro RESTORE_ALL |
230 | popl_cfi %ebx | 223 | popl_cfi_reg ebx |
231 | CFI_RESTORE ebx | 224 | popl_cfi_reg ecx |
232 | popl_cfi %ecx | 225 | popl_cfi_reg edx |
233 | CFI_RESTORE ecx | 226 | popl_cfi_reg esi |
234 | popl_cfi %edx | 227 | popl_cfi_reg edi |
235 | CFI_RESTORE edx | 228 | popl_cfi_reg ebp |
236 | popl_cfi %esi | 229 | popl_cfi_reg eax |
237 | CFI_RESTORE esi | ||
238 | popl_cfi %edi | ||
239 | CFI_RESTORE edi | ||
240 | popl_cfi %ebp | ||
241 | CFI_RESTORE ebp | ||
242 | popl_cfi %eax | ||
243 | CFI_RESTORE eax | ||
244 | .endm | 230 | .endm |
245 | 231 | ||
246 | #endif /* CONFIG_X86_64 */ | 232 | #endif /* CONFIG_X86_64 */ |