Re: [PATCH v6 7/9] iommu/amd: Update domain into to dte entry during device driver init

2016-11-12 Thread Baoquan He
Hi Joerg, Thanks for your reviewing and great comments! On 11/10/16 at 12:48pm, Joerg Roedel wrote: > On Thu, Oct 20, 2016 at 07:37:18PM +0800, Baoquan He wrote: > > prot = dir2prot(direction); > > + if (translation_pre_enabled(iommu) && !dev_data->domain_updated) { > > +

Re: [PATCH v6 7/9] iommu/amd: Update domain into to dte entry during device driver init

2016-11-12 Thread Baoquan He
Hi Joerg, Thanks for your reviewing and great comments! On 11/10/16 at 12:48pm, Joerg Roedel wrote: > On Thu, Oct 20, 2016 at 07:37:18PM +0800, Baoquan He wrote: > > prot = dir2prot(direction); > > + if (translation_pre_enabled(iommu) && !dev_data->domain_updated) { > > +

Re: [PATCH v6 7/9] iommu/amd: Update domain into to dte entry during device driver init

2016-11-10 Thread Joerg Roedel
On Thu, Oct 20, 2016 at 07:37:18PM +0800, Baoquan He wrote: > prot = dir2prot(direction); > + if (translation_pre_enabled(iommu) && !dev_data->domain_updated) { > + dev_data->domain_updated = true; > + set_dte_entry(dev_data->devid, domain, dev_data->ats.enabled);

Re: [PATCH v6 7/9] iommu/amd: Update domain into to dte entry during device driver init

2016-11-10 Thread Joerg Roedel
On Thu, Oct 20, 2016 at 07:37:18PM +0800, Baoquan He wrote: > prot = dir2prot(direction); > + if (translation_pre_enabled(iommu) && !dev_data->domain_updated) { > + dev_data->domain_updated = true; > + set_dte_entry(dev_data->devid, domain, dev_data->ats.enabled);

[PATCH v6 7/9] iommu/amd: Update domain into to dte entry during device driver init

2016-10-20 Thread Baoquan He
All devices are supposed to reset themselves at device driver initialization stage. At this time if in kdump kernel those on-flight DMA will be stopped because of device reset. It's best time to update the protection domain info, especially pte_root, to dte entry which the device relates to.

[PATCH v6 7/9] iommu/amd: Update domain into to dte entry during device driver init

2016-10-20 Thread Baoquan He
All devices are supposed to reset themselves at device driver initialization stage. At this time if in kdump kernel those on-flight DMA will be stopped because of device reset. It's best time to update the protection domain info, especially pte_root, to dte entry which the device relates to.