提交 0e8a0996 编写于 作者: N Nadav Amit 提交者: Paolo Bonzini

KVM: x86: Clear DR7.LE during task-switch

DR7.LE should be cleared during task-switch. This feature is poorly documented.
For reference, see:
http://pdos.csail.mit.edu/6.828/2005/readings/i386/s12_02.htm

SDM [17.2.4]:
  This feature is not supported in the P6 family processors, later IA-32
  processors, and Intel 64 processors.

AMD [2:13.1.1.4]:
  This bit is ignored by implementations of the AMD64 architecture.

Intel's formulation could mean that it isn't even zeroed, but current
hardware indeed does not behave like that.
Signed-off-by: NNadav Amit <namit@cs.technion.ac.il>
Reviewed-by: NRadim Krčmář <rkrcmar@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 518547b3
...@@ -5490,7 +5490,7 @@ static int handle_task_switch(struct kvm_vcpu *vcpu) ...@@ -5490,7 +5490,7 @@ static int handle_task_switch(struct kvm_vcpu *vcpu)
} }
/* clear all local breakpoint enable flags */ /* clear all local breakpoint enable flags */
vmcs_writel(GUEST_DR7, vmcs_readl(GUEST_DR7) & ~0x55); vmcs_writel(GUEST_DR7, vmcs_readl(GUEST_DR7) & ~0x155);
/* /*
* TODO: What about debug traps on tss switch? * TODO: What about debug traps on tss switch?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册