From: sashiko-bot@kernel.org
To: "Jinqian Yang" <yangjinqian1@huawei.com>, kvmarm@lists.linux.dev
Cc: "Oliver Upton" <oupton@kernel.org>, "Marc Zyngier" <maz@kernel.org>
Subject: Re: [PATCH v2] KVM: arm64: Register irq_bypass consumers only when direct MSIs are possible
Date: Fri, 13 Nov 2026 10:01:05 +0000 [thread overview]
Message-ID: <sashiko-outbox-212593@kernel.org> (raw)
In-Reply-To: <20261113093840.1034795-1-yangjinqian1@huawei.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] KVM: arm64: irq_bypass skipped if vITS is created after
KVM_IRQFD
--
commit 3a0bd42f42a6d2802fe72bb1bc5c8b719382be8f
Author: Jinqian Yang <yangjinqian1@huawei.com>
KVM: arm64: Register irq_bypass consumers only when direct MSIs are possible
This commit passes struct kvm to kvm_arch_has_irq_bypass() and gates
arm64 irq_bypass consumer registration on vgic_supports_direct_msis(kvm).
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index 97332ffcb1300..da86646b67097 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -1742,9 +1742,9 @@ void kvm_set_vm_id_reg(struct kvm *kvm, u32 reg, u64 val);
> #define kvm_has_sctlr2(k) \
> (kvm_has_feat((k), ID_AA64MMFR3_EL1, SCTLRX, IMP))
>
> -static inline bool kvm_arch_has_irq_bypass(void)
> +static inline bool kvm_arch_has_irq_bypass(struct kvm *kvm)
> {
> - return true;
> + return vgic_supports_direct_msis(kvm);
> }
>
> void kvm_idregs_enforce_dependencies(struct kvm *kvm);
[Severity: Medium]
Can kvm_irqfd_assign() skip irq_bypass_register_consumer() when userspace
creates the virtual ITS after initializing the VGICv3 distributor and
assigning irqfds?
kvm_irqfd_assign() only requires kvm_arch_intc_initialized(kvm)
(vgic_initialized(kvm)) and evaluates kvm_arch_has_irq_bypass(kvm) once
without holding kvm->arch.config_lock. vgic_supports_direct_msis(kvm)
checks vgic_has_its(kvm), which tests dist->its_model, but vgic_its_create()
explicitly allows creating a KVM_DEV_TYPE_ARM_VGIC_ITS device after the
VGIC is already initialized:
arch/arm64/kvm/vgic/vgic-its.c:vgic_its_create() {
...
if (vgic_initialized(dev->kvm)) {
ret = vgic_v4_init(dev->kvm);
...
dev->kvm->arch.vgic.msis_require_devid = true;
dev->kvm->arch.vgic.its_model = KVM_DEV_TYPE_ARM_VGIC_V3;
}
If userspace initializes the VGICv3 distributor, assigns an irqfd via
KVM_IRQFD, and then creates the ITS and configures MSI routing,
vgic_supports_direct_msis(kvm) returns false during kvm_irqfd_assign().
Because vgic_its_create() does not register existing irqfds as irq_bypass
consumers, GICv4 direct vLPI forwarding is never enabled for those irqfds
and interrupts silently fall back to software injection.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113093840.1034795-1-yangjinqian1@huawei.com?part=1
prev parent reply other threads:[~2026-11-13 10:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 9:38 [PATCH v2] KVM: arm64: Register irq_bypass consumers only when direct MSIs are possible Jinqian Yang
2026-11-13 10:01 ` sashiko-bot [this message]
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=sashiko-outbox-212593@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=yangjinqian1@huawei.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.