[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c0f3255-83ea-4108-847f-63b895997577@suse.com>
Date: Thu, 28 Sep 2023 17:33:08 +0200
From: Juergen Gross <jgross@...e.com>
To: Viresh Kumar <viresh.kumar@...aro.org>,
Stefano Stabellini <sstabellini@...nel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>
Cc: Vincent Guittot <vincent.guittot@...aro.org>,
Alex Bennée <alex.bennee@...aro.org>,
stratos-dev@...lists.linaro.org,
Erik Schilling <erik.schilling@...aro.org>,
Manos Pitsidianakis <manos.pitsidianakis@...aro.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] xen: evtchn: Allow shared registration of IRQ handers
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@...aro.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
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3099 bytes)
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists