ia64/xen-unstable

changeset 19140:102576868e8d

amd-iommu: drop locks before printing error messages

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jan 30 11:13:32 2009 +0000 (2009-01-30)
parents 2d70ad9c3bc7
children e1135b40e783
files xen/drivers/passthrough/amd/iommu_map.c
line diff
     1.1 --- a/xen/drivers/passthrough/amd/iommu_map.c	Fri Jan 30 11:13:06 2009 +0000
     1.2 +++ b/xen/drivers/passthrough/amd/iommu_map.c	Fri Jan 30 11:13:32 2009 +0000
     1.3 @@ -461,8 +461,8 @@ int amd_iommu_map_page(struct domain *d,
     1.4      iommu_l2e = iommu_l2e_from_pfn(hd->root_table, hd->paging_mode, gfn);
     1.5      if ( iommu_l2e == 0 )
     1.6      {
     1.7 +        spin_unlock_irqrestore(&hd->mapping_lock, flags);
     1.8          amd_iov_error("Invalid IO pagetable entry gfn = %lx\n", gfn);
     1.9 -        spin_unlock_irqrestore(&hd->mapping_lock, flags);
    1.10          return -EFAULT;
    1.11      }
    1.12      set_iommu_l1e_present(iommu_l2e, gfn, (u64)mfn << PAGE_SHIFT, iw, ir);
    1.13 @@ -493,8 +493,8 @@ int amd_iommu_unmap_page(struct domain *
    1.14  
    1.15      if ( iommu_l2e == 0 )
    1.16      {
    1.17 +        spin_unlock_irqrestore(&hd->mapping_lock, flags);
    1.18          amd_iov_error("Invalid IO pagetable entry gfn = %lx\n", gfn);
    1.19 -        spin_unlock_irqrestore(&hd->mapping_lock, flags);
    1.20          return -EFAULT;
    1.21      }
    1.22  
    1.23 @@ -533,9 +533,9 @@ int amd_iommu_reserve_domain_unity_map(
    1.24  
    1.25          if ( iommu_l2e == 0 )
    1.26          {
    1.27 -            amd_iov_error(
    1.28 -            "Invalid IO pagetable entry phys_addr = %lx\n", phys_addr);
    1.29              spin_unlock_irqrestore(&hd->mapping_lock, flags);
    1.30 +            amd_iov_error("Invalid IO pagetable entry phys_addr = %lx\n",
    1.31 +                          phys_addr);
    1.32              return -EFAULT;
    1.33          }
    1.34  
    1.35 @@ -582,8 +582,8 @@ int amd_iommu_sync_p2m(struct domain *d)
    1.36          if ( iommu_l2e == 0 )
    1.37          {
    1.38              spin_unlock(&d->page_alloc_lock);
    1.39 +            spin_unlock_irqrestore(&hd->mapping_lock, flags);
    1.40              amd_iov_error("Invalid IO pagetable entry gfn = %lx\n", gfn);
    1.41 -            spin_unlock_irqrestore(&hd->mapping_lock, flags);
    1.42              return -EFAULT;
    1.43          }
    1.44