From: Oliver Upton <oliver.upton@linux.dev>
To: Raghavendra Rao Ananta <rananta@google.com>
Cc: kvmarm@lists.linux.dev, Marc Zyngier <maz@kernel.org>,
Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>, Eric Auger <eauger@redhat.com>,
Ben Horgan <ben.horgan@arm.com>,
Eric Auger <eric.auger@redhat.com>
Subject: Re: [PATCH v5 4/6] KVM: arm64: vgic-v3: Allow userspace to write GICD_TYPER2.nASSGIcap
Date: Sat, 26 Jul 2025 08:45:22 -0700 [thread overview]
Message-ID: <aIT4Ek_DqdioF0u1@linux.dev> (raw)
In-Reply-To: <CAJHc60wXquZzFNP+ekWZeVKAYkrB8eG+16c-LWLYX75NpYd03g@mail.gmail.com>
On Fri, Jul 25, 2025 at 03:53:23PM -0700, Raghavendra Rao Ananta wrote:
> Hi Oliver,
>
> On Wed, Jul 23, 2025 at 11:28 PM Oliver Upton <oliver.upton@linux.dev> wrote:
> >
> > From: Raghavendra Rao Ananta <rananta@google.com>
> >
> > KVM unconditionally advertises GICD_TYPER2.nASSGIcap (which internally
> > implies vSGIs) on GICv4.1 systems. Allow userspace to change whether a
> > VM supports the feature. Only allow changes prior to VGIC initialization
> > as at that point vPEs need to be allocated for the VM.
> >
> > For convenience, bundle support for vLPIs and vSGIs behind this feature,
> > allowing userspace to control vPE allocation for VMs in environments
> > that may be constrained on vPE IDs.
> >
> Is the "bundling vLPI and vSGI" part missing from this series? Unless
> I'm using a wrong base, we call vgic_v4_init() if
> vgic_supports_direct_irqs(), which will be true even if userspace
> turned off GICD_TYPER2.nASSGIcap. Am I missing something?
Nope, squashing this into the patch:
diff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h
index 96048ec59d0d..fb6d7c098ae6 100644
--- a/arch/arm64/kvm/vgic/vgic.h
+++ b/arch/arm64/kvm/vgic/vgic.h
@@ -375,7 +375,15 @@ bool vgic_supports_direct_sgis(struct kvm *kvm);
static inline bool vgic_supports_direct_irqs(struct kvm *kvm)
{
- return vgic_supports_direct_msis(kvm) || vgic_supports_direct_sgis(kvm);
+ /*
+ * Deliberately conflate vLPI and vSGI support on GICv4.1 hardware,
+ * indirectly allowing userspace to control whether or not vPEs are
+ * allocated for the VM.
+ */
+ if (system_supports_direct_sgis())
+ return vgic_supports_direct_sgis(kvm);
+
+ return vgic_supports_direct_msis(kvm);
}
int vgic_v4_init(struct kvm *kvm);
next prev parent reply other threads:[~2025-07-26 15:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 6:27 [PATCH v5 0/6] KVM: arm64: Allow userspace to write GICD_TYPER2.nASSGIcap Oliver Upton
2025-07-24 6:28 ` [PATCH v5 1/6] KVM: arm64: Disambiguate support for vSGIs v. vLPIs Oliver Upton
2025-07-24 6:28 ` [PATCH v5 2/6] KVM: arm64: vgic-v3: Consolidate MAINT_IRQ handling Oliver Upton
2025-07-24 6:28 ` [PATCH v5 3/6] KVM: arm64: vgic-v3: Allow access to GICD_IIDR prior to initialization Oliver Upton
2025-07-24 6:28 ` [PATCH v5 4/6] KVM: arm64: vgic-v3: Allow userspace to write GICD_TYPER2.nASSGIcap Oliver Upton
2025-07-25 22:53 ` Raghavendra Rao Ananta
2025-07-26 15:45 ` Oliver Upton [this message]
2025-07-24 6:28 ` [PATCH v5 5/6] KVM: arm64: selftests: Add test for nASSGIcap attribute Oliver Upton
2025-07-24 6:28 ` [PATCH v5 6/6] Documentation: KVM: arm64: Describe VGICv3 registers writable pre-init Oliver Upton
2025-07-25 16:55 ` [PATCH v5 0/6] KVM: arm64: Allow userspace to write GICD_TYPER2.nASSGIcap Marc Zyngier
2025-07-28 16:07 ` Eric Auger
2025-07-28 17:15 ` Oliver Upton
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=aIT4Ek_DqdioF0u1@linux.dev \
--to=oliver.upton@linux.dev \
--cc=ben.horgan@arm.com \
--cc=eauger@redhat.com \
--cc=eric.auger@redhat.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=rananta@google.com \
--cc=suzuki.poulose@arm.com \
--cc=yuzenghui@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox