Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH] KVM: x86/xen: Use read_trylock() for GPC locks in hardirq paths
@ 2026-08-07 12:19 sai madhu
  2026-08-07 12:19 ` sai madhu
  0 siblings, 1 reply; 3+ messages in thread
From: sai madhu @ 2026-08-07 12:19 UTC (permalink / raw)
  To: kvm; +Cc: dwmw2, seanjc, pbonzini, syzbot+919877893c9d28162dc2, sai madhu

Hi KVM maintainers,

This patch fixes a lockdep WARNING in kvm_xen_set_evtchn_fast() when
called from xen_timer_callback() in hard IRQ context.

Bug report:
  https://syzkaller.appspot.com/bug?extid=919877893c9d28162dc2

Observed crash (unpatched):
  [ BUG: Invalid wait context ]
  (&gpc->lock) at kvm_xen_set_evtchn_fast+0x1fb
  context-{2:2}  (hard IRQ, from xen_timer_callback)

Fix:
  Use read_trylock() on gpc->lock and return -EWOULDBLOCK on failure.
  The existing slow path (timer_pending + kvm_xen_inject_timer_irqs)
  handles deferred delivery safely in vcpu_run context.

This patch is based on David Woodhouse's May 2026 series (patch 3/7).
I reproduced the syzbot C repro on x86_64 with nested KVM:

  Unpatched bzImage-b69053dd: 1x lockdep BUG at ~69s
  Patched bzImage-xen-fix:    0x lockdep BUG (same repro)

Tested-by: sai madhu <suryasaimadhu369@gmail.com>

Thanks,
sai madhu

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-07 12:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 12:19 [PATCH] KVM: x86/xen: Use read_trylock() for GPC locks in hardirq paths sai madhu
2026-08-07 12:19 ` sai madhu
2026-08-07 12:28   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox