* [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390
Add setup_initial_init_mm() helper, then use it
to cleanup the text, data and brk setup code.
v2:
- change argument from "char *" to "void *" setup_initial_init_mm()
suggested by Geert Uytterhoeven
- use NULL instead of (void *)0 on h8300 and m68k
- collect ACKs
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
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 | 8 ++++++++
16 files changed, 23 insertions(+), 60 deletions(-)
--
2.26.2
^ permalink raw reply [flat|nested] 90+ messages in thread
* [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390
Add setup_initial_init_mm() helper, then use it
to cleanup the text, data and brk setup code.
v2:
- change argument from "char *" to "void *" setup_initial_init_mm()
suggested by Geert Uytterhoeven
- use NULL instead of (void *)0 on h8300 and m68k
- collect ACKs
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
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 | 8 ++++++++
16 files changed, 23 insertions(+), 60 deletions(-)
--
2.26.2
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: uclinux-h8-devel, linux-s390, Kefeng Wang, linux-sh, linux-csky,
linux-mm, linux-m68k, openrisc, linux-riscv, linux-snps-arc,
linuxppc-dev, linux-arm-kernel
Add setup_initial_init_mm() helper, then use it
to cleanup the text, data and brk setup code.
v2:
- change argument from "char *" to "void *" setup_initial_init_mm()
suggested by Geert Uytterhoeven
- use NULL instead of (void *)0 on h8300 and m68k
- collect ACKs
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
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 | 8 ++++++++
16 files changed, 23 insertions(+), 60 deletions(-)
--
2.26.2
^ permalink raw reply [flat|nested] 90+ messages in thread
* [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390
Add setup_initial_init_mm() helper, then use it
to cleanup the text, data and brk setup code.
v2:
- change argument from "char *" to "void *" setup_initial_init_mm()
suggested by Geert Uytterhoeven
- use NULL instead of (void *)0 on h8300 and m68k
- collect ACKs
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
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 | 8 ++++++++
16 files changed, 23 insertions(+), 60 deletions(-)
--
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 [flat|nested] 90+ messages in thread
* [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390
Add setup_initial_init_mm() helper, then use it
to cleanup the text, data and brk setup code.
v2:
- change argument from "char *" to "void *" setup_initial_init_mm()
suggested by Geert Uytterhoeven
- use NULL instead of (void *)0 on h8300 and m68k
- collect ACKs
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
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 | 8 ++++++++
16 files changed, 23 insertions(+), 60 deletions(-)
--
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 [flat|nested] 90+ messages in thread
* [OpenRISC] [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: openrisc
Add setup_initial_init_mm() helper, then use it
to cleanup the text, data and brk setup code.
v2:
- change argument from "char *" to "void *" setup_initial_init_mm()
suggested by Geert Uytterhoeven
- use NULL instead of (void *)0 on h8300 and m68k
- collect ACKs
Cc: linux-snps-arc at lists.infradead.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-csky at vger.kernel.org
Cc: uclinux-h8-devel at lists.sourceforge.jp
Cc: linux-m68k at lists.linux-m68k.org
Cc: openrisc at lists.librecores.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-riscv at lists.infradead.org
Cc: linux-sh at vger.kernel.org
Cc: linux-s390 at vger.kernel.org
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 | 8 ++++++++
16 files changed, 23 insertions(+), 60 deletions(-)
--
2.26.2
^ permalink raw reply [flat|nested] 90+ messages in thread
* [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
2021-06-04 7:06 ` Kefeng Wang
` (3 preceding siblings ...)
(?)
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390, x86
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/linux/mm_types.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 5aacc1c10a45..e1d2429089a4 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -572,6 +572,14 @@ struct mm_struct {
};
extern struct mm_struct init_mm;
+static inline void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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] 90+ messages in thread
* [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390, x86
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/linux/mm_types.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 5aacc1c10a45..e1d2429089a4 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -572,6 +572,14 @@ struct mm_struct {
};
extern struct mm_struct init_mm;
+static inline void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 90+ messages in thread
* [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: uclinux-h8-devel, linux-s390, Kefeng Wang, linux-sh, x86,
linux-csky, linux-mm, linux-m68k, openrisc, linux-riscv,
linux-snps-arc, linuxppc-dev, linux-arm-kernel
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/linux/mm_types.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 5aacc1c10a45..e1d2429089a4 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -572,6 +572,14 @@ struct mm_struct {
};
extern struct mm_struct init_mm;
+static inline void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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] 90+ messages in thread
* [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390, x86
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/linux/mm_types.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 5aacc1c10a45..e1d2429089a4 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -572,6 +572,14 @@ struct mm_struct {
};
extern struct mm_struct init_mm;
+static inline void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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
_______________________________________________
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] 90+ messages in thread
* [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390, x86
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/linux/mm_types.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 5aacc1c10a45..e1d2429089a4 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -572,6 +572,14 @@ struct mm_struct {
};
extern struct mm_struct init_mm;
+static inline void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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
_______________________________________________
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] 90+ messages in thread
* [OpenRISC] [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: openrisc
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc at lists.infradead.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-csky at vger.kernel.org
Cc: uclinux-h8-devel at lists.sourceforge.jp
Cc: linux-m68k at lists.linux-m68k.org
Cc: openrisc at lists.librecores.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-riscv at lists.infradead.org
Cc: linux-sh at vger.kernel.org
Cc: linux-s390 at vger.kernel.org
Cc: x86 at kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/linux/mm_types.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 5aacc1c10a45..e1d2429089a4 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -572,6 +572,14 @@ struct mm_struct {
};
extern struct mm_struct init_mm;
+static inline void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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] 90+ messages in thread
* [PATCH v2 02/15] arc: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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] 90+ messages in thread
* [PATCH v2 02/15] arc: convert to setup_initial_init_mm()
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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] 90+ messages in thread
* [PATCH v2 03/15] arm: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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] 90+ messages in thread
* [PATCH v2 03/15] arm: convert to setup_initial_init_mm()
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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] 90+ messages in thread
* [PATCH v2 04/15] arm64: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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 61845c0821d9..bfc98f893a1b 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -298,10 +298,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] 90+ messages in thread
* [PATCH v2 04/15] arm64: convert to setup_initial_init_mm()
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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 61845c0821d9..bfc98f893a1b 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -298,10 +298,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] 90+ messages in thread
* [PATCH v2 05/15] csky: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
` (8 preceding siblings ...)
(?)
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: linux-mm, Kefeng Wang, Guo Ren, linux-csky
Use setup_initial_init_mm() helper to simplify code.
Acked-by: Guo Ren <guoren@kernel.org>
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] 90+ messages in thread
* [PATCH v2 06/15] h8300: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
` (9 preceding siblings ...)
(?)
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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 0281f92eea3d..f757056305df 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, NULL);
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] 90+ messages in thread
* [PATCH v2 07/15] m68k: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
` (10 preceding siblings ...)
(?)
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, Greg Ungerer, Geert Uytterhoeven, linux-m68k
Use setup_initial_init_mm() helper to simplify code.
Acked-by: Greg Ungerer <gerg@linux-m68k.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@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..5e4104f07a44 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, NULL);
config_BSP(&command_line[0], sizeof(command_line));
--
2.26.2
^ permalink raw reply related [flat|nested] 90+ messages in thread
* [PATCH v2 08/15] nds32: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
` (11 preceding siblings ...)
(?)
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: linux-mm, 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] 90+ messages in thread
* [PATCH v2 09/15] nios2: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
` (12 preceding siblings ...)
(?)
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: linux-mm, 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] 90+ messages in thread
* [PATCH v2 10/15] openrisc: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, Stafford Horne, Jonas Bonn,
Stefan Kristiansson, openrisc
Use setup_initial_init_mm() helper to simplify code.
Acked-by: Stafford Horne <shorne@gmail.com>
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] 90+ messages in thread
* [OpenRISC] [PATCH v2 10/15] openrisc: convert to setup_initial_init_mm()
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: openrisc
Use setup_initial_init_mm() helper to simplify code.
Acked-by: Stafford Horne <shorne@gmail.com>
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] 90+ messages in thread
* [PATCH v2 11/15] powerpc: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, Michael Ellerman, Benjamin Herrenschmidt,
linuxppc-dev
Use setup_initial_init_mm() helper to simplify code.
Note klimit is (unsigned long) _end, with new helper,
will use _end directly.
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 74a98fff2c2f..96697c6e1e16 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -927,10 +927,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] 90+ messages in thread
* [PATCH v2 11/15] powerpc: convert to setup_initial_init_mm()
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel; +Cc: linux-mm, Kefeng Wang, linuxppc-dev
Use setup_initial_init_mm() helper to simplify code.
Note klimit is (unsigned long) _end, with new helper,
will use _end directly.
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 74a98fff2c2f..96697c6e1e16 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -927,10 +927,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] 90+ messages in thread
* [PATCH v2 12/15] riscv: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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 03901d3a8b02..52396874f859 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] 90+ messages in thread
* [PATCH v2 12/15] riscv: convert to setup_initial_init_mm()
@ 2021-06-04 7:06 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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 03901d3a8b02..52396874f859 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] 90+ messages in thread
* [PATCH v2 13/15] s390: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
` (16 preceding siblings ...)
(?)
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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 5aab59ad5688..e1793ed43510 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -1119,10 +1119,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] 90+ messages in thread
* [PATCH v2 14/15] sh: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
` (17 preceding siblings ...)
(?)
@ 2021-06-04 7:06 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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] 90+ messages in thread
* [PATCH v2 15/15] x86: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
` (18 preceding siblings ...)
(?)
@ 2021-06-04 7:06 ` Kefeng Wang
2021-06-08 0:26 ` Andrew Morton
-1 siblings, 1 reply; 90+ messages in thread
From: Kefeng Wang @ 2021-06-04 7:06 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, 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 72920af0b3c0..2be957ab7f8c 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -868,10 +868,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] 90+ messages in thread
* Re: [PATCH v2 04/15] arm64: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
@ 2021-06-04 9:19 ` Catalin Marinas
-1 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2021-06-04 9:19 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, linux-kernel, linux-mm, Will Deacon, linux-arm-kernel
On Fri, Jun 04, 2021 at 03:06:22PM +0800, Kefeng Wang wrote:
> 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>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 04/15] arm64: convert to setup_initial_init_mm()
@ 2021-06-04 9:19 ` Catalin Marinas
0 siblings, 0 replies; 90+ messages in thread
From: Catalin Marinas @ 2021-06-04 9:19 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, linux-kernel, linux-mm, Will Deacon, linux-arm-kernel
On Fri, Jun 04, 2021 at 03:06:22PM +0800, Kefeng Wang wrote:
> 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>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
_______________________________________________
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] 90+ messages in thread
* Re: [PATCH v2 02/15] arc: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
(?)
@ 2021-06-04 14:03 ` Vineet Gupta
-1 siblings, 0 replies; 90+ messages in thread
From: Vineet Gupta @ 2021-06-04 14:03 UTC (permalink / raw)
To: Kefeng Wang, Andrew Morton, linux-kernel; +Cc: linux-mm, linux-snps-arc
On 6/4/21 12:06 AM, Kefeng Wang wrote:
> 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>
Acked-by: Vineet Gupta <vgupta@synopsys.com> #arch/arc
Thx,
-Vineet
> ---
> 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);
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 02/15] arc: convert to setup_initial_init_mm()
@ 2021-06-04 14:03 ` Vineet Gupta
0 siblings, 0 replies; 90+ messages in thread
From: Vineet Gupta @ 2021-06-04 14:03 UTC (permalink / raw)
To: Kefeng Wang, Andrew Morton, linux-kernel; +Cc: linux-mm, linux-snps-arc
On 6/4/21 12:06 AM, Kefeng Wang wrote:
> 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>
Acked-by: Vineet Gupta <vgupta@synopsys.com> #arch/arc
Thx,
-Vineet
> ---
> 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);
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 02/15] arc: convert to setup_initial_init_mm()
@ 2021-06-04 14:03 ` Vineet Gupta
0 siblings, 0 replies; 90+ messages in thread
From: Vineet Gupta @ 2021-06-04 14:03 UTC (permalink / raw)
To: Kefeng Wang, Andrew Morton, linux-kernel; +Cc: linux-mm, linux-snps-arc
On 6/4/21 12:06 AM, Kefeng Wang wrote:
> 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>
Acked-by: Vineet Gupta <vgupta@synopsys.com> #arch/arc
Thx,
-Vineet
> ---
> 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);
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
2021-06-04 7:06 ` Kefeng Wang
` (3 preceding siblings ...)
(?)
@ 2021-06-06 21:29 ` Mike Rapoport
-1 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:29 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper, then use it
> to cleanup the text, data and brk setup code.
>
> v2:
> - change argument from "char *" to "void *" setup_initial_init_mm()
> suggested by Geert Uytterhoeven
> - use NULL instead of (void *)0 on h8300 and m68k
> - collect ACKs
>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-csky@vger.kernel.org
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: openrisc@lists.librecores.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-riscv@lists.infradead.org
> Cc: linux-sh@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> 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()
I might be missing something, but AFAIU the init_mm.start_code and other
fields are not used really early so the new setup_initial_init_mm()
function can be called in the generic code outside setup_arch(), e.g in
mm_init().
> 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 | 8 ++++++++
> 16 files changed, 23 insertions(+), 60 deletions(-)
>
> --
> 2.26.2
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-06 21:29 ` Mike Rapoport
0 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:29 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper, then use it
> to cleanup the text, data and brk setup code.
>
> v2:
> - change argument from "char *" to "void *" setup_initial_init_mm()
> suggested by Geert Uytterhoeven
> - use NULL instead of (void *)0 on h8300 and m68k
> - collect ACKs
>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-csky@vger.kernel.org
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: openrisc@lists.librecores.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-riscv@lists.infradead.org
> Cc: linux-sh@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> 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()
I might be missing something, but AFAIU the init_mm.start_code and other
fields are not used really early so the new setup_initial_init_mm()
function can be called in the generic code outside setup_arch(), e.g in
mm_init().
> 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 | 8 ++++++++
> 16 files changed, 23 insertions(+), 60 deletions(-)
>
> --
> 2.26.2
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-06 21:29 ` Mike Rapoport
0 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:29 UTC (permalink / raw)
To: Kefeng Wang
Cc: uclinux-h8-devel, linux-s390, linux-sh, linux-kernel, linux-csky,
linux-mm, linux-m68k, openrisc, Andrew Morton, linux-snps-arc,
linuxppc-dev, linux-riscv, linux-arm-kernel
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper, then use it
> to cleanup the text, data and brk setup code.
>
> v2:
> - change argument from "char *" to "void *" setup_initial_init_mm()
> suggested by Geert Uytterhoeven
> - use NULL instead of (void *)0 on h8300 and m68k
> - collect ACKs
>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-csky@vger.kernel.org
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: openrisc@lists.librecores.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-riscv@lists.infradead.org
> Cc: linux-sh@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> 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()
I might be missing something, but AFAIU the init_mm.start_code and other
fields are not used really early so the new setup_initial_init_mm()
function can be called in the generic code outside setup_arch(), e.g in
mm_init().
> 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 | 8 ++++++++
> 16 files changed, 23 insertions(+), 60 deletions(-)
>
> --
> 2.26.2
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-06 21:29 ` Mike Rapoport
0 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:29 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper, then use it
> to cleanup the text, data and brk setup code.
>
> v2:
> - change argument from "char *" to "void *" setup_initial_init_mm()
> suggested by Geert Uytterhoeven
> - use NULL instead of (void *)0 on h8300 and m68k
> - collect ACKs
>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-csky@vger.kernel.org
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: openrisc@lists.librecores.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-riscv@lists.infradead.org
> Cc: linux-sh@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> 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()
I might be missing something, but AFAIU the init_mm.start_code and other
fields are not used really early so the new setup_initial_init_mm()
function can be called in the generic code outside setup_arch(), e.g in
mm_init().
> 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 | 8 ++++++++
> 16 files changed, 23 insertions(+), 60 deletions(-)
>
> --
> 2.26.2
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-06 21:29 ` Mike Rapoport
0 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:29 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper, then use it
> to cleanup the text, data and brk setup code.
>
> v2:
> - change argument from "char *" to "void *" setup_initial_init_mm()
> suggested by Geert Uytterhoeven
> - use NULL instead of (void *)0 on h8300 and m68k
> - collect ACKs
>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-csky@vger.kernel.org
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: openrisc@lists.librecores.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-riscv@lists.infradead.org
> Cc: linux-sh@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> 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()
I might be missing something, but AFAIU the init_mm.start_code and other
fields are not used really early so the new setup_initial_init_mm()
function can be called in the generic code outside setup_arch(), e.g in
mm_init().
> 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 | 8 ++++++++
> 16 files changed, 23 insertions(+), 60 deletions(-)
>
> --
> 2.26.2
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
_______________________________________________
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] 90+ messages in thread
* [OpenRISC] [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-06 21:29 ` Mike Rapoport
0 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:29 UTC (permalink / raw)
To: openrisc
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper, then use it
> to cleanup the text, data and brk setup code.
>
> v2:
> - change argument from "char *" to "void *" setup_initial_init_mm()
> suggested by Geert Uytterhoeven
> - use NULL instead of (void *)0 on h8300 and m68k
> - collect ACKs
>
> Cc: linux-snps-arc at lists.infradead.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-csky at vger.kernel.org
> Cc: uclinux-h8-devel at lists.sourceforge.jp
> Cc: linux-m68k at lists.linux-m68k.org
> Cc: openrisc at lists.librecores.org
> Cc: linuxppc-dev at lists.ozlabs.org
> Cc: linux-riscv at lists.infradead.org
> Cc: linux-sh at vger.kernel.org
> Cc: linux-s390 at vger.kernel.org
> 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()
I might be missing something, but AFAIU the init_mm.start_code and other
fields are not used really early so the new setup_initial_init_mm()
function can be called in the generic code outside setup_arch(), e.g in
mm_init().
> 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 | 8 ++++++++
> 16 files changed, 23 insertions(+), 60 deletions(-)
>
> --
> 2.26.2
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
2021-06-04 7:06 ` Kefeng Wang
` (3 preceding siblings ...)
(?)
@ 2021-06-06 21:31 ` Mike Rapoport
-1 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:31 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390, x86
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper to setup kernel text,
> data and brk.
>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-csky@vger.kernel.org
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: openrisc@lists.librecores.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-riscv@lists.infradead.org
> Cc: linux-sh@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> Cc: x86@kernel.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> include/linux/mm_types.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 5aacc1c10a45..e1d2429089a4 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -572,6 +572,14 @@ struct mm_struct {
> };
>
> extern struct mm_struct init_mm;
> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
> + void *end_data, void *brk)
I think it's not that performance sensitive to make it inline. It can be
placed in mm/init-mm.c with a forward declaration in mm.h
> +{
> + 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
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-06 21:31 ` Mike Rapoport
0 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:31 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390, x86
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper to setup kernel text,
> data and brk.
>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-csky@vger.kernel.org
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: openrisc@lists.librecores.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-riscv@lists.infradead.org
> Cc: linux-sh@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> Cc: x86@kernel.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> include/linux/mm_types.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 5aacc1c10a45..e1d2429089a4 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -572,6 +572,14 @@ struct mm_struct {
> };
>
> extern struct mm_struct init_mm;
> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
> + void *end_data, void *brk)
I think it's not that performance sensitive to make it inline. It can be
placed in mm/init-mm.c with a forward declaration in mm.h
> +{
> + 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
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-06 21:31 ` Mike Rapoport
0 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:31 UTC (permalink / raw)
To: Kefeng Wang
Cc: uclinux-h8-devel, linux-s390, linux-sh, x86, linux-kernel,
linux-csky, linux-mm, linux-m68k, openrisc, Andrew Morton,
linux-snps-arc, linuxppc-dev, linux-riscv, linux-arm-kernel
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper to setup kernel text,
> data and brk.
>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-csky@vger.kernel.org
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: openrisc@lists.librecores.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-riscv@lists.infradead.org
> Cc: linux-sh@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> Cc: x86@kernel.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> include/linux/mm_types.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 5aacc1c10a45..e1d2429089a4 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -572,6 +572,14 @@ struct mm_struct {
> };
>
> extern struct mm_struct init_mm;
> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
> + void *end_data, void *brk)
I think it's not that performance sensitive to make it inline. It can be
placed in mm/init-mm.c with a forward declaration in mm.h
> +{
> + 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
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-06 21:31 ` Mike Rapoport
0 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:31 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390, x86
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper to setup kernel text,
> data and brk.
>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-csky@vger.kernel.org
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: openrisc@lists.librecores.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-riscv@lists.infradead.org
> Cc: linux-sh@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> Cc: x86@kernel.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> include/linux/mm_types.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 5aacc1c10a45..e1d2429089a4 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -572,6 +572,14 @@ struct mm_struct {
> };
>
> extern struct mm_struct init_mm;
> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
> + void *end_data, void *brk)
I think it's not that performance sensitive to make it inline. It can be
placed in mm/init-mm.c with a forward declaration in mm.h
> +{
> + 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
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-06 21:31 ` Mike Rapoport
0 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:31 UTC (permalink / raw)
To: Kefeng Wang
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390, x86
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper to setup kernel text,
> data and brk.
>
> Cc: linux-snps-arc@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-csky@vger.kernel.org
> Cc: uclinux-h8-devel@lists.sourceforge.jp
> Cc: linux-m68k@lists.linux-m68k.org
> Cc: openrisc@lists.librecores.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-riscv@lists.infradead.org
> Cc: linux-sh@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> Cc: x86@kernel.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> include/linux/mm_types.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 5aacc1c10a45..e1d2429089a4 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -572,6 +572,14 @@ struct mm_struct {
> };
>
> extern struct mm_struct init_mm;
> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
> + void *end_data, void *brk)
I think it's not that performance sensitive to make it inline. It can be
placed in mm/init-mm.c with a forward declaration in mm.h
> +{
> + 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
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
_______________________________________________
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] 90+ messages in thread
* [OpenRISC] [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-06 21:31 ` Mike Rapoport
0 siblings, 0 replies; 90+ messages in thread
From: Mike Rapoport @ 2021-06-06 21:31 UTC (permalink / raw)
To: openrisc
Hello Kefeng,
On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
> Add setup_initial_init_mm() helper to setup kernel text,
> data and brk.
>
> Cc: linux-snps-arc at lists.infradead.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-csky at vger.kernel.org
> Cc: uclinux-h8-devel at lists.sourceforge.jp
> Cc: linux-m68k at lists.linux-m68k.org
> Cc: openrisc at lists.librecores.org
> Cc: linuxppc-dev at lists.ozlabs.org
> Cc: linux-riscv at lists.infradead.org
> Cc: linux-sh at vger.kernel.org
> Cc: linux-s390 at vger.kernel.org
> Cc: x86 at kernel.org
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> include/linux/mm_types.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 5aacc1c10a45..e1d2429089a4 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -572,6 +572,14 @@ struct mm_struct {
> };
>
> extern struct mm_struct init_mm;
> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
> + void *end_data, void *brk)
I think it's not that performance sensitive to make it inline. It can be
placed in mm/init-mm.c with a forward declaration in mm.h
> +{
> + 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
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
2021-06-06 21:29 ` Mike Rapoport
` (3 preceding siblings ...)
(?)
@ 2021-06-07 0:55 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 0:55 UTC (permalink / raw)
To: Mike Rapoport
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390
On 2021/6/7 5:29, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper, then use it
>> to cleanup the text, data and brk setup code.
>>
>> v2:
>> - change argument from "char *" to "void *" setup_initial_init_mm()
>> suggested by Geert Uytterhoeven
>> - use NULL instead of (void *)0 on h8300 and m68k
>> - collect ACKs
>>
>> Cc: linux-snps-arc@lists.infradead.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-csky@vger.kernel.org
>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>> Cc: linux-m68k@lists.linux-m68k.org
>> Cc: openrisc@lists.librecores.org
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Cc: linux-riscv@lists.infradead.org
>> Cc: linux-sh@vger.kernel.org
>> Cc: linux-s390@vger.kernel.org
>> 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()
> I might be missing something, but AFAIU the init_mm.start_code and other
> fields are not used really early so the new setup_initial_init_mm()
> function can be called in the generic code outside setup_arch(), e.g in
> mm_init().
Hi Mike, each architecture has their own value, not the same, eg m68K and
h8300, also the name of the text/code/brk is different in some arch, so
I keep
unchanged.
>
>> 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 | 8 ++++++++
>> 16 files changed, 23 insertions(+), 60 deletions(-)
>>
>> --
>> 2.26.2
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 0:55 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 0:55 UTC (permalink / raw)
To: Mike Rapoport
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390
On 2021/6/7 5:29, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper, then use it
>> to cleanup the text, data and brk setup code.
>>
>> v2:
>> - change argument from "char *" to "void *" setup_initial_init_mm()
>> suggested by Geert Uytterhoeven
>> - use NULL instead of (void *)0 on h8300 and m68k
>> - collect ACKs
>>
>> Cc: linux-snps-arc@lists.infradead.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-csky@vger.kernel.org
>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>> Cc: linux-m68k@lists.linux-m68k.org
>> Cc: openrisc@lists.librecores.org
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Cc: linux-riscv@lists.infradead.org
>> Cc: linux-sh@vger.kernel.org
>> Cc: linux-s390@vger.kernel.org
>> 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()
> I might be missing something, but AFAIU the init_mm.start_code and other
> fields are not used really early so the new setup_initial_init_mm()
> function can be called in the generic code outside setup_arch(), e.g in
> mm_init().
Hi Mike, each architecture has their own value, not the same, eg m68K and
h8300, also the name of the text/code/brk is different in some arch, so
I keep
unchanged.
>
>> 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 | 8 ++++++++
>> 16 files changed, 23 insertions(+), 60 deletions(-)
>>
>> --
>> 2.26.2
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 0:55 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 0:55 UTC (permalink / raw)
To: Mike Rapoport
Cc: uclinux-h8-devel, linux-s390, linux-sh, linux-kernel, linux-csky,
linux-mm, linux-m68k, openrisc, Andrew Morton, linux-snps-arc,
linuxppc-dev, linux-riscv, linux-arm-kernel
On 2021/6/7 5:29, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper, then use it
>> to cleanup the text, data and brk setup code.
>>
>> v2:
>> - change argument from "char *" to "void *" setup_initial_init_mm()
>> suggested by Geert Uytterhoeven
>> - use NULL instead of (void *)0 on h8300 and m68k
>> - collect ACKs
>>
>> Cc: linux-snps-arc@lists.infradead.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-csky@vger.kernel.org
>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>> Cc: linux-m68k@lists.linux-m68k.org
>> Cc: openrisc@lists.librecores.org
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Cc: linux-riscv@lists.infradead.org
>> Cc: linux-sh@vger.kernel.org
>> Cc: linux-s390@vger.kernel.org
>> 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()
> I might be missing something, but AFAIU the init_mm.start_code and other
> fields are not used really early so the new setup_initial_init_mm()
> function can be called in the generic code outside setup_arch(), e.g in
> mm_init().
Hi Mike, each architecture has their own value, not the same, eg m68K and
h8300, also the name of the text/code/brk is different in some arch, so
I keep
unchanged.
>
>> 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 | 8 ++++++++
>> 16 files changed, 23 insertions(+), 60 deletions(-)
>>
>> --
>> 2.26.2
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 0:55 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 0:55 UTC (permalink / raw)
To: Mike Rapoport
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390
On 2021/6/7 5:29, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper, then use it
>> to cleanup the text, data and brk setup code.
>>
>> v2:
>> - change argument from "char *" to "void *" setup_initial_init_mm()
>> suggested by Geert Uytterhoeven
>> - use NULL instead of (void *)0 on h8300 and m68k
>> - collect ACKs
>>
>> Cc: linux-snps-arc@lists.infradead.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-csky@vger.kernel.org
>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>> Cc: linux-m68k@lists.linux-m68k.org
>> Cc: openrisc@lists.librecores.org
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Cc: linux-riscv@lists.infradead.org
>> Cc: linux-sh@vger.kernel.org
>> Cc: linux-s390@vger.kernel.org
>> 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()
> I might be missing something, but AFAIU the init_mm.start_code and other
> fields are not used really early so the new setup_initial_init_mm()
> function can be called in the generic code outside setup_arch(), e.g in
> mm_init().
Hi Mike, each architecture has their own value, not the same, eg m68K and
h8300, also the name of the text/code/brk is different in some arch, so
I keep
unchanged.
>
>> 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 | 8 ++++++++
>> 16 files changed, 23 insertions(+), 60 deletions(-)
>>
>> --
>> 2.26.2
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 0:55 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 0:55 UTC (permalink / raw)
To: Mike Rapoport
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390
On 2021/6/7 5:29, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper, then use it
>> to cleanup the text, data and brk setup code.
>>
>> v2:
>> - change argument from "char *" to "void *" setup_initial_init_mm()
>> suggested by Geert Uytterhoeven
>> - use NULL instead of (void *)0 on h8300 and m68k
>> - collect ACKs
>>
>> Cc: linux-snps-arc@lists.infradead.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-csky@vger.kernel.org
>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>> Cc: linux-m68k@lists.linux-m68k.org
>> Cc: openrisc@lists.librecores.org
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Cc: linux-riscv@lists.infradead.org
>> Cc: linux-sh@vger.kernel.org
>> Cc: linux-s390@vger.kernel.org
>> 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()
> I might be missing something, but AFAIU the init_mm.start_code and other
> fields are not used really early so the new setup_initial_init_mm()
> function can be called in the generic code outside setup_arch(), e.g in
> mm_init().
Hi Mike, each architecture has their own value, not the same, eg m68K and
h8300, also the name of the text/code/brk is different in some arch, so
I keep
unchanged.
>
>> 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 | 8 ++++++++
>> 16 files changed, 23 insertions(+), 60 deletions(-)
>>
>> --
>> 2.26.2
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
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] 90+ messages in thread
* [OpenRISC] [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 0:55 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 0:55 UTC (permalink / raw)
To: openrisc
On 2021/6/7 5:29, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper, then use it
>> to cleanup the text, data and brk setup code.
>>
>> v2:
>> - change argument from "char *" to "void *" setup_initial_init_mm()
>> suggested by Geert Uytterhoeven
>> - use NULL instead of (void *)0 on h8300 and m68k
>> - collect ACKs
>>
>> Cc: linux-snps-arc at lists.infradead.org
>> Cc: linux-arm-kernel at lists.infradead.org
>> Cc: linux-csky at vger.kernel.org
>> Cc: uclinux-h8-devel at lists.sourceforge.jp
>> Cc: linux-m68k at lists.linux-m68k.org
>> Cc: openrisc at lists.librecores.org
>> Cc: linuxppc-dev at lists.ozlabs.org
>> Cc: linux-riscv at lists.infradead.org
>> Cc: linux-sh at vger.kernel.org
>> Cc: linux-s390 at vger.kernel.org
>> 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()
> I might be missing something, but AFAIU the init_mm.start_code and other
> fields are not used really early so the new setup_initial_init_mm()
> function can be called in the generic code outside setup_arch(), e.g in
> mm_init().
Hi Mikeļ¼ each architecture has their own value, not the same, eg m68K and
h8300, also the name of the text/code/brk is different in some arch, so
I keep
unchanged.
>
>> 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 | 8 ++++++++
>> 16 files changed, 23 insertions(+), 60 deletions(-)
>>
>> --
>> 2.26.2
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
2021-06-06 21:31 ` Mike Rapoport
` (3 preceding siblings ...)
(?)
@ 2021-06-07 1:50 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 1:50 UTC (permalink / raw)
To: Mike Rapoport
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390, x86
On 2021/6/7 5:31, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper to setup kernel text,
>> data and brk.
>>
>> Cc: linux-snps-arc@lists.infradead.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-csky@vger.kernel.org
>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>> Cc: linux-m68k@lists.linux-m68k.org
>> Cc: openrisc@lists.librecores.org
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Cc: linux-riscv@lists.infradead.org
>> Cc: linux-sh@vger.kernel.org
>> Cc: linux-s390@vger.kernel.org
>> Cc: x86@kernel.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> include/linux/mm_types.h | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
>> index 5aacc1c10a45..e1d2429089a4 100644
>> --- a/include/linux/mm_types.h
>> +++ b/include/linux/mm_types.h
>> @@ -572,6 +572,14 @@ struct mm_struct {
>> };
>>
>> extern struct mm_struct init_mm;
>> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
>> + void *end_data, void *brk)
> I think it's not that performance sensitive to make it inline. It can be
> placed in mm/init-mm.c with a forward declaration in mm.h
Ok, I will send a update one with this change.
>
>> +{
>> + 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
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-07 1:50 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 1:50 UTC (permalink / raw)
To: Mike Rapoport
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390, x86
On 2021/6/7 5:31, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper to setup kernel text,
>> data and brk.
>>
>> Cc: linux-snps-arc@lists.infradead.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-csky@vger.kernel.org
>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>> Cc: linux-m68k@lists.linux-m68k.org
>> Cc: openrisc@lists.librecores.org
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Cc: linux-riscv@lists.infradead.org
>> Cc: linux-sh@vger.kernel.org
>> Cc: linux-s390@vger.kernel.org
>> Cc: x86@kernel.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> include/linux/mm_types.h | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
>> index 5aacc1c10a45..e1d2429089a4 100644
>> --- a/include/linux/mm_types.h
>> +++ b/include/linux/mm_types.h
>> @@ -572,6 +572,14 @@ struct mm_struct {
>> };
>>
>> extern struct mm_struct init_mm;
>> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
>> + void *end_data, void *brk)
> I think it's not that performance sensitive to make it inline. It can be
> placed in mm/init-mm.c with a forward declaration in mm.h
Ok, I will send a update one with this change.
>
>> +{
>> + 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
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-07 1:50 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 1:50 UTC (permalink / raw)
To: Mike Rapoport
Cc: uclinux-h8-devel, linux-s390, linux-sh, x86, linux-kernel,
linux-csky, linux-mm, linux-m68k, openrisc, Andrew Morton,
linux-snps-arc, linuxppc-dev, linux-riscv, linux-arm-kernel
On 2021/6/7 5:31, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper to setup kernel text,
>> data and brk.
>>
>> Cc: linux-snps-arc@lists.infradead.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-csky@vger.kernel.org
>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>> Cc: linux-m68k@lists.linux-m68k.org
>> Cc: openrisc@lists.librecores.org
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Cc: linux-riscv@lists.infradead.org
>> Cc: linux-sh@vger.kernel.org
>> Cc: linux-s390@vger.kernel.org
>> Cc: x86@kernel.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> include/linux/mm_types.h | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
>> index 5aacc1c10a45..e1d2429089a4 100644
>> --- a/include/linux/mm_types.h
>> +++ b/include/linux/mm_types.h
>> @@ -572,6 +572,14 @@ struct mm_struct {
>> };
>>
>> extern struct mm_struct init_mm;
>> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
>> + void *end_data, void *brk)
> I think it's not that performance sensitive to make it inline. It can be
> placed in mm/init-mm.c with a forward declaration in mm.h
Ok, I will send a update one with this change.
>
>> +{
>> + 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
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-07 1:50 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 1:50 UTC (permalink / raw)
To: Mike Rapoport
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390, x86
On 2021/6/7 5:31, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper to setup kernel text,
>> data and brk.
>>
>> Cc: linux-snps-arc@lists.infradead.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-csky@vger.kernel.org
>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>> Cc: linux-m68k@lists.linux-m68k.org
>> Cc: openrisc@lists.librecores.org
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Cc: linux-riscv@lists.infradead.org
>> Cc: linux-sh@vger.kernel.org
>> Cc: linux-s390@vger.kernel.org
>> Cc: x86@kernel.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> include/linux/mm_types.h | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
>> index 5aacc1c10a45..e1d2429089a4 100644
>> --- a/include/linux/mm_types.h
>> +++ b/include/linux/mm_types.h
>> @@ -572,6 +572,14 @@ struct mm_struct {
>> };
>>
>> extern struct mm_struct init_mm;
>> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
>> + void *end_data, void *brk)
> I think it's not that performance sensitive to make it inline. It can be
> placed in mm/init-mm.c with a forward declaration in mm.h
Ok, I will send a update one with this change.
>
>> +{
>> + 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
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-07 1:50 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 1:50 UTC (permalink / raw)
To: Mike Rapoport
Cc: Andrew Morton, linux-kernel, linux-mm, linux-snps-arc,
linux-arm-kernel, linux-csky, uclinux-h8-devel, linux-m68k,
openrisc, linuxppc-dev, linux-riscv, linux-sh, linux-s390, x86
On 2021/6/7 5:31, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper to setup kernel text,
>> data and brk.
>>
>> Cc: linux-snps-arc@lists.infradead.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-csky@vger.kernel.org
>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>> Cc: linux-m68k@lists.linux-m68k.org
>> Cc: openrisc@lists.librecores.org
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Cc: linux-riscv@lists.infradead.org
>> Cc: linux-sh@vger.kernel.org
>> Cc: linux-s390@vger.kernel.org
>> Cc: x86@kernel.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> include/linux/mm_types.h | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
>> index 5aacc1c10a45..e1d2429089a4 100644
>> --- a/include/linux/mm_types.h
>> +++ b/include/linux/mm_types.h
>> @@ -572,6 +572,14 @@ struct mm_struct {
>> };
>>
>> extern struct mm_struct init_mm;
>> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
>> + void *end_data, void *brk)
> I think it's not that performance sensitive to make it inline. It can be
> placed in mm/init-mm.c with a forward declaration in mm.h
Ok, I will send a update one with this change.
>
>> +{
>> + 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
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
_______________________________________________
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] 90+ messages in thread
* [OpenRISC] [PATCH v2 01/15] mm: add setup_initial_init_mm() helper
@ 2021-06-07 1:50 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 1:50 UTC (permalink / raw)
To: openrisc
On 2021/6/7 5:31, Mike Rapoport wrote:
> Hello Kefeng,
>
> On Fri, Jun 04, 2021 at 03:06:19PM +0800, Kefeng Wang wrote:
>> Add setup_initial_init_mm() helper to setup kernel text,
>> data and brk.
>>
>> Cc: linux-snps-arc at lists.infradead.org
>> Cc: linux-arm-kernel at lists.infradead.org
>> Cc: linux-csky at vger.kernel.org
>> Cc: uclinux-h8-devel at lists.sourceforge.jp
>> Cc: linux-m68k at lists.linux-m68k.org
>> Cc: openrisc at lists.librecores.org
>> Cc: linuxppc-dev at lists.ozlabs.org
>> Cc: linux-riscv at lists.infradead.org
>> Cc: linux-sh at vger.kernel.org
>> Cc: linux-s390 at vger.kernel.org
>> Cc: x86 at kernel.org
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>> include/linux/mm_types.h | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
>> index 5aacc1c10a45..e1d2429089a4 100644
>> --- a/include/linux/mm_types.h
>> +++ b/include/linux/mm_types.h
>> @@ -572,6 +572,14 @@ struct mm_struct {
>> };
>>
>> extern struct mm_struct init_mm;
>> +static inline void setup_initial_init_mm(void *start_code, void *end_code,
>> + void *end_data, void *brk)
> I think it's not that performance sensitive to make it inline. It can be
> placed in mm/init-mm.c with a forward declaration in mm.h
Ok, I will send a update one with this change.
>
>> +{
>> + 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
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* [PATCH v3] mm: add setup_initial_init_mm() helper
2021-06-06 21:31 ` Mike Rapoport
` (3 preceding siblings ...)
(?)
@ 2021-06-07 2:36 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 2:36 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390, x86
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
v3: declaration in mm.h, implemention in init-mm.c
include/linux/mm.h | 3 +++
mm/init-mm.c | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c274f75efcf9..02aa057540b7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -244,6 +244,9 @@ int __add_to_page_cache_locked(struct page *page, struct address_space *mapping,
#define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *brk);
+
/*
* Linux kernel virtual memory manager primitives.
* The idea being to have a "virtual" mm in the same way
diff --git a/mm/init-mm.c b/mm/init-mm.c
index 153162669f80..b4a6f38fb51d 100644
--- a/mm/init-mm.c
+++ b/mm/init-mm.c
@@ -40,3 +40,12 @@ struct mm_struct init_mm = {
.cpu_bitmap = CPU_BITS_NONE,
INIT_MM_CONTEXT(init_mm)
};
+
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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;
+}
--
2.26.2
^ permalink raw reply related [flat|nested] 90+ messages in thread
* [PATCH v3] mm: add setup_initial_init_mm() helper
@ 2021-06-07 2:36 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 2:36 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390, x86
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
v3: declaration in mm.h, implemention in init-mm.c
include/linux/mm.h | 3 +++
mm/init-mm.c | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c274f75efcf9..02aa057540b7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -244,6 +244,9 @@ int __add_to_page_cache_locked(struct page *page, struct address_space *mapping,
#define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *brk);
+
/*
* Linux kernel virtual memory manager primitives.
* The idea being to have a "virtual" mm in the same way
diff --git a/mm/init-mm.c b/mm/init-mm.c
index 153162669f80..b4a6f38fb51d 100644
--- a/mm/init-mm.c
+++ b/mm/init-mm.c
@@ -40,3 +40,12 @@ struct mm_struct init_mm = {
.cpu_bitmap = CPU_BITS_NONE,
INIT_MM_CONTEXT(init_mm)
};
+
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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;
+}
--
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] 90+ messages in thread
* [PATCH v3] mm: add setup_initial_init_mm() helper
@ 2021-06-07 2:36 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 2:36 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: uclinux-h8-devel, linux-s390, Kefeng Wang, linux-sh, x86,
linux-csky, linux-mm, linux-m68k, openrisc, linux-riscv,
linux-snps-arc, linuxppc-dev, linux-arm-kernel
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
v3: declaration in mm.h, implemention in init-mm.c
include/linux/mm.h | 3 +++
mm/init-mm.c | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c274f75efcf9..02aa057540b7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -244,6 +244,9 @@ int __add_to_page_cache_locked(struct page *page, struct address_space *mapping,
#define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *brk);
+
/*
* Linux kernel virtual memory manager primitives.
* The idea being to have a "virtual" mm in the same way
diff --git a/mm/init-mm.c b/mm/init-mm.c
index 153162669f80..b4a6f38fb51d 100644
--- a/mm/init-mm.c
+++ b/mm/init-mm.c
@@ -40,3 +40,12 @@ struct mm_struct init_mm = {
.cpu_bitmap = CPU_BITS_NONE,
INIT_MM_CONTEXT(init_mm)
};
+
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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;
+}
--
2.26.2
^ permalink raw reply related [flat|nested] 90+ messages in thread
* [PATCH v3] mm: add setup_initial_init_mm() helper
@ 2021-06-07 2:36 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 2:36 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390, x86
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
v3: declaration in mm.h, implemention in init-mm.c
include/linux/mm.h | 3 +++
mm/init-mm.c | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c274f75efcf9..02aa057540b7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -244,6 +244,9 @@ int __add_to_page_cache_locked(struct page *page, struct address_space *mapping,
#define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *brk);
+
/*
* Linux kernel virtual memory manager primitives.
* The idea being to have a "virtual" mm in the same way
diff --git a/mm/init-mm.c b/mm/init-mm.c
index 153162669f80..b4a6f38fb51d 100644
--- a/mm/init-mm.c
+++ b/mm/init-mm.c
@@ -40,3 +40,12 @@ struct mm_struct init_mm = {
.cpu_bitmap = CPU_BITS_NONE,
INIT_MM_CONTEXT(init_mm)
};
+
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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;
+}
--
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] 90+ messages in thread
* [PATCH v3] mm: add setup_initial_init_mm() helper
@ 2021-06-07 2:36 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 2:36 UTC (permalink / raw)
To: Andrew Morton, linux-kernel
Cc: linux-mm, Kefeng Wang, linux-snps-arc, linux-arm-kernel,
linux-csky, uclinux-h8-devel, linux-m68k, openrisc, linuxppc-dev,
linux-riscv, linux-sh, linux-s390, x86
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-csky@vger.kernel.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-m68k@lists.linux-m68k.org
Cc: openrisc@lists.librecores.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-riscv@lists.infradead.org
Cc: linux-sh@vger.kernel.org
Cc: linux-s390@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
v3: declaration in mm.h, implemention in init-mm.c
include/linux/mm.h | 3 +++
mm/init-mm.c | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c274f75efcf9..02aa057540b7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -244,6 +244,9 @@ int __add_to_page_cache_locked(struct page *page, struct address_space *mapping,
#define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *brk);
+
/*
* Linux kernel virtual memory manager primitives.
* The idea being to have a "virtual" mm in the same way
diff --git a/mm/init-mm.c b/mm/init-mm.c
index 153162669f80..b4a6f38fb51d 100644
--- a/mm/init-mm.c
+++ b/mm/init-mm.c
@@ -40,3 +40,12 @@ struct mm_struct init_mm = {
.cpu_bitmap = CPU_BITS_NONE,
INIT_MM_CONTEXT(init_mm)
};
+
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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;
+}
--
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] 90+ messages in thread
* [OpenRISC] [PATCH v3] mm: add setup_initial_init_mm() helper
@ 2021-06-07 2:36 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 2:36 UTC (permalink / raw)
To: openrisc
Add setup_initial_init_mm() helper to setup kernel text,
data and brk.
Cc: linux-snps-arc at lists.infradead.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-csky at vger.kernel.org
Cc: uclinux-h8-devel at lists.sourceforge.jp
Cc: linux-m68k at lists.linux-m68k.org
Cc: openrisc at lists.librecores.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-riscv at lists.infradead.org
Cc: linux-sh at vger.kernel.org
Cc: linux-s390 at vger.kernel.org
Cc: x86 at kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
v3: declaration in mm.h, implemention in init-mm.c
include/linux/mm.h | 3 +++
mm/init-mm.c | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index c274f75efcf9..02aa057540b7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -244,6 +244,9 @@ int __add_to_page_cache_locked(struct page *page, struct address_space *mapping,
#define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *brk);
+
/*
* Linux kernel virtual memory manager primitives.
* The idea being to have a "virtual" mm in the same way
diff --git a/mm/init-mm.c b/mm/init-mm.c
index 153162669f80..b4a6f38fb51d 100644
--- a/mm/init-mm.c
+++ b/mm/init-mm.c
@@ -40,3 +40,12 @@ struct mm_struct init_mm = {
.cpu_bitmap = CPU_BITS_NONE,
INIT_MM_CONTEXT(init_mm)
};
+
+void setup_initial_init_mm(void *start_code, void *end_code,
+ void *end_data, void *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;
+}
--
2.26.2
^ permalink raw reply related [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
2021-06-07 0:55 ` Kefeng Wang
` (2 preceding siblings ...)
(?)
@ 2021-06-07 5:48 ` Christophe Leroy
-1 siblings, 0 replies; 90+ messages in thread
From: Christophe Leroy @ 2021-06-07 5:48 UTC (permalink / raw)
To: Kefeng Wang, Mike Rapoport
Cc: uclinux-h8-devel, linux-s390, linux-sh, linux-kernel, linux-csky,
linux-mm, linux-m68k, openrisc, Andrew Morton, linux-snps-arc,
linuxppc-dev, linux-riscv, linux-arm-kernel
Hi Kefeng,
Le 07/06/2021 à 02:55, Kefeng Wang a écrit :
>
> On 2021/6/7 5:29, Mike Rapoport wrote:
>> Hello Kefeng,
>>
>> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>>> Add setup_initial_init_mm() helper, then use it
>>> to cleanup the text, data and brk setup code.
>>>
>>> v2:
>>> - change argument from "char *" to "void *" setup_initial_init_mm()
>>> suggested by Geert Uytterhoeven
>>> - use NULL instead of (void *)0 on h8300 and m68k
>>> - collect ACKs
>>>
>>> Cc: linux-snps-arc@lists.infradead.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-csky@vger.kernel.org
>>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>>> Cc: linux-m68k@lists.linux-m68k.org
>>> Cc: openrisc@lists.librecores.org
>>> Cc: linuxppc-dev@lists.ozlabs.org
>>> Cc: linux-riscv@lists.infradead.org
>>> Cc: linux-sh@vger.kernel.org
>>> Cc: linux-s390@vger.kernel.org
>>> 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()
>> I might be missing something, but AFAIU the init_mm.start_code and other
>> fields are not used really early so the new setup_initial_init_mm()
>> function can be called in the generic code outside setup_arch(), e.g in
>> mm_init().
>
> Hi Mike, each architecture has their own value, not the same, eg m68K and
>
> h8300, also the name of the text/code/brk is different in some arch, so I keep
>
> unchanged.
What you could do is to define a __weak function that architectures can override and call that
function from mm_init() as suggested by Mike,
Something like:
void __weak setup_initial_init_mm(void)
{
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;
}
Then only the few architecture that are different would override it.
I see a few archictectures are usigne PAGE_OFFSET to set .start_code, but it is likely that this is
equivalent to _stext.
Christophe
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 5:48 ` Christophe Leroy
0 siblings, 0 replies; 90+ messages in thread
From: Christophe Leroy @ 2021-06-07 5:48 UTC (permalink / raw)
To: Kefeng Wang, Mike Rapoport
Cc: uclinux-h8-devel, linux-s390, linux-sh, linux-kernel, linux-csky,
linux-mm, linux-m68k, openrisc, Andrew Morton, linux-snps-arc,
linuxppc-dev, linux-riscv, linux-arm-kernel
Hi Kefeng,
Le 07/06/2021 à 02:55, Kefeng Wang a écrit :
>
> On 2021/6/7 5:29, Mike Rapoport wrote:
>> Hello Kefeng,
>>
>> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>>> Add setup_initial_init_mm() helper, then use it
>>> to cleanup the text, data and brk setup code.
>>>
>>> v2:
>>> - change argument from "char *" to "void *" setup_initial_init_mm()
>>> suggested by Geert Uytterhoeven
>>> - use NULL instead of (void *)0 on h8300 and m68k
>>> - collect ACKs
>>>
>>> Cc: linux-snps-arc@lists.infradead.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-csky@vger.kernel.org
>>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>>> Cc: linux-m68k@lists.linux-m68k.org
>>> Cc: openrisc@lists.librecores.org
>>> Cc: linuxppc-dev@lists.ozlabs.org
>>> Cc: linux-riscv@lists.infradead.org
>>> Cc: linux-sh@vger.kernel.org
>>> Cc: linux-s390@vger.kernel.org
>>> 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()
>> I might be missing something, but AFAIU the init_mm.start_code and other
>> fields are not used really early so the new setup_initial_init_mm()
>> function can be called in the generic code outside setup_arch(), e.g in
>> mm_init().
>
> Hi Mike, each architecture has their own value, not the same, eg m68K and
>
> h8300, also the name of the text/code/brk is different in some arch, so I keep
>
> unchanged.
What you could do is to define a __weak function that architectures can override and call that
function from mm_init() as suggested by Mike,
Something like:
void __weak setup_initial_init_mm(void)
{
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;
}
Then only the few architecture that are different would override it.
I see a few archictectures are usigne PAGE_OFFSET to set .start_code, but it is likely that this is
equivalent to _stext.
Christophe
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 5:48 ` Christophe Leroy
0 siblings, 0 replies; 90+ messages in thread
From: Christophe Leroy @ 2021-06-07 5:48 UTC (permalink / raw)
To: Kefeng Wang, Mike Rapoport
Cc: uclinux-h8-devel, linux-s390, linux-sh, linux-kernel, linux-csky,
linux-mm, linux-m68k, openrisc, Andrew Morton, linux-snps-arc,
linuxppc-dev, linux-riscv, linux-arm-kernel
Hi Kefeng,
Le 07/06/2021 à 02:55, Kefeng Wang a écrit :
>
> On 2021/6/7 5:29, Mike Rapoport wrote:
>> Hello Kefeng,
>>
>> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>>> Add setup_initial_init_mm() helper, then use it
>>> to cleanup the text, data and brk setup code.
>>>
>>> v2:
>>> - change argument from "char *" to "void *" setup_initial_init_mm()
>>> suggested by Geert Uytterhoeven
>>> - use NULL instead of (void *)0 on h8300 and m68k
>>> - collect ACKs
>>>
>>> Cc: linux-snps-arc@lists.infradead.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-csky@vger.kernel.org
>>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>>> Cc: linux-m68k@lists.linux-m68k.org
>>> Cc: openrisc@lists.librecores.org
>>> Cc: linuxppc-dev@lists.ozlabs.org
>>> Cc: linux-riscv@lists.infradead.org
>>> Cc: linux-sh@vger.kernel.org
>>> Cc: linux-s390@vger.kernel.org
>>> 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()
>> I might be missing something, but AFAIU the init_mm.start_code and other
>> fields are not used really early so the new setup_initial_init_mm()
>> function can be called in the generic code outside setup_arch(), e.g in
>> mm_init().
>
> Hi Mike, each architecture has their own value, not the same, eg m68K and
>
> h8300, also the name of the text/code/brk is different in some arch, so I keep
>
> unchanged.
What you could do is to define a __weak function that architectures can override and call that
function from mm_init() as suggested by Mike,
Something like:
void __weak setup_initial_init_mm(void)
{
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;
}
Then only the few architecture that are different would override it.
I see a few archictectures are usigne PAGE_OFFSET to set .start_code, but it is likely that this is
equivalent to _stext.
Christophe
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 5:48 ` Christophe Leroy
0 siblings, 0 replies; 90+ messages in thread
From: Christophe Leroy @ 2021-06-07 5:48 UTC (permalink / raw)
To: Kefeng Wang, Mike Rapoport
Cc: uclinux-h8-devel, linux-s390, linux-sh, linux-kernel, linux-csky,
linux-mm, linux-m68k, openrisc, Andrew Morton, linux-snps-arc,
linuxppc-dev, linux-riscv, linux-arm-kernel
Hi Kefeng,
Le 07/06/2021 à 02:55, Kefeng Wang a écrit :
>
> On 2021/6/7 5:29, Mike Rapoport wrote:
>> Hello Kefeng,
>>
>> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>>> Add setup_initial_init_mm() helper, then use it
>>> to cleanup the text, data and brk setup code.
>>>
>>> v2:
>>> - change argument from "char *" to "void *" setup_initial_init_mm()
>>> suggested by Geert Uytterhoeven
>>> - use NULL instead of (void *)0 on h8300 and m68k
>>> - collect ACKs
>>>
>>> Cc: linux-snps-arc@lists.infradead.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-csky@vger.kernel.org
>>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>>> Cc: linux-m68k@lists.linux-m68k.org
>>> Cc: openrisc@lists.librecores.org
>>> Cc: linuxppc-dev@lists.ozlabs.org
>>> Cc: linux-riscv@lists.infradead.org
>>> Cc: linux-sh@vger.kernel.org
>>> Cc: linux-s390@vger.kernel.org
>>> 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()
>> I might be missing something, but AFAIU the init_mm.start_code and other
>> fields are not used really early so the new setup_initial_init_mm()
>> function can be called in the generic code outside setup_arch(), e.g in
>> mm_init().
>
> Hi Mike, each architecture has their own value, not the same, eg m68K and
>
> h8300, also the name of the text/code/brk is different in some arch, so I keep
>
> unchanged.
What you could do is to define a __weak function that architectures can override and call that
function from mm_init() as suggested by Mike,
Something like:
void __weak setup_initial_init_mm(void)
{
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;
}
Then only the few architecture that are different would override it.
I see a few archictectures are usigne PAGE_OFFSET to set .start_code, but it is likely that this is
equivalent to _stext.
Christophe
_______________________________________________
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] 90+ messages in thread
* [OpenRISC] [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 5:48 ` Christophe Leroy
0 siblings, 0 replies; 90+ messages in thread
From: Christophe Leroy @ 2021-06-07 5:48 UTC (permalink / raw)
To: openrisc
Hi Kefeng,
Le 07/06/2021 à 02:55, Kefeng Wang a écrit :
>
> On 2021/6/7 5:29, Mike Rapoport wrote:
>> Hello Kefeng,
>>
>> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>>> Add setup_initial_init_mm() helper, then use it
>>> to cleanup the text, data and brk setup code.
>>>
>>> v2:
>>> - change argument from "char *" to "void *" setup_initial_init_mm()
>>> suggested by Geert Uytterhoeven
>>> - use NULL instead of (void *)0 on h8300 and m68k
>>> - collect ACKs
>>>
>>> Cc: linux-snps-arc at lists.infradead.org
>>> Cc: linux-arm-kernel at lists.infradead.org
>>> Cc: linux-csky at vger.kernel.org
>>> Cc: uclinux-h8-devel at lists.sourceforge.jp
>>> Cc: linux-m68k at lists.linux-m68k.org
>>> Cc: openrisc at lists.librecores.org
>>> Cc: linuxppc-dev at lists.ozlabs.org
>>> Cc: linux-riscv at lists.infradead.org
>>> Cc: linux-sh at vger.kernel.org
>>> Cc: linux-s390 at vger.kernel.org
>>> 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()
>> I might be missing something, but AFAIU the init_mm.start_code and other
>> fields are not used really early so the new setup_initial_init_mm()
>> function can be called in the generic code outside setup_arch(), e.g in
>> mm_init().
>
> Hi Mike, each architecture has their own value, not the same, eg m68K and
>
> h8300, also the name of the text/code/brk is different in some arch, so I keep
>
> unchanged.
What you could do is to define a __weak function that architectures can override and call that
function from mm_init() as suggested by Mike,
Something like:
void __weak setup_initial_init_mm(void)
{
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;
}
Then only the few architecture that are different would override it.
I see a few archictectures are usigne PAGE_OFFSET to set .start_code, but it is likely that this is
equivalent to _stext.
Christophe
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
2021-06-07 5:48 ` Christophe Leroy
` (3 preceding siblings ...)
(?)
@ 2021-06-07 8:30 ` Kefeng Wang
-1 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 8:30 UTC (permalink / raw)
To: Christophe Leroy, Mike Rapoport
Cc: uclinux-h8-devel, linux-s390, linux-sh, linux-kernel, linux-csky,
linux-mm, linux-m68k, openrisc, Andrew Morton, linux-snps-arc,
linuxppc-dev, linux-riscv, linux-arm-kernel
On 2021/6/7 13:48, Christophe Leroy wrote:
> Hi Kefeng,
>
> Le 07/06/2021 à 02:55, Kefeng Wang a écrit :
>>
>> On 2021/6/7 5:29, Mike Rapoport wrote:
>>> Hello Kefeng,
>>>
>>> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>>>> Add setup_initial_init_mm() helper, then use it
>>>> to cleanup the text, data and brk setup code.
>>>>
>>>> v2:
>>>> - change argument from "char *" to "void *" setup_initial_init_mm()
>>>> suggested by Geert Uytterhoeven
>>>> - use NULL instead of (void *)0 on h8300 and m68k
>>>> - collect ACKs
>>>>
>>>> Cc: linux-snps-arc@lists.infradead.org
>>>> Cc: linux-arm-kernel@lists.infradead.org
>>>> Cc: linux-csky@vger.kernel.org
>>>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>>>> Cc: linux-m68k@lists.linux-m68k.org
>>>> Cc: openrisc@lists.librecores.org
>>>> Cc: linuxppc-dev@lists.ozlabs.org
>>>> Cc: linux-riscv@lists.infradead.org
>>>> Cc: linux-sh@vger.kernel.org
>>>> Cc: linux-s390@vger.kernel.org
>>>> 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()
>>> I might be missing something, but AFAIU the init_mm.start_code and
>>> other
>>> fields are not used really early so the new setup_initial_init_mm()
>>> function can be called in the generic code outside setup_arch(), e.g in
>>> mm_init().
>>
>> Hi Mike, each architecture has their own value, not the same, eg m68K
>> and
>>
>> h8300, also the name of the text/code/brk is different in some arch,
>> so I keep
>>
>> unchanged.
>
> What you could do is to define a __weak function that architectures
> can override and call that function from mm_init() as suggested by Mike,
>
> Something like:
>
> void __weak setup_initial_init_mm(void)
> {
> 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;
> }
>
> Then only the few architecture that are different would override it.
>
> I see a few archictectures are usigne PAGE_OFFSET to set .start_code,
> but it is likely that this is equivalent to _stext.
Yes, the __weak function is option, but the change is only covered 14
archs, there are 7 other archs(alpha hexagon ia64
microblaze mips sparc um xtensa)without related setup code. Also like
x86, it has own brk , maybe there are some
other different in some arch, so I think let's keep unchanged for now,
thanks.
>
> Christophe
> .
>
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 8:30 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 8:30 UTC (permalink / raw)
To: Christophe Leroy, Mike Rapoport
Cc: uclinux-h8-devel, linux-s390, linux-sh, linux-kernel, linux-csky,
linux-mm, linux-m68k, openrisc, Andrew Morton, linux-snps-arc,
linuxppc-dev, linux-riscv, linux-arm-kernel
On 2021/6/7 13:48, Christophe Leroy wrote:
> Hi Kefeng,
>
> Le 07/06/2021 à 02:55, Kefeng Wang a écrit :
>>
>> On 2021/6/7 5:29, Mike Rapoport wrote:
>>> Hello Kefeng,
>>>
>>> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>>>> Add setup_initial_init_mm() helper, then use it
>>>> to cleanup the text, data and brk setup code.
>>>>
>>>> v2:
>>>> - change argument from "char *" to "void *" setup_initial_init_mm()
>>>> suggested by Geert Uytterhoeven
>>>> - use NULL instead of (void *)0 on h8300 and m68k
>>>> - collect ACKs
>>>>
>>>> Cc: linux-snps-arc@lists.infradead.org
>>>> Cc: linux-arm-kernel@lists.infradead.org
>>>> Cc: linux-csky@vger.kernel.org
>>>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>>>> Cc: linux-m68k@lists.linux-m68k.org
>>>> Cc: openrisc@lists.librecores.org
>>>> Cc: linuxppc-dev@lists.ozlabs.org
>>>> Cc: linux-riscv@lists.infradead.org
>>>> Cc: linux-sh@vger.kernel.org
>>>> Cc: linux-s390@vger.kernel.org
>>>> 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()
>>> I might be missing something, but AFAIU the init_mm.start_code and
>>> other
>>> fields are not used really early so the new setup_initial_init_mm()
>>> function can be called in the generic code outside setup_arch(), e.g in
>>> mm_init().
>>
>> Hi Mike, each architecture has their own value, not the same, eg m68K
>> and
>>
>> h8300, also the name of the text/code/brk is different in some arch,
>> so I keep
>>
>> unchanged.
>
> What you could do is to define a __weak function that architectures
> can override and call that function from mm_init() as suggested by Mike,
>
> Something like:
>
> void __weak setup_initial_init_mm(void)
> {
> 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;
> }
>
> Then only the few architecture that are different would override it.
>
> I see a few archictectures are usigne PAGE_OFFSET to set .start_code,
> but it is likely that this is equivalent to _stext.
Yes, the __weak function is option, but the change is only covered 14
archs, there are 7 other archs(alpha hexagon ia64
microblaze mips sparc um xtensa)without related setup code. Also like
x86, it has own brk , maybe there are some
other different in some arch, so I think let's keep unchanged for now,
thanks.
>
> Christophe
> .
>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 8:30 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 8:30 UTC (permalink / raw)
To: Christophe Leroy, Mike Rapoport
Cc: uclinux-h8-devel, linux-s390, linux-sh, linux-kernel, linux-csky,
linux-mm, linux-m68k, openrisc, Andrew Morton, linux-snps-arc,
linuxppc-dev, linux-riscv, linux-arm-kernel
On 2021/6/7 13:48, Christophe Leroy wrote:
> Hi Kefeng,
>
> Le 07/06/2021 à 02:55, Kefeng Wang a écrit :
>>
>> On 2021/6/7 5:29, Mike Rapoport wrote:
>>> Hello Kefeng,
>>>
>>> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>>>> Add setup_initial_init_mm() helper, then use it
>>>> to cleanup the text, data and brk setup code.
>>>>
>>>> v2:
>>>> - change argument from "char *" to "void *" setup_initial_init_mm()
>>>> suggested by Geert Uytterhoeven
>>>> - use NULL instead of (void *)0 on h8300 and m68k
>>>> - collect ACKs
>>>>
>>>> Cc: linux-snps-arc@lists.infradead.org
>>>> Cc: linux-arm-kernel@lists.infradead.org
>>>> Cc: linux-csky@vger.kernel.org
>>>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>>>> Cc: linux-m68k@lists.linux-m68k.org
>>>> Cc: openrisc@lists.librecores.org
>>>> Cc: linuxppc-dev@lists.ozlabs.org
>>>> Cc: linux-riscv@lists.infradead.org
>>>> Cc: linux-sh@vger.kernel.org
>>>> Cc: linux-s390@vger.kernel.org
>>>> 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()
>>> I might be missing something, but AFAIU the init_mm.start_code and
>>> other
>>> fields are not used really early so the new setup_initial_init_mm()
>>> function can be called in the generic code outside setup_arch(), e.g in
>>> mm_init().
>>
>> Hi Mike, each architecture has their own value, not the same, eg m68K
>> and
>>
>> h8300, also the name of the text/code/brk is different in some arch,
>> so I keep
>>
>> unchanged.
>
> What you could do is to define a __weak function that architectures
> can override and call that function from mm_init() as suggested by Mike,
>
> Something like:
>
> void __weak setup_initial_init_mm(void)
> {
> 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;
> }
>
> Then only the few architecture that are different would override it.
>
> I see a few archictectures are usigne PAGE_OFFSET to set .start_code,
> but it is likely that this is equivalent to _stext.
Yes, the __weak function is option, but the change is only covered 14
archs, there are 7 other archs(alpha hexagon ia64
microblaze mips sparc um xtensa)without related setup code. Also like
x86, it has own brk , maybe there are some
other different in some arch, so I think let's keep unchanged for now,
thanks.
>
> Christophe
> .
>
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 8:30 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 8:30 UTC (permalink / raw)
To: Christophe Leroy, Mike Rapoport
Cc: uclinux-h8-devel, linux-s390, linux-sh, linux-kernel, linux-csky,
linux-mm, linux-m68k, openrisc, Andrew Morton, linux-snps-arc,
linuxppc-dev, linux-riscv, linux-arm-kernel
On 2021/6/7 13:48, Christophe Leroy wrote:
> Hi Kefeng,
>
> Le 07/06/2021 à 02:55, Kefeng Wang a écrit :
>>
>> On 2021/6/7 5:29, Mike Rapoport wrote:
>>> Hello Kefeng,
>>>
>>> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>>>> Add setup_initial_init_mm() helper, then use it
>>>> to cleanup the text, data and brk setup code.
>>>>
>>>> v2:
>>>> - change argument from "char *" to "void *" setup_initial_init_mm()
>>>> suggested by Geert Uytterhoeven
>>>> - use NULL instead of (void *)0 on h8300 and m68k
>>>> - collect ACKs
>>>>
>>>> Cc: linux-snps-arc@lists.infradead.org
>>>> Cc: linux-arm-kernel@lists.infradead.org
>>>> Cc: linux-csky@vger.kernel.org
>>>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>>>> Cc: linux-m68k@lists.linux-m68k.org
>>>> Cc: openrisc@lists.librecores.org
>>>> Cc: linuxppc-dev@lists.ozlabs.org
>>>> Cc: linux-riscv@lists.infradead.org
>>>> Cc: linux-sh@vger.kernel.org
>>>> Cc: linux-s390@vger.kernel.org
>>>> 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()
>>> I might be missing something, but AFAIU the init_mm.start_code and
>>> other
>>> fields are not used really early so the new setup_initial_init_mm()
>>> function can be called in the generic code outside setup_arch(), e.g in
>>> mm_init().
>>
>> Hi Mike, each architecture has their own value, not the same, eg m68K
>> and
>>
>> h8300, also the name of the text/code/brk is different in some arch,
>> so I keep
>>
>> unchanged.
>
> What you could do is to define a __weak function that architectures
> can override and call that function from mm_init() as suggested by Mike,
>
> Something like:
>
> void __weak setup_initial_init_mm(void)
> {
> 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;
> }
>
> Then only the few architecture that are different would override it.
>
> I see a few archictectures are usigne PAGE_OFFSET to set .start_code,
> but it is likely that this is equivalent to _stext.
Yes, the __weak function is option, but the change is only covered 14
archs, there are 7 other archs(alpha hexagon ia64
microblaze mips sparc um xtensa)without related setup code. Also like
x86, it has own brk , maybe there are some
other different in some arch, so I think let's keep unchanged for now,
thanks.
>
> Christophe
> .
>
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 8:30 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 8:30 UTC (permalink / raw)
To: Christophe Leroy, Mike Rapoport
Cc: uclinux-h8-devel, linux-s390, linux-sh, linux-kernel, linux-csky,
linux-mm, linux-m68k, openrisc, Andrew Morton, linux-snps-arc,
linuxppc-dev, linux-riscv, linux-arm-kernel
On 2021/6/7 13:48, Christophe Leroy wrote:
> Hi Kefeng,
>
> Le 07/06/2021 à 02:55, Kefeng Wang a écrit :
>>
>> On 2021/6/7 5:29, Mike Rapoport wrote:
>>> Hello Kefeng,
>>>
>>> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>>>> Add setup_initial_init_mm() helper, then use it
>>>> to cleanup the text, data and brk setup code.
>>>>
>>>> v2:
>>>> - change argument from "char *" to "void *" setup_initial_init_mm()
>>>> suggested by Geert Uytterhoeven
>>>> - use NULL instead of (void *)0 on h8300 and m68k
>>>> - collect ACKs
>>>>
>>>> Cc: linux-snps-arc@lists.infradead.org
>>>> Cc: linux-arm-kernel@lists.infradead.org
>>>> Cc: linux-csky@vger.kernel.org
>>>> Cc: uclinux-h8-devel@lists.sourceforge.jp
>>>> Cc: linux-m68k@lists.linux-m68k.org
>>>> Cc: openrisc@lists.librecores.org
>>>> Cc: linuxppc-dev@lists.ozlabs.org
>>>> Cc: linux-riscv@lists.infradead.org
>>>> Cc: linux-sh@vger.kernel.org
>>>> Cc: linux-s390@vger.kernel.org
>>>> 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()
>>> I might be missing something, but AFAIU the init_mm.start_code and
>>> other
>>> fields are not used really early so the new setup_initial_init_mm()
>>> function can be called in the generic code outside setup_arch(), e.g in
>>> mm_init().
>>
>> Hi Mike, each architecture has their own value, not the same, eg m68K
>> and
>>
>> h8300, also the name of the text/code/brk is different in some arch,
>> so I keep
>>
>> unchanged.
>
> What you could do is to define a __weak function that architectures
> can override and call that function from mm_init() as suggested by Mike,
>
> Something like:
>
> void __weak setup_initial_init_mm(void)
> {
> 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;
> }
>
> Then only the few architecture that are different would override it.
>
> I see a few archictectures are usigne PAGE_OFFSET to set .start_code,
> but it is likely that this is equivalent to _stext.
Yes, the __weak function is option, but the change is only covered 14
archs, there are 7 other archs(alpha hexagon ia64
microblaze mips sparc um xtensa)without related setup code. Also like
x86, it has own brk , maybe there are some
other different in some arch, so I think let's keep unchanged for now,
thanks.
>
> Christophe
> .
>
_______________________________________________
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] 90+ messages in thread
* [OpenRISC] [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 8:30 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-07 8:30 UTC (permalink / raw)
To: openrisc
On 2021/6/7 13:48, Christophe Leroy wrote:
> Hi Kefeng,
>
> Le 07/06/2021 à 02:55, Kefeng Wang a écrit :
>>
>> On 2021/6/7 5:29, Mike Rapoport wrote:
>>> Hello Kefeng,
>>>
>>> On Fri, Jun 04, 2021 at 03:06:18PM +0800, Kefeng Wang wrote:
>>>> Add setup_initial_init_mm() helper, then use it
>>>> to cleanup the text, data and brk setup code.
>>>>
>>>> v2:
>>>> - change argument from "char *" to "void *" setup_initial_init_mm()
>>>> suggested by Geert Uytterhoeven
>>>> - use NULL instead of (void *)0 on h8300 and m68k
>>>> - collect ACKs
>>>>
>>>> Cc: linux-snps-arc at lists.infradead.org
>>>> Cc: linux-arm-kernel at lists.infradead.org
>>>> Cc: linux-csky at vger.kernel.org
>>>> Cc: uclinux-h8-devel at lists.sourceforge.jp
>>>> Cc: linux-m68k at lists.linux-m68k.org
>>>> Cc: openrisc at lists.librecores.org
>>>> Cc: linuxppc-dev at lists.ozlabs.org
>>>> Cc: linux-riscv at lists.infradead.org
>>>> Cc: linux-sh at vger.kernel.org
>>>> Cc: linux-s390 at vger.kernel.org
>>>> 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()
>>> I might be missing something, but AFAIU the init_mm.start_code and
>>> other
>>> fields are not used really early so the new setup_initial_init_mm()
>>> function can be called in the generic code outside setup_arch(), e.g in
>>> mm_init().
>>
>> Hi Mike, each architecture has their own value, not the same, eg m68K
>> and
>>
>> h8300, also the name of the text/code/brk is different in some arch,
>> so I keep
>>
>> unchanged.
>
> What you could do is to define a __weak function that architectures
> can override and call that function from mm_init() as suggested by Mike,
>
> Something like:
>
> void __weak setup_initial_init_mm(void)
> {
> 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;
> }
>
> Then only the few architecture that are different would override it.
>
> I see a few archictectures are usigne PAGE_OFFSET to set .start_code,
> but it is likely that this is equivalent to _stext.
Yes, the __weak function is option, but the change is only covered 14
archs, there are 7 other archs(alpha hexagon ia64
microblaze mips sparc um xtensa)without related setup code. Also like
x86, it has own brk , maybe there are some
other different in some arch, so I think let's keep unchanged for now,
thanks.
>
> Christophe
> .
>
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 03/15] arm: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
@ 2021-06-07 9:25 ` Russell King (Oracle)
-1 siblings, 0 replies; 90+ messages in thread
From: Russell King (Oracle) @ 2021-06-07 9:25 UTC (permalink / raw)
To: Kefeng Wang; +Cc: Andrew Morton, linux-kernel, linux-mm, linux-arm-kernel
On Fri, Jun 04, 2021 at 03:06:21PM +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>
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thanks.
--
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] 90+ messages in thread
* Re: [PATCH v2 03/15] arm: convert to setup_initial_init_mm()
@ 2021-06-07 9:25 ` Russell King (Oracle)
0 siblings, 0 replies; 90+ messages in thread
From: Russell King (Oracle) @ 2021-06-07 9:25 UTC (permalink / raw)
To: Kefeng Wang; +Cc: Andrew Morton, linux-kernel, linux-mm, linux-arm-kernel
On Fri, Jun 04, 2021 at 03:06:21PM +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>
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thanks.
--
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] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
2021-06-07 5:48 ` Christophe Leroy
` (3 preceding siblings ...)
(?)
@ 2021-06-07 9:31 ` Russell King (Oracle)
-1 siblings, 0 replies; 90+ messages in thread
From: Russell King (Oracle) @ 2021-06-07 9:31 UTC (permalink / raw)
To: Christophe Leroy
Cc: Kefeng Wang, Mike Rapoport, uclinux-h8-devel, linux-s390,
linux-sh, linux-kernel, linux-csky, linux-mm, linux-m68k,
openrisc, Andrew Morton, linux-snps-arc, linuxppc-dev,
linux-riscv, linux-arm-kernel
On Mon, Jun 07, 2021 at 07:48:54AM +0200, Christophe Leroy wrote:
> Hi Kefeng,
>
> What you could do is to define a __weak function that architectures can
> override and call that function from mm_init() as suggested by Mike,
The problem with weak functions is that they bloat the kernel. Each
time a weak function is overriden, it becomes dead unreachable code
within the kernel image.
At some point we're probabily going to have to enable -ffunction-sections
to (hopefully) allow the dead code to be discarded.
--
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] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 9:31 ` Russell King (Oracle)
0 siblings, 0 replies; 90+ messages in thread
From: Russell King (Oracle) @ 2021-06-07 9:31 UTC (permalink / raw)
To: Christophe Leroy
Cc: Kefeng Wang, Mike Rapoport, uclinux-h8-devel, linux-s390,
linux-sh, linux-kernel, linux-csky, linux-mm, linux-m68k,
openrisc, Andrew Morton, linux-snps-arc, linuxppc-dev,
linux-riscv, linux-arm-kernel
On Mon, Jun 07, 2021 at 07:48:54AM +0200, Christophe Leroy wrote:
> Hi Kefeng,
>
> What you could do is to define a __weak function that architectures can
> override and call that function from mm_init() as suggested by Mike,
The problem with weak functions is that they bloat the kernel. Each
time a weak function is overriden, it becomes dead unreachable code
within the kernel image.
At some point we're probabily going to have to enable -ffunction-sections
to (hopefully) allow the dead code to be discarded.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 9:31 ` Russell King (Oracle)
0 siblings, 0 replies; 90+ messages in thread
From: Russell King (Oracle) @ 2021-06-07 9:31 UTC (permalink / raw)
To: Christophe Leroy
Cc: uclinux-h8-devel, linux-s390, Kefeng Wang, linux-sh,
linux-kernel, linux-csky, linux-mm, linux-m68k, openrisc,
linux-arm-kernel, Andrew Morton, linux-snps-arc, linuxppc-dev,
linux-riscv, Mike Rapoport
On Mon, Jun 07, 2021 at 07:48:54AM +0200, Christophe Leroy wrote:
> Hi Kefeng,
>
> What you could do is to define a __weak function that architectures can
> override and call that function from mm_init() as suggested by Mike,
The problem with weak functions is that they bloat the kernel. Each
time a weak function is overriden, it becomes dead unreachable code
within the kernel image.
At some point we're probabily going to have to enable -ffunction-sections
to (hopefully) allow the dead code to be discarded.
--
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] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 9:31 ` Russell King (Oracle)
0 siblings, 0 replies; 90+ messages in thread
From: Russell King (Oracle) @ 2021-06-07 9:31 UTC (permalink / raw)
To: Christophe Leroy
Cc: Kefeng Wang, Mike Rapoport, uclinux-h8-devel, linux-s390,
linux-sh, linux-kernel, linux-csky, linux-mm, linux-m68k,
openrisc, Andrew Morton, linux-snps-arc, linuxppc-dev,
linux-riscv, linux-arm-kernel
On Mon, Jun 07, 2021 at 07:48:54AM +0200, Christophe Leroy wrote:
> Hi Kefeng,
>
> What you could do is to define a __weak function that architectures can
> override and call that function from mm_init() as suggested by Mike,
The problem with weak functions is that they bloat the kernel. Each
time a weak function is overriden, it becomes dead unreachable code
within the kernel image.
At some point we're probabily going to have to enable -ffunction-sections
to (hopefully) allow the dead code to be discarded.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 9:31 ` Russell King (Oracle)
0 siblings, 0 replies; 90+ messages in thread
From: Russell King (Oracle) @ 2021-06-07 9:31 UTC (permalink / raw)
To: Christophe Leroy
Cc: Kefeng Wang, Mike Rapoport, uclinux-h8-devel, linux-s390,
linux-sh, linux-kernel, linux-csky, linux-mm, linux-m68k,
openrisc, Andrew Morton, linux-snps-arc, linuxppc-dev,
linux-riscv, linux-arm-kernel
On Mon, Jun 07, 2021 at 07:48:54AM +0200, Christophe Leroy wrote:
> Hi Kefeng,
>
> What you could do is to define a __weak function that architectures can
> override and call that function from mm_init() as suggested by Mike,
The problem with weak functions is that they bloat the kernel. Each
time a weak function is overriden, it becomes dead unreachable code
within the kernel image.
At some point we're probabily going to have to enable -ffunction-sections
to (hopefully) allow the dead code to be discarded.
--
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] 90+ messages in thread
* [OpenRISC] [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code
@ 2021-06-07 9:31 ` Russell King (Oracle)
0 siblings, 0 replies; 90+ messages in thread
From: Russell King @ 2021-06-07 9:31 UTC (permalink / raw)
To: openrisc
On Mon, Jun 07, 2021 at 07:48:54AM +0200, Christophe Leroy wrote:
> Hi Kefeng,
>
> What you could do is to define a __weak function that architectures can
> override and call that function from mm_init() as suggested by Mike,
The problem with weak functions is that they bloat the kernel. Each
time a weak function is overriden, it becomes dead unreachable code
within the kernel image.
At some point we're probabily going to have to enable -ffunction-sections
to (hopefully) allow the dead code to be discarded.
--
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] 90+ messages in thread
* Re: [PATCH v2 15/15] x86: convert to setup_initial_init_mm()
2021-06-04 7:06 ` [PATCH v2 15/15] x86: " Kefeng Wang
@ 2021-06-08 0:26 ` Andrew Morton
2021-06-08 1:39 ` Kefeng Wang
0 siblings, 1 reply; 90+ messages in thread
From: Andrew Morton @ 2021-06-08 0:26 UTC (permalink / raw)
To: Kefeng Wang; +Cc: linux-kernel, linux-mm, Thomas Gleixner, Ingo Molnar, x86
On Fri, 4 Jun 2021 15:06:33 +0800 Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
> Use setup_initial_init_mm() helper to simplify code.
>
> ...
>
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -868,10 +868,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;
arch/x86/kernel/setup.c:873:47: warning: passing argument 4 of 'setup_initial_init_mm' makes pointer from integer without a cast [-Wint-conversion]
873 | setup_initial_init_mm(_text, _etext, _edata, _brk_end);
| ^~~~~~~~
| |
| long unsigned int
In file included from ./include/linux/pid_namespace.h:7,
from ./include/linux/ptrace.h:10,
from ./include/linux/elfcore.h:11,
from ./include/linux/crash_core.h:6,
from ./include/linux/kexec.h:18,
from ./include/linux/crash_dump.h:5,
from arch/x86/kernel/setup.c:9:
./include/linux/mm.h:248:29: note: expected 'void *' but argument is of type 'long unsigned int'
248 | void *end_data, void *brk);
| ~~~~~~^~~
afaict the other architectures will warn this way, not sure.
Please check all that, refresh ,retest and resend?
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 15/15] x86: convert to setup_initial_init_mm()
2021-06-08 0:26 ` Andrew Morton
@ 2021-06-08 1:39 ` Kefeng Wang
0 siblings, 0 replies; 90+ messages in thread
From: Kefeng Wang @ 2021-06-08 1:39 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux-mm, Thomas Gleixner, Ingo Molnar, x86
On 2021/6/8 8:26, Andrew Morton wrote:
> On Fri, 4 Jun 2021 15:06:33 +0800 Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>
>> Use setup_initial_init_mm() helper to simplify code.
>>
>> ...
>>
>> --- a/arch/x86/kernel/setup.c
>> +++ b/arch/x86/kernel/setup.c
>> @@ -868,10 +868,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;
> arch/x86/kernel/setup.c:873:47: warning: passing argument 4 of 'setup_initial_init_mm' makes pointer from integer without a cast [-Wint-conversion]
> 873 | setup_initial_init_mm(_text, _etext, _edata, _brk_end);
> | ^~~~~~~~
> | |
> | long unsigned int
> In file included from ./include/linux/pid_namespace.h:7,
> from ./include/linux/ptrace.h:10,
> from ./include/linux/elfcore.h:11,
> from ./include/linux/crash_core.h:6,
> from ./include/linux/kexec.h:18,
> from ./include/linux/crash_dump.h:5,
> from arch/x86/kernel/setup.c:9:
> ./include/linux/mm.h:248:29: note: expected 'void *' but argument is of type 'long unsigned int'
> 248 | void *end_data, void *brk);
> | ~~~~~~^~~
>
>
> afaict the other architectures will warn this way, not sure.
I check all archs again, the x86/m68k/powerpc/h8300 has use some value
which is not pointer ,
other are changed, but forget this one. I do compile, but I don't know
why I missed it, sorry about
this.
>
> Please check all that, refresh ,retest and resend?
> .
>
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 12/15] riscv: convert to setup_initial_init_mm()
2021-06-04 7:06 ` Kefeng Wang
@ 2021-06-12 3:55 ` Palmer Dabbelt
-1 siblings, 0 replies; 90+ messages in thread
From: Palmer Dabbelt @ 2021-06-12 3:55 UTC (permalink / raw)
To: wangkefeng.wang
Cc: akpm, linux-kernel, linux-mm, wangkefeng.wang, Paul Walmsley,
linux-riscv
On Fri, 04 Jun 2021 00:06:30 PDT (-0700), wangkefeng.wang@huawei.com wrote:
> 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 03901d3a8b02..52396874f859 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;
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
^ permalink raw reply [flat|nested] 90+ messages in thread
* Re: [PATCH v2 12/15] riscv: convert to setup_initial_init_mm()
@ 2021-06-12 3:55 ` Palmer Dabbelt
0 siblings, 0 replies; 90+ messages in thread
From: Palmer Dabbelt @ 2021-06-12 3:55 UTC (permalink / raw)
To: wangkefeng.wang
Cc: akpm, linux-kernel, linux-mm, wangkefeng.wang, Paul Walmsley,
linux-riscv
On Fri, 04 Jun 2021 00:06:30 PDT (-0700), wangkefeng.wang@huawei.com wrote:
> 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 03901d3a8b02..52396874f859 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;
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 90+ messages in thread
end of thread, other threads:[~2021-06-12 4:00 UTC | newest]
Thread overview: 90+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04 7:06 [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code Kefeng Wang
2021-06-04 7:06 ` [OpenRISC] " Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-04 7:06 ` [PATCH v2 01/15] mm: add setup_initial_init_mm() helper Kefeng Wang
2021-06-04 7:06 ` [OpenRISC] " Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-06 21:31 ` Mike Rapoport
2021-06-06 21:31 ` [OpenRISC] " Mike Rapoport
2021-06-06 21:31 ` Mike Rapoport
2021-06-06 21:31 ` Mike Rapoport
2021-06-06 21:31 ` Mike Rapoport
2021-06-06 21:31 ` Mike Rapoport
2021-06-07 1:50 ` Kefeng Wang
2021-06-07 1:50 ` [OpenRISC] " Kefeng Wang
2021-06-07 1:50 ` Kefeng Wang
2021-06-07 1:50 ` Kefeng Wang
2021-06-07 1:50 ` Kefeng Wang
2021-06-07 1:50 ` Kefeng Wang
2021-06-07 2:36 ` [PATCH v3] " Kefeng Wang
2021-06-07 2:36 ` [OpenRISC] " Kefeng Wang
2021-06-07 2:36 ` Kefeng Wang
2021-06-07 2:36 ` Kefeng Wang
2021-06-07 2:36 ` Kefeng Wang
2021-06-07 2:36 ` Kefeng Wang
2021-06-04 7:06 ` [PATCH v2 02/15] arc: convert to setup_initial_init_mm() Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-04 14:03 ` Vineet Gupta
2021-06-04 14:03 ` Vineet Gupta
2021-06-04 14:03 ` Vineet Gupta
2021-06-04 7:06 ` [PATCH v2 03/15] arm: " Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-07 9:25 ` Russell King (Oracle)
2021-06-07 9:25 ` Russell King (Oracle)
2021-06-04 7:06 ` [PATCH v2 04/15] arm64: " Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-04 9:19 ` Catalin Marinas
2021-06-04 9:19 ` Catalin Marinas
2021-06-04 7:06 ` [PATCH v2 05/15] csky: " Kefeng Wang
2021-06-04 7:06 ` [PATCH v2 06/15] h8300: " Kefeng Wang
2021-06-04 7:06 ` [PATCH v2 07/15] m68k: " Kefeng Wang
2021-06-04 7:06 ` [PATCH v2 08/15] nds32: " Kefeng Wang
2021-06-04 7:06 ` [PATCH v2 09/15] nios2: " Kefeng Wang
2021-06-04 7:06 ` [PATCH v2 10/15] openrisc: " Kefeng Wang
2021-06-04 7:06 ` [OpenRISC] " Kefeng Wang
2021-06-04 7:06 ` [PATCH v2 11/15] powerpc: " Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-04 7:06 ` [PATCH v2 12/15] riscv: " Kefeng Wang
2021-06-04 7:06 ` Kefeng Wang
2021-06-12 3:55 ` Palmer Dabbelt
2021-06-12 3:55 ` Palmer Dabbelt
2021-06-04 7:06 ` [PATCH v2 13/15] s390: " Kefeng Wang
2021-06-04 7:06 ` [PATCH v2 14/15] sh: " Kefeng Wang
2021-06-04 7:06 ` [PATCH v2 15/15] x86: " Kefeng Wang
2021-06-08 0:26 ` Andrew Morton
2021-06-08 1:39 ` Kefeng Wang
2021-06-06 21:29 ` [PATCH v2 00/15] init_mm: cleanup ARCH's text/data/brk setup code Mike Rapoport
2021-06-06 21:29 ` [OpenRISC] " Mike Rapoport
2021-06-06 21:29 ` Mike Rapoport
2021-06-06 21:29 ` Mike Rapoport
2021-06-06 21:29 ` Mike Rapoport
2021-06-06 21:29 ` Mike Rapoport
2021-06-07 0:55 ` Kefeng Wang
2021-06-07 0:55 ` [OpenRISC] " Kefeng Wang
2021-06-07 0:55 ` Kefeng Wang
2021-06-07 0:55 ` Kefeng Wang
2021-06-07 0:55 ` Kefeng Wang
2021-06-07 0:55 ` Kefeng Wang
2021-06-07 5:48 ` Christophe Leroy
2021-06-07 5:48 ` [OpenRISC] " Christophe Leroy
2021-06-07 5:48 ` Christophe Leroy
2021-06-07 5:48 ` Christophe Leroy
2021-06-07 5:48 ` Christophe Leroy
2021-06-07 8:30 ` Kefeng Wang
2021-06-07 8:30 ` [OpenRISC] " Kefeng Wang
2021-06-07 8:30 ` Kefeng Wang
2021-06-07 8:30 ` Kefeng Wang
2021-06-07 8:30 ` Kefeng Wang
2021-06-07 8:30 ` Kefeng Wang
2021-06-07 9:31 ` Russell King (Oracle)
2021-06-07 9:31 ` [OpenRISC] " Russell King
2021-06-07 9:31 ` Russell King (Oracle)
2021-06-07 9:31 ` Russell King (Oracle)
2021-06-07 9:31 ` Russell King (Oracle)
2021-06-07 9:31 ` Russell King (Oracle)
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.