All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Kagstrom <simon.kagstrom@bth.se>
To: Hollis Blanchard <hollisb@us.ibm.com>
Cc: xen-devel list <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] paging_enabled and non-HVM guests
Date: Wed, 10 May 2006 08:06:20 +0200	[thread overview]
Message-ID: <87r7325s83.wl%simon.kagstrom@bth.se> (raw)
In-Reply-To: <1147204426.19485.67.camel@basalt.austin.ibm.com>

At Tue, 09 May 2006 14:53:46 -0500,
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@bth.se>
> > 
> > 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.

OK, I guess that sounds reasonable. Checks for HVM guests are done on
a number of other places as well in libxc, however. Is the support
meant to be transparent between HVM and PV guests?

I won't argue for an incorrect fix, but as the code is right now it
segmentation faults because the virtual address passed to

        page = page_array[va >> PAGE_SHIFT] << PAGE_SHIFT;

(with libxc incorrectly believing paging is disabled) accesses outside
of page_array. I'll keep the patch privately for now since gdbserver
breaks without it.

// Simon

  parent reply	other threads:[~2006-05-10  6:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-09 11:31 [PATCH] paging_enabled and non-HVM guests Simon Kagstrom
2006-05-09 19:53 ` Hollis Blanchard
2006-05-09 20:14   ` Anthony Liguori
2006-05-09 20:26     ` Ryan Harper
2006-05-10  6:06   ` Simon Kagstrom [this message]
2006-05-10 14:51     ` Hollis Blanchard
2006-05-10 15:42       ` Hollis Blanchard
2006-05-10 18:35         ` Simon Kagstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r7325s83.wl%simon.kagstrom@bth.se \
    --to=simon.kagstrom@bth.se \
    --cc=hollisb@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.