All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH V3 1/2] virtio: introduce methods of sanitizing device features
Date: Mon, 17 Nov 2014 12:11:39 +0200	[thread overview]
Message-ID: <20141117101139.GE20133@redhat.com> (raw)
In-Reply-To: <20141117104430.54362e7d.cornelia.huck@de.ibm.com>

On Mon, Nov 17, 2014 at 10:44:30AM +0100, Cornelia Huck wrote:
> On Mon, 17 Nov 2014 11:37:01 +0200
> "Michael S. Tsirkin" <mst@redhat.com> wrote:
> 
> > On Mon, Nov 17, 2014 at 05:17:17PM +0800, Jason Wang wrote:
> > > Buggy host may advertised buggy host features (a usual case is that host
> > > advertise a feature whose dependencies were missed). In this case, driver
> > > should detect and disable the buggy features by itself.
> > > 
> > > This patch introduces driver specific sanitize_features() method which is
> > > called just before features finalizing to detect and disable buggy features
> > > advertised by host.
> > > 
> > > Virtio-net will be the first user.
> > > 
> > > Cc: Rusty Russell <rusty@rustcorp.com.au>
> > > Cc: Michael S. Tsirkin <mst@redhat.com>
> > > Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
> > > Cc: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> > > Signed-off-by: Jason Wang <jasowang@redhat.com>
> > 
> > Hmm this conflicts with virtio 1.0 work: we drop
> > features as bitmap there.
> 
> But that's an implementation detail, no? We'll still need a way for the
> driver to sanitize features, and I think this interface works just fine.

Now that you mention it, I don't think we do.

The spec is quite explicit that devices must not expose invalid
combinations of features.

Admittedly, BUG_ON isn't very friendly to hypervisors.

But e.g. failing probe seems better than trying to work around
hypervisor bugs - otherwise we'll be stuck maintaining compatibility
with hypervisors forever.

-- 
MST

WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Jason Wang <jasowang@redhat.com>,
	rusty@rustcorp.com.au, virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org,
	Wanlong Gao <gaowanlong@cn.fujitsu.com>
Subject: Re: [PATCH V3 1/2] virtio: introduce methods of sanitizing device features
Date: Mon, 17 Nov 2014 12:11:39 +0200	[thread overview]
Message-ID: <20141117101139.GE20133@redhat.com> (raw)
In-Reply-To: <20141117104430.54362e7d.cornelia.huck@de.ibm.com>

On Mon, Nov 17, 2014 at 10:44:30AM +0100, Cornelia Huck wrote:
> On Mon, 17 Nov 2014 11:37:01 +0200
> "Michael S. Tsirkin" <mst@redhat.com> wrote:
> 
> > On Mon, Nov 17, 2014 at 05:17:17PM +0800, Jason Wang wrote:
> > > Buggy host may advertised buggy host features (a usual case is that host
> > > advertise a feature whose dependencies were missed). In this case, driver
> > > should detect and disable the buggy features by itself.
> > > 
> > > This patch introduces driver specific sanitize_features() method which is
> > > called just before features finalizing to detect and disable buggy features
> > > advertised by host.
> > > 
> > > Virtio-net will be the first user.
> > > 
> > > Cc: Rusty Russell <rusty@rustcorp.com.au>
> > > Cc: Michael S. Tsirkin <mst@redhat.com>
> > > Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
> > > Cc: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> > > Signed-off-by: Jason Wang <jasowang@redhat.com>
> > 
> > Hmm this conflicts with virtio 1.0 work: we drop
> > features as bitmap there.
> 
> But that's an implementation detail, no? We'll still need a way for the
> driver to sanitize features, and I think this interface works just fine.

Now that you mention it, I don't think we do.

The spec is quite explicit that devices must not expose invalid
combinations of features.

Admittedly, BUG_ON isn't very friendly to hypervisors.

But e.g. failing probe seems better than trying to work around
hypervisor bugs - otherwise we'll be stuck maintaining compatibility
with hypervisors forever.

-- 
MST

  reply	other threads:[~2014-11-17 10:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17  9:17 [PATCH V3 1/2] virtio: introduce methods of sanitizing device features Jason Wang
2014-11-17  9:17 ` Jason Wang
2014-11-17  9:17 ` [PATCH V3 2/2] virtio-net: sanitize buggy features advertised by host Jason Wang
2014-11-17  9:17   ` Jason Wang
2014-11-17 10:08   ` Michael S. Tsirkin
2014-11-17 10:08     ` Michael S. Tsirkin
2014-11-18  3:03     ` Jason Wang
2014-11-18  3:03       ` Jason Wang
2014-11-18 11:02       ` Michael S. Tsirkin
2014-11-18 11:02         ` Michael S. Tsirkin
2014-11-17  9:37 ` [PATCH V3 1/2] virtio: introduce methods of sanitizing device features Michael S. Tsirkin
2014-11-17  9:37   ` Michael S. Tsirkin
2014-11-17  9:44   ` Cornelia Huck
2014-11-17  9:44     ` Cornelia Huck
2014-11-17 10:11     ` Michael S. Tsirkin [this message]
2014-11-17 10:11       ` Michael S. Tsirkin
2014-11-17 10:20       ` Cornelia Huck
2014-11-17 10:20         ` Cornelia Huck
2014-11-17 10:28         ` Michael S. Tsirkin
2014-11-17 10:28           ` Michael S. Tsirkin
2014-11-17 11:20           ` Cornelia Huck
2014-11-17 11:20             ` Cornelia Huck
2014-11-18  3:23       ` Jason Wang
2014-11-18  3:23         ` Jason Wang
2014-11-18 11:04         ` Michael S. Tsirkin
2014-11-18 11:04           ` Michael S. Tsirkin
2014-11-19  3:00           ` Jason Wang
2014-11-19  3:00             ` Jason Wang

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=20141117101139.GE20133@redhat.com \
    --to=mst@redhat.com \
    --cc=cornelia.huck@de.ibm.com \
    --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.