[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aEt1aXPhivCJZbyE@google.com>
Date: Thu, 12 Jun 2025 17:48:41 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Kai Huang <kai.huang@...el.com>
Cc: "pbonzini@...hat.com" <pbonzini@...hat.com>, "vkuznets@...hat.com" <vkuznets@...hat.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 04/18] KVM: x86: Drop superfluous kvm_hv_set_sint() =>
kvm_hv_synic_set_irq() wrapper
On Thu, Jun 12, 2025, Kai Huang wrote:
> On Wed, 2025-06-11 at 14:35 -0700, Sean Christopherson wrote:
> > Drop the superfluous kvm_hv_set_sint() and instead wire up ->set() directly
> > to its final destination, kvm_hv_synic_set_irq(). Keep hv_synic_set_irq()
> > instead of kvm_hv_set_sint() to provide some amount of consistency in the
> > ->set() helpers, e.g. to match kvm_pic_set_irq() and kvm_ioapic_set_irq().
> >
> > kvm_set_msi() is arguably the oddball, e.g. kvm_set_msi_irq() should be
> > something like kvm_msi_to_lapic_irq() so that kvm_set_msi() can instead be
> > kvm_set_msi_irq(), but that's a future problem to solve.
>
> Agreed on kvm_msi_to_lapic_irq(), but isn't kvm_msi_set_irq() a matter match
> to kvm_{pic/ioapic/hv_synic}_set_irq()? :-)
Yes, the problem is that kvm_set_msi() is used by common code, i.e. could actually
be kvm_arch_set_msi_irq(). I'm not entirely sure churning _that_ much code is
worth the marginal improvement in readability.
$ git grep -w kvm_set_msi
arch/arm64/kvm/vgic/vgic-irqfd.c: e->set = kvm_set_msi;
arch/arm64/kvm/vgic/vgic-irqfd.c: * kvm_set_msi: inject the MSI corresponding to the
arch/arm64/kvm/vgic/vgic-irqfd.c:int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
arch/loongarch/kvm/irqfd.c: * kvm_set_msi: inject the MSI corresponding to the
arch/loongarch/kvm/irqfd.c:int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
arch/loongarch/kvm/irqfd.c: e->set = kvm_set_msi;
arch/powerpc/kvm/mpic.c:int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
arch/powerpc/kvm/mpic.c: e->set = kvm_set_msi;
arch/riscv/kvm/vm.c:int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
arch/riscv/kvm/vm.c: e->set = kvm_set_msi;
arch/riscv/kvm/vm.c: return kvm_set_msi(e, kvm, irq_source_id, level, line_status);
arch/s390/kvm/interrupt.c:int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e, struct kvm *kvm,
arch/x86/kvm/irq_comm.c:int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
arch/x86/kvm/irq_comm.c: e->set = kvm_set_msi;
include/linux/kvm_host.h:int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm,
virt/kvm/irqchip.c: return kvm_set_msi(&route, kvm, KVM_USERSPACE_IRQ_SOURCE_ID, 1, false);
Powered by blists - more mailing lists