Skip to content

Commit cd01672

Browse files
kot-begemot-ukjmberg-intel
authored andcommitted
um: Enable preemption in UML
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 <[email protected]> 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 <[email protected]>
1 parent bcf3d95 commit cd01672

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

arch/um/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ config UML
1111
select ARCH_HAS_KCOV
1212
select ARCH_HAS_STRNCPY_FROM_USER
1313
select ARCH_HAS_STRNLEN_USER
14-
select ARCH_NO_PREEMPT
14+
select ARCH_NO_PREEMPT_DYNAMIC
1515
select HAVE_ARCH_AUDITSYSCALL
1616
select HAVE_ARCH_KASAN if X86_64
1717
select HAVE_ARCH_KASAN_VMALLOC if HAVE_ARCH_KASAN

arch/um/kernel/irq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ static void _sigio_handler(struct uml_pt_regs *regs,
238238

239239
void sigio_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs)
240240
{
241+
preempt_disable();
241242
_sigio_handler(regs, irqs_suspended);
243+
preempt_enable();
242244
}
243245

244246
static struct irq_entry *get_irq_entry_by_fd(int fd)

arch/x86/um/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ obj-y += syscalls_64.o vdso/
3131

3232
subarch-y = ../lib/csum-partial_64.o ../lib/memcpy_64.o \
3333
../lib/memmove_64.o ../lib/memset_64.o
34-
subarch-$(CONFIG_PREEMPTION) += ../entry/thunk_64.o
3534

3635
endif
3736

0 commit comments

Comments
 (0)