Re: [PATCH v9 05/13] iommu/amd: Add function copy_dev_tables()

2017-08-04 Thread Baoquan He
On 08/04/17 at 02:51pm, Joerg Roedel wrote: > On Fri, Aug 04, 2017 at 08:30:39PM +0800, Baoquan He wrote: > > Sorry, I don't get 'this one' meaning, are you suggesting the copy for > > loop should be take out of the iommu for loop? > > > > About the temporary copy of the old device-table, you

Re: [PATCH v9 05/13] iommu/amd: Add function copy_dev_tables()

2017-08-04 Thread Joerg Roedel
On Fri, Aug 04, 2017 at 08:30:39PM +0800, Baoquan He wrote: > Sorry, I don't get 'this one' meaning, are you suggesting the copy for > loop should be take out of the iommu for loop? > > About the temporary copy of the old device-table, you can see in patch > 7/13, if irq sanity check failed, it

Re: [PATCH v9 05/13] iommu/amd: Add function copy_dev_tables()

2017-08-04 Thread Baoquan He
On 08/04/17 at 02:09pm, Joerg Roedel wrote: > > On Tue, Aug 01, 2017 at 07:37:21PM +0800, Baoquan He wrote: > > + for_each_iommu(iommu) { .. > > + if (copied) > > + continue; > > + > > + old_devtb_phys = entry & PAGE_MASK; > > +

Re: [PATCH v9 05/13] iommu/amd: Add function copy_dev_tables()

2017-08-04 Thread Baoquan He
Hi Joerg, Thanks for your reviewing! On 08/04/17 at 02:09pm, Joerg Roedel wrote: > Hi Baoquan, > > On Tue, Aug 01, 2017 at 07:37:21PM +0800, Baoquan He wrote: > > + for_each_iommu(iommu) { > > + /* All IOMMUs should use the same device table with the same > > size */ > > +

Re: [PATCH v9 05/13] iommu/amd: Add function copy_dev_tables()

2017-08-04 Thread Joerg Roedel
Hi Baoquan, On Tue, Aug 01, 2017 at 07:37:21PM +0800, Baoquan He wrote: > + for_each_iommu(iommu) { > + /* All IOMMUs should use the same device table with the same > size */ > + lo = readl(iommu->mmio_base + MMIO_DEV_TABLE_OFFSET); > + hi =

[PATCH v9 05/13] iommu/amd: Add function copy_dev_tables()

2017-08-01 Thread Baoquan He
Add function copy_dev_tables to copy the old DEV table entries of the panicked kernel to the new allocated device table. Since all iommus share the same device table the copy only need be done one time. Here add a new global old_dev_tbl_cpy to point to the newly allocated device table which the