From patchwork Mon Mar 15 13:55:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 400476 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3468464jai; Mon, 15 Mar 2021 07:23:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/OIiVA79RURpuAGgJyiNiwU4aMiIqIvBC9FFWAGm7mLhl96FDY31Ybb4cyJssDttOAdPp X-Received: by 2002:a50:fe08:: with SMTP id f8mr29844102edt.217.1615817781614; Mon, 15 Mar 2021 07:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817781; cv=none; d=google.com; s=arc-20160816; b=YLba7H5Weu09zZIPYflJba4kGSSO2alx8fE7AzHDzD3tfrGk7mAUSIHOmV4pl7rdX9 F/TsYdm2kYOw2juaZ2/H37phz8vSM7W0CvpoqiUiS/YdVwR+owsOZUwQSCO8NCPrfsyH 8Bu0sIDBEpuSV8U9HrOubtGdhQBuYCgJvbS3swrYRSihsHmrfKpBJJv7fpdBjvcLfxFs /ONzc3mysMYtaquz/g60F9/AWM8FMRg2jru6Q01MbWQrVFYR/ty8Y/UggFi2VoqmfOBq 45alzF+uL41aUlgFRFqCFpWOi2tdZymZVCyumR2TsodKpC3DHRkj2y/Ypt1pAIsxbvwj gccg== 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=0aQUwnIDnqmHZKnQMmdQWj7sZljDb+dSlgXow+pItXE=; b=OIvhUdfY/wZHcI6R/RIILUR/BElvJyxZFqd6/Pj1ZaymVmlAwGh+LZ2CJhX4SCjI53 GX+CerImzdL6xJ9iUXGJtFcZrnF/dlDzP1ornsJe7PCCERzEqg5gBKD+yAXerf3zqa4h n8QEYftGFIILACg42C3YPZOu8BXiVdPvMY2/VZl1dPBtsAco1qMXSdOiVXHu4/xEIKf6 dCE8xZrqT1dDMPt+FicsQ0XNrDI9tUDhwmzoNk59Jr4WyzuFn2K4DvpNcPbMuOG8NWJj zm6eWfgGrBBSNoniQJjZEPPksqy6MY/DGAyy0v2NZiGvI6UoLSPjp59x+P4d/nE8C7pm xEfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JzCiHcsl; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h21si993553ede.37.2021.03.15.07.16.21; Mon, 15 Mar 2021 07:16:21 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JzCiHcsl; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S232071AbhCOOJS (ORCPT + 12 others); Mon, 15 Mar 2021 10:09:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:50102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234504AbhCOODq (ORCPT ); Mon, 15 Mar 2021 10:03:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D6C6664EE3; Mon, 15 Mar 2021 14:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615817025; bh=LhpoZ0uUhZh39UDjgMmZOu5gqIsck3d/R/PafC0L0CM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JzCiHcsljwFXzuyWLJ4NeHPTPTSv/0matAbNQCl6g5BJt6PCzEQ4PhwwCOZO2DjGW FcSHpQlpa1CVgQxALUdSLcq+exVXGy/Ewm1Nlaa/jIyDTNWQZ5ipyHH6i8nQNrcgP3 xjfS7wJJzX+4m25HZmrvCqihabj6WCvXeBoUQb2s= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , David Hildenbrand , Mike Rapoport , Nathan Chancellor , Nick Desaulniers , Faiyaz Mohammed , Baoquan He , Thomas Bogendoerfer , Aslan Bakirov , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 5.11 265/306] memblock: fix section mismatch warning Date: Mon, 15 Mar 2021 14:55:28 +0100 Message-Id: <20210315135516.595578150@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Greg Kroah-Hartman From: Arnd Bergmann [ Upstream commit 34dc2efb39a231280fd6696a59bbe712bf3c5c4a ] The inlining logic in clang-13 is rewritten to often not inline some functions that were inlined by all earlier compilers. In case of the memblock interfaces, this exposed a harmless bug of a missing __init annotation: WARNING: modpost: vmlinux.o(.text+0x507c0a): Section mismatch in reference from the function memblock_bottom_up() to the variable .meminit.data:memblock The function memblock_bottom_up() references the variable __meminitdata memblock. This is often because memblock_bottom_up lacks a __meminitdata annotation or the annotation of memblock is wrong. Interestingly, these annotations were present originally, but got removed with the explanation that the __init annotation prevents the function from getting inlined. I checked this again and found that while this is the case with clang, gcc (version 7 through 10, did not test others) does inline the functions regardless. As the previous change was apparently intended to help the clang builds, reverting it to help the newer clang versions seems appropriate as well. gcc builds don't seem to care either way. Link: https://lkml.kernel.org/r/20210225133808.2188581-1-arnd@kernel.org Fixes: 5bdba520c1b3 ("mm: memblock: drop __init from memblock functions to make it inline") Reference: 2cfb3665e864 ("include/linux/memblock.h: add __init to memblock_set_bottom_up()") Signed-off-by: Arnd Bergmann Reviewed-by: David Hildenbrand Reviewed-by: Mike Rapoport Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Faiyaz Mohammed Cc: Baoquan He Cc: Thomas Bogendoerfer Cc: Aslan Bakirov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/linux/memblock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.30.1 diff --git a/include/linux/memblock.h b/include/linux/memblock.h index b93c44b9121e..7643d2dfa959 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -460,7 +460,7 @@ static inline void memblock_free_late(phys_addr_t base, phys_addr_t size) /* * Set the allocation direction to bottom-up or top-down. */ -static inline void memblock_set_bottom_up(bool enable) +static inline __init void memblock_set_bottom_up(bool enable) { memblock.bottom_up = enable; } @@ -470,7 +470,7 @@ static inline void memblock_set_bottom_up(bool enable) * if this is true, that said, memblock will allocate memory * in bottom-up direction. */ -static inline bool memblock_bottom_up(void) +static inline __init bool memblock_bottom_up(void) { return memblock.bottom_up; }