Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933941AbbFJU0k (ORCPT ); Wed, 10 Jun 2015 16:26:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37632 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752277AbbFJU0b (ORCPT ); Wed, 10 Jun 2015 16:26:31 -0400 Date: Wed, 10 Jun 2015 15:26:29 -0500 From: Josh Poimboeuf To: Andy Lutomirski Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Michal Marek , Peter Zijlstra , Andy Lutomirski , Borislav Petkov , Linus Torvalds , Andi Kleen , X86 ML , live-patching@vger.kernel.org, "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation Message-ID: <20150610202629.GE1125@treble.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1550 Lines: 38 On Wed, Jun 10, 2015 at 11:24:05AM -0700, Andy Lutomirski wrote: > Slightly off-topic, but this reminds me: when writing inline asm that > needs to push to the stack (for whatever reason), it's incredibly > messy to get the annotations right -- they're different depending on > whether the previous frame base (is that what "CFA" is?) is currently > sp + constant, in which case we need an annotation adjusting the > constant or whether it's independent of sp (bp + constant), in which > case we shouldn't adjust the offset. (If it's some other function of > sp, we're screwed.) > > Regardless of whether these types of annotations end up being done by > hand or by script, should we consider asking the binutils people to > give us some nice .cfi_adjust_for_push and .cfi_adjust_for_pop or > similar directives? Hm, that's a tough one. Might be worth asking... Another alternative would be to ask gcc to make a change to always setup the frame pointer for any function which has inline assembly, so that you know (hopefully) that CFA is based on bp. Or, maybe there's already a way to force gcc to do that with the asm directive somehow? > > See here for Jan Beulich's solution, which is incomprehensible to me: > > http://thread.gmane.org/gmane.linux.kernel/1820765 -- Josh -- 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/