From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Koichiro Den <den@valinux.co.jp>
Cc: Anup Patel <anup@brainfault.org>,
Atish Patra <atish.patra@linux.dev>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
kvm@vger.kernel.org, kvm-riscv@lists.infradead.org,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH] RISC-V: KVM: Run vCPU timer callbacks in hardirq context on RT
Date: Wed, 18 Nov 2026 08:13:14 +0100 [thread overview]
Message-ID: <20261118071314.NJWhnli-@linutronix.de> (raw)
In-Reply-To: <20261118062104.2912910-1-den@valinux.co.jp>
On 2026-11-18 15:21:04 [+0900], Koichiro Den wrote:
> On hosts with Sstc, kvm_arch_vcpu_load() cancels the vCPU wakeup hrtimer
> with preemption disabled, including when called from sched-in preemption
> notifier. The vCPU reset path also cancels the timer under get_cpu(),
> with or without Sstc.
>
> On PREEMPT_RT, these callbacks run in softirq thread context, so
> hrtimer_cancel() may sleep waiting for a running callback, which is
> invalid with preemption disabled.
>
> Let the callbacks run in hardirq context on -RT. They only rearm the
> timer, update interrupt state under a raw spinlock, and kick the vCPU.
> Similar to commit 9090825fa997 ("KVM: arm/arm64: Let the timer expire in
> hardirq context on RT").
>
> Cc: stable@vger.kernel.org
> Fixes: 3e1d86569c21 ("RISC-V: KVM: Add SBI HSM extension in KVM")
> Fixes: 8f5cb44b1bae ("RISC-V: KVM: Support sstc extension")
> Signed-off-by: Koichiro Den <den@valinux.co.jp>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Sebastian
prev parent reply other threads:[~2026-11-18 7:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 6:21 Koichiro Den
2026-11-18 7:13 ` Sebastian Andrzej Siewior [this message]
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=20261118071314.NJWhnli-@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=alex@ghiti.fr \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=atish.patra@linux.dev \
--cc=clrkwllms@kernel.org \
--cc=den@valinux.co.jp \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=rostedt@goodmis.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
all inboxes | Powered by JetHome®