All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@eu.citrix.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stabellini <Stefano.Stabellini@eu.citrix.com>Stefano
Subject: Re: [PATCH 3/4] xen: events: add xen_allocate_irq_{dynamic, gsi} and xen_free_irq
Date: Tue, 11 Jan 2011 19:32:54 +0000	[thread overview]
Message-ID: <1294774374.12280.62.camel@localhost.localdomain> (raw)
In-Reply-To: <20110111184625.GB29378@dumpdata.com>

On Tue, 2011-01-11 at 18:46 +0000, Konrad Rzeszutek Wilk wrote:
> > +     if (!identity_mapped_irq(gsi) &&
> > +         (xen_initial_domain() || !xen_pv_domain()))
> 
> Perhaps 'xen_hvm_domain()' would sound better? That way there
> are less _not_ expressions to think through?

This is deliberately just the inverse of the test I removed from the
callsite in xen_map_pirq_gsi, modulo an application or two of De
Morgan's:

-       /* If we are a PV guest, we don't have GSIs (no ACPI passed). Therefore
-        * we are using the !xen_initial_domain() to drop in the function.*/
-       if (identity_mapped_irq(gsi) || (!xen_initial_domain() &&
-                               xen_pv_domain())) {
-               irq = gsi;
-               irq_alloc_desc_at(irq, -1);
-       } else
-               irq = find_unbound_irq();
+       irq = xen_allocate_irq_gsi(gsi);

This patch is just the refactoring step before the meat of the change in
the following patch where this complex expression goes away. 

> > +             return xen_allocate_irq_dynamic();
> 
> Ok, so this ends up allocating an IRQ for all non-physical
> IRQs, such as the spinlock, call IPI, and so on, correct? 

The overall effect should be identical to before this patch. 

> > +static void xen_free_irq(unsigned irq)
> > +{
> > +     irq_free_desc(irq);
> This is still OK even if the IRQ is < NR_IRQS_LEGACY? You mention
> "Legacy IRQ descriptors are already allocated by the arch" so I would
> think that the arch would take care of de-allocating those?

Hmm. Interesting question. I suspect you are right but I can't think
howto convince the system to deallocate such an interrupt anyway. I'll
dig around the code a little and convince myself as best I can that
adding a check+return there is correct.

Ian.

  reply	other threads:[~2011-01-11 19:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-11 17:19 [PATCH 0/4] xen: events: improve event channel IRQ allocation strategy Ian Campbell
2011-01-11 17:20 ` [PATCH 1/4] xen: handled remapped IRQs when enabling a pcifront PCI device Ian Campbell
2011-01-11 17:20 ` [PATCH 2/4] xen:events: move find_unbound_irq inside CONFIG_PCI_MSI Ian Campbell
2011-01-11 17:20 ` [PATCH 3/4] xen: events: add xen_allocate_irq_{dynamic, gsi} and xen_free_irq Ian Campbell
2011-01-11 18:46   ` Konrad Rzeszutek Wilk
2011-01-11 19:32     ` Ian Campbell [this message]
2011-02-03  8:30   ` [PATCH] xen: events: do not free legacy IRQs Ian Campbell
2011-02-03  9:49     ` Ian Campbell
2011-01-11 17:20 ` [PATCH 4/4] xen: events: allocate GSIs and dynamic IRQs from separate IRQ ranges Ian Campbell
2011-01-11 19:14   ` Konrad Rzeszutek Wilk
2011-01-11 19:39     ` Ian Campbell
2011-01-11 18:34 ` [PATCH 0/4] xen: events: improve event channel IRQ allocation strategy Konrad Rzeszutek Wilk
2011-01-11 19:25   ` Ian Campbell
2011-01-11 20:40     ` Konrad Rzeszutek Wilk
2011-01-12 10:04       ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294774374.12280.62.camel@localhost.localdomain \
    --to=ian.campbell@eu.citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=jeremy@goop.org \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.