From: Raghavendra Rao Ananta <rananta@google.com>
To: Oliver Upton <oliver.upton@linux.dev>, Marc Zyngier <maz@kernel.org>
Cc: Raghavendra Rao Anata <rananta@google.com>,
Mingwei Zhang <mizhang@google.com>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: [PATCH 0/3] KVM: arm64: Allow vGICv4 configuration per VM
Date: Wed, 14 May 2025 19:21:56 +0000 [thread overview]
Message-ID: <20250514192159.1751538-1-rananta@google.com> (raw)
Hello,
When kvm-arm.vgic_v4_enable=1, KVM adds support for direct interrupt
injection by default to all the VMs in the system, aka GICv4. A
shortcoming of the GIC architecture is that there's an absolute limit on
the number of vPEs that can be tracked by the ITS. It is possible that
an operator is running a mix of VMs on a system, only wanting to provide
a specific class of VMs with hardware interrupt injection support.
To support this, introduce a GIC attribute, KVM_DEV_ARM_VGIC_CONFIG_GICV4,
for the userspace to enable or disable vGICv4 for a given VM.
The attribute allows the configuration only when vGICv4 is enabled in KVM,
else it acts a read-only attribute returning
KVM_DEV_ARM_VGIC_CONFIG_GICV4_UNAVAILABLE as the value.
On the other hand, if KVM has the vGICv4 enabled via the cmdline, the
VM absorbs this configuration by default to maintain the backward
compatibility. Userspace can get the attribute's value to check if the VM
has vGICv4 support if it sees KVM_DEV_ARM_VGIC_CONFIG_GICV4_ENABLE as the
value. As required, it can disable vGICv4 by setting
KVM_DEV_ARM_VGIC_CONFIG_GICV4_DISABLE as the value.
The patches are distrubuted as:
Patch-1 contains the KVM code that introduces the
KVM_DEV_ARM_VGIC_CONFIG_GICV4 attr, and adds all the support around it.
Patch-2 adds the documentation for the said attribute.
Patch-3 extends the vgic_init kvm/arm64 selftest that tests the get and
set of this attribute in various configurations.
Thank you.
Raghavendra
Raghavendra Rao Ananta (3):
kvm: arm64: Add support for KVM_DEV_ARM_VGIC_CONFIG_GICV4 attr
docs: kvm: devices/arm-vgic-v3: Document KVM_DEV_ARM_VGIC_CONFIG_GICV4
attr
KVM: selftests: Extend vgic_init to test GICv4 config attr
.../virt/kvm/devices/arm-vgic-v3.rst | 24 ++++++--
arch/arm64/include/uapi/asm/kvm.h | 7 +++
arch/arm64/kvm/vgic/vgic-init.c | 3 +
arch/arm64/kvm/vgic/vgic-its.c | 2 +-
arch/arm64/kvm/vgic/vgic-kvm-device.c | 39 +++++++++++++
arch/arm64/kvm/vgic/vgic-mmio-v3.c | 12 ++--
arch/arm64/kvm/vgic/vgic-v3.c | 16 ++++-
arch/arm64/kvm/vgic/vgic-v4.c | 8 +--
include/kvm/arm_vgic.h | 5 ++
tools/testing/selftests/kvm/arm64/vgic_init.c | 58 +++++++++++++++++++
10 files changed, 157 insertions(+), 17 deletions(-)
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
--
2.49.0.1101.gccaa498523-goog
next reply other threads:[~2025-05-14 19:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 19:21 Raghavendra Rao Ananta [this message]
2025-05-14 19:21 ` [PATCH 1/3] kvm: arm64: Add support for KVM_DEV_ARM_VGIC_CONFIG_GICV4 attr Raghavendra Rao Ananta
2025-05-14 19:21 ` [PATCH 2/3] docs: kvm: devices/arm-vgic-v3: Document " Raghavendra Rao Ananta
2025-05-14 19:21 ` [PATCH 3/3] KVM: selftests: Extend vgic_init to test GICv4 config attr Raghavendra Rao Ananta
2025-05-15 10:30 ` [PATCH 0/3] KVM: arm64: Allow vGICv4 configuration per VM Ben Horgan
2025-05-15 10:48 ` Marc Zyngier
2025-05-15 15:55 ` Raghavendra Rao Ananta
2025-05-15 16:48 ` Ben Horgan
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=20250514192159.1751538-1-rananta@google.com \
--to=rananta@google.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=mizhang@google.com \
--cc=oliver.upton@linux.dev \
/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