Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3529053pxf; Mon, 15 Mar 2021 11:34:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+DaITX25pFD6Pk3pG2G4X6b2gLuCFc9/Yk4PffEHTdhp0j0yUd5L/TAkFJ1w5bMgqA4Kv X-Received: by 2002:a17:906:6817:: with SMTP id k23mr24699238ejr.6.1615833294950; Mon, 15 Mar 2021 11:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833294; cv=none; d=google.com; s=arc-20160816; b=HN3yeJbxQjC/qrLqH2BV5ubpDhPxihxKbJ0Q7IPJe017VLGnSCnQ7JrSJHgGUcDWKO tEivvufhJZIQVrZ/1XY96GHc9y8gZPGUJR+SOctIPcsluH/Ygw4GM683Oc02jPzSH12g iNfaWKjrFfiCIZBKp6lZRt/DtZrykTrTKYhnZy666iJM+1+kUXZucKCBUY5db21HJ/+Q eppfFoyHhWE6B68FxDPH7Jgeoi29YsfaOcy28uNHCqN1EODj39nPWqLuejcXrZe7kV+t Pn93u5NK4F1zgvaJhN8ep69D0ZiMIa/7DKcE9zKS0cJVCrWaLIfNBHrv5UrGRPKnlefs TFBQ== 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=CbOaUENNAk5fodtRJhjQQxXoE52RmW2OtWgmpujwdoOk7848psQsEwWpLL+SehThqg r8qzJGEPy6msPSV64rKtVj5L9zZc3KEfAPgZN4KZhAfbZuQiWUou5nY3B/gBtPH6ABHJ uf2wWdNJRYu/uY7IL9IRD+eDdRuM0Epn+0utkfJic2mfDR/A2V7i8Mt2vM+NDoqLjHjf 2/e9JzjOcG/7fKz1Y0LSzUuNiOcqnjBcu1JYLGmtKbDr98Owp9nKyqc6GsTWnGCwf1kM wcBg3bE7b5xGOckCOILq8n5u1kEBjRgp9Lc6kUOsQamocb+yFlhdtG6vl8NveOchTKin FQ2w== 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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si12648871ejg.224.2021.03.15.11.34.32; Mon, 15 Mar 2021 11:34:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238780AbhCOOoO (ORCPT + 99 others); Mon, 15 Mar 2021 10:44:14 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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; } -- 2.30.1