All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Kai Huang <kai.huang@intel.com>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
	"vkuznets@redhat.com" <vkuznets@redhat.com>,
	 "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 04/18] KVM: x86: Drop superfluous kvm_hv_set_sint() => kvm_hv_synic_set_irq() wrapper
Date: Thu, 12 Jun 2025 17:48:41 -0700	[thread overview]
Message-ID: <aEt1aXPhivCJZbyE@google.com> (raw)
In-Reply-To: <44cb77805d1d05f7a28a50fc16e4d2d73aca88f3.camel@intel.com>

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);

  reply	other threads:[~2025-06-13  0:48 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 21:35 [PATCH v2 00/18] KVM: x86: Add I/O APIC kconfig, delete irq_comm.c Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 01/18] KVM: x86: Trigger I/O APIC route rescan in kvm_arch_irq_routing_update() Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 02/18] KVM: x86: Drop superfluous kvm_set_pic_irq() => kvm_pic_set_irq() wrapper Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 03/18] KVM: x86: Drop superfluous kvm_set_ioapic_irq() => kvm_ioapic_set_irq() wrapper Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 04/18] KVM: x86: Drop superfluous kvm_hv_set_sint() => kvm_hv_synic_set_irq() wrapper Sean Christopherson
2025-06-12  2:38   ` Huang, Kai
2025-06-13  0:48     ` Sean Christopherson [this message]
2025-06-13  1:41       ` Huang, Kai
2025-06-13 14:22         ` Sean Christopherson
2025-06-18  9:02   ` Vitaly Kuznetsov
2025-06-11 21:35 ` [PATCH v2 05/18] KVM: x86: Move PIT ioctl helpers to i8254.c Sean Christopherson
2025-06-12  2:09   ` Huang, Kai
2025-06-13  0:49     ` Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 06/18] KVM: x86: Move KVM_{GET,SET}_IRQCHIP ioctl helpers to irq.c Sean Christopherson
2025-06-12  2:20   ` Huang, Kai
2025-06-13  0:52     ` Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 07/18] KVM: x86: Rename irqchip_kernel() to irqchip_full() Sean Christopherson
2025-06-12  2:24   ` Huang, Kai
2025-06-13  0:53     ` Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 08/18] KVM: x86: Move kvm_setup_default_irq_routing() into irq.c Sean Christopherson
2025-06-12  2:27   ` Huang, Kai
2025-06-11 21:35 ` [PATCH v2 09/18] KVM: x86: Move kvm_{request,free}_irq_source_id() to i8254.c (PIT) Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 10/18] KVM: x86: Hardcode the PIT IRQ source ID to '2' Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 11/18] KVM: x86: Don't clear PIT's IRQ line status when destroying PIT Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 12/18] KVM: x86: Explicitly check for in-kernel PIC when getting ExtINT Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 13/18] KVM: Move x86-only tracepoints to x86's trace.h Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 14/18] KVM: x86: Add CONFIG_KVM_IOAPIC to allow disabling in-kernel I/O APIC Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 15/18] KVM: Squash two CONFIG_HAVE_KVM_IRQCHIP #ifdefs into one Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 16/18] KVM: selftests: Fall back to split IRQ chip if full in-kernel chip is unsupported Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 17/18] KVM: x86: Move IRQ mask notifier infrastructure to I/O APIC emulation Sean Christopherson
2025-06-11 21:35 ` [PATCH v2 18/18] KVM: x86: Fold irq_comm.c into irq.c Sean Christopherson
2025-06-24 19:38 ` [PATCH v2 00/18] KVM: x86: Add I/O APIC kconfig, delete irq_comm.c Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aEt1aXPhivCJZbyE@google.com \
    --to=seanjc@google.com \
    --cc=kai.huang@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.