Re: [PATCH v9 09/10] s390/vfio_ccw: selectively expand io_mutex
From: Matthew Rosato
Date: Tue Jul 28 2026 - 10:58:46 EST
On 7/27/26 11:30 PM, Eric Farman wrote:
> The io_mutex was defined to serialize the io_regions, but then has
> also sort of been associated with the I/O themselves because of
> the close relationship they share.
>
> With the handful of races that are possible, the choices are either to:
> A) expand the scope of io_mutex to close these remaining windows, or
> B) reduce the scope of io_mutex to just io_region, and introduce a new
> lock mechanism for the remaining I/O resources
>
> This patch implements A, since B brings with it a lot more interactions
> that would need to be tracked and kept in a correct hierarchy. It also
> takes advantage of the workqueue element for cp_free() that now gets
> called out of fsm_notoper(), which could be invoked out of an interrupt
> context and thus cannot acquire a mutex itself.
>
> Fixes: 4f76617378ee ("vfio-ccw: protect the I/O region")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Eric Farman <farman@xxxxxxxxxxxxx>
Reviewed-by: Matthew Rosato <mjrosato@xxxxxxxxxxxxx>