Commit Graph

17 Commits

Author SHA1 Message Date
Norman Feske 5fe29e8e4a Express affinities via Cartesian coordinates
This patch introduces new types for expressing CPU affinities. Instead
of dealing with physical CPU numbers, affinities are expressed as
rectangles in a grid of virtual CPU nodes. This clears the way to
conveniently assign sets of adjacent CPUs to subsystems, each of them
managing their respective viewport of the coordinate space.

By using 2D Cartesian coordinates, the locality of CPU nodes can be
modeled for different topologies such as SMP (simple Nx1 grid), grids of
NUMA nodes, or ring topologies.
2013-08-13 17:08:24 +02:00
Alexander Boettcher 4ae1faf14d base: add affinity support to pager construction
Propagating the affinity information is needed to allow for assigning
a pager thread that is local to the CPU of the to-be-created thread.

issue #814
2013-08-13 17:08:23 +02:00
Norman Feske 21de42c45d core: Introduce 'Address_space' interface
The new core-internal 'Address_space' interface enables cores RM service
to flush mappings of a PD in which a given 'Rm_client' thread resides.
Prior this patch, each platform invented their own way to flush mappings
in the respective 'rm_session_support.cc' implementation. However, those
implementations used to deal poorly with some corner cases. In
particular, if a PD session was destroyed prior a RM session, the RM
session would try to use no longer existing PD session. The new
'Address_space' uses the just added weak-pointer mechanism to deal with
this issue.

Furthermore, the generic 'Rm_session_component::detach' function has
been improved to avoid duplicated unmap operations for platforms that
implement the 'Address_space' interface. Therefore, it is related to
issue #595. Right now, this is OKL4 only, but other platforms will follow.
2013-03-12 21:53:08 +01:00
Alexander Boettcher 5380c09c6f nova: construct pager name out of client name
Ease debugging to find out which client is dying actually.
2013-02-21 11:52:02 +01:00
Norman Feske 73ab30c22c Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
Martin Stein 05f5999e71 cpu_session: Access thread state by value 2012-11-23 12:20:22 +01:00
Norman Feske 83bdfea9b0 Extend Cpu_session with thread-affinity API
This patch introduces the functions 'affinity' and 'num_cpus' to the CPU
session interface. The interface extension will allow the assignment of
individual threads to CPUs. At this point, it is just a stub with no
actual platform support.
2012-09-05 10:25:04 +02:00
Alexander Boettcher aae3ce348e NOVA: add single-step support used by gdb
Fixes #336
2012-08-30 10:42:38 +02:00
Alexander Boettcher fcd62729d4 NOVA: tunnel thread start parameters via state()
The cpu_session interface fails to be virtualized by gdb_monitor because
platform-nova uses an extended nova_cpu_session interface.

The problem was that threads have been created directly at core without
knowledge of gdb_monitor. This lead to the situation that gdb_monitor didn't
know of all threads to be debugged.

Tunnel the additional parameters required on base-nova through the state()
call of the cpu_session interface before the thread actual is started.
2012-08-30 10:42:26 +02:00
Alexander Boettcher 841a1fd579 NOVA: extend cpu_session with synchronous pause
The kernel provides a "recall" feature issued on threads to force a thread into
an exception. In the exception the current state of the thread can be obtained
and its execution can be halted/paused.

However, the recall exception is only delivered when the next time the thread
would leave the kernel. That means the delivery is asynchronous and Genode has
to wait until the exception triggered.

Waiting for the exception can either be done in the cpu_session service or
outside the service in the protection domain of the caller.

It turned out that waiting inside the cpu_service is prone to deadlock the
system. The cpu_session interface is one of many session interfaces handled by
the same thread inside Core.

Deadlock situation:
* The caller (thread_c) to pause some thread_p manages to establish the call
  to the cpu_session thread_s of Core but get be interrupted before issuing
  the actual pause (recall) command.
* Now the - to be recalled thread_p - is scheduled and tries to invoke another
  service of Core, like making log output.
* Since the Core thread_s is handling the session request of thread_c, the
  kernel uses the timeslice of thread_p to help to finish the request handled
  by thread_s.
* Thread_s issues the actual pause/recall on thread_p and blocks inside Core
  to wait for the recall exception to be issued.
* thread_p will leave not the kernel before finishing it actual IPC with
  thread_s which is blocked waiting for thread_p.

That is the reason why the waiting/blocking for the recall exception taking
place must be done on NOVA in the context of the caller (thread_1).

Introduce a pause_sync call to the cpu_session which returns a semaphore
capability to the caller. The caller blocks on the semaphore and is woken up
when the pager of thread_p receives the recall exception with the state of
thread_p.
2012-08-30 10:40:00 +02:00
Alexander Boettcher f68482f87a NOVA: add support to cpu_session to create vCPUs
Extend base-nova specific cpu_session to create also vCPUs.
2012-08-09 11:09:42 +02:00
Alexander Boettcher 650a1d47f0 NOVA: Throughly cleanup caps in case of errors 2012-08-09 11:09:42 +02:00
Alexander Boettcher 9c57fd7229 NOVA: delegate EC cap solely with recall right
Vancouver recalls the vCPU in the vCPU dispatcher code. Enable the right bit
in the mapped native cap so that Vancouver actually is able to perform this
operation.
2012-08-09 11:09:41 +02:00
Alexander Boettcher 0a89d8dbb4 NOVA: extend cpu_session for base-nova 2012-08-09 11:09:40 +02:00
Martin Stein 9369057f90 Extend RAM/CPU session for base-hw context-areas. 2012-08-02 16:41:21 +02:00
Norman Feske 08ce32215d Bump year in copyright headers to 2012 2012-01-03 15:35:05 +01:00
Genode Labs da4e1feaa5 Imported Genode release 11.11 2011-12-22 16:19:25 +01:00