From patchwork Tue Jan 30 16:14:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 126278 Delivered-To: patch@linaro.org Received: by 10.46.84.92 with SMTP id y28csp3499687ljd; Tue, 30 Jan 2018 08:17:08 -0800 (PST) X-Google-Smtp-Source: AH8x224qkJFWpnG18eh8CI2dUCOV+e3ZmVlyTV2m1dA+MtYwXJtp5fL5MFvpsQAf9N+zONvgCFNG X-Received: by 10.107.88.4 with SMTP id m4mr30820405iob.278.1517329028638; Tue, 30 Jan 2018 08:17:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517329028; cv=none; d=google.com; s=arc-20160816; b=vRb3oIOJEUDLjGRdbrrN5kyz0IMgYlsBKMrBR8qwxi5WQYA+I5lz346xDxw2MfJB+J Vsa7/EYwNNdyZwdhmplS7o1OZNRA4FeJdyY/olS+CZk+UeWZZwRCoZtuBEKdHcIdbAwl F8G+nFmtbfyyYDRxttG7nyl2UtyIbihNvQwC4L9QjNeXcgaWt/fbtPfCAAPQ/ZcPBS8U 01J4/GUeBiVsFVvPEcA7f/UwrJW1HaSpY+XFdFRw2IY5BiAkOd+ORTf0u9iiMCMk8aKZ HNpiuwtYP/fjqNgJ8qXG52mX0KpETyhgoTmUdURIYGdoJgghf1FcaDf4uk7Gd14iZDOd p/cQ== 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=dmYdq04xRpr8/Q3Z0w6Ejmdc3mMa8vn/Z1902IQRpSk=; b=xq3SSgxvp+eACGzlA0CXsg+0chSa6ANsJtECeNsFcga9aDIt0coDqypsE18+Zzv2SS ScyV0IMHc7upVqplPx3JTU4DO2HK48YwO7DPG01dwk4qMdJk/yWX2A+rv+k3tJhgHOMH wc/2/WfgHRbjBNCiJOPnOrK9HWrRymzq/68LnsQ+jgA4dGaYIy7wmlESuvHgp0iuIK5z lqvw11kWYa3wgM75gEWehgOTDpzRU3ybYpvgA0IDixacpEh4qjSltfPwsrC7VTaiF7kw 90KxCd7y/dflPYQOjCc+NwJOpx4cguIO3A/FLJVamXvTJlox7+XE+d33qheeKfIoqwq2 TOdA== 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 s3si35151ioi.323.2018.01.30.08.17.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 08:17:08 -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 1egYYX-0008OR-9x; Tue, 30 Jan 2018 16:14:45 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egYYV-0008OK-Pb for xen-devel@lists.xen.org; Tue, 30 Jan 2018 16:14:43 +0000 X-Inumbo-ID: a62475db-05d8-11e8-ba59-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id a62475db-05d8-11e8-ba59-bc764e045a96; Tue, 30 Jan 2018 17:14:29 +0100 (CET) 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 EA20D1529; Tue, 30 Jan 2018 08:14:41 -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 DAE593F25C; Tue, 30 Jan 2018 08:14:40 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 30 Jan 2018 16:14:32 +0000 Message-Id: <20180130161433.6910-3-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180130161433.6910-1-julien.grall@arm.com> References: <20180130161433.6910-1-julien.grall@arm.com> Cc: andrew.cooper3@citrix.com, Julien Grall , sstabellini@kernel.org, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH 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 --- 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; }