Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp746404imu; Fri, 9 Nov 2018 05:31:15 -0800 (PST) X-Google-Smtp-Source: AJdET5eX5zO719kzN9WVNmF+C8cUgpUtBYHYQNBdxGFVOKqeOzJQAVXsOJ4pqWD5fWwkFJbp2gb1 X-Received: by 2002:a17:902:bb89:: with SMTP id m9-v6mr5466955pls.245.1541770275080; Fri, 09 Nov 2018 05:31:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541770274; cv=none; d=google.com; s=arc-20160816; b=GIAjbtfu6xc3gQBVk6+fHwGj+pyvMIDxEnQo3rIj0eR7ZfYp0wJSgBWatHTISCCvo2 sOOn4YeCuccHNgHFzldWCYIi2GPROu5MByJaY9GkOt6JJwntUQJipvnsYwd4tWUL0qBK J//N3xikETscCkxIv9FcfMlaIm3hI0S5EnL6I5ef+kHzsB+02/14B/tzuMuuBHs3gFgL AC3K1Gf051hqn3EhLR3kzbX1ayIcq63JUcUdo7GOuWVFl8LYa+8xviTiLEE7Xlx3YrXy y+SxYOcH7a+D/PgDbyGR7nqzAPVlTYlzcLsKPfqvxuBLCSgSzzjytR5Hb6TPTRmcK3t/ UuCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=1fnEsl2b6udhQJL3gYOo9vFlgUJFTop1UpoWl/kv4Oc=; b=ArJUsK8fEtgnxfU2QwFyz6BHDgft+mw5FcJ9EPTryAW7mHeeYC0dv+UrFM8gkIUpbp voJxxkFlJwCwbf1oyiZKGwYRIBRGl7DCtUeFlLcFnhdpjxkt3YqgrT9wG37l73ToDGpJ UavHfcV+3OJ4bbagLeR/6B+wk2vQYDCkKB2PHPjR+3dUNkwepfmNusFuvqUl14kQ+EAV 2NCuE5Q9tgzaA5H5Cu7jbuavNL1MO0HSiXrLwAacR2+cBH2ZtEO6iF+KITyA8cNI19wk pQly/vtiZZErUcNYIVQ1L9Ri/nTgwY4Q4CC2fG2tMf+Yj/N9wzWYmq/gvihBRl//jZKq kjTg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d24-v6si7601193plr.127.2018.11.09.05.30.42; Fri, 09 Nov 2018 05:31:14 -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; 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 S1727978AbeKIXKj (ORCPT + 99 others); Fri, 9 Nov 2018 18:10:39 -0500 Received: from foss.arm.com ([217.140.101.70]:60228 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727735AbeKIXKj (ORCPT ); Fri, 9 Nov 2018 18:10:39 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 97B7080D; Fri, 9 Nov 2018 05:30:00 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CC9403F5C0; Fri, 9 Nov 2018 05:29:58 -0800 (PST) Date: Fri, 9 Nov 2018 13:29:56 +0000 From: Mark Rutland To: Peter Maydell Cc: Alex =?utf-8?Q?Benn=C3=A9e?= , kvm-devel , Marc Zyngier , Catalin Marinas , Will Deacon , open list , Christoffer Dall , kvmarm@lists.cs.columbia.edu, arm-mail-list Subject: Re: [RFC PATCH] KVM: arm64: don't single-step for non-emulated faults Message-ID: <20181109132955.kqfccmqrugfj5rkl@lakrids.cambridge.arm.com> References: <20181107180120.urnvkcrkh46ytsdb@lakrids.cambridge.arm.com> <20181107180829.sex54bxhd5wyqvan@lakrids.cambridge.arm.com> <87r2fv68us.fsf@linaro.org> <20181108135122.llmfsel32dbe2q7o@lakrids.cambridge.arm.com> <87pnvf63u2.fsf@linaro.org> <20181109115644.f4qjqnv2kogoke42@lakrids.cambridge.arm.com> <87lg625th2.fsf@linaro.org> <20181109124930.axelmyohmrcb63b4@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 09, 2018 at 12:56:54PM +0000, Peter Maydell wrote: > On 9 November 2018 at 12:49, Mark Rutland wrote: > > I'm not saying anything about *decisions*. I'm saying that we can make > > the state consistent by advancing the singlestep state in the same way > > that HW does, at the instant it advances the PC. > > > > i.e. do that in kvm_skip_instr(), as I've done in my local tree. > > > > That mirrors the HW, and we don't need to special-case any handling for > > emulated vs non-emulated instructions. > > You also need to do it in the "set PC because we're making the guest > take an exception" code path, which doesn't go through kvm_skip_instr(). Sure. > This corresponds to the two kinds of "step completed" in hardware as > noted in DDI0487D.a D2.12.3 fig D2-3 footnote b: > * executing the instruction to be stepped without taking an exception > * taking an exception to an exception level that debug exceptions > are enabled from [ie guest EL1 in our case] Thanks for the pointer! Mark.