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/
Home Products Support Community News


Re: [Xen-devel] [PATCH] paging_enabled and non-HVM guests

To: Anthony Liguori <aliguori@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] paging_enabled and non-HVM guests
From: Ryan Harper <ryanh@xxxxxxxxxx>
Date: Tue, 9 May 2006 15:26:57 -0500
Cc: Simon Kagstrom <simon.kagstrom@xxxxxx>, xen-devel list <xen-devel@xxxxxxxxxxxxxxxxxxx>, Hollis Blanchard <hollisb@xxxxxxxxxx>
Delivery-date: Tue, 09 May 2006 13:27:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4460F832.4060808@xxxxxxxxxx>
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: <87wtcv5t9e.wl%simon.kagstrom@xxxxxx> <1147204426.19485.67.camel@xxxxxxxxxxxxxxxxxxxxx> <4460F832.4060808@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
* Anthony Liguori <aliguori@xxxxxxxxxx> [2006-05-09 15:15]:
> Hollis Blanchard wrote:
> >On Tue, 2006-05-09 at 13:31 +0200, Simon Kagstrom wrote:
> >  
> >>I had a problem with the GDB-server crashing on connections in
> >>xen_ptrace.c:map_domain_va(). paging_enabled() should only be checked
> >>for HVM guests, and the patch adds a check for that.
> >>
> >>Signed-off-by: Simon Kagstrom <ska@xxxxxx>
> >>
> >>diff -r 4501d60d6add tools/libxc/xc_ptrace.c
> >>--- a/tools/libxc/xc_ptrace.c       Tue May  9 09:57:05 2006
> >>+++ b/tools/libxc/xc_ptrace.c       Tue May  9 13:26:14 2006
> >>@@ -374,7 +374,7 @@
> >>     if (fetch_regs(xc_handle, cpu, NULL))
> >>         return NULL;
> >> 
> >>-    if (!paging_enabled(&ctxt[cpu])) { 
> >>+    if ( (ctxt[cpu].flags & VGCF_HVM_GUEST) && 
> >>!paging_enabled(&ctxt[cpu])) { static void * v;
> >>         unsigned long page;
> >>    
> >
> >I looked at this a couple weeks ago, and I think the real problem is
> >that the CR registers are never updated in Xen's vcpu structure, and so
> >xc_vcpu_getcontext() doesn't get them either. So Xen should be fixed; we
> >shouldn't add workarounds to userland.
> >  
> I think that the CR registers are never changed during the life of a PV 
> domain.  I think all that's needed is for some sane values to be set 
> during domain creation and things start working.  I believe Ryan had a 
> patch that did this?

Well, I only hacked up enough to get things functional.  I didn't know
what cr4 should look like so I skipped that check.  Here are the two
patches I needed to debug paravirt 64-bit domUs via gdb.  I was going to
look into abstracting out the index into the page_array (it is only
needed on domains with shadow paging; non-shadow page tables
already have mfns).

Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253

Attachment: fix_ptrace_paravirt64.patch
Description: Text document

Attachment: setup_sane_cr0.patch
Description: Text document

Xen-devel mailing list