]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
um: Enable preemption in UML
authorAnton Ivanov <anton.ivanov@cambridgegreys.com>
Tue, 2 Jul 2024 08:25:50 +0000 (10:25 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 3 Jul 2024 15:10:43 +0000 (17:10 +0200)
Since userspace state is saved in the MM process, kernel using
FPU still doesn't really need to do anything, so this really
is as simple as enabling preemption. The irq critical section
in sigio_handler() needs preempt_disable()/preempt_enable().

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Link: https://patch.msgid.link/20240702102549.d2fcea450854.I12f5a53d80ec1e425e66ef272b1e95cb523b608e@changeid
[rebase, remove FPU save/restore, fix x86/um Makefile,
 rewrite commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/Kconfig
arch/um/kernel/irq.c
arch/x86/um/Makefile

index 1faefc0a18eac63df85a7cc1fbb8b1caa7cec7d5..dca84fd6d00a5079b16a49ff814e38ee757243ae 100644 (file)
@@ -11,7 +11,7 @@ config UML
        select ARCH_HAS_KCOV
        select ARCH_HAS_STRNCPY_FROM_USER
        select ARCH_HAS_STRNLEN_USER
-       select ARCH_NO_PREEMPT
+       select ARCH_NO_PREEMPT_DYNAMIC
        select HAVE_ARCH_AUDITSYSCALL
        select HAVE_ARCH_KASAN if X86_64
        select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN
index ceda4bd2e5ed198688e4fc572ab70342d1b3cc03..534e91797f89275d8a2d29ff062493a9f84531a2 100644 (file)
@@ -238,7 +238,9 @@ static void _sigio_handler(struct uml_pt_regs *regs,
 
 void sigio_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs)
 {
+       preempt_disable();
        _sigio_handler(regs, irqs_suspended);
+       preempt_enable();
 }
 
 static struct irq_entry *get_irq_entry_by_fd(int fd)
index 17b85209c43d5c8e7cca79909e78929ad4025f0f..36e67fc97c22fd0702c5a29162820f18e4331055 100644 (file)
@@ -31,7 +31,6 @@ obj-y += syscalls_64.o vdso/
 
 subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o \
        ../lib/memmove_64.o ../lib/memset_64.o
-subarch-$(CONFIG_PREEMPTION) += ../entry/thunk_64.o
 
 endif