lkml.org 
[lkml]   [2017]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v5 07/10] arm64/mm: Don't flush the data cache if the page is unmapped by XPFO
Date
From: Juerg Haefliger <juerg.haefliger@hpe.com>

If the page is unmapped by XPFO, a data cache flush results in a fatal
page fault. So don't flush in that case.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Tested-by: Tycho Andersen <tycho@docker.com>
---
arch/arm64/mm/flush.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c
index 21a8d828cbf4..e17a063b2df2 100644
--- a/arch/arm64/mm/flush.c
+++ b/arch/arm64/mm/flush.c
@@ -20,6 +20,7 @@
#include <linux/export.h>
#include <linux/mm.h>
#include <linux/pagemap.h>
+#include <linux/xpfo.h>

#include <asm/cacheflush.h>
#include <asm/cache.h>
@@ -30,7 +31,9 @@ void sync_icache_aliases(void *kaddr, unsigned long len)
unsigned long addr = (unsigned long)kaddr;

if (icache_is_aliasing()) {
- __clean_dcache_area_pou(kaddr, len);
+ /* Don't flush if the page is unmapped by XPFO */
+ if (!xpfo_page_is_unmapped(virt_to_page(kaddr)))
+ __clean_dcache_area_pou(kaddr, len);
__flush_icache_all();
} else {
flush_icache_range(addr, addr + len);
--
2.11.0
\
 
 \ /
  Last update: 2017-08-09 22:10    [W:0.176 / U:0.068 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site