aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--virt/kvm/arm/vgic/vgic-its.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
index 4943d6aebdd1..2faf1f458e8a 100644
--- a/virt/kvm/arm/vgic/vgic-its.c
+++ b/virt/kvm/arm/vgic/vgic-its.c
@@ -727,7 +727,12 @@ static bool vgic_its_check_device_id(struct kvm *kvm, struct vgic_its *its,
727 * Any address beyond our supported 48 bits of PA will be caught 727 * Any address beyond our supported 48 bits of PA will be caught
728 * by the actual check in the final step. 728 * by the actual check in the final step.
729 */ 729 */
730 gfn = (indirect_ptr & GENMASK_ULL(51, 16)) >> PAGE_SHIFT; 730 indirect_ptr &= GENMASK_ULL(51, 16);
731
732 /* Find the address of the actual entry */
733 index = device_id % (SZ_64K / GITS_BASER_ENTRY_SIZE(r));
734 indirect_ptr += index * GITS_BASER_ENTRY_SIZE(r);
735 gfn = indirect_ptr >> PAGE_SHIFT;
731 736
732 return kvm_is_visible_gfn(kvm, gfn); 737 return kvm_is_visible_gfn(kvm, gfn);
733} 738}