Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1707831

[PATCH v5 07/10] arm64/mm: Don't flush the data cache if the page is unmapped by XPFO

From Tycho Andersen <tycho@docker.com>
Newsgroups linux.kernel
Subject [PATCH v5 07/10] arm64/mm: Don't flush the data cache if the page is unmapped by XPFO
Date 2017-08-09 22:10 +0200
Message-ID <ucFsJ-3Hw-9@gated-at.bofh.it> (permalink)
References <ucFsJ-3Hw-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 00/10] Add support for eXclusive Page Frame Ownership Tycho Andersen <tycho@docker.com> - 2017-08-09 22:10 +0200
  [PATCH v5 07/10] arm64/mm: Don't flush the data cache if the page is unmapped by XPFO Tycho Andersen <tycho@docker.com> - 2017-08-09 22:10 +0200
  [PATCH v5 01/10] mm: add MAP_HUGETLB support to vm_mmap Tycho Andersen <tycho@docker.com> - 2017-08-09 22:20 +0200
  [PATCH v5 03/10] swiotlb: Map the buffer if it was unmapped by XPFO Tycho Andersen <tycho@docker.com> - 2017-08-09 22:20 +0200
    Re: [PATCH v5 03/10] swiotlb: Map the buffer if it was unmapped by  XPFO Konrad Rzeszutek Wilk <konrad@darnok.org> - 2017-08-10 15:10 +0200
      Re: [PATCH v5 03/10] swiotlb: Map the buffer if it was unmapped by  XPFO Tycho Andersen <tycho@docker.com> - 2017-08-10 18:30 +0200
  [PATCH v5 04/10] arm64: Add __flush_tlb_one() Tycho Andersen <tycho@docker.com> - 2017-08-09 22:20 +0200
  [PATCH v5 02/10] mm, x86: Add support for eXclusive Page Frame Ownership (XPFO) Tycho Andersen <tycho@docker.com> - 2017-08-09 22:20 +0200
  [PATCH v5 05/10] arm64/mm: Add support for XPFO Tycho Andersen <tycho@docker.com> - 2017-08-09 22:20 +0200
    Re: [kernel-hardening] [PATCH v5 05/10] arm64/mm: Add support for  XPFO Laura Abbott <labbott@redhat.com> - 2017-08-11 20:10 +0200
      Re: [kernel-hardening] [PATCH v5 05/10] arm64/mm: Add support for  XPFO Tycho Andersen <tycho@docker.com> - 2017-08-11 22:20 +0200

csiph-web