Re: [PATCH 7/9] um: Implement kernel side of SECCOMP based process handling

2025-03-06 Thread Hajime Tazaki
Hello, thanks for the update; was waiting for this. On Tue, 25 Feb 2025 03:18:25 +0900, Benjamin Berg wrote: > > This adds the kernel side of the seccomp based process handling. > > Co-authored-by: Johannes Berg > Signed-off-by: Benjamin Berg > Signed-off-by: Benjamin Berg (snip) > diff --

[PATCH 04/13] MIPS: consolidate mem_init() for NUMA machines

2025-03-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Both MIPS systems that support numa (loongsoon3 and sgi-ip27) have identical mem_init() for NUMA case. Move that into arch/mips/mm/init.c and drop duplicate per-machine definitions. Signed-off-by: Mike Rapoport (Microsoft) --- arch/mips/loongson64/numa.c

[PATCH 02/13] csky: move setup_initrd() to setup.c

2025-03-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Memory used by initrd should be reserved as soon as possible before there any memblock allocations that might overwrite that memory. This will also help with pulling out memblock_free_all() to the generic code and reducing code duplication in arch::mem_init().

Re: [PATCH 00/13] arch, mm: reduce code duplication in mem_init()

2025-03-06 Thread Andrew Morton
On Thu, 6 Mar 2025 20:51:10 +0200 Mike Rapoport wrote: > Every architecture has implementation of mem_init() function and some > even more than one. All these release free memory to the buddy > allocator, most of them set high_memory to the end of directly > addressable memory and many of them s

[PATCH 12/13] arch, mm: introduce arch_mm_preinit

2025-03-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Currently, implementation of mem_init() in every architecture consists of one or more of the following: * initializations that must run before page allocator is active, for instance swiotlb_init() * a call to memblock_free_all() to release all the memory to th

[PATCH 06/13] nios2: move pr_debug() about memory start and end to setup_arch()

2025-03-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" This will help with pulling out memblock_free_all() to the generic code and reducing code duplication in arch::mem_init(). Signed-off-by: Mike Rapoport (Microsoft) --- arch/nios2/kernel/setup.c | 2 ++ arch/nios2/mm/init.c | 2 -- 2 files changed, 2 inser

[PATCH 13/13] arch, mm: make releasing of memory to page allocator more explicit

2025-03-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" The point where the memory is released from memblock to the buddy allocator is hidden inside arch-specific mem_init()s and the call to memblock_free_all() is needlessly duplicated in every artiste cure and after introduction of arch_mm_preinit() hook, mem_init()

[PATCH 07/13] s390: make setup_zero_pages() use memblock

2025-03-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Allocating the zero pages from memblock is simpler because the memory is already reserved. This will also help with pulling out memblock_free_all() to the generic code and reducing code duplication in arch::mem_init(). Signed-off-by: Mike Rapoport (Microsoft)

[PATCH 10/13] arch, mm: set high_memory in free_area_init()

2025-03-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" high_memory defines upper bound on the directly mapped memory. This bound is defined by the beginning of ZONE_HIGHMEM when a system has high memory and by the end of memory otherwise. All this is known to generic memory management initialization code that can se

Re: [PATCH 00/13] arch, mm: reduce code duplication in mem_init()

2025-03-06 Thread Dave Hansen
On 3/6/25 10:51, Mike Rapoport wrote: > 53 files changed, 151 insertions(+), 618 deletions(-) > delete mode 100644 arch/x86/include/asm/numa_32.h > delete mode 100644 arch/x86/mm/highmem_32.c Holy cow, nice work. For the x86 bits: Acked-by: Dave Hansen

[PATCH 08/13] xtensa: split out printing of virtual memory layout to a function

2025-03-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" This will help with pulling out memblock_free_all() to the generic code and reducing code duplication in arch::mem_init(). Signed-off-by: Mike Rapoport (Microsoft) --- arch/xtensa/mm/init.c | 97 ++- 1 file changed, 50 i

[PATCH 05/13] MIPS: make setup_zero_pages() use memblock

2025-03-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Allocating the zero pages from memblock is simpler because the memory is already reserved. This will also help with pulling out memblock_free_all() to the generic code and reducing code duplication in arch::mem_init(). Signed-off-by: Mike Rapoport (Microsoft)

[PATCH 00/13] arch, mm: reduce code duplication in mem_init()

2025-03-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Hi, Every architecture has implementation of mem_init() function and some even more than one. All these release free memory to the buddy allocator, most of them set high_memory to the end of directly addressable memory and many of them set max_mapnr for FLATMEM

[PATCH v2 3/4] um: Switch to the pthread-based helper in sigio workaround

2025-03-06 Thread Tiwei Bie
The write_sigio thread and UML kernel thread share the same errno, which can lead to conflicts when both call syscalls concurrently. Switch to the pthread-based helper to address this issue. Signed-off-by: Tiwei Bie --- arch/um/os-Linux/sigio.c | 44 +--- 1 fi

[PATCH v2 1/4] um: Add pthread-based helper support

2025-03-06 Thread Tiwei Bie
Introduce a new set of utility functions that can be used to create pthread-based helpers. Helper threads created in this way will ensure thread safety for errno while sharing the same memory space. Signed-off-by: Tiwei Bie --- arch/um/include/shared/os.h | 5 +++ arch/um/os-Linux/helper.c |

[PATCH v2 4/4] um: Prohibit the VM_CLONE flag in run_helper_thread()

2025-03-06 Thread Tiwei Bie
Directly creating helper threads with VM_CLONE using clone can compromise the thread safety of errno. Since all these helper threads have been converted to use os_run_helper_thread(), let's prevent using this flag in run_helper_thread(). Signed-off-by: Tiwei Bie --- arch/um/os-Linux/helper.c | 4