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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C1F8C4332F for ; Wed, 29 Sep 2021 03:30:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E64DD613D3 for ; Wed, 29 Sep 2021 03:30:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E64DD613D3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 3CA3794000B; Tue, 28 Sep 2021 23:30:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 378FF940009; Tue, 28 Sep 2021 23:30:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 267AC94000B; Tue, 28 Sep 2021 23:30:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0128.hostedemail.com [216.40.44.128]) by kanga.kvack.org (Postfix) with ESMTP id 1473E940009 for ; Tue, 28 Sep 2021 23:30:14 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AECF032097 for ; Wed, 29 Sep 2021 03:30:13 +0000 (UTC) X-FDA: 78639182706.23.1A32B96 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf29.hostedemail.com (Postfix) with ESMTP id 5A54A9000163 for ; Wed, 29 Sep 2021 03:30:13 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 3DADA6136A; Wed, 29 Sep 2021 03:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1632886212; bh=lAsZkVWCgtK9MeeRJYwB3NBoT+2DxJthR4/1O1TAIes=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dfVjJrubYTO47quRVYblsuacimy4FdB01c/nTYORGfFL1JUqj7Gjssp7j1DflRu19 DcZ6fguLWly3Lnj/eMqi4Cvk4LUTap0e9stLMmvC17RZxhUlHcPjGyoeqcfCrO0y4F gBEkAfZBr2ag37SjeuamGob5UZM6VN4l8mYqaQXw= Date: Tue, 28 Sep 2021 20:30:11 -0700 From: Andrew Morton To: Christophe Leroy Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arch@vger.kernel.org, Gerald Schaefer , Stephen Rothwell Subject: Re: [PATCH v2 2/4] mm: Make generic arch_is_kernel_initmem_freed() do what it says Message-Id: <20210928203011.da1f059b72be9ada7d67fe35@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 5A54A9000163 X-Stat-Signature: qakntcifgyamzp3u4cdycem5kbj7bekg Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=dfVjJrub; dmarc=none; spf=pass (imf29.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1632886213-823099 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 Tue, 28 Sep 2021 09:15:35 +0200 Christophe Leroy wrote: > Commit 7a5da02de8d6 ("locking/lockdep: check for freed initmem in > static_obj()") added arch_is_kernel_initmem_freed() which is supposed > to report whether an object is part of already freed init memory. > > For the time being, the generic version of arch_is_kernel_initmem_freed() > always reports 'false', allthough free_initmem() is generically called > on all architectures. > > Therefore, change the generic version of arch_is_kernel_initmem_freed() > to check whether free_initmem() has been called. If so, then check > if a given address falls into init memory. > > In order to use function init_section_contains(), the fonction is > moved at the end of asm-generic/section.h i386 allmodconfig: In file included from arch/x86/platform/intel-quark/imr.c:28: ./include/asm-generic/sections.h: In function 'arch_is_kernel_initmem_freed': ./include/asm-generic/sections.h:171:6: error: 'system_state' undeclared (first use in this function) 171 | if (system_state < SYSTEM_FREEING_INITMEM) | ^~~~~~~~~~~~ ./include/asm-generic/sections.h:171:6: note: each undeclared identifier is reported only once for each function it appears in ./include/asm-generic/sections.h:171:21: error: 'SYSTEM_FREEING_INITMEM' undeclared (first use in this function) 171 | if (system_state < SYSTEM_FREEING_INITMEM) | ^~~~~~~~~~~~~~~~~~~~~~ I don't think it would be a good idea to include kernel.h from sections.h - it's unclear to me which is the "innermost" of those two. It would be better to uninline arch_is_kernel_initmem_freed(). Surely there's no real reason for inlining it? Anyway, I'll drop the series for now.