[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 08/10] xen/arm: vgic-v2: Don't check the size when we ignore the write/read a zero

Some registers, such as GICD_ITARGET0 can be read/write with different

When the write is ignored only word-access is checked. This will lead to
a domain crash if the guest is trying to access via byte-word.

In general, it's not necessary/important to check the size. It's better
to log it to let know the guest that its access will have no effect.

Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>

    This patch should be backported to Xen 4.4 and 4.5 as it fixes
    byte-access to GICD_ITARGET0.

    Although, this patch won't apply directly to Xen 4.4.
 xen/arch/arm/vgic-v2.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index a34a0c7..8c6ca72 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -227,7 +227,8 @@ bad_width:
     return 0;
-    if ( dabt.size != DABT_WORD ) goto bad_width;
+    gdprintk(XENLOG_DEBUG, "vGICD: read as zero width, %d r%d offset %#08x\n",
+             dabt.size, dabt.reg, gicd_reg);
     *r = 0;
     return 1;
@@ -498,7 +499,8 @@ bad_width:
     return 0;
-    if ( dabt.size != DABT_WORD ) goto bad_width;
+    gdprintk(XENLOG_DEBUG, "vGICD: ignore write width %d r%d offset %#08x\n",
+             dabt.size, dabt.reg, gicd_reg);
     return 1;

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.