[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v10 3/5] xen/console: add locking for serial_rx ring buffer access


  • To: Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • From: dmukhin@xxxxxxxx
  • Date: Fri, 6 Feb 2026 14:24:16 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 148.163.138.245) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jvRfC2O/mNe4IS70swksiJIxQzfBIUtBFytrUnAMVCM=; b=SEPIza8C9tppSK0aBvPqyI52TtUsOxNpr6w2HTWEbB3meo3Ac3NhdMYw9bgCyJ9G/34SHNBkMx9mgYKKi8wumJPI+SMSLDIqcvWK8vyKYCqiQmAocuRzdg0bcPZsydduCCalMVgJ4XPNC+Qq/aI3E2CcGGfaEqdma7j9Ask92K7Vrr6Om1114nVn697W/iF3Yp3PxnFQkbf+cpjzkJfBizO21ohqbZMQ8WVHmIi5ukGBTPtk2LkixfYEVXgf8uXBroLrBJvIqO82vLcnS6t95lJMdIKE8HkASDy1UrTzThlqPmRNfai0AP7djlGVye4V4TgFiEHJrq/JQ64OMJSl0g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fApHTIzm/Yp8ErgWTub6r+lNXlA162moVIrLcMeubsRrgZbbyrrmQcLXR2SfGBYggSd01tVxkDC0JPcfX0m0YHyE1SsBVt+67fnmiWReyCYKoux0w9xcBIlVEevQMniDk4BkpeZiEZTguGdnKTB1qt7ylO51HEbA6dHGtG2ph2SYW+mHJ/SbLqlAN87jjl5mh7b8LO2Q3xjaFqUniGT8U+iqLrpgb/01n40FMBWx9+HbjB9kxzSfHHFws+DiXgLkzLkt4IfYkatXWYUFc5cBPDY9/KyNCY2T2PXCaSkyRmfIgeTdP4eV6oYoe39NsPtrIa/OanY5kPjDs4R+9vfmKw==
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, grygorii_strashko@xxxxxxxx, anthony.perard@xxxxxxxxxx, michal.orzel@xxxxxxx, julien@xxxxxxx, roger.pau@xxxxxxxxxx, jason.andryuk@xxxxxxx, victorm.lira@xxxxxxx, andrew.cooper3@xxxxxxxxxx, jbeulich@xxxxxxxx, sstabellini@xxxxxxxxxx
  • Delivery-date: Fri, 06 Feb 2026 22:24:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

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 <stefano.stabellini@xxxxxxx>

Reviewed-by: Denis Mukhin <dmukhin@xxxxxxxx> 



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.