From c4ed38cfbc758551e5f4c6d33aff673a361a438d Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Fri, 15 Jul 2016 13:44:40 +0200 Subject: [PATCH] sel4: fix vm_space has_page_table_at Issue #2044 --- repos/base-sel4/src/core/include/vm_space.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/repos/base-sel4/src/core/include/vm_space.h b/repos/base-sel4/src/core/include/vm_space.h index 5d3484551b..894371de6f 100644 --- a/repos/base-sel4/src/core/include/vm_space.h +++ b/repos/base-sel4/src/core/include/vm_space.h @@ -340,12 +340,13 @@ class Genode::Vm_space { Lock::Guard guard(_lock); - /* check if we need to add a page table to core's VM space */ - if (!_page_table_registry.has_page_table_at(to_virt)) - _alloc_and_map_page_table(to_virt); - for (size_t i = 0; i < num_pages; i++) { off_t const offset = i << get_page_size_log2(); + + /* check if we need to add a page table to core's VM space */ + if (!_page_table_registry.has_page_table_at(to_virt + offset)) + _alloc_and_map_page_table(to_virt + offset); + _map_page(from_phys + offset, to_virt + offset, flush_support); } }