From mboxrd@z Thu Jan 1 00:00:00 1970 From: Huw Davies Subject: [PATCH v2] KVM: vmx: Advance rip to after an ICEBP instruction. Date: Wed, 16 Apr 2014 10:02:51 +0100 Message-ID: <1397638971-12840-1-git-send-email-huw@codeweavers.com> Cc: Gleb Natapov , Paolo Bonzini , Marcelo Tosatti , Jan Kiszka To: kvm Return-path: Received: from mail.codeweavers.com ([216.251.189.131]:49558 "EHLO mail.codeweavers.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754989AbaDPJC5 (ORCPT ); Wed, 16 Apr 2014 05:02:57 -0400 Sender: kvm-owner@vger.kernel.org List-ID: 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 --- v2: Mask off DR6_RESERVED before comparing to zero. 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..930a0df 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 & ~DR6_RESERVED)) /* icebp */ + skip_emulated_instruction(vcpu); + kvm_queue_exception(vcpu, DB_VECTOR); return 1; } -- 1.8.0