[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
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 stack usage on vfork(2) syscall is different. It also adds the follow up routine for SIGS

[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(-) diff

[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/nom

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

2024-12-08 Thread Hajime Tazaki
This commit introduces an entry point of syscall interface for !MMU mode. It uses an entry function, __kernel_vsyscall, a kernel-wide global symbol accessible from any locations. Although it isn't in the scope of this commit, it can be also exposed via vdso image which is directly accessible from

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

2024-12-08 Thread Hajime Tazaki
As userspace on UML/!MMU also need to configure %fs register when it is running to correctly access thread structure, host syscalls implemented in os-Linux drivers may be puzzled when they are called. Thus it has to configure %fs register via arch_prctl(SET_FS) on every host syscalls. Signed-off-

[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/x

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

2024-12-08 Thread Hajime Tazaki
Since ptrace facility isn't used under !MMU of UML, there is different code path to invoke processes/threads; on an entry to the syscall interface, the stack pointer should be manipulated to handle vfork(2) return address, no external process is used, and need to properly configure some of register

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

2024-12-08 Thread Hajime Tazaki
This commit adds syscall hook with seccomp. Using seccomp raises SIGSYS to UML process, which is captured in the (UML) kernel, then call the syscall entry point, __kernel_vsyscall, to hook the original syscall instructions. The SIGSYS signal is raised upon the execution from uml_reserved and high

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

2024-12-08 Thread Hajime Tazaki
This commit adds memory operations on UML under !MMU environment. Some part of the original UML code relying on CONFIG_MMU are excluded from compilation when !CONFIG_MMU. Additionally, generic functions such as uaccess, futex, memcpy/strnlen/strncpy can be used as user- and kernel-space share the

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

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

2024-12-08 Thread Hajime Tazaki
As UML supports CONFIG_MMU=n case, it has to use an alternate ELF loader, FDPIC ELF loader. In this commit, we added necessary definitions in the arch, as UML has not been used so far. It also updates Kconfig file to use BINFMT_ELF_FDPIC under !MMU environment. Cc: Eric Biederman Cc: Kees Cook

[PATCH v4 00/13] nommu UML

2024-12-08 Thread Hajime Tazaki
This is a series of patches of nommu arch addition to UML. It would be nice to ask comments/opinions on this. There are still several limitations/issues which we already found; here is the list of those issues. - memory mapped by loadable modules are not distinguished from userspace memory. -

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
This is a series of patches of nommu arch addition to UML. It would be nice to ask comments/opinions on this. There are still several limitations/issues which we already found; here is the list of those issues. - memory mapped by loadable modules are not distinguished from userspace memory. -