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 X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 6FCFAC433E6 for ; Tue, 16 Mar 2021 17:46:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1D8206511D for ; Tue, 16 Mar 2021 17:46:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D8206511D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AD59B6B006C; Tue, 16 Mar 2021 13:46:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AAFC16B0070; Tue, 16 Mar 2021 13:46:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9264F6B0071; Tue, 16 Mar 2021 13:46:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0162.hostedemail.com [216.40.44.162]) by kanga.kvack.org (Postfix) with ESMTP id 794EB6B006C for ; Tue, 16 Mar 2021 13:46:21 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 391C38249980 for ; Tue, 16 Mar 2021 17:46:21 +0000 (UTC) X-FDA: 77926466562.12.B45AD36 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 3F891C000C44 for ; Tue, 16 Mar 2021 17:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615916775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n0Rc9AlR5VZpjh6F9+qzo94812lXmZf2NLEz1UriYA8=; b=CXJNDU41D3zeBB9tqmE7R8QaIDYwQR2DhbDcBPpXVfacR2fp/vHuGOBQquA+mxS3/AiNn4 p7liONeSwoCf760wWxra7+aroekEDGeYLFK2/aomjF2KQebtkClWm8S2fiETPjlsShy+e9 ele0LtPEN+PJA2tdG/YhIyNDavtPqYY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-279-nWhwtQY0MxqdtWFpKlBVrg-1; Tue, 16 Mar 2021 13:46:09 -0400 X-MC-Unique: nWhwtQY0MxqdtWFpKlBVrg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 508B4192D78B; Tue, 16 Mar 2021 17:46:07 +0000 (UTC) Received: from [10.36.114.203] (ovpn-114-203.ams2.redhat.com [10.36.114.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id B328A5D9C0; Tue, 16 Mar 2021 17:46:04 +0000 (UTC) Subject: Re: [PATCH] memblock: fix section mismatch warning again To: Mike Rapoport , Andrew Morton Cc: Arnd Bergmann , Mike Rapoport , Nick Desaulniers , clang-built-linux@googlegroups.com, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel test robot References: <20210316171347.14084-1-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Tue, 16 Mar 2021 18:46:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210316171347.14084-1-rppt@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Stat-Signature: jfc56ohgsg8qcgaxreu4u76m4j5ge9hs X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 3F891C000C44 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf03; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615916775-422170 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 16.03.21 18:13, Mike Rapoport wrote: > From: Mike Rapoport > > Commit 34dc2efb39a2 ("memblock: fix section mismatch warning") marked > memblock_bottom_up() and memblock_set_bottom_up() as __init, but they could > be referenced from non-init functions like memblock_find_in_range_node() on > architectures that enable CONFIG_ARCH_KEEP_MEMBLOCK. > > For such builds kernel test robot reports: > All warnings (new ones prefixed by >>, old ones prefixed by <<): > >>> WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up() > The function memblock_find_in_range_node() references > the function __init memblock_bottom_up(). > This is often because memblock_find_in_range_node lacks a __init > annotation or the annotation of memblock_bottom_up is wrong. > > Replace __init annotations with __init_memblock annotations so that the > appropriate section will be selected depending on > CONFIG_ARCH_KEEP_MEMBLOCK. > > Link: https://lore.kernel.org/lkml/202103160133.UzhgY0wt-lkp@intel.com > Fixes: 34dc2efb39a2 ("memblock: fix section mismatch warning") > Signed-off-by: Mike Rapoport > Reported-by: kernel test robot > Reviewed-by: Arnd Bergmann > --- > > @Andrew, please let me know if you'd prefer this merged via memblock tree. > > 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 d13e3cd938b4..5984fff3f175 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 __init void memblock_set_bottom_up(bool enable) > +static inline __init_memblock void memblock_set_bottom_up(bool enable) > { > memblock.bottom_up = enable; > } > @@ -470,7 +470,7 @@ static inline __init void memblock_set_bottom_up(bool enable) > * if this is true, that said, memblock will allocate memory > * in bottom-up direction. > */ > -static inline __init bool memblock_bottom_up(void) > +static inline __init_memblock bool memblock_bottom_up(void) > { > return memblock.bottom_up; > } > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb