Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp708384imu; Fri, 9 Nov 2018 04:57:54 -0800 (PST) X-Google-Smtp-Source: AJdET5cpvL9TZr7DW+lt59hrkVd0zy8qZphzpOgYeoLy1s6LE1RKCJF3oCgYTeHPC4U+ASrCN+FZ X-Received: by 2002:a17:902:3fe4:: with SMTP id a91-v6mr8730656pld.295.1541768274182; Fri, 09 Nov 2018 04:57:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541768274; cv=none; d=google.com; s=arc-20160816; b=IWlHPculjdmRSJKo5jB06bAjWnA3Ucf6w/eFRbLo9fnE1n1FFjLdNZETk6pO4ZRfhs BpDCDReJ1eaoLhsrovkTgiHgqt/qOjBec8hB3G65h+gTgzBoug+UCnDYye2LgZQp5YZn 9h6eGGHO8G4wPpS6zV1KlD7aD09PpTDK2BnD6WpAIfeqwqBXFHpq2Pio3fmf+bSiO0vR /bsm/8o30DWqmTa+SFV0ZQ2ANi+hgNg6E6pHOZlyXppb3R1VwOPP80Mfe/0CIHr8lOXY 7W3v9xIUCPTRFAhDRSgAOP2cPoIac/L6Fq6huCrTXb6/QVds+C4bVDyH6cX6RP3oZhsS OrDg== 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 :references:in-reply-to:mime-version:dkim-signature; bh=yDn9ONY159qDhkGpErdgo9aiZ+9sFsf7vC33KsLlIaU=; b=Jv7ILX5tBEyOZ/RBHmlPLbx4rQQrbjlbfqU34vDpsyQ7bTQVE/fKLIfkVtPbVsNxIK Lrm7VOA5hvXpKR451ll9Xw5uqbJtqOrIntxST2ZW83+9Y4a8875gK912+rq61UJTnFCS X7lqqmWMOiVnyxEYzguyOC4NdRKykxr64dX/6exu7DHvViZRg4Vidc1q5npDZGCqVrtM 6wvo+8C2zehPNcDSjaDigkBj3ZRIdTXT2BaXV9aC8bPE8vyfuF5RZKzsxauFKPk4juPj i+y+7Yn+qcB7jAL/zDs6kyPYq/ftoxvdotgGtvdqbJ8HaGGz/szWEHyWcZ6C9qFeEjde 6DgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EsR3rr+y; 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-v6si7844468plf.308.2018.11.09.04.57.37; Fri, 09 Nov 2018 04:57:54 -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=EsR3rr+y; 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 S1727843AbeKIWhq (ORCPT + 99 others); Fri, 9 Nov 2018 17:37:46 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:42589 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727731AbeKIWhp (ORCPT ); Fri, 9 Nov 2018 17:37:45 -0500 Received: by mail-oi1-f194.google.com with SMTP id x63-v6so1345397oix.9 for ; Fri, 09 Nov 2018 04:57:15 -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; bh=yDn9ONY159qDhkGpErdgo9aiZ+9sFsf7vC33KsLlIaU=; b=EsR3rr+yQi8RnTOb63Nsnd0KawNl8Aq69twqd24qYfmXL5abQmno1kQcDM5XwHNtrw L+NWPNhxAHoqZCMInUVI3+lbR5U0Bb+ce1scphvP2HyCTj9po3quLQsLlGtABc8qzVoJ stblN49hH0KZgxrcvv6ZpYHSpLggtrw4WChPg= 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; bh=yDn9ONY159qDhkGpErdgo9aiZ+9sFsf7vC33KsLlIaU=; b=RReeYoMiqk8uNtYwF0ZHw5//6VrUaq9EG88kngAIihPJPsvOOcJps0hGJDOrtXg1YT d5ZM/Aulz3IdtPj5fhlw8hnvt8nCUqg37rD0jMcB7TAj8NzFUBrZAmnMcykzPGaE1MY6 Fpxdbt/2b31vmdlH0blf/pZJI6+cjUDf/A0HR3tq84T39w5YCw6LlMT5BTaiPGthnntK JTeNh0OB/CDGsy6VonDzGKtVlRfA76cn8EYn3tNSiS5hpGeoEmdyrgNfQF8fJw5GmBhd 54SKkrxd48aAZT1Ygj6ckIHyhsT9AGRubZWMZVw/8Ae0DXeUQRwB6R5ZytQyJQmK4OAI iqmg== X-Gm-Message-State: AGRZ1gLAU1PE/DadLCrdyY6JY/hhmjySCwKOun6YNQI9oVO48XTYqK5Y uqoduYk7jrxsE78JYcAf91gUS3YjF73bzH5k0v8scg== X-Received: by 2002:aca:f1d6:: with SMTP id p205-v6mr5135282oih.332.1541768234955; Fri, 09 Nov 2018 04:57:14 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a9d:4b0e:0:0:0:0:0 with HTTP; Fri, 9 Nov 2018 04:56:54 -0800 (PST) In-Reply-To: <20181109124930.axelmyohmrcb63b4@lakrids.cambridge.arm.com> References: <20181107171031.22573-1-alex.bennee@linaro.org> <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> From: Peter Maydell Date: Fri, 9 Nov 2018 12:56:54 +0000 Message-ID: Subject: Re: [RFC PATCH] KVM: arm64: don't single-step for non-emulated faults To: Mark Rutland Cc: =?UTF-8?B?QWxleCBCZW5uw6ll?= , kvm-devel , Marc Zyngier , Catalin Marinas , Will Deacon , open list , Christoffer Dall , kvmarm@lists.cs.columbia.edu, arm-mail-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 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(). 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 -- PMM