From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751629AbdINSpd (ORCPT ); Thu, 14 Sep 2017 14:45:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52720 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751447AbdINSpc (ORCPT ); Thu, 14 Sep 2017 14:45:32 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B04C5883C7 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jpoimboe@redhat.com Date: Thu, 14 Sep 2017 13:45:29 -0500 From: Josh Poimboeuf To: Linus Torvalds Cc: Ingo Molnar , the arch/x86 maintainers , Linux Kernel Mailing List , Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Alexander Potapenko , Dmitriy Vyukov , Matthias Kaehlcke , Arnd Bergmann , Peter Zijlstra Subject: Re: [RFC PATCH 3/4] x86/asm: Make alternative macro interfaces more clear and consistent Message-ID: <20170914184529.6k3q6yz3rnhlatsj@treble> References: <20fac125eed15c916f684e27dfca753d524c6725.1504186968.git.jpoimboe@redhat.com> <20170831172542.k5qchwmgckdcnc6d@treble> <20170831173132.i5y5p4gdmm4iv3h3@treble> <20170902103221.5gw5vtxxknprzgdr@gmail.com> <20170914144820.4blzmlqeqc7unpod@treble> <20170914172627.sp2yrecpawovvxxy@treble> <20170914173348.jeddpkfc52dj2jvq@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 14 Sep 2017 18:45:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 14, 2017 at 11:28:30AM -0700, Linus Torvalds wrote: > On Thu, Sep 14, 2017 at 10:33 AM, Josh Poimboeuf wrote: > >> > >> a) uglifying the 15 or so relevant inline asm locations with ifdefs; or > > > > Actually I guess we could put the "sp" in a macro... I'll try it. > > Exactly. Do something like > > #ifdef CONFIG_FRAME_POINTER > # define EXTRA_ASM_CLOBBERS "rsp" > #else > # define EXTRA_ASM_CLOBBERS > #endif > > and then replace the nasty > > register void *__sp asm(_ASM_SP); > .. > "+r" (__sp) > > games with just that EXTRA_ASM_CLOBBERS thing at the end of the clobbers. > > Yes, you'd probably have to document that the alternative_call_2() > thing doesn't take a "input" argument, but a input_and_clobbers, but > all users do that anyway. > > I dunno. There's also alternative_call(), which doesn't yet have the '__rsp' annotation, but it probably should. It has some callers which pass clobbers and some which don't, so its conversion would be trickier. So my plan is to keep patch 3 of this series, which clarifies those alternative macro interfaces, and also separates the inputs from the clobbers. That'll make it really easy to add something like EXTRA_ASM_CLOBBERS above. In fact I'll probably keep patches 1-3, because they're all improvements. Then I'll replace the original patch 4 (ASM_CALL) with the "sp" clobbers thing. -- Josh