lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 08 Feb 2013 14:35:55 +1030
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org
Cc:	Wanlong Gao <gaowanlong@...fujitsu.com>, asias@...hat.com,
	mst@...hat.com, kvm@...r.kernel.org,
	virtualization@...ts.linux-foundation.org,
	"Jens Axboe" <axboe@...nel.dk>
Subject: Re: [RFC PATCH 0/8] virtio: new API for addition of buffers, scatterlist changes

Paolo Bonzini <pbonzini@...hat.com> writes:
> The virtqueue_add_buf function has two limitations:
>
> 1) it requires the caller to provide all the buffers in a single call;
>
> 2) it does not support chained scatterlists: the buffers must be
> provided as an array of struct scatterlist.
>
> Because of these limitations, virtio-scsi has to copy each request into
> a scatterlist internal to the driver.  It cannot just use the one that
> was prepared by the upper SCSI layers.

Hi Paulo,

        Note that you've defined your problem in terms of your solution
here.  For clarity:

The problem: we want to prepend and append to a scatterlist.  We can't
        append, because the chained scatterlist implementation requires
        an element to be appended to join two scatterlists together.

The solution: fix scatterlists by introducing struct sg_ring:
        struct sg_ring {
                struct list_head ring;
        	unsigned int nents;
        	unsigned int orig_nents; /* do we want to replace sg_table? */
                struct scatterlist *sg;
        };

The workaround: make virtio accept multiple scatterlists for a single
        buffer.

There's nothing wrong with your workaround, but if other subsystems have
the same problem we do, perhaps we should consider a broader solution?

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