* [to-be-updated] mm-create-a-new-system-state-and-fix-core_kernel_text.patch removed from -mm tree
@ 2021-09-29 3:31 akpm
2021-09-29 4:19 ` Stephen Rothwell
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2021-09-29 3:31 UTC (permalink / raw)
To: benh, christophe.leroy, gerald.schaefer, hca, mm-commits, paulus, sfr
The patch titled
Subject: mm: create a new system state and fix core_kernel_text()
has been removed from the -mm tree. Its filename was
mm-create-a-new-system-state-and-fix-core_kernel_text.patch
This patch was dropped because an updated version will be merged
------------------------------------------------------
From: Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: mm: create a new system state and fix core_kernel_text()
core_kernel_text() considers that until system_state in at least
SYSTEM_RUNNING, init memory is valid.
But init memory is freed a few lines before setting SYSTEM_RUNNING, so we
have a small period of time when core_kernel_text() is wrong.
Create an intermediate system state called SYSTEM_FREEING_INIT that is set
before starting freeing init memory, and use it in core_kernel_text() to
report init memory invalid earlier.
Link: https://lkml.kernel.org/r/ffa99e8e91e756b081427b27e408f275b7d43df7.1632813331.git.christophe.leroy@csgroup.eu
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/kernel.h | 1 +
init/main.c | 2 ++
kernel/extable.c | 2 +-
3 files changed, 4 insertions(+), 1 deletion(-)
--- a/include/linux/kernel.h~mm-create-a-new-system-state-and-fix-core_kernel_text
+++ a/include/linux/kernel.h
@@ -248,6 +248,7 @@ extern bool early_boot_irqs_disabled;
extern enum system_states {
SYSTEM_BOOTING,
SYSTEM_SCHEDULING,
+ SYSTEM_FREEING_INITMEM,
SYSTEM_RUNNING,
SYSTEM_HALT,
SYSTEM_POWER_OFF,
--- a/init/main.c~mm-create-a-new-system-state-and-fix-core_kernel_text
+++ a/init/main.c
@@ -1505,6 +1505,8 @@ static int __ref kernel_init(void *unuse
kernel_init_freeable();
/* need to finish all async __init code before freeing the memory */
async_synchronize_full();
+
+ system_state = SYSTEM_FREEING_INITMEM;
kprobe_free_init_mem();
ftrace_free_init_mem();
kgdb_free_init_mem();
--- a/kernel/extable.c~mm-create-a-new-system-state-and-fix-core_kernel_text
+++ a/kernel/extable.c
@@ -76,7 +76,7 @@ int notrace core_kernel_text(unsigned lo
addr < (unsigned long)_etext)
return 1;
- if (system_state < SYSTEM_RUNNING &&
+ if (system_state < SYSTEM_FREEING_INITMEM &&
init_kernel_text(addr))
return 1;
return 0;
_
Patches currently in -mm which might be from christophe.leroy@csgroup.eu are
mm-make-generic-arch_is_kernel_initmem_freed-do-what-it-says.patch
powerpc-use-generic-version-of-arch_is_kernel_initmem_freed.patch
s390-use-generic-version-of-arch_is_kernel_initmem_freed.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [to-be-updated] mm-create-a-new-system-state-and-fix-core_kernel_text.patch removed from -mm tree
2021-09-29 3:31 [to-be-updated] mm-create-a-new-system-state-and-fix-core_kernel_text.patch removed from -mm tree akpm
@ 2021-09-29 4:19 ` Stephen Rothwell
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2021-09-29 4:19 UTC (permalink / raw)
To: akpm; +Cc: benh, christophe.leroy, gerald.schaefer, hca, mm-commits, paulus
[-- Attachment #1: Type: text/plain, Size: 460 bytes --]
Hi Andrew,
On Tue, 28 Sep 2021 20:31:13 -0700 akpm@linux-foundation.org wrote:
>
> The patch titled
> Subject: mm: create a new system state and fix core_kernel_text()
> has been removed from the -mm tree. Its filename was
> mm-create-a-new-system-state-and-fix-core_kernel_text.patch
>
> This patch was dropped because an updated version will be merged
I have dropped all 4 patches from linux-next.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-29 4:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 3:31 [to-be-updated] mm-create-a-new-system-state-and-fix-core_kernel_text.patch removed from -mm tree akpm
2021-09-29 4:19 ` Stephen Rothwell
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.