[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] AMD IOMMU: don't free page table prematurely
On 05/26/2014 05:16 AM, Jan Beulich wrote: iommu_merge_pages() still wants to look at the next level page table, the TLB flush necessary before freeing too happens in that function, and if it fails no free should happen at all. Hence the freeing must be done after that function returned successfully, not before it's being called. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- a/xen/drivers/passthrough/amd/iommu_map.c +++ b/xen/drivers/passthrough/amd/iommu_map.c @@ -691,8 +691,6 @@ int amd_iommu_map_page(struct domain *d, if ( !iommu_update_pde_count(d, pt_mfn[merge_level], gfn, mfn, merge_level) ) break; - /* Deallocate lower level page table */ - free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1])); if ( iommu_merge_pages(d, pt_mfn[merge_level], gfn, flags, merge_level) ) @@ -703,6 +701,9 @@ int amd_iommu_map_page(struct domain *d, domain_crash(d); return -EFAULT; } + + /* Deallocate lower level page table */ + free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1])); } out: Reviewed and tested. By the way, is this patch fix any existing known issues? Suravee _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |