Commit Graph

159 Commits

Author SHA1 Message Date
Norman Feske 149356f7ab core: TRACE service interface and implementation 2013-08-15 09:22:47 +02:00
Norman Feske fe4a6d7d81 base: User-level tracing support 2013-08-14 18:43:19 +02:00
Norman Feske a2b15349fd base: Add tracing support to CPU session interface 2013-08-13 17:27:40 +02:00
Christian Prochaska fd11bd489e base: increase maximum file name length
This patch increases the maximum file name length to support
'qt5_qnitpickerviewwidget.lib.so'.

Issue #345.
2013-08-13 17:08:26 +02:00
Norman Feske 35723d813d core: evaluate CPU session affinity argument 2013-08-13 17:08:25 +02:00
Norman Feske 6d837c9e26 Attach affinity information to session requests
This patch extends the 'Parent::session()' and 'Root::session()'
functions with an additional 'affinity' parameter, which is inteded to
express the preferred affinity of the new session. For CPU sessions
provided by core, the values will be used to select the set of CPUs
assigned to the CPU session. For other services, the session affinity
information can be utilized to optimize the locality of the server
thread with the client. For example, to enable the IRQ session to route
an IRQ to the CPU core on which the corresponding device driver (the IRQ
client) is running.
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 2e58428b51 run: Rpc_entrypoint test running on multiple CPUs
Add run script to autopilot list

Issue #814
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 0079179f05 base: store initial ax and di registers in crt0.s
The values are used by a follow up commit by nova to get the boot CPU number.

Issue #814
2013-08-13 17:08:24 +02:00
Alexander Boettcher fdaeda47bb run: extend affinity test
* read out supported number of CPUs
* start per CPU a thread
* monitor by main thread liveness of remote CPU threads
* add a round variable
* terminate run script after a specific round or after 90s
* on qemu wait 5 rounds, on native runs 40

Add run script to autopilot list

Issue #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 717be91e16 base: deny region creation exceeding size of a ds
The rm_session implementation expects that offset + size must be
part of one dataspace. Unfortunately the parameters are not checked
properly during an rm::attach.

During an detach memory behind the actual region can be unmapped by such
bogus region entries.

Issues #591
2013-08-05 15:15:40 +02:00
Christian Prochaska 09049278a6 Round up RM session size to page granularity
Since RM sessions can be used as dataspaces and dataspace sizes are
supposed to have page granularity, RM session sizes should have page
granularity, too.

Fixes #799.
2013-07-18 11:56:44 +02:00
Josef Söntgen 505f4290ec base: activate Rpc_entrypoint explicitly in dtor
The Rpc_exit call is delivered via RPC which results in a deadlock
if the Rpc_entrypoint has not been started yet. To prevent this
situation we active the Rpc_entrypoint explicitly before we call
Rpc_exit.

Fixes #811.
2013-07-16 12:32:29 +02:00
Christian Prochaska c962240922 crt0 cleanup
- use the generic 'crt0.s' for Linux
- move the read-only '__dso_handle' definition into the '.text' section
- move the '__initial_sp' definition into the '.bss' section
- remove the '_main_utcb' definition

Part of #766.
2013-07-05 12:37:43 +02:00
Martin Stein ee4c98e093 base: provide BSS boundary marks in genode.ld
This enables us to use the generic linker script for
base-hw also.

Ref #766
2013-07-05 12:37:43 +02:00
Josef Söntgen cb76c0c45f core: remove hardcoded 'init' from Log output
Until now the print procedure call in the Log_session_component
did contain a hardcoded 'init' string. Adding a method to filter
the session args to prefix the label and labelling the initial
Cpu_connection for the init-process enabled us to remove the
hardcoded string.

Fixes #789.
2013-07-05 12:37:42 +02:00
Josef Söntgen 136af3764d core: add session args filter to Core_child
Add the filter_session_args() method to Core_child to prefix the labels
of its children.

