From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
To: Johannes Berg <johannes@sipsolutions.net>, linux-um@lists.infradead.org
Subject: Re: [PATCH v10] um: Enable preemption in UML
Date: Tue, 2 Jul 2024 11:07:46 +0100 [thread overview]
Message-ID: <2c584137-211b-4746-bb6b-ebdec4c486af@cambridgegreys.com> (raw)
In-Reply-To: <20240702102549.d2fcea450854.I12f5a53d80ec1e425e66ef272b1e95cb523b608e@changeid>
On 02/07/2024 09:25, Johannes Berg wrote:
> From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
>
> 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>
> [vastly simplify, fix x86/um Makefile, rewrite commit message]
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> v10:
> - rebase on top of various other patchsets, including Benjamin's
> page table updates: https://patchwork.ozlabs.org/project/linux-um/list/?series=408104
> - fix x86/um Makefile
> - remove FPU save/restore code since it's not needed
> ---
> arch/um/Kconfig | 2 +-
> arch/um/kernel/irq.c | 2 ++
> arch/x86/um/Makefile | 1 -
> 3 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/um/Kconfig b/arch/um/Kconfig
> index 1faefc0a18ea..dca84fd6d00a 100644
> --- a/arch/um/Kconfig
> +++ b/arch/um/Kconfig
> @@ -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
> diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
> index ceda4bd2e5ed..534e91797f89 100644
> --- a/arch/um/kernel/irq.c
> +++ b/arch/um/kernel/irq.c
> @@ -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)
> diff --git a/arch/x86/um/Makefile b/arch/x86/um/Makefile
> index 17b85209c43d..36e67fc97c22 100644
> --- a/arch/x86/um/Makefile
> +++ b/arch/x86/um/Makefile
> @@ -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
>
Is that all we have left? I lost track of your mm patches and they do not apply cleanly to master at present.
Otherwise, the fpu-less on top of the older mm works fine for me. Testing it at the moment.
--
Anton R. Ivanov
Cambridgegreys Limited. Registered in England. Company Number 10273661
https://www.cambridgegreys.com/
next prev parent reply other threads:[~2024-07-02 10:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 8:25 [PATCH v10] um: Enable preemption in UML Johannes Berg
2024-07-02 10:07 ` Anton Ivanov [this message]
2024-07-02 10:18 ` Johannes Berg
2024-07-02 10:20 ` Johannes Berg
2024-07-02 10:21 ` Anton Ivanov
2024-07-02 10:24 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c584137-211b-4746-bb6b-ebdec4c486af@cambridgegreys.com \
--to=anton.ivanov@cambridgegreys.com \
--cc=johannes@sipsolutions.net \
--cc=linux-um@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox