Commit Graph

95 Commits

Author SHA1 Message Date
Alexander Boettcher
67c1ad4cdd nova: support creation of vCPU in own PD
With the patch a VMM is not forced anymore to co-located the VMM and VM in same
PD.

Fixes #949
2013-11-25 12:12:31 +01:00
Alexander Boettcher
0d8abab3ee nova: remove cap_sel - use cap_map
Fixes #905
2013-11-18 11:01:46 +01:00
Alexander Boettcher
c139253439 nova: use cap_map for IPC
Issue #905
2013-11-18 11:01:46 +01:00
Alexander Boettcher
f330b55227 nova: introduce cap_map
to be used for ref counting of Native_capabilities

* similar as used for base-foc
* will replace nova specific cap_sel_allocator interface

Issue #905
2013-11-18 11:01:45 +01:00
Alexander Boettcher
1dd2a199a5 nova: support cap receive window of various sizes
Open a capability receive window according to the number of the capabilities
expected as out parameter per RPC function.

Typically the number of capabilities expected during the reply of a RPC/IPC
call is 0 to 1. Before this patch ever a capability receive window of 4 has
been opened.

On Nova the capability selectors of receive windows must be naturally aligned
to the size/order of the expected capabilities. This leads until now to the
issue that the left over 3 capabilities couldn't be reused for new IPCs since
they are not naturally aligned to 4.

Issue #905
2013-11-18 11:01:45 +01:00
Alexander Boettcher
a6af6c80ab base: count caps replied by a rpc function
Issue #905
2013-11-18 11:01:45 +01:00
Alexander Boettcher
59cb7d9263 nova: show error message for un-handled exception
Fixes #938
2013-11-05 12:00:18 +01:00
Christian Prochaska
cc04ffcf42 GDB monitor: find out page faulting thread
Fixes #898.
2013-10-25 23:49:00 +02:00
Alexander Boettcher
fe19103546 nova: create sm for signalling via pager
The 'pause' call on base-nova assumes that a thread can solely block in its
associated semaphore. Main reason is that so core can unblock a thread in order
that the recall exception gets delivered and the register state can be
obtained.

Unfortunately the signal session implementation creates a semaphore, which is
unknown by the pager code. Instead create the semaphore via the pager of the
thread, so that the pager can unblock the signal thread when a pause is issued.

Issue #478
2013-10-16 09:26:09 +02:00
Alexander Boettcher
816b4e0479 nova: fix thread in page fault and getting paused
If a thread caused a page fault and later on get be paused, then it left
the recall handler immediately due to the pause call instead of staying
in this handler.

Add some (complicated) state machine to detect and handle the case. Still not
waterproof, especially server threads may never get recalled if they never get
a IPC from the outside.

Fixes #478
2013-10-16 09:26:09 +02:00
Alexander Boettcher
dd2e006309 nova: request native ec cap via pager
Prerequisite to get rid of the base-nova special native_cap method in
cpu_session.

Vancouver/Seoul bootstrap code gets also much simpler.

Issue #478
2013-10-16 09:26:09 +02:00
Alexander Boettcher
d3bcafc4c6 nova: support requesting multiple event portals
Enables us to request the exception handler portals at once instead each
separately.

Issue #478
2013-10-16 09:26:09 +02:00
Alexander Boettcher
c426bac8bb nova: create sm of each thread in pager
Mainly simplification of the code and getting rid of reserved (Genode) special
cap selectors in the syscall-generic.h file.

Issue #478
2013-10-16 09:26:09 +02:00
Alexander Boettcher
ff29f85cc9 nova: speed up cap selector allocation
Issue #485
2013-09-23 14:26:01 +02:00
Alexander Boettcher
f1af8e371d nova: unify code for normal and server threads 2013-08-13 17:08:25 +02:00
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
9e8255948d base: add affinity to rpc_entrypoint constructor
Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher
0e83b0b093 nova: create core threads on boot cpu
The boot CPU is not necessarily 0 as currently assumed for base-nova.
Replace all hard coded values by the actual boot cpu number.

Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher
4e47cd2568 nova: catch exception when leaving thread::entry()
Catch exceptions and try to make a printf. If this also fails, catch
it and die causing some noise output in core to detect the situation.
2013-08-13 17:08:23 +02:00
Alexander Boettcher
8655b58953 nova: show client name for unhandled page faults
This patch eases debugging.
2013-08-13 17:08:23 +02:00
Alexander Boettcher
4e2e79bf4f nova: create pager/server thread on specific cpus
issue #814
2013-08-13 17:08:23 +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
Alexander Boettcher
8f204ffd26 nova: improve page fault debugging messages
Ease debugging.

