From patchwork Sat Oct 22 07:26:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1141288wrr; Sat, 22 Oct 2022 03:28:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6w3Y30OF5N3QYVgaaMBGM0lk6gkhuUily6MrZqmhh36lTZdG3NvstVH7+YmYkJ1ZLZk1FA X-Received: by 2002:aa7:c6c1:0:b0:460:f684:901a with SMTP id b1-20020aa7c6c1000000b00460f684901amr10959125eds.6.1666434485420; Sat, 22 Oct 2022 03:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666434485; cv=none; d=google.com; s=arc-20160816; b=GgqaoW3M2iRCfA+Ep5djnXpjvSFLZUTKj99AwRbB71ESwEyZwQHawKlJYNcxWZ15hK 9BYAUJmIynzV+dg85ZAQeOYeFKJNMeHGP8/0YF1Gz7MV8JMiF5leCYdVEd2d+bqYrYyF G3BXamN9YXkHFTo46WmQ7jdN479BsL1InGDJi04OS8VA9GguCivXJxKmXO59okXMCcwo BfiayNNcFfjZ/ixJhBqCidaOIzersYFr51mM4imcl4yhpjcfjyGgEISAmLIOFEvVMhRt bPt37kI1ZWd/YSzWu7ao9+gWbn60Aw5t2AJVVL6gh6hBiwObXkIPBDYdi9Bw/jeMU0nN /RtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EwC22GEKUDudLWUoYsqY6JUPbS1ZmXWczO/JHYxxqPs=; b=r4gxT1uAlZPfmKYW9XXjPS/Jgxv3lItVBHZfXBTNudIgpiVExxfxBYNZdleXvidVQt L+QaWUdWliGnWILbwQvrePw/4MHaSfVreQ2xna91uquD0RNvASG24aXjO7RHWPA5XxQy znvPRTP3/iZpn2wBsZhZdBFtd18yi9fEcAanam6Cw9lwpkNhu9gNJu4uuDjRtGBzhQOx ySnX5oGCSNE+pPd26TbKZF+A1n9C/gr+LRdvGA66VulDBVmtq+EmjhqhkV70Sl9zAGpo X+ng374dV4lSzI+0KpblJlT5gt+lskZxVUKQEK5GGFWQbMbyRASkZOS9nmim9YZuoH4a tN5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rmFTavuU; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd33-20020a17090762a100b007879bc7eacfsi23266224ejc.93.2022.10.22.03.27.33; Sat, 22 Oct 2022 03:28: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=@linuxfoundation.org header.s=korg header.b=rmFTavuU; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230086AbiJVKVV (ORCPT + 99 others); Sat, 22 Oct 2022 06:21:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230010AbiJVKUq (ORCPT ); Sat, 22 Oct 2022 06:20:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C35D31D5A3; Sat, 22 Oct 2022 02:37:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F0D64B82E35; Sat, 22 Oct 2022 08:00:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C69AC433D7; Sat, 22 Oct 2022 08:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425617; bh=WsLm7DULaSh3XLEUh8TtPER6hSxauw/5gTEcKzR+ymA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rmFTavuUkooxzmbugtnm0pGLkApoysBWN0zW9v6D9/SgSSCoxY7K0wcNUTcAfdJ4s rq81ZODUEpjmiVKA8jhWbeIU4IPr5QtoVL6xPwnMoHXSryGuZvhUzbOeYNoW9+y29d nhWnemO9NjkA6vj3UzPWVWC4Q8hCGSBCrpSMpsKo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yann Sionneau , Masahiro Yamada , Sasha Levin Subject: [PATCH 5.19 529/717] linux/export: use inline assembler to populate symbol CRCs Date: Sat, 22 Oct 2022 09:26:48 +0200 Message-Id: <20221022072521.710779092@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747383207061951662?= X-GMAIL-MSGID: =?utf-8?q?1747383207061951662?= From: Masahiro Yamada [ Upstream commit f3304ecd7f060db1d4197fbdce5a503259f770d3 ] Since commit 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS"), the module versioning on the (non-upstreamed-yet) kvx Linux port is broken due to unexpected padding for __crc_* symbols. The kvx GCC adds padding so u32 gets 8-byte alignment instead of 4. I do not know if this happens for upstream architectures in general, but any compiler has the freedom to insert padding for faster access. Use the inline assembler to directly specify the wanted data layout. This is how we previously did before the breakage. Link: https://lore.kernel.org/lkml/20220817161438.32039-1-ysionneau@kalray.eu/ Link: https://lore.kernel.org/linux-kbuild/31ce5305-a76b-13d7-ea55-afca82c46cf2@kalray.eu/ Fixes: 7b4537199a4a ("kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS") Reported-by: Yann Sionneau Signed-off-by: Masahiro Yamada Tested-by: Yann Sionneau Signed-off-by: Sasha Levin --- include/linux/export-internal.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/export-internal.h b/include/linux/export-internal.h index c2b1d4fd5987..fe7e6ba918f1 100644 --- a/include/linux/export-internal.h +++ b/include/linux/export-internal.h @@ -10,8 +10,10 @@ #include #include -/* __used is needed to keep __crc_* for LTO */ #define SYMBOL_CRC(sym, crc, sec) \ - u32 __section("___kcrctab" sec "+" #sym) __used __crc_##sym = crc + asm(".section \"___kcrctab" sec "+" #sym "\",\"a\"" "\n" \ + "__crc_" #sym ":" "\n" \ + ".long " #crc "\n" \ + ".previous" "\n") #endif /* __LINUX_EXPORT_INTERNAL_H__ */