[Patch v4 6/9] iommu/amd: Add function copy_dev_tables

2016-05-24 Thread Baoquan He
Add function copy_dev_tables to copy old DTE of the 1st kernel to the new DTE table. Since all iommu share the same DTE table the copy only need be done once as long as the physical address of old DTE table is retrieved from iommu reg. Besides the old domain id occupied in 1st kernel need be reserv

Re: [Patch v4 6/9] iommu/amd: Add function copy_dev_tables

2016-05-28 Thread Wan Zongshun
Original Message Add function copy_dev_tables to copy old DTE of the 1st kernel to the new DTE table. Since all iommu share the same DTE table the copy only need be done once as long as the physical address of old DTE table is retrieved from iommu reg. Besides the old domain i

Re: [Patch v4 6/9] iommu/amd: Add function copy_dev_tables

2016-05-29 Thread Baoquan He
On 05/28/16 at 09:08pm, Wan Zongshun wrote: > >+static int copy_dev_tables(void) > >+{ > >+u64 entry; > >+u32 lo, hi, devid; > >+phys_addr_t old_devtb_phys; > >+struct dev_table_entry *old_devtb; > >+u16 dom_id, dte_v; > >+struct amd_iommu *iommu; > >+static int copied;