From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jkitk-0007y3-PI for qemu-devel@nongnu.org; Sat, 12 Apr 2008 12:48:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jkiti-0007uh-O4 for qemu-devel@nongnu.org; Sat, 12 Apr 2008 12:48:15 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jkiti-0007uS-GB for qemu-devel@nongnu.org; Sat, 12 Apr 2008 12:48:14 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jkith-0006M7-PX for qemu-devel@nongnu.org; Sat, 12 Apr 2008 12:48:14 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] 8250: more realistic TX-done IRQ rate Date: Sat, 12 Apr 2008 17:48:05 +0100 References: <4800CDAE.3090606@web.de> In-Reply-To: <4800CDAE.3090606@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804121748.06132.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka On Saturday 12 April 2008, Jan Kiszka wrote: > The 8250 UART emulation currently raises a TX-done IRQ immediately when the > guest writes out some character. This is problematic for guests like Linux > which may flush its output buffer in a loop from IRQ context, because they > may then enter a tight loop with IRQs disabled. In fact, Linux breaks out > of this loop after some iterations and issue the well-known [1] "too much > work for irq..." warning. And in case the console output is on the very > same serial port, the console output is utterly corrupted. Please see previous threads on this topic. > Patch below addresses the issue by delaying the TX-done IRQ more > realistically, ie. according to the currently set baudrate. Unless the serial baud rate is extremely low (<1kbaud) this isn't going to work with any sort of reliability. You have to fix this in a way that doesn't require high resolution realtime response. I'd also expect you to have the same problem with the RX queue. If you don't it's a bug elsewhere in qemu. > + qemu_mod_timer(s->tx_timer, 1000 / (11520 / s->divider)); This looks bogus. I think you're a few orders of magnitude out in your timing calculations. As mentioned above, in practice you unlikely to get anywhere near the necessary realtime performance out of qemu. Paul