Re: [PATCH] KVM: x86/xen: bail in IRQ context on PREEMPT_RT in kvm_xen_set_evtchn_fast()

From: David Woodhouse

Date: Thu May 07 2026 - 09:07:32 EST


On Thu, 2026-05-07 at 09:12 +0200, Sebastian Andrzej Siewior wrote:
>
> So the cited patch does not look bad. That read-trylock should be fine
> on RT (as in I don't see anything wrong with it). What did happen to it?

The read_trylock() may be fine... but does a read_unlock() try to
"re-enable" hardirqs?

[ 112.266981] ------------[ cut here ]------------
[ 112.266987] DEBUG_LOCKS_WARN_ON(lockdep_hardirq_context())
[ 112.266990] WARNING: kernel/locking/lockdep.c:4404 at lockdep_hardirqs_on_prepare.part.0+0xca/0x140, CPU#139: swapper/139/0
[ 112.267010] Modules linked in: binfmt_misc cfg80211 rfkill 8021q garp mrp stp llc vfat fat spi_nor pmt_telemetry mtd iTCO_wdt pmt_discovery intel_pmc_bxt pmt_class intel_sdsi intel_rapl_msr intel_rapl_common intel_uncore_frequency intel_uncore_frequency_common intel_ifs i10nm_edac skx_edac_common nfit libnvdimm ena x86_pkg_temp_thermal intel_powerclamp coretemp rapl intel_cstate snd_pcm snd_timer snd intel_uncore soundcore pcspkr dax_hmem isst_if_mbox_pci isst_if_mmio isst_if_common intel_vsec spi_intel_pci i2c_i801 spi_intel i2c_smbus i2c_ismt nfnetlink lz4hc_compress lz4_compress iaa_crypto nvme nvme_core nvme_keyring nvme_auth pinctrl_emmitsburg wmi qat_4xxx intel_qat idxd crc8 idxd_bus fuse
[ 112.267088] CPU: 139 UID: 0 PID: 0 Comm: swapper/139 Not tainted 7.1.0-rc2+ #13 PREEMPT_{RT,LAZY}
[ 112.267096] Hardware name: Amazon EC2 c7i.metal-48xl/Not Specified, BIOS 1.0 10/16/2017
[ 112.267099] RIP: 0010:lockdep_hardirqs_on_prepare.part.0+0xd1/0x140
[ 112.267107] Code: 00 00 00 5b c3 cc cc cc cc e8 eb e5 8b 00 85 c0 74 cf 8b 15 11 b5 62 02 85 d2 75 c5 48 8d 3d 66 54 64 02 48 c7 c6 40 4f 7e b4 <67> 48 0f b9 3a 5b c3 cc cc cc cc e8 bf e5 8b 00 85 c0 74 a3 44 8b
[ 112.267112] RSP: 0018:ff60c0a7cf974df8 EFLAGS: 00010046
[ 112.267118] RAX: 0000000000000001 RBX: ff251118e4165cf0 RCX: 0000000000000001
[ 112.267122] RDX: 0000000000000000 RSI: ffffffffb47e4f40 RDI: ffffffffb4fcd6a0
[ 112.267125] RBP: ff60c0a7cf974e70 R08: 0000000000000001 R09: 0000000000000000
[ 112.267127] R10: 0000000000000000 R11: 0000000000000001 R12: ff251118e4166530
[ 112.267130] R13: ff251118e4166548 R14: ff251118e5d82bc0 R15: 0000000000000000
[ 112.267134] FS: 0000000000000000(0000) GS:ff2511184a123000(0000) knlGS:0000000000000000
[ 112.267138] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 112.267142] CR2: 0000000000000000 CR3: 000000535ee7c004 CR4: 0000000000f73ef0
[ 112.267146] PKRU: 55555554
[ 112.267148] Call Trace:
[ 112.267151] <IRQ>
[ 112.267156] trace_hardirqs_on+0x18/0x100
[ 112.267172] ? lock_release.part.0+0x1c/0x50
[ 112.267179] _raw_spin_unlock_irq+0x28/0x50
[ 112.267193] rt_read_unlock+0x1a2/0x290
[ 112.267202] kvm_xen_set_evtchn_fast+0x347/0x480
[ 112.267217] ? __lock_release.isra.0+0x59/0x170
[ 112.267224] ? __pfx_xen_timer_callback+0x10/0x10
[ 112.267231] xen_timer_callback+0x8c/0xd0
[ 112.267239] __hrtimer_run_queues+0x86/0x3b0
[ 112.267253] hrtimer_interrupt+0x115/0x240

Attachment: smime.p7s
Description: S/MIME cryptographic signature