WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [HVM] Debug register access question
From: "Travis Betak" <travis.betak@xxxxxxx>
Date: Thu, 17 Aug 2006 18:32:33 -0500 (CDT)
Delivery-date: Thu, 17 Aug 2006 16:33:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>