From patchwork Thu Feb 1 18:47:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 126576 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1971632ljc; Thu, 1 Feb 2018 10:50:30 -0800 (PST) X-Google-Smtp-Source: AH8x224Y2gtsjV5iwGBVfEw1mF/qkHtCIxlvcykwygYIcFudMdle1TkuKQ4lwo42HmynG55O2e1k X-Received: by 10.107.62.198 with SMTP id l189mr39313544ioa.231.1517511030552; Thu, 01 Feb 2018 10:50:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517511030; cv=none; d=google.com; s=arc-20160816; b=N/6spl2O+lYaR6RwQxdGCqEU0jfDtRNH/fsBKVCPoqNtoN6ENQY6FYuei4bjxM6/GI nVaRUKMkv2tk86YhT8pBSd1EAvdhdobXRotRWHkYPpI7egRIuo5kQey4abU/TjluJjuu nRqVB6k+qJzAcxlSxcoQUNM72WWRONkh6DFeJzqEFgeoQr+RkJbursgVHDPdPQhvNhj8 Yg6Xy31X6TYYVpACWqMOGXjPQuJGjDxiAjfb19FwUwe3QQAz2N+tiKYfRGGwUIyBo2CV u7w8mkDT/u80irfCe/M5NCR5xBR/jLQfg9R10zTsM2qk1Vj+K6q5+dWO2RnYM+6+4SIg JGcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=aWC6toSZdaDt9uQgM2ZziwhbZEfaOKro5DQgIj3yBqQ=; b=nOLD6dWjKUZcmnTQ56pTj1RJZohq/wfOjIDHqlzpBdSgV35ConIznf3UKIUgJ+PrFZ Za+Ri5ReU3yICMaPw+vx0rI/ad4tqVl62r623tgeNl1tH0NdW2+QzCn2A2/CLoVd+51o Wiyo5PAYNngjQuIG/qErPCK+s3d8Y2aK/YGM6GR4Ohe1qx3AvSp+2wx9DNLs/38dlAtx hncDKyygpnDDPNq9kfB7wq9Sy9mqeQ3Jl8F5/5+piKx2I9lSLpLfSrgjlEsEfTuIdsDM Iuc0382RKoP7WXRs9POnAb+/a2odfAVpdPAo44vhIJuNnmpeajvi/rEdwmmK+dL+J7J9 wcmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id f193si495450itd.38.2018.02.01.10.50.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:50:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehJu6-0007W9-Gw; Thu, 01 Feb 2018 18:48:10 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehJu5-0007UZ-1V for xen-devel@lists.xen.org; Thu, 01 Feb 2018 18:48:09 +0000 X-Inumbo-ID: 82961958-0780-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 82961958-0780-11e8-b9b1-635ca7ef6cff; Thu, 01 Feb 2018 18:48:36 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1D87215BE; Thu, 1 Feb 2018 10:48:03 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0E4053F25C; Thu, 1 Feb 2018 10:48:01 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 1 Feb 2018 18:47:48 +0000 Message-Id: <20180201184749.29430-3-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201184749.29430-1-julien.grall@arm.com> References: <20180201184749.29430-1-julien.grall@arm.com> Cc: andrew.cooper3@citrix.com, Julien Grall , sstabellini@kernel.org, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH v2 2/3] xen/arm: Don't crash domain on bad MMIO emulation X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Now the MMIO emulation is able to distinguish unhandled IO from aborted one, there are no need to crash the domain when the region is access with a bad width. Instead let Xen inject a data abort to the guest and decide what to do. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2 - Add Stefano's reviewed-by --- xen/arch/arm/vgic-v2.c | 2 -- xen/arch/arm/vgic-v3-its.c | 3 --- xen/arch/arm/vgic-v3.c | 8 -------- xen/arch/arm/vpl011.c | 2 -- 4 files changed, 15 deletions(-) diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c index 2bdb25261a..646d1f3d12 100644 --- a/xen/arch/arm/vgic-v2.c +++ b/xen/arch/arm/vgic-v2.c @@ -348,7 +348,6 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info, bad_width: printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n", v, dabt.size, dabt.reg, gicd_reg); - domain_crash_synchronous(); return 0; read_as_zero_32: @@ -613,7 +612,6 @@ bad_width: printk(XENLOG_G_ERR "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n", v, dabt.size, dabt.reg, r, gicd_reg); - domain_crash_synchronous(); return 0; write_ignore_32: diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c index d8fa44258d..32061c6b03 100644 --- a/xen/arch/arm/vgic-v3-its.c +++ b/xen/arch/arm/vgic-v3-its.c @@ -1136,7 +1136,6 @@ read_reserved: bad_width: printk(XENLOG_G_ERR "vGITS: bad read width %d r%d offset %#04lx\n", info->dabt.size, info->dabt.reg, (unsigned long)info->gpa & 0xffff); - domain_crash_synchronous(); return 0; } @@ -1446,8 +1445,6 @@ bad_width: printk(XENLOG_G_ERR "vGITS: bad write width %d r%d offset %#08lx\n", info->dabt.size, info->dabt.reg, (unsigned long)info->gpa & 0xffff); - domain_crash_synchronous(); - return 0; } diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c index af16dfd005..2ad8a6be62 100644 --- a/xen/arch/arm/vgic-v3.c +++ b/xen/arch/arm/vgic-v3.c @@ -328,7 +328,6 @@ static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info, bad_width: printk(XENLOG_G_ERR "%pv vGICR: bad read width %d r%d offset %#08x\n", v, dabt.size, dabt.reg, gicr_reg); - domain_crash_synchronous(); return 0; read_as_zero_64: @@ -648,7 +647,6 @@ bad_width: printk(XENLOG_G_ERR "%pv: vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n", v, dabt.size, dabt.reg, r, gicr_reg); - domain_crash_synchronous(); return 0; write_ignore_64: @@ -760,7 +758,6 @@ static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v, bad_width: printk(XENLOG_G_ERR "%pv: %s: bad read width %d r%d offset %#08x\n", v, name, dabt.size, dabt.reg, reg); - domain_crash_synchronous(); return 0; read_as_zero: @@ -876,7 +873,6 @@ bad_width: printk(XENLOG_G_ERR "%pv: %s: bad write width %d r%d=%"PRIregister" offset %#08x\n", v, name, dabt.size, dabt.reg, r, reg); - domain_crash_synchronous(); return 0; write_ignore_32: @@ -937,7 +933,6 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info, bad_width: printk(XENLOG_G_ERR "%pv: vGICR: SGI: bad read width %d r%d offset %#08x\n", v, dabt.size, dabt.reg, gicr_reg); - domain_crash_synchronous(); return 0; read_as_zero_32: @@ -1017,7 +1012,6 @@ bad_width: printk(XENLOG_G_ERR "%pv: vGICR: SGI: bad write width %d r%d=%"PRIregister" offset %#08x\n", v, dabt.size, dabt.reg, r, gicr_reg); - domain_crash_synchronous(); return 0; write_ignore_32: @@ -1268,7 +1262,6 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info, bad_width: printk(XENLOG_G_ERR "%pv: vGICD: bad read width %d r%d offset %#08x\n", v, dabt.size, dabt.reg, gicd_reg); - domain_crash_synchronous(); return 0; read_as_zero_32: @@ -1456,7 +1449,6 @@ bad_width: printk(XENLOG_G_ERR "%pv: vGICD: bad write width %d r%d=%"PRIregister" offset %#08x\n", v, dabt.size, dabt.reg, r, gicd_reg); - domain_crash_synchronous(); return 0; write_ignore_32: diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c index 725b2e03ad..7788c2fc32 100644 --- a/xen/arch/arm/vpl011.c +++ b/xen/arch/arm/vpl011.c @@ -296,7 +296,6 @@ static int vpl011_mmio_read(struct vcpu *v, bad_width: gprintk(XENLOG_ERR, "vpl011: bad read width %d r%d offset %#08x\n", dabt.size, dabt.reg, vpl011_reg); - domain_crash_synchronous(); return 0; } @@ -366,7 +365,6 @@ write_ignore: bad_width: gprintk(XENLOG_ERR, "vpl011: bad write width %d r%d offset %#08x\n", dabt.size, dabt.reg, vpl011_reg); - domain_crash_synchronous(); return 0; }