From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752075AbeANLzB (ORCPT + 1 other); Sun, 14 Jan 2018 06:55:01 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:37631 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751907AbeANLzA (ORCPT ); Sun, 14 Jan 2018 06:55:00 -0500 Date: Sun, 14 Jan 2018 12:54:52 +0100 (CET) From: Thomas Gleixner To: Alexey Dobriyan cc: mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/alternatives: fixup alternative_call_2 In-Reply-To: <20171225150628.GA4803@avx2> Message-ID: References: <20171225150628.GA4803@avx2> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, 25 Dec 2017, Alexey Dobriyan wrote: > The following pattern fails to compile while the same pattern > with alternative_call() does. > > if (...) > alternative_call_2(...); > else > alternative_call_2(...); Sigh. Can we get an explanation WHY it fails ? > > Signed-off-by: Alexey Dobriyan > --- > > arch/x86/include/asm/alternative.h | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > --- a/arch/x86/include/asm/alternative.h > +++ b/arch/x86/include/asm/alternative.h > @@ -218,13 +218,11 @@ static inline int alternatives_text_reserved(void *start, void *end) > */ > #define alternative_call_2(oldfunc, newfunc1, feature1, newfunc2, feature2, \ > output, input...) \ > -{ \ > asm volatile (ALTERNATIVE_2("call %P[old]", "call %P[new1]", feature1,\ > "call %P[new2]", feature2) \ > : output, ASM_CALL_CONSTRAINT \ > : [old] "i" (oldfunc), [new1] "i" (newfunc1), \ > - [new2] "i" (newfunc2), ## input); \ > -} > + [new2] "i" (newfunc2), ## input) > > /* > * use this macro(s) if you need more than one output parameter >