VFIO fixes for v5.12-rc6

- Fix pfnmap batch carryover (Daniel Jordan)
 
  - Fix nvlink Kconfig dependency (Jason Gunthorpe)
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEQvbATlQL0amee4qQI5ubbjuwiyIFAmBjUtobHGFsZXgud2ls
 bGlhbXNvbkByZWRoYXQuY29tAAoJECObm247sIsiL1wP/ixbIvAu4U4kLnYIt0YN
 2Kb8V92yqe7SzBAp3xDDrq8LiHFwEePEbzFxQZioG/40QaqNUx+VmkjkHeVkNOCa
 a+bspmKg6PZuLHDvZO1/SbyeWibk+cRDK2nMWfP5LMrLyMucnd1QjdGACigDSZ/w
 plV84Z1i5WS/43gh3HxKe6TRdXWnHyEabePCnzxD7vkbnmqJySz008+LxG3g/lWL
 HroRAeRtuGQISVm+bJWNEywAk0KdDtZTuIc2EYW+0Hw4GiyfHSNicNIzV4Cg3Adv
 DpVn/WYpaMt12of7va3wHDkX1S29lm645OBvER4nOyzMsenmCdG59C9vddHb25Ni
 y1YqsbvIfPKyr/HNV/mdYy+DStE+Y1COMVljRwugSPdJO/Jl6Oi4c0z5FY6m9B1x
 62CmWTiiMRAA+TWHGu/O0XBcbf0tlsNIiTz5KMJ/HzqBa7TIjbGu1YWeAjKv/QuK
 TVyVZ+nuJbnnNGtwtDHGHWpDyaCdtwZIrbJar+dU9G4bj0Md8MmfIhELnEr8jeNY
 usZ2Ma5VyYKm6libgCQDuyATedyoHcAdRF/hxL3dJBP4csJiPCCCAhvCMrledNUD
 LPWQiUH3dJWqDHiVhikN8xTnroqofXg4csm7Gunv6+D7D3WaBzwjWzpFRxfkXVKB
 Ftv1qVODJ5OCEWfyIPAb08tA
 =JG2W
 -----END PGP SIGNATURE-----

Merge tag 'vfio-v5.12-rc6' of git://github.com/awilliam/linux-vfio

Pull VFIO fixes from Alex Williamson:

 - Fix pfnmap batch carryover (Daniel Jordan)

 - Fix nvlink Kconfig dependency (Jason Gunthorpe)

* tag 'vfio-v5.12-rc6' of git://github.com/awilliam/linux-vfio:
  vfio/nvlink: Add missing SPAPR_TCE_IOMMU depends
  vfio/type1: Empty batch for pfnmap pages
This commit is contained in:
Linus Torvalds 2021-03-30 09:49:36 -07:00
commit 17860ccabf
2 changed files with 7 additions and 1 deletions

View File

@ -42,6 +42,6 @@ config VFIO_PCI_IGD
config VFIO_PCI_NVLINK2
def_bool y
depends on VFIO_PCI && PPC_POWERNV
depends on VFIO_PCI && PPC_POWERNV && SPAPR_TCE_IOMMU
help
VFIO PCI support for P9 Witherspoon machine with NVIDIA V100 GPUs

View File

@ -739,6 +739,12 @@ out:
ret = vfio_lock_acct(dma, lock_acct, false);
unpin_out:
if (batch->size == 1 && !batch->offset) {
/* May be a VM_PFNMAP pfn, which the batch can't remember. */
put_pfn(pfn, dma->prot);
batch->size = 0;
}
if (ret < 0) {
if (pinned && !rsvd) {
for (pfn = *pfn_base ; pinned ; pfn++, pinned--)