Fixes #674
2013-03-08 12:15:02 +01:00
Alexander Boettcher
974c5442c6 nova: don't try to prepare UTCB in case of vCPU
vCPU has no UTCB.

Fixes #673
2013-02-27 16:47:21 +01:00
Christian Prochaska
a99193ad90 Rework the internal lock interface
With this patch, the 'futex' syscall gets used for blocking and unblocking
of threads in the Linux-specific lock implementation.

The 'Native_thread_id' type, which was previously used in the
lock-internal 'Applicant' class to identify a thread to be woken up,
was not suitable anymore for implementing this change. With this patch,
the 'Thread_base*' type gets used instead, which also has the positive
effect of making the public 'cancelable_lock.h' header file
platform-independent.

Fixes #646.
2013-02-25 22:14:21 +01:00
Alexander Boettcher
801d09f166 nova: revoke set portal id right
Revoke the right to set the portal id (aka label) when it is not needed
anymore. Otherwise everybody in the system having a mapping of the portal can
reset the label to something we don't expect.

Issue #667
2013-02-25 16:45:50 +01:00
Alexander Boettcher
467eec731f nova: set default receive and translate windows 2013-02-21 11:52:02 +01:00
Alexander Boettcher
ff062f24ff nova: map write_combined ds as dma able 2013-02-21 11:52:02 +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
bcdc706f42 Unify 'ipc.h' and 'ipc_generic.h' across platforms
The distinction between 'ipc.h' and 'ipc_generic.h' is no more. The only
use case for platform-specific extensions of the IPC support was the
marshalling of capabilities. However, this case is accommodated by a
function interface ('_marshal_capability', '_unmarshal_capability'). By
moving the implementation of these functions from the headers into the
respective ipc libraries, we can abandon the platform-specific 'ipc.h'
headers.
2013-02-14 13:23:37 +01:00
Alexander Boettcher
ee8eea9330 nova: fix lock guard usage in cap selector
Issue #549
2013-02-11 12:11:48 +01:00
Alexander Boettcher
64dbe08359 nova: kill thread with no pager where recall fails
Issue #549
2013-02-11 12:01:27 +01:00
Alexander Boettcher
edd30b56a2 nova: fix pager cleanup handling
The cleanup call must be performed already during the _dissolve function
shortly after the object at the cap_session is freed up. Otherwise there
is the chance that an in-flight IPC will find the to be dissolved function
again.

Bomb test triggered the case, that a already dissolved rpc_object was found
by a in-flight IPC. If the rpc_object was already freed up by alloc->destroy
the thread using this stale rpc_object pointer cause page-faults in core.

Fixes partly #549
2013-02-11 12:01:26 +01:00
Alexander Boettcher
28f7cf5dc2 nova: fix cleanup handling in server object
As first step the rpc object must be freed up so that the kernel object
(portal) vanishes. Then the object must be removed from the internal object
pool list so that the object can't be obtained anymore. And then the cleanup
call can be performed (_leave_server_object) since now all names to the
rpc_object are gone.

Doing it in different order (as before the commit) there is a very very little
chance (but the bomb test triggers it occasionally) that the rpc_object can be
obtained again by an incoming IPC - even it is already scheduled for removal.

Fixes partly #549
2013-02-11 12:01:26 +01:00
Alexander Boettcher
9453d319cb base: add remove_client to rm_session
Fixes #13
2013-02-11 12:01:25 +01:00
Alexander Boettcher
486b27a1b8 nova: ease debugging if no cap indexes are left
If we ran out of capabilities indexes, the bit allocator throws an exception.
If this happens the code seems to hang and nothing happens.

Instead one could catch the exception and print some diagnostic message.
This would be nice, but don't work. Printing some diagnostic message itself
tries to do potentially IPC and will allocate new capability indexes at
least for the receive window.

