Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3410782imu; Wed, 7 Nov 2018 09:54:29 -0800 (PST) X-Google-Smtp-Source: AJdET5exCcyFpxLP/ATpSbmnV1U3D/yh+NtH/GnblYJGnw07mBY6lclbpRXsZFZywXrZuRlVe3h5 X-Received: by 2002:a62:c60a:: with SMTP id m10-v6mr1170979pfg.15.1541613269877; Wed, 07 Nov 2018 09:54:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541613269; cv=none; d=google.com; s=arc-20160816; b=D6DgyBQ6j8pO1BWiQZPm9MNh2tu8wLVXAtT31HwebjA0J1akSEH8pg1ril0b2IQyfG 6IZ0ZyWTGFJqsE6zCyR4jSq2C3LtMJER+tPK8JXhJ8B6jDxrbyHmQWWsv8v4UMCne5KF 37VdE4BwDtAAvoLI4vgNj33bj0jfjajjWQsKTRs8TSLaYQ8U1XfadQClwlyY7PIPZOtw CvlFlbguhzEuYAgWMhfXo6Olvj/HiGldtDsDtEDBWZniNmpl2aUEyyj+R4JHkpoUbEui MYNiWwygkGRLXdvOaLk00aX6Z6hFhGkXZC/wX2VVwWJNMmv5SpZAjnqjgcpD0HBfVnRq +yXA== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature; bh=7alyjK2h82VBXpRkR+UDz3WifDdbEuYo5P0F+e+rox0=; b=tDIj8itMwAzeY3aCBzwYHQ1m5f4l0nzIeIcSxlE5vjxvKvzhGA9//MQu6UL8NsHpCZ Meyn9+91P0pViD/uLDez6LS0th7HmCtZWvT57V8jy/QxoaX02B0UU8COU6F2u6cHLBxV t/rmyo9cALqJ3e9JymLa2iyZNtMVeRVKsaHFHBvzJMgTjkgU+XaqCTWcegGmqyUUu+2R neMF1KxboybBxzslEFfoGIY7h13967l1GpggEqKVcDR3OsQ45qE1KwAQo0FqRQ+nK1k1 Br6uev8MCqTdxL2sUGUmLgytIU74KJPN2FwchIVTyFUB3LLKMFyRnUbAYy/pnlOhP0yR 7ZJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jcu0KVkq; 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 62-v6si1281502plf.308.2018.11.07.09.54.15; Wed, 07 Nov 2018 09:54:29 -0800 (PST) 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=jcu0KVkq; 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 S1731624AbeKHDZJ (ORCPT + 99 others); Wed, 7 Nov 2018 22:25:09 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:45191 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731459AbeKHDZI (ORCPT ); Wed, 7 Nov 2018 22:25:08 -0500 Received: by mail-ot1-f67.google.com with SMTP id g10so15549990otl.12 for ; Wed, 07 Nov 2018 09:53:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=7alyjK2h82VBXpRkR+UDz3WifDdbEuYo5P0F+e+rox0=; b=jcu0KVkqywPUWoedZFwe8Zh2RHuc3dGzxZMfmVThsh8dRP2fig+NvPN3EUVdW5VKH9 bqzGdFsBcN3zsq+OWAv4z2JHZ2BKEX4jJJmfu3u8FluVMbiV7acFIhEsFX8V0KE2qByV izZ+cE+W4Tangyucyw4q4cmtCJvAVdg2kwkWc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=7alyjK2h82VBXpRkR+UDz3WifDdbEuYo5P0F+e+rox0=; b=rKTzAxaHiZv3VWScN3dTC3UJlThTtk2A2gwhPDUNGkKPQisEE+eSGIDoxR62juCewm Me38ul744CI2vUVQRazMwDN+qYtqOG9utyTaeMOy2iB48C2loO5k2eCSg2SXH0iNFbcU 0MGJzj0nSmvp2cuc3h6p95GfIODjT+cAHL5EqY0HEeQyWEW5bOTo+z47Nt1Uc6STx6W4 KCGllObJ/thOwFLCzPtviYhdHpelsAM1o10AlcqWEye5jv4ASu8CX5cTbU9hLVvCLuG1 6jOSAQRZEBR2CfonN8SDpVvJPHWSnb9qMF60VgUiakfw0YiVT504r5XwNp7qFZnAh+Eo 6clw== X-Gm-Message-State: AGRZ1gLiOO/ydXft8wY9yuqlmGgL64xazPlQ4L/BmYniH9yrcer3qVlg 77m07lhvgaTAm7iSI3zv747UwcNpieA1eSAesxa6EA== X-Received: by 2002:a9d:12d:: with SMTP id 42mr688427otu.352.1541613220630; Wed, 07 Nov 2018 09:53:40 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a9d:4b0e:0:0:0:0:0 with HTTP; Wed, 7 Nov 2018 09:53:20 -0800 (PST) In-Reply-To: References: <20181107171031.22573-1-alex.bennee@linaro.org> From: Peter Maydell Date: Wed, 7 Nov 2018 17:53:20 +0000 Message-ID: Subject: Re: [RFC PATCH] KVM: arm64: don't single-step for non-emulated faults To: =?UTF-8?B?QWxleCBCZW5uw6ll?= Cc: kvm-devel , arm-mail-list , kvmarm@lists.cs.columbia.edu, Christoffer Dall , Marc Zyngier , Catalin Marinas , Will Deacon , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7 November 2018 at 17:39, Peter Maydell wrote= : > On 7 November 2018 at 17:10, Alex Benn=C3=A9e wr= ote: >> Not all faults handled by handle_exit are instruction emulations. For >> example a ESR_ELx_EC_IABT will result in the page tables being updated >> but the instruction that triggered the fault hasn't actually executed >> yet. We use the simple heuristic of checking for a changed PC before >> seeing if kvm_arm_handle_step_debug wants to claim we stepped an >> instruction. >> >> Signed-off-by: Alex Benn=C3=A9e > > What's the rationale for this change? Presumably it's fixing > something, but the commit message doesn't really say what... > > This feels to me like it's working around the fact that > we've separated two things ("advance pc (or set it if we're > going to make the guest take an exception)" and "notice that > we have completed a single step") that should be handled > at one point in the code. ...so for instance if your guest PC is at the entrypoint for an exception, and you singlestep and take the same exception again, this should count as a single step completed, even though the PC has not changed. Granted, that's a little contrived, but it can happen in cases where the guest gets completely confused and is sitting in a tight loop taking exceptions because there's no ram at the vector table address, or whatever. thanks -- PMM