All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v3 04/16] virtio/console: verify device has config space
Date: Wed, 21 Jan 2015 08:44:09 +0200	[thread overview]
Message-ID: <20150121064409.GA13320@redhat.com> (raw)
In-Reply-To: <20150121061452.GV31174@grmbl.mre>

On Wed, Jan 21, 2015 at 11:44:52AM +0530, Amit Shah wrote:
> On (Tue) 20 Jan 2015 [13:09:55], Michael S. Tsirkin wrote:
> > On Tue, Jan 20, 2015 at 04:10:40PM +0530, Amit Shah wrote:
> > > On (Wed) 14 Jan 2015 [19:27:35], Michael S. Tsirkin wrote:
> > > > Some devices might not implement config space access
> > > > (e.g. remoteproc used not to - before 3.9).
> > > > virtio/console needs config space access so make it
> > > > fail gracefully if not there.
> > > 
> > > Do we know any such devices?  Wondering what prompted this patch.  If
> > > it's just theoretical, I'd rather let it be like this, and pull this
> > > in when there's a device that doesn't have config space.
> > 
> > Yes, with virtio 1.0 config space can be in a separate BAR now.  If
> > that's not enabled by BIOS (e.g. out of space), we won't have config
> > space.
> 
> I'm still not sure whether we should pull in this patch before
> actually seeing a failure.
> 
> You do have a dev_err which tells why the probe failed, so it's an
> acceptable compromise I suppose.
> 
> > > Also, just the console functionality (i.e. F_MULTIPORT is unset) is
> > > available w/o config space access.
> > 
> > Supporting this by gracefully disabling F_MULTIPORT
> > would require getting this info from driver before
> > features are finalized.
> > Alternatively, check F_MULTIPORT and only fail if set?
> > Let me know, I'll cook up a patch.
> 
> Yes, failing only if F_MULTIPORT is set is a better option (if we have
> to fail).

OK, that's easy I think - will send a patch on top.

> > > In fact, getting this patch in
> > > would mean remoteproc wouldn't even run in its pre-config days...
> > 
> > It seems to have get callback unconditionally now - or did I miss
> > something?
> 
> What I meant was remoteproc doesn't depend on the config space, only
> uses the console functionality.  If remoteproc devices didn't expose a
> config space, this patch would cause it to lose its console
> functionality for no apparent reason.
> 
> 
> 		Amit

Better than crashing on jump to NULL?

-- 
MST

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Rusty Russell <rusty@rustcorp.com.au>,
	cornelia.huck@de.ibm.com, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v3 04/16] virtio/console: verify device has config space
Date: Wed, 21 Jan 2015 08:44:09 +0200	[thread overview]
Message-ID: <20150121064409.GA13320@redhat.com> (raw)
In-Reply-To: <20150121061452.GV31174@grmbl.mre>

On Wed, Jan 21, 2015 at 11:44:52AM +0530, Amit Shah wrote:
> On (Tue) 20 Jan 2015 [13:09:55], Michael S. Tsirkin wrote:
> > On Tue, Jan 20, 2015 at 04:10:40PM +0530, Amit Shah wrote:
> > > On (Wed) 14 Jan 2015 [19:27:35], Michael S. Tsirkin wrote:
> > > > Some devices might not implement config space access
> > > > (e.g. remoteproc used not to - before 3.9).
> > > > virtio/console needs config space access so make it
> > > > fail gracefully if not there.
> > > 
> > > Do we know any such devices?  Wondering what prompted this patch.  If
> > > it's just theoretical, I'd rather let it be like this, and pull this
> > > in when there's a device that doesn't have config space.
> > 
> > Yes, with virtio 1.0 config space can be in a separate BAR now.  If
> > that's not enabled by BIOS (e.g. out of space), we won't have config
> > space.
> 
> I'm still not sure whether we should pull in this patch before
> actually seeing a failure.
> 
> You do have a dev_err which tells why the probe failed, so it's an
> acceptable compromise I suppose.
> 
> > > Also, just the console functionality (i.e. F_MULTIPORT is unset) is
> > > available w/o config space access.
> > 
> > Supporting this by gracefully disabling F_MULTIPORT
> > would require getting this info from driver before
> > features are finalized.
> > Alternatively, check F_MULTIPORT and only fail if set?
> > Let me know, I'll cook up a patch.
> 
> Yes, failing only if F_MULTIPORT is set is a better option (if we have
> to fail).

OK, that's easy I think - will send a patch on top.

> > > In fact, getting this patch in
> > > would mean remoteproc wouldn't even run in its pre-config days...
> > 
> > It seems to have get callback unconditionally now - or did I miss
> > something?
> 
> What I meant was remoteproc doesn't depend on the config space, only
> uses the console functionality.  If remoteproc devices didn't expose a
> config space, this patch would cause it to lose its console
> functionality for no apparent reason.
> 
> 
> 		Amit

Better than crashing on jump to NULL?

-- 
MST

  reply	other threads:[~2015-01-21  6:44 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14 17:27 [PATCH v3 00/16] virtio-pci: towards virtio 1.0 guest support Michael S. Tsirkin
2015-01-14 17:27 ` Michael S. Tsirkin
2015-01-14 17:27 ` [PATCH v3 01/16] virtio_pci: drop virtio_config dependency Michael S. Tsirkin
2015-01-14 17:27   ` Michael S. Tsirkin
2015-01-14 17:27 ` [PATCH v3 02/16] virtio/9p: verify device has config space Michael S. Tsirkin
2015-01-14 17:27   ` Michael S. Tsirkin
2015-01-14 17:27 ` [PATCH v3 03/16] virtio/blk: " Michael S. Tsirkin
2015-01-14 17:27   ` Michael S. Tsirkin
2015-01-14 17:27 ` [PATCH v3 04/16] virtio/console: " Michael S. Tsirkin
2015-01-14 17:27   ` Michael S. Tsirkin
2015-01-20 10:40   ` Amit Shah
2015-01-20 10:40     ` Amit Shah
2015-01-20 11:09     ` Michael S. Tsirkin
2015-01-20 11:09       ` Michael S. Tsirkin
2015-01-21  6:14       ` Amit Shah
2015-01-21  6:14         ` Amit Shah
2015-01-21  6:44         ` Michael S. Tsirkin [this message]
2015-01-21  6:44           ` Michael S. Tsirkin
2015-01-14 17:27 ` [PATCH v3 05/16] virtio/net: " Michael S. Tsirkin
2015-01-14 17:27 ` Michael S. Tsirkin
2015-01-14 17:27 ` [PATCH v3 06/16] virtio/scsi: " Michael S. Tsirkin
2015-01-14 17:27 ` Michael S. Tsirkin
2015-01-14 17:27 ` [PATCH v3 07/16] virtio/balloon: " Michael S. Tsirkin
2015-01-14 17:27   ` Michael S. Tsirkin
2015-01-14 17:27 ` [PATCH v3 08/16] mn10300: drop dead code Michael S. Tsirkin
2015-01-14 17:27 ` Michael S. Tsirkin
2015-01-23 23:08   ` Bjorn Helgaas
2015-01-23 23:08     ` Bjorn Helgaas
2015-01-14 17:27 ` [PATCH v3 09/16] pci: add pci_iomap_range Michael S. Tsirkin
2015-01-23 23:08   ` Bjorn Helgaas
2015-01-23 23:08   ` Bjorn Helgaas
2015-01-14 17:27 ` Michael S. Tsirkin
2015-01-14 17:27 ` [PATCH v3 10/16] s390: " Michael S. Tsirkin
2015-01-14 17:27   ` Michael S. Tsirkin
2015-01-16 10:11   ` Sebastian Ott
2015-01-16 10:11   ` Sebastian Ott
2015-01-21  0:43     ` Rusty Russell
2015-01-21  0:43       ` Rusty Russell
2015-01-14 17:28 ` [PATCH v3 11/16] virtio_pci: move probe/remove code to common Michael S. Tsirkin
2015-01-14 17:28   ` Michael S. Tsirkin
2015-01-14 17:28 ` [PATCH v3 12/16] virtio-pci: define layout for virtio 1.0 Michael S. Tsirkin
2015-01-14 17:28   ` Michael S. Tsirkin
2015-01-14 17:28 ` [PATCH v3 13/16] virtio_pci: modern driver Michael S. Tsirkin
2015-01-14 17:28 ` Michael S. Tsirkin
2015-01-14 17:28 ` [PATCH v3 14/16] virtio_pci: macros for PCI layout offsets Michael S. Tsirkin
2015-01-14 17:28   ` Michael S. Tsirkin
2015-01-14 17:28 ` Michael S. Tsirkin
2015-01-14 17:28 ` [PATCH v3 15/16] virtio_pci_modern: reduce number of mappings Michael S. Tsirkin
2015-01-14 17:28 ` Michael S. Tsirkin
2015-01-14 17:28 ` [PATCH v3 16/16] virtio_pci_modern: support devices with no config Michael S. Tsirkin
2015-01-14 17:28 ` Michael S. Tsirkin
2015-01-14 17:28 ` Michael S. Tsirkin
2015-01-14 17:28 ` Michael S. Tsirkin
2015-01-15 21:18 ` [PATCH v3 00/16] virtio-pci: towards virtio 1.0 guest support Gerd Hoffmann
2015-01-15 21:32   ` Michael S. Tsirkin
2015-01-16  8:32     ` Gerd Hoffmann
2015-01-16  8:45       ` Michael S. Tsirkin
2015-01-16 13:27         ` Gerd Hoffmann
2015-01-19 10:54           ` Gerd Hoffmann
2015-01-20 16:38             ` Michael S. Tsirkin
2015-01-19 11:07       ` Gerd Hoffmann
2015-01-19 11:07         ` Gerd Hoffmann
2015-01-19 22:11         ` Michael S. Tsirkin
2015-01-20 16:32         ` Michael S. Tsirkin
2015-01-21 11:31           ` Gerd Hoffmann
2015-01-21 11:36             ` Michael S. Tsirkin
2015-01-21 13:43               ` Gerd Hoffmann
2015-01-21 14:19                 ` Michael S. Tsirkin
2015-01-21 11:31           ` Gerd Hoffmann

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=20150121064409.GA13320@redhat.com \
    --to=mst@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.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.