Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp817693ybe; Thu, 5 Sep 2019 06:27:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqydLk0ERwt/BnyGZ3gSSKgEQj4ht4zAX0aJeUTbuZ5l+ew12KsmFQh8P26fuGAfrqcYi5na X-Received: by 2002:a62:e216:: with SMTP id a22mr3808764pfi.249.1567690027278; Thu, 05 Sep 2019 06:27:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567690027; cv=none; d=google.com; s=arc-20160816; b=c9CfQ3jW8ZmUD0ZYHB+nd2x/Cp17u6OFwSptobjS8iN5Sd1aoZ9xGUVJfHuwJIVnWU 5Rwu7SHt0p2GyukenSAs08tj85bhY27DeHZlcmWxwvfBgtcqPWD6kMBmZGcidObiqwk4 1Xa7SLxHQcLPRgyFGOMqK5SUb8+QIje/DsxQNU2ly61VKgQs6HJaVu6q4FTY6SJle4MA 3RZD22rD5JGa8Sy1P4iKx3VuJ7T9dIPj/zsYg1cNZIF/T5MyW2T/jjT7US/cthVrEuAR r06O746m11OosxB5kYVTBD6asD53K7st64tOVWGI+nJpwl4aOp1I83jkU8s1hL0BJXxn WCXg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=EpstRFVY8/0j9iRxnYF0hTkQ6AdyNOJ+oUdC7XJrdZk=; b=C1K59sgWcNnhM8zHyTS9nYbOTT5j6QUY0x46SlSC4UfEIOmntizY1KVvMUL22OgQza LSgccwf/BWwbyNImfgXB85SR+gM8OxCpv9xe51OhiHsBpKD0RM/NOvq2A0bGIK7gfPSy VC1xcuaGzKf5corfvd2n1c17egtQMvXY2gqYwcMqdTmzG7+3K2wZcsQqQLSGSuZS4hm7 YfkFKHpE6nRgKh4CGlM8C0146TP0JrZMuNuW9ByPJOLhhH2pTLEzubO5bJGkn43MxLcS 1we6vxy6NFfoQqVExtiKAT5hV9CE7hAEdCtB8bdYSreGW83eS1x+MF7kepK7Ihz2MQ/r oaZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=JU8ZtJW7; 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 k15si1967321pls.379.2019.09.05.06.26.51; Thu, 05 Sep 2019 06:27:07 -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=JU8ZtJW7; 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 S2388919AbfIEMCO (ORCPT + 99 others); Thu, 5 Sep 2019 08:02:14 -0400 Received: from mout.gmx.net ([212.227.15.15]:55991 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733146AbfIEMCO (ORCPT ); Thu, 5 Sep 2019 08:02:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1567684918; bh=Ifg8ScrvmDwqe6DT0xc5FKzrFMpkjXP2CoDGAqSR8Kw=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=JU8ZtJW7Cs/y7o84KN46w39L+ZCoR7OPTknfmpuCV5OD8V53+MXH7NXMWAWQkaF8q oDhmBH8rbONkCNzjnFPMYT+Zzyb5xSE75ivlSHgkeNxOtPAB5rwW7yOX8M9m/KmODh z/a74375T9cydsM86Hw0vbMyI4fte5OTKpNn0q1Q= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.51] ([84.118.159.3]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mj8qd-1ibrou3xmX-00fDo3; Thu, 05 Sep 2019 14:01:58 +0200 Subject: Re: [PATCH 1/1] KVM: inject data abort if instruction cannot be decoded To: Stefan Hajnoczi Cc: Marc Zyngier , James Morse , Julien Thierry , Suzuki K Pouloze , Peter Maydell , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org References: <20190904180736.29009-1-xypron.glpk@gmx.de> <20190905092039.GG32415@stefanha-x1.localdomain> From: Heinrich Schuchardt Message-ID: <561eae08-c5f1-9543-275c-0da0a85cd7df@gmx.de> Date: Thu, 5 Sep 2019 14:01:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190905092039.GG32415@stefanha-x1.localdomain> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:CajlwCQ/dFSIPb9BoBQWcuZxEtLDjozJAje3PZp6uiuat15ZNyn FUaYmh7XqHvansuNFN3EW9g1BL3iSOv26VEPD/OHNNPfz6yRrPAWseemeuNoa2Db4u8FgU4 hRR9abF3JReiH5UubK9R9bDE1itGIlfDiAPGxa+lS6RSJdCZ0Q7uUEqcdnrSYjI2tV0lM2B zhEgrfWIk4Jf6ijAXnw7A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:2BnKRf1R0is=:dW6bd8F7Kb6/NPNuN6OFhb GOEJaRTw800UZN5LtZ2/IFZOLl+53OjXKhKUTr+cOxiqTLiwdIW6pYtJmh7GWde/N5YqKVkGF y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QGI7mtuAiS4spWGCuQvDf ldtDCuxobhlc09zMg0OmAMjBYYRYhcQyy5LpKIPFHd10Y3SomZG8bGQvQT/KdSGTveRDwPRnN Yd7f70iAK5o4000W7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/5/19 11:20 AM, Stefan Hajnoczi wrote: > On Wed, Sep 04, 2019 at 08:07:36PM +0200, Heinrich Schuchardt wrote: >> 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 >> --- >> 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 >> --- 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; > > I see this more as a temporary debugging hack than something to merge. > > It sounds like in your case the guest environment provided good > debugging information and you preferred it over debugging this from the > host side. That's fine, but allowing the guest to continue running in > the general case makes it much harder to track down the root cause of a > problem because many guest CPU instructions may be executed after the > original problem occurs. Other guest software may fail silently in > weird ways. IMO it's best to fail early. > > Stefan > As virtual machine are ubiquitous, expect also mission critical system to run on them. At development time halting a machine may be a good idea. In production this is often the worst solution. Rebooting may be essential for survival. For an anecdotal example see: https://www.hq.nasa.gov/alsj/a11/a11.1201-pa.html I am convinced that leaving it to the guest to decide how to react is the best choice. Best regards Heinrich