summaryrefslogtreecommitdiff
path: root/arch/arm64/kvm/vgic/vgic.h
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2022-04-05 21:23:27 +0300
committerMarc Zyngier <maz@kernel.org>2022-05-04 16:09:53 +0300
commit49a1a2c70a7fd820fe60a65a3e38ab9095082dc9 (patch)
treed9d3e7cf5b54c8c3fd49faca4bfd646a0b036a4b /arch/arm64/kvm/vgic/vgic.h
parent4645d11f4a5538ec1221f36e397cfb0115718ffe (diff)
downloadlinux-49a1a2c70a7fd820fe60a65a3e38ab9095082dc9.tar.xz
KVM: arm64: vgic-v3: Advertise GICR_CTLR.{IR, CES} as a new GICD_IIDR revision
Since adversising GICR_CTLR.{IC,CES} is directly observable from a guest, we need to make it selectable from userspace. For that, bump the default GICD_IIDR revision and let userspace downgrade it to the previous default. For GICv2, the two distributor revisions are strictly equivalent. Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20220405182327.205520-5-maz@kernel.org
Diffstat (limited to 'arch/arm64/kvm/vgic/vgic.h')
-rw-r--r--arch/arm64/kvm/vgic/vgic.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h
index 1d04a900f3e3..4c6bdd321faa 100644
--- a/arch/arm64/kvm/vgic/vgic.h
+++ b/arch/arm64/kvm/vgic/vgic.h
@@ -98,6 +98,11 @@
#define DEBUG_SPINLOCK_BUG_ON(p)
#endif
+static inline u32 vgic_get_implementation_rev(struct kvm_vcpu *vcpu)
+{
+ return vcpu->kvm->arch.vgic.implementation_rev;
+}
+
/* Requires the irq_lock to be held by the caller. */
static inline bool irq_is_pending(struct vgic_irq *irq)
{