From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6zAI-0002N3-7S for qemu-devel@nongnu.org; Mon, 12 Mar 2012 02:55:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6zAG-0002Gi-Aa for qemu-devel@nongnu.org; Mon, 12 Mar 2012 02:55:29 -0400 Received: from fmmailgate07.web.de ([217.72.192.248]:34899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6zAG-0002GV-1H for qemu-devel@nongnu.org; Mon, 12 Mar 2012 02:55:28 -0400 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate07.web.de (Postfix) with ESMTP id B9906E173CD for ; Mon, 12 Mar 2012 07:55:25 +0100 (CET) Message-ID: <4F5D9DD6.4060806@web.de> Date: Mon, 12 Mar 2012 07:55:18 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <1331449479-8197-1-git-send-email-liwp@linux.vnet.ibm.com> <4F5C585E.5020906@web.de> <20120312060850.GB31217@liwp@linux.vnet.ibm.com> In-Reply-To: <20120312060850.GB31217@liwp@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig1105DFD1CAF3E5999304BA03" Subject: Re: [Qemu-devel] [PATCH] fix bug of isa_bus irq List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wanpeng Li Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1105DFD1CAF3E5999304BA03 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2012-03-12 07:08, Wanpeng Li wrote: > On Sun, Mar 11, 2012 at 08:46:38AM +0100, Jan Kiszka wrote: >> On 2012-03-11 08:04, Wanpeng Li wrote: >>> ISA bus only use IRQ 0~15, so don't need to give an array qemu_irq 0~= 23, just >>> array qemu_irq i8259 is ok. >>> >>> Signed-off-by: Wanpeng Li >>> --- >>> hw/pc_piix.c | 3 ++- >>> 1 files changed, 2 insertions(+), 1 deletions(-) >>> >>> diff --git a/hw/pc_piix.c b/hw/pc_piix.c >>> index 63dba4e..52f7cf8 100644 >>> --- a/hw/pc_piix.c >>> +++ b/hw/pc_piix.c >>> @@ -210,7 +210,6 @@ static void pc_init1(MemoryRegion *system_memory,= >>> isa_bus =3D isa_bus_new(NULL, system_io); >>> no_hpet =3D 1; >>> } >>> - isa_bus_irqs(isa_bus, gsi); >>> =20 >>> if (kvm_irqchip_in_kernel()) { >>> i8259 =3D kvm_i8259_init(isa_bus); >>> @@ -221,6 +220,8 @@ static void pc_init1(MemoryRegion *system_memory,= >>> i8259 =3D i8259_init(isa_bus, cpu_irq[0]); >>> } >>> =20 >>> + isa_bus_irqs(isa_bus, i8259); >>> + >>> for (i =3D 0; i < ISA_NUM_IRQS; i++) { >>> gsi_state->i8259_irq[i] =3D i8259[i]; >>> } >> >> This is bogus. isa_bus_irqs sets the output IRQs of the ISA bus. And >> those are not only delivered to the PIC on the PIIX2, but also the >> IOAPIC. Thus we have to pass in the GSI input lines which dispatch to >> both. Of those lines, only the first 16 will be used by the ISA bus >> (there is even an assert to ensure this). >> >> Did you see any concrete bug in the context of this logic? >> >> Jan >> >=20 > Yes, but actually PIC is being used at present, whether passing qemu_ir= q > 0~23 to isa_bus is not safe or not. Sorry, IRQ routing to PIC and IOAPIC is actually not a property of the PIIX3 but the board we emulate. And here we follow the Multiprocessor Specification of Intel and route ISA bus IRQs to both interrupt controllers. Thus the bus must be connected to the GSIs. And, again, GSI[16..13] aren't referenced by the ISA bus at any time. Jan --------------enig1105DFD1CAF3E5999304BA03 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk9dndsACgkQitSsb3rl5xT/5gCgq5EkMSSszXhK8jPs348w+M7u I/cAoKizvIZsKIRAOnySvM59RRXnGOFt =rJVB -----END PGP SIGNATURE----- --------------enig1105DFD1CAF3E5999304BA03--