[PATCH v10 04/13] x86/um: nommu: syscall handling

2025-06-22 Thread Hajime Tazaki
cture. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/x86/um/Makefile| 4 ++ arch/x86/um/nommu/Makefile | 8 +++ arch/x86/um/nommu/do_syscall_64.c | 25 +++ arch/x86/um/nommu/entry_64.S| 91 + arch/x

[PATCH v10 10/13] um: nommu: a work around for MMU dependency to PCI driver

2025-06-22 Thread Hajime Tazaki
PCI drivers for nommu UML, we will refactor this code. Signed-off-by: Hajime Tazaki --- arch/um/include/asm/dma.h | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/um/include/asm/dma.h b/arch/um/include/asm/dma.h index fdc53642c718..643d74555671 100644 --- a/arch/um/include/

[PATCH v10 13/13] um: nommu: plug nommu code into build system

2025-06-22 Thread Hajime Tazaki
Add nommu kernel for um build. defconfig is also provided. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Kconfig| 14 ++- arch/um/configs/x86_64_nommu_defconfig | 54 ++ 2 files changed, 66 insertions(+), 2 deletions

[PATCH v10 01/13] x86/um: nommu: elf loader for fdpic

2025-06-22 Thread Hajime Tazaki
Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: linux...@kvack.org Cc: linux-fsde...@vger.kernel.org Acked-by: Kees Cook Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/asm/mmu.h| 5 + arch/um/include/asm/ptrace-generic.h | 6

[PATCH v10 02/13] um: decouple MMU specific code from the common part

2025-06-22 Thread Hajime Tazaki
This splits the memory, process related code with common and MMU specific parts in order to avoid ifdefs in .c file and duplication between MMU and !MMU. Signed-off-by: Hajime Tazaki --- arch/um/kernel/Makefile | 5 +- arch/um/kernel/mem-pgtable.c| 55 + arch/um

[PATCH v10 00/13] nommu UML

2025-06-22 Thread Hajime Tazaki
UML_CONFIG_MMU to CONFIG_MMU as using uml/linux.git - proposed a patch of maple-tree issue (resolving a limitation in RFC v1) https://lore.kernel.org/linux-mm/20241108222834.3625217-1-thehaj...@gmail.com/ RFC: - https://lore.kernel.org/linux-um/cover.1729770373.git.thehaj...@gmail.com/ Hajime Tazaki

[PATCH v10 03/13] um: nommu: memory handling

2025-06-22 Thread Hajime Tazaki
the address space in !CONFIG_MMU mode. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Makefile | 4 arch/um/include/asm/futex.h | 4 arch/um/include/asm/mmu.h | 3 +++ arch/um/include/asm/mmu_context.h | 2 ++ arch/um/include/asm

[PATCH v10 08/13] x86/um/vdso: nommu: vdso memory update

2025-06-22 Thread Hajime Tazaki
On !MMU mode, the address of vdso is accessible from userspace. This commit implements the entry point by pointing a block of page address. This commit also add memory permission configuration of vdso page to be executable. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch

[PATCH v10 06/13] x86/um: nommu: process/thread handling

2025-06-22 Thread Hajime Tazaki
red in non-ptrace syscall entry/leave so, we also need to handle pending signal by ourselves. ptrace related syscalls are not tested yet so, marked arch_has_single_step() unsupported in !MMU environment. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/asm/ptrace-gene

[PATCH v10 09/13] x86/um: nommu: signal handling

2025-06-22 Thread Hajime Tazaki
the register. It also adds the follow up routine for SIGSEGV as a signal delivery runs in the same stack frame while we have to avoid endless SIGSEGV. Signed-off-by: Hajime Tazaki --- arch/um/include/shared/kern_util.h| 4 + arch/um/nommu/Makefile| 2 +- arch/um/nommu/os

[PATCH v10 11/13] um: change machine name for uname output

2025-06-22 Thread Hajime Tazaki
This commit tries to display MMU/!MMU mode from the output of uname(2) so that users can distinguish which mode of UML is running right now. Signed-off-by: Hajime Tazaki --- arch/um/Makefile| 6 ++ arch/um/os-Linux/util.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion

[PATCH v10 05/13] um: nommu: seccomp syscalls hook

2025-06-22 Thread Hajime Tazaki
high_physmem, which locates userspace memory. It also renames existing static function, sigsys_handler(), in start_up.c to avoid name conflicts between them. Signed-off-by: Hajime Tazaki Signed-off-by: Kenichi Yasukata --- arch/um/include/shared/kern_util.h| 2 + arch/um/include/shared

[PATCH v10 12/13] um: nommu: add documentation of nommu UML

2025-06-22 Thread Hajime Tazaki
This commit adds an initial documentation for !MMU mode of UML. Signed-off-by: Hajime Tazaki --- Documentation/virt/uml/nommu-uml.rst | 180 +++ MAINTAINERS | 1 + 2 files changed, 181 insertions(+) create mode 100644 Documentation/virt/uml

