> -----Original Message----- > From: Jan Beulich [mailto:[email protected]] > Sent: 13 May 2019 08:36 > To: Paul Durrant <[email protected]> > Cc: Brian Woods <[email protected]>; Suravee Suthikulpanit > <[email protected]>; Andrew > Cooper <[email protected]>; Roger Pau Monne <[email protected]>; > Wei Liu > <[email protected]>; Kevin Tian <[email protected]>; xen-devel > <[email protected]> > Subject: Re: [PATCH 2/5] iommu / x86: move call to scan_pci_devices() out of > vendor code > > >>> On 08.05.19 at 15:24, <[email protected]> wrote: > > It's not vendor specific so it shouldn't really be there. > > Perhaps, but this needs better justification: > > > --- a/xen/drivers/passthrough/vtd/iommu.c > > +++ b/xen/drivers/passthrough/vtd/iommu.c > > @@ -2372,10 +2372,6 @@ static int __init vtd_setup(void) > > P(iommu_hap_pt_share, "Shared EPT tables"); > > #undef P > > > > - ret = scan_pci_devices(); > > - if ( ret ) > > - goto error; > > - > > ret = init_vtd_hw(); > > Even after some looking around, it's not obvious to me that the latter > call doesn't depend on PCI devices being known, more specifically > segment 0's bus2bridge[] having been filled. Nor can I tell whether > there would be some noticeable misbehavior (prior to any guests > starting) if there was a dependency and it got broken by the re- > ordering.
I don't see any dependency but the code is somewhat tangled. Perhaps it would be better to build the PCI topology *before* IOMMU init and then iterate over the the devices after init to do the group assignment. I certainly can't see anything in the scan as it stands that would need the IOMMU to have been initialized. Paul > > Jan > _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
