From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA4D2C77B71 for ; Tue, 18 Apr 2023 08:09:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230143AbjDRIJH (ORCPT ); Tue, 18 Apr 2023 04:09:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231143AbjDRIJF (ORCPT ); Tue, 18 Apr 2023 04:09:05 -0400 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB9D67ABC for ; Tue, 18 Apr 2023 01:08:32 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VgOfNHv_1681805096; Received: from 30.221.131.28(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VgOfNHv_1681805096) by smtp.aliyun-inc.com; Tue, 18 Apr 2023 16:04:57 +0800 Message-ID: Date: Tue, 18 Apr 2023 16:04:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] x86/alternatives: fix build issue with binutils before 2.28 To: Willy Tarreau , Borislav Petkov Cc: tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org References: <20230418064228.21577-1-w@1wt.eu> Content-Language: en-US From: Jingbo Xu In-Reply-To: <20230418064228.21577-1-w@1wt.eu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/18/23 2:42 PM, Willy Tarreau wrote: > The usage of the BIT() macro in asm code was introduced in 6.3 in by > commit 5d1dd961e743 ("x86/alternatives: Add alt_instr.flags") but this > macro uses "1UL" in the shift operations, while gas before 2.28 do not > support the "L" suffix after a number, and those before 2.27 do not > support the "U" suffix, resulting in build errors such as the following > with such versions: > > ./arch/x86/include/asm/uaccess_64.h:124: Error: found 'L', expected: ')' > ./arch/x86/include/asm/uaccess_64.h:124: Error: junk at end of line, > first unrecognized character is `L' > > There's a single use of this macro here, let's revert to (1 << 0) that > works with such older binutils. > > Cc: Jingbo Xu > Cc: Borislav Petkov > Cc: "H. Peter Anvin" > Link: https://lore.kernel.org/lkml/a9aae568-3046-306c-bd71-92c1fc8eeddc@linux.alibaba.com/ > Signed-off-by: Willy Tarreau > --- > > Boris, I understood from your message that 2.28 was the first working version, > so that's what I mentioned here. My tests showed that 2.27 wasn't sufficient > and that 2.29 was OK. If I was wrong and it's 2.29 instead, feel free to edit > the subject line, description and the comment, I'm totally fine with this! > > > arch/x86/include/asm/alternative.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h > index e2975a32d443..b119685c0b31 100644 > --- a/arch/x86/include/asm/alternative.h > +++ b/arch/x86/include/asm/alternative.h > @@ -8,7 +8,7 @@ > > #define ALT_FLAGS_SHIFT 16 > > -#define ALT_FLAG_NOT BIT(0) > +#define ALT_FLAG_NOT (1 << 0) /* note: gas < 2.28 can't use BIT(0) */ > #define ALT_NOT(feature) ((ALT_FLAG_NOT << ALT_FLAGS_SHIFT) | (feature)) > > #ifndef __ASSEMBLY__ It works for me. Tested-by: Jingbo Xu -- Thanks, Jingbo