From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi1b4-0002Wd-RK for qemu-devel@nongnu.org; Wed, 07 May 2014 09:09:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wi1au-0007dM-ET for qemu-devel@nongnu.org; Wed, 07 May 2014 09:09:18 -0400 Received: from mail-qa0-f48.google.com ([209.85.216.48]:43621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wi1au-0007cu-Ap for qemu-devel@nongnu.org; Wed, 07 May 2014 09:09:08 -0400 Received: by mail-qa0-f48.google.com with SMTP id i13so965858qae.35 for ; Wed, 07 May 2014 06:09:07 -0700 (PDT) From: Mike Day In-Reply-To: <1399442518-26303-2-git-send-email-aik@ozlabs.ru> References: <1399442518-26303-1-git-send-email-aik@ozlabs.ru> <1399442518-26303-2-git-send-email-aik@ozlabs.ru> Date: Wed, 07 May 2014 09:09:06 -0400 Message-ID: <87eh05u45p.fsf@pixel.localdomain> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 1/6] xics: add flags for interrupts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Alexander Graf > > for (i = 0; i < ics->nr_irqs; i++) { > /* FIXME: filter by server#? */ > - if (ics->islsi[i]) { > + if (ics->irqs[i].flags & XICS_FLAGS_LSI) { > resend_lsi(ics, i); Not part of your patch, but I'm curious about this FIXME (there's an identical FIXME in resend_msi). Has this proved to be a problem? With these patches you could have many unallocated interrupts in array AFTER the last allocated interrupt, correct? In that case, the loop would continue beyond the last allocated interrupt for no purpose. There are a couple ways to mitigate this type of situation by using alternative data structures to inform the loop traversal. I don't know if it is worth the effort, though. > +/* @flags == 0 measn the interrupt is not allocated */ > +#define XICS_FLAGS_LSI 0x1 > +#define XICS_FLAGS_MSI 0x2 (nit) typo in the above comment Mike -- Mike Day | "Endurance is a Virtue"