KVM: vmx: Advance rip to after an ICEBP instruction.
PATCH v2 1/1 KVM: vmx: Advance rip to after an ICEBP instruction.
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
---
v2: Mask off DR6_RESERVED before comparing to zero.
arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+)
arch/x86/kvm/vmx.c +3 -0
@@ -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 ; }
Signature · 1 line
1.8.0
Quoted 19 lines · Huw Davies
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 <[email protected]>---
v2: Mask offDR6_RESERVEDbefore comparing to zero.arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kvm/vmx.c +0
-0
arch/x86/kvm/vmx.c static int handle_exception(struct kvm_vcpu *vcpu) · line 4849
Quoted 9 lines
arch/x86/kvm/vmx.c +3
-0@@ -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 ; }
Signature · 2 lines
Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux
Paolo Bonzini
maintainerIl 16/04/2014 11:02, Huw Davies ha scritto:
Quoted 19 lines
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 <[email protected]>---
v2: Mask offDR6_RESERVEDbefore comparing to zero.arch/x86/kvm/vmx.c | 3 +++ 1 file changed, 3 insertions(+)arch/x86/kvm/vmx.c +0
-0
arch/x86/kvm/vmx.c static int handle_exception(struct kvm_vcpu *vcpu) · line 4849
Quoted 9 lines
arch/x86/kvm/vmx.c +3
-0@@ -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 ; }
This was applied to kvm/next by Marcelo. Thanks for contributing to KVM!
Paolo