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>
if ( (egfn - sgfn) > progress && !(progress & mask) )
{
rc = progress;
- goto tlbflush;
+ goto out;
}
break;
}
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 )
{