From 3ae2c1712eb29b5a1df3e41b51e18fb457f213a9 Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Mon, 4 Mar 2013 11:26:18 +0100 Subject: [PATCH] base-foc: Do not touch memory during map operation Don't do anything in Mapping::prepare_map_operation. At this point and in the current implementation, the memory has been mapped and cleared already. Touching the memory may only pollute the cache causing data corruption in DMA memory. Fixes issue #452 --- base-foc/include/base/ipc_pager.h | 17 +++-------------- base-foc/src/core/platform.cc | 2 -- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/base-foc/include/base/ipc_pager.h b/base-foc/include/base/ipc_pager.h index cdcfc6bae..e8b0eaea5 100644 --- a/base-foc/include/base/ipc_pager.h +++ b/base-foc/include/base/ipc_pager.h @@ -75,21 +75,10 @@ namespace Genode { bool write_combined() const { return _write_combined; } /** - * Prepare map operation - * - * On Fiasco, we need to map a page locally to be able to map it to - * another address space. + * Prepare map operation is not needed on Fiasco.OC, since we clear the + * dataspace before this function is called. */ - void prepare_map_operation() - { - size_t mapping_size = 1 << _log2size; - for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) { - if (_rw) - touch_read_write((unsigned char volatile *)(_src_addr + i)); - else - touch_read((unsigned char const volatile *)(_src_addr + i)); - } - } + void prepare_map_operation() { } }; diff --git a/base-foc/src/core/platform.cc b/base-foc/src/core/platform.cc index 8c73276b6..9d6fc80a1 100644 --- a/base-foc/src/core/platform.cc +++ b/base-foc/src/core/platform.cc @@ -250,8 +250,6 @@ static inline int sigma0_req_region(addr_t *addr, unsigned log2size) *addr = l4_utcb_mr()->mr[0] & (~0UL << L4_PAGESHIFT); - touch_rw((void *)addr, 1); - return 0; }