From patchwork Mon Jan 19 16:29:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 43318 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F20FE2034D for ; Mon, 19 Jan 2015 16:31:20 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id l61sf3196537wev.0 for ; Mon, 19 Jan 2015 08:31:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=Kf67Mjm7yuEAyj9YnI6ElvBkzNl6N0X8lcJ69KEZMtA=; b=BmC9owlD+dByaSNlefIlUPR/6QZ8clABzQd4a6d5Vd78ULwbhGwRmszINA8orFJWCM 25sGQC7TfzcEDZg97xQRSFqjnwKjtLSWIjTHamTDqaXFFizE6AEzWNo/4GUu1iXbvZtT 9lFmeAFP2SCznKFxslqaT+AZQhwBaXXNDTLfRcbxc9iRGhYwkeB18KzM38mIJ5NQBBeq mWUFhyuO5U7paUZ/EDR1prTnoLsPTxN4IOMVwVAjHFGHKmLR7vQ98jPTqLaVpPLNwGR5 5M267JD30rwjJNDqLIGq8kVTbfy+oOe/K/Awx/96fJzwxOh86Ukx8L5vFdfeB174tIUb 1WFg== X-Gm-Message-State: ALoCoQkdPsLE6ZOG3wjbm7zN8XfV8NzqYOT593YoGBswcCJL897Ad4nkPiytWNrPYSDuQV07yu2n X-Received: by 10.112.37.72 with SMTP id w8mr920069lbj.6.1421685080097; Mon, 19 Jan 2015 08:31:20 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.195 with SMTP id da3ls685010lac.32.gmail; Mon, 19 Jan 2015 08:31:19 -0800 (PST) X-Received: by 10.152.19.7 with SMTP id a7mr32359431lae.16.1421685079951; Mon, 19 Jan 2015 08:31:19 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id gl8si12422879lbc.60.2015.01.19.08.31.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Jan 2015 08:31:19 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id pn19so29664025lab.9 for ; Mon, 19 Jan 2015 08:31:19 -0800 (PST) X-Received: by 10.152.8.11 with SMTP id n11mr31860638laa.38.1421685079868; Mon, 19 Jan 2015 08:31:19 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1144471lbb; Mon, 19 Jan 2015 08:31:18 -0800 (PST) X-Received: by 10.224.63.70 with SMTP id a6mr49904160qai.42.1421685078419; Mon, 19 Jan 2015 08:31:18 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id z5si18080152qab.9.2015.01.19.08.31.17 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 19 Jan 2015 08:31:18 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YDFDI-0006W7-2n; Mon, 19 Jan 2015 16:30:04 +0000 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: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id E6/E1-02953-7013DB45; Mon, 19 Jan 2015 16:29:59 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-16.tower-27.messagelabs.com!1421684999!16119274!1 X-Originating-IP: [74.125.82.178] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1621 invoked from network); 19 Jan 2015 16:29:59 -0000 Received: from mail-we0-f178.google.com (HELO mail-we0-f178.google.com) (74.125.82.178) by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 19 Jan 2015 16:29:59 -0000 Received: by mail-we0-f178.google.com with SMTP id p10so32347160wes.9 for ; Mon, 19 Jan 2015 08:29:59 -0800 (PST) X-Received: by 10.180.24.167 with SMTP id v7mr37761404wif.5.1421684998952; Mon, 19 Jan 2015 08:29:58 -0800 (PST) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id fw6sm14830368wib.1.2015.01.19.08.29.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Jan 2015 08:29:58 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 19 Jan 2015 16:29:15 +0000 Message-Id: <1421684957-29884-9-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1421684957-29884-1-git-send-email-julien.grall@linaro.org> References: <1421684957-29884-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH 08/10] xen/arm: vgic-v2: Don't check the size when we ignore the write/read a zero X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: 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; }