Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp618592ybe; Thu, 5 Sep 2019 03:17:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQEKIZZ7WgCk92BDIFHHFb0r3fvg2azvgYmAzkStr+GDqavxXUZBedgtX6Pe3lRpYCU8vN X-Received: by 2002:a65:640d:: with SMTP id a13mr2439042pgv.256.1567678633778; Thu, 05 Sep 2019 03:17:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567678633; cv=none; d=google.com; s=arc-20160816; b=RxbsnVrLvmXkwgxC5GxgmFMnmC5DYN3ZRSmGgamfI2rnaPlt05cxDSB1RY/9ZHHYPA cNziVSaInh7/p+ER4/Ve2OqaSu2DYZKEbxJgw5RId6MQuld7J11jVTPs/gT5pu/jqfYp BIXysTKqk+Oc0HfEP+uwZQjNFGv3u/spU61JDKmtQlyq0ywq1bn/liB1XRpAC6YaZP4M d7nW4VEn+qiyUsRjBQ3g0WHI3T93DyUjhJmYf6XNw8+oE7JgrhhkqfI+XK9u/uMsvf3z QWnDe+0P5BJbSpAi4Uk1ddJ3D9FLyx0k7dOK9erb2/8u44da7Rzj9+B7RKmp8134oMgl NenQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:user-agent :references:in-reply-to:subject:cc:to:from:message-id:date; bh=O/Iygw8Q+ZSXBEc3N/DN2S3XxZoSt1QzuMvAJe/1ffQ=; b=uudvi4eg8fI3zHBzuCUqGAlPX/IGqoVS39BEtkbAqK5JGQ4cacTvJXMWYzpMF0LvU5 1daVaXWuCSmevFa0xq1uCDuXJxsBH2ZeDQfZcVOrA2MRueDEAun8g0Ajt0V6JDbLBxNu NU0IuYP1wYJ9YBkakHdztCr/KTHAz8FYwgaXLoE3C9Bwndl1FgWyEpGeXsgeZy8KGLq0 HMLAswpuDQ7p5FhPqccov8THvwveiRnXtvABg5zTYy+sGi2Vnp4ObCVkWNK94ctKpVNo ORLkl2bIzawJGgk8eh6gUUuy4xWUpYSuMDFsmxoNEHAnOX1PdX78OaZcdmwyIow+dbeu 3WwQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8si1401239pgj.239.2019.09.05.03.16.57; Thu, 05 Sep 2019 03:17:13 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731706AbfIEJPy (ORCPT + 99 others); Thu, 5 Sep 2019 05:15:54 -0400 Received: from foss.arm.com ([217.140.110.172]:39936 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731109AbfIEJPy (ORCPT ); Thu, 5 Sep 2019 05:15:54 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 89DE9360; Thu, 5 Sep 2019 02:15:53 -0700 (PDT) Received: from big-swifty.misterjones.org (unknown [10.1.27.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1612E3F67D; Thu, 5 Sep 2019 02:15:50 -0700 (PDT) Date: Thu, 05 Sep 2019 10:15:49 +0100 Message-ID: <86k1anrtmi.wl-maz@kernel.org> From: Marc Zyngier To: Peter Maydell Cc: Heinrich Schuchardt , James Morse , Julien Thierry , Suzuki K Pouloze , Stefan Hajnoczi , =?UTF-8?B?IkRhbmllbCBQIC4gQmVycmFuZ8OpIg==?= , arm-mail-list , kvmarm@lists.cs.columbia.edu, lkml - Kernel Mailing List Subject: Re: [PATCH 1/1] KVM: inject data abort if instruction cannot be decoded In-Reply-To: References: <20190904180736.29009-1-xypron.glpk@gmx.de> <86r24vrwyh.wl-maz@kernel.org> <86mufjrup7.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: Approximate MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 05 Sep 2019 09:56:44 +0100, Peter Maydell wrote: > > On Thu, 5 Sep 2019 at 09:52, Marc Zyngier wrote: > > > > On Thu, 05 Sep 2019 09:16:54 +0100, > > Peter Maydell wrote: > > > This is true, but the problem is that barfing out to userspace > > > makes it harder to debug the guest because it means that > > > the VM is immediately destroyed, whereas AIUI if we > > > inject some kind of exception then (assuming you're set up > > > to do kernel-debug via gdbstub) you can actually examine > > > the offending guest code with a debugger because at least > > > your VM is still around to inspect... > > > > To Christoffer's point, I find the benefit a bit dubious. Yes, you get > > an exception, but the instruction that caused it may be completely > > legal (store with post-increment, for example), leading to an even > > more puzzled developer (that exception should never have been > > delivered the first place). > > Right, but the combination of "host kernel prints a message > about an unsupported load/store insn" and "within-guest debug > dump/stack trace/etc" is much more useful than just having > "host kernel prints message" and "QEMU exits"; and it requires > about 3 lines of code change... Which is wrong, and creates a new behaviour that isn't specified anywhere. > > > I'm far more in favour of dumping the state of the access in the run > > structure (much like we do for a MMIO access) and let userspace do > > something about it (such as dumping information on the console or > > breaking). It could even inject an exception *if* the user has asked > > for it. > > ...whereas this requires agreement on a kernel-userspace API, > larger changes in the kernel, somebody to implement the userspace > side of things, and the user to update both the kernel and QEMU. > It's hard for me to see that the benefit here over the 3-line > approach really outweighs the extra effort needed. 3 lines that already require the host kernel to be updated, and create a legacy that we'll never be able to get rid of. > In practice saying "we should do this" is saying "we're going to do > nothing", based on the historical record. Thanks for the vote of confidence... M. -- Jazz is not dead, it just smells funny.