Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753314AbdHBUNr (ORCPT ); Wed, 2 Aug 2017 16:13:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51042 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751991AbdHBUNo (ORCPT ); Wed, 2 Aug 2017 16:13:44 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BED4D883AD Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=rkrcmar@redhat.com Date: Wed, 2 Aug 2017 22:13:38 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com, me@kylehuey.com Subject: Re: [PATCH] KVM: svm: support single stepping over emulated instructions Message-ID: <20170802201338.GA32318@flask> References: <1501689810-20638-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1501689810-20638-1-git-send-email-pbonzini@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 02 Aug 2017 20:13:44 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 873 Lines: 28 2017-08-02 18:03+0200, Paolo Bonzini: > Use kvm_skip_emulated_instruction so that debug exceptions are > properly injected. This fixes debug.flat on AMD machines. > > Signed-off-by: Paolo Bonzini > --- We already have b742c1e6e79d ("KVM: SVM: handle singlestep exception when skipping emulated instructions"), so the only applicable part of this patch is > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 0e846f0cb83b..931ba449456e 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -5548,6 +5548,7 @@ static void kvm_vcpu_do_singlestep(struct kvm_vcpu *vcpu, int *r) > */ > vcpu->arch.dr6 &= ~15; > vcpu->arch.dr6 |= DR6_BS | DR6_RTM; > + kvm_update_dr6(vcpu); > kvm_queue_exception(vcpu, DB_VECTOR); > } > } which makes sense. And shouldn't we do the same for kvm_vcpu_check_breakpoint()? Thanks.