From patchwork Fri Feb 2 10:14:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 126627 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp495857ljc; Fri, 2 Feb 2018 02:17:39 -0800 (PST) X-Google-Smtp-Source: AH8x2276Xf5ErvUq3UlcBSBrXo0/Xr+7Xuyp64BA42Uft9ZdVYVMogyvjMY0R8M7bFy6rJldtBub X-Received: by 10.36.13.211 with SMTP id 202mr5990484itx.136.1517566659432; Fri, 02 Feb 2018 02:17:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517566659; cv=none; d=google.com; s=arc-20160816; b=TuvuzkSbbNP78SbNLxsmxbZpUojzJGQRyvtuVVx1r/jQpNUzjswjzIND+z5oH0nmpI PhDbHhz30zGdXz3/KmhLji34KD5TdMn3wv3OFx5ohyNY9HGfhNcaU63diwGWzD4RWaUZ stxIcHYex/xGe/w9zc6+oS3eTTNqp2ONvygu2hhZ9T+DLLLiDvuVqfHA3hYmU+8i3GQv H2mwSAHGUa6Dd4F5HYRK/YKErB0RXKpRVMwOvd/+LqLZRa8ghUeo5VHEp77bNZNXR6tZ 5TJYKUTFqANRGREYOIepXWqo9VNRkb2a+M1wYJo8RU8Niwo/ny/zVg9+Lli5nMFsldGC K/tA== 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=0s7RCE1/yBzEccmP6YSqE6uoIo09hem48RgZV1iHehMWEu411meQtddBgGWRAJVMz4 JFGMrLuQmhFfH0YBUSVO2MP1H4guZvZmMS9VLvaLBMREEAUTT05HaJ6gkppjGVjFe7Mq FxOvYlLmARHGaaQhiqPIkfYcV5qWwhqCbFKWZnvGvx553iKW9tFtgyJtHuDjoMtyFcE7 i+vJWoluT1B0lrInsYIwRETayQA6sSyJuw9HxV37mE8upGl8kSB/e7UZRc8jgrrjH+oh 1b9ZYmGnNhzsT2daCsLYizNfCkaOg+PI+PGDamIykai2RY23sb0xs1nOmUaB6YfsGG86 D4kg== 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 v36si1516482iov.112.2018.02.02.02.17.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Feb 2018 02:17:39 -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 1ehYN0-0006Fj-J6; Fri, 02 Feb 2018 10:14:58 +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 1ehYMy-0006FT-Km for xen-devel@lists.xen.org; Fri, 02 Feb 2018 10:14:56 +0000 X-Inumbo-ID: e053e405-0801-11e8-ba59-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id e053e405-0801-11e8-ba59-bc764e045a96; Fri, 02 Feb 2018 11:14:38 +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 808821529; Fri, 2 Feb 2018 02:14:55 -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 7195E3F487; Fri, 2 Feb 2018 02:14:54 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 2 Feb 2018 10:14:43 +0000 Message-Id: <20180202101444.3510-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180202101444.3510-1-julien.grall@arm.com> References: <20180202101444.3510-1-julien.grall@arm.com> Cc: andrew.cooper3@citrix.com, Julien Grall , sstabellini@kernel.org, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH v3 3/4] 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 Reviewed-by: Andre Przywara --- 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; }