Consolidate RM service into PD session

This patch integrates three region maps into each PD session to
reduce the session overhead and to simplify the PD creation procedure.
Please refer to the issue cited below for an elaborative discussion.

Note the API change:

With this patch, the semantics of core's RM service have changed. Now,
the service is merely a tool for creating and destroying managed
dataspaces, which are rarely needed. Regular components no longer need a
RM session. For this reason, the corresponding argument for the
'Process' and 'Child' constructors has been removed.

The former interface of the 'Rm_session' is not named 'Region_map'. As a
minor refinement, the 'Fault_type' enum values are now part of the
'Region_map::State' struct.

Issue #1938
This commit is contained in:
Norman Feske
2016-04-15 15:19:22 +02:00
committed by Christian Helmuth
parent e20bbe7002
commit 511acad507
189 changed files with 3314 additions and 2934 deletions

View File

@@ -23,6 +23,7 @@ SRC_CC += thread/thread.cc thread/thread_bootstrap.cc thread/trace.cc
SRC_CC += thread/myself.cc
SRC_CC += thread/stack_allocator.cc
SRC_CC += sleep.cc
SRC_CC += region_map_client.cc
SRC_CC += rm_session_client.cc
SRC_CC += entrypoint/entrypoint.cc
SRC_CC += component/component.cc

View File

@@ -187,7 +187,7 @@ namespace Genode {
/*
* On L4/Fiasco, we don't use directed unmap but rely on the
* in-kernel mapping database. See 'rm_session_support.cc'.
* in-kernel mapping database. See 'region_map_support.cc'.
*/
void flush(addr_t, size_t) { PDBG("not implemented"); }
};

View File

@@ -107,6 +107,15 @@ namespace Genode {
*/
void unbind();
/**
* Return pointer to the thread's PD
*
* Used to validate the success of the bind operation.
*
* XXX to be removed
*/
Platform_pd *pd() { return _platform_pd; }
/**
* Override thread state with 's'
*

View File

@@ -19,7 +19,7 @@
/* Genode includes */
#include <base/stdint.h>
#include <base/printf.h>
#include <rm_session/rm_session.h>
#include <region_map/region_map.h>
#include <util/touch.h>
/* base-internal includes */
@@ -100,13 +100,13 @@ namespace Genode {
constexpr size_t get_super_page_size_log2() { return L4_LOG2_SUPERPAGESIZE; }
inline void print_page_fault(const char *msg, addr_t pf_addr, addr_t pf_ip,
Rm_session::Fault_type pf_type,
Region_map::State::Fault_type pf_type,
unsigned long badge)
{
Fiasco::l4_threadid_t tid;
tid.raw = badge;
printf("%s (%s pf_addr=%p pf_ip=%p from %x.%02x)\n", msg,
pf_type == Rm_session::WRITE_FAULT ? "WRITE" : "READ",
pf_type == Region_map::State::WRITE_FAULT ? "WRITE" : "READ",
(void *)pf_addr, (void *)pf_ip,
(int)tid.id.task, (int)tid.id.lthread);
}

View File

@@ -28,8 +28,8 @@ SRC_CC += stack_area.cc \
platform_thread.cc \
ram_session_component.cc \
ram_session_support.cc \
rm_session_component.cc \
rm_session_support.cc \
region_map_component.cc \
region_map_support.cc \
rom_session_component.cc \
signal_source_component.cc \
thread_start.cc \
@@ -56,7 +56,7 @@ vpath rpc_cap_factory.cc $(GEN_CORE_DIR)
vpath core_rpc_cap_alloc.cc $(GEN_CORE_DIR)
vpath pd_assign_pci.cc $(GEN_CORE_DIR)
vpath pd_upgrade_ram_quota.cc $(GEN_CORE_DIR)
vpath rm_session_component.cc $(GEN_CORE_DIR)
vpath region_map_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_component.cc $(GEN_CORE_DIR)
vpath io_mem_session_support.cc $(GEN_CORE_DIR)
vpath signal_source_component.cc $(GEN_CORE_DIR)