summaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2016-07-18 17:16:26 +0200
committerMarc Zyngier <marc.zyngier@arm.com>2016-07-18 19:15:16 +0200
commitc0091073dd775d0446a9f88dda8c9a86b64340b2 (patch)
tree702b64e1d6557399aa7c377ee79d5e0aa6fcc1b0 /virt/kvm/arm
parentKVM: arm64: vgic-its: Generalize use of vgic_get_irq_kref (diff)
downloadlinux-c0091073dd775d0446a9f88dda8c9a86b64340b2.tar.xz
linux-c0091073dd775d0446a9f88dda8c9a86b64340b2.zip
KVM: arm64: vgic-its: Fix handling of indirect tables
The current code will fail on valid indirect tables, and happily use the ones that are pointing out of the guest RAM. Funny what a small "!" can do for you... Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'virt/kvm/arm')
-rw-r--r--virt/kvm/arm/vgic/vgic-its.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
index f427fa2f7263..d6697c4d81ec 100644
--- a/virt/kvm/arm/vgic/vgic-its.c
+++ b/virt/kvm/arm/vgic/vgic-its.c
@@ -702,9 +702,9 @@ static bool vgic_its_check_device_id(struct kvm *kvm, struct vgic_its *its,
return false;
/* Each 1st level entry is represented by a 64-bit value. */
- if (!kvm_read_guest(kvm,
- BASER_ADDRESS(r) + index * sizeof(indirect_ptr),
- &indirect_ptr, sizeof(indirect_ptr)))
+ if (kvm_read_guest(kvm,
+ BASER_ADDRESS(r) + index * sizeof(indirect_ptr),
+ &indirect_ptr, sizeof(indirect_ptr)))
return false;
/* check the valid bit of the first level entry */