On Wed, Feb 04, 2026 at 03:37:10PM -0800, Stefano Stabellini wrote:
> Guard every mutation of serial_rx_cons/prod with console_lock so that
> cross-domain reads can't see stale data:
> 
> - In console_switch_input(): protect console_rx assignment with the lock
>   using irqsave/irqrestore variants since this can be called from
>   interrupt context
> 
> - In __serial_rx(): protect the ring buffer write operation when
>   delivering input to the hardware domain
> 
> - In do_console_io() CONSOLEIO_read: hold the lock around the entire
>   read loop, using a local buffer copy to avoid holding the lock during
>   copy_to_guest_offset()
> 
> This is preparatory work for allowing multiple domains to use the
> console_io hypercalls where proper synchronization is required.
> 
> Signed-off-by: Stefano Stabellini <[email protected]>

Reviewed-by: Denis Mukhin <[email protected]> 

Reply via email to