From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52069 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0qPI-00063P-KG for qemu-devel@nongnu.org; Wed, 29 Sep 2010 02:44:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0qPH-000337-BI for qemu-devel@nongnu.org; Wed, 29 Sep 2010 02:44:48 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:56380) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0qPG-00032z-VL for qemu-devel@nongnu.org; Wed, 29 Sep 2010 02:44:47 -0400 Message-ID: <4CA2E057.80204@web.de> Date: Wed, 29 Sep 2010 08:44:39 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4CA2069D.9040104@uiuc.edu> <4CA248C5.2020409@gmail.com> In-Reply-To: <4CA248C5.2020409@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig751432A30AA09EABF06ACBC6" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: PATCH: debugging apic List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sam King Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig751432A30AA09EABF06ACBC6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Am 28.09.2010 21:57, Sam King wrote: > Thanks to Bernhard Kauer for pointing out the problem. Apparently if > software disables LVT_LINT0 when there is a pending CPU_HARD_INTERRUPT > you can get into trouble. I attached a patch that fixes the problem by= > resetting the interrupt_request. I am not sure if we need to do the > same for LINT1, but this fixed the incorrect GPF I was getting. >=20 =2E.. [ please inline patches ] > *** hw/apic.c 2010-07-22 07:39:04.000000000 -0500 > --- ../qemu-0.12.5-fixed/hw/apic.c 2010-09-28 14:45:55.476945540 -0500 > *************** > *** 841,846 **** > --- 841,851 ---- > s->lvt[n] =3D val; > if (n =3D=3D APIC_LVT_TIMER) > apic_timer_update(s, qemu_get_clock(vm_clock)); > +=20 > + if(n =3D=3D APIC_LVT_LINT0) { > + if((val & APIC_LVT_MASKED) && (env->interrupt_request= & CPU_INTERRUPT_HARD)) > + cpu_reset_interrupt(env, CPU_INTERRUPT_HARD); > + } > } > break; > case 0x38: This actually points out open issues, but more work is required: You need to consider other potentially pending interrupts as well, thus you must not blindly reset here. And the same is true for invocations of apic_deliver_pic_intr(..., 0). The APIC has to save the PIC line state and forward it according to its current LVT mask state, which includes raising the interrupt if the mask is removed while the PIC line is high. Jan --------------enig751432A30AA09EABF06ACBC6 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.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkyi4FsACgkQitSsb3rl5xR+mwCg66Vh4/g+0VR/yGSZUCqxZX5X tZMAoKn6LLVnl8FywCRd3OmNMx8IAsbQ =FrST -----END PGP SIGNATURE----- --------------enig751432A30AA09EABF06ACBC6--