All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: minios-devel@lists.xenproject.org,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Martin Lucina <martin@lucina.net>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Minios-devel] Double gnttab_end_access in mini-os netfront
Date: Tue, 8 Dec 2015 13:32:53 +0100	[thread overview]
Message-ID: <20151208123253.GP960@mail-itl> (raw)
In-Reply-To: <1449576694.16124.72.camel@citrix.com>


[-- Attachment #1.1: Type: text/plain, Size: 2077 bytes --]

On Tue, Dec 08, 2015 at 12:11:34PM +0000, Ian Campbell wrote:
> On Tue, 2015-12-08 at 13:00 +0100, Samuel Thibault wrote:
> > Marek Marczykowski-Górecki, on Tue 08 Dec 2015 12:46:31 +0100, wrote:
> > > > > http://xenbits.xen.org/gitweb/?p=mini-os.git;a=commit;h=7c8f3483906
> > > > > 52a67e
> > > > > 9356eec9cd2b0f76a9c7c72
> > > > > 
> > > > > With that commit reverted, issue vanishes.
> > > > > 
> > > > > I guess it's because before this commit, there was "if (rx->status
> > > > > ==
> > > > > NETIF_RSP_NULL) continue" before "gnttab_end_access(buf->gref)",
> > > > > but now
> > > > > that case is handled after gnttab_end_access (using "if (rx->status 
> > > > > >
> > > > > NETIF_RSP_NULL)"). I think the fix would be to restore that
> > > > > "continue"
> > > > > line.
> > > > 
> > > > That sounds pretty plausible to me (FWIW). Have you tried it?
> > > 
> > > I've tried moving gnttab_end_access into that if branch. And it didn't
> > > worked.
> > 
> > Which if branch?  Please show the code, C is less ambiguous than english
> > :)
> 
> Details of in which way it didn't work would also be useful, I expect.

I don't have my test environment handy, but the change was:
--- netfront.c.orig     2015-12-08 13:29:04.913000000 +0100
+++ netfront.c  2015-12-08 13:29:24.060000000 +0100
@@ -122,10 +122,10 @@
 
         buf = &dev->rx_buffers[id];
         page = (unsigned char*)buf->page;
-        gnttab_end_access(buf->gref);
 
         if (rx->status > NETIF_RSP_NULL)
         {
+        gnttab_end_access(buf->gref);
 #ifdef HAVE_LIBC
            if (dev->netif_rx == NETIF_SELECT_RX) {
                int len = rx->status;


But to be frank, I'm not entirely sure that the tested version was
really with this patch, as stubdom building code is quite convolved...
The crash was the same, but I'll test it again to be sure.

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

[-- Attachment #1.2: Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2015-12-08 12:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-06  2:19 Double gnttab_end_access in mini-os netfront Marek Marczykowski-Górecki
2015-12-08 11:33 ` Ian Campbell
2015-12-08 11:46   ` Marek Marczykowski-Górecki
2015-12-08 12:00     ` Samuel Thibault
2015-12-08 12:11       ` [Minios-devel] " Ian Campbell
2015-12-08 12:32         ` Marek Marczykowski-Górecki [this message]
2015-12-08 11:59   ` Samuel Thibault

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=20151208123253.GP960@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=ian.campbell@citrix.com \
    --cc=martin@lucina.net \
    --cc=minios-devel@lists.xenproject.org \
    --cc=samuel.thibault@ens-lyon.org \
    --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.