From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry7ZZ-00022T-L2 for qemu-devel@nongnu.org; Thu, 16 Feb 2012 15:05:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ry7ZT-00022x-JA for qemu-devel@nongnu.org; Thu, 16 Feb 2012 15:04:57 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:33442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry7ZT-00022i-78 for qemu-devel@nongnu.org; Thu, 16 Feb 2012 15:04:51 -0500 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate01.web.de (Postfix) with ESMTP id C3AF21ABC55A2 for ; Thu, 16 Feb 2012 21:04:49 +0100 (CET) Message-ID: <4F3D615E.2060603@web.de> Date: Thu, 16 Feb 2012 21:04:46 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4F3D5123.1020209@redhat.com> In-Reply-To: <4F3D5123.1020209@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigCAC42C1760ACC759F76B6609" Subject: Re: [Qemu-devel] Minor regression with kvm ioapic, gsi >= 16 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Marcelo Tosatti , "qemu-devel@nongnu.org" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigCAC42C1760ACC759F76B6609 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2012-02-16 19:55, Avi Kivity wrote: > kvm-unit-tests.git x86/apic.flat is failing ioapic tests with >=20 > qemu-system-x86_64 -vnc :99 -device testdev,chardev=3Dx -chardev null,i= d=3Dx > -smp 2 -kernel ./x86/apic.flat -serial stdio > ... > ioapic interrupt: FAIL > ioapic simultaneous interrupt: FAIL >=20 > This happens because the test is invoking gsi 16, which is handled by > the non-kvm ioapic instead of the kvm ioapic. That test should be changed anyway as the hack that allowed it so far will break finally when we move to upstream logic. Moreover, it is testing unused path with our current chipset. When this may change, I'm sure we will also have better IRQ injection mechanisms by that time. Find a patch below. >=20 > Introduced by >=20 > commit c3388c9bd8d4f4fd841b521feed20993185d9be4 > Author: Jan Kiszka > Date: Mon Feb 6 12:20:53 2012 +0100 >=20 > qemu-kvm: Fix GSI handling with in-kernel irqchip > =20 > Interrupt routing with in-kernel irqchip was always a mess. Now thi= s > increased after latest upstream merge: we started to call ioapic_se= t_irq > also for kernel-handled interrupts. > =20 > Reduce this mess again by using the upstream kvm_piix3_gsi_handler.= It > is aware of the PIIX3-specific routing in KVM mode and won't call i= nto > the user space APIC model (as we do not raise IRQs >=3D ISA_NUM_IRQ= S with > the PIIX3). > =20 > Signed-off-by: Jan Kiszka > Signed-off-by: Marcelo Tosatti >=20 >=20 > The obvious fix would be to start using upstream's kvm-ioapic, but you > haven't, why? >=20 I did this in a separate series, see your inbox. Jan --------8<-------- From: Jan Kiszka Do not use unsupported IRQ numbers The testdev is not able to trigger IRQs outside the ISA range (without fragile hacks). But we can use lower pins as well without losing information as the PIC is masked during the test. Signed-off-by: Jan Kiszka --- x86/apic.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/x86/apic.c b/x86/apic.c index 2725b9a..9e6bff9 100644 --- a/x86/apic.c +++ b/x86/apic.c @@ -139,8 +139,8 @@ static void ioapic_isr_77(isr_regs_t *regs) static void test_ioapic_intr(void) { handle_irq(0x77, ioapic_isr_77); - set_ioapic_redir(0x10, 0x77); - toggle_irq_line(0x10); + set_ioapic_redir(0x0f, 0x77); + toggle_irq_line(0x0f); asm volatile ("nop"); report("ioapic interrupt", g_isr_77 =3D=3D 1); } @@ -168,11 +168,11 @@ static void test_ioapic_simultaneous(void) { handle_irq(0x78, ioapic_isr_78); handle_irq(0x66, ioapic_isr_66); - set_ioapic_redir(0x10, 0x78); - set_ioapic_redir(0x11, 0x66); + set_ioapic_redir(0x0e, 0x78); + set_ioapic_redir(0x0f, 0x66); irq_disable(); - toggle_irq_line(0x11); - toggle_irq_line(0x10); + toggle_irq_line(0x0e); + toggle_irq_line(0x0f); irq_enable(); asm volatile ("nop"); report("ioapic simultaneous interrupt", --=20 1.7.3.4 --------------enigCAC42C1760ACC759F76B6609 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/ iEYEARECAAYFAk89YV8ACgkQitSsb3rl5xQGIACdFbbwidW7mX6VuZwNbVBS/NAI 40gAoKC7t/uM0lMu29oTHswJZfc+7gxs =bh6I -----END PGP SIGNATURE----- --------------enigCAC42C1760ACC759F76B6609--