On Tue, Jan 16, 2024 at 12:58:36PM +0800, Li RongQing wrote:
> virtqueue_enable_cb() will call virtqueue_poll() which will check if
> queue is broken at beginning, so remove the virtqueue_is_broken() call
>
> Signed-off-by: Li RongQing
Acked-by: Michael S. Tsirkin
> ---
t Van Assche
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-r...@vger.kernel.org
> Cc: linux-ker...@vger.kernel.org
> Cc: Michael S. Tsirkin
> Cc: Christoph Hellwig
> Cc: Leon Romanovsky
> Cc: Andrew Morton
> ---
> [v2]: Elaborated patch description
>
> include/
On Mon, Oct 16, 2017 at 03:36:50PM +, Bart Van Assche wrote:
> On Mon, 2017-10-16 at 18:27 +0300, Michael S. Tsirkin wrote:
> > On Mon, Oct 16, 2017 at 01:57:35PM +, Bart Van Assche wrote:
> > > On Mon, 2017-10-16 at 16:34 +0300, Michael S. Tsirkin wrote:
> > > &
On Mon, Oct 16, 2017 at 01:57:35PM +, Bart Van Assche wrote:
> On Mon, 2017-10-16 at 16:34 +0300, Michael S. Tsirkin wrote:
> > I don't see how it'll help make things better. OTOH if the specific
> > drivers are tagged in the makefile, they can be gradually mo
On Sun, Sep 24, 2017 at 11:36:33PM +0100, Al Viro wrote:
> Suppose vhost_scsi_iov_to_sgl() got a two-iovec array, mapped
> e.g. 20 pages from the first one just fine and failed on the
> second.
>
> static int
> vhost_scsi_iov_to_sgl(struct vhost_scsi_cmd *cmd, bool write,
> s
On Fri, Aug 11, 2017 at 04:09:26PM +0200, Paolo Bonzini wrote:
> On 10/08/2017 23:41, Michael S. Tsirkin wrote:
> >>> Then we probably should fail probe if vq size is too small.
> >> What does this mean?
> >
> > We must prevent driver from submitting s/g lis
On Thu, Aug 10, 2017 at 10:35:11PM +0100, Richard W.M. Jones wrote:
> On Fri, Aug 11, 2017 at 12:31:44AM +0300, Michael S. Tsirkin wrote:
> > Then we probably should fail probe if vq size is too small.
>
> What does this mean?
>
> Rich.
We must prevent driver from submittin
On Thu, Aug 10, 2017 at 10:30:38PM +0100, Richard W.M. Jones wrote:
> On Fri, Aug 11, 2017 at 12:21:16AM +0300, Michael S. Tsirkin wrote:
> > On Thu, Aug 10, 2017 at 05:40:34PM +0100, Richard W.M. Jones wrote:
> > > If using indirect descriptors, you can make the total_sg as
On Thu, Aug 10, 2017 at 05:40:34PM +0100, Richard W.M. Jones wrote:
> If using indirect descriptors, you can make the total_sg as large as
> you want.
That would be a spec violation though, even if it happens to
work on current QEMU.
The spec says:
A driver MUST NOT create a descriptor ch
On Fri, Mar 31, 2017 at 12:04:55PM +0800, Jason Wang wrote:
>
>
> On 2017年03月30日 22:32, Michael S. Tsirkin wrote:
> > On Thu, Mar 30, 2017 at 02:00:08PM +0800, Jason Wang wrote:
> > >
> > > On 2017年03月30日 04:48, Michael S. Tsirkin wrote:
> > > > We
On Thu, Mar 30, 2017 at 02:00:08PM +0800, Jason Wang wrote:
>
>
> On 2017年03月30日 04:48, Michael S. Tsirkin wrote:
> > We are going to add more parameters to find_vqs, let's wrap the call so
> > we don't need to tweak all drivers every time.
> >
We are going to add more parameters to find_vqs, let's wrap the call so
we don't need to tweak all drivers every time.
Signed-off-by: Michael S. Tsirkin
---
drivers/block/virtio_blk.c | 3 +--
drivers/char/virtio_console.c | 6 +++---
drivers/cry
On Thu, Jan 26, 2017 at 11:41:09AM +0800, Fam Zheng wrote:
> This implements the VIRTIO_SCSI_F_FC_HOST feature by reading the config
> fields and presenting them as sysfs fc_host attributes. The config
> change handler is added here because primary_active will toggle during
> migration.
Looks like
On Thu, Jan 26, 2017 at 11:41:08AM +0800, Fam Zheng wrote:
> Signed-off-by: Fam Zheng
> ---
I pefer combining this with implementation,
hard to reason about interface alone.
> include/uapi/linux/virtio_scsi.h | 6 ++
> 1 file changed, 6 insertions(+)
>
> diff --git a/include/uapi/linux/vir
On Tue, Jan 17, 2017 at 10:05:00PM +0800, Fam Zheng wrote:
> On Tue, 01/17 14:17, Paolo Bonzini wrote:
> >
> >
> > On 16/01/2017 18:26, Fam Zheng wrote:
> > >> Is the endianness correct for big-endian host here?
> > >
> > > I think so. The fc_host sysfs uses u64 to represent port_name and
> > >
This is just a reposting of the patch that enables endian checks, with addition
of trivial patches that drop __bitwise__ and __CHECK_ENDIAN__ everywhere.
I plan to include this in my pull request unless I hear otherwise.
Michael S. Tsirkin (8):
linux/types.h: enable endian checks for all
__bitwise__ used to mean "yes, please enable sparse checks
unconditionally", but now that we dropped __CHECK_ENDIAN__
__bitwise is exactly the same.
There aren't many users, replace it by __bitwise everywhere.
Signed-off-by: Michael S. Tsirkin
---
arch/arm/plat-samsung/include/
On Fri, Dec 09, 2016 at 09:49:28PM -0800, Joe Perches wrote:
> On Fri, 2016-12-09 at 22:45 +0200, Michael S. Tsirkin wrote:
> > This adds endian-ness labels for lots of qla structs.
> > Doing this cuts down number of sparse warnings from ~1700 to ~1400.
> > Will help find and
On Fri, Dec 09, 2016 at 03:18:02PM +, Bart Van Assche wrote:
> On 12/08/16 22:40, Madhani, Himanshu wrote:
> > We’ll take a look and send patches to resolve these warnings.
>
> Thanks!
>
> Bart.
>
Sounds good. I posted what I have so far so that you can
start from that.
--
MST
--
To unsub
This adds endian-ness labels for lots of qla structs.
Doing this cuts down number of sparse warnings from ~1700 to ~1400.
Will help find and resolve some of real issues down the road.
Signed-off-by: Michael S. Tsirkin
---
Compile-tested only.
diff --git a/drivers/scsi/qla2xxx/qla_def.h b
On Thu, Dec 08, 2016 at 06:38:11AM +, Bart Van Assche wrote:
> On 12/07/16 21:54, Michael S. Tsirkin wrote:
> > On Thu, Dec 08, 2016 at 05:21:47AM +, Bart Van Assche wrote:
> >> Additionally, there are notable exceptions to the rule that most drivers
> >> are
On Thu, Dec 08, 2016 at 05:21:47AM +, Bart Van Assche wrote:
> On 12/07/16 18:29, Michael S. Tsirkin wrote:
> > By now, linux is mostly endian-clean. Enabling endian-ness
> > checks for everyone produces about 200 new sparse warnings for me -
> > less than 10% over the
drop __CHECK_ENDIAN__. Follow-up patches
can drop distinction between __bitwise and __bitwise__.
Cc: Linus Torvalds
Suggested-by: Christoph Hellwig
Signed-off-by: Michael S. Tsirkin
---
Linus, could you ack this for upstream? If yes I'll
merge through my tree as a replacement for enabling
thi
On Wed, Dec 07, 2016 at 07:25:51AM +0100, Johannes Berg wrote:
> On Tue, 2016-12-06 at 17:41 +0200, Michael S. Tsirkin wrote:
>
> > It seems that there should be a better way to do it,
> > but this works too.
>
> In some cases there might be:
>
> > --- a/drive
__CHECK_ENDIAN__ isn't on by default presumably because
it triggers too many sparse warnings for correct code.
But virtio is now clean of these warnings, and
we want to keep it this way - enable this for
sparse builds.
Signed-off-by: Michael S. Tsirkin
---
It seems that there should be a b
sparse
builds.
Michael S. Tsirkin (10):
virtio_console: drop unused config fields
drm/virtio: fix endianness in primary_plane_update
drm/virtio: fix lock context imbalance
drm/virtio: annotate virtio_gpu_queue_ctrl_buffer_locked
vhost: make interval tree static inline
vhost: add missing
On Thu, Sep 17, 2015 at 07:15:44AM -0700, James Bottomley wrote:
> On Thu, 2015-09-17 at 08:33 +0300, Michael S. Tsirkin wrote:
> > On Wed, Sep 16, 2015 at 07:29:17PM -0500, Suman Anna wrote:
> > > The virtio core uses a static ida named virtio_index_ida for
> > > assign
ng ida_destroy() in the virtio core module
> exit.
>
> Cc: "Michael S. Tsirkin"
> Signed-off-by: Suman Anna
Interesting.
Will the same apply to e.g. sd_index_ida in drivers/scsi/sd.c
or iscsi_sess_ida in drivers/scsi/scsi_transport_iscsi.c?
If no, why not?
One doesn
On Sun, Mar 29, 2015 at 05:03:36PM +0300, James Bottomley wrote:
> On Sun, 2015-03-29 at 15:42 +0200, Michael S. Tsirkin wrote:
> > Header moved from linux/pci_ids.h to uapi/linux/pci_ids.h,
> > use the new header directly so we can drop
> > the wrapper in include/linux/pci_i
Header moved from linux/pci_ids.h to uapi/linux/pci_ids.h,
use the new header directly so we can drop
the wrapper in include/linux/pci_ids.h.
Signed-off-by: Michael S. Tsirkin
---
drivers/scsi/qla1280.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/qla1280.c b
Header moved from linux/pci_ids.h to uapi/linux/pci_ids.h,
use the new header directly so we can drop
the wrapper in include/linux/pci_ids.h.
Signed-off-by: Michael S. Tsirkin
---
drivers/scsi/arcmsr/arcmsr_hba.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi
On Wed, Feb 04, 2015 at 02:55:12AM -0800, Nicholas A. Bellinger wrote:
> On Wed, 2015-02-04 at 02:41 -0800, Nicholas A. Bellinger wrote:
> > On Wed, 2015-02-04 at 10:42 +0100, Michael S. Tsirkin wrote:
> > > On Wed, Feb 04, 2015 at 01:40:25AM -0800, Nicholas
On Wed, Feb 04, 2015 at 02:41:07AM -0800, Nicholas A. Bellinger wrote:
> On Wed, 2015-02-04 at 10:42 +0100, Michael S. Tsirkin wrote:
> > On Wed, Feb 04, 2015 at 01:40:25AM -0800, Nicholas A. Bellinger wrote:
> > > > > + /*
> > > > > +
On Wed, Feb 04, 2015 at 02:41:07AM -0800, Nicholas A. Bellinger wrote:
> On Wed, 2015-02-04 at 10:42 +0100, Michael S. Tsirkin wrote:
> > On Wed, Feb 04, 2015 at 01:40:25AM -0800, Nicholas A. Bellinger wrote:
> > > > > + /*
> > > > > +
On Wed, Feb 04, 2015 at 02:11:20AM -0800, Nicholas A. Bellinger wrote:
> On Tue, 2015-02-03 at 23:56 +, Al Viro wrote:
> > On Tue, Feb 03, 2015 at 06:29:59AM +, Nicholas A. Bellinger wrote:
> > > + * Copy over the virtio-scsi request header, which when
> > > + * ANY_LAYOUT
On Wed, Feb 04, 2015 at 01:40:25AM -0800, Nicholas A. Bellinger wrote:
> > > + /*
> > > + * Any associated T10_PI bytes for the outgoing / incoming
> > > + * payloads are included in calculation of exp_data_len here.
> > > + */
> > > + if (out_size > req_s
On Wed, Feb 04, 2015 at 01:13:58AM -0800, Nicholas A. Bellinger wrote:
> On Tue, 2015-02-03 at 11:40 +0200, Michael S. Tsirkin wrote:
> > On Tue, Feb 03, 2015 at 06:30:00AM +, Nicholas A. Bellinger wrote:
> > > From: Nicholas Bellinger
> > >
> > > S
On Tue, Feb 03, 2015 at 11:56:16PM +, Al Viro wrote:
> On Tue, Feb 03, 2015 at 06:29:59AM +, Nicholas A. Bellinger wrote:
> > +* Copy over the virtio-scsi request header, which when
> > +* ANY_LAYOUT is enabled may span multiple iovecs, or a
> > +* single
> + * copy_from_iter() is modifying the iovecs as copies over
> + * req_size bytes into req, so the returned out_iter.iov[0]
> + * will contain the correct start + offset of the outgoing
> + * WRITE payload, if DMA_TO_DEVICE is set.
> +
Convert prot_bytes offset to use iov_iter_advance
> - Drop max_niov usage in vhost_scsi_handle_vqal
> - Drop vhost_skip_iovec_bytes in favour of iov_iter
>
> Cc: Michael S. Tsirkin
> Cc: Paolo Bonzini
> Signed-off-by: Nicholas Bellinger
> ---
> drivers/vhost/scsi.c | 260
> +
d do a global rename to make the usage consistent.
>
> Cc: Michael S. Tsirkin
> Cc: Paolo Bonzini
> Signed-off-by: Nicholas Bellinger
Yes, I've been wondering about that.
Acked-by: Michael S. Tsirkin
> ---
> drivers/vhost/scsi.c | 662
> +
On Tue, Feb 03, 2015 at 06:30:00AM +, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger
>
> Signal support of VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits
> required for virtio-scsi 1.0 spec layout requirements.
>
> Cc: Michael S. Tsirkin
> Cc: Paolo Bon
.
>
> Cc: Michael S. Tsirkin
> Cc: Paolo Bonzini
> Signed-off-by: Nicholas Bellinger
Acked-by: Michael S. Tsirkin
> ---
> drivers/vhost/scsi.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index 9af93d0..2
head and drop the pre virtio 1.0 logic in vhost_scsi_handle_vq()
> and associated helpers.
Will probably be easier to review if you smash this with patch 5,
this way we see both old and new code side by side.
Also, let's rename _vqal to _vq in this patch?
> Cc: Michael S. Tsirkin
>
On Tue, Feb 03, 2015 at 06:29:54AM +, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger
>
> Hi MST, Paolo, Al & Co,
>
> Here is -v3 for adding vhost/scsi ANY_LAYOUT + VERSION_1 host feature
> bit support.
>
> It adds a new vhost_virtqueue ->handle_kick() callback to determine the
> st
h your tree, you can drop these
when applying, but it's best not to assume this, and put
changelog after ---.
> Cc: Michael S. Tsirkin
> Cc: Paolo Bonzini
> Signed-off-by: Nicholas Bellinger
> ---
> drivers/vhost/scsi.c | 93
> ++
nges existing code to save cmd->tvc_resp_iov instead of the
> first single iovec base pointer from &vq->iov[out].
Typo in subject: should be copy_to_iter.
> v3 changes:
> - Convert memcpy_toiovecend -> copy_to_iser usage
This belongs after ---
> Cc: Michael S. Tsirkin
ALIGN, so allow
> the same parameters as well.
>
> Cc: Michael S. Tsirkin
> Cc: Paolo Bonzini
> Signed-off-by: Nicholas Bellinger
> ---
> drivers/vhost/scsi.c | 37 +++--
> 1 file changed, 15 insertions(+), 22 deletions(-)
>
> diff
Some devices might not implement config space access
(e.g. remoteproc used not to - before 3.9).
virtio/scsi needs config space access so make it
fail gracefully if not there.
Signed-off-by: Michael S. Tsirkin
---
drivers/scsi/virtio_scsi.c | 6 ++
1 file changed, 6 insertions(+)
diff
Some devices might not implement config space access
(e.g. remoteproc used not to - before 3.9).
virtio/scsi needs config space access so make it
fail gracefully if not there.
Signed-off-by: Michael S. Tsirkin
---
drivers/scsi/virtio_scsi.c | 6 ++
1 file changed, 6 insertions(+)
diff
ns where incorrectly
> being passed directly into target_submit_cmd_map_sgls().
>
> This patch adds the missing virtio-scsi to TCM/SAM task attribute
> conversion.
>
> Cc: Christoph Hellwig
> Cc: Michael S. Tsirkin
> Cc: Paolo Bonzini
> Signed-off-by: Nicholas Belling
On Tue, Jan 06, 2015 at 09:25:05PM +0800, Fam Zheng wrote:
> There is a race condition in virtscsi_handle_event, when many device
> hotplug/unplug events flush in quickly.
>
> The scsi_remove_device in virtscsi_handle_transport_reset may trigger
> the BUG_ON in scsi_target_reap, because the state
On Tue, Jan 06, 2015 at 03:33:36PM +0800, Fam Zheng wrote:
> There is a race condition in virtscsi_handle_event, when many device
> hotplug/unplug events flush in quickly.
>
> The scsi_remove_device in virtscsi_handle_transport_reset may trigger
> the BUG_ON in scsi_target_reap, because the state
On Tue, Jan 06, 2015 at 12:10:59AM +0200, Michael S. Tsirkin wrote:
> On Mon, Jan 05, 2015 at 11:48:47AM -0800, Venkatesh Srinivas wrote:
> > On Sun, Jan 4, 2015 at 10:04 PM, Fam Zheng wrote:
> >
> > There is a race condition in virtscsi_handle_event, when many device
&
On Mon, Jan 05, 2015 at 11:48:47AM -0800, Venkatesh Srinivas wrote:
> On Sun, Jan 4, 2015 at 10:04 PM, Fam Zheng wrote:
>
> There is a race condition in virtscsi_handle_event, when many device
> hotplug/unplug events flush in quickly.
>
> The scsi_remove_device in virtscsi_handle_tra
Note: for consistency, and to avoid sparse errors,
convert all fields, even those no longer in use
for virtio v1.0.
Signed-off-by: Michael S. Tsirkin
Acked-by: Paolo Bonzini
---
include/linux/virtio_scsi.h | 32 +++-
drivers/scsi/virtio_scsi.c | 51
Core activates this bit automatically now,
drop it from drivers that set it explicitly.
Signed-off-by: Michael S. Tsirkin
---
drivers/block/virtio_blk.c| 1 -
drivers/char/virtio_console.c | 1 -
drivers/net/virtio_net.c | 1 -
drivers/scsi/virtio_scsi.c| 1 -
4 files changed, 4
On Mon, Dec 01, 2014 at 02:53:05PM +0200, Michael S. Tsirkin wrote:
> On Mon, Dec 01, 2014 at 01:50:01PM +0100, Cornelia Huck wrote:
> > On Sun, 30 Nov 2014 17:12:47 +0200
> > "Michael S. Tsirkin" wrote:
> >
> > > Note: for consistency, and to avoid s
On Mon, Dec 01, 2014 at 01:50:01PM +0100, Cornelia Huck wrote:
> On Sun, 30 Nov 2014 17:12:47 +0200
> "Michael S. Tsirkin" wrote:
>
> > Note: for consistency, and to avoid sparse errors,
> > convert all fields, even those no longer in use
> > for virtio
Note: for consistency, and to avoid sparse errors,
convert all fields, even those no longer in use
for virtio v1.0.
Signed-off-by: Michael S. Tsirkin
Acked-by: Paolo Bonzini
---
include/linux/virtio_scsi.h | 32 +++-
drivers/scsi/virtio_scsi.c | 51
Note: for consistency, and to avoid sparse errors,
convert all fields, even those no longer in use
for virtio v1.0.
Signed-off-by: Michael S. Tsirkin
Acked-by: Paolo Bonzini
---
include/linux/virtio_scsi.h | 32 +++-
drivers/scsi/virtio_scsi.c | 51
Note: for consistency, and to avoid sparse errors,
convert all fields, even those no longer in use
for virtio v1.0.
Signed-off-by: Michael S. Tsirkin
Acked-by: Paolo Bonzini
---
include/linux/virtio_scsi.h | 32 +++-
drivers/scsi/virtio_scsi.c | 51
On Wed, Nov 26, 2014 at 03:51:03PM +0100, Cornelia Huck wrote:
> On Tue, 25 Nov 2014 18:44:08 +0200
> "Michael S. Tsirkin" wrote:
>
> > Note: for consistency, and to avoid sparse errors,
> > convert all fields, even those no longer in use
> > for virtio
Note: for consistency, and to avoid sparse errors,
convert all fields, even those no longer in use
for virtio v1.0.
Signed-off-by: Michael S. Tsirkin
---
include/linux/virtio_scsi.h | 32 +++-
drivers/scsi/virtio_scsi.c | 51
Note: for consistency, and to avoid sparse errors,
convert all fields, even those no longer in use
for virtio v1.0.
Signed-off-by: Michael S. Tsirkin
---
include/linux/virtio_scsi.h | 32 +++-
drivers/scsi/virtio_scsi.c | 51
On Mon, Nov 10, 2014 at 04:45:09PM -0800, Andy Grover wrote:
> On 10/13/2014 12:50 AM, Michael S. Tsirkin wrote:
> >virtio spec 0.9.X requires DRIVER_OK to be set before
> >VQs are used, but some drivers use VQs before probe
> >function returns.
> >Since DRIVER_OK is set
On Tue, Oct 21, 2014 at 12:05:31PM -0700, Nicholas A. Bellinger wrote:
> Hey Paolo,
>
> On Thu, 2014-10-09 at 12:49 +0200, Paolo Bonzini wrote:
> > Il 09/10/2014 10:49, Paolo Bonzini ha scritto:
> > >
> > > It does not happen if you close QEMU with SIGTERM, ctrl-c, or with the
> > > "quit" comman
On Mon, Oct 20, 2014 at 04:35:55PM +0300, Michael S. Tsirkin wrote:
> On Mon, Oct 20, 2014 at 02:42:23PM +0200, Cornelia Huck wrote:
> > On Mon, 20 Oct 2014 13:07:50 +0100
> > Thomas Graf wrote:
> >
> > > On 10/13/14 at 10:50am, Michael S. Tsirkin wrote:
> >
On Mon, Oct 20, 2014 at 02:42:23PM +0200, Cornelia Huck wrote:
> On Mon, 20 Oct 2014 13:07:50 +0100
> Thomas Graf wrote:
>
> > On 10/13/14 at 10:50am, Michael S. Tsirkin wrote:
> > > virtio spec requires drivers to set DRIVER_OK before using VQs.
> > > This
On Mon, Oct 20, 2014 at 04:10:16PM +0300, Michael S. Tsirkin wrote:
> On Mon, Oct 20, 2014 at 01:07:50PM +0100, Thomas Graf wrote:
> > On 10/13/14 at 10:50am, Michael S. Tsirkin wrote:
> > > virtio spec requires drivers to set DRIVER_OK before using VQs.
> > > This is se
On Mon, Oct 20, 2014 at 01:07:50PM +0100, Thomas Graf wrote:
> On 10/13/14 at 10:50am, Michael S. Tsirkin wrote:
> > virtio spec requires drivers to set DRIVER_OK before using VQs.
> > This is set automatically after probe returns, virtio console violated this
> > rule by
On Tue, Oct 14, 2014 at 11:01:12AM +1030, Rusty Russell wrote:
> "Michael S. Tsirkin" writes:
> > Defer config changed notifications that arrive during
> > probe/scan/freeze/restore.
> >
> > This will allow drivers to set DRIVER_OK earlier, without worryin
DRIVER_OK: previously,
the callback could race with driver-specific initialization.
This will also help simplify drivers.
Signed-off-by: Michael S. Tsirkin
Reviewed-by: Cornelia Huck
---
include/linux/virtio.h | 6 ++
drivers/virtio/virtio.c | 57
gone.
Get rid of the unnecessary lock.
Signed-off-by: Michael S. Tsirkin
Reviewed-by: Cornelia Huck
---
drivers/block/virtio_blk.c | 8
1 file changed, 8 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 91272f1a..89ba8d6 100644
--- a/drivers/block
virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after probe returns, virtio net violated this
rule by using receive VQs within probe.
To fix, call virtio_device_ready before using VQs.
Signed-off-by: Michael S. Tsirkin
Reviewed-by: Cornelia Huck
early callers to become
spec compliant and eventually support non-transitional devices.
Add API for drivers to call before using VQs.
Sets DRIVER_OK internally.
Signed-off-by: Michael S. Tsirkin
Reviewed-by: Cornelia Huck
---
include/linux/virtio_config.h | 17 +
1 file changed
goto done;
done:
return;
is ugly, it was put there to make diff review easier.
replace by open-coded return.
Signed-off-by: Michael S. Tsirkin
Acked-by: Cornelia Huck
---
drivers/net/virtio_net.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers
virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after probe returns, virtio block violated this
rule by calling add_disk, which causes the VQ to be used directly within
probe.
To fix, call virtio_device_ready before using VQs.
Signed-off-by: Michael S
gone.
Get rid of the unnecessary lock.
Signed-off-by: Michael S. Tsirkin
Reviewed-by: Cornelia Huck
---
drivers/net/virtio_net.c | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 743fb04..23e4a69 100644
--- a/drivers
hange notifications.
Signed-off-by: Michael S. Tsirkin
Reviewed-by: Cornelia Huck
---
drivers/net/virtio_net.c | 27 ---
1 file changed, 4 insertions(+), 23 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 59caa06..743fb04 100644
--- a/dr
virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after resume returns, virtio console violated this
rule by adding inbufs, which causes the VQ to be used directly within
restore.
To fix, call virtio_device_ready before using VQs.
Signed-off-by: Michael S
In the extremely unlikely event that driver initialization fails after
RX buffers are added, virtio net frees RX buffers while VQs are
still active, potentially causing device to use a freed buffer.
To fix, reset device first - same as we do on device removal.
Signed-off-by: Michael S. Tsirkin
virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after restore returns, virtio net violated this
rule by using receive VQs within restore.
To fix, call virtio_device_ready before using VQs.
Signed-off-by: Michael S. Tsirkin
Reviewed-by: Cornelia Huck
virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after restore returns, virtio scsi violated
this rule on restore by kicking event vq within restore.
To fix, call virtio_device_ready before using event queue.
Signed-off-by: Michael S. Tsirkin
We currently kick event within virtscsi_init,
before host is fully initialized.
This can in theory confuse guest if device
consumes the buffers immediately.
To fix, move virtscsi_kick_event_all out to scan/restore.
Signed-off-by: Michael S. Tsirkin
---
drivers/scsi/virtio_scsi.c | 16
virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after probe returns, virtio console violated this
rule by adding inbufs, which causes the VQ to be used directly within
probe.
To fix, call virtio_device_ready before using VQs.
Signed-off-by: Michael S
: Michael S. Tsirkin
---
net/9p/trans_virtio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 6940d8f..766ba48 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -575,6 +575,8 @@ static int p9_virtio_probe(struct virtio_device
starting queues.
Signed-off-by: Michael S. Tsirkin
---
drivers/block/virtio_blk.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 46b04bf..1c95af5 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block
virtio spec requires drivers to set DRIVER_OK before using VQs.
This is set automatically after resume returns, virtio balloon
violated this rule by adding bufs, which causes the VQ to be used
directly within restore.
To fix, call virtio_device_ready before using VQ.
Signed-off-by: Michael S
We cancel event work on device removal, but an interrupt
could trigger immediately after this, and queue it
again.
To fix, set a flag.
Loosely based on patch by Paolo Bonzini
Signed-off-by: Paolo Bonzini
Signed-off-by: Michael S. Tsirkin
---
drivers/scsi/virtio_scsi.c | 11 ++-
1
From: Paolo Bonzini
Michael S. Tsirkin noticed a race condition:
we reset device on freeze, but system WQ is still
running so it might try adding bufs to a VQ meanwhile.
To fix, switch to handling events from the freezable WQ.
Reported-by: Michael S. Tsirkin
Signed-off-by: Paolo Bonzini
Code like
vi->vq = NULL;
kfree(vi)
does not make sense.
Clean it up, use goto error labels for cleanup.
Signed-off-by: Michael S. Tsirkin
---
drivers/char/hw_random/virtio-rng.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/c
Enable VQs early like we do for restore.
This makes it possible to drop the scan callback,
moving scanning into the probe function, and making
code simpler.
Signed-off-by: Michael S. Tsirkin
---
drivers/scsi/virtio_scsi.c | 23 +++
1 file changed, 7 insertions(+), 16
This is in preparation to extending config changed event handling
in core.
Wrapping these in an API also seems to make for a cleaner code.
Signed-off-by: Michael S. Tsirkin
Reviewed-by: Cornelia Huck
---
include/linux/virtio.h | 6 +
drivers/virtio/virtio.c | 54
hange notifications.
Signed-off-by: Michael S. Tsirkin
Reviewed-by: Cornelia Huck
---
drivers/block/virtio_blk.c | 23 ---
1 file changed, 4 insertions(+), 19 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 0a58140..91272f1a 100644
--- a/dr
behaviour will break with hypervisors that assume spec compliant
behaviour. It seems like a good idea to have this patch applied to
stable branches to reduce the support butden for the hypervisors.
Cc: sta...@vger.kernel.org
Cc: Amit Shah
Signed-off-by: Michael S. Tsirkin
---
drivers/virtio
not look like a big deal.
See also commit 3fff0179e33cd7d0a688dab65700c46ad089e934
virtio-pci: do not oops on config change if driver not loaded.
for the original motivation behind the driver check.
Signed-off-by: Michael S. Tsirkin
Reviewed-by: Cornelia Huck
---
include/linux/virtio.h
le to modify it trivially and then drop scan callback
from core, but I'm rather inclined to look at ways to
make some rng core changes so that we don't need to
have so many variables tracking device state.
So this is deferred for now.
Michael S. Tsirkin (24):
virtio_pci: fix virtio s
On Mon, Oct 13, 2014 at 05:22:39PM +1030, Rusty Russell wrote:
> "Michael S. Tsirkin" writes:
> > virtio spec 0.9.X requires DRIVER_OK to be set before
> > VQs are used, but some drivers use VQs before probe
> > function returns.
> > Since DRIVER_OK is se
is virtio rng.
It's possible to modify it trivially and then drop scan callback
from core, but I'm rather inclined to look at ways to
make some rng core changes so that we don't need to
have so many variables tracking device state.
So this is deferred for now.
Michael S. Tsirkin (24):
1 - 100 of 196 matches
Mail list logo