Commit Graph

106 Commits

Author SHA1 Message Date
Alexander Boettcher
512c29c486 nova: mtd fields are unsigned
Bit 31 (FPU Mtd) got negative expanded when combined with 64bit value.

Detected during work on #1129
2014-05-07 10:37:37 +02:00
Alexander Boettcher
a7bc8bac9a nova: support usage of priorities in Genode/Nova
Enables finally the usage of priorities on base-nova.

Fixes #986
2014-04-16 17:30:31 +02:00
Alexander Boettcher
bfa3053e62 nova: set pager and native ec cap for main thread
Prerequisite for follow up commit regarding base-nova specific Genode Spinlock
replacement.

Issue #986
2014-04-16 17:30:30 +02:00
Alexander Boettcher
ecaf09a41b nova: extent ec_ctrl in kernel and base-nova
The commit switches the kernel branch to r5 and updates the syscall bindings
in base-nova accordingly. Beside some cleanups, r5 extents the ec_ctrl syscall
to support following features:

* An EC may yield its current timeslice. The timeslice gets enqueued at the end
  of the run queue without refreshing the left budget of the quantum.
* An EC helps with the current SC another EC. Used in Genode to implement
  helping over a user-level lock to avoid live-lock situation. (Think of
  a limited priority-inheritance mechanism.)
* An EC requests a new scheduler decision. Used in Genode to transfer back the
  potentially helping SC to the helper EC.

Issue #986
2014-04-14 12:32:31 +02:00
Alexander Boettcher
f69b206593 nova: fix utcb layout for 32bit
Makes virtualbox as 32bit VMM working
2014-02-28 10:11:11 +01:00
Alexander Boettcher
dd95266235 nova: add feature to yield a thread
used by virtualbox intensively
2014-02-28 10:11:11 +01:00
Alexander Boettcher
39a7ffd233 nova: use kernel branch with vCPU fpu support
branch r4 based on latest vanilla kernel of @udosteinberg
2014-02-28 10:11:11 +01:00
Alexander Boettcher
fa23c0bd4f nova: update syscall bindings 2014-02-28 10:11:11 +01:00
Alexander Boettcher
8c7cadde5f nova: support noreturn attribute for syscall reply 2014-02-28 10:11:10 +01:00
Martin Stein
0b64328944 base: setup thread object for main thread in CRT0
For a main thread a thread object is created by the CRT0 before _main gets
called so that _main can already run in a generic environment that, e.g.,
catches stack overflows as a page-fault instead of corrupting the BSS.
Additionally dynamic programs have only one CRT0 - the one of the LDSO -
which does the initialization for both LDSO and program.

ref #989
2014-02-25 14:58:05 +01:00
Stefan Kalkowski
5447c406e5 thread: rearrange thread context management
Use a bit allocator for the allocation management of thread contexts,
instead of holding allocation information within the Thread_base objects,
which lead to race conditions in the past.

Moreover, extend the Thread_base class interface with the ability to
to add additional stacks to a thread, and associate the context they're
located in with the corresponding Thread_base object. Additional stacks
can be used to do user-level scheduling with stack switching, without breaking
Genode's API.

Fixes #1024
Fixes #1036
2014-01-27 18:54:09 +01:00
Stefan Kalkowski
66c5887bd3 Move Bit_allocator from base-nova to base
Change the template parameter for Bit_allocator, and Bit_array. Instead of
assigning words to be used by the bit array, you can now tell the count of
items that shall be used.

Moreover, some dead code, previously using the Bit_allocator, was removed.

Related to #1024
2014-01-27 18:54:09 +01:00
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
75ecdab9e8 nova: add inc/dec to native_types.h
Issue #905
2013-11-18 11:01:45 +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
Christian Prochaska
cc04ffcf42 GDB monitor: find out page faulting thread
Fixes #898.
2013-10-25 23:49:00 +02:00
Alexander Boettcher
73cff5c996 nova: don't wait for workers in cpu_session::pause
If a local thread is attempted to be 'pause'd via cpu_session, don't wait
until it gets into the recalled state. If the caller is lucky it is, if not
return only the stack pointer.

Avoids deadlocking of the gdb when attached to a process running a server.

Issue #478
2013-10-16 09:26:09 +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
2c983f3c89 nova: remove native_cap method from cpu_session
Remove native_cap method which caused the cpu_session implementation of the
gdb server to fail.

Issue #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
Norman Feske
a2b15349fd base: Add tracing support to CPU session interface 2013-08-13 17:27:40 +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
70d0b00dde nova: update to kernel revision r3
r3 contains the recent Nova upstream kernel version plus the Genode specific
extensions and changes as known from r2.

Additionally, the r3 branch

* contains the assign_pci patch now directly,
* adds support for cross CPU IPC,
* fixes some issues with freeing up kernel memory part of r2 and
* update the documentation a bit.

Fixes #814
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
Alexander Boettcher
1a82b664ef nova: determine number of CPUs
Issue #813
2013-08-13 17:08:23 +02:00
Norman Feske
6f294eddc2 Fix warning about initializer of 'Local_addr'
Fixes #726
2013-05-06 11:11:03 +02: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
46447d531e nova: add syscall pt_ctrl bindings
Issue #667
2013-02-25 16:45:49 +01:00
Alexander Boettcher
c36f6a04a7 nova: extend pd_session by assign_pci function 2013-02-21 11:52:02 +01:00
Alexander Boettcher
250f7b1570 nova: update syscall assign_gsi/_pci for 32/64 bit 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
1c2f76cd2a nova: add support to specify dma mapping flag 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
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
f762e8e4fd nova: increase number of available cap indexes
Noux test requires some more indexes. We don't free all up because of a missing
reference counting implementation of indexes in base-nova.

Issue #394
2013-02-11 12:01:25 +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
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
fa2cbdc7cb Fix: don't deference stale pager pointer in core
Reset pager pointer in platform_thread if pager object is removed.

Fixes #532
2012-11-29 13:44:07 +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
Norman Feske
f2e47ef9f4 Whitespace 2012-11-26 09:45:13 +01:00
Martin Stein
05f5999e71 cpu_session: Access thread state by value 2012-11-23 12:20:22 +01:00