linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: x86/irq: Conditionally register IRQ bypass consumer again
@ 2023-07-24 11:12 Like Xu
  2023-07-29 14:40 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Like Xu @ 2023-07-24 11:12 UTC (permalink / raw)
  To: Alex Williamson, Sean Christopherson; +Cc: kvm, linux-kernel

From: Like Xu <likexu@tencent.com>

As commit 14717e203186 ("kvm: Conditionally register IRQ bypass consumer"):
"if we don't support a mechanism for bypassing IRQs, don't register as a
consumer. This eliminates meaningless dev_info()s when the connect fails
between producer and consumer", such as on Linux hosts where enable_apicv
or posted-interrupts capability is unsupported or globally disabled.

Cc: Alex Williamson <alex.williamson@redhat.com>
Reported-by: Yong He <alexyonghe@tencent.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217379
Signed-off-by: Like Xu <likexu@tencent.com>
---
 arch/x86/kvm/x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index a6b9bea62fb8..8b68a5cb3123 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -13185,7 +13185,7 @@ EXPORT_SYMBOL_GPL(kvm_arch_has_noncoherent_dma);
 
 bool kvm_arch_has_irq_bypass(void)
 {
-	return true;
+	return enable_apicv && irq_remapping_cap(IRQ_POSTING_CAP);
 }
 
 int kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *cons,
-- 
2.41.0


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

* Re: [PATCH] KVM: x86/irq: Conditionally register IRQ bypass consumer again
  2023-07-24 11:12 [PATCH] KVM: x86/irq: Conditionally register IRQ bypass consumer again Like Xu
@ 2023-07-29 14:40 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2023-07-29 14:40 UTC (permalink / raw)
  To: Like Xu; +Cc: Alex Williamson, Sean Christopherson, kvm, linux-kernel

Queued, thanks.  I tweaked the commit message to explain
that originally commit 14717e203186 disabled registration
of the consumer on AMD machines.

Paolo



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

end of thread, other threads:[~2023-07-29 14:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-24 11:12 [PATCH] KVM: x86/irq: Conditionally register IRQ bypass consumer again Like Xu
2023-07-29 14:40 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).