mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 V3 2/2] xen: privcmd: Add support for irqfd
Date: Tue, 25 Jul 2023 10:42:21 +0200	[thread overview]
Message-ID: <938e9198-8684-6e1b-d3a9-4601bedd2004@suse.com> (raw)
In-Reply-To: <8c1ea7faa0fe5deed1b2c86ea0f73e824f8a001d.1690190453.git.viresh.kumar@linaro.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 2295 bytes --]

On 25.07.23 08:47, Viresh Kumar wrote:
> Xen provides support for injecting interrupts to the guests via the
> HYPERVISOR_dm_op() hypercall. The same is used by the Virtio based
> device backend implementations, in an inefficient manner currently.
> 
> Generally, the Virtio backends are implemented to work with the Eventfd
> based mechanism. In order to make such backends work with Xen, another
> software layer needs to poll the Eventfds and raise an interrupt to the
> guest using the Xen based mechanism. This results in an extra context
> switch.
> 
> This is not a new problem in Linux though. It is present with other
> hypervisors like KVM, etc. as well. The generic solution implemented in
> the kernel for them is to provide an IOCTL call to pass the interrupt
> details and eventfd, which lets the kernel take care of polling the
> eventfd and raising of the interrupt, instead of handling this in user
> space (which involves an extra context switch).
> 
> This patch adds support to inject a specific interrupt to guest using
> the eventfd mechanism, by preventing the extra context switch.
> 
> Inspired by existing implementations for KVM, etc..
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> V2.1->V3
> - No changes
> 
> V2->V2.1
> - Select EVENTFD from Kconfig
> 
> V1->V2:
> - Improve error handling.
> - Remove the unnecessary usage of list_for_each_entry_safe().
> - Restrict the use of XEN_DMOP_set_irq_level to only ARM64.
> 
>   drivers/xen/Kconfig        |   1 +
>   drivers/xen/privcmd.c      | 276 ++++++++++++++++++++++++++++++++++++-
>   include/uapi/xen/privcmd.h |  14 ++
>   3 files changed, 289 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
> index d5d7c402b651..7967393c55a4 100644
> --- a/drivers/xen/Kconfig
> +++ b/drivers/xen/Kconfig
> @@ -261,6 +261,7 @@ config XEN_SCSI_BACKEND
>   config XEN_PRIVCMD
>   	tristate "Xen hypercall passthrough driver"
>   	depends on XEN
> +	select EVENTFD

I don't like this. Can we maybe add another bool config item depending on
XEN_PRIVCMD, EVENTFD and XEN_VIRTIO, which can then be used to guard the
code additions to privcmd.c?

This would avoid adding additional code for everyone.


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 --]

  reply	other threads:[~2023-07-25  8:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25  6:47 [PATCH V3 1/2] xen: Update dm_op.h from Xen public header Viresh Kumar
2023-07-25  6:47 ` [PATCH V3 2/2] xen: privcmd: Add support for irqfd Viresh Kumar
2023-07-25  8:42   ` Juergen Gross [this message]
2023-07-25  7:04 ` [PATCH V3 1/2] xen: Update dm_op.h from Xen public header Jan Beulich
2023-07-25  7:09   ` Viresh Kumar
2023-07-25  7:18     ` Jan Beulich
2023-07-25  7:42       ` Viresh Kumar
2023-07-25  7:49         ` Jan Beulich
2023-07-25  7:54           ` 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=938e9198-8684-6e1b-d3a9-4601bedd2004@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®