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:
committed by
Christian Helmuth
parent
e20bbe7002
commit
511acad507
@@ -28,6 +28,7 @@
|
||||
/* Genode includes */
|
||||
#include <os/attached_ram_dataspace.h>
|
||||
#include <rm_session/connection.h>
|
||||
#include <region_map/client.h>
|
||||
|
||||
/* VMM utilities includes */
|
||||
#include <vmm/types.h>
|
||||
@@ -45,11 +46,11 @@ namespace Vmm {
|
||||
* part of the address space, which contains the shadow of the VCPU's physical
|
||||
* memory.
|
||||
*/
|
||||
struct Vmm::Virtual_reservation : Rm_connection
|
||||
struct Vmm::Virtual_reservation : private Rm_connection, Region_map_client
|
||||
{
|
||||
Virtual_reservation(addr_t vm_size)
|
||||
:
|
||||
Rm_connection(0, vm_size)
|
||||
Region_map_client(Rm_connection::create(vm_size))
|
||||
{
|
||||
try {
|
||||
/*
|
||||
@@ -57,7 +58,7 @@ struct Vmm::Virtual_reservation : Rm_connection
|
||||
* space. We leave out the very first page because core denies
|
||||
* the attachment of anything at the zero page.
|
||||
*/
|
||||
env()->rm_session()->attach_at(Rm_connection::dataspace(),
|
||||
env()->rm_session()->attach_at(Region_map_client::dataspace(),
|
||||
PAGE_SIZE, 0, PAGE_SIZE);
|
||||
|
||||
} catch (Rm_session::Region_conflict) {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <nova_cpu_session/connection.h>
|
||||
#include <cpu_session/connection.h>
|
||||
#include <pd_session/connection.h>
|
||||
#include <rm_session/connection.h>
|
||||
#include <region_map/client.h>
|
||||
|
||||
/* NOVA includes */
|
||||
#include <nova/native_thread.h>
|
||||
@@ -50,7 +50,6 @@ class Vmm::Vcpu_other_pd : public Vmm::Vcpu_thread
|
||||
Genode::Pd_connection _pd_session;
|
||||
Genode::Affinity::Location _location;
|
||||
Genode::Cpu_session *_cpu_session;
|
||||
Genode::Rm_connection _rm;
|
||||
|
||||
Genode::addr_t _exc_pt_sel;
|
||||
|
||||
@@ -75,7 +74,8 @@ class Vmm::Vcpu_other_pd : public Vmm::Vcpu_thread
|
||||
_pd_session.bind_thread(vcpu_vm);
|
||||
|
||||
/* create new pager object and assign it to the new thread */
|
||||
Pager_capability pager_cap = _rm.add_client(vcpu_vm);
|
||||
Genode::Region_map_client address_space(_pd_session.address_space());
|
||||
Pager_capability pager_cap = address_space.add_client(vcpu_vm);
|
||||
|
||||
_cpu_session->set_pager(vcpu_vm, pager_cap);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user