From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: konrad.wilk@oracle.com, david.vrabel@citrix.com, jgross@suse.com,
tglx@linutronix.de, linux-kernel@vger.kernel.org,
xen-devel@lists.xen.org
Subject: Re: [Xen-devel] [PATCH] xen/events: Always allocate legacy interrupts on PV guests
Date: Wed, 18 Nov 2015 12:16:28 +0100 [thread overview]
Message-ID: <87lh9vv9pv.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <1447774585-21857-1-git-send-email-boris.ostrovsky@oracle.com> (Boris Ostrovsky's message of "Tue, 17 Nov 2015 10:36:25 -0500")
Boris Ostrovsky <boris.ostrovsky@oracle.com> writes:
> After commit 8c058b0b9c34 ("x86/irq: Probe for PIC presence before
> allocating descs for legacy IRQs") early_irq_init() will no longer
> preallocate descriptors for legacy interrupts if PIT does not
> exist.
PIC?
>
> Therefore we need to allocate those descriptors for PV guests
> ourselves.
>
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Suggested-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> drivers/xen/events/events_base.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
> index 849500e..a2bb333 100644
> --- a/drivers/xen/events/events_base.c
> +++ b/drivers/xen/events/events_base.c
> @@ -419,8 +419,8 @@ static int __must_check xen_allocate_irq_gsi(unsigned gsi)
> if (xen_pv_domain() && !xen_initial_domain())
> return xen_allocate_irq_dynamic();
>
> - /* Legacy IRQ descriptors are already allocated by the arch. */
> - if (gsi < NR_IRQS_LEGACY)
> + /* On HVM legacy IRQ descriptors are already allocated by the arch. */
> + if (xen_hvm_domain() && gsi < NR_IRQS_LEGACY)
> irq = gsi;
Wouldn't it be better to write it as
if (gsi < nr_legacy_irqs()) ?
I think it's possible to have PIC-less HVM guests in future (btw, what
about HVMlite?). I see nr_legacy_irqs() is x86-only but it can easily be
defined to NR_IRQS_LEGACY on other arches.
> else
> irq = irq_alloc_desc_at(gsi, -1);
> @@ -445,8 +445,8 @@ static void xen_free_irq(unsigned irq)
>
> kfree(info);
>
> - /* Legacy IRQ descriptors are managed by the arch. */
> - if (irq < NR_IRQS_LEGACY)
> + /* On HVM legacy IRQ descriptors are managed by the arch. */
> + if (xen_hvm_domain() && irq < NR_IRQS_LEGACY)
> return;
>
> irq_free_desc(irq);
--
Vitaly
next prev parent reply other threads:[~2015-11-18 11:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-17 15:36 [PATCH] xen/events: Always allocate legacy interrupts on PV guests Boris Ostrovsky
2015-11-17 15:38 ` David Vrabel
2015-11-17 16:24 ` Juergen Gross
2015-11-18 11:16 ` Vitaly Kuznetsov [this message]
2015-11-18 14:03 ` [Xen-devel] " Boris Ostrovsky
2015-11-18 14:28 ` Vitaly Kuznetsov
2015-11-18 15:00 ` Boris Ostrovsky
-- strict thread matches above, loose matches on Subject: below --
2015-11-20 16:25 Boris Ostrovsky
2015-11-26 18:22 ` [Xen-devel] " David Vrabel
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=87lh9vv9pv.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=jgross@suse.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=xen-devel@lists.xen.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox