Re: [RFC PATCH 3/3] hw/virtio: Have virtqueue_get_avail_bytes() pass caches arg to callees

2021-09-02 Thread Stefan Hajnoczi
On Thu, Sep 02, 2021 at 03:09:54PM +0200, Stefano Garzarella wrote: > On Thu, Sep 02, 2021 at 01:12:33PM +0100, Stefan Hajnoczi wrote: > > On Wed, Sep 01, 2021 at 05:55:38PM +0200, Stefano Garzarella wrote: > > > On Thu, Aug 26, 2021 at 07:26:58PM +0200, Philippe Mathieu-Daudé wrote: > > > > Both

Re: [RFC PATCH 3/3] hw/virtio: Have virtqueue_get_avail_bytes() pass caches arg to callees

2021-09-02 Thread Stefano Garzarella
On Thu, Sep 02, 2021 at 01:12:33PM +0100, Stefan Hajnoczi wrote: On Wed, Sep 01, 2021 at 05:55:38PM +0200, Stefano Garzarella wrote: On Thu, Aug 26, 2021 at 07:26:58PM +0200, Philippe Mathieu-Daudé wrote: > Both virtqueue_packed_get_avail_bytes() and > virtqueue_split_get_avail_bytes() access

Re: [RFC PATCH 3/3] hw/virtio: Have virtqueue_get_avail_bytes() pass caches arg to callees

2021-09-02 Thread Stefan Hajnoczi
On Wed, Sep 01, 2021 at 05:55:38PM +0200, Stefano Garzarella wrote: > On Thu, Aug 26, 2021 at 07:26:58PM +0200, Philippe Mathieu-Daudé wrote: > > Both virtqueue_packed_get_avail_bytes() and > > virtqueue_split_get_avail_bytes() access the region cache, but > > their caller also does. Simplify by

Re: [RFC PATCH 3/3] hw/virtio: Have virtqueue_get_avail_bytes() pass caches arg to callees

2021-09-01 Thread Stefano Garzarella
On Thu, Aug 26, 2021 at 07:26:58PM +0200, Philippe Mathieu-Daudé wrote: Both virtqueue_packed_get_avail_bytes() and virtqueue_split_get_avail_bytes() access the region cache, but their caller also does. Simplify by having virtqueue_get_avail_bytes calling both with RCU lock held, and passing the

[RFC PATCH 3/3] hw/virtio: Have virtqueue_get_avail_bytes() pass caches arg to callees

2021-08-26 Thread Philippe Mathieu-Daudé
Both virtqueue_packed_get_avail_bytes() and virtqueue_split_get_avail_bytes() access the region cache, but their caller also does. Simplify by having virtqueue_get_avail_bytes calling both with RCU lock held, and passing the caches as argument. Signed-off-by: Philippe Mathieu-Daudé --- RFC