linux-stable/samples
Alex Williamson 94eacb45d8 vfio/mtty: Overhaul mtty interrupt handling
[ Upstream commit 293fbc2881 ]

The mtty driver does not currently conform to the vfio SET_IRQS uAPI.
For example, it claims to support mask and unmask of INTx, but actually
does nothing.  It claims to support AUTOMASK for INTx, but doesn't.  It
fails to teardown eventfds under the full semantics specified by the
SET_IRQS ioctl.  It also fails to teardown eventfds when the device is
closed, leading to memory leaks.  It claims to support the request IRQ,
but doesn't.

Fix all these.

A side effect of this is that QEMU will now report a warning:

vfio <uuid>: Failed to set up UNMASK eventfd signaling for interrupt \
INTX-0: VFIO_DEVICE_SET_IRQS failure: Inappropriate ioctl for device

The fact is that the unmask eventfd was never supported but quietly
failed.  mtty never honored the AUTOMASK behavior, therefore there
was nothing to unmask.  QEMU is verbose about the failure, but
properly falls back to userspace unmasking.

Fixes: 9d1a546c53 ("docs: Sample driver to demonstrate how to use Mediated device framework.")
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/r/20231016224736.2575718-2-alex.williamson@redhat.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-10 17:16:55 +01:00
..
acrn virt: acrn: Replace obsolete memalign() with posix_memalign() 2023-04-20 14:20:51 +02:00
auxdisplay .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
binderfs .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
bpf samples/bpf: syscall_tp_user: Fix array out-of-bound access 2023-11-28 17:19:48 +00:00
configfs treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
connector .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
coresight coresight: syscfg: Example CoreSight configuration loadable module 2021-11-26 11:34:07 -07:00
fanotify Add gitignore file for samples/fanotify/ subdirectory 2021-11-07 11:19:24 -08:00
fprobe fprobe: Pass return address to the handlers 2023-06-06 21:39:55 +09:00
ftrace samples: ftrace: Replace bti assembly with hint for older compiler 2023-08-21 22:03:58 -04:00
hid bpf: Replace deprecated -target with --target= for Clang 2023-06-29 15:46:17 +02:00
hidraw .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
hw_breakpoint samples/hw_breakpoint: mark sample_hbp as static 2023-07-26 11:17:19 -07:00
kdb kdb: Rename members of struct kdbtab_t 2021-07-27 17:05:06 +01:00
kfifo samples/kfifo: Rename read_lock/write_lock 2021-10-13 14:36:48 +02:00
kmemleak kmemleak-test: drop __init to get better backtrace 2023-06-09 16:25:40 -07:00
kobject samples/kobject: make kobj_type structure constant 2023-02-08 13:34:41 +01:00
kprobes samples/kprobes: Add LoongArch support 2023-02-25 22:12:17 +08:00
landlock samples/landlock: Document best-effort approach for LANDLOCK_ACCESS_FS_REFER 2022-11-07 20:49:50 +01:00
livepatch livepatch: Reorder to use before freeing a pointer 2022-03-23 13:51:11 +01:00
mei samples: mei: don't wait on read completion upon write. 2021-08-01 09:54:22 +02:00
nitro_enclaves nitro_enclaves: Add fixes for checkpatch blank line reports 2021-09-14 11:11:20 +02:00
pfsm samples: Add userspace example for TI TPS6594 PFSM 2023-06-15 13:41:53 +02:00
pidfd .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
pktgen samples: pktgen: fix append mode failed issue 2023-07-03 09:15:26 +01:00
qmi soc: qcom: qmi: use const for struct qmi_elem_info 2022-08-29 17:33:01 -05:00
rpmsg
rust samples: rust: print: Add sample code for Arc printing 2023-04-10 05:05:43 +02:00
seccomp samples/seccomp: Adjust sample to also provide kill option 2022-02-10 19:09:12 -08:00
timers .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
trace_events tracing: Fix cpumask() example typo 2022-12-14 11:17:55 -05:00
trace_printk
uhid
user_events tracing/user_events: Use write ABI in example 2023-03-29 06:52:09 -04:00
v4l treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_168.RULE (part 2) 2022-06-10 14:51:36 +02:00
vfio-mdev vfio/mtty: Overhaul mtty interrupt handling 2024-01-10 17:16:55 +01:00
vfs .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
watch_queue .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
watchdog .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig vfio-dev/mdpy-fb: Use fbdev I/O helpers 2023-08-04 15:54:39 +02:00
Makefile samples: Add userspace example for TI TPS6594 PFSM 2023-06-15 13:41:53 +02:00