From: "Jan Beulich" Subject: Re: Re: 4.0/4.1 requests - IO-APIC EOI v2 [RFC] Date: Fri, 09 Sep 2011 17:03:07 +0100 Message-ID: <4E6A54DB02000078000558B6@nat28.tlf.novell.com> References: <4E689D9A.1020405@citrix.com> <4E68C6C10200007800055485@nat28.tlf.novell.com> <4E68C09B.8050409@citrix.com> <4E68E1D30200007800055501@nat28.tlf.novell.com> <4E68C9A9.8090707@citrix.com> <4E6A2B7F.6060006@citrix.com> <4E6A4F66020000780005589B@nat28.tlf.novell.com> <4E6A36EB.6000802@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <4E6A36EB.6000802@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Andrew Cooper Cc: Keir Fraser , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 09.09.11 at 17:55, Andrew Cooper wrote: > On 09/09/11 16:39, Jan Beulich wrote: >>>>> On 09.09.11 at 17:06, Andrew Cooper = wrote: >>> @@ -397,18 +397,7 @@ static void clear_IO_APIC_pin(unsigned i >>> entry.trigger =3D 1; >>> __ioapic_write_entry(apic, pin, TRUE, entry); >>> } >>> - if (mp_ioapics[apic].mpc_apicver >=3D 0x20) >>> - io_apic_eoi(apic, entry.vector); >>> - else { >>> - /* >>> - * Mechanism by which we clear remoteIRR in this case is = by >>> - * changing the trigger mode to edge and back to level. >>> - */ >>> - entry.trigger =3D 0; >>> - __ioapic_write_entry(apic, pin, TRUE, entry); >>> - entry.trigger =3D 1; >>> - __ioapic_write_entry(apic, pin, TRUE, entry); >>> - } >>> + io_apic_eoi(apic, entry.vector, pin); >> This should be __io_apic_eoi() - all other functions called here are = the >> non-locking ones, too. >=20 > Questionable - I traced the calls and at this point and cant see the > ioapic lock being taken. I guess it might be safer overall to use > non-locking and leave the problem to whoever cleans up the irq code... It indeed is not being taken, and as you say this is deliberate (we may be cleaning up in a crashed environment here). >>> + { >>> + /* Else fake an EOI by switching to edge triggered mode >>> + * and back */ >>> + struct IO_APIC_route_entry entry; >>> + bool_t need_to_unmask =3D 0; >>> + >> You may want to assert that at least one of vector and pin is not -1. >=20 > There is a BUG_ON at the top of the function if both vector and pin are = -1. Sorry, I must have missed that. Jan