xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com,
	dmitry.torokhov@gmail.com, david.vrabel@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH] xen/pvhvm: If xen_platform_pci=0 is set don't blow up.
Date: Thu, 12 Dec 2013 20:29:25 -0500	[thread overview]
Message-ID: <20131213012925.GB2697@pegasus.dumpdata.com> (raw)
In-Reply-To: <1386845001.12610.57.camel@kazak.uk.xensource.com>

On Thu, Dec 12, 2013 at 10:43:21AM +0000, Ian Campbell wrote:
> On Wed, 2013-12-11 at 15:26 -0500, Konrad Rzeszutek Wilk wrote:
> 
> > diff --git a/arch/x86/xen/platform-pci-unplug.c b/arch/x86/xen/platform-pci-unplug.c
> > index 0a78524..2fb9088 100644
> > --- a/arch/x86/xen/platform-pci-unplug.c
> > +++ b/arch/x86/xen/platform-pci-unplug.c
> > @@ -69,6 +69,75 @@ static int check_platform_magic(void)
> >  	return 0;
> >  }
> >  
> > +bool xen_has_pv_devices()
> > +{
> > +	if (!xen_domain())
> > +		return false;
> > +
> > +	/* PV domains always have them. */
> > +	if (xen_pv_domain())
> > +		return true;
> > +
> > +	/* And user has xen_platform_pci=0 set in guest config as
> > +	 * driver did not modify the value. */
> > +	if (xen_platform_pci_unplug == 0)
> > +		return false;
> > +
> > +	if (xen_platform_pci_unplug & XEN_UNPLUG_NEVER)
> > +		return false;
> > +
> > +	if (xen_platform_pci_unplug & XEN_UNPLUG_ALL)
> > +		return true;
> > +
> > +	/* And the calleer has to follow with xen_pv_{disk,nic}_devices
> 
> "caller" (or "callee"? probably not)
> 
> > +	 * to be certain which driver can load. */
> 
> In the XEN_UNPLUG_UNNECESSARY case won't we end up here and return
> false, when in fact this means we have PV devices which we want to use?

Yes. Thanks for spotting that bug.
> 
> > +	return false;
> > +}
> > +EXPORT_SYMBOL_GPL(xen_has_pv_devices);
> > +
> > +bool __xen_has_pv_device(int state)
> 
>   ^static?

Yes :-)
> 
> > [...]diff --git a/include/xen/platform_pci.h b/include/xen/platform_pci.h
> > index 438c256..b49eeab 100644
> > --- a/include/xen/platform_pci.h
> > +++ b/include/xen/platform_pci.h
> > @@ -48,4 +48,27 @@ static inline int xen_must_unplug_disks(void) {
> >  
> >  extern int xen_platform_pci_unplug;
> 
> I think with all this stuff you could now make xen_platform_pci_unplug
> private to the .c file?

Yes, I have another patch that does that.
> 
> > +#if defined(CONFIG_XEN_PVHVM)
> > +extern bool xen_has_pv_devices(void);
> > +extern bool xen_has_pv_disk_devices(void);
> > +extern bool xen_has_pv_nic_devices(void);
> > +extern bool xen_has_pv_and_legacy_disk_devices(void);
> 
> The logic and usage for all these looked right so far as my cold fuddled
> brain could determine.

Yeeey!
> 
> Ian.
> 

  reply	other threads:[~2013-12-13  1:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03 21:14 [PATCH] xen/pvhvm: If xen_platform_pci=0 is set don't blow up Konrad Rzeszutek Wilk
2013-12-04  0:03 ` Matthew Daley
2013-12-04  9:37 ` Ian Campbell
2013-12-04 10:48 ` Stefano Stabellini
     [not found] ` <1386149848.13256.86.camel@kazak.uk.xensource.com>
2013-12-04 10:51   ` Stefano Stabellini
     [not found]   ` <alpine.DEB.2.02.1312041049310.7093@kaball.uk.xensource.com>
2013-12-04 10:59     ` Ian Campbell
     [not found]     ` <1386154783.17466.14.camel@kazak.uk.xensource.com>
2013-12-04 11:05       ` Stefano Stabellini
     [not found]       ` <alpine.DEB.2.02.1312041104110.7093@kaball.uk.xensource.com>
2013-12-04 11:08         ` Ian Campbell
     [not found]         ` <1386155291.17466.19.camel@kazak.uk.xensource.com>
2013-12-04 11:18           ` Stefano Stabellini
     [not found]           ` <alpine.DEB.2.02.1312041116230.7093@kaball.uk.xensource.com>
2013-12-04 11:23             ` Ian Campbell
     [not found]             ` <1386156220.17466.29.camel@kazak.uk.xensource.com>
2013-12-11 20:26               ` Konrad Rzeszutek Wilk
2013-12-12 10:43                 ` Ian Campbell
2013-12-13  1:29                   ` Konrad Rzeszutek Wilk [this message]
2013-12-13  9:58                     ` Fabio Fantoni
2013-12-13 14:39                       ` Konrad Rzeszutek Wilk
2013-12-12 11:30                 ` Stefano Stabellini
2013-12-13  1:34                   ` Konrad Rzeszutek Wilk
2013-12-13 20:18                   ` Konrad Rzeszutek Wilk
2013-12-16 12:01                     ` Stefano Stabellini
2013-12-04 13:00 ` David Vrabel
     [not found] ` <529F2758.9070304@citrix.com>
2013-12-04 13:06   ` Ian Campbell
2013-12-04 16:42 ` Dmitry Torokhov
     [not found] ` <20131204164218.GA8838@core.coreip.homeip.net>
2013-12-04 16:48   ` Konrad Rzeszutek Wilk
     [not found]   ` <20131204164802.GG391@pegasus.dumpdata.com>
2013-12-04 17:08     ` Dmitry Torokhov

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=20131213012925.GB2697@pegasus.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.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 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).