VFIO update 2021-07-14

* Coverity fix to discard listener (David Hildenbrand)
 
  * MSI-X PBA quirk for BAIDU VFs, additional helper use cases (Cai Huoqing)
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEQvbATlQL0amee4qQI5ubbjuwiyIFAmDvV7cbHGFsZXgud2ls
 bGlhbXNvbkByZWRoYXQuY29tAAoJECObm247sIsiNTAP/jT3B1FCVvyLtKzJnAa8
 tRR6V9vnHYLtfK3ubSnke2VGiv8wKhqmhoh1//1baZNL/c2UkPaNyAOylN4tqHmb
 +iRowtFayVMkLNGcCQ9JpuX2jauJPoX/bua6Jf3k1n1rJZSTgY3uejxooatALIRQ
 9QssLy8bhBg2fHz5G6I7aMhYuBDmFco7Hba5GrdrgIDSHJqt73g1Dd9NNkkpRZCz
 VJwBqRE+TxBQR8HOlFTaokfvtCIxM6p3n0aaPxjRNzdZqo9n4TVyMNGVXAqfcG+v
 hIUEpz6YW6/vhb11OPOL4eQsO8buDOvI6p6SdmEQuO1sFxAlttHgPzLjOFK4Vqvz
 l9omg5ifui1uJziWsxBd0uEcidMX3DBReQK86elzf+60hx75nwI8ijp+L7aPNrNX
 cZp69thXlUCsWODxkRRmogz249PWgjuse8XNNXom22ykWJdNJcmODRfHbcM46C38
 KzU7E/LTV8kE6iIJH/IaWS0gxa9a1SnUiycdmsfloLWqIg632sOgm6Oe82ThlNq6
 kVEndHaB1D0eIAPQ7xPJYEZHyaIShnGX7Trsnh8dqccZFsqNy6SwhpzdUSMSdxEg
 1as8RvSlWwTs2RFoejV70ugZj9iqQdTbbiRfMZGt1NP83epnlK8tcJm5msMcxtLZ
 6+vY/qaCmo3WhUBBjYD9j4Ga
 =/0Rf
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20210714.0' into staging

VFIO update 2021-07-14

 * Coverity fix to discard listener (David Hildenbrand)

 * MSI-X PBA quirk for BAIDU VFs, additional helper use cases (Cai Huoqing)

# gpg: Signature made Wed 14 Jul 2021 22:31:35 BST
# gpg:                using RSA key 42F6C04E540BD1A99E7B8A90239B9B6E3BB08B22
# gpg:                issuer "alex.williamson@redhat.com"
# gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" [full]
# gpg:                 aka "Alex Williamson <alex@shazbot.org>" [full]
# gpg:                 aka "Alex Williamson <alwillia@redhat.com>" [full]
# gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>" [full]
# Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22

* remotes/awilliam/tags/vfio-update-20210714.0:
  vfio/pci: Add pba_offset PCI quirk for BAIDU KUNLUN AI processor
  vfio/pci: Change to use vfio_pci_is()
  vfio: Fix CID 1458134 in vfio_register_ram_discard_listener()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2021-07-15 21:39:04 +01:00
commit bd306cfeee
3 changed files with 15 additions and 3 deletions

View File

@ -783,7 +783,8 @@ static void vfio_register_ram_discard_listener(VFIOContainer *container,
section->mr);
g_assert(vrdl->granularity && is_power_of_2(vrdl->granularity));
g_assert(vrdl->granularity >= 1 << ctz64(container->pgsizes));
g_assert(container->pgsizes &&
vrdl->granularity >= 1ULL << ctz64(container->pgsizes));
ram_discard_listener_init(&vrdl->listener,
vfio_ram_discard_notify_populate,

View File

@ -1499,6 +1499,14 @@ static void vfio_msix_early_setup(VFIOPCIDevice *vdev, Error **errp)
if (vdev->vendor_id == PCI_VENDOR_ID_CHELSIO &&
(vdev->device_id & 0xff00) == 0x5800) {
msix->pba_offset = 0x1000;
/*
* BAIDU KUNLUN Virtual Function devices for KUNLUN AI processor
* return an incorrect value of 0x460000 for the VF PBA offset while
* the BAR itself is only 0x10000. The correct value is 0xb400.
*/
} else if (vfio_pci_is(vdev, PCI_VENDOR_ID_BAIDU,
PCI_DEVICE_ID_KUNLUN_VF)) {
msix->pba_offset = 0xb400;
} else if (vdev->msix_relo == OFF_AUTOPCIBAR_OFF) {
error_setg(errp, "hardware reports invalid configuration, "
"MSIX PBA outside of specified BAR");
@ -3058,14 +3066,14 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
}
}
if (vdev->vendor_id == PCI_VENDOR_ID_NVIDIA) {
if (vfio_pci_is(vdev, PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID)) {
ret = vfio_pci_nvidia_v100_ram_init(vdev, errp);
if (ret && ret != -ENODEV) {
error_report("Failed to setup NVIDIA V100 GPU RAM");
}
}
if (vdev->vendor_id == PCI_VENDOR_ID_IBM) {
if (vfio_pci_is(vdev, PCI_VENDOR_ID_IBM, PCI_ANY_ID)) {
ret = vfio_pci_nvlink2_init(vdev, errp);
if (ret && ret != -ENODEV) {
error_report("Failed to setup NVlink2 bridge");

View File

@ -227,6 +227,9 @@
#define PCI_VENDOR_ID_FREESCALE 0x1957
#define PCI_DEVICE_ID_MPC8533E 0x0030
#define PCI_VENDOR_ID_BAIDU 0x1d22
#define PCI_DEVICE_ID_KUNLUN_VF 0x3685
#define PCI_VENDOR_ID_INTEL 0x8086
#define PCI_DEVICE_ID_INTEL_82378 0x0484
#define PCI_DEVICE_ID_INTEL_82441 0x1237