From: Juergen Gross <jgross@suse.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: "Vincent Guittot" <vincent.guittot@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
stratos-dev@op-lists.linaro.org,
"Erik Schilling" <erik.schilling@linaro.org>,
"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
"Mathieu Poirier" <mathieu.poirier@linaro.org>,
xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] xen: evtchn: Allow shared registration of IRQ handers
Date: Thu, 28 Sep 2023 17:33:08 +0200 [thread overview]
Message-ID: <8c0f3255-83ea-4108-847f-63b895997577@suse.com> (raw)
In-Reply-To: <fc6d47de76a8b77d0a1b4bc8204694c079715f2e.1693311370.git.viresh.kumar@linaro.org>
[-- Attachment #1.1.1: Type: text/plain, Size: 2009 bytes --]
On 29.08.23 14:29, Viresh Kumar wrote:
> Currently the handling of events is supported either in the kernel or
> userspace, but not both.
>
> In order to support fast delivery of interrupts from the guest to the
> backend, we need to handle the Queue notify part of Virtio protocol in
> kernel and the rest in userspace.
>
> Update the interrupt handler registration flag to IRQF_SHARED for event
> channels, which would allow multiple entities to bind their interrupt
> handler for the same event channel port.
>
> Also increment the reference count of irq_info when multiple entities
> try to bind event channel to irqchip, so the unbinding happens only
> after all the users are gone.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> drivers/xen/events/events_base.c | 1 +
> drivers/xen/evtchn.c | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
> index c7715f8bd452..0182680dab3a 100644
> --- a/drivers/xen/events/events_base.c
> +++ b/drivers/xen/events/events_base.c
> @@ -1239,6 +1239,7 @@ static int bind_evtchn_to_irq_chip(evtchn_port_t evtchn, struct irq_chip *chip,
> } else {
> struct irq_info *info = info_for_irq(irq);
> WARN_ON(info == NULL || info->type != IRQT_EVTCHN);
> + info->refcnt++;
This should be conditional on the WARN_ON() not triggering.
> }
>
> out:
> diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
> index c99415a70051..43f77915feb5 100644
> --- a/drivers/xen/evtchn.c
> +++ b/drivers/xen/evtchn.c
> @@ -397,7 +397,7 @@ static int evtchn_bind_to_user(struct per_user_data *u, evtchn_port_t port)
> if (rc < 0)
> goto err;
>
> - rc = bind_evtchn_to_irqhandler_lateeoi(port, evtchn_interrupt, 0,
> + rc = bind_evtchn_to_irqhandler_lateeoi(port, evtchn_interrupt, IRQF_SHARED,
> u->name, evtchn);
> if (rc < 0)
> goto err;
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
next prev parent reply other threads:[~2023-09-28 15:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-29 12:29 [PATCH 0/2] xen: privcmd: Add ioeventfd support Viresh Kumar
2023-08-29 12:29 ` [PATCH 1/2] xen: evtchn: Allow shared registration of IRQ handers Viresh Kumar
2023-09-28 15:33 ` Juergen Gross [this message]
2023-08-29 12:29 ` [PATCH 2/2] xen: privcmd: Add support for ioeventfd Viresh Kumar
2023-09-29 5:46 ` Juergen Gross
2023-10-05 6:32 ` Viresh Kumar
2023-10-09 9:40 ` Alex Bennée
2023-10-09 10:53 ` Viresh Kumar
2023-10-09 10:58 ` Juergen Gross
2023-10-05 10:07 ` Viresh Kumar
2023-10-14 12:19 ` [Stratos-dev] " Arnd Bergmann
2023-09-26 7:16 ` [PATCH 0/2] xen: privcmd: Add ioeventfd support Viresh Kumar
2023-09-26 7:17 ` Juergen Gross
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=8c0f3255-83ea-4108-847f-63b895997577@suse.com \
--to=jgross@suse.com \
--cc=alex.bennee@linaro.org \
--cc=erik.schilling@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manos.pitsidianakis@linaro.org \
--cc=mathieu.poirier@linaro.org \
--cc=oleksandr_tyshchenko@epam.com \
--cc=sstabellini@kernel.org \
--cc=stratos-dev@op-lists.linaro.org \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=xen-devel@lists.xenproject.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
all inboxes | Powered by JetHome®