From: Christophe Leroy <christophe.leroy@csgroup.eu> To: Benjamin Herrenschmidt <benh@kernel.crashing.org>, Paul Mackerras <paulus@samba.org>, Michael Ellerman <mpe@ellerman.id.au> Cc: Christophe Leroy <christophe.leroy@csgroup.eu>, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Michael Neuling <mikey@neuling.org> Subject: [PATCH v2 2/3] powerpc: Stop using init_mem_is_free Date: Sat, 25 Sep 2021 10:31:43 +0200 [thread overview] Message-ID: <4abb3611309bf7b31520d990f426e5941b562b67.1632558672.git.christophe.leroy@csgroup.eu> (raw) In-Reply-To: <a7a35416ddab4b42617e2c81fe5816c7f8d0c63f.1632558672.git.christophe.leroy@csgroup.eu> 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 <mikey@neuling.org> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> --- 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 <christophe.leroy@csgroup.eu> --- 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 <asm-generic/sections.h> -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
WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@csgroup.eu> To: Benjamin Herrenschmidt <benh@kernel.crashing.org>, Paul Mackerras <paulus@samba.org>, Michael Ellerman <mpe@ellerman.id.au> Cc: Michael Neuling <mikey@neuling.org>, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] powerpc: Stop using init_mem_is_free Date: Sat, 25 Sep 2021 10:31:43 +0200 [thread overview] Message-ID: <4abb3611309bf7b31520d990f426e5941b562b67.1632558672.git.christophe.leroy@csgroup.eu> (raw) In-Reply-To: <a7a35416ddab4b42617e2c81fe5816c7f8d0c63f.1632558672.git.christophe.leroy@csgroup.eu> 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 <mikey@neuling.org> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> --- 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 <christophe.leroy@csgroup.eu> --- 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 <asm-generic/sections.h> -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
next prev parent reply other threads:[~2021-09-25 12:24 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-25 8:31 [PATCH v2 1/3] powerpc/code-patching: Improve verification of patchability Christophe Leroy 2021-09-25 8:31 ` Christophe Leroy 2021-09-25 8:31 ` Christophe Leroy [this message] 2021-09-25 8:31 ` [PATCH v2 2/3] powerpc: Stop using init_mem_is_free Christophe Leroy 2021-09-25 8:31 ` [PATCH v2 3/3] powerpc: Remove init_mem_is_free Christophe Leroy 2021-09-25 8:31 ` Christophe Leroy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=4abb3611309bf7b31520d990f426e5941b562b67.1632558672.git.christophe.leroy@csgroup.eu \ --to=christophe.leroy@csgroup.eu \ --cc=benh@kernel.crashing.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linuxppc-dev@lists.ozlabs.org \ --cc=mikey@neuling.org \ --cc=mpe@ellerman.id.au \ --cc=paulus@samba.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.