kernel-hacking-2024-linux-s.../drivers
Yi Liu 5c8d3d93f6 vfio: Refactor vfio_device open and close
This refactor makes the vfio_device_open() to accept device, iommufd_ctx
pointer and kvm pointer. These parameters are generic items in today's
group path and future device cdev path. Caller of vfio_device_open()
should take care the necessary protections. e.g. the current group path
need to hold the group_lock to ensure the iommufd_ctx and kvm pointer are
valid.

This refactor also wraps the group spefcific codes in the device open and
close paths to be paired helpers like:

- vfio_device_group_open/close(): call vfio_device_open/close()
- vfio_device_group_use/unuse_iommu(): this pair is container specific.
				       iommufd vs. container is selected
				       in vfio_device_first_open().

Such helpers are supposed to be moved to group.c. While iommufd related
codes will be kept in the generic helpers since future device cdev path
also need to handle iommufd.

Link: https://lore.kernel.org/r/20221201145535.589687-8-yi.l.liu@intel.com
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Tested-by: Lixiao Yang <lixiao.yang@intel.com>
Tested-by: Yu He <yu.he@intel.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2022-12-05 08:56:01 -04:00
..
accessibility speakup: replace utils' u_char with unsigned char 2022-11-09 15:25:24 +01:00
acpi platform-drivers-x86 for v6.1-3 2022-11-07 10:19:04 -08:00
amba
android binder: validate alloc->mm in ->mmap() handler 2022-11-09 15:41:27 +01:00
ata ata: libata-core: do not issue non-internal commands once EH is pending 2022-11-12 07:51:06 +09:00
atm
auxdisplay
base
bcma
block block-6.1-2022-11-25 2022-11-25 17:50:57 -08:00
bluetooth
bus bus: ixp4xx: Don't touch bit 7 on IXP42x 2022-11-22 23:12:18 +01:00
cdrom
char
clk
clocksource clocksource/drivers/arm_arch_timer: Fix XGene-1 TVAL register math error 2022-11-21 16:01:56 +01:00
comedi
connector
counter
cpufreq cpufreq: amd-pstate: add amd-pstate driver parameter for mode selection 2022-11-22 19:57:15 +01:00
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma Merge tag 'v6.1-rc7' into iommufd.git for-next 2022-12-02 12:04:39 -04:00
dma-buf dma-buf: fix racing conflict of dma_heap_add() 2022-11-22 18:27:56 +05:30
edac
eisa
extcon extcon: usbc-tusb320: Call the Type-C IRQ handler only if a port is registered 2022-11-08 16:45:31 +01:00
firewire
firmware Char/Misc driver fixes for 6.1-rc6 2022-11-18 10:29:25 -08:00
fpga fpga: m10bmc-sec: Fix kconfig dependencies 2022-11-15 21:46:58 +08:00
fsi
gnss
gpio
gpu Merge tag 'v6.1-rc7' into iommufd.git for-next 2022-12-02 12:04:39 -04:00
greybus
hid for-linus-2022111101 2022-11-11 09:03:19 -08:00
hsi
hte
hv Drivers: hv: vmbus: fix possible memory leak in vmbus_device_register() 2022-11-21 10:57:42 +00:00
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio iio: adc: aspeed: Remove the trim valid dts property. 2022-11-14 20:20:08 +00:00
infiniband
input Input updates for v6.1-rc5 2022-11-18 17:56:29 -08:00
interconnect
iommu Merge tag 'v6.1-rc7' into iommufd.git for-next 2022-12-02 12:04:39 -04:00
ipack
irqchip
isdn mISDN: fix misuse of put_device() in mISDN_register_device() 2022-11-14 10:43:13 +00:00
leds
macintosh
mailbox
mcb
md block-6.1-2022-11-18 2022-11-18 13:59:45 -08:00
media
memory
memstick
message
mfd
misc Merge tag 'v6.1-rc7' into iommufd.git for-next 2022-12-02 12:04:39 -04:00
mmc mmc: sdhci-pci: Fix possible memory leak caused by missing pci_dev_put() 2022-11-16 17:00:39 +01:00
most
mtd mtd: onenand: omap2: add dependency on GPMC 2022-11-07 16:53:04 +01:00
mux
net net: thunderx: Fix the ACPI memory leak 2022-11-24 10:15:47 +01:00
nfc nfc: st-nci: fix incorrect sizing calculations in EVT_TRANSACTION 2022-11-23 20:01:50 -08:00
ntb
nubus
nvdimm
nvme block-6.1-2022-11-18 2022-11-18 13:59:45 -08:00
nvmem nvmem: lan9662-otp: Change return type of lan9662_otp_wait_flag_clear() 2022-11-22 18:22:05 +01:00
of
opp
parisc
parport parport_pc: Avoid FIFO port location truncation 2022-11-09 15:40:32 +01:00
pci Merge tag 'v6.1-rc7' into iommufd.git for-next 2022-12-02 12:04:39 -04:00
pcmcia
peci
perf
phy phy: ralink: mt7621-pci: add sentinel to quirks table 2022-11-05 13:01:25 +05:30
pinctrl pinctrl: mediatek: Export debounce time tables 2022-11-15 09:13:59 +01:00
platform platform-drivers-x86 for v6.1-4 2022-11-16 10:36:13 -08:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: Late fixes for v6.1 2022-11-25 13:54:48 -08:00
remoteproc
reset
rpmsg
rtc
s390 Merge tag 'v6.1-rc7' into iommufd.git for-next 2022-12-02 12:04:39 -04:00
sbus
scsi hyperv-fixes for 6.1-rc7 2022-11-25 12:32:42 -08:00
sh
siox siox: fix possible memory leak in siox_device_add() 2022-11-09 15:40:14 +01:00
slimbus slimbus: qcom-ngd: Fix build error when CONFIG_SLIM_QCOM_NGD_CTRL=y && CONFIG_QCOM_RPROC_COMMON=m 2022-11-10 18:45:40 +01:00
soc soc: imx8m: Enable OCOTP clock before reading the register 2022-11-14 15:52:53 +08:00
soundwire
spi spi: Fixes for v6.1 2022-11-23 11:19:06 -08:00
spmi
ssb
staging Staging driver fix for 6.1-rc6 2022-11-18 12:02:38 -08:00
target scsi: target: tcm_loop: Fix possible name leak in tcm_loop_setup_hba_bus() 2022-11-17 17:46:16 +00:00
tc
tee tee: optee: fix possible memory leak in optee_register_device() 2022-11-17 09:22:12 +01:00
thermal
thunderbolt
tty TTY/Serial driver fixes for 6.1-rc6 2022-11-18 10:59:52 -08:00
ufs
uio
usb usb: cdnsp: fix issue with ZLP - added TD_SIZE = 1 2022-11-22 16:52:05 +01:00
vdpa
vfio vfio: Refactor vfio_device open and close 2022-12-05 08:56:01 -04:00
vhost
video Merge tag 'drm-misc-fixes-2022-11-24' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes 2022-11-25 09:21:11 +10:00
virt virt/sev-guest: Prevent IV reuse in the SNP guest driver 2022-11-21 11:03:40 +01:00
virtio
vlynq
w1
watchdog
xen xen: branch for v6.1-rc6 2022-11-16 10:49:06 -08:00
zorro
Kconfig
Makefile