From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757119AbbALT0F (ORCPT ); Mon, 12 Jan 2015 14:26:05 -0500 Received: from mail-lb0-f176.google.com ([209.85.217.176]:36659 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757096AbbALT0B (ORCPT ); Mon, 12 Jan 2015 14:26:01 -0500 MIME-Version: 1.0 In-Reply-To: <20150112192314.GF3904@pd.tnic> References: <1421017655-25561-1-git-send-email-dvlasenk@redhat.com> <20150112192314.GF3904@pd.tnic> From: Andy Lutomirski Date: Mon, 12 Jan 2015 11:25:39 -0800 Message-ID: Subject: Re: [PATCH] x86: introduce push/pop macros which generate CFI_REL_OFFSET and CFI_RESTORE To: Borislav Petkov Cc: Denys Vlasenko , "linux-kernel@vger.kernel.org" , Linus Torvalds , Oleg Nesterov , "H. Peter Anvin" , Frederic Weisbecker , X86 ML , Alexei Starovoitov , Will Drewry , Kees Cook Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 12, 2015 at 11:23 AM, Borislav Petkov wrote: > On Mon, Jan 12, 2015 at 12:07:35AM +0100, Denys Vlasenko wrote: >> 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). > > ... > >> diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h >> index f6f1598..de1cdaf 100644 >> --- a/arch/x86/include/asm/dwarf2.h >> +++ b/arch/x86/include/asm/dwarf2.h >> @@ -86,11 +86,23 @@ >> CFI_ADJUST_CFA_OFFSET 8 >> .endm >> >> + .macro pushq_cfi_reg reg >> + pushq %\reg >> + CFI_ADJUST_CFA_OFFSET 8 >> + CFI_REL_OFFSET \reg, 0 >> + .endm > > What's wrong with adding the CFI_REL_OFFSET to the pushl/popl_cfi macro > and not add two new _reg macros? > > I.e., have the _cfi macros add all the CFI annotations needed. > I think that some users don't want the CFI_REL_OFFSET. Also, there's that pesky % sign. --Andy > -- > Regards/Gruss, > Boris. > > Sent from a fat crate under my desk. Formatting is fine. > -- -- Andy Lutomirski AMA Capital Management, LLC