]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86/xen: don't block on pfncache locks in kvm_xen_set_evtchn_fast()
authorPaul Durrant <pdurrant@amazon.com>
Mon, 4 Dec 2023 10:06:08 +0000 (10:06 +0000)
committerPaul Durrant <pdurrant@amazon.com>
Thu, 15 Feb 2024 09:55:51 +0000 (09:55 +0000)
commita2adcd124ff47d4f1692f4ca4859e795fe771031
tree0065f80882fd024963688f42ef2518cb6917eea0
parent203de18768ff37b67041055ef6d987afaad7d070
KVM: x86/xen: don't block on pfncache locks in kvm_xen_set_evtchn_fast()

As described in [1] compiling with CONFIG_PROVE_RAW_LOCK_NESTING shows that
kvm_xen_set_evtchn_fast() is blocking on pfncache locks in IRQ context.
There is only actually blocking with PREEMPT_RT because the locks will
turned into mutexes. There is no 'raw' version of rwlock_t that can be used
to avoid that, so use read_trylock() and treat failure to lock the same as
an invalid cache.

[1] https://lore.kernel.org/lkml/99771ef3a4966a01fefd3adbb2ba9c3a75f97cf2.camel@infradead.org/T/#mbd06e5a04534ce9c0ee94bd8f1e8d942b2d45bd6

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
---
Cc: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: x86@kernel.org
v13:
 - Patch title change.

v11:
 - Amended the commit comment.

v10:
 - New in this version.
arch/x86/kvm/xen.c