From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751162AbdFAN5s (ORCPT ); Thu, 1 Jun 2017 09:57:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:36280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751058AbdFAN5q (ORCPT ); Thu, 1 Jun 2017 09:57:46 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FCA623A10 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org MIME-Version: 1.0 In-Reply-To: <5ec63cefd2093152464b7bb1383938f6970e65eb.1496293620.git.jpoimboe@redhat.com> References: <5ec63cefd2093152464b7bb1383938f6970e65eb.1496293620.git.jpoimboe@redhat.com> From: Andy Lutomirski Date: Thu, 1 Jun 2017 06:57:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 05/10] objtool, x86: add facility for asm code to provide CFI hints To: Josh Poimboeuf Cc: X86 ML , "linux-kernel@vger.kernel.org" , live-patching@vger.kernel.org, Linus Torvalds , Andy Lutomirski , Jiri Slaby , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra 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 Wed, May 31, 2017 at 10:44 PM, Josh Poimboeuf wrote: > Some asm (and inline asm) code does special things to the stack which > objtool can't understand. (Nor can GCC or GNU assembler, for that > matter.) In such cases we need a facility for the code to provide > annotations, so the unwinder can unwind through it. > > This provides such a facility, in the form of CFI hints. They're > similar to the GNU assembler .cfi* directives, but they give more > information, and are needed in far fewer places, because objtool can > fill in the blanks by following branches and adjusting the stack pointer > for pushes and pops. Two minor suggestions: Could you prefix these with something other than "CFI_"? For those of use who have read the binutils manual, using "CFI_" sounds awfully like .cfi_, and people might expect the semantics to be the same. > +#define CFI_HINT(cfa_reg, cfa_offset, type) \ > + "999: \n\t" \ Have you checked if 999 is used elsewhere? My personal preference is to use: .Ldescriptive_text_\@: instead of a hopefully-unique number. I never researched the history, but I suspect that the convention of using large numbers came from early binutils versions that didn't have \@, but we use \@ fairly extensively in the kernel these days, so it would seem that we no longer support binutils versions that old.