* [PATCH] x86/asm/entry/64: Add forgotten CFI annotation
@ 2015-04-07 16:42 Denys Vlasenko
2015-04-08 7:18 ` Ingo Molnar
2015-04-08 7:43 ` [tip:x86/asm] " tip-bot for Denys Vlasenko
0 siblings, 2 replies; 3+ messages in thread
From: Denys Vlasenko @ 2015-04-07 16:42 UTC (permalink / raw)
To: Ingo Molnar
Cc: Denys Vlasenko, Linus Torvalds, Steven Rostedt, Borislav Petkov,
H. Peter Anvin, Andy Lutomirski, Oleg Nesterov,
Frederic Weisbecker, Alexei Starovoitov, Will Drewry, Kees Cook,
x86, linux-kernel
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: Linus Torvalds <torvalds@linux-foundation.org>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Ingo Molnar <mingo@kernel.org>
CC: Borislav Petkov <bp@alien8.de>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: Andy Lutomirski <luto@amacapital.net>
CC: Oleg Nesterov <oleg@redhat.com>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Alexei Starovoitov <ast@plumgrid.com>
CC: Will Drewry <wad@chromium.org>
CC: Kees Cook <keescook@chromium.org>
CC: x86@kernel.org
CC: linux-kernel@vger.kernel.org
---
arch/x86/kernel/entry_64.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 65485b3..15261ba 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -429,6 +429,7 @@ return_from_execve:
1:
/* must use IRET code path (pt_regs->cs may have changed) */
addq $8, %rsp
+ CFI_ADJUST_CFA_OFFSET -8
ZERO_EXTRA_REGS
movq %rax,RAX(%rsp)
jmp int_ret_from_sys_call
--
1.8.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/asm/entry/64: Add forgotten CFI annotation
2015-04-07 16:42 [PATCH] x86/asm/entry/64: Add forgotten CFI annotation Denys Vlasenko
@ 2015-04-08 7:18 ` Ingo Molnar
2015-04-08 7:43 ` [tip:x86/asm] " tip-bot for Denys Vlasenko
1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2015-04-08 7:18 UTC (permalink / raw)
To: Denys Vlasenko
Cc: Linus Torvalds, Steven Rostedt, Borislav Petkov, H. Peter Anvin,
Andy Lutomirski, Oleg Nesterov, Frederic Weisbecker,
Alexei Starovoitov, Will Drewry, Kees Cook, x86, linux-kernel
* Denys Vlasenko <dvlasenk@redhat.com> wrote:
> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
> CC: Linus Torvalds <torvalds@linux-foundation.org>
> CC: Steven Rostedt <rostedt@goodmis.org>
> CC: Ingo Molnar <mingo@kernel.org>
> CC: Borislav Petkov <bp@alien8.de>
> CC: "H. Peter Anvin" <hpa@zytor.com>
> CC: Andy Lutomirski <luto@amacapital.net>
> CC: Oleg Nesterov <oleg@redhat.com>
> CC: Frederic Weisbecker <fweisbec@gmail.com>
> CC: Alexei Starovoitov <ast@plumgrid.com>
> CC: Will Drewry <wad@chromium.org>
> CC: Kees Cook <keescook@chromium.org>
> CC: x86@kernel.org
> CC: linux-kernel@vger.kernel.org
> ---
> arch/x86/kernel/entry_64.S | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
> index 65485b3..15261ba 100644
> --- a/arch/x86/kernel/entry_64.S
> +++ b/arch/x86/kernel/entry_64.S
> @@ -429,6 +429,7 @@ return_from_execve:
> 1:
> /* must use IRET code path (pt_regs->cs may have changed) */
> addq $8, %rsp
> + CFI_ADJUST_CFA_OFFSET -8
> ZERO_EXTRA_REGS
> movq %rax,RAX(%rsp)
> jmp int_ret_from_sys_call
So given that this is a pretty common pattern:
triton:~/tip> git grep -A 1 'addq.*%rsp' arch/x86/kernel/entry_64.S
arch/x86/kernel/entry_64.S: addq $8, %rsp
arch/x86/kernel/entry_64.S- CFI_ADJUST_CFA_OFFSET -8
--
arch/x86/kernel/entry_64.S: addq $8, %rsp
arch/x86/kernel/entry_64.S- DEFAULT_FRAME 0
--
arch/x86/kernel/entry_64.S: addq $8, %rsp
arch/x86/kernel/entry_64.S- DEFAULT_FRAME 0
--
arch/x86/kernel/entry_64.S: addq $-0x80,(%rsp) /* Adjust vector to [-256,-1] range */
arch/x86/kernel/entry_64.S- interrupt do_IRQ
--
arch/x86/kernel/entry_64.S: addq $0x30,%rsp
arch/x86/kernel/entry_64.S- CFI_ADJUST_CFA_OFFSET -0x30
--
arch/x86/kernel/entry_64.S: addq $0x30,%rsp
arch/x86/kernel/entry_64.S- CFI_ADJUST_CFA_OFFSET -0x30
--
arch/x86/kernel/entry_64.S: addq $(6*8), %rsp
arch/x86/kernel/entry_64.S- CFI_ADJUST_CFA_OFFSET -6*8
--
arch/x86/kernel/entry_64.S: addq $(10*8), %rsp
arch/x86/kernel/entry_64.S- CFI_ADJUST_CFA_OFFSET -10*8
it might make sense to introduce addq_cfi, to further hide the dwarf
uglies?
btw., doesn't:
arch/x86/kernel/entry_64.S: addq $-0x80,(%rsp) /* Adjust vector to [-256,-1] range */
before the do_IRQ() call need a CFI adjustment as well?
Thanks,
Ingo
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:x86/asm] x86/asm/entry/64: Add forgotten CFI annotation
2015-04-07 16:42 [PATCH] x86/asm/entry/64: Add forgotten CFI annotation Denys Vlasenko
2015-04-08 7:18 ` Ingo Molnar
@ 2015-04-08 7:43 ` tip-bot for Denys Vlasenko
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Denys Vlasenko @ 2015-04-08 7:43 UTC (permalink / raw)
To: linux-tip-commits
Cc: mingo, wad, tglx, brgerst, ast, rostedt, keescook, luto,
fweisbec, hpa, bp, linux-kernel, dvlasenk, torvalds, oleg
Commit-ID: 8b3607b5b8c591d8bf045911cb7c90ecaa6e7b73
Gitweb: http://git.kernel.org/tip/8b3607b5b8c591d8bf045911cb7c90ecaa6e7b73
Author: Denys Vlasenko <dvlasenk@redhat.com>
AuthorDate: Tue, 7 Apr 2015 18:42:47 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 8 Apr 2015 09:18:36 +0200
x86/asm/entry/64: Add forgotten CFI annotation
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
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: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Drewry <wad@chromium.org>
Link: http://lkml.kernel.org/r/1428424967-14460-1-git-send-email-dvlasenk@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/entry_64.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 4ca03c5..3197f41 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -506,6 +506,7 @@ return_from_execve:
1:
/* must use IRET code path (pt_regs->cs may have changed) */
addq $8, %rsp
+ CFI_ADJUST_CFA_OFFSET -8
ZERO_EXTRA_REGS
movq %rax,RAX(%rsp)
jmp int_ret_from_sys_call
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-08 7:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-07 16:42 [PATCH] x86/asm/entry/64: Add forgotten CFI annotation Denys Vlasenko
2015-04-08 7:18 ` Ingo Molnar
2015-04-08 7:43 ` [tip:x86/asm] " tip-bot for Denys Vlasenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.