From: Julien Grall Date: Tue, 1 Dec 2015 17:52:09 +0000 (+0000) Subject: xen/arm: p2m: Flush for every exit paths in apply_p2m_changes X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1ec2fa626f71152031b620bfe2d4941b9016a688;p=people%2Fjulieng%2Fxen-unstable.git xen/arm: p2m: Flush for every exit paths in apply_p2m_changes 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 Acked-by: Ian Campbell --- diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index e396c40e78..f910cab595 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -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 ) {