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

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

2024-12-08 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 v4 12/13] um: nommu: add documentation of nommu UML

2024-12-08 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 v4 05/13] x86/um: nommu: syscall handling

2024-12-08 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| 87 +

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

2024-12-08 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 v4 09/13] x86/um/vdso: nommu: vdso memory update

2024-12-08 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 v4 07/13] x86/um: nommu: process/thread handling

2024-12-08 Thread Hajime Tazaki
me of registers (fs segment register for TLS, etc) on every context switch, etc. Signals aren't delivered 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

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

2024-12-08 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 v4 04/13] um: nommu: memory handling

2024-12-08 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 v4 03/13] um: decouple MMU specific code from the common part

2024-12-08 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 v4 02/13] x86/um: nommu: elf loader for fdpic

2024-12-08 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 v4 00/13] nommu UML

2024-12-08 Thread Hajime Tazaki
...@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/um: nommu: elf loader for fdpic um: decouple MMU specific code from the common part um: nommu: memory handling x86/um: nommu

Re: [PATCH v3 00/13] nommu UML

2024-12-08 Thread Hajime Tazaki
On Sun, 08 Dec 2024 19:13:11 +0900, Hajime Tazaki wrote: > > This is a series of patches of nommu arch addition to UML. It would > be nice to ask comments/opinions on this. sorry for the noise. this is my mistake for resending patch. please ignore this. -- Hajime

[PATCH v3 00/13] nommu UML

2024-12-08 Thread Hajime Tazaki
...@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/um: nommu: elf loader for fdpic um: decouple MMU specific code from the common part um: nommu: memory handling x86/um: nommu

Re: [PATCH v3 06/13] um: nommu: syscalls handler from userspace by seccomp filter

2024-12-05 Thread Hajime Tazaki
On Thu, 05 Dec 2024 22:54:21 +0900, Johannes Berg wrote: > > On Thu, 2024-12-05 at 22:51 +0900, Hajime Tazaki wrote: > > > > > > I don't understand why this behaves differently with and without > > > zpoline, it seems it shouldn't need to. Anywa

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

2024-12-05 Thread Hajime Tazaki
On Thu, 05 Dec 2024 22:58:52 +0900, Johannes Berg wrote: > > On Thu, 2024-12-05 at 22:56 +0900, Hajime Tazaki wrote: > > > > > > +++ b/arch/x86/um/asm/processor.h > > > > @@ -38,6 +38,18 @@ static __always_inline void cpu_relax(void) > > &

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

2024-12-05 Thread Hajime Tazaki
On Thu, 05 Dec 2024 04:31:11 +0900, Geert Uytterhoeven wrote: > > On Wed, Dec 4, 2024 at 5:53 PM Johannes Berg > wrote: > > On Tue, 2024-12-03 at 13:23 +0900, Hajime Tazaki wrote: > > > > > > +static int os_x86_arch_prctl(int pid, int option, unsigned lo

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

2024-12-05 Thread Hajime Tazaki
On Thu, 05 Dec 2024 01:50:07 +0900, Johannes Berg wrote: > > On Tue, 2024-12-03 at 13:23 +0900, Hajime Tazaki wrote: > > > > +++ b/arch/um/kernel/process.c > > @@ -117,13 +117,17 @@ void new_thread_handler(void) > > * callback returns only if the

Re: [PATCH v3 06/13] um: nommu: syscalls handler from userspace by seccomp filter

2024-12-05 Thread Hajime Tazaki
On Thu, 05 Dec 2024 01:42:11 +0900, Johannes Berg wrote: > > On Tue, 2024-12-03 at 13:23 +0900, Hajime Tazaki wrote: > > > > +#ifndef CONFIG_MMU > > +extern int um_zpoline_enabled; > > +#endif > > That doesn't make sense, there's no good rea

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

2024-12-05 Thread Hajime Tazaki
On Thu, 05 Dec 2024 01:20:51 +0900, Johannes Berg wrote: > > On Tue, 2024-12-03 at 13:23 +0900, Hajime Tazaki wrote: > > > > arch/um/include/asm/Kbuild | 1 + > > > > arch/x86/um/asm/module.h | 24 > > &g

Re: [PATCH v3 05/13] x86/um: nommu: syscall translation by zpoline

2024-12-05 Thread Hajime Tazaki
On Thu, 05 Dec 2024 01:37:42 +0900, Johannes Berg wrote: > > On Tue, 2024-12-03 at 13:23 +0900, Hajime Tazaki wrote: > > This commit adds a mechanism to hook syscalls for unmodified userspace > > programs used under UML in !MMU mode. The mechanism, called zpoline, > >

Re: [PATCH v3 03/13] um: nommu: memory handling

2024-12-05 Thread Hajime Tazaki
On Thu, 05 Dec 2024 01:34:49 +0900, Johannes Berg wrote: > > On Tue, 2024-12-03 at 13:23 +0900, Hajime Tazaki wrote: > > > > +++ b/arch/um/include/asm/futex.h > > @@ -8,7 +8,11 @@ > > > > > > int arch_futex_atomic_op_inuser(int op, u3

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

2024-12-05 Thread Hajime Tazaki
On Thu, 05 Dec 2024 01:37:14 +0900, Johannes Berg wrote: > > arch/x86/um/do_syscall_64.c | 37 +++ > > arch/x86/um/entry_64.S | 87 + > > > > As I said before, I think it needs to be something obviously nommu. > Maybe in a new direct

Re: [PATCH v3 00/13] nommu UML

2024-12-05 Thread Hajime Tazaki
Thanks Johannes, On Thu, 05 Dec 2024 01:20:04 +0900, Johannes Berg wrote: > > On Tue, 2024-12-03 at 13:22 +0900, Hajime Tazaki wrote: > > This is a series of patches of nommu arch addition to UML. > > Please next time you resend this, don't hide it in the old thread :)

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

2024-12-02 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 ++ arch/x86/um/Makefile | 18

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

2024-12-02 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 | 230 +++ MAINTAINERS | 1 + 2 files changed, 231 insertions(+) create mode 100644 Documentation/virt/uml

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

2024-12-02 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 v3 10/13] x86/um: nommu: signal handling

2024-12-02 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/os-Linux/signal.c | 16 +++- arch/x86/um/signal.c | 37 - 2 files changed, 51 insertions(+), 2 deletions

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

2024-12-02 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 v3 08/13] um: nommu: configure fs register on host syscall invocation

2024-12-02 Thread Hajime Tazaki
-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/um/include/shared/os.h | 3 ++ arch/um/os-Linux/main.c | 5 arch/um/os-Linux/process.c | 8 ++ arch/um/os-Linux/start_up.c | 20 + arch/x86/um/do_syscall_64.c | 36 +++ arch/x86/um

[PATCH v3 06/13] um: nommu: syscalls handler from userspace by seccomp filter

2024-12-02 Thread Hajime Tazaki
2) JIT-generated code. The SIGSYS signal is raised upon the execution from uml_reserved and 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 | 6

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

2024-12-02 Thread Hajime Tazaki
me of registers (fs segment register for TLS, etc) on every context switch, etc. Signals aren't delivered 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/kernel/process.c

[PATCH v3 05/13] x86/um: nommu: syscall translation by zpoline

2024-12-02 Thread Hajime Tazaki
) used by MMU-full UML. Signed-off-by: Hajime Tazaki --- arch/x86/um/asm/elf.h | 3 + arch/x86/um/zpoline.c | 223 ++ 2 files changed, 226 insertions(+) create mode 100644 arch/x86/um/zpoline.c diff --git a/arch/x86/um/asm/elf.h b/arch/x86/um/asm/elf.h

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

2024-12-02 Thread Hajime Tazaki
cture. Signed-off-by: Hajime Tazaki Signed-off-by: Ricardo Koller --- arch/x86/um/do_syscall_64.c | 37 +++ arch/x86/um/entry_64.S | 87 + arch/x86/um/shared/sysdep/syscalls_64.h | 6 ++ 3 files changed, 130 insertions(+) create mode 1

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

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

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

2024-12-02 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/Kbuild | 1 + arch/um/include/asm/mmu.h| 5 + arch/um/include/asm

[PATCH v3 01/13] fs: binfmt_elf_efpic: add architecture hook elf_arch_finalize_exec

2024-12-02 Thread Hajime Tazaki
Kara Cc: Eric Biederman Cc: Kees Cook Cc: linux-fsde...@vger.kernel.org Cc: linux...@kvack.org Signed-off-by: Hajime Tazaki --- fs/binfmt_elf_fdpic.c | 10 ++ include/linux/elf-fdpic.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/fs/binfmt_elf_fdpic.c b/fs

[PATCH v3 00/13] nommu UML

2024-12-02 Thread Hajime Tazaki
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): fs: binfmt_elf_efpic: add architecture hook elf_arch_finalize_exec x86/um: nommu: elf loader for

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

2024-11-30 Thread Hajime Tazaki
Hello, On Thu, 28 Nov 2024 19:37:21 +0900, Benjamin Berg wrote: > > +#ifndef CONFIG_MMU > > + memset(&r, 0, sizeof(r)); > > + /* mark is_user=1 when the IP is from userspace code. */ > > + if (mc && (REGS_IP(mc->gregs) > uml_reserved > > +    && REGS_IP(mc->gregs) < high_physmem)) > > + r.is_us

Re: [RFC PATCH v2 09/13] x86/um/vdso: nommu: vdso memory update

2024-11-27 Thread Hajime Tazaki
Thanks Benjamin, On Wed, 27 Nov 2024 19:36:44 +0900, Benjamin Berg wrote: > > @@ -51,9 +65,15 @@ __kernel_old_time_t > > __vdso_time(__kernel_old_time_t *t) > >  { > >   long secs; > >   > > +#ifdef CONFIG_MMU > >   asm volatile("syscall" > >   : "=a" (secs) > >   : "0"

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

2024-11-27 Thread Hajime Tazaki
On Wed, 27 Nov 2024 19:00:11 +0900, Benjamin Berg wrote: > > + > > + os_info("Checking FSGSBASE instructions..."); > > + if (sigsetjmp(jmpbuf, 0) == 0) { > > + asm volatile("rdfsbase %0" : "=r" (fsbase) :: "memory"); > > + host_has_fsgsbase = 1; > > + os_info("O

Re: [RFC PATCH v2 00/13] nommu UML

2024-11-23 Thread Hajime Tazaki
Hello David, On Sat, 23 Nov 2024 16:27:27 +0900, David Gow wrote: > I had a chance to give this a proper try with KUnit, and think it'd be > a great options to have available: it's certainly nice to have a fast, > easy nommu architecture for testing. thanks for the test. > I'd echo the commen

Re: [RFC PATCH v2 00/13] nommu UML

2024-11-15 Thread Hajime Tazaki
Hello Anton, thanks for the comment. On Fri, 15 Nov 2024 19:26:07 +0900, Anton Ivanov wrote: > > What do others think? Would you use it? What for? > > I always thought of it as "another LKL". In that case, it can be compared > to LKL on merit and if it is equivalent or better - go into kernel

Re: [RFC PATCH v2 00/13] nommu UML

2024-11-15 Thread Hajime Tazaki
-11 at 15:27 +0900, Hajime Tazaki wrote: > > This is a series of patches of nommu arch addition to UML. It would > > be nice to ask comments/opinions on this. > > So I've been thinking about this for a while now... thank you for your time ! > To be clear, I'm not

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

2024-11-14 Thread Hajime Tazaki
Hello Greg, On Thu, 14 Nov 2024 10:40:03 +0900, Greg Ungerer wrote: > I was only interested in the ability to run ELF based static/PIE binaries > when I did 782f4c5c44e7d99d ("m68knommu: allow elf_fdpic loader to be > selected"). > I did the same thing for RISC-V in commit 9549fb354ef1 ("riscv

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

2024-11-13 Thread Hajime Tazaki
On Wed, 13 Nov 2024 22:55:02 +0900, Geert Uytterhoeven wrote: > On Wed, Nov 13, 2024 at 2:17 PM Hajime Tazaki wrote: > > On Wed, 13 Nov 2024 19:27:08 +0900, > > Geert Uytterhoeven wrote: > > > On Wed, Nov 13, 2024 at 9:37 AM Johannes Berg > > > wrote: > >

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

2024-11-13 Thread Hajime Tazaki
Hello, thanks for the inputs Geert, Johannes, On Wed, 13 Nov 2024 19:27:08 +0900, Geert Uytterhoeven wrote: > > Hi Johannes, > > On Wed, Nov 13, 2024 at 9:37 AM Johannes Berg > wrote: > > On Wed, 2024-11-13 at 09:36 +0100, Johannes Berg wrote: > > > On Wed, 2024-11-13 at 09:19 +0100, Geert

  1   2   >