aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--virt/kvm/arm/vgic/vgic-its.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
index c41e11fd841c..fcb2fceaa4a5 100644
--- a/virt/kvm/arm/vgic/vgic-its.c
+++ b/virt/kvm/arm/vgic/vgic-its.c
@@ -754,8 +754,9 @@ static bool vgic_its_check_id(struct vgic_its *its, u64 baser, u32 id,
754 u64 indirect_ptr, type = GITS_BASER_TYPE(baser); 754 u64 indirect_ptr, type = GITS_BASER_TYPE(baser);
755 phys_addr_t base = GITS_BASER_ADDR_48_to_52(baser); 755 phys_addr_t base = GITS_BASER_ADDR_48_to_52(baser);
756 int esz = GITS_BASER_ENTRY_SIZE(baser); 756 int esz = GITS_BASER_ENTRY_SIZE(baser);
757 int index; 757 int index, idx;
758 gfn_t gfn; 758 gfn_t gfn;
759 bool ret;
759 760
760 switch (type) { 761 switch (type) {
761 case GITS_BASER_TYPE_DEVICE: 762 case GITS_BASER_TYPE_DEVICE:
@@ -782,7 +783,8 @@ static bool vgic_its_check_id(struct vgic_its *its, u64 baser, u32 id,
782 783
783 if (eaddr) 784 if (eaddr)
784 *eaddr = addr; 785 *eaddr = addr;
785 return kvm_is_visible_gfn(its->dev->kvm, gfn); 786
787 goto out;
786 } 788 }
787 789
788 /* calculate and check the index into the 1st level */ 790 /* calculate and check the index into the 1st level */
@@ -812,7 +814,12 @@ static bool vgic_its_check_id(struct vgic_its *its, u64 baser, u32 id,
812 814
813 if (eaddr) 815 if (eaddr)
814 *eaddr = indirect_ptr; 816 *eaddr = indirect_ptr;
815 return kvm_is_visible_gfn(its->dev->kvm, gfn); 817
818out:
819 idx = srcu_read_lock(&its->dev->kvm->srcu);
820 ret = kvm_is_visible_gfn(its->dev->kvm, gfn);
821 srcu_read_unlock(&its->dev->kvm->srcu, idx);
822 return ret;
816} 823}
817 824
818static int vgic_its_alloc_collection(struct vgic_its *its, 825static int vgic_its_alloc_collection(struct vgic_its *its,