Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1856370rwb; Fri, 19 Aug 2022 10:31:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Qd4gOTido6Z6AXTQNl11vKxyPhposBcc57TT2bq/HN25s+P59cmmEqN125V+lQCJAXMAQ X-Received: by 2002:a17:90a:a406:b0:1fa:da13:549e with SMTP id y6-20020a17090aa40600b001fada13549emr5902197pjp.182.1660930265834; Fri, 19 Aug 2022 10:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930265; cv=none; d=google.com; s=arc-20160816; b=F8D9+ZinyHFT9hAQkyC3LpIcMydDhMsB0baBA4GWlqVEOxX/bLe8UE+aX03S6vFkfi /zAgRXjmNxVGSft1LN+qm63Dokl3D1ochOARAMv4nwUXx1kTcw0L8bC0/tHL6Ihbn3MN E5NXdCakXSnT9mQXz0KCIhNFshuM1OfA17A0rbTMUsK1YPuM+Tn5Sigqwjmxp8Uqu1ZM LwRoIAiu3/PMe50V+qAk9vo2NL/6tyIYg1gCDHNjcrzlMfsN4iUHG0rMayeD1HQKSwWM HzbvGomrpnECL4hHf0Gog02N6lFyw3Yayfi4j9+FvRZkQacMqlHzEpt/6yHmhk5LTV/R f0Kw== 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=mMMz+ANE0aTDUTawaT4WD4qDtInFGxthP1jOZe0jjfE=; b=A0PoDhJT3AsT7JTElx8CQaou1zaWv26ghZqzMgPXhWlUj5z19Z161ZnZiymWOgLX22 U+YsLqRYWo/DDYBLgtT58dZRrxSJ8Po0+/FwHcfiaR4cdndyRrsJ7LJiPVza7kMEO99L WPbfAapkY1Kj1EYI1DXuUzzBZ+CPpnDt8+paf4OrDLy/xsILd0/7vPN1bhXBm6I93E+S ANkbdoDSnwUGK95rF15dgtLqYmbMrUGG87EROqKo30ypFc8gzUMK4i7Bohu+spEi3adF 8F90ICvQW28/wXulK4Gjysa59cT8ghcAajZJfqJjFt4Wrl+veyne1plfOvz/hREYHzUo 4eCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bFymP0oY; 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 t20-20020a170902e1d400b0017283063df2si3901536pla.334.2022.08.19.10.30.55; Fri, 19 Aug 2022 10:31: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=bFymP0oY; 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 S1354053AbiHSQsS (ORCPT + 99 others); Fri, 19 Aug 2022 12:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354017AbiHSQpl (ORCPT ); Fri, 19 Aug 2022 12:45:41 -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 2535212A1D7; Fri, 19 Aug 2022 09:11:52 -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 84CA5B82813; Fri, 19 Aug 2022 16:11:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEFAFC433C1; Fri, 19 Aug 2022 16:11:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925510; bh=SQXOfBhhjusfyQ7h7S2cvioqr/p4Hpbw5vz6sQzz1Wk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bFymP0oYRlPsetSxtQ9Ps0dQ7yE35DyE9teKmF4lF0ilvwRGmKl9vlsKPrJ8DY0oz gL4BQoze3r7lBQAf/VEBZ5KToCsgsJ+A2I0mLlj5Cf67MQC84ao3vAnr0CIIttP5g7 k5bYDsa1X3HoJpV5N5pb093sy57TdZ5uuHwF9JHc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, WANG Xuerui , Huacai Chen , Jarkko Sakkinen Subject: [PATCH 5.10 514/545] tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH Date: Fri, 19 Aug 2022 17:44:44 +0200 Message-Id: <20220819153852.507832822@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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.1 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,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 From: Huacai Chen commit bed4593645366ad7362a3aa7bc0d100d8d8236a8 upstream. If DEBUG_SECTION_MISMATCH enabled, __calc_tpm2_event_size() will not be inlined, this cause section mismatch like this: WARNING: modpost: vmlinux.o(.text.unlikely+0xe30c): Section mismatch in reference from the variable L0 to the function .init.text:early_ioremap() The function L0() references the function __init early_memremap(). This is often because L0 lacks a __init annotation or the annotation of early_ioremap is wrong. Fix it by using __always_inline instead of inline for the called-once function __calc_tpm2_event_size(). Fixes: 44038bc514a2 ("tpm: Abstract crypto agile event size calculations") Cc: stable@vger.kernel.org # v5.3 Reported-by: WANG Xuerui Signed-off-by: Huacai Chen Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman --- include/linux/tpm_eventlog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/tpm_eventlog.h +++ b/include/linux/tpm_eventlog.h @@ -157,7 +157,7 @@ struct tcg_algorithm_info { * Return: size of the event on success, 0 on failure */ -static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, +static __always_inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, struct tcg_pcr_event *event_header, bool do_mapping) {