Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751466AbbDHHSc (ORCPT ); Wed, 8 Apr 2015 03:18:32 -0400 Received: from mail-wg0-f48.google.com ([74.125.82.48]:33257 "EHLO mail-wg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751030AbbDHHSa (ORCPT ); Wed, 8 Apr 2015 03:18:30 -0400 Date: Wed, 8 Apr 2015 09:18:26 +0200 From: Ingo Molnar 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@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/asm/entry/64: Add forgotten CFI annotation Message-ID: <20150408071826.GA32374@gmail.com> References: <1428424967-14460-1-git-send-email-dvlasenk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428424967-14460-1-git-send-email-dvlasenk@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2641 Lines: 79 * Denys Vlasenko wrote: > Signed-off-by: Denys Vlasenko > CC: Linus Torvalds > CC: Steven Rostedt > CC: Ingo Molnar > CC: Borislav Petkov > CC: "H. Peter Anvin" > CC: Andy Lutomirski > CC: Oleg Nesterov > CC: Frederic Weisbecker > CC: Alexei Starovoitov > CC: Will Drewry > CC: Kees Cook > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/