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 6B86EC433EF for ; Sat, 25 Sep 2021 12:24:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4927761038 for ; Sat, 25 Sep 2021 12:24:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244930AbhIYM0G (ORCPT ); Sat, 25 Sep 2021 08:26:06 -0400 Received: from pegase2.c-s.fr ([93.17.235.10]:46137 "EHLO pegase2.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244846AbhIYM0E (ORCPT ); Sat, 25 Sep 2021 08:26:04 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4HGp4C0qcGz9sW9; Sat, 25 Sep 2021 14:24:27 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17h4qlarqDac; Sat, 25 Sep 2021 14:24:27 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4HGp4B75d8z9sW6; Sat, 25 Sep 2021 14:24:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id DF4FC8B76D; Sat, 25 Sep 2021 14:24:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id FSeUYn7msvyu; Sat, 25 Sep 2021 14:24:26 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.203.8]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A860D8B763; Sat, 25 Sep 2021 14:24:26 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.16.1/8.16.1) with ESMTPS id 18P8VmC81326000 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 25 Sep 2021 10:31:48 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.16.1/8.16.1/Submit) id 18P8Vmtv1325999; Sat, 25 Sep 2021 10:31:48 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Michael Neuling Subject: [PATCH v2 2/3] powerpc: Stop using init_mem_is_free Date: Sat, 25 Sep 2021 10:31:43 +0200 Message-Id: <4abb3611309bf7b31520d990f426e5941b562b67.1632558672.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Generic parts of the kernel for instance core_kernel_text() use 'system_state' to check whether init memory has been freed. Do the same and stop using init_mem_is_free. Cc: Michael Neuling Signed-off-by: Christophe Leroy --- arch_is_kernel_initmem_freed() is likely going to go away via the mm tree, in that case this patch will void. v2: Also remove declaration of init_mem_is_free. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/sections.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h index 6e4af4492a14..454b8434bfc4 100644 --- a/arch/powerpc/include/asm/sections.h +++ b/arch/powerpc/include/asm/sections.h @@ -10,11 +10,9 @@ #include -extern bool init_mem_is_free; - static inline int arch_is_kernel_initmem_freed(unsigned long addr) { - if (!init_mem_is_free) + if (system_state < SYSTEM_RUNNING) return 0; return addr >= (unsigned long)__init_begin && -- 2.31.1 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 E993BC433F5 for ; Sat, 25 Sep 2021 12:25:41 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 562CF61038 for ; Sat, 25 Sep 2021 12:25:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 562CF61038 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HGp5b6r2wz3cFT for ; Sat, 25 Sep 2021 22:25:39 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=csgroup.eu (client-ip=93.17.235.10; helo=pegase2.c-s.fr; envelope-from=christophe.leroy@csgroup.eu; receiver=) Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HGp4S0CyHz307x for ; Sat, 25 Sep 2021 22:24:39 +1000 (AEST) Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4HGp4C0qcGz9sW9; Sat, 25 Sep 2021 14:24:27 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17h4qlarqDac; Sat, 25 Sep 2021 14:24:27 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4HGp4B75d8z9sW6; Sat, 25 Sep 2021 14:24:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id DF4FC8B76D; Sat, 25 Sep 2021 14:24:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id FSeUYn7msvyu; Sat, 25 Sep 2021 14:24:26 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.203.8]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A860D8B763; Sat, 25 Sep 2021 14:24:26 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.16.1/8.16.1) with ESMTPS id 18P8VmC81326000 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 25 Sep 2021 10:31:48 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.16.1/8.16.1/Submit) id 18P8Vmtv1325999; Sat, 25 Sep 2021 10:31:48 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Subject: [PATCH v2 2/3] powerpc: Stop using init_mem_is_free Date: Sat, 25 Sep 2021 10:31:43 +0200 Message-Id: <4abb3611309bf7b31520d990f426e5941b562b67.1632558672.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Neuling , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Generic parts of the kernel for instance core_kernel_text() use 'system_state' to check whether init memory has been freed. Do the same and stop using init_mem_is_free. Cc: Michael Neuling Signed-off-by: Christophe Leroy --- arch_is_kernel_initmem_freed() is likely going to go away via the mm tree, in that case this patch will void. v2: Also remove declaration of init_mem_is_free. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/sections.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h index 6e4af4492a14..454b8434bfc4 100644 --- a/arch/powerpc/include/asm/sections.h +++ b/arch/powerpc/include/asm/sections.h @@ -10,11 +10,9 @@ #include -extern bool init_mem_is_free; - static inline int arch_is_kernel_initmem_freed(unsigned long addr) { - if (!init_mem_is_free) + if (system_state < SYSTEM_RUNNING) return 0; return addr >= (unsigned long)__init_begin && -- 2.31.1