All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Cc: Keir Fraser <keir@xen.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Don Slutz <dslutz@verizon.com>,
	xen-devel@lists.xen.org, Jan Beulich <jbeulich@suse.com>
Subject: Re: [BUGFIX][PATCH 4/4] XEN_DOMCTL_gdbsx_guestmemio: always do the copyback.
Date: Tue, 7 Jan 2014 10:00:24 +0000	[thread overview]
Message-ID: <1389088824.31766.105.camel@kazak.uk.xensource.com> (raw)
In-Reply-To: <20140106175349.6cbd190b@mantra.us.oracle.com>

On Mon, 2014-01-06 at 17:53 -0800, Mukesh Rathor wrote:
> On Sat,  4 Jan 2014 12:52:16 -0500
> Don Slutz <dslutz@verizon.com> wrote:
> 
> > The gdbsx code expects that domctl->u.gdbsx_guest_memio.remain is
> > returned.
> > 
> > Without this gdb does not report an error.
> > 
> > With this patch and using a 1G hvm domU:
> > 
> > (gdb) x/1xh 0x6ae9168b
> > 0x6ae9168b:     Cannot access memory at address 0x6ae9168b
> > 
> > Signed-off-by: Don Slutz <dslutz@verizon.com>
> > ---
> >  xen/arch/x86/domctl.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
> > index ef6c140..4aa751f 100644
> > --- a/xen/arch/x86/domctl.c
> > +++ b/xen/arch/x86/domctl.c
> > @@ -997,8 +997,7 @@ long arch_do_domctl(
> >              domctl->u.gdbsx_guest_memio.len;
> >  
> >          ret = gdbsx_guest_mem_io(domctl->domain,
> > &domctl->u.gdbsx_guest_memio);
> > -        if ( !ret )
> > -           copyback = 1;
> > +        copyback = 1;
> >      }
> >      break;
> >  
> 
> Ooopsy... my thought was that an application should not even look at
> remain if the hcall/syscall failed, but forgot when writing the
> gdbsx itself :). Think of it this way, if the call didn't even make it to 
> xen, and some reason the ioctl returned non-zero rc, then remain would 
> still be zero. So I think we should fix gdbsx instead of here:
> 
> xg_write_mem():
>     if ((rc=_domctl_hcall(XEN_DOMCTL_gdbsx_guestmemio, frombuf, buflen)))
>     {
>         XGERR("ERROR: failed to write %d bytes. errno:%d rc:%d\n",
>                iop->remain, errno, rc);

Isn't this still using iop->remain on failure which is what you say
shouldn't be done?

>         return iop->len;
>     }    
> 
> Similarly in xg_read_mem().
> 
> Hope that makes sense. Don't mean to create work for you for my mistake,
> so if you don't have time, I can submit a patch for this too.
> 
> thanks
> Mukesh

  reply	other threads:[~2014-01-07 10:00 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-04 17:52 [BUGFIX][PATCH 0/4] gdbsx: fix 3 bugs Don Slutz
2014-01-04 17:52 ` [BUGFIX][PATCH 1/4] dbg_rw_guest_mem: need to call put_gfn in error path Don Slutz
2014-01-05 23:09   ` Andrew Cooper
2014-01-06 12:43     ` Don Slutz
2014-01-06 13:13       ` Andrew Cooper
2014-01-06 19:50         ` Don Slutz
2014-01-07  0:41           ` Mukesh Rathor
2014-01-04 17:52 ` [PATCH 2/4] dbg_rw_guest_mem: Enable debug log output Don Slutz
2014-01-04 21:13   ` Konrad Rzeszutek Wilk
2014-01-04 21:24     ` Don Slutz
2014-01-05 18:29       ` Konrad Rzeszutek Wilk
2014-01-06 15:28       ` Ian Campbell
2014-01-06 16:41         ` Don Slutz
2014-01-06 16:44           ` Ian Campbell
2014-01-06 16:49             ` Don Slutz
2014-01-07  1:04   ` Mukesh Rathor
2014-01-04 17:52 ` [BUGFIX][PATCH 3/4] xg_read_mem: Report on error Don Slutz
2014-01-07  0:50   ` Mukesh Rathor
2014-01-04 17:52 ` [BUGFIX][PATCH 4/4] XEN_DOMCTL_gdbsx_guestmemio: always do the copyback Don Slutz
2014-01-05 23:35   ` Andrew Cooper
2014-01-06 15:43     ` Ian Campbell
2014-01-07  1:53   ` Mukesh Rathor
2014-01-07 10:00     ` Ian Campbell [this message]
2014-01-07 10:02       ` Ian Campbell
2014-01-07 16:24         ` Don Slutz
2014-01-07 23:01           ` Mukesh Rathor
2014-01-08  1:02             ` Don Slutz
2014-01-08  2:33               ` Mukesh Rathor
2014-01-07 16:26       ` Don Slutz
2014-01-07 23:10         ` Mukesh Rathor
2014-01-07 23:05       ` Mukesh Rathor
2014-01-06 15:45 ` [BUGFIX][PATCH 0/4] gdbsx: fix 3 bugs Ian Campbell
2014-01-07  0:53   ` Mukesh Rathor

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=1389088824.31766.105.camel@kazak.uk.xensource.com \
    --to=ian.campbell@citrix.com \
    --cc=dslutz@verizon.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=mukesh.rathor@oracle.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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.