[PATCH v10 07/13] um: nommu: configure fs register on host syscall invocation

2025-06-22 Thread Hajime Tazaki
-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/shared/os.h | 6 +++ arch/um/os-Linux/process.c| 6 +++ arch/um/os-Linux/start_up.c | 21 + arch/x86/um/nommu/do_syscall_64.c | 37 arch/x86/um/nommu/syscalls_64.c | 71

Re: [PATCH v9 04/13] x86/um: nommu: syscall handling

2025-06-21 Thread Hajime Tazaki
On Thu, 19 Jun 2025 19:31:53 +0900, Benjamin Berg wrote: > > diff --git a/arch/x86/um/nommu/do_syscall_64.c > > b/arch/x86/um/nommu/do_syscall_64.c > > new file mode 100644 > > index ..5d0fa83e7fdc > > --- /dev/null > > +++ b/arch/x86/um/nommu/do_syscall_64.c > > @@ -0,0 +1,37 @@ >

Re: [PATCH v9 07/13] um: nommu: configure fs register on host syscall invocation

2025-06-19 Thread Hajime Tazaki
On Thu, 19 Jun 2025 21:38:47 +0900, Benjamin Berg wrote: > > On Thu, 2025-06-19 at 21:22 +0900, Hajime Tazaki wrote: > > > > On Thu, 19 Jun 2025 19:40:49 +0900, > > Benjamin Berg wrote: > > > > > > On Thu, 2025-06-19 at 10:04 +0900, Hajime Tazaki wr

Re: [PATCH v7 10/13] x86/um: nommu: signal handling

2025-06-19 Thread Hajime Tazaki
Thanks, # this is a thread of my older series, v7 (current one is v9), tho your comment is still valid so, thanks ! On Thu, 19 Jun 2025 20:43:06 +0900, Benjamin Berg wrote: > > Hi, > > I am not sure that fxsaveq/fxrstorq is guaranteed to be sufficient. I > don't think that catches some of the

Re: [PATCH v9 07/13] um: nommu: configure fs register on host syscall invocation

2025-06-19 Thread Hajime Tazaki
On Thu, 19 Jun 2025 19:40:49 +0900, Benjamin Berg wrote: > > On Thu, 2025-06-19 at 10:04 +0900, Hajime Tazaki wrote: > > As userspace on UML/!MMU also need to configure %fs register when it is > > running to correctly access thread structure, host syscalls implemented >

Re: [PATCH v9 06/13] x86/um: nommu: process/thread handling

2025-06-19 Thread Hajime Tazaki
Hello, On Thu, 19 Jun 2025 19:36:04 +0900, Benjamin Berg wrote: > > +void arch_switch_to(struct task_struct *to) > > +{ > > + /* > > +* In !CONFIG_MMU, it doesn't ptrace thus, > > +* The FS_BASE/GS_BASE registers are saved here. > > +*/ > > + current_top_of_stack = task_top_of_s

[PATCH v9 12/13] um: nommu: add documentation of nommu UML

2025-06-18 Thread Hajime Tazaki
This commit adds an initial documentation for !MMU mode of UML. Signed-off-by: Hajime Tazaki --- Documentation/virt/uml/nommu-uml.rst | 180 +++ MAINTAINERS | 1 + 2 files changed, 181 insertions(+) create mode 100644 Documentation/virt/uml

[PATCH v9 04/13] x86/um: nommu: syscall handling

2025-06-18 Thread Hajime Tazaki
cture. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/x86/um/Makefile| 4 ++ arch/x86/um/nommu/Makefile | 8 +++ arch/x86/um/nommu/do_syscall_64.c | 37 ++ arch/x86/um/nommu/entry_64.S| 91 + arc

[PATCH v9 13/13] um: nommu: plug nommu code into build system

2025-06-18 Thread Hajime Tazaki
Add nommu kernel for um build. defconfig is also provided. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Kconfig| 14 ++- arch/um/configs/x86_64_nommu_defconfig | 54 ++ 2 files changed, 66 insertions(+), 2 deletions

[PATCH v9 09/13] x86/um: nommu: signal handling

2025-06-18 Thread Hajime Tazaki
the register. It also adds the follow up routine for SIGSEGV as a signal delivery runs in the same stack frame while we have to avoid endless SIGSEGV. Signed-off-by: Hajime Tazaki --- arch/um/include/shared/kern_util.h| 4 + arch/um/nommu/Makefile| 2 +- arch/um/nommu/os

[PATCH v9 06/13] x86/um: nommu: process/thread handling

2025-06-18 Thread Hajime Tazaki
red in non-ptrace syscall entry/leave so, we also need to handle pending signal by ourselves. ptrace related syscalls are not tested yet so, marked arch_has_single_step() unsupported in !MMU environment. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/asm/ptrace-gene

[PATCH v9 11/13] um: change machine name for uname output

2025-06-18 Thread Hajime Tazaki
This commit tries to display MMU/!MMU mode from the output of uname(2) so that users can distinguish which mode of UML is running right now. Signed-off-by: Hajime Tazaki --- arch/um/Makefile| 6 ++ arch/um/os-Linux/util.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion

[PATCH v9 07/13] um: nommu: configure fs register on host syscall invocation

2025-06-18 Thread Hajime Tazaki
-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/shared/os.h | 6 +++ arch/um/os-Linux/process.c| 6 +++ arch/um/os-Linux/start_up.c | 21 + arch/x86/um/nommu/do_syscall_64.c | 37 arch/x86/um/nommu/syscalls_64.c | 71

[PATCH v9 02/13] um: decouple MMU specific code from the common part

2025-06-18 Thread Hajime Tazaki
This splits the memory, process related code with common and MMU specific parts in order to avoid ifdefs in .c file and duplication between MMU and !MMU. Signed-off-by: Hajime Tazaki --- arch/um/kernel/Makefile | 5 +- arch/um/kernel/mem-pgtable.c| 55 + arch/um

[PATCH v9 08/13] x86/um/vdso: nommu: vdso memory update

2025-06-18 Thread Hajime Tazaki
On !MMU mode, the address of vdso is accessible from userspace. This commit implements the entry point by pointing a block of page address. This commit also add memory permission configuration of vdso page to be executable. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch

[PATCH v9 10/13] um: nommu: a work around for MMU dependency to PCI driver

2025-06-18 Thread Hajime Tazaki
PCI drivers for nommu UML, we will refactor this code. Signed-off-by: Hajime Tazaki --- arch/um/include/asm/dma.h | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/um/include/asm/dma.h b/arch/um/include/asm/dma.h index fdc53642c718..643d74555671 100644 --- a/arch/um/include/

[PATCH v9 00/13] nommu UML

2025-06-18 Thread Hajime Tazaki
/ RFC: - https://lore.kernel.org/linux-um/cover.1729770373.git.thehaj...@gmail.com/ Hajime Tazaki (13): x86/um: nommu: elf loader for fdpic um: decouple MMU specific code from the common part um: nommu: memory handling x86/um: nommu: syscall handling um: nommu: seccomp syscalls hook x86

[PATCH v9 05/13] um: nommu: seccomp syscalls hook

2025-06-18 Thread Hajime Tazaki
high_physmem, which locates userspace memory. It also renames existing static function, sigsys_handler(), in start_up.c to avoid name conflicts between them. Signed-off-by: Hajime Tazaki Signed-off-by: Kenichi Yasukata --- arch/um/include/shared/kern_util.h| 2 + arch/um/include/shared

[PATCH v9 01/13] x86/um: nommu: elf loader for fdpic

2025-06-18 Thread Hajime Tazaki
Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: linux...@kvack.org Cc: linux-fsde...@vger.kernel.org Acked-by: Kees Cook Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/asm/mmu.h| 5 + arch/um/include/asm/ptrace-generic.h | 6

[PATCH v9 03/13] um: nommu: memory handling

2025-06-18 Thread Hajime Tazaki
the address space in !CONFIG_MMU mode. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Makefile | 4 arch/um/include/asm/futex.h | 4 arch/um/include/asm/mmu.h | 3 +++ arch/um/include/asm/mmu_context.h | 2 ++ arch/um/include/asm

[PATCH v8 05/12] um: nommu: seccomp syscalls hook

2025-04-29 Thread Hajime Tazaki
high_physmem, which locates userspace memory. Signed-off-by: Hajime Tazaki Signed-off-by: Kenichi Yasukata --- arch/um/include/shared/kern_util.h| 2 + arch/um/include/shared/os.h | 10 +++ arch/um/kernel/um_arch.c | 3 + arch/um/nommu/Makefile| 3

[PATCH v8 10/12] um: change machine name for uname output

2025-04-29 Thread Hajime Tazaki
This commit tries to display MMU/!MMU mode from the output of uname(2) so that users can distinguish which mode of UML is running right now. Signed-off-by: Hajime Tazaki --- arch/um/Makefile| 6 ++ arch/um/os-Linux/util.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion

[PATCH v8 00/12] nommu UML

2025-04-29 Thread Hajime Tazaki
/20241108222834.3625217-1-thehaj...@gmail.com/ RFC: - https://lore.kernel.org/linux-um/cover.1729770373.git.thehaj...@gmail.com/ Hajime Tazaki (12): x86/um: nommu: elf loader for fdpic um: decouple MMU specific code from the common part um: nommu: memory handling x86/um: nommu: syscall handling um: nommu

[PATCH v8 08/12] x86/um/vdso: nommu: vdso memory update

2025-04-29 Thread Hajime Tazaki
On !MMU mode, the address of vdso is accessible from userspace. This commit implements the entry point by pointing a block of page address. This commit also add memory permission configuration of vdso page to be executable. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch

[PATCH v8 04/12] x86/um: nommu: syscall handling

2025-04-29 Thread Hajime Tazaki
cture. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/x86/um/Makefile| 4 ++ arch/x86/um/nommu/Makefile | 8 +++ arch/x86/um/nommu/do_syscall_64.c | 37 ++ arch/x86/um/nommu/entry_64.S| 91 + arc

[PATCH v8 07/12] um: nommu: configure fs register on host syscall invocation

2025-04-29 Thread Hajime Tazaki
-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/shared/os.h | 6 +++ arch/um/os-Linux/process.c| 6 +++ arch/um/os-Linux/start_up.c | 20 + arch/x86/um/nommu/do_syscall_64.c | 37 arch/x86/um/nommu/syscalls_64.c | 71

[PATCH v8 03/12] um: nommu: memory handling

2025-04-29 Thread Hajime Tazaki
the address space in !CONFIG_MMU mode. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Makefile | 4 arch/um/include/asm/futex.h | 4 arch/um/include/asm/mmu.h | 3 +++ arch/um/include/asm/mmu_context.h | 2 ++ arch/um/include/asm

[PATCH v8 11/12] um: nommu: add documentation of nommu UML

2025-04-29 Thread Hajime Tazaki
This commit adds an initial documentation for !MMU mode of UML. Signed-off-by: Hajime Tazaki --- Documentation/virt/uml/nommu-uml.rst | 177 +++ MAINTAINERS | 1 + 2 files changed, 178 insertions(+) create mode 100644 Documentation/virt/uml

[PATCH v8 06/12] x86/um: nommu: process/thread handling

2025-04-29 Thread Hajime Tazaki
red in non-ptrace syscall entry/leave so, we also need to handle pending signal by ourselves. ptrace related syscalls are not tested yet so, marked arch_has_single_step() unsupported in !MMU environment. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/asm/ptrace-gene

[PATCH v8 01/12] x86/um: nommu: elf loader for fdpic

2025-04-29 Thread Hajime Tazaki
Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: linux...@kvack.org Cc: linux-fsde...@vger.kernel.org Acked-by: Kees Cook Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/asm/mmu.h| 5 + arch/um/include/asm/ptrace-generic.h | 6

[PATCH v8 02/12] um: decouple MMU specific code from the common part

2025-04-29 Thread Hajime Tazaki
This splits the memory, process related code with common and MMU specific parts in order to avoid ifdefs in .c file and duplication between MMU and !MMU. Signed-off-by: Hajime Tazaki --- arch/um/kernel/Makefile | 5 +- arch/um/kernel/mem-pgtable.c| 55 + arch/um

[PATCH v8 09/12] x86/um: nommu: signal handling

2025-04-29 Thread Hajime Tazaki
the register. It also adds the follow up routine for SIGSEGV as a signal delivery runs in the same stack frame while we have to avoid endless SIGSEGV. Signed-off-by: Hajime Tazaki --- arch/um/include/shared/kern_util.h| 4 + arch/um/nommu/Makefile| 2 +- arch/um/nommu/os

[PATCH v8 12/12] um: nommu: plug nommu code into build system

2025-04-29 Thread Hajime Tazaki
Add nommu kernel for um build. defconfig is also provided. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Kconfig| 14 +- arch/um/configs/x86_64_nommu_defconfig | 64 ++ 2 files changed, 76 insertions(+), 2 deletions

Re: [PATCH v7 00/13] nommu UML

2025-04-26 Thread Hajime Tazaki
Hello Lorenzo, On Fri, 25 Apr 2025 22:49:31 +0900, Lorenzo Stoakes wrote: > It seemed this series died, which is a pity, i'd be very useful to have > this functionality to aid in easily testing nommu in mm code. > > I know that I pushed back a little (or rather - wondering about the status > o

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 --

Re: [PATCH v7 00/13] nommu UML

2025-02-04 Thread Hajime Tazaki
Hello Richard, Anton, Cc: Johannes, On Mon, 20 Jan 2025 15:00:02 +0900, Hajime Tazaki wrote: > > This patchset is another spin of nommu mode addition to UML. It doesn't > change a lot since the last version (v5), but contain clean ups. It would > be nice to hear about your

[PATCH v7 13/13] um: nommu: plug nommu code into build system

2025-01-19 Thread Hajime Tazaki
Add nommu kernel for um build. defconfig is also provided. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Kconfig| 14 +- arch/um/configs/x86_64_nommu_defconfig | 64 ++ 2 files changed, 76 insertions(+), 2 deletions

[PATCH v7 08/13] um: nommu: configure fs register on host syscall invocation

2025-01-19 Thread Hajime Tazaki
-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/shared/os.h | 6 +++ arch/um/os-Linux/process.c| 6 +++ arch/um/os-Linux/start_up.c | 20 + arch/x86/um/nommu/do_syscall_64.c | 37 arch/x86/um/nommu/syscalls_64.c | 71

[PATCH v7 03/13] um: decouple MMU specific code from the common part

2025-01-19 Thread Hajime Tazaki
This splits the memory, process related code with common and MMU specific parts in order to avoid ifdefs in .c file and duplication between MMU and !MMU. Signed-off-by: Hajime Tazaki --- arch/um/kernel/Makefile | 5 +- arch/um/kernel/mem-pgtable.c| 55 + arch/um

[PATCH v7 07/13] x86/um: nommu: process/thread handling

2025-01-19 Thread Hajime Tazaki
red in non-ptrace syscall entry/leave so, we also need to handle pending signal by ourselves. ptrace related syscalls are not tested yet so, marked arch_has_single_step() unsupported in !MMU environment. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/asm/ptrace-gene

[PATCH v7 02/13] x86/um: nommu: elf loader for fdpic

2025-01-19 Thread Hajime Tazaki
Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: linux...@kvack.org Cc: linux-fsde...@vger.kernel.org Acked-by: Kees Cook Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/asm/mmu.h| 5 + arch/um/include/asm/ptrace-generic.h | 6

[PATCH v7 05/13] x86/um: nommu: syscall handling

2025-01-19 Thread Hajime Tazaki
cture. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/x86/um/Makefile| 4 ++ arch/x86/um/nommu/Makefile | 8 +++ arch/x86/um/nommu/do_syscall_64.c | 37 ++ arch/x86/um/nommu/entry_64.S| 91 + arc

[PATCH v7 04/13] um: nommu: memory handling

2025-01-19 Thread Hajime Tazaki
the address space in !CONFIG_MMU mode. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Makefile | 4 arch/um/include/asm/futex.h | 4 arch/um/include/asm/mmu.h | 3 +++ arch/um/include/asm/mmu_context.h | 2 ++ arch/um/include/asm

[PATCH v7 12/13] um: nommu: add documentation of nommu UML

2025-01-19 Thread Hajime Tazaki
This commit adds an initial documentation for !MMU mode of UML. Signed-off-by: Hajime Tazaki --- Documentation/virt/uml/nommu-uml.rst | 177 +++ MAINTAINERS | 1 + 2 files changed, 178 insertions(+) create mode 100644 Documentation/virt/uml

[PATCH v7 10/13] x86/um: nommu: signal handling

2025-01-19 Thread Hajime Tazaki
the register. It also adds the follow up routine for SIGSEGV as a signal delivery runs in the same stack frame while we have to avoid endless SIGSEGV. Signed-off-by: Hajime Tazaki --- arch/um/include/shared/kern_util.h| 4 + arch/um/nommu/Makefile| 2 +- arch/um/nommu/os

[PATCH v7 01/13] x86/um: clean up elf specific definitions

2025-01-19 Thread Hajime Tazaki
The file arch/x86/um/asm/module.h is equivalent to the definition of asm-generic. Thus this commit cleans up to use it. Signed-off-by: Hajime Tazaki --- arch/um/include/asm/Kbuild | 1 + arch/x86/um/asm/module.h | 24 2 files changed, 1 insertion(+), 24 deletions

[PATCH v7 09/13] x86/um/vdso: nommu: vdso memory update

2025-01-19 Thread Hajime Tazaki
On !MMU mode, the address of vdso is accessible from userspace. This commit implements the entry point by pointing a block of page address. This commit also add memory permission configuration of vdso page to be executable. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch

[PATCH v7 11/13] um: change machine name for uname output

2025-01-19 Thread Hajime Tazaki
This commit tries to display MMU/!MMU mode from the output of uname(2) so that users can distinguish which mode of UML is running right now. Signed-off-by: Hajime Tazaki --- arch/um/Makefile| 6 ++ arch/um/os-Linux/util.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion

[PATCH v7 00/13] nommu UML

2025-01-19 Thread Hajime Tazaki
hehaj...@gmail.com/ Hajime Tazaki (13): x86/um: clean up elf specific definitions x86/um: nommu: elf loader for fdpic um: decouple MMU specific code from the common part um: nommu: memory handling x86/um: nommu: syscall handling um: nommu: seccomp syscalls hook x86/um: nommu: process/thread han

[PATCH v7 06/13] um: nommu: seccomp syscalls hook

2025-01-19 Thread Hajime Tazaki
high_physmem, which locates userspace memory. Signed-off-by: Hajime Tazaki Signed-off-by: Kenichi Yasukata --- arch/um/include/shared/kern_util.h| 8 +++ arch/um/include/shared/os.h | 10 +++ arch/um/kernel/um_arch.c | 3 + arch/um/nommu/Makefile| 3

Re: [PATCH v6 00/13] nommu UML

2025-01-16 Thread Hajime Tazaki
Hello, On Wed, 15 Jan 2025 18:30:41 +0900, Benjamin Berg wrote: > > > Maybe I am missing it, but I do not yet see proper FP register > > > handling. This will be needed for task/thread switches and also signal > > > emission/sigreturn. I am attaching the test program that I used to > > > verify

Re: [PATCH v6 00/13] nommu UML

2025-01-14 Thread Hajime Tazaki
Hello, On Wed, 15 Jan 2025 03:53:36 +0900, Benjamin Berg wrote: > > On Tue, 2025-01-14 at 20:30 +0900, Hajime Tazaki wrote: > > This patchset is another spin of nommu mode addition to UML.  It doesn't > > change a lot since the last version (v5), but contain clean ups. 

[PATCH v6 07/13] x86/um: nommu: process/thread handling

2025-01-14 Thread Hajime Tazaki
red in non-ptrace syscall entry/leave so, we also need to handle pending signal by ourselves. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/os-Linux/process.c | 6 + arch/x86/um/Makefile| 3 ++- arch/x86/um/nommu/Makefile | 2 +- arch/x86/um/nommu/

[PATCH v6 12/13] um: nommu: add documentation of nommu UML

2025-01-14 Thread Hajime Tazaki
This commit adds an initial documentation for !MMU mode of UML. Signed-off-by: Hajime Tazaki --- Documentation/virt/uml/nommu-uml.rst | 177 +++ MAINTAINERS | 1 + 2 files changed, 178 insertions(+) create mode 100644 Documentation/virt/uml

[PATCH v6 04/13] um: nommu: memory handling

2025-01-14 Thread Hajime Tazaki
the address space in !CONFIG_MMU mode. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Makefile | 4 arch/um/include/asm/futex.h | 4 arch/um/include/asm/mmu.h | 3 +++ arch/um/include/asm/mmu_context.h | 2 ++ arch/um/include/asm

[PATCH v6 13/13] um: nommu: plug nommu code into build system

2025-01-14 Thread Hajime Tazaki
Add nommu kernel for um build. defconfig is also provided. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Kconfig| 14 +- arch/um/configs/x86_64_nommu_defconfig | 64 ++ 2 files changed, 76 insertions(+), 2 deletions

[PATCH v6 08/13] um: nommu: configure fs register on host syscall invocation

2025-01-14 Thread Hajime Tazaki
-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/shared/os.h | 6 +++ arch/um/os-Linux/process.c| 6 +++ arch/um/os-Linux/start_up.c | 20 + arch/x86/um/nommu/do_syscall_64.c | 37 arch/x86/um/nommu/syscalls_64.c | 71

[PATCH v6 02/13] x86/um: nommu: elf loader for fdpic

2025-01-14 Thread Hajime Tazaki
Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: linux...@kvack.org Cc: linux-fsde...@vger.kernel.org Acked-by: Kees Cook Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/asm/mmu.h| 5 + arch/um/include/asm/ptrace-generic.h | 6

[PATCH v6 09/13] x86/um/vdso: nommu: vdso memory update

2025-01-14 Thread Hajime Tazaki
On !MMU mode, the address of vdso is accessible from userspace. This commit implements the entry point by pointing a block of page address. This commit also add memory permission configuration of vdso page to be executable. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch

[PATCH v6 06/13] um: nommu: seccomp syscalls hook

2025-01-14 Thread Hajime Tazaki
high_physmem, which locates userspace memory. Signed-off-by: Hajime Tazaki Signed-off-by: Kenichi Yasukata --- arch/um/include/shared/kern_util.h| 8 +++ arch/um/include/shared/os.h | 10 +++ arch/um/kernel/um_arch.c | 3 + arch/um/nommu/Makefile| 3

[PATCH v6 11/13] um: change machine name for uname output

2025-01-14 Thread Hajime Tazaki
This commit tries to display MMU/!MMU mode from the output of uname(2) so that users can distinguish which mode of UML is running right now. Signed-off-by: Hajime Tazaki --- arch/um/Makefile| 6 ++ arch/um/os-Linux/util.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion

[PATCH v6 00/13] nommu UML

2025-01-14 Thread Hajime Tazaki
nvert UML_CONFIG_MMU to CONFIG_MMU as using uml/linux.git - proposed a patch of maple-tree issue (resolving a limitation in RFC v1) https://lore.kernel.org/linux-mm/20241108222834.3625217-1-thehaj...@gmail.com/ RFC: - https://lore.kernel.org/linux-um/cover.1729770373.git.thehaj...@gmail.com/ H

[PATCH v6 10/13] x86/um: nommu: signal handling

2025-01-14 Thread Hajime Tazaki
. Signed-off-by: Hajime Tazaki --- arch/um/include/shared/kern_util.h| 4 + arch/um/nommu/Makefile| 2 +- arch/um/nommu/os-Linux/signal.c | 13 ++ arch/um/nommu/trap.c | 188 ++ arch/um/os-Linux/signal.c | 25

[PATCH v6 01/13] x86/um: clean up elf specific definitions

2025-01-14 Thread Hajime Tazaki
The file arch/x86/um/asm/module.h is equivalent to the definition of asm-generic. Thus this commit cleans up to use it. Signed-off-by: Hajime Tazaki --- arch/um/include/asm/Kbuild | 1 + arch/x86/um/asm/module.h | 24 2 files changed, 1 insertion(+), 24 deletions

[PATCH v6 05/13] x86/um: nommu: syscall handling

2025-01-14 Thread Hajime Tazaki
cture. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/x86/um/Makefile| 4 ++ arch/x86/um/nommu/Makefile | 8 +++ arch/x86/um/nommu/do_syscall_64.c | 37 ++ arch/x86/um/nommu/entry_64.S| 91 + arc

[PATCH v6 03/13] um: decouple MMU specific code from the common part

2025-01-14 Thread Hajime Tazaki
This splits the memory, process related code with common and MMU specific parts in order to avoid ifdefs in .c file and duplication between MMU and !MMU. Signed-off-by: Hajime Tazaki --- arch/um/kernel/Makefile | 5 +- arch/um/kernel/mem-pgtable.c| 55 + arch/um

Re: [PATCH v5 02/13] x86/um: nommu: elf loader for fdpic

2024-12-13 Thread Hajime Tazaki
On Sat, 14 Dec 2024 06:53:44 +0900, Eric W. Biederman wrote: > > config BINFMT_ELF > > bool "Kernel support for ELF binaries" > > - depends on MMU > > select ELFCORE > > default y > > help > > @@ -58,7 +57,7 @@ config ARCH_USE_GNU_PROPERTY > > config BINFM

Re: [PATCH v5 02/13] x86/um: nommu: elf loader for fdpic

2024-12-13 Thread Hajime Tazaki
On Sat, 14 Dec 2024 05:01:58 +0900, Eric W. Biederman wrote: > >> Last time I looked the regular binfmt_elf works just fine > >> without an mmu. I looked again and at a quick skim the > >> regular elf loader still looks like it will work without > >> an MMU. > > > > I'm wondering how you looked

Re: [PATCH v5 02/13] x86/um: nommu: elf loader for fdpic

2024-12-12 Thread Hajime Tazaki
Hello Eric, thanks for the feedback. On Thu, 12 Dec 2024 23:22:47 +0900, Eric W. Biederman wrote: > > Hajime Tazaki writes: > > > As UML supports CONFIG_MMU=n case, it has to use an alternate ELF > > loader, FDPIC ELF loader. In this commit, we added necessary > &

[PATCH v5 04/13] um: nommu: memory handling

2024-12-12 Thread Hajime Tazaki
the address space in !CONFIG_MMU mode. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Makefile | 4 arch/um/include/asm/futex.h | 4 arch/um/include/asm/mmu.h | 3 +++ arch/um/include/asm/mmu_context.h | 2 ++ arch/um/include/asm

[PATCH v5 03/13] um: decouple MMU specific code from the common part

2024-12-12 Thread Hajime Tazaki
This splits the memory, process related code with common and MMU specific parts in order to avoid ifdefs in .c file and duplication between MMU and !MMU. Signed-off-by: Hajime Tazaki --- arch/um/include/shared/mem.h| 8 ++ arch/um/kernel/Makefile | 5 +- arch/um/kernel/mem

[PATCH v5 08/13] um: nommu: configure fs register on host syscall invocation

2024-12-12 Thread Hajime Tazaki
-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/shared/os.h | 6 +++ arch/um/os-Linux/process.c| 6 +++ arch/um/os-Linux/start_up.c | 20 + arch/x86/um/nommu/do_syscall_64.c | 37 arch/x86/um/nommu/syscalls_64.c | 71

[PATCH v5 01/13] x86/um: clean up elf specific definitions

2024-12-12 Thread Hajime Tazaki
The file arch/x86/um/asm/module.h is equivalent to the definition of asm-generic. Thus this commit cleans up to use it. Signed-off-by: Hajime Tazaki --- arch/um/include/asm/Kbuild | 1 + arch/x86/um/asm/module.h | 24 2 files changed, 1 insertion(+), 24 deletions

[PATCH v5 10/13] x86/um: nommu: signal handling

2024-12-12 Thread Hajime Tazaki
. Signed-off-by: Hajime Tazaki --- arch/um/nommu/Makefile| 2 +- arch/um/nommu/trap.c | 188 ++ arch/um/os-Linux/signal.c | 6 + arch/x86/um/nommu/os-Linux/mcontext.c | 11 ++ arch/x86/um/shared/sysdep/mcontext.h | 1

[PATCH v5 05/13] x86/um: nommu: syscall handling

2024-12-12 Thread Hajime Tazaki
cture. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/x86/um/Makefile| 4 ++ arch/x86/um/nommu/Makefile | 8 +++ arch/x86/um/nommu/do_syscall_64.c | 37 ++ arch/x86/um/nommu/entry_64.S| 91 + arc

[PATCH v5 11/13] um: change machine name for uname output

2024-12-12 Thread Hajime Tazaki
This commit tries to display MMU/!MMU mode from the output of uname(2) so that users can distinguish which mode of UML is running right now. Signed-off-by: Hajime Tazaki --- arch/um/Makefile| 6 ++ arch/um/os-Linux/util.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion

[PATCH v5 06/13] um: nommu: seccomp syscalls hook

2024-12-12 Thread Hajime Tazaki
high_physmem, which locates userspace memory. Signed-off-by: Hajime Tazaki Signed-off-by: Kenichi Yasukata --- arch/um/include/shared/kern_util.h| 8 +++ arch/um/include/shared/os.h | 10 +++ arch/um/kernel/um_arch.c | 3 + arch/um/nommu/Makefile| 3

[PATCH v5 07/13] x86/um: nommu: process/thread handling

2024-12-12 Thread Hajime Tazaki
red in non-ptrace syscall entry/leave so, we also need to handle pending signal by ourselves. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/os-Linux/process.c | 6 + arch/x86/um/Makefile| 3 ++- arch/x86/um/nommu/Makefile | 2 +- arch/x86/um/nommu/

[PATCH v5 00/13] nommu UML

2024-12-12 Thread Hajime Tazaki
- proposed a patch of maple-tree issue (resolving a limitation in RFC v1) https://lore.kernel.org/linux-mm/20241108222834.3625217-1-thehaj...@gmail.com/ RFC: - https://lore.kernel.org/linux-um/cover.1729770373.git.thehaj...@gmail.com/ Hajime Tazaki (13): x86/um: clean up elf specific definitions x86

[PATCH v5 12/13] um: nommu: add documentation of nommu UML

2024-12-12 Thread Hajime Tazaki
This commit adds an initial documentation for !MMU mode of UML. Signed-off-by: Hajime Tazaki --- Documentation/virt/uml/nommu-uml.rst | 177 +++ MAINTAINERS | 1 + 2 files changed, 178 insertions(+) create mode 100644 Documentation/virt/uml

[PATCH v5 13/13] um: nommu: plug nommu code into build system

2024-12-12 Thread Hajime Tazaki
Add nommu kernel for um build. defconfig is also provided. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/Kconfig| 14 +- arch/um/configs/x86_64_nommu_defconfig | 64 ++ 2 files changed, 76 insertions(+), 2 deletions

[PATCH v5 02/13] x86/um: nommu: elf loader for fdpic

2024-12-12 Thread Hajime Tazaki
Cc: Alexander Viro Cc: Christian Brauner Cc: Jan Kara Cc: linux...@kvack.org Cc: linux-fsde...@vger.kernel.org Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/asm/mmu.h| 5 + arch/um/include/asm/ptrace-generic.h | 6 ++ arch/x86/um/asm/elf.h

[PATCH v5 09/13] x86/um/vdso: nommu: vdso memory update

2024-12-12 Thread Hajime Tazaki
On !MMU mode, the address of vdso is accessible from userspace. This commit implements the entry point by pointing a block of page address. This commit also add memory permission configuration of vdso page to be executable. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch

Re: [PATCH v4 10/13] x86/um: nommu: signal handling

2024-12-11 Thread Hajime Tazaki
On Sun, 08 Dec 2024 19:15:37 +0900, Hajime Tazaki wrote: > > This commit updates the behavior of signal handling under !MMU > environment. 1) the stack preparation for the signal handlers and > 2) restoration of stack after rt_sigreturn(2) syscall. Those are needed > as the

[PATCH v4 01/13] x86/um: clean up elf specific definitions

2024-12-08 Thread Hajime Tazaki
The file arch/x86/um/asm/module.h is equivalent to the definition of asm-generic. Thus this commit cleans up to use it. Signed-off-by: Hajime Tazaki --- arch/um/include/asm/Kbuild | 1 + arch/x86/um/asm/module.h | 24 2 files changed, 1 insertion(+), 24 deletions

[PATCH v4 10/13] x86/um: nommu: signal handling

2024-12-08 Thread Hajime Tazaki
SIGSEGV as a signal delivery runs in the same stack frame while we have to avoid endless SIGSEGV. Signed-off-by: Hajime Tazaki --- arch/um/nommu/Makefile| 2 +- arch/um/nommu/trap.c | 188 ++ arch/um/os-Linux/signal.c | 6

[PATCH v4 11/13] um: change machine name for uname output

2024-12-08 Thread Hajime Tazaki
This commit tries to display MMU/!MMU mode from the output of uname(2) so that users can distinguish which mode of UML is running right now. Signed-off-by: Hajime Tazaki --- arch/um/Makefile| 6 ++ arch/um/os-Linux/util.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion

  1   2   >