summaryrefslogtreecommitdiff
path: root/virt/kvm/arm/vgic/vgic.h
diff options
context:
space:
mode:
authorEric Auger <eric.auger@redhat.com>2017-01-09 16:19:41 +0100
committerChristoffer Dall <cdall@linaro.org>2017-05-08 14:38:23 +0200
commitea1ad53e1e31a32dcbeae61b8d3d01cccedcffc5 (patch)
treee911f5beba5e173f4bb94224b42803ed34f0bd7e /virt/kvm/arm/vgic/vgic.h
parent920a7a8fa92ae0ec73c4f6d6f15c01f86017f20d (diff)
KVM: arm64: vgic-its: Collection table save/restore
The save path copies the collection entries into guest RAM at the GPA specified in the BASER register. This obviously requires the BASER to be set. The last written element is a dummy collection table entry. We do not index by collection ID as the collection entry can fit into 8 bytes while containing the collection ID. On restore path we re-allocate the collection objects. Signed-off-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Christoffer Dall <cdall@linaro.org> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'virt/kvm/arm/vgic/vgic.h')
-rw-r--r--virt/kvm/arm/vgic/vgic.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/virt/kvm/arm/vgic/vgic.h b/virt/kvm/arm/vgic/vgic.h
index 79768c801863..757de7a2bdc3 100644
--- a/virt/kvm/arm/vgic/vgic.h
+++ b/virt/kvm/arm/vgic/vgic.h
@@ -73,6 +73,15 @@
KVM_REG_ARM_VGIC_SYSREG_CRM_MASK | \
KVM_REG_ARM_VGIC_SYSREG_OP2_MASK)
+/*
+ * As per Documentation/virtual/kvm/devices/arm-vgic-its.txt,
+ * below macros are defined for ITS table entry encoding.
+ */
+#define KVM_ITS_CTE_VALID_SHIFT 63
+#define KVM_ITS_CTE_VALID_MASK BIT_ULL(63)
+#define KVM_ITS_CTE_RDBASE_SHIFT 16
+#define KVM_ITS_CTE_ICID_MASK GENMASK_ULL(15, 0)
+
static inline bool irq_is_pending(struct vgic_irq *irq)
{
if (irq->config == VGIC_CONFIG_EDGE)