]> xenbits.xensource.com Git - people/julieng/xen-unstable.git/commitdiff
xen/arm: p2m: Flush for every exit paths in apply_p2m_changes
authorJulien Grall <julien.grall@citrix.com>
Tue, 1 Dec 2015 17:52:09 +0000 (17:52 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 15 Dec 2015 11:58:54 +0000 (11:58 +0000)
Currently, the TLB is not flushed if an error occured while updating the
stage-2 p2m. However, the TLB will contain stale mappings for any entry
updated so far.

To avoid a such situation, flush on every exit path when the variable
"flush" is set.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/p2m.c

index e396c40e78ed9e7c65a7db905686ab54ee9f9add..f910cab595b0e90b30bf9547f37227dfd4f4832b 100644 (file)
@@ -1010,7 +1010,7 @@ static int apply_p2m_changes(struct domain *d,
                 if ( (egfn - sgfn) > progress && !(progress & mask) )
                 {
                     rc = progress;
-                    goto tlbflush;
+                    goto out;
                 }
                 break;
             }
@@ -1096,15 +1096,13 @@ static int apply_p2m_changes(struct domain *d,
 
     rc = 0;
 
-tlbflush:
+out:
     if ( flush )
     {
         flush_tlb_domain(d);
         iommu_iotlb_flush(d, sgfn, egfn - sgfn);
     }
 
-out:
-
     if ( rc < 0 && ( op == INSERT || op == ALLOCATE ) &&
          addr != start_gpaddr )
     {