Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4987194rwe; Mon, 17 Apr 2023 23:49:35 -0700 (PDT) X-Google-Smtp-Source: AKy350aNvxlbbEK0AdDcy9YPL40LjTU5OxPi+S4I9F1aeXLV2sLCqEJcGAEVduIIfMPoO/INFeAY X-Received: by 2002:a17:902:f544:b0:1a6:9906:1eae with SMTP id h4-20020a170902f54400b001a699061eaemr1268165plf.36.1681800575414; Mon, 17 Apr 2023 23:49:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681800575; cv=none; d=google.com; s=arc-20160816; b=B3IIIkAslFXFPW5BaPMm2vFwHPfSNKrQbPrEL7+/W7uNsvrwWrh9V6j5vOArSsBle5 uLDU5BnJ76wj3CnwVUcUAjqKgXsBeYMbjuaqKggazXqxEgtkku/XfZSSGULsW8ydufu8 4lH4tweeoDBUy+/dHmcIVPhMS7drMNchu041spI1X3Fr3xpwrmPIq8spkWyb/+cLyMiP 2GrdeqPG+2Sk9BpMO8Fj1zR6FEJD4vxNOYo0l3N9JYZK9xGWxUFuTcw+8hJLt3RUcNld HvJvG0woGqdAtWwaTR16ccKRHJuI1pRET+wwUuYc2RLFrrp7fMjBeQEjbS4ubMyXJKXM rMmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=kY5fTg1/hjnDQAYC6FQv8akXgLdIdxWsuUWP4XAvCNw=; b=hOnPI8NO1x96SbiAoE1sLQhY5bl1/aaKPn6wCYqKtRA3fjVFSQvotQJnF0042YWaXC s/GkOyORwQGvhj8nDn6JpHCb7LtWIPUwFJ47NvwrliSTjRA9G2/FDIV8f5tLH3Jgda1o boKXjFyfYkl1bKPfChgJsEKA6JTyO606cv7UWD0gAQxmpeIbI2hmaoaRjjiFppqbW8y8 nHkjAiDJdfbmNScB6AAJAXae4QtBMX0NS26A2fcvTsQUaFiSzgcToo0dC1310F+JDUdV Mnpc7XeKjMTeT8Li8nj7LeHnFJNf0wh3C8edaCtWQsJUIph9/n6eO6XcqBm+d8OSLa5o atAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a170903024500b001a1deff6062si14223868plh.281.2023.04.17.23.49.20; Mon, 17 Apr 2023 23:49:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbjDRGnW (ORCPT + 99 others); Tue, 18 Apr 2023 02:43:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbjDRGnR (ORCPT ); Tue, 18 Apr 2023 02:43:17 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 09D131FFD for ; Mon, 17 Apr 2023 23:43:14 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 33I6gYsK021620; Tue, 18 Apr 2023 08:42:34 +0200 From: Willy Tarreau To: Borislav Petkov Cc: Jingbo Xu , tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH] x86/alternatives: fix build issue with binutils before 2.28 Date: Tue, 18 Apr 2023 08:42:28 +0200 Message-Id: <20230418064228.21577-1-w@1wt.eu> X-Mailer: git-send-email 2.17.5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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__ -- 2.35.3