* [PATCH v2] KVM: vmx: Advance rip to after an ICEBP instruction.
@ 2014-04-16 9:02 Huw Davies
2014-04-16 9:22 ` Jan Kiszka
2014-04-28 10:18 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Huw Davies @ 2014-04-16 9:02 UTC (permalink / raw)
To: kvm; +Cc: Gleb Natapov, Paolo Bonzini, Marcelo Tosatti, Jan Kiszka
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 <huw@codeweavers.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] KVM: vmx: Advance rip to after an ICEBP instruction.
2014-04-16 9:02 [PATCH v2] KVM: vmx: Advance rip to after an ICEBP instruction Huw Davies
@ 2014-04-16 9:22 ` Jan Kiszka
2014-04-28 10:18 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2014-04-16 9:22 UTC (permalink / raw)
To: Huw Davies, kvm; +Cc: Gleb Natapov, Paolo Bonzini, Marcelo Tosatti
On 2014-04-16 11:02, 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 <huw@codeweavers.com>
>
> ---
> 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;
> }
>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] KVM: vmx: Advance rip to after an ICEBP instruction.
2014-04-16 9:02 [PATCH v2] KVM: vmx: Advance rip to after an ICEBP instruction Huw Davies
2014-04-16 9:22 ` Jan Kiszka
@ 2014-04-28 10:18 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2014-04-28 10:18 UTC (permalink / raw)
To: Huw Davies, kvm; +Cc: Gleb Natapov, Marcelo Tosatti, Jan Kiszka
Il 16/04/2014 11:02, Huw Davies ha scritto:
> 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 <huw@codeweavers.com>
>
> ---
> 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;
> }
>
This was applied to kvm/next by Marcelo. Thanks for contributing to KVM!
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-28 10:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-16 9:02 [PATCH v2] KVM: vmx: Advance rip to after an ICEBP instruction Huw Davies
2014-04-16 9:22 ` Jan Kiszka
2014-04-28 10:18 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox