From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Xenomai <xenomai@lists.linux.dev>,
Florian Bezdeka <florian.bezdeka@siemens.com>
Subject: Re: [PATCH] x86: dovetail: Harden __send_ipi_mask for KVM guests
Date: Mon, 24 Feb 2025 18:15:40 +0100 [thread overview]
Message-ID: <87plj72rib.fsf@xenomai.org> (raw)
In-Reply-To: <eeca1faa-bf32-47c9-aba7-fa197034dcac@siemens.com> (Jan Kiszka's message of "Mon, 24 Feb 2025 17:44:45 +0100")
Jan Kiszka <jan.kiszka@siemens.com> writes:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This function is called in case paravirtual IPIs of a KVM host are used.
> Just like for hard submission handlers, we need to harden the path to
> avoid splashes like these:
>
> IRQ pipeline: some code running in oob context 'Xenomai'
> called an in-band only routine
> CPU: 0 PID: 410 Comm: (udev-worker) Not tainted 5.10.229-cip54+ #265
> Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014
> IRQ stage: Xenomai
> Call Trace:
> dump_stack+0x84/0x9c
> inband_irq_save+0xa/0x30
> __send_ipi_mask+0x81/0x260
> ? preempt_count_sub+0x96/0xe0
> ? _raw_spin_unlock_irq+0x33/0x50
> ? xnsched_pick_next+0xe0/0xe0
> ? ___xnsched_run+0x491/0x5b0
> ? ktime_get_mono_fast_ns+0x50/0xb0
> ___xnsched_run+0x491/0x5b0
> run_oob_call+0x97/0x170
> xnthread_start+0x23f/0x330
> ? rt_stack_deliver+0x340/0x340 [rtnet]
> rtdm_task_init.part.14+0x7e/0xc0
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> arch/x86/kernel/kvm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index 5df1061fc6ee1..b183caf41aa44 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -525,7 +525,7 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector)
> if (cpumask_empty(mask))
> return;
>
> - local_irq_save(flags);
> + flags = hard_local_irq_save();
>
> switch (vector) {
> default:
> @@ -563,7 +563,7 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector)
> ret);
> }
>
> - local_irq_restore(flags);
> + hard_local_irq_restore(flags);
> }
>
> static void kvm_send_ipi_mask(const struct cpumask *mask, int vector)
Ack.
--
Philippe.
next prev parent reply other threads:[~2025-02-24 17:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 16:44 [PATCH] x86: dovetail: Harden __send_ipi_mask for KVM guests Jan Kiszka
2025-02-24 17:15 ` Philippe Gerum [this message]
2025-02-24 17:23 ` Florian Bezdeka
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=87plj72rib.fsf@xenomai.org \
--to=rpm@xenomai.org \
--cc=florian.bezdeka@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=xenomai@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.