[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] xen/arm: mm: flush_page_to_ram() only need to clean to PoC
commit 9617d5f9c19d1d157629e1e436791509526e0ce5 Author: Julien Grall <jgrall@xxxxxxxxxx> AuthorDate: Sat Feb 20 17:54:13 2021 +0000 Commit: Julien Grall <jgrall@xxxxxxxxxx> CommitDate: Thu Apr 1 17:12:05 2021 +0100 xen/arm: mm: flush_page_to_ram() only need to clean to PoC At the moment, flush_page_to_ram() is both cleaning and invalidate to PoC the page. The goal of flush_page_to_ram() is to prevent corruption when the guest has disabled the cache (the cache line may be dirty) and the guest to read previous content. Per this definition, the invalidating the line is not necessary. So invalidating the cache is unnecessary. In fact, it may be counter- productive as the line may be (speculatively) accessed a bit after. So this will incurr an expensive access to the memory. More generally, we should avoid interferring too much with cache. Therefore, flush_page_to_ram() is updated to only clean to PoC the page. The performance impact of this change will depend on your workload/processor. Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx> Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx> Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> --- xen/arch/arm/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 59f8a3f15f..2f11d214e1 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -529,7 +529,7 @@ void flush_page_to_ram(unsigned long mfn, bool sync_icache) { void *v = map_domain_page(_mfn(mfn)); - clean_and_invalidate_dcache_va_range(v, PAGE_SIZE); + clean_dcache_va_range(v, PAGE_SIZE); unmap_domain_page(v); /* -- generated by git-patchbot for /home/xen/git/xen.git#master
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |