From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH 08/10] xen/arm: vgic-v2: Don't check the size when we ignore the write/read a zero Date: Mon, 19 Jan 2015 16:29:15 +0000 Message-ID: <1421684957-29884-9-git-send-email-julien.grall@linaro.org> References: <1421684957-29884-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YDFDE-0006Tb-BO for xen-devel@lists.xenproject.org; Mon, 19 Jan 2015 16:30:00 +0000 Received: by mail-we0-f178.google.com with SMTP id p10so32347160wes.9 for ; Mon, 19 Jan 2015 08:29:59 -0800 (PST) In-Reply-To: <1421684957-29884-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org Some registers, such as GICD_ITARGET0 can be read/write with different size. 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 --- 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; read_as_zero: - 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; write_ignore: - 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; } -- 2.1.4