summaryrefslogtreecommitdiffstats
path: root/include/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2015-12-01 13:48:56 +0000
committerMarc Zyngier <marc.zyngier@arm.com>2015-12-14 11:30:38 +0000
commit3c13b8f435acb452eac62d966148a8b6fa92151f (patch)
tree2632e4a1f49c247191ef4a47f76ffafddf265a20 /include/kvm
parent06282fd2c2bf61619649a2b13e4a08556598a64c (diff)
downloadlinux-3c13b8f435acb452eac62d966148a8b6fa92151f.tar.gz
linux-3c13b8f435acb452eac62d966148a8b6fa92151f.tar.bz2
linux-3c13b8f435acb452eac62d966148a8b6fa92151f.zip
KVM: arm/arm64: vgic-v3: Make the LR indexing macro public
We store GICv3 LRs in reverse order so that the CPU can save/restore them in rever order as well (don't ask why, the design is crazy), and yet generate memory traffic that doesn't completely suck. We need this macro to be available to the C version of save/restore. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'include/kvm')
-rw-r--r--include/kvm/arm_vgic.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index d2f41477f8ae..13a3d537811b 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -279,6 +279,12 @@ struct vgic_v2_cpu_if {
u32 vgic_lr[VGIC_V2_MAX_LRS];
};
+/*
+ * LRs are stored in reverse order in memory. make sure we index them
+ * correctly.
+ */
+#define VGIC_V3_LR_INDEX(lr) (VGIC_V3_MAX_LRS - 1 - lr)
+
struct vgic_v3_cpu_if {
#ifdef CONFIG_KVM_ARM_VGIC_V3
u32 vgic_hcr;