So, catch the exception and let the thread die, so at least the instruction
pointer is left as trace to identify the reason of the trouble.

Fixes #625
2013-01-24 11:09:15 +01:00
Alexander Boettcher
e817163f1a nova: use lock guard instead of explicit calls
If an exception is thrown the lock is released automatically, so that
other callers may get a capability index if in between some are freed. Fixes
some deadlocks if Genode is short on capability indexes.

Related to #625
2013-01-24 11:05:41 +01:00
Alexander Boettcher
6cc0d69aa7 nova: recall thread if exception can't be resolved
Recall faulting thread and block pager thread. The pager get resumed as soon
as the fault gets resolved by the rm_session (or never ever).

Fixes #621
2013-01-21 11:40:38 +01:00
Norman Feske
8fe0c6c91c base-nova: Coding style 2013-01-11 23:11:07 +01:00
Norman Feske
73ab30c22c Update copyright headers to 2013 2013-01-10 21:44:47 +01:00
Alexander Boettcher
c2d3543e62 base: replace obj_by_* by lookup_and_lock
Add functionality to lookup an object and lock it. Additional the case is
handled that a object may be already in-destruction and the lookup will deny
returning the object.

The object_pool generalize the lookup and lock functionality of the rpc_server
and serve as base for following up patches to fix dangling pointer issues.
2013-01-10 11:13:13 +01:00
Alexander Boettcher
cef9af1978 nova: set page fault handler for core threads
Ease debugging if a core thread fail.
2012-12-21 14:54:20 +01:00
Alexander Boettcher
727f29f2e9 Remove obsolete cap selector lock
We can use the Genode::Lock abstraction instead of a separate native SM cap.
2012-11-27 10:56:05 +01:00
Alexander Boettcher
4d12464cee Read BIOS data area (BDA) to get serial I/O ports
If the I/O ports are non default (3f8), we had to specify manually the correct
I/O ports. With this commit the BDA is read and the I/O port of the first
serial interface (COM) is taken. If no serial interface is available no device
configuration will be undertaken.
2012-11-23 12:20:27 +01:00
Martin Stein
05f5999e71 cpu_session: Access thread state by value 2012-11-23 12:20:22 +01:00
Norman Feske
bcabbe2c92 Add 'Thread_base::join()'
Using the new 'join()' function, the caller can explicitly block for the
completion of the thread's 'entry()' function. The test case for this
feature can be found at 'os/src/test/thread_join'. For hybrid
Linux/Genode programs, the 'Thread_base::join()' does not map directly
to 'pthread_join'. The latter function gets already called by the
destructor of 'Thread_base'. According to the documentation, subsequent
calls of 'pthread_join' for one thread may result in undefined behaviour.
So we use a 'Genode::Lock' on this platform, which is in line with the
other platforms.

Related to #194, #501
2012-11-19 12:43:34 +01:00
Christian Helmuth
d23ee02e9a Destruct IPC-server object on entrypoint destruction
The IPC-server object exists solely on the stack of the entrypoint
thread and, therefore, would never be destructed as the thread is just
killed. Now, the object is explicitly destructed in the entrypoint
destructor. An alternative solution could instruct the entrypoint thread
the terminate, which would automatically cleanup its stack.

The object pool is assumed to be empty on destruction of the entrypoint.
If not, we warn and at least dissolve all RPC objects.
2012-11-16 13:55:00 +01:00
Alexander Boettcher
83039267fa Cleanup: remove 'first' and 'next' of cpu_session
Fixes #10
2012-10-24 11:34:38 +02:00
Norman Feske
8b0ad007ca Fix warning 2012-10-12 13:10:48 +02:00
Sebastian Sumpf
4a3d852b65 Core: Shared IRQ support for Nova/FOC/OKL4
Implement shared IRQs using 'Irq_proxy' class.

Nova: Added global worker 'Irq_thread' support in core and adapted Irq_session.

FOC: Adapted IRQ session code, x86 has shared IRQ support, ARM uses the old
model. Read and set 'mode' argument (from MADT) in 'Irq_session'.

OKL4: Use generic 'Irq_proxy'

Fixes issue #390
2012-10-11 17:10:16 +02:00