Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp888793rwi; Wed, 19 Oct 2022 04:21:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4O/ntG05OfdFgUlEnCQK4pmOJs7gMwcogyIKMuZPdTTr5AgJ3aPA8ws4XqIoxrf5Jb8JGz X-Received: by 2002:a17:903:2285:b0:185:44df:d916 with SMTP id b5-20020a170903228500b0018544dfd916mr7893302plh.120.1666178478919; Wed, 19 Oct 2022 04:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666178478; cv=none; d=google.com; s=arc-20160816; b=DvWY1+sLOxIYnXZmoaCYPTRPTWE/O97DutK+fqO5iwZoN+ym/eMJPNal9eJq0xDGMr 5XazSctKGVvBsFKTd96x3YhSc1yss5MQU+IEWiZNixzdzWbufYQsNy3nvlrxPf/h009k dOyb42xtQHYzOpqTF2RT+sTWtxNTX3aMXme72e1m09kGfMVHg+iiNjLP42u1Z9Dpv+MI 2vADmTGhd4hi3OiaYmC+U1UAYuusl5tBSC0fv/vutT3+jGiBTNzZZTdqajBvFci5Vvvc MJgIycX0RrDTWzfp4gLw+4UVTVdYNvHy5YbCP12MIEC8RMcnq1yA3Bn8T0e5ptiTDghW cceQ== 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=MFX4ZSrcO7m2xJAjdkO2xTAd2S5HHmhfZ2B3IqNJOjlE5I8NbEBaUyf9ZsjTTZbJnv +YPPyaU0p+rJ4tH+nIyARljxsbijjOVbL1cGPpCaLsM8pMbP4qfnDEx9VqVIUZM7OKzF 74kJvIdphNbgWFFFAPAt/SUe4ZWeIX4DcCLvlCFMYkpX5NfwaPwyMXh2KEMJHW2uOA9o oICP15+LR5GUvaHNa7JXbjLInpEg2ly5aFxX1uaYRj/oCvYDeaJXyxi1P+eAQ4fOynAv FFFQhp5RcyRB2jTNwSE+AIH2JoEm0a+oKh4L+cNYbwkBZ/WqoRhKKpCBIClvcX4qRUUX V4RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qHIOTEOp; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f70-20020a636a49000000b0042b9117b723si17440502pgc.794.2022.10.19.04.21.04; Wed, 19 Oct 2022 04:21:18 -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=qHIOTEOp; 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 S232310AbiJSLLA (ORCPT + 99 others); Wed, 19 Oct 2022 07:11:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232369AbiJSLJt (ORCPT ); Wed, 19 Oct 2022 07:09:49 -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 1935E107CC4; Wed, 19 Oct 2022 03:38:15 -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 6AC17B823A7; Wed, 19 Oct 2022 09:06:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7783C433D7; Wed, 19 Oct 2022 09:06:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170417; bh=WsLm7DULaSh3XLEUh8TtPER6hSxauw/5gTEcKzR+ymA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qHIOTEOpCU7XnUUeOprUAYxWyjdvPt9t3kOs2xqhLLMnUvOsUF4W/ZpeqBehBx0Dl +Qk/qrfOu+42JgWLgRcWCd2w4CmYwCKh6NwKjz7C/aBgREzCf8Ymv0YAJaPDlWUQo6 niFb8ZXJAsZzkSzhBDxVsl30/NHp4OZvhZAGGJXQ= 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 6.0 648/862] linux/export: use inline assembler to populate symbol CRCs Date: Wed, 19 Oct 2022 10:32:15 +0200 Message-Id: <20221019083318.553316034@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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__ */ -- 2.35.1