From 6151e1bbb2c77453548d6f13faad000e9dc3099c Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Mon, 26 Mar 2018 14:47:17 +0200 Subject: [PATCH] Disable super-page I/O mappings on FOC and Fiasco We disable super-page I/O mappings because our unmap code does not flush local mappings from core and, thus, breaks later re-mappings of different page size. Issue #2547 --- repos/base-fiasco/src/core/io_mem_session_support.cc | 11 ++++++++--- repos/base-foc/src/core/include/map_local.h | 9 ++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/repos/base-fiasco/src/core/io_mem_session_support.cc b/repos/base-fiasco/src/core/io_mem_session_support.cc index 123b1e8cf1..609d8d995d 100644 --- a/repos/base-fiasco/src/core/io_mem_session_support.cc +++ b/repos/base-fiasco/src/core/io_mem_session_support.cc @@ -31,9 +31,14 @@ void Io_mem_session_component::_unmap_local(addr_t base, size_t) } -static inline bool can_use_super_page(addr_t base, size_t size) { - return (base & (get_super_page_size() - 1)) == 0 - && (size >= get_super_page_size()); } +static inline bool can_use_super_page(addr_t, size_t) +{ + /* + * We disable super-page I/O mappings as unmap does not flush the local + * mapping which breaks later re-mappings of different page size. + */ + return false; +} addr_t Io_mem_session_component::_map_local(addr_t base, size_t size) diff --git a/repos/base-foc/src/core/include/map_local.h b/repos/base-foc/src/core/include/map_local.h index a6fdb34253..0b31c6a272 100644 --- a/repos/base-foc/src/core/include/map_local.h +++ b/repos/base-foc/src/core/include/map_local.h @@ -66,10 +66,13 @@ namespace Genode { } - static inline bool can_use_super_page(addr_t base, size_t size) + static inline bool can_use_super_page(addr_t, size_t) { - return (base & (get_super_page_size() - 1)) == 0 - && (size >= get_super_page_size()); + /* + * We disable super-page I/O mappings as unmap does not flush the local + * mapping which breaks later re-mappings of different page size. + */ + return false; }