All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yang Luohan" <ylh440104@gmail.com>, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: x86/xen: defer timer event delivery on PREEMPT_RT
Date: Thu, 03 Dec 2026 09:35:16 +0000	[thread overview]
Message-ID: <sashiko-outbox-247465@kernel.org> (raw)
In-Reply-To: <179628948570.2061.8987479680072097733@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] KVM: x86/xen: missing Fixes trailer for commit 77c9b9dea4fb
--

commit 21cb04c9f920ff2e2b8066f225f0bcf72b648f06
Author: Yang Luohan <ylh440104@gmail.com>

> KVM: x86/xen: defer timer event delivery on PREEMPT_RT
>
> xen_timer_callback() runs from an hrtimer, so it executes with interrupts
> disabled. It calls kvm_xen_set_evtchn_fast(), which acquires gpc->lock with
> read_lock_irqsave(). On PREEMPT_RT rwlock_t is a sleeping lock, and taking
> it in that context reports:
>
>   BUG: sleeping function called from invalid context at
>        kernel/locking/spinlock_rt.c:248
>   in_atomic(): 1, irqs_disabled(): 1
>   kvm_xen_set_evtchn_fast
>   xen_timer_callback
>
> The callback already handles -EWOULDBLOCK by recording the pending timer
> and raising KVM_REQ_UNBLOCK, and the delivery is then completed from
> vCPU context by kvm_xen_inject_timer_irqs(). On PREEMPT_RT, skip the
> fast path and let that deferred path run instead of taking a sleeping
> lock from hardirq context.
>
> Signed-off-by: Yang Luohan <ylh440104@gmail.com>

[Severity: Low]
This fixes a sleeping-in-invalid-context bug on PREEMPT_RT introduced
when xen_timer_callback() started calling kvm_xen_set_evtchn_fast().
Should this include:

  Fixes: 77c9b9dea4fb ("KVM: x86/xen: Use fast path for Xen timer delivery")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/179628948570.2061.8987479680072097733@gmail.com?part=1

  reply	other threads:[~2026-12-03  9:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  9:18 [PATCH] KVM: x86/xen: defer timer event delivery on PREEMPT_RT Yang Luohan
2026-12-03  9:35 ` sashiko-bot [this message]
2026-12-03 11:00 ` [PATCH v2] " Yang Luohan
2026-12-03 15:13   ` Sean Christopherson
2026-12-03 15:20     ` David Woodhouse
2026-12-03 21:08       ` Sean Christopherson
2026-12-04  9:02         ` David Woodhouse

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=sashiko-outbox-247465@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=ylh440104@gmail.com \
    /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.