Fixes #789.
2013-07-05 12:37:42 +02:00
Josef Söntgen 4ba17f7ebd core: use label for init's Cpu_session
Fixes #789.
2013-07-05 12:37:42 +02:00
Stefan Kalkowski 770157fea0 Enable re-use of singleton, but closed IRQ session
Fix #784
2013-06-26 14:27:19 +02:00
Christian Prochaska 4a9b1c6aab base-linux: add ARM support
This patch introduces a new platform 'linux_arm' for building and running
Genode/Linux on an ARM device.

Known limitations:

- libc 'setjmp()'/'longjmp()' doesn't currently save/restore floating
  point registers

Fixes #746.
2013-05-24 14:55:37 +02:00
Norman Feske ddffc8765e core: Be more precise in IO_MEM error message 2013-05-15 20:47:38 +02:00
Christian Prochaska 562ac7d059 64-bit fixes
Fixes #734.
2013-05-10 11:16:12 +02:00
Christian Prochaska ea3adfef9a Create the context area RM session at startup
With this patch, the thread context area RM session gets created at
program startup to have the thread context area's virtual address range
reserved right from the beginning.

Fixes #734.

This patch implies that all Genode processes try to create an RM
session. So a route to the RM service must be present even for processes
that have only a single thread. Hence, the patch contains an update of
affected components.
2013-05-07 21:56:07 +02:00
Norman Feske 09e04d6378 Avoid leakage of signal-source reply capabilities
Issue #717
2013-05-07 21:56:06 +02:00
Martin Stein 028ef7d776 mmio: fix bug in read/write array items
Fix #668
2013-05-06 11:11:04 +02:00
Christian Prochaska 89109cf377 core: preserve more memory
core needs to preserve more memory when built with -O0 for the 64-bit
'linux_x86' platform

Fixes #727.
2013-05-06 11:11:03 +02:00
Martin Stein e9f4e6b37d base: bug in util_mmio.run
Fix #659
2013-04-12 10:52:29 +02:00
Martin Stein ea7ed5947a base: hand over Pd_connection label to Platform_pd
fix: #656
2013-04-08 11:42:24 +02:00
Norman Feske 2bbe840597 core: Handle disappearing managed dataspaces
This patch adds the consideration of suddenly disappearing managed
dataspaces in the 'Rm_session_component::reverse_lookup' function.
Previously, this case resulted in a seamingly valid translation.

Fixes #701
2013-03-27 19:27:24 +01:00
Norman Feske e38983a8fa Simple thread-affinity test 2013-03-21 12:54:02 +01:00
Norman Feske 764a3656a1 cxx: Decouple C++ runtime from 'env()->heap()' 2013-03-21 11:04:56 +01:00
Alexander Boettcher 0c8b996fa4 base: calculate initial junk based on 32/64 host
Issue #666
2013-03-18 13:07:22 +01: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
Norman Feske 352f58b94b core: New utilities for object lifetime management 2013-03-12 21:53:08 +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
Norman Feske 7fef0ba931 base: Increase stack size of signal thread
On foc_pbxa9, the stack size did not suffice within core.
2013-02-25 16:45:50 +01:00
Martin Stein 0f8803245a base: make signal framework usable for base-hw
ref #641
2013-02-22 20:28:28 +01:00
Christian Prochaska 519bed419d core: preserve more memory
core needs to preserve more memory when built with -O0 for the 64-bit
'linux_x86' platform

Fixes #653.
2013-02-20 14:53:42 +01:00
Norman Feske fae63f4fa9 Merge base libraries into a single library
This patch simplifies the way of how Genode's base libraries are
organized. Originally, the base API was implemented in the form of many
small libraries such as 'thread', 'env', 'server', etc. Most of them
used to consist of only a small number of files. Because those libraries
are incorporated in any build, the checking of their inter-dependencies
made the build process more verbose than desired. Also, the number of
libraries and their roles (core only, non-core only, shared by both core
and non-core) were not easy to capture.

Hereby, the base libraries have been reduced to the following few
libraries:

- startup.mk contains the startup code for normal Genode processes.
  On some platform, core is able to use the library as well.
- base-common.mk contains the parts of the base library that are
  identical by core and non-core processes.
- base.mk contains the complete base API implementation for non-core
  processes

Consequently, the 'LIBS' declaration in 'target.mk' files becomes
simpler as well. In the most simple case, only the 'base' library must
be mentioned.

Fixes #18
2013-02-19 14:45:55 +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
Norman Feske b1f63e3356 Turn 'platform_env.h' into a private header
This patch removes 'platform_env.h' from the public API headers because
this header was not part of the API anyway.
2013-02-14 13:23:36 +01:00
Norman Feske 0ed8797df2 Add sanity check to AVL tree, fix #597 2013-02-13 16:01:25 +01:00
Alexander Boettcher 764f8335d0 base: reset _last_applicant variable
Fixes #647
2013-02-11 12:54:04 +01:00
Alexander Boettcher 6c7661ed62 base: fix sporadic context thread area faults
reverts 68156918ee
"base: apply thread.cc fix of foc to base"

Depending on the context area a fixed location is calculated where the
memory for the stack is attached to. If the context area is released before the
detach call, the very same context area can be reused and memory for the new
stack is attached for a new thread. The detach of the old thread would then
revoke the mapping for the new thread which will cause a un-handled page fault.

Issue #549
2013-02-11 12:01:27 +01:00
Norman Feske 9acad80f37 core: support upgrades of init's Env:: sessions 2013-02-11 12:01:27 +01:00
Norman Feske 622959ede4 core: always release Irq_proxy startup lock
Prior this patch the startup lock was not released if the call of
'_associate()' failed. In this condition, the caller of the constructor
was infinitely blocked.
2013-02-11 12:01:27 +01:00
Alexander Boettcher 7868156b19 base: fix deadlock in core_env on base-nova
During a ram_session->free call in 'core' the lock in core_env.h is taken.
Then in the ram_session::_free_ds implementation the dissolve function for the
dataspace is called. base-nova tries to make sure that the ds is not
accessible anymore by any kind of parallel incoming IPC by performing a
cleanup IPC. Unfortunately the dataspace_session implementation uses the very
same allocator in 'core' and may require to obtain the same lock as taken in
ram_session->free. This leads to a spurious deadlock on base-nova.

The actual free_ds implementation is mostly thread safe, since all used objects
inside there are already locked. The only missing piece is the _payload
variable. By changing the _payload variable in a atomic fashion there is no
need to lock the whole ram_session->free call which avoids deadlocks on
base-nova.

Fixes #549
2013-02-11 12:01:26 +01:00
Alexander Boettcher f50d816555 base: fix dangling session pointers in rm_session
If page faults are handled concurrently (as for base-nova) the traverse lookup
call in rm_session_component must be thread safe, which it isn't.
If the faulting area is backed by nested dataspaces which are managed by
various rm_sessions then a race happens under following circumstances
(triggered occasionally by the bomb test).

The traverse lookup may return a pointer to a rm_session of a nested dataspace.
If the rm_session is in parallel subject to destruction it happened that faults
got enqueued to the faulters list of the deleted rm_session and internally to
a list of the current rm_session of the Rm_client.

During destruction of the faulting Rm_client the associated rm_session will
be dissolved from the Rm_client, which leads to dereferencing the
dangling pointer of the already destructed rm_session.

On base-nova the memory of the rm_session object get unmapped eventually, so
that the de-referencing of the dangling pointer caused page faults in core.

The memory on other kernels inside core never get unmapped so that the
bug doesn't trigger visible faults.

The patch replace the keeping of a rm_session pointer by keeping a
capability instead. The rm_session object must be looked up now explicitly in
the Object_pool implementation, which implements proper reference counting on
the rm_session object.

Issue #549
2013-02-11 12:01:26 +01:00