linux-mainline/tools/testing/selftests
Linus Torvalds 4debf77169 iommufd for 6.6
This includes a shared branch with VFIO:
 
  - Enhance VFIO_DEVICE_GET_PCI_HOT_RESET_INFO so it can work with iommufd
    FDs, not just group FDs. This removes the last place in the uAPI that
    required the group fd.
 
  - Give VFIO a new device node /dev/vfio/devices/vfioX (the so called cdev
    node) which is very similar to the FD from VFIO_GROUP_GET_DEVICE_FD.
    The cdev is associated with the struct device that the VFIO driver is
    bound to and shows up in sysfs in the normal way.
 
  - Add a cdev IOCTL VFIO_DEVICE_BIND_IOMMUFD which allows a newly opened
    /dev/vfio/devices/vfioX to be associated with an IOMMUFD, this replaces
    the VFIO_GROUP_SET_CONTAINER flow.
 
  - Add cdev IOCTLs VFIO_DEVICE_[AT|DE]TACH_IOMMUFD_PT to allow the IOMMU
    translation the vfio_device is associated with to be changed. This is a
    significant new feature for VFIO as previously each vfio_device was
    fixed to a single translation.
 
    The translation is under the control of iommufd, so it can be any of
    the different translation modes that iommufd is learning to create.
 
 At this point VFIO has compilation options to remove the legacy interfaces
 and in modern mode it behaves like a normal driver subsystem. The
 /dev/vfio/iommu and /dev/vfio/groupX nodes are not present and each
 vfio_device only has a /dev/vfio/devices/vfioX cdev node that represents
 the device.
 
 On top of this is built some of the new iommufd functionality:
 
  - IOMMU_HWPT_ALLOC allows userspace to directly create the low level
    IO Page table objects and affiliate them with IOAS objects that hold
    the translation mapping. This is the basic functionality for the
    normal IOMMU_DOMAIN_PAGING domains.
 
  - VFIO_DEVICE_ATTACH_IOMMUFD_PT can be used to replace the current
    translation. This is wired up to through all the layers down to the
    driver so the driver has the ability to implement a hitless
    replacement. This is necessary to fully support guest behaviors when
    emulating HW (eg guest atomic change of translation)
 
  - IOMMU_GET_HW_INFO returns information about the IOMMU driver HW that
    owns a VFIO device. This includes support for the Intel iommu, and
    patches have been posted for all the other server IOMMU.
 
 Along the way are a number of internal items:
 
  - New iommufd kapis iommufd_ctx_has_group(), iommufd_device_to_ictx(),
    iommufd_device_to_id(), iommufd_access_detach(), iommufd_ctx_from_fd(),
    iommufd_device_replace()
 
  - iommufd now internally tracks iommu_groups as it needs some per-group
    data
 
  - Reorganize how the internal hwpt allocation flows to have more robust
    locking
 
  - Improve the access interfaces to support detach and replace of an IOAS
    from an access
 
  - New selftests and a rework of how the selftests creates a mock iommu
    driver to be more like a real iommu driver
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQRRRCHOFoQz/8F5bUaFwuHvBreFYQUCZO/QDQAKCRCFwuHvBreF
 YZ2iAP4hNEF6MJLRI2A28V3I/80f3x9Ed3Cirp/Q8ZdVEE+HYQD8DFaafJ0y3iPQ
 5mxD4ZrZ9KfUns/gUqCT5oPHjrcvSAM=
 =EQCw
 -----END PGP SIGNATURE-----

Merge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd

Pull iommufd updates from Jason Gunthorpe:
 "On top of the vfio updates is built some new iommufd functionality:

   - IOMMU_HWPT_ALLOC allows userspace to directly create the low level
     IO Page table objects and affiliate them with IOAS objects that
     hold the translation mapping. This is the basic functionality for
     the normal IOMMU_DOMAIN_PAGING domains.

   - VFIO_DEVICE_ATTACH_IOMMUFD_PT can be used to replace the current
     translation. This is wired up to through all the layers down to the
     driver so the driver has the ability to implement a hitless
     replacement. This is necessary to fully support guest behaviors
     when emulating HW (eg guest atomic change of translation)

   - IOMMU_GET_HW_INFO returns information about the IOMMU driver HW
     that owns a VFIO device. This includes support for the Intel iommu,
     and patches have been posted for all the other server IOMMU.

  Along the way are a number of internal items:

   - New iommufd kernel APIs: iommufd_ctx_has_group(),
        iommufd_device_to_ictx(), iommufd_device_to_id(),
        iommufd_access_detach(), iommufd_ctx_from_fd(),
        iommufd_device_replace()

   - iommufd now internally tracks iommu_groups as it needs some
     per-group data

   - Reorganize how the internal hwpt allocation flows to have more
     robust locking

   - Improve the access interfaces to support detach and replace of an
     IOAS from an access

   - New selftests and a rework of how the selftests creates a mock
     iommu driver to be more like a real iommu driver"

Link: https://lore.kernel.org/lkml/ZO%2FTe6LU1ENf58ZW@nvidia.com/

* tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd: (34 commits)
  iommufd/selftest: Don't leak the platform device memory when unloading the module
  iommu/vt-d: Implement hw_info for iommu capability query
  iommufd/selftest: Add coverage for IOMMU_GET_HW_INFO ioctl
  iommufd: Add IOMMU_GET_HW_INFO
  iommu: Add new iommu op to get iommu hardware information
  iommu: Move dev_iommu_ops() to private header
  iommufd: Remove iommufd_ref_to_users()
  iommufd/selftest: Make the mock iommu driver into a real driver
  vfio: Support IO page table replacement
  iommufd/selftest: Add IOMMU_TEST_OP_ACCESS_REPLACE_IOAS coverage
  iommufd: Add iommufd_access_replace() API
  iommufd: Use iommufd_access_change_ioas in iommufd_access_destroy_object
  iommufd: Add iommufd_access_change_ioas(_id) helpers
  iommufd: Allow passing in iopt_access_list_id to iopt_remove_access()
  vfio: Do not allow !ops->dma_unmap in vfio_pin/unpin_pages()
  iommufd/selftest: Add a selftest for IOMMU_HWPT_ALLOC
  iommufd/selftest: Return the real idev id from selftest mock_domain
  iommufd: Add IOMMU_HWPT_ALLOC
  iommufd/selftest: Test iommufd_device_replace()
  iommufd: Make destroy_rwsem use a lock class per object type
  ...
2023-08-30 20:41:37 -07:00
..
alsa
amd-pstate
arm64 Merge branch 'for-next/selftests' into for-next/core 2023-08-25 12:36:57 +01:00
bpf - Some swap cleanups from Ma Wupeng ("fix WARN_ON in add_to_avail_list") 2023-08-29 14:25:26 -07:00
breakpoints
cachestat linux-kselftest-next-6.6-rc1 2023-08-28 18:46:47 -07:00
capabilities
cgroup selftests: cgroup: fix test_kmem_memcg_deletion kernel mem check 2023-08-24 16:20:27 -07:00
clone3
connector selftests: connector: Fix input argument error paths to skip 2023-07-31 20:11:42 -07:00
core
cpu-hotplug
cpufreq
damon selftests/damon/sysfs: test damon_target filter 2023-08-21 13:37:37 -07:00
dma
dmabuf-heaps
drivers selftests: bonding: create directly devices in the target namespaces 2023-08-28 10:24:08 +01:00
efivarfs
exec
fchmodat2 selftests: fchmodat2: remove duplicate unneeded defines 2023-08-05 12:40:44 +02:00
filelock selftests: add OFD lock tests 2023-08-24 10:41:47 -04:00
filesystems selftests/filesystems: Add six consecutive 'x' characters to mktemp 2023-08-16 10:10:39 -06:00
firmware
fpu
ftrace selftests/ftrace: Add a basic testcase for snapshot 2023-08-16 15:13:40 -04:00
futex selftests/futex: Order calls to futex_lock_pi 2023-08-16 10:48:10 -06:00
gpio
hid
ia64
intel_pstate
iommu iommufd/selftest: Add coverage for IOMMU_GET_HW_INFO ioctl 2023-08-18 12:52:15 -03:00
ipc
ir
kcmp
kexec
kmod
kselftest selftests: line buffer test program's stdout 2023-08-18 10:12:42 -07:00
kvm KVM: selftests: Expand x86's sregs test to cover illegal CR0 values 2023-07-29 11:05:32 -04:00
landlock
lib
livepatch
lkdtm
locking
media_tests
membarrier
memfd selftests: improve vm.memfd_noexec sysctl tests 2023-08-21 13:38:00 -07:00
memory-hotplug
mincore
mm selftests/mm: fix WARNING comparing pointer to 0 2023-08-24 16:20:27 -07:00
mount
mount_setattr
move_mount_set_group
mqueue
nci
net selftests: tls: test some invalid inputs for setsockopt 2023-08-27 17:17:40 -07:00
netfilter
nolibc linux-kselftest-nolibc-6.6-rc1 2023-08-28 19:03:24 -07:00
nsfs
ntb
openat2
perf_events
pid_namespace
pidfd
powerpc
prctl selftests:prctl: add set-process-name to .gitignore 2023-07-25 10:33:25 -06:00
proc - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
pstore
ptp selftests/ptp: Add -X option for testing PTP_SYS_OFFSET_PRECISE 2023-07-28 10:59:40 +01:00
ptrace
rcutorture smp_call_function torture-test updates for v6.6 2023-08-28 13:42:29 -07:00
resctrl selftests/resctrl: Remove test type checks from cat_val() 2023-07-25 08:54:11 -06:00
riscv selftests: riscv: Fix compilation error with vstate_exec_nolibc.c 2023-08-02 13:48:10 -07:00
rlimits
rseq linux-kselftest-next-6.6-rc1 2023-08-28 18:46:47 -07:00
rtc
safesetid
sched
seccomp selftests/seccomp: Handle arm32 corner cases better 2023-08-10 13:26:19 -07:00
sgx
sigaltstack
size
sparc64
splice
static_keys
sync
syscall_user_dispatch
sysctl
tc-testing selftests/tc-testing: verify that a qdisc can be grafted onto a taprio class 2023-08-09 15:59:21 -07:00
tdx
timens
timers
tmpfs
tpm2
tty
uevent
user
user_events selftests/user_events: Reenable build 2023-08-16 10:29:57 -06:00
vDSO
watchdog
wireguard treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
x86
zram
.gitignore
gen_kselftest_tar.sh
kselftest_deps.sh
kselftest_harness.h selftests/harness: Actually report SKIP for signal tests 2023-08-10 23:10:09 -07:00
kselftest_install.sh
kselftest_module.h
kselftest.h selftests: line buffer test program's stdout 2023-08-18 10:12:42 -07:00
lib.mk
Makefile Networking changes for 6.6. 2023-08-29 11:33:01 -07:00
run_kselftest.sh