xen/evtchn: Introduce new IOCTL to bind static evtchn
authorRahul Singh <rahul.singh@arm.com>
Tue, 18 Jul 2023 11:31:07 +0000 (12:31 +0100)
committerJuergen Gross <jgross@suse.com>
Wed, 26 Jul 2023 06:42:34 +0000 (08:42 +0200)
commit58f6259b7a08f8d47d4629609703d358b042f0fd
tree4a5e985689b139612ba918aaee054831b2428c25
parent0d8f7cc8057890db08c54fe610d8a94af59da082
xen/evtchn: Introduce new IOCTL to bind static evtchn

Xen 4.17 supports the creation of static evtchns. To allow user space
application to bind static evtchns introduce new ioctl
"IOCTL_EVTCHN_BIND_STATIC". Existing IOCTL doing more than binding
that’s why we need to introduce the new IOCTL to only bind the static
event channels.

Static evtchns to be available for use during the lifetime of the
guest. When the application exits, __unbind_from_irq() ends up being
called from release() file operations because of that static evtchns
are getting closed. To avoid closing the static event channel, add the
new bool variable "is_static" in "struct irq_info" to mark the event
channel static when creating the event channel to avoid closing the
static evtchn.

Also, take this opportunity to remove the open-coded version of the
evtchn close in drivers/xen/evtchn.c file and use xen_evtchn_close().

Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Link: https://lore.kernel.org/r/ae7329bf1713f83e4aad4f3fa0f316258c40a3e9.1689677042.git.rahul.singh@arm.com
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/events/events_base.c
drivers/xen/evtchn.c
include/uapi/xen/evtchn.h
include/xen/events.h