Re: [PATCH] KVM: Use thread debug register storage instead of kvm specific data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/01/2009 02:16 PM, Avi Kivity wrote:

          set_debugreg(0, 7);
          set_debugreg(vcpu->arch.eff_db[0], 0);
          set_debugreg(vcpu->arch.eff_db[1], 1);
@@ -3645,15 +3638,14 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
      trace_kvm_entry(vcpu->vcpu_id);
      kvm_x86_ops->run(vcpu);

-    if (unlikely(vcpu->arch.switch_db_regs)) {
-        set_debugreg(0, 7);
-        set_debugreg(vcpu->arch.host_db[0], 0);
-        set_debugreg(vcpu->arch.host_db[1], 1);
-        set_debugreg(vcpu->arch.host_db[2], 2);
-        set_debugreg(vcpu->arch.host_db[3], 3);
+ if (unlikely(vcpu->arch.switch_db_regs || test_thread_flag(TIF_DEBUG))) {
IIRC, you must clear dr7 before loading dr0..3 to avoid spurious effects.

Yeah, I thought of it but forgot to implement it.

Actually on the entry path it is done correctly, and on the exit path dr7 is cleared, so this patch is correct.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux