Re: [RFC PATCH v1 1/5] vfio-ccw: Move guest_cp storage into common struct

Cornelia Huck
2019-06-19T08:14:27Z

On Tue, 18 Jun 2019 22:23:48 +0200
Eric Farman <farman@linux.ibm.com> wrote:

> Rather than allocating/freeing a piece of memory every time
> we try to figure out how long a CCW chain is, let's use a piece
> of memory allocated for each device.
>
> The io_mutex added with commit 4f76617378ee9 ("vfio-ccw: protect
> the I/O region") is held for the duration of the VFIO_CCW_EVENT_IO_REQ
> event that accesses/uses this space, so there should be no race
> concerns with another CPU attempting an (unexpected) SSCH for the
> same device.
>
> Suggested-by: Cornelia Huck <cohuck@redhat.com>
> Signed-off-by: Eric Farman <farman@linux.ibm.com>
> ---
> Conny, your suggestion [1] did not go unnoticed. :)

:)

>
> [1] https://patchwork.kernel.org/comment/22312659/
> ---
> drivers/s390/cio/vfio_ccw_cp.c | 23 ++++-------------------
> drivers/s390/cio/vfio_ccw_cp.h | 7 +++++++
> drivers/s390/cio/vfio_ccw_drv.c | 7 +++++++
> 3 files changed, 18 insertions(+), 19 deletions(-)

Nice!

Reviewed-by: Cornelia Huck <cohuck@redhat.com>