[PATCH] um: implement arch_sync_kernel_mappings

anton.ivanov at cambridgegreys.com anton.ivanov at cambridgegreys.com
Tue Mar 16 09:58:41 GMT 2021


From: Anton Ivanov <anton.ivanov at cambridgegreys.com>

This improves the tlb flushing behavior by syncing modified
ranges out of map_kernel_range_noflush in a way which is
similar to x86.

Signed-off-by: Anton Ivanov <anton.ivanov at cambridgegreys.com>
---
 arch/um/include/asm/page.h | 2 ++
 arch/um/kernel/tlb.c       | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h
index 95af12e82a32..f4c66689f039 100644
--- a/arch/um/include/asm/page.h
+++ b/arch/um/include/asm/page.h
@@ -9,6 +9,8 @@
 
 #include <linux/const.h>
 
+#define ARCH_PAGE_TABLE_SYNC_MASK PGTBL_PMD_MODIFIED
+
 /* PAGE_SHIFT determines the page size */
 #define PAGE_SHIFT	12
 #define PAGE_SIZE	(_AC(1, UL) << PAGE_SHIFT)
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index bc38f79ca3a3..b27c4457cc72 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -602,3 +602,8 @@ void force_flush_all(void)
 		vma = vma->vm_next;
 	}
 }
+
+void arch_sync_kernel_mappings(unsigned long start, unsigned long end)
+{
+	flush_tlb_kernel_range_common(start, end);
+}
-- 
2.20.1




More information about the linux-um mailing list