]> xenbits.xensource.com Git - xen.git/commitdiff
arm/vpci: mask off upper bits in vPCI read mmio handler
authorStewart Hildebrand <stewart.hildebrand@amd.com>
Thu, 8 May 2025 10:46:06 +0000 (06:46 -0400)
committerStefano Stabellini <stefano.stabellini@amd.com>
Fri, 9 May 2025 20:58:40 +0000 (13:58 -0700)
On Arm, we expect read handlers to have the bits above the access size
zeroed. vPCI read handlers may return all 1s. Mask off the bits above
the access size.

Fixes: 9a5e22b64266 ("xen/arm: check read handler behavior")
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/vpci.c

index b63a356bb4a881523f06338e9138142b60b2a206..3a3ff5d0812cdf960b67d700f67d8c9eccd86b78 100644 (file)
@@ -37,7 +37,7 @@ static int vpci_mmio_read(struct vcpu *v, mmio_info_t *info,
     if ( vpci_ecam_read(sbdf, ECAM_REG_OFFSET(info->gpa),
                         1U << info->dabt.size, &data) )
     {
-        *r = data;
+        *r = data & invalid;
         return 1;
     }