Commit 234489ac authored by Nipun Gupta's avatar Nipun Gupta Committed by Alex Williamson
Browse files

vfio/cdx: add support for CDX bus



vfio-cdx driver enables IOCTLs for user space to query
MMIO regions for CDX devices and mmap them. This change
also adds support for reset of CDX devices. With VFIO
enabled on CDX devices, user-space applications can also
exercise DMA securely via IOMMU on these devices.

This change adds the VFIO CDX driver and enables the following
ioctls for CDX devices:
 - VFIO_DEVICE_GET_INFO:
 - VFIO_DEVICE_GET_REGION_INFO
 - VFIO_DEVICE_RESET

Signed-off-by: default avatarNipun Gupta <nipun.gupta@amd.com>
Reviewed-by: default avatarPieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com>
Tested-by: default avatarNikhil Agarwal <nikhil.agarwal@amd.com>
Link: https://lore.kernel.org/r/20230531124557.11009-1-nipun.gupta@amd.com


Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 1e44c58c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -22085,6 +22085,13 @@ F: Documentation/filesystems/vfat.rst
F:	fs/fat/
F:	tools/testing/selftests/filesystems/fat/
VFIO CDX DRIVER
M:	Nipun Gupta <nipun.gupta@amd.com>
M:	Nikhil Agarwal <nikhil.agarwal@amd.com>
L:	kvm@vger.kernel.org
S:	Maintained
F:	drivers/vfio/cdx/*
VFIO DRIVER
M:	Alex Williamson <alex.williamson@redhat.com>
L:	kvm@vger.kernel.org
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ source "drivers/vfio/pci/Kconfig"
source "drivers/vfio/platform/Kconfig"
source "drivers/vfio/mdev/Kconfig"
source "drivers/vfio/fsl-mc/Kconfig"
source "drivers/vfio/cdx/Kconfig"
endif

source "virt/lib/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -14,3 +14,4 @@ obj-$(CONFIG_VFIO_PCI_CORE) += pci/
obj-$(CONFIG_VFIO_PLATFORM_BASE) += platform/
obj-$(CONFIG_VFIO_MDEV) += mdev/
obj-$(CONFIG_VFIO_FSL_MC) += fsl-mc/
obj-$(CONFIG_VFIO_CDX) += cdx/
+17 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
#
# VFIO CDX configuration
#
# Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
#

config VFIO_CDX
	tristate "VFIO support for CDX bus devices"
	depends on CDX_BUS
	select EVENTFD
	help
	  Driver to enable VFIO support for the devices on CDX bus.
	  This is required to make use of CDX devices present in
	  the system using the VFIO framework.

	  If you don't know what to do here, say N.
+8 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
#

obj-$(CONFIG_VFIO_CDX) += vfio-cdx.o

vfio-cdx-objs := main.o
Loading