Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp536356ybe; Thu, 5 Sep 2019 01:47:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJkETpOtN0aBK4OHAIr0yYMYlUfOH91ZqO8bgC7Zm/jryUoyrauFCiieeQeC8TyS744XjX X-Received: by 2002:aa7:869a:: with SMTP id d26mr2480012pfo.2.1567673251519; Thu, 05 Sep 2019 01:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567673251; cv=none; d=google.com; s=arc-20160816; b=EW73ZxIRtlw18caAYTUrEcgpAN+xFRc55sJwy/2bc+r9yLaX2rhHMxvMCYzkQ00hGG G/haLvTEOQ6tQC/0n6AH0Lxze+Z1jA0Qh+OHqy4UB4MY4ftMAQd+RgEnfCZu+3oYFiqW NMoWXZ2ggakEO4zdCYxJa0O5FQ+mShFPGLcPvYGbTy6XhtfGKKyEcp/ci5dyXL59CVSJ 5dKzfoonzJsjivu+gyk7XxsHrWkOYL698Er5XeCKmx6ePkBxUDm8lo4C3Ooij/cOvoqW sXb8PsKd7TzatmMoFwvxzC07viuVca7BGYqV00YLA/WiYa+dQGd3ZjbCjZsPVYIF72i1 PEgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0xPzSESc4AZSzOz8iuenGzI1AlT1OxyaOVK/bXB62NU=; b=ov2BIGr9Pq10qA31cf/+2D1ZXSOZC1o0czcP0jrdhe74R/B/nBSXq36rOgeaE4J9mP ZN8rh0Db3KXYzQITRyOrpsdSiH7YCwIhns2zydE19titZhCYQPt8Yvhm4oVoaURZCRsQ Fl/yYesxDxk40ViIeZUNaYDsOXgnHgQNf6VYxHXWiVRK58y8NBoNXM3LUwUaV1g55YNo Dch8I2leluJI8GcbI0mEj3Y6ef2dBDCF4n7o9UczNpB6+qgL6Qu9aev+6kgbuDFXue5T NbRYTMAfh8GiO7aRZlPyqBQhTiH5uP/jeZVJ5f4ngitNiFnR3bEOE99gpSOTzpD7/yzi X2tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OuTz5wvU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j23si1498878pfr.41.2019.09.05.01.47.14; Thu, 05 Sep 2019 01:47:31 -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=@linaro.org header.s=google header.b=OuTz5wvU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731775AbfIEIRG (ORCPT + 99 others); Thu, 5 Sep 2019 04:17:06 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:46958 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730937AbfIEIRG (ORCPT ); Thu, 5 Sep 2019 04:17:06 -0400 Received: by mail-ot1-f65.google.com with SMTP id g19so1260252otg.13 for ; Thu, 05 Sep 2019 01:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0xPzSESc4AZSzOz8iuenGzI1AlT1OxyaOVK/bXB62NU=; b=OuTz5wvUQ35QYkpSKKPCxxQaaU1HK9r2e88MGLbbYqoqxReti2Duuk8kuS0KYSC1Ip pdHLMs7zhO419UJhHXlo+5eiLjxOlJzvBJvCkJ3krsKonpbm0VX4vie2pR8FyWB7NvC8 xwNADNZ++jqxlZ73zV3Fv4RHQ1CtN/gCiJYwY6zC+I9oUFbUzixbhoF1ofdOq8nGsV/x zsdighpHoFIa+hFO9Gfuw4SI4cNG/br0SpICPLmLwP7JT0b8Rw1es+25pX61XTWttPNd pNvFwcXfQACkPtI8sYYB2mxINaHDTZiPwLrnEMjPnV1KdzshSBt/8xJLmUURA816hh65 xaDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0xPzSESc4AZSzOz8iuenGzI1AlT1OxyaOVK/bXB62NU=; b=XDIm8UwLNyHxhlTc7uvTfWNWAkL11RxpARXh4f+miUc+NoPWc2ZoLfLqetz4uxJMJE dwz9KCBq07uWB0X6wUZwnqDFnApOD+9y/ccjqALCKsTm7lnhaPxkFv1d/V510w5Nexk3 O/y/tmlswHx+4zgrjUf70iPhVgvzpxjuARXhNMBKYrEiepv7R2KCeOpYmbgrZVH3b0Nm ihTITPhwIPQPe0KYyVeLj5gkvFBEC4mWFDG5C00+yD20++aTnE5qQCtN87AqnSSro8zZ PddLlA2QDo/QfxXHMsBeF4MH/Eh5rvrrEs7H5xDlilDbQs7C6BFaDsPj9FfUWnAvYrNY F1CQ== X-Gm-Message-State: APjAAAVm/QPJGb+UaL+NJVtpz0lEYqoYmVN/38GtRkr7gHBQNfDJOW2a i+5wlNp8GEcrQV3pM3/DLYSZvgsxuf2c10W2JQz/lg== X-Received: by 2002:a9d:5e11:: with SMTP id d17mr1498113oti.135.1567671425605; Thu, 05 Sep 2019 01:17:05 -0700 (PDT) MIME-Version: 1.0 References: <20190904180736.29009-1-xypron.glpk@gmx.de> <86r24vrwyh.wl-maz@kernel.org> In-Reply-To: <86r24vrwyh.wl-maz@kernel.org> From: Peter Maydell Date: Thu, 5 Sep 2019 09:16:54 +0100 Message-ID: Subject: Re: [PATCH 1/1] KVM: inject data abort if instruction cannot be decoded To: Marc Zyngier Cc: Heinrich Schuchardt , James Morse , Julien Thierry , Suzuki K Pouloze , Stefan Hajnoczi , =?UTF-8?Q?Daniel_P_=2E_Berrang=C3=A9?= , arm-mail-list , kvmarm@lists.cs.columbia.edu, lkml - Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 Sep 2019 at 09:04, Marc Zyngier wrote: > How can you tell that the access would fault? You have no idea at that > stage (the kernel doesn't know about the MMIO ranges that userspace > handles). All you know is that you're faced with a memory access that > you cannot emulate in the kernel. Injecting a data abort at that stage > is not something that the architecture allows. To be fair, locking up the whole CPU (which is effectively what the kvm_err/ENOSYS is going to do to the VM) isn't something the architecture allows either :-) > Of course, the best thing would be to actually fix the guest so that > it doesn't use non-emulatable MMIO accesses. In general, that the sign > of a bug in low-level accessors. 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... thanks -- PMM