Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-17 Thread Xu, Quan
> On 17.12.2015 at 8:10pm, wrote: > >>> On 17.12.15 at 12:43, wrote: > > You are correct. > > As the _pci_hide_device()'s early check, I didn't use it. > > Could I remove the device from that list before adding it to > > dom_xen's, and reuse pci_hide_device() as below? > > That's what I was tr

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-17 Thread Jan Beulich
>>> On 17.12.15 at 12:43, wrote: >> On 16.12.2015 at 4:08pm, wrote: >> >>> On 16.12.15 at 04:51, wrote: >> > --- a/xen/drivers/passthrough/pci.c >> > +++ b/xen/drivers/passthrough/pci.c >> > @@ -1318,6 +1318,25 @@ int iommu_remove_device(struct pci_dev *pdev) >> > return hd->platform_ops->

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-17 Thread Xu, Quan
> On 16.12.2015 at 4:08pm, wrote: > >>> On 16.12.15 at 04:51, wrote: > > --- a/xen/drivers/passthrough/pci.c > > +++ b/xen/drivers/passthrough/pci.c > > @@ -1318,6 +1318,25 @@ int iommu_remove_device(struct pci_dev *pdev) > > return hd->platform_ops->remove_device(pdev->devfn, > > pci_to_dev

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-16 Thread Jan Beulich
>>> On 16.12.15 at 04:51, wrote: > --- a/xen/drivers/passthrough/pci.c > +++ b/xen/drivers/passthrough/pci.c > @@ -1318,6 +1318,25 @@ int iommu_remove_device(struct pci_dev *pdev) > return hd->platform_ops->remove_device(pdev->devfn, pci_to_dev(pdev)); > } > > +int iommu_hide_device(struct

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Xu, Quan
> On 15.12.15 at 9:44pm, wrote: > >>> On 15.12.15 at 14:31, wrote: > > Copy from pci_hide_device(), which is actually add device to dom_xen > > and add pdev->domain_list to dom_xen->arch.pdev_list. > > > > Quite similar, a second one only with proper justification, I can > > reassign Device form

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Xu, Quan
> On 15.12.2015 at 9:44pm, wrote: > >>> On 15.12.15 at 14:31, wrote: > > Copy from pci_hide_device(), which is actually add device to dom_xen > > and add pdev->domain_list to dom_xen->arch.pdev_list. > > > > Quite similar, a second one only with proper justification, I can > > reassign Device for

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Jan Beulich
>>> On 15.12.15 at 14:01, wrote: >> On 15.12.2015 at 8:32pm, wrote: >> >>> On 15.12.15 at 12:42, wrote: >> On 15.12.15 at 11:24, wrote: >> > >> On 15.12.2015 at 5:17pm, wrote: >> > >> >>> On 15.12.15 at 09:15, wrote: >> > >> >> On 14.12.2015 at 5:28pm, wrote: >> > >> >> >>> On 12.12.1

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Xu, Quan
> On 15.12.2015 at 8:30pm, wrote: > >>> On 15.12.15 at 13:23, wrote: > >> On 15.12.2015 at 5:17pm, wrote: > >> >>> On 15.12.15 at 09:15, wrote: > >> >> On 14.12.2015 at 5:28pm, wrote: > >> >> >>> On 12.12.15 at 14:21, wrote: > >> >> > @@ -88,6 +89,16 @@ struct pci_dev { #define > >> >> > for

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Xu, Quan
> On 15.12.2015 at 8:32pm, wrote: > >>> On 15.12.15 at 12:42, wrote: > On 15.12.15 at 11:24, wrote: > > >> On 15.12.2015 at 5:17pm, wrote: > > >> >>> On 15.12.15 at 09:15, wrote: > > >> >> On 14.12.2015 at 5:28pm, wrote: > > >> >> >>> On 12.12.15 at 14:21, wrote: > > >> >> > --- a/xen/

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Jan Beulich
>>> On 15.12.15 at 13:23, wrote: >> On 15.12.2015 at 5:17pm, wrote: >> >>> On 15.12.15 at 09:15, wrote: >> >> On 14.12.2015 at 5:28pm, wrote: >> >> >>> On 12.12.15 at 14:21, wrote: >> >> > @@ -88,6 +89,16 @@ struct pci_dev { #define for_each_pdev(domain, >> >> > pdev) \ >> >> > list_for_

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Jan Beulich
>>> On 15.12.15 at 12:42, wrote: On 15.12.15 at 11:24, wrote: > >> On 15.12.2015 at 5:17pm, wrote: > >> >>> On 15.12.15 at 09:15, wrote: > >> >> On 14.12.2015 at 5:28pm, wrote: > >> >> >>> On 12.12.15 at 14:21, wrote: > >> >> > --- a/xen/drivers/passthrough/vtd/iommu.c > >> >> > +++ b/x

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Xu, Quan
> On 15.12.2015 at 5:17pm, wrote: > >>> On 15.12.15 at 09:15, wrote: > >> On 14.12.2015 at 5:28pm, wrote: > >> >>> On 12.12.15 at 14:21, wrote: > >> > @@ -88,6 +89,16 @@ struct pci_dev { #define for_each_pdev(domain, > >> > pdev) \ > >> > list_for_each_entry(pdev, &(domain->arch.pdev_l

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Xu, Quan
> On 15.12.2015 at 5:17pm, wrote: > >>> On 15.12.15 at 09:15, wrote: > >> On 14.12.2015 at 5:28pm, wrote: > >> >>> On 12.12.15 at 14:21, wrote: > >> > --- a/xen/drivers/passthrough/vtd/iommu.c > >> > +++ b/xen/drivers/passthrough/vtd/iommu.c > >> > @@ -1890,6 +1890,9 @@ static int intel_iommu_a

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Xu, Quan
> On 15.12.2015 at 5:17pm, wrote: > >>> On 15.12.15 at 09:15, wrote: > >> On 14.12.2015 at 5:28pm, wrote: > >> >>> On 12.12.15 at 14:21, wrote: > >> > --- a/xen/drivers/passthrough/vtd/iommu.c > >> > +++ b/xen/drivers/passthrough/vtd/iommu.c > >> > @@ -1890,6 +1890,9 @@ static int intel_iommu_a

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Jan Beulich
>>> On 15.12.15 at 09:15, wrote: >> On 14.12.2015 at 5:28pm, wrote: >> >>> On 12.12.15 at 14:21, wrote: >> > --- a/xen/drivers/passthrough/vtd/iommu.c >> > +++ b/xen/drivers/passthrough/vtd/iommu.c >> > @@ -1890,6 +1890,9 @@ static int intel_iommu_add_device(u8 devfn, struct >> pci_dev *pdev) >>

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-15 Thread Xu, Quan
>On 14.12.2015 at 5:28pm, wrote: > >>> On 12.12.15 at 14:21, wrote: > > --- a/xen/drivers/passthrough/vtd/iommu.c > > +++ b/xen/drivers/passthrough/vtd/iommu.c > > @@ -1890,6 +1890,9 @@ static int intel_iommu_add_device(u8 devfn, struct > pci_dev *pdev) > > if ( !pdev->domain ) > >

Re: [Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-14 Thread Jan Beulich
>>> On 12.12.15 at 14:21, wrote: > --- a/xen/drivers/passthrough/vtd/iommu.c > +++ b/xen/drivers/passthrough/vtd/iommu.c > @@ -1890,6 +1890,9 @@ static int intel_iommu_add_device(u8 devfn, struct > pci_dev *pdev) > if ( !pdev->domain ) > return -EINVAL; > > +if ( is_pdev_unass

[Xen-devel] [PATCH v3 2/2] VT-d: Fix vt-d flush timeout issue.

2015-12-12 Thread Quan Xu
If IOTLB/Context/IETC flush is timeout, we should think all devices under this IOMMU cannot function correctly. So for each device under this IOMMU we'll mark it as unassignable and kill the domain owning the device. If Device-TLB flush is timeout, we'll mark the target ATS device as unassignable