summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2016-07-17 11:34:53 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2016-07-18 18:15:16 +0100
commit7e3963a51563d844fcd3bdc13e2847561b15e8de (patch)
treec16eb6631d0fb377b487a180b3259e59a6716038 /virt
parentc0091073dd775d0446a9f88dda8c9a86b64340b2 (diff)
downloadblackbird-op-linux-7e3963a51563d844fcd3bdc13e2847561b15e8de.tar.gz
blackbird-op-linux-7e3963a51563d844fcd3bdc13e2847561b15e8de.zip
KVM: arm64: vgic-its: Fix vgic_its_check_device_id BE handling
The ITS tables are stored in LE format. If the host is reading a L1 table entry to check its validity, it must convert it to the CPU endianness. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/vgic/vgic-its.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
index d6697c4d81ec..2ac5927b1d91 100644
--- a/virt/kvm/arm/vgic/vgic-its.c
+++ b/virt/kvm/arm/vgic/vgic-its.c
@@ -707,6 +707,8 @@ static bool vgic_its_check_device_id(struct kvm *kvm, struct vgic_its *its,
&indirect_ptr, sizeof(indirect_ptr)))
return false;
+ indirect_ptr = le64_to_cpu(indirect_ptr);
+
/* check the valid bit of the first level entry */
if (!(indirect_ptr & BIT_ULL(63)))
return false;
OpenPOWER on IntegriCloud