Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'vfio-v6.4-rc1' of https://github.com/awilliam/linux-vfio

Pull VFIO updates from Alex Williamson:

- Expose and allow R/W access to the PCIe DVSEC capability through
vfio-pci, as we already do with the legacy vendor capability
(K V P Satyanarayana)

- Fix kernel-doc issues with structure definitions (Simon Horman)

- Clarify ordering of operations relative to the kvm-vfio device for
driver dependencies against the kvm pointer (Yi Liu)

* tag 'vfio-v6.4-rc1' of https://github.com/awilliam/linux-vfio:
docs: kvm: vfio: Suggest KVM_DEV_VFIO_GROUP_ADD vs VFIO_GROUP_GET_DEVICE_FD ordering
vfio: correct kdoc for ops structures
vfio/pci: Add DVSEC PCI Extended Config Capability to user visible list.

+17
+5
Documentation/virt/kvm/devices/vfio.rst
··· 39 39 - @groupfd is a file descriptor for a VFIO group; 40 40 - @tablefd is a file descriptor for a TCE table allocated via 41 41 KVM_CREATE_SPAPR_TCE. 42 + 43 + The GROUP_ADD operation above should be invoked prior to accessing the 44 + device file descriptor via VFIO_GROUP_GET_DEVICE_FD in order to support 45 + drivers which require a kvm pointer to be set in their .open_device() 46 + callback.
+7
drivers/vfio/pci/vfio_pci_config.c
··· 96 96 [PCI_EXT_CAP_ID_SECPCI] = 0, /* not yet */ 97 97 [PCI_EXT_CAP_ID_PMUX] = 0, /* not yet */ 98 98 [PCI_EXT_CAP_ID_PASID] = 0, /* not yet */ 99 + [PCI_EXT_CAP_ID_DVSEC] = 0xFF, 99 100 }; 100 101 101 102 /* ··· 1102 1101 ret |= init_pci_ext_cap_err_perm(&ecap_perms[PCI_EXT_CAP_ID_ERR]); 1103 1102 ret |= init_pci_ext_cap_pwr_perm(&ecap_perms[PCI_EXT_CAP_ID_PWR]); 1104 1103 ecap_perms[PCI_EXT_CAP_ID_VNDR].writefn = vfio_raw_config_write; 1104 + ecap_perms[PCI_EXT_CAP_ID_DVSEC].writefn = vfio_raw_config_write; 1105 1105 1106 1106 if (ret) 1107 1107 vfio_pci_uninit_perm_bits(); ··· 1442 1440 return PCI_TPH_BASE_SIZEOF + (sts * 2) + 2; 1443 1441 } 1444 1442 return PCI_TPH_BASE_SIZEOF; 1443 + case PCI_EXT_CAP_ID_DVSEC: 1444 + ret = pci_read_config_dword(pdev, epos + PCI_DVSEC_HEADER1, &dword); 1445 + if (ret) 1446 + return pcibios_err_to_errno(ret); 1447 + return PCI_DVSEC_HEADER1_LEN(dword); 1445 1448 default: 1446 1449 pci_warn(pdev, "%s: unknown length for PCI ecap %#x@%#x\n", 1447 1450 __func__, ecap, epos);
+5
include/linux/vfio.h
··· 67 67 /** 68 68 * struct vfio_device_ops - VFIO bus driver device callbacks 69 69 * 70 + * @name: Name of the device driver. 70 71 * @init: initialize private fields in device structure 71 72 * @release: Reclaim private fields in device structure 72 73 * @bind_iommufd: Called when binding the device to an iommufd ··· 140 139 #endif 141 140 142 141 /** 142 + * struct vfio_migration_ops - VFIO bus device driver migration callbacks 143 + * 143 144 * @migration_set_state: Optional callback to change the migration state for 144 145 * devices that support migration. It's mandatory for 145 146 * VFIO_DEVICE_FEATURE_MIGRATION migration support. ··· 167 164 }; 168 165 169 166 /** 167 + * struct vfio_log_ops - VFIO bus device driver logging callbacks 168 + * 170 169 * @log_start: Optional callback to ask the device start DMA logging. 171 170 * @log_stop: Optional callback to ask the device stop DMA logging. 172 171 * @log_read_and_clear: Optional callback to ask the device read