From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] KVM: vmx: Advance rip to after an ICEBP instruction. Date: Tue, 15 Apr 2014 18:46:11 +0200 Message-ID: <534D6253.6060405@siemens.com> References: <1397569210-31612-1-git-send-email-huw@codeweavers.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , Paolo Bonzini , Marcelo Tosatti To: Huw Davies , kvm Return-path: Received: from david.siemens.de ([192.35.17.14]:49951 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750932AbaDOQrn (ORCPT ); Tue, 15 Apr 2014 12:47:43 -0400 In-Reply-To: <1397569210-31612-1-git-send-email-huw@codeweavers.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2014-04-15 15:40, Huw Davies wrote: > When entering an exception after an ICEBP, the saved instruction > pointer should point to after the instruction. > > This fixes the bug here: https://bugs.launchpad.net/qemu/+bug/1119686 > > Signed-off-by: Huw Davies > --- > arch/x86/kvm/vmx.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 1f68c58..4c41d7a 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -4841,6 +4841,9 @@ static int handle_exception(struct kvm_vcpu *vcpu) > (KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP))) { > vcpu->arch.dr6 &= ~15; > vcpu->arch.dr6 |= dr6; > + if (dr6 == 0) /* icebp */ In arch/x86/kernel/traps.c, DR6_RESERVED is first masked out before testing the result against 0 - that's probably more robust here, too. Jan > + skip_emulated_instruction(vcpu); > + > kvm_queue_exception(vcpu, DB_VECTOR); > return 1; > } > -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux