From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xensource.com, Jan Beulich <JBeulich@novell.com>,
linux-kernel@vger.kernel.org,
Konrad Rzeszutek Wilk <konrad@kernel.org>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH 4/9] xen: Add support to check if IRQ line is shared with other domains.
Date: Mon, 13 Dec 2010 11:34:52 -0800 [thread overview]
Message-ID: <4D06755C.2050200@goop.org> (raw)
In-Reply-To: <1292263303-31680-5-git-send-email-konrad.wilk@oracle.com>
On 12/13/2010 10:01 AM, Konrad Rzeszutek Wilk wrote:
> We do this via the PHYSDEVOP_irq_status_query support hypervisor call.
> We will get a positive value if another domain has binded its
> PIRQ to the specified IRQ line.
>
> [v2: Deal with v2.6.37-rc1 rebase fallout]
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> drivers/xen/events.c | 13 +++++++++++++
> include/xen/events.h | 3 +++
> 2 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index 96c93e7..690dfad 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -1398,6 +1398,19 @@ void xen_poll_irq(int irq)
> xen_poll_irq_timeout(irq, 0 /* no timeout */);
> }
>
> +/* Check whether the IRQ line is shared with other guests. */
> +int xen_ignore_irq(int irq)
I think this could do with a better name. The function actually testing
for sharing; the fact you might choose to ignore it because its shared
is by the by (and becomes very misleading if you end up wanting to test
for sharedness for some other reason).
> +{
> + struct irq_info *info = info_for_irq(irq);
> + struct physdev_irq_status_query irq_status = { .irq =
> + info->u.pirq.gsi };
That's a pretty awkward linebreak.
J
> +
> + if (HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status))
> + return 0;
> + return !(irq_status.flags & XENIRQSTAT_shared);
> +}
> +EXPORT_SYMBOL_GPL(xen_ignore_irq);
> +
> void xen_irq_resume(void)
> {
> unsigned int cpu, irq, evtchn;
> diff --git a/include/xen/events.h b/include/xen/events.h
> index 646dd17..553c664 100644
> --- a/include/xen/events.h
> +++ b/include/xen/events.h
> @@ -89,4 +89,7 @@ int xen_vector_from_irq(unsigned pirq);
> /* Return gsi allocated to pirq */
> int xen_gsi_from_irq(unsigned pirq);
>
> +/* Determine whether to ignore this IRQ if passed to a guest. */
> +int xen_ignore_irq(int irq);
> +
> #endif /* _XEN_EVENTS_H */
next prev parent reply other threads:[~2010-12-13 19:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-13 18:01 [PATCH v2] Xen PCI backend driver Konrad Rzeszutek Wilk
2010-12-13 18:01 ` [PATCH 1/9] xen: export xen_gsi_from_irq, it is required by modular pciback Konrad Rzeszutek Wilk
2010-12-13 18:01 ` [PATCH 2/9] xen/pci: Add xen_[find|register|unregister]_device_domain_owner functions Konrad Rzeszutek Wilk
2010-12-13 19:28 ` Jeremy Fitzhardinge
2010-12-13 18:01 ` [PATCH 3/9] xen: Check if the PCI device is owned by a domain different than DOMID_SELF Konrad Rzeszutek Wilk
2010-12-13 18:01 ` [PATCH 4/9] xen: Add support to check if IRQ line is shared with other domains Konrad Rzeszutek Wilk
2010-12-13 19:34 ` Jeremy Fitzhardinge [this message]
2010-12-13 18:01 ` [PATCH 5/9] xen: implement bind_interdomain_evtchn_to_irqhandler for backend drivers Konrad Rzeszutek Wilk
2010-12-13 18:01 ` [PATCH 6/9] pci/xen: Make xen_[find|register|unregister]_domain_owner be _GPL Konrad Rzeszutek Wilk
2010-12-13 19:18 ` Jeremy Fitzhardinge
2010-12-13 18:01 ` [PATCH 7/9] xen-pciback: Backend driver for Xen pci-front Konrad Rzeszutek Wilk
2010-12-13 18:01 ` [PATCH 8/9] xen/pciback: Fix checkpatch warnings and errors Konrad Rzeszutek Wilk
2010-12-13 18:01 ` [PATCH 9/9] xen/xen-pciback: Swap over to DEFINE_PCI_DEVICE_TABLE Konrad Rzeszutek Wilk
2010-12-14 10:08 ` Jan Beulich
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=4D06755C.2050200@goop.org \
--to=jeremy@goop.org \
--cc=JBeulich@novell.com \
--cc=konrad.wilk@oracle.com \
--cc=konrad@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stefano.stabellini@eu.citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox