Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1027980ybe; Wed, 4 Sep 2019 11:22:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZUcuh+gKIrDrgJKpU488/YMo8ffgnW+fw5Emlsqmn5BitJRV+Ir3LsRnPXG9azWCqnTTH X-Received: by 2002:a17:902:728a:: with SMTP id d10mr20353144pll.309.1567621337766; Wed, 04 Sep 2019 11:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567621337; cv=none; d=google.com; s=arc-20160816; b=nXfOdQZiV2PRBfIud9P1T1Az+Kxn5J3HtkjIwhNkK4n9ZHLJ9MqjHdjVmt1o5SvyFz 2QPRU/GQYWVshb4NuhzEJE/AYwXIK4LM4SYAn1OMxMS7gU9iafcSeO2vgkiW096ZStnj jGQDC1MiHr1dudAZ9sW5xAyoV4omw07DwElTSKSMj71ZJqh72QJIIcSi9hbqdQ0754OU EDsngmstFWwVl9KiOrKST7mMbr+DaTuqkirC5AI1SBGPFYC6J41N9nQzQCcxLcSTKuCS iLlPGhkDa2gLwpAzB+rRJnaf39MQhVt2RhS+O6oPIrNM/uJypIomeDfe5nk6Tb24Akr0 jV6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JaJ/bUZkHYNMCPv4jtfaKbv0IB+IWkq24kEnV/oiktQ=; b=MHEIQCScpWTso648BHV70hztec7Nsleu498tw+/1CHN4Uq6ZWbuixwIWoy4DLsyeid TnkW7bjBTZ7CqfoeLX7LtiyEvuJJzf+oqtvt6ogfxzPuGGVn4vBRWW5XzIHZN/jqOxB7 O47cBUZBwDsn2ItB9kXvCNzEbTWvMuPbQJTf5svXaf1bYp6Prb+xpAlbThdDxM4FFB4R RtZSCXfSwZG0zBEEcaJUnj7jY04Ud12J3RcTJshbqATbd59RMZmPCdtrrXFLo+J4xssi NVdU2IfC3rcgOgvc1Ogf9F7Y3TFUkd3mm1TNpcXNCWf+v92xygRLkmgKfi8zEd6NwrX4 iRNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=dFPK7v0e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si18135870pga.567.2019.09.04.11.22.02; Wed, 04 Sep 2019 11:22:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=dFPK7v0e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389787AbfIDSUY (ORCPT + 99 others); Wed, 4 Sep 2019 14:20:24 -0400 Received: from mout.gmx.net ([212.227.15.15]:44349 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388701AbfIDSIJ (ORCPT ); Wed, 4 Sep 2019 14:08:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1567620473; bh=uSFdeY18J73GEbur7/f5eGY33e2+gZfGIbg70oqM+2E=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=dFPK7v0eikK//IWvKaPDuTF8vPd9O/aKmO1DDSUY2K3IC2bxnVQ5PIk2EJhGM27kR +lY+G9BNhgaiYDLaUrJX9F/2f1aIQsTNuq3ya5rD0AT7g8CjigqFQwromeihBXHSXC O/uuMoGto9MJPLXCEM44QVkN4nCV3sTM8MJWrjW4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([84.118.159.3]) by mail.gmx.com (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MhlGk-1ij1B310yG-00dqYX; Wed, 04 Sep 2019 20:07:53 +0200 From: Heinrich Schuchardt To: Marc Zyngier Cc: James Morse , Julien Thierry , Suzuki K Pouloze , Peter Maydell , Stefan Hajnoczi , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Heinrich Schuchardt Subject: [PATCH 1/1] KVM: inject data abort if instruction cannot be decoded Date: Wed, 4 Sep 2019 20:07:36 +0200 Message-Id: <20190904180736.29009-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.23.0.rc1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:abXNHvOQi/p7CEIzoPWMQ9XFYpp4Z25ZscYRNbtDcb67ZH0vqAE CCaWYLtBMzVUoZZj3DLLIFWRozpR+tYvr63KEw05ujxgzzI7iN0g+dgjei45TpxWlugdsiF hLqcNFs7qc6B5xKFTZBxgoGdWkp6vsuL+qhmsf9GozxhZ5IUyUHXZk7+SsU37eCbQpoyn4O c/fcxp1MYFQRPvj2y1OVw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:JozR6u9JImk=:9BlOOIijgEVJQxytK0x9tx ffPR1NDnISmrIyzczzP11cywtaAFP9aCT0RxToSFNkToJSnm4aAHE/S7sSOhgAIyxz/MiIr75 KcPkdb6fnx23AA/KWNlaSRurYgMgazJ/6IuexrQBTdxaFm90ZlBzRLL3K8ywN/CV7JZtvH6z7 aFhqnENeGY04kiL4Zvg4gvZ4OW0XCYjI/FqU9AbtXKdBObedSvwR72zNEd05U37t9+x8zKk6j LTJizGn7PHI8EuNOQLdKg0IXFjG8dPDYe8z7wgn2qlKGBjBeAawjfNp3Epb6kUw9213ZNGLMo fh1gBhdrooRdaj1tEiGAhterenwoPCIM9X+VRYi8DAQbb70yGSicPAYEljE/k+/rJofxOuT+q CxwkoHsuZ4mqi5+NhnaTJl4e36SNg28WzHRxDYOvL2igXBERcU6bsBTitDCccbufyP+5dPxOQ uPyjZfdAVfzt20K85FboUwnZkpWJ8PAiIrQaJZXInThEl1hlhcQZBHzYzyhU5Hr0vT7U4bguC Jk1d4iShpWENsqgl5/YyR1EpmrUUZyiBRo01uDGlt9hLy/RC6f3F7rSjihjY1zPvYJb9r26zl sjKm0HwdyniWypblwzX1tidPLcBPHVc7xLlAQB9Amxfrap8J5aIaJV9ncupkKh9lDp1SMA7bi bbFb7ydvnEj9BvWA7m7P9G3rJBACZN+IByS9r2paS2gmJORze++SF7xMJ4CapGqMPhm0Uh0+m NWRh4c0s58AB0LRR0FnqR0vIkZjw58tSrhrZpQ+i3HGvS9U73dI9u74NpBU/UtPNAl1M2oC33 lU0fo9l6DRWSvRYhpvM+2DLbV2udzosMeRZaicEkLQuVPBWNFtqfE6GjW4KVEbg3EftIIKjKR 0gT3EfIIZdht5LApSOvcoT70CR06LPLNQ0o3DEzr2ake3RZ2x6ItWyyJD2cf+MIMsBa7xKluS cRnSMqgtb9PkRlVbNFar+V/OJ3yKgF04Ay4K/3PiP3AygXGBXLaN2SaDOnbm+6BsN8XXZNLGJ wEJbpsOVJ8RM0sLV8X2HpOgJy77cP3gLkngJ3OQ0+ziAetElq+4QoVGQHvzzIc37WuWuUj672 HV4zT7/BsxTmuoCUoNd2qwOf/vWbcWNHRuTTY+ujEDs0+SybO+LhCZ8r+WlBFZgejj7NXq+RE cgxieGDxbNjHstwJ68ra7rk37gfXEY/CDV3xk1cGtH89pLOT4mYhLPJ/CAin64ctNsznLUIXM 81exZsNAov/vsxqph Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If an application tries to access memory that is not mapped, an error ENOSYS, "load/store instruction decoding not implemented" may occur. QEMU will hang with a register dump. Instead create a data abort that can be handled gracefully by the application running in the virtual environment. Now the virtual machine can react to the event in the most appropriate way - by recovering, by writing an informative log, or by rebooting. Signed-off-by: Heinrich Schuchardt =2D-- virt/kvm/arm/mmio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virt/kvm/arm/mmio.c b/virt/kvm/arm/mmio.c index a8a6a0c883f1..0cbed7d6a0f4 100644 =2D-- a/virt/kvm/arm/mmio.c +++ b/virt/kvm/arm/mmio.c @@ -161,8 +161,8 @@ int io_mem_abort(struct kvm_vcpu *vcpu, struct kvm_run= *run, if (ret) return ret; } else { - kvm_err("load/store instruction decoding not implemented\n"); - return -ENOSYS; + kvm_inject_dabt(vcpu, kvm_vcpu_get_hfar(vcpu)); + return 1; } rt =3D vcpu->arch.mmio_decode.rt; =2D- 2.23.0.rc1