From patchwork Mon May 18 17:37:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225781 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40A6FC433E0 for ; Mon, 18 May 2020 17:57:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D06620715 for ; Mon, 18 May 2020 17:57:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589824667; bh=MT8t/Y/qjbY9lEmvs0LhPBNuEWj5pnEFucUdNsbCr0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=aMhs6t0CqjAAMrPXo+Y6xmr8m5QBRUoc++d0PGfRhSyNQNMb/WOaWXLLxmEPmQUVr yEJtrGTi4QafhdOfp/vOFXyEHNE7yx+lsLkiZ0wh842dL/PEGmwepH0PFYu5F5iWg9 dwZmcOXdoU7akUcU2pa721+aNh5KqrESA8vD+ing= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731488AbgERR5o (ORCPT ); Mon, 18 May 2020 13:57:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:36486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731837AbgERR5n (ORCPT ); Mon, 18 May 2020 13:57:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CE49220674; Mon, 18 May 2020 17:57:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589824662; bh=MT8t/Y/qjbY9lEmvs0LhPBNuEWj5pnEFucUdNsbCr0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qZMQfDiq2IXiqd8kaDRqUUPyYyDhfvts1jRPPN4iAxDv4DKjCixkV4s1VmuUOrWPe esYt2/wYQiNrVTwnRryD0v1ah8hOtFp/YwdF/o8Iv6v251PMdn2jSa4BdpmZpF2roZ Vjldm/KG2ZA1obnH0fB4tTixSPQQCNXk7DAdA/ec= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Torvalds Subject: [PATCH 5.4 101/147] gcc-10: mark more functions __init to avoid section mismatch warnings Date: Mon, 18 May 2020 19:37:04 +0200 Message-Id: <20200518173525.986717228@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200518173513.009514388@linuxfoundation.org> References: <20200518173513.009514388@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Torvalds commit e99332e7b4cda6e60f5b5916cf9943a79dbef902 upstream. It seems that for whatever reason, gcc-10 ends up not inlining a couple of functions that used to be inlined before. Even if they only have one single callsite - it looks like gcc may have decided that the code was unlikely, and not worth inlining. The code generation difference is harmless, but caused a few new section mismatch errors, since the (now no longer inlined) function wasn't in the __init section, but called other init functions: Section mismatch in reference from the function kexec_free_initrd() to the function .init.text:free_initrd_mem() Section mismatch in reference from the function tpm2_calc_event_log_size() to the function .init.text:early_memremap() Section mismatch in reference from the function tpm2_calc_event_log_size() to the function .init.text:early_memunmap() So add the appropriate __init annotation to make modpost not complain. In both cases there were trivially just a single callsite from another __init function. Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- drivers/firmware/efi/tpm.c | 2 +- init/initramfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/drivers/firmware/efi/tpm.c +++ b/drivers/firmware/efi/tpm.c @@ -16,7 +16,7 @@ int efi_tpm_final_log_size; EXPORT_SYMBOL(efi_tpm_final_log_size); -static int tpm2_calc_event_log_size(void *data, int count, void *size_info) +static int __init tpm2_calc_event_log_size(void *data, int count, void *size_info) { struct tcg_pcr_event2_head *header; int event_size, size = 0; --- a/init/initramfs.c +++ b/init/initramfs.c @@ -534,7 +534,7 @@ void __weak free_initrd_mem(unsigned lon } #ifdef CONFIG_KEXEC_CORE -static bool kexec_free_initrd(void) +static bool __init kexec_free_initrd(void) { unsigned long crashk_start = (unsigned long)__va(crashk_res.start); unsigned long crashk_end = (unsigned long)__va(crashk_res.end);