From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tokarev Subject: Re: [Qemu-devel] Re: >2 serial ports? Date: Mon, 22 Mar 2010 11:35:17 +0300 Message-ID: <4BA72BC5.1020303@msgid.tls.msk.ru> References: <4BA094FE.6020109@msgid.tls.msk.ru> <4BA09E41.7000300@redhat.com> <201003171118.09873.paul@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, Gerd Hoffmann , KVM list To: Paul Brook Return-path: Received: from isrv.corpit.ru ([81.13.33.159]:56222 "EHLO isrv.corpit.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752301Ab0CVIfU (ORCPT ); Mon, 22 Mar 2010 04:35:20 -0400 In-Reply-To: <201003171118.09873.paul@codesourcery.com> Sender: kvm-owner@vger.kernel.org List-ID: Paul Brook wrote at Wed, 17 Mar 2010 11:18:09 +0000: >> Oh, well, yes, I remember. qemu is more strict on ISA irq sharing now. >> A bit too strict. >> >> /me goes dig out a old patch which never made it upstream for some >> reason I forgot. Attached. > > This is wrong. Two devices should never be manipulating the same qemu_irq > object. If you want multiple devices connected to the same IRQ then you need > an explicit multiplexer. e.g. arm_timer.c:sp804_set_irq. So... what we have to do here? I've looked at the mentioned routine, here it is: /* Merge the IRQs from the two component devices. */ static void sp804_set_irq(void *opaque, int irq, int level) { sp804_state *s = (sp804_state *)opaque; s->level[irq] = level; qemu_set_irq(s->irq, s->level[0] || s->level[1]); } But I know nothing about qemu internals, so don't quite understand how to do this in case of serial ports. I see it is tracking two timers and raises the irq level if at least one half is raised... That to say - I've got the idea, but how to apply it to serial ports? Thanks! /mjt From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ntd6h-0003ts-CZ for qemu-devel@nongnu.org; Mon, 22 Mar 2010 04:35:31 -0400 Received: from [199.232.76.173] (port=49983 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ntd6g-0003tc-RB for qemu-devel@nongnu.org; Mon, 22 Mar 2010 04:35:30 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ntd6f-00042e-Gd for qemu-devel@nongnu.org; Mon, 22 Mar 2010 04:35:30 -0400 Received: from isrv.corpit.ru ([81.13.33.159]:34420) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ntd6f-00040d-0C for qemu-devel@nongnu.org; Mon, 22 Mar 2010 04:35:29 -0400 Message-ID: <4BA72BC5.1020303@msgid.tls.msk.ru> Date: Mon, 22 Mar 2010 11:35:17 +0300 From: Michael Tokarev MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: >2 serial ports? References: <4BA094FE.6020109@msgid.tls.msk.ru> <4BA09E41.7000300@redhat.com> <201003171118.09873.paul@codesourcery.com> In-Reply-To: <201003171118.09873.paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org, KVM list , Gerd Hoffmann Paul Brook wrote at Wed, 17 Mar 2010 11:18:09 +0000: >> Oh, well, yes, I remember. qemu is more strict on ISA irq sharing now. >> A bit too strict. >> >> /me goes dig out a old patch which never made it upstream for some >> reason I forgot. Attached. > > This is wrong. Two devices should never be manipulating the same qemu_irq > object. If you want multiple devices connected to the same IRQ then you need > an explicit multiplexer. e.g. arm_timer.c:sp804_set_irq. So... what we have to do here? I've looked at the mentioned routine, here it is: /* Merge the IRQs from the two component devices. */ static void sp804_set_irq(void *opaque, int irq, int level) { sp804_state *s = (sp804_state *)opaque; s->level[irq] = level; qemu_set_irq(s->irq, s->level[0] || s->level[1]); } But I know nothing about qemu internals, so don't quite understand how to do this in case of serial ports. I see it is tracking two timers and raises the irq level if at least one half is raised... That to say - I've got the idea, but how to apply it to serial ports? Thanks! /mjt