[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v10] VT-d: use correct BDF for VF to search VT-d unit
Sorry for the delay, it looks like this patch resolves the issue. Tested-by: Crawford, Eric R <Eric.R.Crawford@xxxxxxxxx> -Eric -----Original Message----- From: Gao, Chao Sent: Monday, August 28, 2017 12:27 AM To: Crawford, Eric R <eric.r.crawford@xxxxxxxxx> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>; Roger Pau Monné <roger.pau@xxxxxxxxxx>; Wei Liu <wei.liu2@xxxxxxxxxx>; George Dunlap <George.Dunlap@xxxxxxxxxxxxx>; Ian Jackson <ian.jackson@xxxxxxxxxxxxx>; Crawford, Eric R <eric.r.crawford@xxxxxxxxx>; Tian, Kevin <kevin.tian@xxxxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>; xen-devel@xxxxxxxxxxxxx; Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>; Tim Deegan <tim@xxxxxxx>; Jan Beulich <JBeulich@xxxxxxxx> Subject: Re: [PATCH v10] VT-d: use correct BDF for VF to search VT-d unit On Mon, Aug 28, 2017 at 02:16:18AM -0600, Jan Beulich wrote: >>>> On 28.08.17 at 04:42, <chao.gao@xxxxxxxxx> wrote: >> When SR-IOV is enabled, 'Virtual Functions' of a 'Physical Function' >> are under the scope of the same VT-d unit as the 'Physical Function'. >> A 'Physical Function' can be a 'Traditional Function' or an ARI >> 'Extended Function'. And furthermore, 'Extended Functions' on an >> endpoint are under the scope of the same VT-d unit as the >> 'Traditional Functions' on the endpoint. To search VT-d unit for a >> VF, if its PF isn't an extended function, the BDF of PF should be >> used. Otherwise the BDF of a traditional function in the same device >> with the PF should be used. >> >> Current code uses PCI_SLOT() to recognize an ARI 'Extended Funcion'. >> But it is conceptually wrong w/o checking whether PF is an extended >> function and would lead to match VFs of a RC integrated PF to a wrong >> VT-d unit. >> >> This patch overrides VF 'is_extfn' field and uses this field to >> indicate whether the PF of this VF is an extended function. The field >> helps to use correct BDF to search VT-d unit. >> >> Reported-by: Crawford, Eric R <Eric.R.Crawford@xxxxxxxxx> >> Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx> > >Acked-by: Jan Beulich <jbeulich@xxxxxxxx> albeit ... > >> --- a/xen/drivers/passthrough/vtd/dmar.c >> +++ b/xen/drivers/passthrough/vtd/dmar.c >> @@ -211,15 +211,15 @@ struct acpi_drhd_unit >> *acpi_find_matched_drhd_unit(const struct pci_dev *pdev) >> if ( pdev == NULL ) >> return NULL; >> >> - if ( pdev->info.is_extfn ) >> + if ( pdev->info.is_virtfn ) >> { >> - bus = pdev->bus; >> - devfn = 0; >> + bus = pdev->info.physfn.bus; >> + devfn = (!pdev->info.is_extfn) ? pdev->info.physfn.devfn : >> + 0; > >... if I end up committing this and if I don't forget, I'll likely take >the liberty to remove the pointless parentheses here. > Hi, Eric. Could you test this patch again and give your Tested-by if it fixes the problem you reported? Thanks Chao _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |