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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 30 Mar 2017 17:34:17 +0300
From:   "Michael S. Tsirkin" <mst@...hat.com>
To:     Cornelia Huck <cornelia.huck@...ibm.com>
Cc:     linux-kernel@...r.kernel.org,
        John Fastabend <john.fastabend@...il.com>,
        virtualization@...ts.linux-foundation.org
Subject: Re: [PATCH 3/6] virtio: allow extra context per descriptor

On Thu, Mar 30, 2017 at 09:23:16AM +0200, Cornelia Huck wrote:
> On Wed, 29 Mar 2017 23:48:53 +0300
> "Michael S. Tsirkin" <mst@...hat.com> wrote:
> 
> > Allow extra context per descriptor. To avoid slow down for data path,
> > this disables use of indirect descriptors for this vq.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@...hat.com>
> > ---
> >  drivers/virtio/virtio_ring.c | 70 ++++++++++++++++++++++++++++++++++++--------
> >  include/linux/virtio.h       |  9 ++++++
> >  2 files changed, 66 insertions(+), 13 deletions(-)
> > 
> 
> >  /**
> > + * virtqueue_add_inbuf_ctx - expose input buffers to other end
> > + * @vq: the struct virtqueue we're talking about.
> > + * @sg: scatterlist (must be well-formed and terminated!)
> > + * @num: the number of entries in @sg writable by other side
> > + * @data: the token identifying the buffer.
> > + * @ctx: extra context for the token
> 
> I think that needs do that ctx != NULL collides with indirect
> descriptors.

At the API level what happens is that ctx needs to be enabled
at find_vqs time. Doing that will disable indirect descriptors
but this is not visible in the API.

> > + * @gfp: how to do memory allocations (if necessary).
> > + *
> > + * Caller must ensure we don't call this with other virtqueue operations
> > + * at the same time (except where noted).
> > + *
> > + * Returns zero or a negative error (ie. ENOSPC, ENOMEM, EIO).
> > + */
> > +int virtqueue_add_inbuf_ctx(struct virtqueue *vq,
> > +			struct scatterlist *sg, unsigned int num,
> > +			void *data,
> > +			void *ctx,
> > +			gfp_t gfp)
> > +{
> > +	return virtqueue_add(vq, &sg, num, 0, 1, data, ctx, gfp);
> > +}
> > +EXPORT_SYMBOL_GPL(virtqueue_add_inbuf_ctx);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