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

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


  • To: "Travis Betak" <travis.betak@xxxxxxx>
  • From: "George Dunlap " <dunlapg@xxxxxxxxx>
  • Date: Fri, 18 Aug 2006 17:44:49 -0400
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 18 Aug 2006 14:45:12 -0700
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=sgEaXGq0PkhybqW+suh+K+oE5thVsRTY+fvk/fL2/vxveeWvFEF0v8xThqt9wTvBroiagg9sp4t9UjKVT4ZiLisQrvdII5VRIcyb4mQqGQMnZ447W4J29Z98EOEoeOWEQHWVgo4XpSDSICJEynmwKylnQL3tImeDagmLS+bSWOM=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Good catch.  Do you have a simple test to verify that the new patch
works properly?
-George

On 8/17/06, Travis Betak <travis.betak@xxxxxxx> wrote:
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;

---

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





_______________________________________________
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®.