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

Re: [PATCH for-4.22] char/ns16550: bound execution time of ns16550_interrupt()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 23 Jun 2026 16:19:08 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • 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=uRS58iMhLNg5y/4kLEAE7WHi2dVvTtk56WbX55L+UmM=; b=vJYF9J8L/gtHCGqbRhzHzG6LD3Pdd1+wD5uGMITtrVMHaOYLRR1BeNZl7NIfN4+N3dOdlt3csrPM9jmyyUIJW6qcc/nAMsaWru6Htw9TgFEo8MJUVSVzTzYcNsH3nLAfjuf6K0FwzuJJPj2RMRNeDQccIFteJxX+IGe415x/V72/0sE59qnoyHBEY4X4lDy/l1Ln9ScL1hO2C91CGgXsNR6YpjadC7IBix+XWB2RwtTuItTyjUkSk0/pWSICi1XUff9kpjA03KXknRiDYENeIARley7OvEJYYHvNjMz3cOraTQis2ovmn9M4qZ+e1TxideMJI3ZSf37tQqtT1Z9efg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Wkk18n1SGY1ZqLBckxo7WXMe02Juek/l5r8VJD6laDLpnVrqazMPxoJbxCW3Vwqb9r4Jl+it/NUCPVmpM2mYXzXtnxATbbYeAJFqrbjqlv1YElmeErePZL+D5cgXT1EO25AFJZbBVnnhvlrVeaAUMzqclCO2NFaVgmijfT0V/aGmKqB0IMTxgC57LO0ZsGxcH4xI6VHmyKlBbXnGIKDi99BSNBUUAQR83wTtGnS+cAX5URcd1PCHlj2UFvPfSxU+EcQW1mu7wOPGG4xouIsEDjFOug2TRx5u6AgeJAtMv6dKZSqSewjY3GZxE0JQsrLOfi2ertT4oLcY3N9SXtPhzQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 23 Jun 2026 14:19:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Jun 23, 2026 at 03:46:11PM +0200, Jan Beulich wrote:
> On 23.06.2026 15:36, Oleksii Kurochko wrote:
> > On 6/23/26 12:31 PM, Roger Pau Monne wrote:
> >> The current logic in ns16550_interrupt() will loop until the device sets
> >> the NOINT in IIR.  At least on the Lenovo ThinkSystem SR630 V4 the flow
> >> control of the serial-over-lan emulated UART seems to be broken, as it
> >> doesn't set the NOINT bit consistently.  The Transmitter Holding Register
> >> Empty in LSR also seems to not be properly signaled, as even with it set
> >> writes to the transmit register take ~6ms.  This leads to the watchdog
> >> triggering very easily on such system.
> >>
> >> Introduce an upper bound on the execution time of ns16550_interrupt(), this
> >> is currently set as 4x the polling interval, which is calculated as the
> >> time to fill RX FIFO and/or empty TX FIFO.  The current maximum is 5ms.
> >> Once the timeout triggers the interrupt is disabled and the uart is
> >> switched to polling mode.
> > 
> > Don't you mmiss Fixes: tag?
> 
> Fixes: "SoL on Lenovo ThinkSystem SR630 V4"
> 
> you mean? I think there's nothing wrong with our pre-existing code, and
> the changes here instead are a workaround for some (apparently) badly
> implemented SoL.

It was on purpose that no Fixes tag was provided.

Xen code would be fine with well-behaved uarts, however most of the
serial-over-lan emulated ones are not well behaved it seems.

There's a possible issue with the unbounded loop in
ns16550_interrupt() as it's relying solely on hardware register values
to terminate, which again would be OK if hardware was correctly
implemented.  I don't think this warrants a Fixes tag.

Thanks, Roger.



 


Rackspace

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