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

[Xen-devel] [HVM] Debug register access question



Hello all,

I'm adding the lazy save/restore of hardware debug registers to the SVM part of HVM and I'm slightly confused about something done in the VMX counterpart.

The intercept for debug registers is enabled until the first access. The hypervisor takes note that the guests debug registers are now dirty and disables the debug register intercept allowing the guest free access to the registers.

My question is this. On the debug register access, why is the EIP updated? I don't understand some of the finer details of VT but by updating the EIP, doesn't this initial debug register access get lost? I've included the two snippets of code in question below and a patch to remove EIP update if it is wrong.

  --travis

---

static void vmx_dr_access(unsigned long exit_qualification,
                          struct cpu_user_regs *regs)
{
    struct vcpu *v = current;

    v->arch.hvm_vcpu.flag_dr_dirty = 1;

    /* We could probably be smarter about this */
    __restore_debug_registers(v);

    /* Allow guest direct access to DR registers */
    v->arch.hvm_vcpu.u.vmx.exec_control &= ~CPU_BASED_MOV_DR_EXITING;
    __vmwrite(CPU_BASED_VM_EXEC_CONTROL,
              v->arch.hvm_vcpu.u.vmx.exec_control);
}

[snip ...]

    case EXIT_REASON_DR_ACCESS:
        __vmread(EXIT_QUALIFICATION, &exit_qualification);
        vmx_dr_access(exit_qualification, &regs);
        __get_instruction_length(inst_len);
        __update_guest_eip(inst_len);
        break;

---

Attachment: dont-update-eip-on-dr-access.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.