Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3247966rwe; Mon, 29 Aug 2022 08:14:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR6FytiB3Q7C162g9sJDyxKx9dehmrIz/nIVit4+R1NHjRqudBFw0s+KVda5gx+ygnIxrsSf X-Received: by 2002:a17:90b:1b08:b0:1f5:b65:9654 with SMTP id nu8-20020a17090b1b0800b001f50b659654mr19085901pjb.77.1661786045810; Mon, 29 Aug 2022 08:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661786045; cv=none; d=google.com; s=arc-20160816; b=ldEVPH/r6Pp3jiMjgRgCzGyfIRDI954SYQ+d/wAyO+Mz8xRh9nnF0F5Nd8XdlEoUQR EoqMZnVcuWhEBBLCNWfbEneZSOIAVme+vyZqbf+i+8GjjLSbJkILWuuUOW6CN5v3gIM2 8tSVQ3h5EtPfb1Wmv8WCaHj+MJCWr05bm4sHqgWf4fviJRaHqv/gRNAMIV+HndDMf4CA FOcLCuquVmnmYO9wR8zNLC1D5txK0R8rGdXk4ESReftnvdkbAUNlAltFI2dTnz6ZQfBT 0mRP8FJ3CIi1dqCi50NSojC3gzfp7jwqEhx7aMt+y/4JDXVrtsnCYmpxsGv2e6vWdjdn 9AAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=Ye7G0Ndu6fF4ecPmM+TVr3M5lrIwZfFdc3cBUT3yGxU=; b=x5xyWCc4i0zFmYJnTwdOF7852IhTHlY7pH523Y/+DmytXkIpVu4nDyk14A62Va3DEr WooWWDtvDM+QtlcSZoWEaWQK604//0Koubzy5NzUyYZpaEJpGG4AYI3vEBaf3SJ3lR4C 4nCrsR/NiEKYwYQvu0nv4PZMFUZ4HweJm2d4TkfMHnBgc6AItFS5YjUx7VJ2zlz4kJEp RO33i0pKLNubc2s874V6yFRz8pMoyzedYNRpdWYQBsUwWH6Ki0+aqIQ/CcGECV3lPZkP Mp0n0Zhc43w4mq0OUpUrtInsytDlBrTZ86BmwC/8qlA898a2Lj1RMahLvhvNbDEe86cR qh8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=SNXxaCpV; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6-20020a170903024600b001726d843055si10154529plh.378.2022.08.29.08.13.54; Mon, 29 Aug 2022 08:14:05 -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; dkim=pass header.i=@xry111.site header.s=default header.b=SNXxaCpV; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229685AbiH2PCu (ORCPT + 99 others); Mon, 29 Aug 2022 11:02:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiH2PCs (ORCPT ); Mon, 29 Aug 2022 11:02:48 -0400 Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55C0485A9C for ; Mon, 29 Aug 2022 08:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1661785363; bh=P0So/d1QHvZh/G4+ijTFNIkaXwtW+51RX8yFY1F9e6Y=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=SNXxaCpVH8BLpiKMYNfVMPX5HvyElAUAwMtcmZu+HwbE9GvPxhY4zfKNj8bUsS1mp wcaJ9lbFKot2YOykwAPcPcp9EsvTkJnNAXPmsp5bmPbjNNfFohHlF4ZpHESvi2IH8e B6ZK9xOP0qQ5U4biZl12cXlO6f9kHChQInPCLmww= Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 34143667AA; Mon, 29 Aug 2022 11:02:42 -0400 (EDT) Message-ID: <5f9d3aa5fad957dae2f14e483b3b79dbcf9e794d.camel@xry111.site> Subject: Re: [PATCH v6 3/6] LoongArch: Use model("extreme") attribute for per-CPU variables in module if CONFIG_AS_HAS_EXPLICIT_RELOCS From: Xi Ruoyao To: loongarch@lists.linux.dev Cc: linux-kernel@vger.kernel.org, WANG Xuerui , Huacai Chen , Youling Tang , Jinyang He Date: Mon, 29 Aug 2022 23:02:40 +0800 In-Reply-To: <20220829133146.15236-4-xry111@xry111.site> References: <20220829133146.15236-1-xry111@xry111.site> <20220829133146.15236-4-xry111@xry111.site> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, PDS_OTHER_BAD_TLD,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Mon, 2022-08-29 at 21:31 +0800, Xi Ruoyao wrote: > diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile > index 1563747c4fa8..593818a61741 100644 > --- a/arch/loongarch/Makefile > +++ b/arch/loongarch/Makefile > @@ -53,6 +53,9 @@ LDFLAGS_vmlinux=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0+=3D -G0 -static -n -nostdlib > =C2=A0# combination of a "new" assembler and "old" compiler is not suppor= ted.=C2=A0 Either > =C2=A0# upgrade the compiler or downgrade the assembler. > =C2=A0ifdef CONFIG_AS_HAS_EXPLICIT_RELOCS > +ifeq ($(shell echo '__has_attribute(model)' | $(CC) -E -P - 2> /dev/null= ), 0) > +$(error "C compiler must support model attribute if using explicit reloc= s") > +endif Self review: I'm wondering if we really need this thing... There won't be a GCC version released with explicit relocation but without model attribute (GCC 13 starts to support them both). But without a check, if someone uses an early GCC 13 snapshot and ignores the -Wattributes warning, the system will suddenly blow up loading a module with per-CPU variable defined. Maybe "-Werror=3Dattributes" is better, but is it OK to add a -Werror=3D option for entire Linux tree? > =C2=A0cflags-y=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0+=3D -mexplicit-relocs > =C2=A0else > =C2=A0cflags-y=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0+=3D $(call cc-option,-mno-explicit-relocs) --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University