linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"annie.li@oracle.com" <annie.li@oracle.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: Regressions in v3.3-rc1 introduced by "xen/granttable: Grant tables V2 implementation"
Date: Wed, 25 Jan 2012 22:30:35 +0000	[thread overview]
Message-ID: <1327530635.856.6.camel@dagon.hellion.org.uk> (raw)
In-Reply-To: <20120125204652.GA21284@phenom.dumpdata.com>

On Wed, 2012-01-25 at 20:46 +0000, Konrad Rzeszutek Wilk wrote:
> On Wed, Jan 25, 2012 at 09:55:33AM +0000, Ian Campbell wrote:
> > On Wed, 2012-01-25 at 05:12 +0000, Konrad Rzeszutek Wilk wrote:
> > > On Tue, Jan 24, 2012 at 11:49:49PM -0500, Konrad Rzeszutek Wilk wrote:
> > > > When I try to bootup a PVonHVM guest with Xen 4.1 I get this:
> > > 
> > > .. snip..
> > > > 
> > > > and with this little patch I can get it to work:
> > > 
> > > I get the domU to boot but the network stops being responsive.
> > > I see this in the Dom0:
> > 
> > Your original patch would set the version to two in the hypervisor and
> > then ignore that and continue to use v1 so that isn't surprising.
> > 
> > > (XEN) grant_table.c:362:d0 Bad flags (0) or dom (0). (expected dom 0, flags 103)
> > > [ 6834.488816] vif vif-12-0: 1 mapping in shared page 768 from domain 12
> > > [ 6834.490235] vif vif-12-0: 1 mapping shared-frames 768/769 port 15
> > > 
> > > Replacing the patch with:
> > > 
> > > diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
> > > index 1cd94da..b4d4eac 100644
> > > --- a/drivers/xen/grant-table.c
> > > +++ b/drivers/xen/grant-table.c
> > > @@ -948,9 +948,12 @@ static void gnttab_request_version(void)
> > >  	int rc;
> > >  	struct gnttab_set_version gsv;
> > >  
> > > -	gsv.version = 2;
> > > +	if (xen_hvm_domain())
> > > +		gsv.version = 1;
> > > +	else
> > > +		gsv.version = 2;
> > >  	rc = HYPERVISOR_grant_table_op(GNTTABOP_set_version, &gsv, 1);
> > > -	if (rc == 0) {
> > > +	if (rc == 0 && gsv.version == 2) {
> > >  		grant_table_version = 2;
> > >  		gnttab_interface = &gnttab_v2_ops;
> > >  	} else if (grant_table_version == 2) {
> > > 
> > > Gets me back to how it worked in Linux v3.2.
> > > 
> > > But that is just a band-aid fix...
> > 
> > The real bug is presumably either that the Linux v2 code is buggy for
> > use in an HVM guest or that Xen's support for v2 in HVM guests is either
> > buggy or explicitly disabled (in which case set_version should fail for
> > version=2).
> > 
> > Is the set_version with version=1 succeeding or failing? Likewise for
> > the version=2 call?
> 
> Both return 0. But version=2 returns the error in the hypervisor:
> 
>  (XEN) grant_table.c:362:d0 Bad flags (0) or dom (0). (expected dom 0, flags 103)

This was with your first (buggy) patch, right?

I think this error is because your first version of the patch switched
to v2 but then ignored that and continued to use the v1 data structures
-- hence there is a disagreement between the kernel and the hypervisor
about where the flags actually are and you get errors like the above.

Ian.


      reply	other threads:[~2012-01-25 22:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-25  4:49 Regressions in v3.3-rc1 introduced by "xen/granttable: Grant tables V2 implementation" Konrad Rzeszutek Wilk
2012-01-25  5:12 ` Konrad Rzeszutek Wilk
2012-01-25  9:55   ` Ian Campbell
2012-01-25 15:16     ` [Xen-devel] " Paul Durrant
2012-01-25 15:47       ` Ian Campbell
     [not found]       ` <45B8991A987A4149B40F1A061BF49097CBE27F2A88@LONPMAILBOX01.citrite.net>
2012-01-25 15:51         ` Ian Campbell
2012-01-25 15:23     ` Paul Durrant
2012-01-25 15:49       ` Ian Campbell
2012-01-25 20:50       ` Konrad Rzeszutek Wilk
2012-01-25 22:34         ` Ian Campbell
2012-01-25 20:46     ` Konrad Rzeszutek Wilk
2012-01-25 22:30       ` Ian Campbell [this message]

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=1327530635.856.6.camel@dagon.hellion.org.uk \
    --to=ian.campbell@citrix.com \
    --cc=annie.li@oracle.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).