kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: vmx: DR7 masking on task switch emulation is wrong
@ 2014-05-19  6:50 Nadav Amit
  2014-05-19 11:00 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Nadav Amit @ 2014-05-19  6:50 UTC (permalink / raw)
  To: pbonzini; +Cc: gleb, tglx, mingo, hpa, x86, kvm, linux-kernel, Nadav Amit

The DR7 masking which is done on task switch emulation should be in hex format
(clearing the local breakpoints enable bits 0,2,4 and 6).

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
---
 arch/x86/kvm/vmx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 138ceff..286d510 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -5439,7 +5439,7 @@ static int handle_task_switch(struct kvm_vcpu *vcpu)
 	}
 
 	/* clear all local breakpoint enable flags */
-	vmcs_writel(GUEST_DR7, vmcs_readl(GUEST_DR7) & ~55);
+	vmcs_writel(GUEST_DR7, vmcs_readl(GUEST_DR7) & ~0x55);
 
 	/*
 	 * TODO: What about debug traps on tss switch?
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: vmx: DR7 masking on task switch emulation is wrong
  2014-05-19  6:50 [PATCH] KVM: vmx: DR7 masking on task switch emulation is wrong Nadav Amit
@ 2014-05-19 11:00 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2014-05-19 11:00 UTC (permalink / raw)
  To: Nadav Amit; +Cc: gleb, tglx, mingo, hpa, x86, kvm, linux-kernel

Il 19/05/2014 08:50, Nadav Amit ha scritto:
> The DR7 masking which is done on task switch emulation should be in hex format
> (clearing the local breakpoints enable bits 0,2,4 and 6).
>
> Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
> ---
>  arch/x86/kvm/vmx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 138ceff..286d510 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -5439,7 +5439,7 @@ static int handle_task_switch(struct kvm_vcpu *vcpu)
>  	}
>
>  	/* clear all local breakpoint enable flags */
> -	vmcs_writel(GUEST_DR7, vmcs_readl(GUEST_DR7) & ~55);
> +	vmcs_writel(GUEST_DR7, vmcs_readl(GUEST_DR7) & ~0x55);
>
>  	/*
>  	 * TODO: What about debug traps on tss switch?
>

Thanks, applying to kvm/queue.

Paolo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-19 11:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-19  6:50 [PATCH] KVM: vmx: DR7 masking on task switch emulation is wrong Nadav Amit
2014-05-19 11:00 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).