Commit Graph

240 Commits

Author SHA1 Message Date
Alexander Boettcher 8c5f350e0e nova: avoid fault during core thread fault dump 2014-05-07 10:37:40 +02:00
Stefan Kalkowski b888a26d57 core: extend core memory allocator
* Allow to translate physical to virtual core addresses and vice versa
* Eliminate race introduced by commit "core: re-design memory allocator"

Ref #723
2014-05-07 10:37:38 +02:00
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 9ae441e469 nova: replacement of generic Genode spinlock
Turn Genode user-level spinlock into a user-level "helpinglock". This requires
support by the kernel introduced with kernel branch r5.

The commit avoids live-locks when multiple threads with SCs on different
priority levels compete for the same user-level Genode "spinlock".

Issue #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 03ce614c23 base: add cpu_session parameter to thread creation
Fixes #1114
2014-04-14 12:32:31 +02:00
Alexander Boettcher 93f06dd11a nova: set invalid affinity space in thread constructor
Otherwise affinity space is set to 1x1 and in cpu_session_component.cc the cpu
session local affinity space defined by parent is not taken because
"Location::valid()" returns true.

Issue #1107
2014-04-14 12:32:30 +02:00
Christian Helmuth cd0d378142 Provide Genode version information in log
Fixes #551
2014-04-01 16:38:49 +02:00
Christian Helmuth 7e35b84054 nova: simplify handling of multi-boot command line
Fixes #1105.
2014-03-31 16:53:14 +02:00
Stefan Kalkowski 0dece91973 core: re-design memory allocator (fix #1091)
* Core_mem_allocator: implement Range_allocator interface
* Core_mem_allocator: allocate with page-granularity only
* Use slab allocators in core where meaningful (e.g. dataspace objects)
2014-03-18 14:24:55 +01:00
Alexander Boettcher d1b0af5eb9 nova: nopcid required for thinkpad x201 2014-02-28 10:11:11 +01:00
Alexander Boettcher 737a3290d9 nova: for clearing a ds it must be ever writable 2014-02-28 10:11:11 +01: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 523791b361 base: generic implementation of Context_allocator
ref #989
2014-02-25 14:58:05 +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
Martin Stein f7149623ca base: rename reload_parent_cap.cc
ref #989
2014-02-25 14:58:04 +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
Christian Helmuth 7e517179c9 Unify stack alignment among all platforms
The alignment is now done in Thread_base::Context. Implementations are
forced to use Context::stack_top(), which aligns the stack top.
2014-01-27 18:54:08 +01:00
Alexander Boettcher 944be1b4e6 nova: throw exception if ram_ds setup fails
Fail hard if no large enough virtual memory area can be found where to map
the memory from the kernel to core.

Additionally clear dataspaces in junks if it can't be done in one large junk.

Fixes #1011
2013-12-20 15:17:33 +01:00
Christian Prochaska 1884e16ecf base-nova: increase page fault handler stack size
When building Genode/NOVA with -O0, the page fault handler thread could
run out of stack.

Fixes #977.
2013-11-26 16:50:52 +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 63d902543b nova: initialize cap_map
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
Alexander Boettcher a6af6c80ab base: count caps replied by a rpc function
Issue #905
2013-11-18 11:01:45 +01:00
Christian Helmuth d65220bcf2 base-nova: Use CROSS_DEV_PREFIX in run environment
Related to #490.
2013-11-06 14:33:33 +01:00
Alexander Boettcher bde7e24820 nova: fix size of virtual address space for 64bit
Fixes #933
2013-11-05 12:18:51 +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 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
Christian Helmuth f763e5ec2a Move main bootstrap to platform-specific object
To prevent multiple execution of main-bootstrap, I moved the code to a
statically initialized object. The reason for this change is that
_main() is exeuted twice when starting dynamic binaries. Now, the object
is part of the base-common library which is linked with ld.lib.so.
2013-09-26 15:00:16 +02:00
Alexander Boettcher ff29f85cc9 nova: speed up cap selector allocation
Issue #485
2013-09-23 14:26:01 +02:00
Alexander Boettcher 1df1611f45 run: support target serial for base-nova
Issue #683
2013-08-22 15:13:12 +02:00
Norman Feske 149356f7ab core: TRACE service interface and implementation 2013-08-15 09:22:47 +02:00