>>> "Tian, Kevin" <kevin.t...@intel.com> 06/30/17 11:20 AM >>> >> From: Gao, Chao >> Sent: Friday, June 30, 2017 9:17 AM >> --- a/xen/drivers/passthrough/vtd/dmar.c >> +++ b/xen/drivers/passthrough/vtd/dmar.c >> @@ -218,8 +218,17 @@ struct acpi_drhd_unit >> *acpi_find_matched_drhd_unit(const struct pci_dev *pdev) >> } >> else if ( pdev->info.is_virtfn ) >> { >> + struct pci_dev *physfn; >> + >> bus = pdev->info.physfn.bus; >> - devfn = PCI_SLOT(pdev->info.physfn.devfn) ? 0 : pdev- >> >info.physfn.devfn; >> + /* >> + * Use 0 as 'devfn' to search VT-d unit when the physical function >> + * is an Extended Function. >> + */ >> + pcidevs_lock(); >> + physfn = pci_get_pdev(pdev->seg, bus, pdev->info.physfn.devfn); >> + devfn = (physfn && physfn->info.is_extfn) ? 0 : pdev- >> >info.physfn.devfn; > >is it legal to have physfn as NULL when is_virtfn is true?
I had asked for the check to be there just to be on the safe side. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel