* [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper
@ 2021-05-29 10:54 Kefeng Wang
2021-05-29 10:54 ` [PATCH 01/15] mm: add " Kefeng Wang
` (14 more replies)
0 siblings, 15 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang
Add setup_initial_init_mm() helper and use it to cleanup the text,
data and brk setup code.
Kefeng Wang (15):
mm: add setup_initial_init_mm() helper
arc: convert to setup_initial_init_mm()
arm: convert to setup_initial_init_mm()
arm64: convert to setup_initial_init_mm()
csky: convert to setup_initial_init_mm()
h8300: convert to setup_initial_init_mm()
m68k: convert to setup_initial_init_mm()
nds32: convert to setup_initial_init_mm()
nios2: convert to setup_initial_init_mm()
openrisc: convert to setup_initial_init_mm()
powerpc: convert to setup_initial_init_mm()
riscv: convert to setup_initial_init_mm()
s390: convert to setup_initial_init_mm()
sh: convert to setup_initial_init_mm()
x86: convert to setup_initial_init_mm()
arch/arc/mm/init.c | 5 +----
arch/arm/kernel/setup.c | 5 +----
arch/arm64/kernel/setup.c | 5 +----
arch/csky/kernel/setup.c | 5 +----
arch/h8300/kernel/setup.c | 5 +----
arch/m68k/kernel/setup_mm.c | 5 +----
arch/m68k/kernel/setup_no.c | 5 +----
arch/nds32/kernel/setup.c | 5 +----
arch/nios2/kernel/setup.c | 5 +----
arch/openrisc/kernel/setup.c | 5 +----
arch/powerpc/kernel/setup-common.c | 5 +----
arch/riscv/kernel/setup.c | 5 +----
arch/s390/kernel/setup.c | 5 +----
arch/sh/kernel/setup.c | 5 +----
arch/x86/kernel/setup.c | 5 +----
include/linux/mm_types.h | 10 ++++++++++
16 files changed, 25 insertions(+), 60 deletions(-)
--
2.26.2
^ permalink raw reply [flat|nested] 43+ messages in thread
* [PATCH 01/15] mm: add setup_initial_init_mm() helper
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
@ 2021-05-29 10:54 ` Kefeng Wang
2021-05-31 7:45 ` Geert Uytterhoeven
2021-05-29 10:54 ` Kefeng Wang
` (13 subsequent siblings)
14 siblings, 1 reply; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/linux/mm_types.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 38a516ec7d98..ae4c2e95c80a 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -564,6 +564,16 @@ struct mm_struct {
};
extern struct mm_struct init_mm;
+static inline void setup_initial_init_mm(char *start_code,
+ char *end_code,
+ char *end_data,
+ char *brk)
+{
+ init_mm.start_code = (unsigned long)start_code;
+ init_mm.end_code = (unsigned long)end_code;
+ init_mm.end_data = (unsigned long)end_data;
+ init_mm.brk = (unsigned long)brk;
+}
/* Pointer magic because the dynamic array size confuses some compilers. */
static inline void mm_init_cpumask(struct mm_struct *mm)
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 02/15] arc: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
@ 2021-05-29 10:54 ` Kefeng Wang
2021-05-29 10:54 ` Kefeng Wang
` (13 subsequent siblings)
14 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang, Vineet Gupta, linux-snps-arc
Use setup_initial_init_mm() helper to simplify code.
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/arc/mm/init.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index e2ed355438c9..33b8fab89022 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -94,10 +94,7 @@ void __init setup_arch_memory(void)
{
unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 };
- init_mm.start_code = (unsigned long)_text;
- init_mm.end_code = (unsigned long)_etext;
- init_mm.end_data = (unsigned long)_edata;
- init_mm.brk = (unsigned long)_end;
+ setup_initial_init_mm(_text, _etext, _edata, _end);
/* first page of system - kernel .vector starts here */
min_low_pfn = virt_to_pfn(CONFIG_LINUX_RAM_BASE);
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 02/15] arc: convert to setup_initial_init_mm()
@ 2021-05-29 10:54 ` Kefeng Wang
0 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang, Vineet Gupta, linux-snps-arc
Use setup_initial_init_mm() helper to simplify code.
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: linux-snps-arc@lists.infradead.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/arc/mm/init.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index e2ed355438c9..33b8fab89022 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -94,10 +94,7 @@ void __init setup_arch_memory(void)
{
unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 };
- init_mm.start_code = (unsigned long)_text;
- init_mm.end_code = (unsigned long)_etext;
- init_mm.end_data = (unsigned long)_edata;
- init_mm.brk = (unsigned long)_end;
+ setup_initial_init_mm(_text, _etext, _edata, _end);
/* first page of system - kernel .vector starts here */
min_low_pfn = virt_to_pfn(CONFIG_LINUX_RAM_BASE);
--
2.26.2
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 03/15] arm: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
@ 2021-05-29 10:54 ` Kefeng Wang
2021-05-29 10:54 ` Kefeng Wang
` (13 subsequent siblings)
14 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang, Russell King, linux-arm-kernel
Use setup_initial_init_mm() helper to simplify code.
Cc: Russell King <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/arm/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 1a5edf562e85..81de1bf07ba6 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1114,10 +1114,7 @@ void __init setup_arch(char **cmdline_p)
if (mdesc->reboot_mode != REBOOT_HARD)
reboot_mode = mdesc->reboot_mode;
- init_mm.start_code = (unsigned long) _text;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) _end;
+ setup_initial_init_mm(_text, _etext, _edata, _end);
/* populate cmd_line too for later use, preserving boot_command_line */
strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 03/15] arm: convert to setup_initial_init_mm()
@ 2021-05-29 10:54 ` Kefeng Wang
0 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang, Russell King, linux-arm-kernel
Use setup_initial_init_mm() helper to simplify code.
Cc: Russell King <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/arm/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 1a5edf562e85..81de1bf07ba6 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -1114,10 +1114,7 @@ void __init setup_arch(char **cmdline_p)
if (mdesc->reboot_mode != REBOOT_HARD)
reboot_mode = mdesc->reboot_mode;
- init_mm.start_code = (unsigned long) _text;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) _end;
+ setup_initial_init_mm(_text, _etext, _edata, _end);
/* populate cmd_line too for later use, preserving boot_command_line */
strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
--
2.26.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 04/15] arm64: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
@ 2021-05-29 10:54 ` Kefeng Wang
2021-05-29 10:54 ` Kefeng Wang
` (13 subsequent siblings)
14 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: Kefeng Wang, Catalin Marinas, Will Deacon, linux-arm-kernel
Use setup_initial_init_mm() helper to simplify code.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/arm64/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index ac8222443ea8..08b0308b7f3b 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -293,10 +293,7 @@ u64 cpu_logical_map(unsigned int cpu)
void __init __no_sanitize_address setup_arch(char **cmdline_p)
{
- init_mm.start_code = (unsigned long) _stext;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) _end;
+ setup_initial_init_mm(_stext, _etext, _edata, _end);
*cmdline_p = boot_command_line;
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 04/15] arm64: convert to setup_initial_init_mm()
@ 2021-05-29 10:54 ` Kefeng Wang
0 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: Kefeng Wang, Catalin Marinas, Will Deacon, linux-arm-kernel
Use setup_initial_init_mm() helper to simplify code.
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/arm64/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index ac8222443ea8..08b0308b7f3b 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -293,10 +293,7 @@ u64 cpu_logical_map(unsigned int cpu)
void __init __no_sanitize_address setup_arch(char **cmdline_p)
{
- init_mm.start_code = (unsigned long) _stext;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) _end;
+ setup_initial_init_mm(_stext, _etext, _edata, _end);
*cmdline_p = boot_command_line;
--
2.26.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 05/15] csky: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
` (3 preceding siblings ...)
2021-05-29 10:54 ` Kefeng Wang
@ 2021-05-29 10:54 ` Kefeng Wang
2021-05-30 0:23 ` Guo Ren
2021-05-29 10:54 ` [PATCH 06/15] h8300: " Kefeng Wang
` (9 subsequent siblings)
14 siblings, 1 reply; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang, Guo Ren, linux-csky
Use setup_initial_init_mm() helper to simplify code.
Cc: Guo Ren <guoren@kernel.org>
Cc: linux-csky@vger.kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/csky/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/csky/kernel/setup.c b/arch/csky/kernel/setup.c
index e93bc6f74432..c64e7be2045b 100644
--- a/arch/csky/kernel/setup.c
+++ b/arch/csky/kernel/setup.c
@@ -78,10 +78,7 @@ void __init setup_arch(char **cmdline_p)
pr_info("Phys. mem: %ldMB\n",
(unsigned long) memblock_phys_mem_size()/1024/1024);
- init_mm.start_code = (unsigned long) _stext;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) _end;
+ setup_initial_init_mm(_stext, _etext, _edata, _end);
parse_early_param();
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 06/15] h8300: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
` (4 preceding siblings ...)
2021-05-29 10:54 ` [PATCH 05/15] csky: " Kefeng Wang
@ 2021-05-29 10:54 ` Kefeng Wang
2021-05-31 7:48 ` Geert Uytterhoeven
2021-05-29 10:54 ` [PATCH 07/15] m68k: " Kefeng Wang
` (8 subsequent siblings)
14 siblings, 1 reply; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang, Yoshinori Sato, uclinux-h8-devel
Use setup_initial_init_mm() helper to simplify code.
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: uclinux-h8-devel@lists.sourceforge.jp
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/h8300/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c
index 15280af7251c..8db9ce76ee60 100644
--- a/arch/h8300/kernel/setup.c
+++ b/arch/h8300/kernel/setup.c
@@ -97,10 +97,7 @@ void __init setup_arch(char **cmdline_p)
{
unflatten_and_copy_device_tree();
- init_mm.start_code = (unsigned long) _stext;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) 0;
+ setup_initial_init_mm(_stext, _etext, _edata, (void *)0);
pr_notice("\r\n\nuClinux " CPU "\n");
pr_notice("Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne\n");
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 07/15] m68k: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
` (5 preceding siblings ...)
2021-05-29 10:54 ` [PATCH 06/15] h8300: " Kefeng Wang
@ 2021-05-29 10:54 ` Kefeng Wang
2021-05-31 7:48 ` Geert Uytterhoeven
2021-05-29 10:54 ` [PATCH 08/15] nds32: " Kefeng Wang
` (7 subsequent siblings)
14 siblings, 1 reply; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang, Geert Uytterhoeven, linux-m68k
Use setup_initial_init_mm() helper to simplify code.
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/m68k/kernel/setup_mm.c | 5 +----
arch/m68k/kernel/setup_no.c | 5 +----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index 017bac3aab80..4b51bfd38e5f 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -258,10 +258,7 @@ void __init setup_arch(char **cmdline_p)
}
}
- init_mm.start_code = PAGE_OFFSET;
- init_mm.end_code = (unsigned long)_etext;
- init_mm.end_data = (unsigned long)_edata;
- init_mm.brk = (unsigned long)_end;
+ setup_initial_init_mm((void *)PAGE_OFFSET, _etext, _edata, _end);
#if defined(CONFIG_BOOTPARAM)
strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE);
diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c
index d1b7988efc91..541b134ed8fc 100644
--- a/arch/m68k/kernel/setup_no.c
+++ b/arch/m68k/kernel/setup_no.c
@@ -87,10 +87,7 @@ void __init setup_arch(char **cmdline_p)
memory_start = PAGE_ALIGN(_ramstart);
memory_end = _ramend;
- init_mm.start_code = (unsigned long) &_stext;
- init_mm.end_code = (unsigned long) &_etext;
- init_mm.end_data = (unsigned long) &_edata;
- init_mm.brk = (unsigned long) 0;
+ setup_initial_init_mm(_stext, _etext, _edata, (void *)0);
config_BSP(&command_line[0], sizeof(command_line));
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 08/15] nds32: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
` (6 preceding siblings ...)
2021-05-29 10:54 ` [PATCH 07/15] m68k: " Kefeng Wang
@ 2021-05-29 10:54 ` Kefeng Wang
2021-05-29 10:54 ` [PATCH 09/15] nios2: " Kefeng Wang
` (6 subsequent siblings)
14 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang, Nick Hu, Greentime Hu
Use setup_initial_init_mm() helper to simplify code.
Cc: Nick Hu <nickhu@andestech.com>
Cc: Greentime Hu <green.hu@gmail.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/nds32/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/nds32/kernel/setup.c b/arch/nds32/kernel/setup.c
index af82e996f412..41725eaf8bac 100644
--- a/arch/nds32/kernel/setup.c
+++ b/arch/nds32/kernel/setup.c
@@ -294,10 +294,7 @@ void __init setup_arch(char **cmdline_p)
setup_cpuinfo();
- init_mm.start_code = (unsigned long)&_stext;
- init_mm.end_code = (unsigned long)&_etext;
- init_mm.end_data = (unsigned long)&_edata;
- init_mm.brk = (unsigned long)&_end;
+ setup_initial_init_mm(_stext, _etext, _edata, _end);
/* setup bootmem allocator */
setup_memory();
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 09/15] nios2: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
` (7 preceding siblings ...)
2021-05-29 10:54 ` [PATCH 08/15] nds32: " Kefeng Wang
@ 2021-05-29 10:54 ` Kefeng Wang
2021-05-29 10:54 ` [OpenRISC] " Kefeng Wang
` (5 subsequent siblings)
14 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang, Ley Foon Tan
Use setup_initial_init_mm() helper to simplify code.
Cc: Ley Foon Tan <ley.foon.tan@intel.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/nios2/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c
index d2f21957e99c..cf8d687a2644 100644
--- a/arch/nios2/kernel/setup.c
+++ b/arch/nios2/kernel/setup.c
@@ -156,10 +156,7 @@ void __init setup_arch(char **cmdline_p)
memory_start = memblock_start_of_DRAM();
memory_end = memblock_end_of_DRAM();
- init_mm.start_code = (unsigned long) _stext;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) _end;
+ setup_initial_init_mm(_stext, _etext, _edata, _end);
init_task.thread.kregs = &fake_regs;
/* Keep a copy of command line */
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 10/15] openrisc: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
@ 2021-05-29 10:54 ` Kefeng Wang
2021-05-29 10:54 ` Kefeng Wang
` (13 subsequent siblings)
14 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: Kefeng Wang, Jonas Bonn, Stefan Kristiansson, Stafford Horne, openrisc
Use setup_initial_init_mm() helper to simplify code.
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Stafford Horne <shorne@gmail.com>
Cc: openrisc@lists.librecores.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/openrisc/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c
index c6f9e7b9f7cb..8ae2da6ac097 100644
--- a/arch/openrisc/kernel/setup.c
+++ b/arch/openrisc/kernel/setup.c
@@ -293,10 +293,7 @@ void __init setup_arch(char **cmdline_p)
#endif
/* process 1's initial memory region is the kernel code/data */
- init_mm.start_code = (unsigned long)_stext;
- init_mm.end_code = (unsigned long)_etext;
- init_mm.end_data = (unsigned long)_edata;
- init_mm.brk = (unsigned long)_end;
+ setup_initial_init_mm(_stext, _etext, _edata, _end);
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start == initrd_end) {
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [OpenRISC] [PATCH 10/15] openrisc: convert to setup_initial_init_mm()
@ 2021-05-29 10:54 ` Kefeng Wang
0 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:54 UTC (permalink / raw)
To: openrisc
Use setup_initial_init_mm() helper to simplify code.
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Stafford Horne <shorne@gmail.com>
Cc: openrisc at lists.librecores.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/openrisc/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c
index c6f9e7b9f7cb..8ae2da6ac097 100644
--- a/arch/openrisc/kernel/setup.c
+++ b/arch/openrisc/kernel/setup.c
@@ -293,10 +293,7 @@ void __init setup_arch(char **cmdline_p)
#endif
/* process 1's initial memory region is the kernel code/data */
- init_mm.start_code = (unsigned long)_stext;
- init_mm.end_code = (unsigned long)_etext;
- init_mm.end_data = (unsigned long)_edata;
- init_mm.brk = (unsigned long)_end;
+ setup_initial_init_mm(_stext, _etext, _edata, _end);
#ifdef CONFIG_BLK_DEV_INITRD
if (initrd_start == initrd_end) {
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 11/15] powerpc: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
@ 2021-05-29 10:55 ` Kefeng Wang
2021-05-29 10:54 ` Kefeng Wang
` (13 subsequent siblings)
14 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:55 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: Kefeng Wang, Michael Ellerman, Benjamin Herrenschmidt, linuxppc-dev
Use setup_initial_init_mm() helper to simplify code.
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/powerpc/kernel/setup-common.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 046fe21b5c3b..c046d99efd18 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p)
klp_init_thread_info(&init_task);
- init_mm.start_code = (unsigned long)_stext;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = klimit;
+ setup_initial_init_mm(_stext, _etext, _edata, _end);
mm_iommu_init(&init_mm);
irqstack_early_init();
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 11/15] powerpc: convert to setup_initial_init_mm()
@ 2021-05-29 10:55 ` Kefeng Wang
0 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:55 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: Kefeng Wang, linuxppc-dev
Use setup_initial_init_mm() helper to simplify code.
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/powerpc/kernel/setup-common.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 046fe21b5c3b..c046d99efd18 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p)
klp_init_thread_info(&init_task);
- init_mm.start_code = (unsigned long)_stext;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = klimit;
+ setup_initial_init_mm(_stext, _etext, _edata, _end);
mm_iommu_init(&init_mm);
irqstack_early_init();
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 12/15] riscv: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
@ 2021-05-29 10:55 ` Kefeng Wang
2021-05-29 10:54 ` Kefeng Wang
` (13 subsequent siblings)
14 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:55 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: Kefeng Wang, Paul Walmsley, Palmer Dabbelt, linux-riscv
Use setup_initial_init_mm() helper to simplify code.
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: linux-riscv@lists.infradead.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/riscv/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 4db4d0b5911f..c6623015f85f 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -264,10 +264,7 @@ static void __init parse_dtb(void)
void __init setup_arch(char **cmdline_p)
{
parse_dtb();
- init_mm.start_code = (unsigned long) _stext;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) _end;
+ setup_initial_init_mm(_stext, _etext, _edata, _end);
*cmdline_p = boot_command_line;
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 12/15] riscv: convert to setup_initial_init_mm()
@ 2021-05-29 10:55 ` Kefeng Wang
0 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:55 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: Kefeng Wang, Paul Walmsley, Palmer Dabbelt, linux-riscv
Use setup_initial_init_mm() helper to simplify code.
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: linux-riscv@lists.infradead.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/riscv/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 4db4d0b5911f..c6623015f85f 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -264,10 +264,7 @@ static void __init parse_dtb(void)
void __init setup_arch(char **cmdline_p)
{
parse_dtb();
- init_mm.start_code = (unsigned long) _stext;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) _end;
+ setup_initial_init_mm(_stext, _etext, _edata, _end);
*cmdline_p = boot_command_line;
--
2.26.2
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 13/15] s390: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
` (11 preceding siblings ...)
2021-05-29 10:55 ` Kefeng Wang
@ 2021-05-29 10:55 ` Kefeng Wang
2021-05-29 10:55 ` [PATCH 14/15] sh: " Kefeng Wang
2021-05-29 10:55 ` [PATCH 15/15] x86: " Kefeng Wang
14 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:55 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: Kefeng Wang, Heiko Carstens, Vasily Gorbik,
Christian Borntraeger, linux-s390
Use setup_initial_init_mm() helper to simplify code.
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: linux-s390@vger.kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/s390/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 146d01700a55..3feb9c5972eb 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -1096,10 +1096,7 @@ void __init setup_arch(char **cmdline_p)
ROOT_DEV = Root_RAM0;
- init_mm.start_code = (unsigned long) _text;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) _end;
+ setup_initial_init_mm(_text, _etext, _edata, _end);
if (IS_ENABLED(CONFIG_EXPOLINE_AUTO))
nospec_auto_detect();
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 14/15] sh: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
` (12 preceding siblings ...)
2021-05-29 10:55 ` [PATCH 13/15] s390: " Kefeng Wang
@ 2021-05-29 10:55 ` Kefeng Wang
2021-05-29 10:55 ` [PATCH 15/15] x86: " Kefeng Wang
14 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:55 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: Kefeng Wang, Yoshinori Sato, Rich Felker, linux-sh
Use setup_initial_init_mm() helper to simplify code.
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/sh/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 4144be650d41..1fcb6659822a 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -294,10 +294,7 @@ void __init setup_arch(char **cmdline_p)
if (!MOUNT_ROOT_RDONLY)
root_mountflags &= ~MS_RDONLY;
- init_mm.start_code = (unsigned long) _text;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) _end;
+ setup_initial_init_mm(_text, _etext, _edata, _end);
code_resource.start = virt_to_phys(_text);
code_resource.end = virt_to_phys(_etext)-1;
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* [PATCH 15/15] x86: convert to setup_initial_init_mm()
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
` (13 preceding siblings ...)
2021-05-29 10:55 ` [PATCH 14/15] sh: " Kefeng Wang
@ 2021-05-29 10:55 ` Kefeng Wang
14 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-29 10:55 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: Kefeng Wang, Thomas Gleixner, Ingo Molnar, x86
Use setup_initial_init_mm() helper to simplify code.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/x86/kernel/setup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index bdcdd29efea6..9bc914c24778 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -869,10 +869,7 @@ void __init setup_arch(char **cmdline_p)
if (!boot_params.hdr.root_flags)
root_mountflags &= ~MS_RDONLY;
- init_mm.start_code = (unsigned long) _text;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = _brk_end;
+ setup_initial_init_mm(_text, _etext, _edata, _brk_end);
code_resource.start = __pa_symbol(_text);
code_resource.end = __pa_symbol(_etext)-1;
--
2.26.2
^ permalink raw reply related [flat|nested] 43+ messages in thread
* Re: [PATCH 03/15] arm: convert to setup_initial_init_mm()
2021-05-29 10:54 ` Kefeng Wang
@ 2021-05-29 12:18 ` Russell King (Oracle)
-1 siblings, 0 replies; 43+ messages in thread
From: Russell King (Oracle) @ 2021-05-29 12:18 UTC (permalink / raw)
To: Kefeng Wang; +Cc: Andrew Morton, linux-kernel, linux-arm-kernel
On Sat, May 29, 2021 at 06:54:52PM +0800, Kefeng Wang wrote:
> Use setup_initial_init_mm() helper to simplify code.
>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Obviously, without having visibility of the contents of
setup_initial_init_mm(), it's impossible to say whether this change is
correct or not, so I won't be providing any acks/reviewed-bys for it.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 03/15] arm: convert to setup_initial_init_mm()
@ 2021-05-29 12:18 ` Russell King (Oracle)
0 siblings, 0 replies; 43+ messages in thread
From: Russell King (Oracle) @ 2021-05-29 12:18 UTC (permalink / raw)
To: Kefeng Wang; +Cc: Andrew Morton, linux-kernel, linux-arm-kernel
On Sat, May 29, 2021 at 06:54:52PM +0800, Kefeng Wang wrote:
> Use setup_initial_init_mm() helper to simplify code.
>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Obviously, without having visibility of the contents of
setup_initial_init_mm(), it's impossible to say whether this change is
correct or not, so I won't be providing any acks/reviewed-bys for it.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 11/15] powerpc: convert to setup_initial_init_mm()
2021-05-29 10:55 ` Kefeng Wang
(?)
@ 2021-05-29 12:46 ` Santosh Sivaraj
2021-05-29 15:22 ` Christophe Leroy
-1 siblings, 1 reply; 43+ messages in thread
From: Santosh Sivaraj @ 2021-05-29 12:46 UTC (permalink / raw)
To: Kefeng Wang, Andrew Morton, linux-kernel; +Cc: Kefeng Wang, linuxppc-dev
Kefeng Wang <wangkefeng.wang@huawei.com> writes:
> Use setup_initial_init_mm() helper to simplify code.
>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> arch/powerpc/kernel/setup-common.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
> index 046fe21b5c3b..c046d99efd18 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p)
>
> klp_init_thread_info(&init_task);
>
> - init_mm.start_code = (unsigned long)_stext;
> - init_mm.end_code = (unsigned long) _etext;
> - init_mm.end_data = (unsigned long) _edata;
> - init_mm.brk = klimit;
> + setup_initial_init_mm(_stext, _etext, _edata, _end);
This function definition is not visible for those who have subscribed only to
linuxppc-dev mailing list. I had to do a web-search with the ID.
Thanks,
Santosh
>
> mm_iommu_init(&init_mm);
> irqstack_early_init();
> --
> 2.26.2
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 10/15] openrisc: convert to setup_initial_init_mm()
2021-05-29 10:54 ` [OpenRISC] " Kefeng Wang
@ 2021-05-29 13:48 ` Stafford Horne
-1 siblings, 0 replies; 43+ messages in thread
From: Stafford Horne @ 2021-05-29 13:48 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, linux-kernel, Jonas Bonn, Stefan Kristiansson, openrisc
On Sat, May 29, 2021 at 06:54:59PM +0800, Kefeng Wang wrote:
> Use setup_initial_init_mm() helper to simplify code.
>
> Cc: Jonas Bonn <jonas@southpole.se>
> Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
> Cc: Stafford Horne <shorne@gmail.com>
> Cc: openrisc@lists.librecores.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Looks fine to me.
Acked-by: Stafford Horne <shorne@gmail.com>
> ---
> arch/openrisc/kernel/setup.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c
> index c6f9e7b9f7cb..8ae2da6ac097 100644
> --- a/arch/openrisc/kernel/setup.c
> +++ b/arch/openrisc/kernel/setup.c
> @@ -293,10 +293,7 @@ void __init setup_arch(char **cmdline_p)
> #endif
>
> /* process 1's initial memory region is the kernel code/data */
> - init_mm.start_code = (unsigned long)_stext;
> - init_mm.end_code = (unsigned long)_etext;
> - init_mm.end_data = (unsigned long)_edata;
> - init_mm.brk = (unsigned long)_end;
> + setup_initial_init_mm(_stext, _etext, _edata, _end);
>
> #ifdef CONFIG_BLK_DEV_INITRD
> if (initrd_start == initrd_end) {
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 43+ messages in thread
* [OpenRISC] [PATCH 10/15] openrisc: convert to setup_initial_init_mm()
@ 2021-05-29 13:48 ` Stafford Horne
0 siblings, 0 replies; 43+ messages in thread
From: Stafford Horne @ 2021-05-29 13:48 UTC (permalink / raw)
To: openrisc
On Sat, May 29, 2021 at 06:54:59PM +0800, Kefeng Wang wrote:
> Use setup_initial_init_mm() helper to simplify code.
>
> Cc: Jonas Bonn <jonas@southpole.se>
> Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
> Cc: Stafford Horne <shorne@gmail.com>
> Cc: openrisc at lists.librecores.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Looks fine to me.
Acked-by: Stafford Horne <shorne@gmail.com>
> ---
> arch/openrisc/kernel/setup.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c
> index c6f9e7b9f7cb..8ae2da6ac097 100644
> --- a/arch/openrisc/kernel/setup.c
> +++ b/arch/openrisc/kernel/setup.c
> @@ -293,10 +293,7 @@ void __init setup_arch(char **cmdline_p)
> #endif
>
> /* process 1's initial memory region is the kernel code/data */
> - init_mm.start_code = (unsigned long)_stext;
> - init_mm.end_code = (unsigned long)_etext;
> - init_mm.end_data = (unsigned long)_edata;
> - init_mm.brk = (unsigned long)_end;
> + setup_initial_init_mm(_stext, _etext, _edata, _end);
>
> #ifdef CONFIG_BLK_DEV_INITRD
> if (initrd_start == initrd_end) {
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 11/15] powerpc: convert to setup_initial_init_mm()
2021-05-29 12:46 ` Santosh Sivaraj
@ 2021-05-29 15:22 ` Christophe Leroy
0 siblings, 0 replies; 43+ messages in thread
From: Christophe Leroy @ 2021-05-29 15:22 UTC (permalink / raw)
To: Santosh Sivaraj; +Cc: linuxppc-dev, linux-kernel, Andrew Morton, Kefeng Wang
Santosh Sivaraj <santosh@fossix.org> a écrit :
> Kefeng Wang <wangkefeng.wang@huawei.com> writes:
>
>> Use setup_initial_init_mm() helper to simplify code.
I only got that patch, and patchwork as well
(https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=246315)
Can you tell where I can see and get the full series ?
And next time can you copy all patches to linuxppc-dev
Thanks
Christophe
>>
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> arch/powerpc/kernel/setup-common.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/kernel/setup-common.c
>> b/arch/powerpc/kernel/setup-common.c
>> index 046fe21b5c3b..c046d99efd18 100644
>> --- a/arch/powerpc/kernel/setup-common.c
>> +++ b/arch/powerpc/kernel/setup-common.c
>> @@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p)
>>
>> klp_init_thread_info(&init_task);
>>
>> - init_mm.start_code = (unsigned long)_stext;
>> - init_mm.end_code = (unsigned long) _etext;
>> - init_mm.end_data = (unsigned long) _edata;
>> - init_mm.brk = klimit;
>> + setup_initial_init_mm(_stext, _etext, _edata, _end);
>
> This function definition is not visible for those who have subscribed only to
> linuxppc-dev mailing list. I had to do a web-search with the ID.
>
> Thanks,
> Santosh
>
>>
>> mm_iommu_init(&init_mm);
>> irqstack_early_init();
>> --
>> 2.26.2
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 11/15] powerpc: convert to setup_initial_init_mm()
@ 2021-05-29 15:22 ` Christophe Leroy
0 siblings, 0 replies; 43+ messages in thread
From: Christophe Leroy @ 2021-05-29 15:22 UTC (permalink / raw)
To: Santosh Sivaraj; +Cc: Andrew Morton, linuxppc-dev, linux-kernel, Kefeng Wang
Santosh Sivaraj <santosh@fossix.org> a écrit :
> Kefeng Wang <wangkefeng.wang@huawei.com> writes:
>
>> Use setup_initial_init_mm() helper to simplify code.
I only got that patch, and patchwork as well
(https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=246315)
Can you tell where I can see and get the full series ?
And next time can you copy all patches to linuxppc-dev
Thanks
Christophe
>>
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> arch/powerpc/kernel/setup-common.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/kernel/setup-common.c
>> b/arch/powerpc/kernel/setup-common.c
>> index 046fe21b5c3b..c046d99efd18 100644
>> --- a/arch/powerpc/kernel/setup-common.c
>> +++ b/arch/powerpc/kernel/setup-common.c
>> @@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p)
>>
>> klp_init_thread_info(&init_task);
>>
>> - init_mm.start_code = (unsigned long)_stext;
>> - init_mm.end_code = (unsigned long) _etext;
>> - init_mm.end_data = (unsigned long) _edata;
>> - init_mm.brk = klimit;
>> + setup_initial_init_mm(_stext, _etext, _edata, _end);
>
> This function definition is not visible for those who have subscribed only to
> linuxppc-dev mailing list. I had to do a web-search with the ID.
>
> Thanks,
> Santosh
>
>>
>> mm_iommu_init(&init_mm);
>> irqstack_early_init();
>> --
>> 2.26.2
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 11/15] powerpc: convert to setup_initial_init_mm()
2021-05-29 10:55 ` Kefeng Wang
@ 2021-05-29 16:16 ` Christophe Leroy
-1 siblings, 0 replies; 43+ messages in thread
From: Christophe Leroy @ 2021-05-29 16:16 UTC (permalink / raw)
To: Kefeng Wang; +Cc: linuxppc-dev, linux-kernel, Andrew Morton
Kefeng Wang <wangkefeng.wang@huawei.com> a écrit :
> Use setup_initial_init_mm() helper to simplify code.
>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> arch/powerpc/kernel/setup-common.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/kernel/setup-common.c
> b/arch/powerpc/kernel/setup-common.c
> index 046fe21b5c3b..c046d99efd18 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p)
>
> klp_init_thread_info(&init_task);
>
> - init_mm.start_code = (unsigned long)_stext;
> - init_mm.end_code = (unsigned long) _etext;
> - init_mm.end_data = (unsigned long) _edata;
> - init_mm.brk = klimit;
> + setup_initial_init_mm(_stext, _etext, _edata, _end);
This looks wrong, should be klimit instead of _end IIUC
>
> mm_iommu_init(&init_mm);
> irqstack_early_init();
> --
> 2.26.2
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 11/15] powerpc: convert to setup_initial_init_mm()
@ 2021-05-29 16:16 ` Christophe Leroy
0 siblings, 0 replies; 43+ messages in thread
From: Christophe Leroy @ 2021-05-29 16:16 UTC (permalink / raw)
To: Kefeng Wang; +Cc: Andrew Morton, linuxppc-dev, linux-kernel
Kefeng Wang <wangkefeng.wang@huawei.com> a écrit :
> Use setup_initial_init_mm() helper to simplify code.
>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> arch/powerpc/kernel/setup-common.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/kernel/setup-common.c
> b/arch/powerpc/kernel/setup-common.c
> index 046fe21b5c3b..c046d99efd18 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p)
>
> klp_init_thread_info(&init_task);
>
> - init_mm.start_code = (unsigned long)_stext;
> - init_mm.end_code = (unsigned long) _etext;
> - init_mm.end_data = (unsigned long) _edata;
> - init_mm.brk = klimit;
> + setup_initial_init_mm(_stext, _etext, _edata, _end);
This looks wrong, should be klimit instead of _end IIUC
>
> mm_iommu_init(&init_mm);
> irqstack_early_init();
> --
> 2.26.2
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 05/15] csky: convert to setup_initial_init_mm()
2021-05-29 10:54 ` [PATCH 05/15] csky: " Kefeng Wang
@ 2021-05-30 0:23 ` Guo Ren
0 siblings, 0 replies; 43+ messages in thread
From: Guo Ren @ 2021-05-30 0:23 UTC (permalink / raw)
To: Kefeng Wang; +Cc: Andrew Morton, Linux Kernel Mailing List, linux-csky
Acked-by: Guo Ren <guoren@kernel.org>
Thx
On Sat, May 29, 2021 at 6:46 PM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>
> Use setup_initial_init_mm() helper to simplify code.
>
> Cc: Guo Ren <guoren@kernel.org>
> Cc: linux-csky@vger.kernel.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> arch/csky/kernel/setup.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/csky/kernel/setup.c b/arch/csky/kernel/setup.c
> index e93bc6f74432..c64e7be2045b 100644
> --- a/arch/csky/kernel/setup.c
> +++ b/arch/csky/kernel/setup.c
> @@ -78,10 +78,7 @@ void __init setup_arch(char **cmdline_p)
> pr_info("Phys. mem: %ldMB\n",
> (unsigned long) memblock_phys_mem_size()/1024/1024);
>
> - init_mm.start_code = (unsigned long) _stext;
> - init_mm.end_code = (unsigned long) _etext;
> - init_mm.end_data = (unsigned long) _edata;
> - init_mm.brk = (unsigned long) _end;
> + setup_initial_init_mm(_stext, _etext, _edata, _end);
>
> parse_early_param();
>
> --
> 2.26.2
>
--
Best Regards
Guo Ren
ML: https://lore.kernel.org/linux-csky/
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 11/15] powerpc: convert to setup_initial_init_mm()
2021-05-29 15:22 ` Christophe Leroy
@ 2021-05-31 1:02 ` Kefeng Wang
-1 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-31 1:02 UTC (permalink / raw)
To: Christophe Leroy, Santosh Sivaraj
Cc: linuxppc-dev, linux-kernel, Andrew Morton
On 2021/5/29 23:22, Christophe Leroy wrote:
> Santosh Sivaraj <santosh@fossix.org> a écrit :
>
>> Kefeng Wang <wangkefeng.wang@huawei.com> writes:
>>
>>> Use setup_initial_init_mm() helper to simplify code.
>
> I only got that patch, and patchwork as well
> (https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=246315)
>
> Can you tell where I can see and get the full series ?
>
> And next time can you copy all patches to linuxppc-dev
ok, will be careful next time, thank for your reminding.
>
> Thanks
> Christophe
>
>>>
>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>> Cc: linuxppc-dev@lists.ozlabs.org
>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>> ---
>>> arch/powerpc/kernel/setup-common.c | 5 +----
>>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>>
>>> diff --git a/arch/powerpc/kernel/setup-common.c
>>> b/arch/powerpc/kernel/setup-common.c
>>> index 046fe21b5c3b..c046d99efd18 100644
>>> --- a/arch/powerpc/kernel/setup-common.c
>>> +++ b/arch/powerpc/kernel/setup-common.c
>>> @@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p)
>>>
>>> klp_init_thread_info(&init_task);
>>>
>>> - init_mm.start_code = (unsigned long)_stext;
>>> - init_mm.end_code = (unsigned long) _etext;
>>> - init_mm.end_data = (unsigned long) _edata;
>>> - init_mm.brk = klimit;
>>> + setup_initial_init_mm(_stext, _etext, _edata, _end);
>>
>> This function definition is not visible for those who have subscribed
>> only to
>> linuxppc-dev mailing list. I had to do a web-search with the ID.
>>
>> Thanks,
>> Santosh
>>
>>>
>>> mm_iommu_init(&init_mm);
>>> irqstack_early_init();
>>> --
>>> 2.26.2
>
>
> .
>
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 11/15] powerpc: convert to setup_initial_init_mm()
@ 2021-05-31 1:02 ` Kefeng Wang
0 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-31 1:02 UTC (permalink / raw)
To: Christophe Leroy, Santosh Sivaraj
Cc: Andrew Morton, linuxppc-dev, linux-kernel
On 2021/5/29 23:22, Christophe Leroy wrote:
> Santosh Sivaraj <santosh@fossix.org> a écrit :
>
>> Kefeng Wang <wangkefeng.wang@huawei.com> writes:
>>
>>> Use setup_initial_init_mm() helper to simplify code.
>
> I only got that patch, and patchwork as well
> (https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=246315)
>
> Can you tell where I can see and get the full series ?
>
> And next time can you copy all patches to linuxppc-dev
ok, will be careful next time, thank for your reminding.
>
> Thanks
> Christophe
>
>>>
>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>> Cc: linuxppc-dev@lists.ozlabs.org
>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>> ---
>>> arch/powerpc/kernel/setup-common.c | 5 +----
>>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>>
>>> diff --git a/arch/powerpc/kernel/setup-common.c
>>> b/arch/powerpc/kernel/setup-common.c
>>> index 046fe21b5c3b..c046d99efd18 100644
>>> --- a/arch/powerpc/kernel/setup-common.c
>>> +++ b/arch/powerpc/kernel/setup-common.c
>>> @@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p)
>>>
>>> klp_init_thread_info(&init_task);
>>>
>>> - init_mm.start_code = (unsigned long)_stext;
>>> - init_mm.end_code = (unsigned long) _etext;
>>> - init_mm.end_data = (unsigned long) _edata;
>>> - init_mm.brk = klimit;
>>> + setup_initial_init_mm(_stext, _etext, _edata, _end);
>>
>> This function definition is not visible for those who have subscribed
>> only to
>> linuxppc-dev mailing list. I had to do a web-search with the ID.
>>
>> Thanks,
>> Santosh
>>
>>>
>>> mm_iommu_init(&init_mm);
>>> irqstack_early_init();
>>> --
>>> 2.26.2
>
>
> .
>
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 11/15] powerpc: convert to setup_initial_init_mm()
2021-05-29 16:16 ` Christophe Leroy
@ 2021-05-31 1:05 ` Kefeng Wang
-1 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-31 1:05 UTC (permalink / raw)
To: Christophe Leroy; +Cc: linuxppc-dev, linux-kernel, Andrew Morton
On 2021/5/30 0:16, Christophe Leroy wrote:
> Kefeng Wang <wangkefeng.wang@huawei.com> a écrit :
>
>> Use setup_initial_init_mm() helper to simplify code.
>>
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> arch/powerpc/kernel/setup-common.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/kernel/setup-common.c
>> b/arch/powerpc/kernel/setup-common.c
>> index 046fe21b5c3b..c046d99efd18 100644
>> --- a/arch/powerpc/kernel/setup-common.c
>> +++ b/arch/powerpc/kernel/setup-common.c
>> @@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p)
>>
>> klp_init_thread_info(&init_task);
>>
>> - init_mm.start_code = (unsigned long)_stext;
>> - init_mm.end_code = (unsigned long) _etext;
>> - init_mm.end_data = (unsigned long) _edata;
>> - init_mm.brk = klimit;
>> + setup_initial_init_mm(_stext, _etext, _edata, _end);
>
> This looks wrong, should be klimit instead of _end IIUC
see arch/powerpc/kernel/setup-common.c:
unsigned long klimit = (unsigned long) _end;
the setup_initial_init_mm helper [1] should use the original _end
+static inline void setup_initial_init_mm(char *start_code,
+ char *end_code,
+ char *end_data,
+ char *brk)
+{
+ init_mm.start_code = (unsigned long)start_code;
+ init_mm.end_code = (unsigned long)end_code;
+ init_mm.end_data = (unsigned long)end_data;
+ init_mm.brk = (unsigned long)brk;
+}
[1] https://lkml.org/lkml/2021/5/29/84
>
>>
>> mm_iommu_init(&init_mm);
>> irqstack_early_init();
>> --
>> 2.26.2
>
>
> .
>
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 11/15] powerpc: convert to setup_initial_init_mm()
@ 2021-05-31 1:05 ` Kefeng Wang
0 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-31 1:05 UTC (permalink / raw)
To: Christophe Leroy; +Cc: Andrew Morton, linuxppc-dev, linux-kernel
On 2021/5/30 0:16, Christophe Leroy wrote:
> Kefeng Wang <wangkefeng.wang@huawei.com> a écrit :
>
>> Use setup_initial_init_mm() helper to simplify code.
>>
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> arch/powerpc/kernel/setup-common.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/kernel/setup-common.c
>> b/arch/powerpc/kernel/setup-common.c
>> index 046fe21b5c3b..c046d99efd18 100644
>> --- a/arch/powerpc/kernel/setup-common.c
>> +++ b/arch/powerpc/kernel/setup-common.c
>> @@ -928,10 +928,7 @@ void __init setup_arch(char **cmdline_p)
>>
>> klp_init_thread_info(&init_task);
>>
>> - init_mm.start_code = (unsigned long)_stext;
>> - init_mm.end_code = (unsigned long) _etext;
>> - init_mm.end_data = (unsigned long) _edata;
>> - init_mm.brk = klimit;
>> + setup_initial_init_mm(_stext, _etext, _edata, _end);
>
> This looks wrong, should be klimit instead of _end IIUC
see arch/powerpc/kernel/setup-common.c:
unsigned long klimit = (unsigned long) _end;
the setup_initial_init_mm helper [1] should use the original _end
+static inline void setup_initial_init_mm(char *start_code,
+ char *end_code,
+ char *end_data,
+ char *brk)
+{
+ init_mm.start_code = (unsigned long)start_code;
+ init_mm.end_code = (unsigned long)end_code;
+ init_mm.end_data = (unsigned long)end_data;
+ init_mm.brk = (unsigned long)brk;
+}
[1] https://lkml.org/lkml/2021/5/29/84
>
>>
>> mm_iommu_init(&init_mm);
>> irqstack_early_init();
>> --
>> 2.26.2
>
>
> .
>
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 03/15] arm: convert to setup_initial_init_mm()
2021-05-29 12:18 ` Russell King (Oracle)
@ 2021-05-31 1:10 ` Kefeng Wang
-1 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-31 1:10 UTC (permalink / raw)
To: Russell King (Oracle); +Cc: Andrew Morton, linux-kernel, linux-arm-kernel
On 2021/5/29 20:18, Russell King (Oracle) wrote:
> On Sat, May 29, 2021 at 06:54:52PM +0800, Kefeng Wang wrote:
>> Use setup_initial_init_mm() helper to simplify code.
>>
>> Cc: Russell King <linux@armlinux.org.uk>
>> Cc: linux-arm-kernel@lists.infradead.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> Obviously, without having visibility of the contents of
> setup_initial_init_mm(), it's impossible to say whether this change is
> correct or not, so I won't be providing any acks/reviewed-bys for it.
I realized that patch with introducing the setup_initial_init_mm helper
should
be send to each architectures, will pay attention next times.
Here is the helper https://lkml.org/lkml/2021/5/29/84
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 03/15] arm: convert to setup_initial_init_mm()
@ 2021-05-31 1:10 ` Kefeng Wang
0 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-31 1:10 UTC (permalink / raw)
To: Russell King (Oracle); +Cc: Andrew Morton, linux-kernel, linux-arm-kernel
On 2021/5/29 20:18, Russell King (Oracle) wrote:
> On Sat, May 29, 2021 at 06:54:52PM +0800, Kefeng Wang wrote:
>> Use setup_initial_init_mm() helper to simplify code.
>>
>> Cc: Russell King <linux@armlinux.org.uk>
>> Cc: linux-arm-kernel@lists.infradead.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> Obviously, without having visibility of the contents of
> setup_initial_init_mm(), it's impossible to say whether this change is
> correct or not, so I won't be providing any acks/reviewed-bys for it.
I realized that patch with introducing the setup_initial_init_mm helper
should
be send to each architectures, will pay attention next times.
Here is the helper https://lkml.org/lkml/2021/5/29/84
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 01/15] mm: add setup_initial_init_mm() helper
2021-05-29 10:54 ` [PATCH 01/15] mm: add " Kefeng Wang
@ 2021-05-31 7:45 ` Geert Uytterhoeven
2021-05-31 13:42 ` Kefeng Wang
0 siblings, 1 reply; 43+ messages in thread
From: Geert Uytterhoeven @ 2021-05-31 7:45 UTC (permalink / raw)
To: Kefeng Wang; +Cc: Andrew Morton, Linux Kernel Mailing List
Hi Kefeng,
On Sat, May 29, 2021 at 12:47 PM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
> Add setup_initial_init_mm() helper to setup kernel text,
> data and brk.
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Thanks for your patch!
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -564,6 +564,16 @@ struct mm_struct {
> };
>
> extern struct mm_struct init_mm;
> +static inline void setup_initial_init_mm(char *start_code,
> + char *end_code,
> + char *end_data,
> + char *brk)
"void *" (for all four)?
> +{
> + init_mm.start_code = (unsigned long)start_code;
> + init_mm.end_code = (unsigned long)end_code;
> + init_mm.end_data = (unsigned long)end_data;
> + init_mm.brk = (unsigned long)brk;
> +}
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 07/15] m68k: convert to setup_initial_init_mm()
2021-05-29 10:54 ` [PATCH 07/15] m68k: " Kefeng Wang
@ 2021-05-31 7:48 ` Geert Uytterhoeven
2021-06-02 13:13 ` Greg Ungerer
0 siblings, 1 reply; 43+ messages in thread
From: Geert Uytterhoeven @ 2021-05-31 7:48 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, Linux Kernel Mailing List, linux-m68k, Greg Ungerer
Hi Kefeng
(CC Greg for m68knommu)
On Sat, May 29, 2021 at 12:46 PM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
> Use setup_initial_init_mm() helper to simplify code.
>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: linux-m68k@lists.linux-m68k.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Thanks for your patch!
> --- a/arch/m68k/kernel/setup_mm.c
> +++ b/arch/m68k/kernel/setup_mm.c
> @@ -258,10 +258,7 @@ void __init setup_arch(char **cmdline_p)
> }
> }
>
> - init_mm.start_code = PAGE_OFFSET;
> - init_mm.end_code = (unsigned long)_etext;
> - init_mm.end_data = (unsigned long)_edata;
> - init_mm.brk = (unsigned long)_end;
> + setup_initial_init_mm((void *)PAGE_OFFSET, _etext, _edata, _end);
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
> --- a/arch/m68k/kernel/setup_no.c
> +++ b/arch/m68k/kernel/setup_no.c
> @@ -87,10 +87,7 @@ void __init setup_arch(char **cmdline_p)
> memory_start = PAGE_ALIGN(_ramstart);
> memory_end = _ramend;
>
> - init_mm.start_code = (unsigned long) &_stext;
> - init_mm.end_code = (unsigned long) &_etext;
> - init_mm.end_data = (unsigned long) &_edata;
> - init_mm.brk = (unsigned long) 0;
> + setup_initial_init_mm(_stext, _etext, _edata, (void *)0);
Please use NULL instead of (void *)0.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 06/15] h8300: convert to setup_initial_init_mm()
2021-05-29 10:54 ` [PATCH 06/15] h8300: " Kefeng Wang
@ 2021-05-31 7:48 ` Geert Uytterhoeven
0 siblings, 0 replies; 43+ messages in thread
From: Geert Uytterhoeven @ 2021-05-31 7:48 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, Linux Kernel Mailing List, Yoshinori Sato,
moderated list:H8/300 ARCHITECTURE
Hi Kefeng,
On Sat, May 29, 2021 at 12:47 PM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
> Use setup_initial_init_mm() helper to simplify code.
>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Thanks for your patch!
> --- a/arch/h8300/kernel/setup.c
> +++ b/arch/h8300/kernel/setup.c
> @@ -97,10 +97,7 @@ void __init setup_arch(char **cmdline_p)
> {
> unflatten_and_copy_device_tree();
>
> - init_mm.start_code = (unsigned long) _stext;
> - init_mm.end_code = (unsigned long) _etext;
> - init_mm.end_data = (unsigned long) _edata;
> - init_mm.brk = (unsigned long) 0;
> + setup_initial_init_mm(_stext, _etext, _edata, (void *)0);
Please use NULL instead of (void *)0.
>
> pr_notice("\r\n\nuClinux " CPU "\n");
> pr_notice("Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne\n");
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 01/15] mm: add setup_initial_init_mm() helper
2021-05-31 7:45 ` Geert Uytterhoeven
@ 2021-05-31 13:42 ` Kefeng Wang
0 siblings, 0 replies; 43+ messages in thread
From: Kefeng Wang @ 2021-05-31 13:42 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Andrew Morton, Linux Kernel Mailing List
On 2021/5/31 15:45, Geert Uytterhoeven wrote:
> Hi Kefeng,
>
> On Sat, May 29, 2021 at 12:47 PM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>> Add setup_initial_init_mm() helper to setup kernel text,
>> data and brk.
>>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> Thanks for your patch!
>
>> --- a/include/linux/mm_types.h
>> +++ b/include/linux/mm_types.h
>> @@ -564,6 +564,16 @@ struct mm_struct {
>> };
>>
>> extern struct mm_struct init_mm;
>> +static inline void setup_initial_init_mm(char *start_code,
>> + char *end_code,
>> + char *end_data,
>> + char *brk)
> "void *" (for all four)?
The original users are all "char*", so same here ;)
>
>> +{
>> + init_mm.start_code = (unsigned long)start_code;
>> + init_mm.end_code = (unsigned long)end_code;
>> + init_mm.end_data = (unsigned long)end_data;
>> + init_mm.brk = (unsigned long)brk;
>> +}
> Gr{oetje,eeting}s,
>
> Geert
>
^ permalink raw reply [flat|nested] 43+ messages in thread
* Re: [PATCH 07/15] m68k: convert to setup_initial_init_mm()
2021-05-31 7:48 ` Geert Uytterhoeven
@ 2021-06-02 13:13 ` Greg Ungerer
0 siblings, 0 replies; 43+ messages in thread
From: Greg Ungerer @ 2021-06-02 13:13 UTC (permalink / raw)
To: Geert Uytterhoeven, Kefeng Wang
Cc: Andrew Morton, Linux Kernel Mailing List, linux-m68k
On 31/5/21 5:48 pm, Geert Uytterhoeven wrote:
> Hi Kefeng
>
> (CC Greg for m68knommu)
>
> On Sat, May 29, 2021 at 12:46 PM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>> Use setup_initial_init_mm() helper to simplify code.
>>
>> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
>> Cc: linux-m68k@lists.linux-m68k.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>
> Thanks for your patch!
>
>> --- a/arch/m68k/kernel/setup_mm.c
>> +++ b/arch/m68k/kernel/setup_mm.c
>> @@ -258,10 +258,7 @@ void __init setup_arch(char **cmdline_p)
>> }
>> }
>>
>> - init_mm.start_code = PAGE_OFFSET;
>> - init_mm.end_code = (unsigned long)_etext;
>> - init_mm.end_data = (unsigned long)_edata;
>> - init_mm.brk = (unsigned long)_end;
>> + setup_initial_init_mm((void *)PAGE_OFFSET, _etext, _edata, _end);
>
> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
>
>> --- a/arch/m68k/kernel/setup_no.c
>> +++ b/arch/m68k/kernel/setup_no.c
>> @@ -87,10 +87,7 @@ void __init setup_arch(char **cmdline_p)
>> memory_start = PAGE_ALIGN(_ramstart);
>> memory_end = _ramend;
>>
>> - init_mm.start_code = (unsigned long) &_stext;
>> - init_mm.end_code = (unsigned long) &_etext;
>> - init_mm.end_data = (unsigned long) &_edata;
>> - init_mm.brk = (unsigned long) 0;
>> + setup_initial_init_mm(_stext, _etext, _edata, (void *)0);
>
> Please use NULL instead of (void *)0.
With that in place, no problems I see.
Acked-by: Greg Ungerer <gerg@linux-m68k.org>
> Gr{oetje,eeting}s,
>
> Geert
>
^ permalink raw reply [flat|nested] 43+ messages in thread
end of thread, other threads:[~2021-06-02 13:13 UTC | newest]
Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-29 10:54 [PATCH 00/15] init_mm: setup init_mm text/data/brk by new setup_initial_init_mm() helper Kefeng Wang
2021-05-29 10:54 ` [PATCH 01/15] mm: add " Kefeng Wang
2021-05-31 7:45 ` Geert Uytterhoeven
2021-05-31 13:42 ` Kefeng Wang
2021-05-29 10:54 ` [PATCH 02/15] arc: convert to setup_initial_init_mm() Kefeng Wang
2021-05-29 10:54 ` Kefeng Wang
2021-05-29 10:54 ` [PATCH 03/15] arm: " Kefeng Wang
2021-05-29 10:54 ` Kefeng Wang
2021-05-29 12:18 ` Russell King (Oracle)
2021-05-29 12:18 ` Russell King (Oracle)
2021-05-31 1:10 ` Kefeng Wang
2021-05-31 1:10 ` Kefeng Wang
2021-05-29 10:54 ` [PATCH 04/15] arm64: " Kefeng Wang
2021-05-29 10:54 ` Kefeng Wang
2021-05-29 10:54 ` [PATCH 05/15] csky: " Kefeng Wang
2021-05-30 0:23 ` Guo Ren
2021-05-29 10:54 ` [PATCH 06/15] h8300: " Kefeng Wang
2021-05-31 7:48 ` Geert Uytterhoeven
2021-05-29 10:54 ` [PATCH 07/15] m68k: " Kefeng Wang
2021-05-31 7:48 ` Geert Uytterhoeven
2021-06-02 13:13 ` Greg Ungerer
2021-05-29 10:54 ` [PATCH 08/15] nds32: " Kefeng Wang
2021-05-29 10:54 ` [PATCH 09/15] nios2: " Kefeng Wang
2021-05-29 10:54 ` [PATCH 10/15] openrisc: " Kefeng Wang
2021-05-29 10:54 ` [OpenRISC] " Kefeng Wang
2021-05-29 13:48 ` Stafford Horne
2021-05-29 13:48 ` [OpenRISC] " Stafford Horne
2021-05-29 10:55 ` [PATCH 11/15] powerpc: " Kefeng Wang
2021-05-29 10:55 ` Kefeng Wang
2021-05-29 12:46 ` Santosh Sivaraj
2021-05-29 15:22 ` Christophe Leroy
2021-05-29 15:22 ` Christophe Leroy
2021-05-31 1:02 ` Kefeng Wang
2021-05-31 1:02 ` Kefeng Wang
2021-05-29 16:16 ` Christophe Leroy
2021-05-29 16:16 ` Christophe Leroy
2021-05-31 1:05 ` Kefeng Wang
2021-05-31 1:05 ` Kefeng Wang
2021-05-29 10:55 ` [PATCH 12/15] riscv: " Kefeng Wang
2021-05-29 10:55 ` Kefeng Wang
2021-05-29 10:55 ` [PATCH 13/15] s390: " Kefeng Wang
2021-05-29 10:55 ` [PATCH 14/15] sh: " Kefeng Wang
2021-05-29 10:55 ` [PATCH 15/15] x86: " Kefeng Wang
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.