mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-23 17:17:38 +00:00
Remove blocking calls from root and parent RPCs
This is a redesign of the root and parent interfaces to eliminate blocking RPC calls. - New session representation at the parent (base/session_state.h) - base-internal root proxy mechanism as migration path - Redesign of base/service.h - Removes ancient 'Connection::KEEP_OPEN' feature - Interface change of 'Child', 'Child_policy', 'Slave', 'Slave_policy' - New 'Slave::Connection' - Changed child-construction procedure to be compatible with the non-blocking parent interface and to be easier to use - The child's initial LOG session, its binary ROM session, and the linker ROM session have become part of the child's envirenment. - Session upgrading must now be performed via 'env.upgrade' instead of performing a sole RPC call the parent. To make RAM upgrades easier, the 'Connection' provides a new 'upgrade_ram' method. Issue #2120
This commit is contained in:
committed by
Christian Helmuth
parent
3cc2a3f085
commit
cfdbccc5c2
@ -18,4 +18,4 @@
|
||||
#include <base/internal/native_env.h>
|
||||
|
||||
|
||||
void Genode::upgrade_pd_session_quota(Genode::size_t quota) { assert(false); }
|
||||
void Genode::upgrade_pd_quota_non_blocking(Genode::size_t quota) { assert(false); }
|
||||
|
@ -15,21 +15,21 @@
|
||||
#include <base/service.h>
|
||||
#include <base/heap.h>
|
||||
|
||||
/* Core includes */
|
||||
/* core includes */
|
||||
#include <platform_services.h>
|
||||
#include <core_parent.h> /* for 'Core_service' type */
|
||||
#include <vm_root.h>
|
||||
|
||||
|
||||
/*
|
||||
* Add ARM virtualization specific vm service
|
||||
*/
|
||||
void Genode::platform_add_local_services(Genode::Rpc_entrypoint *ep,
|
||||
Genode::Sliced_heap *sh,
|
||||
Genode::Service_registry *ls)
|
||||
void Genode::platform_add_local_services(Rpc_entrypoint *ep,
|
||||
Sliced_heap *sh,
|
||||
Registry<Service> *services)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
static Vm_root vm_root(ep, sh);
|
||||
static Local_service vm_ls(Vm_session::service_name(), &vm_root);
|
||||
ls->insert(&vm_ls);
|
||||
static Core_service<Vm_session_component> vm_service(*services, vm_root);
|
||||
}
|
||||
|
@ -18,19 +18,17 @@
|
||||
/* Core includes */
|
||||
#include <platform.h>
|
||||
#include <platform_services.h>
|
||||
#include <core_parent.h>
|
||||
#include <vm_root.h>
|
||||
|
||||
|
||||
/*
|
||||
* Add TrustZone specific vm service
|
||||
*/
|
||||
void Genode::platform_add_local_services(Genode::Rpc_entrypoint *ep,
|
||||
Genode::Sliced_heap *sh,
|
||||
Genode::Service_registry *ls)
|
||||
void Genode::platform_add_local_services(Rpc_entrypoint *ep,
|
||||
Sliced_heap *sliced_heap,
|
||||
Registry<Service> *local_services)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
static Vm_root vm_root(ep, sh);
|
||||
static Local_service vm_ls(Vm_session::service_name(), &vm_root);
|
||||
ls->insert(&vm_ls);
|
||||
static Vm_root vm_root(ep, sliced_heap);
|
||||
static Core_service<Vm_session_component> vm_service(*local_services, vm_root);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
/* Genode includes */
|
||||
#include <base/service.h>
|
||||
|
||||
/* Core includes */
|
||||
/* core includes */
|
||||
#include <core_env.h>
|
||||
#include <platform.h>
|
||||
#include <platform_services.h>
|
||||
@ -24,18 +24,15 @@
|
||||
/*
|
||||
* Add I/O port service and virtualization specific vm service
|
||||
*/
|
||||
void Genode::platform_add_local_services(Genode::Rpc_entrypoint *ep,
|
||||
Genode::Sliced_heap *sh,
|
||||
Genode::Service_registry *ls)
|
||||
void Genode::platform_add_local_services(Rpc_entrypoint *ep,
|
||||
Sliced_heap *sh,
|
||||
Registry<Service> *services)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
static Vm_root vm_root(ep, sh);
|
||||
static Local_service vm_ls(Vm_session::service_name(), &vm_root);
|
||||
static Core_service<Vm_session_component> vm_ls(*services, vm_root);
|
||||
|
||||
static Io_port_root io_port_root(core_env()->pd_session(),
|
||||
platform()->io_port_alloc(), sh);
|
||||
static Local_service io_port_ls(Io_port_session::service_name(),
|
||||
&io_port_root);
|
||||
ls->insert(&vm_ls);
|
||||
ls->insert(&io_port_ls);
|
||||
static Core_service<Io_port_session_component> io_port_ls(*services,
|
||||
io_port_root);
|
||||
}
|
||||
|
@ -20,9 +20,13 @@
|
||||
namespace Genode
|
||||
{
|
||||
/**
|
||||
* Upgrade quota of the PD session within my Genode environment
|
||||
* Upgrade quota of the PD session within my Genode environment non-blocking
|
||||
*
|
||||
* This function doesn't lock the environment when upgrading. This is
|
||||
* needed when doing upgrades in situations where the environment is
|
||||
* already locked due to the operation that triggered the upgrade.
|
||||
*/
|
||||
void upgrade_pd_session_quota(Genode::size_t);
|
||||
void upgrade_pd_quota_non_blocking(size_t);
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__BASE__INTERNAL__NATIVE_ENV_H_ */
|
||||
|
@ -12,18 +12,14 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <pd_session/client.h>
|
||||
#include <base/env.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/globals.h>
|
||||
#include <base/internal/native_env.h>
|
||||
|
||||
|
||||
void Genode::upgrade_pd_session_quota(Genode::size_t quota)
|
||||
void Genode::upgrade_pd_quota_non_blocking(size_t quota)
|
||||
{
|
||||
char buf[128];
|
||||
snprintf(buf, sizeof(buf), "ram_quota=%lu", quota);
|
||||
Pd_session_capability cap =
|
||||
*static_cast<Pd_session_client*>(env()->pd_session());
|
||||
env()->parent()->upgrade(cap, buf);
|
||||
internal_env().parent().upgrade(Parent::Env::pd(),
|
||||
String<64>("ram_quota=", quota).string());
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
|
||||
}
|
||||
|
||||
},
|
||||
[&] () { upgrade_pd_session_quota(3*4096); });
|
||||
[&] () { upgrade_pd_quota_non_blocking(3 * 1024 * sizeof(addr_t)); });
|
||||
|
||||
return Rpc_exception_code(utcb.exception_code());
|
||||
}
|
||||
@ -154,7 +154,7 @@ Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &,
|
||||
default: break;
|
||||
}
|
||||
},
|
||||
[&] () { upgrade_pd_session_quota(3*4096); });
|
||||
[&] () { upgrade_pd_quota_non_blocking(3 * 1024 * sizeof(addr_t)); });
|
||||
|
||||
copy_utcb_to_msg(utcb, request_msg);
|
||||
|
||||
|
@ -20,7 +20,9 @@
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/native_utcb.h>
|
||||
#include <base/internal/native_env.h>
|
||||
#include <base/internal/capability_space.h>
|
||||
#include <base/internal/globals.h>
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
@ -63,12 +65,10 @@ void Signal_transmitter::submit(unsigned cnt)
|
||||
Signal_receiver::Signal_receiver()
|
||||
{
|
||||
retry<Pd_session::Out_of_metadata>(
|
||||
[&] () {
|
||||
_cap = env()->pd_session()->alloc_signal_source();
|
||||
},
|
||||
[&] () { _cap = internal_env().pd().alloc_signal_source(); },
|
||||
[&] () {
|
||||
log("upgrading quota donation for PD session");
|
||||
env()->parent()->upgrade(env()->pd_session_cap(), "ram_quota=8K");
|
||||
internal_env().upgrade(Parent::Env::pd(), "ram_quota=8K");
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -104,11 +104,7 @@ Signal_context_capability Signal_receiver::manage(Signal_context * const c)
|
||||
_contexts.insert(&c->_receiver_le);
|
||||
return c->_cap;
|
||||
},
|
||||
[&] () {
|
||||
log("upgrading quota donation for PD session");
|
||||
env()->parent()->upgrade(env()->pd_session_cap(), "ram_quota=8K");
|
||||
}
|
||||
);
|
||||
[&] () { upgrade_pd_quota_non_blocking(1024 * sizeof(addr_t)); });
|
||||
|
||||
return c->_cap;
|
||||
}
|
||||
|
Reference in New Issue
Block a user