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

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

To: "Travis Betak" <travis.betak@xxxxxxx>
Subject: Re: [Xen-devel] [HVM] Debug register access question
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <Pine.LNX.4.62.0608171812110.5724@twinkletoes01>
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>
References: <Pine.LNX.4.62.0608171812110.5724@twinkletoes01>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>