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-v5.8-rc3' of git://github.com/awilliam/linux-vfio

Pull VFIO fixes from Alex Williamson:

- Fix double free of eventfd ctx (Alex Williamson)

- Fix duplicate use of capability ID (Alex Williamson)

- Fix SR-IOV VF memory enable handling (Alex Williamson)

* tag 'vfio-v5.8-rc3' of git://github.com/awilliam/linux-vfio:
vfio/pci: Fix SR-IOV VF handling with MMIO blocking
vfio/type1: Fix migration info capability ID
vfio/pci: Clear error and request eventfd ctx after releasing

+23 -4
+6 -2
drivers/vfio/pci/vfio_pci.c
··· 521 521 vfio_pci_vf_token_user_add(vdev, -1); 522 522 vfio_spapr_pci_eeh_release(vdev->pdev); 523 523 vfio_pci_disable(vdev); 524 - if (vdev->err_trigger) 524 + if (vdev->err_trigger) { 525 525 eventfd_ctx_put(vdev->err_trigger); 526 - if (vdev->req_trigger) 526 + vdev->err_trigger = NULL; 527 + } 528 + if (vdev->req_trigger) { 527 529 eventfd_ctx_put(vdev->req_trigger); 530 + vdev->req_trigger = NULL; 531 + } 528 532 } 529 533 530 534 mutex_unlock(&vdev->reflck->lock);
+16 -1
drivers/vfio/pci/vfio_pci_config.c
··· 398 398 /* Caller should hold memory_lock semaphore */ 399 399 bool __vfio_pci_memory_enabled(struct vfio_pci_device *vdev) 400 400 { 401 + struct pci_dev *pdev = vdev->pdev; 401 402 u16 cmd = le16_to_cpu(*(__le16 *)&vdev->vconfig[PCI_COMMAND]); 402 403 403 - return cmd & PCI_COMMAND_MEMORY; 404 + /* 405 + * SR-IOV VF memory enable is handled by the MSE bit in the 406 + * PF SR-IOV capability, there's therefore no need to trigger 407 + * faults based on the virtual value. 408 + */ 409 + return pdev->is_virtfn || (cmd & PCI_COMMAND_MEMORY); 404 410 } 405 411 406 412 /* ··· 1734 1728 vconfig[PCI_INTERRUPT_PIN]); 1735 1729 1736 1730 vconfig[PCI_INTERRUPT_PIN] = 0; /* Gratuitous for good VFs */ 1731 + 1732 + /* 1733 + * VFs do no implement the memory enable bit of the COMMAND 1734 + * register therefore we'll not have it set in our initial 1735 + * copy of config space after pci_enable_device(). For 1736 + * consistency with PFs, set the virtual enable bit here. 1737 + */ 1738 + *(__le16 *)&vconfig[PCI_COMMAND] |= 1739 + cpu_to_le16(PCI_COMMAND_MEMORY); 1737 1740 } 1738 1741 1739 1742 if (!IS_ENABLED(CONFIG_VFIO_PCI_INTX) || vdev->nointx)
+1 -1
include/uapi/linux/vfio.h
··· 1030 1030 * size in bytes that can be used by user applications when getting the dirty 1031 1031 * bitmap. 1032 1032 */ 1033 - #define VFIO_IOMMU_TYPE1_INFO_CAP_MIGRATION 1 1033 + #define VFIO_IOMMU_TYPE1_INFO_CAP_MIGRATION 2 1034 1034 1035 1035 struct vfio_iommu_type1_info_cap_migration { 1036 1036 struct vfio_info_cap_header header;