From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AC6CC43334 for ; Mon, 11 Jul 2022 02:59:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229543AbiGKC7c (ORCPT ); Sun, 10 Jul 2022 22:59:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbiGKC7b (ORCPT ); Sun, 10 Jul 2022 22:59:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 351341134; Sun, 10 Jul 2022 19:59:31 -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 dfw.source.kernel.org (Postfix) with ESMTPS id C5372610E7; Mon, 11 Jul 2022 02:59:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D01B4C3411E; Mon, 11 Jul 2022 02:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657508370; bh=IzH5LW9SfJuIzkKecrju8ZriX6rvi9ne+jAVO+HAdRg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QfYAVUU76Dmfz1CEMa1gEFRYnV8Vg/3shiPxp/2Zf4yw15BpELzFgCynIWOie75tf JYpj4Oj3376apRXRVXNiBUahi82sep9JCQkPHbP/CvfOfCEjhA9UE4OiZItEY4UOE2 PQ1NkelcbzULlLMVlTNfU3560qloclwqgTAn49UM8v9CND58vMgfxz0W2poGOfjoLP U0kppS1KuIyw5ZCG7xRAy1trkWToaKnlPZRqGXU2KIlCH2g6MWOAo6StyM9moEfH3U mLYZvDEepRt6ExwCDSjEHGH1u+NO+Pq6cwgJd/25OL/OxbEN/METibwgbXnRFew6Um AktsV6dIrTJ2A== Date: Mon, 11 Jul 2022 05:59:25 +0300 From: Jarkko Sakkinen To: Huacai Chen Cc: Peter Huewe , Jason Gunthorpe , linux-integrity@vger.kernel.org, Xuefeng Li , Huacai Chen , Jiaxun Yang , stable@vger.kernel.org, WANG Xuerui Subject: Re: [PATCH V2] tpm: eventlog: Fix section mismatch for DEBUG_SECTION_MISMATCH Message-ID: References: <20220711011738.3219487-1-chenhuacai@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220711011738.3219487-1-chenhuacai@loongson.cn> Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On Mon, Jul 11, 2022 at 09:17:38AM +0800, Huacai Chen wrote: > 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 > Reported-by: WANG Xuerui > Signed-off-by: Huacai Chen > --- > V2: Add Fixes tag and cc stable@vger.kernel.org > > include/linux/tpm_eventlog.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h > index 739ba9a03ec1..20c0ff54b7a0 100644 > --- 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) > { > -- > 2.31.1 > Reviewed-by: Jarkko Sakkinen BR, Jarkko