Re: [PATCH v1] kbuild: Allow building of samples with UML

2025-02-10 Thread Nicolas Schier
On Wed, Dec 18, 2024 at 12:51:23PM +0100, Mickaël Salaün wrote: > It's useful to build samples/* with UML and the only blocker is the > artificial incompatibility with CONFIG_HEADERS_INSTALL. > > Allow the headers_install target with ARCH=um, which then allow building > samples (and tests using th

Re: [PATCH] um: add back support for FXSAVE registers

2025-02-10 Thread SeongJae Park
On Tue, 7 Jan 2025 13:07:58 -0800 SeongJae Park wrote: > Hello, > > On Wed, 4 Dec 2024 08:48:27 +0100 Benjamin Berg > wrote: > > > From: Benjamin Berg > > > > It was reported that qemu may not enable the XSTATE CPU extension, which > > is a requirement after commit 3f17fed21491 ("um: switc

[PATCH 1/2] um: mark rodata read-only and implement _nofault accesses

2025-02-10 Thread Benjamin Berg
From: Johannes Berg Mark read-only data actually read-only (simple mprotect), and to be able to test it also implement _nofault accesses. This works by setting up a new "segv_continue" pointer in current, and then when we hit a segfault we change the signal return context so that we continue at t

[PATCH 0/2] Remove incorrect host mincore call and add rodata handling

2025-02-10 Thread Benjamin Berg
From: Benjamin Berg Hi, using mincore() to check whether a page is owned by UML is not correct as it returns whether the page is resident in memory and not whether something has been mapped at the address. This means that UML could get spurious failures in *_nofault functions like copy_from_kern

[PATCH 2/2] um: remove copy_from_kernel_nofault_allowed

2025-02-10 Thread Benjamin Berg
From: Benjamin Berg There is no need to override the default version of this function anymore as UML now has proper _nofault memory access functions. Doing this also fixes the fact that the implementation was incorrect as using mincore() will incorrectly flag pages as inaccessible if they were s

[PATCH v5 4/7] syscall.h: introduce syscall_set_nr()

2025-02-10 Thread Dmitry V. Levin
Similar to syscall_set_arguments() that complements syscall_get_arguments(), introduce syscall_set_nr() that complements syscall_get_nr(). syscall_set_nr() is going to be needed along with syscall_set_arguments() on all HAVE_ARCH_TRACEHOOK architectures to implement PTRACE_SET_SYSCALL_INFO API. S

[PATCH v5 3/7] syscall.h: add syscall_set_arguments()

2025-02-10 Thread Dmitry V. Levin
This function is going to be needed on all HAVE_ARCH_TRACEHOOK architectures to implement PTRACE_SET_SYSCALL_INFO API. This partially reverts commit 7962c2eddbfe ("arch: remove unused function syscall_set_arguments()") by reusing some of old syscall_set_arguments() implementations. Signed-off-by:

[PATCH v5 0/7] ptrace: introduce PTRACE_SET_SYSCALL_INFO API

2025-02-10 Thread Dmitry V. Levin
PTRACE_SET_SYSCALL_INFO is a generic ptrace API that complements PTRACE_GET_SYSCALL_INFO by letting the ptracer modify details of system calls the tracee is blocked in. This API allows ptracers to obtain and modify system call details in a straightforward and architecture-agnostic way, providing a

Re: [PATCH 1/2] rust: pass correct target to bindgen on Usermode Linux

2025-02-10 Thread David Gow
On Sat, 8 Feb 2025 at 21:32, Thomas Weißschuh wrote: > > Usermode Linux uses "um" as primary architecture name and the underlying > physical architecture is provided in "SUBARCH". > Resolve the target architecture flags through that underlying architecture. > This is the same pattern as used by sc

[PATCH] arch: um: Pass the correct Rust target and options with gcc

2025-02-10 Thread David Gow
In order to work around some issues with disabling SSE on older versions of gcc (compilation would fail upon seeing a function declaration containing a float, even if it was never called or defined), the corresponding CFLAGS and RUSTFLAGS were only set when using clang. However, this led to two pr