Commit Graph

522 Commits

Author SHA1 Message Date
Alexander Boettcher
1a94338389 trace: support to request subject infos batched
Optimize requesting the Subject_infos from O(n) to O(1) RPC call.

Issue #3610
2020-04-28 08:57:57 +02:00
Norman Feske
6f6340644b Hide binary_ready_hook_for_platform from public
The hook is meant to be internal to the framework. So better keep its
declaration in the framework-internal globals.h header.

Issue #3581
2020-04-24 14:37:47 +02:00
Norman Feske
b134867f31 Remove Rpc_entrypoint::Native_context
This patch largely reverts the commit "base: lay groundwork for
base-linux caps change" because the use of 'epoll' instead of 'select'
alleviated the need to allocate large FD sets, which motivated the
introduction of the 'Native_context' hook.

Related to issue #3581
2020-04-21 16:50:37 +02:00
Tomasz Gajewski
870d348d77 trace: redirect logs to trace based on policy
If trace is enabled for component than an attempt to put message into
trace buffer is performed using log_output policy. If it succeeds than
message is not put to logs using log service.

Fixes #3714
2020-04-17 12:47:48 +02:00
Christian Helmuth
c783764d0b Region-map attach/detach stress depot_autopilot test
Issue #3715
2020-04-17 12:40:13 +02:00
Alexander Boettcher
3956530634 base: use Mutex/Blockade
Issue #3612
2020-04-17 12:40:12 +02:00
Alexander Boettcher
e87d60ddf7 core: use Mutex/Blockade
Issue #3612
2020-04-17 12:40:12 +02:00
Christian Helmuth
e63c5e6c69 base: rework interplay of signal-proxy and entrypoint
The former scheme left open a race window between
_process_incoming_signals() and wait_and_dispatch_one_io_signal()
resulting in both threads calling block_for_signal() and blocking
forever with one unprocessed signal.

Fixes #3704
2020-04-17 12:39:32 +02:00
Christian Helmuth
69080014b0 depot_autopilot: test case for entrypoint
Test for entrypoint destruction and signalling.

Issue #3704
2020-04-17 12:39:32 +02:00
Norman Feske
685bd763f9 ldso: place dynamic allocations within linker area
This is needed to execute the tool-chain scenario on base-nova.
Otherwise, the fork mechanism stumbles upon a region conflict
between ldso allocations and the application heap.

Fixes #3706
2020-03-26 11:38:59 +01:00
Josef Söntgen
f3ec246b67 base: remove diagnostic message in destructor
The LOG message in the Signal_handler_thread's destructor is just an
diagnostic leftover.

Fixes #3666.
2020-02-27 14:46:59 +01:00
Alexander Boettcher
accda1211b mutex: reinit Applicant state in Mutex::acquire()
The applicant_to_wake_up() member must be initialized to 0 to keep the
same semantic as before the change by

"base: add mutex as derivate of lock"

Issue #3662
2020-02-27 14:46:59 +01:00
Stefan Thöni
a7a9855493 base: lay groundwork for base-linux caps change
Include the necessary hooks to introduce file descriptor
based capabilities in base linux.

Issue #3581
2020-02-27 14:46:58 +01:00
Alexander Boettcher
2afc218767 test/registry: measure time used for iteration
Issue #3612
2020-02-20 12:11:22 +01:00
Alexander Boettcher
5bbaa30655 base: use mutex in registry
Issue #3612
2020-02-20 12:11:22 +01:00
Alexander Boettcher
5440cd4b50 base: use blockade in thread
Issue #3612
2020-02-20 12:11:22 +01:00
Alexander Boettcher
2bd77722c7 base: use mutex in heap
Issue #3612
2020-02-20 12:11:22 +01:00
Alexander Boettcher
00f69bc70d base: add mutex as derivate of lock
The mutex class is more restrictive in usage compared to
Genode::Lock.

- At initialiation time it is ever unlocked.
- No thread is permitted to lock twice. Warn about it
  in case it happens.
- Only the lock onwer is permitted to unlock the mutex.
  Warn about it and don't unlock the mutex in case it happens.

Issue #3612
2020-02-20 12:11:22 +01:00
Stefan Kalkowski
79fba6c2ac core: add kernel-specific UTCB quota bookkeeping
Fix #859
2020-02-20 12:11:21 +01:00
bbdf181828 core: add support for unlabeled LOG sessions
If the root child requests a LOG service with the label "unlabeled" then
return a LOG session that logs unprefixed messages. This allows a external
test controller to recognize log messages produced by a blessed component.
2020-02-20 12:08:17 +01:00
Alexander Boettcher
646d6c368c core: fixup cpu weight on failed thread creation
Fixes #3613
2020-02-07 14:14:20 +01:00
Alexander Boettcher
5b633a83df core: dissolve thread object on failed creation
Fixes #3596
2020-02-04 15:51:08 +01:00
Norman Feske
9ec66f0594 allocator_avl: simplify structure
This patch changes the code of '_alloc_two_blocks_metadata' to not
leak the result of a partial allocation in the out parameters of
the method. This eases the reasoning about the absence of a
use-atfer-free problem (there was none).
2020-02-04 15:51:08 +01:00
Norman Feske
6947bddd3f base: avoid use of memcpy 2020-02-04 15:51:08 +01:00
Norman Feske
37ec636018 test/smp: add missing destruct call 2020-02-04 15:51:08 +01:00
Norman Feske
bbfc092a31 core: avoid use of C array as buffer in Log_root 2020-01-03 14:44:15 +01:00
Norman Feske
de52cf1cdd core: check return value of map.metadata
Even though the call of map.metadata is known to always return a valid
pointer (because the meta data is assigned in the code just above),
better add an explicit nullptr check.
2020-01-03 14:44:15 +01:00
Norman Feske
6ae98e2e6d base: mark Parent::Close_result with [[nodiscard]] 2020-01-03 14:44:15 +01:00
Norman Feske
ffc099eb54 cxx: add nullptr check in calloc
Even though malloc via the cxx_heap never fails, the implementation of
calloc should better not rely on this assumption.
2020-01-03 14:44:15 +01:00
Alexander Boettcher
1c361bf545 base: add test to destruct entrypoint
Issue #1921
2019-12-20 11:31:27 +01:00
Alexander Boettcher
bcb7f45201 core: avoid dangling ptr in cpu thread component
if exception is triggered during construction of a thread
2019-12-19 17:01:42 +01:00
Sebastian Sumpf
22d4d5c1c1 ldso: update link map during respawn
move binary to front of link map after respawn. This is required by GDB
in order to load symbol files correctly.

issue #3481
2019-12-19 17:01:42 +01:00
Norman Feske
e8878eee8a ldso: increase initial heap block
This is needed to enable the fork of 'make' in the genodians.org
scenario on NOVA.

Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
3897ddea03 cxx: don't rely on global ctors
This patch removes the global variable 'blocker', which was expected to
be constructed via the global ctors. This mechanism, however, is not
used for the base library, which resulted in the use of an unconstructed
object. Specifically, the spinlock of the 'Lock' of the 'Registry'
defaulted to the LOCKED state (value 0), which eventually would lead to
a deadlock in the contention case of the cxa guard.

I could observe this deadlock once on during the component startup on
base-linux during the construction of the 'startup_lock'.

This patch fixes the problem by explicitly initializing the registry
of blockers via an init function.

Issue #2299
Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
6858270517 base: disarm atexit handling for signal thread
The signal thread is not supposed to be destructed in any scenario other
than the noux fork mechanism (where no signals occur).

Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
4e57b6eceb core: fix destruction of dependent CPU sessions
Issue #3578
2019-12-19 17:00:48 +01:00
Norman Feske
298f317f44 core: remove quota-related diagnostic messages
Issue #3578
2019-12-19 17:00:48 +01:00
Stefan Kalkowski
f82714f341 vm_session: return vcpu id when creating vcpu
Ref #3553
2019-11-21 14:29:36 +01:00
Stefan Kalkowski
18dbd75860 base: explictly target entrypoint in timer session
Fix #3548
2019-11-21 14:29:36 +01:00
Sebastian Sumpf
54643d6878 base: add entry to .dynanmic section in genode_dyn.ld
Make sure that at least entry is present in the .dynamic section, so the
PT_DYNAMIC segment points to something valid in case there are no
dynamic symbols.

issue #3537
2019-11-19 14:45:40 +01:00
Alexander Boettcher
1297a8fb57 trace: skip subject_id 0 in subject id allocator
Issue #3510
2019-11-19 14:23:55 +01:00
Christian Prochaska
5c25e0bdb0 heap: fix typo in alloc(0) diagnostic message
Fixes #3501
2019-11-19 14:19:34 +01:00
Norman Feske
697d496093 ldso: don't strip leading path from ROM name
This patch removes ldso's builtin policy of removing any path elements
prepending the ROM module name. Instead, the ROM name is used as is.
This clears the way to access different ROM modules that share the same
name but are stored at different directories behind an fs_rom (e.g.,
/bin/bash vs. /usr/local/bin/bash).

Issue #3500
2019-11-19 14:17:29 +01:00
Norman Feske
efe7f5172d ldso: prevent premature execution of ctors
Fixes #3487
2019-09-20 14:16:05 +02:00
Christian Helmuth
08aa7d310a Increase stack size in thread test for arm_v8a
It seems throwing an exception on arm_v8a needs a significant amount of
stack space (> 2048 bytes).
2019-09-03 12:12:46 +02:00
Christian Prochaska
ab017607a2 tool chain: TLS support
Fixes #3418
2019-09-02 16:29:33 +02:00
Norman Feske
66d5359d75 ldso: heuristics for libs needed during execve
The allocation of regions within the linker area is normally left to the
best-fit 'Allocator_avl', which happens to populate the linker area
starting with the binary followed by all loaded libraried with no gaps
in between.

When replacing the binary during execve, however, we need to ensure that
the new binary does not conflict with any library that stays resident
during execve. This patch tweaks the linker's region allocation scheme
such that these libraries are placed at the end of the linker area.

Issue #3481
2019-08-28 14:18:45 +02:00
Norman Feske
fa48054959 ldso: Dynamic_linker::respawn mechanism
This patch extends the interface of the dynamic linker with the ability
to replace the running binary executable by another one. It is
designated for the implementation of execve. The interface consists of
two new functions.

'Dynamic_linker::keep' marks the specified shared object as unloadable.
This can be used to pin a set of libraries (i.e., the libc) within the
local address space while replacing the binary and other higher-level
libraries.

'Dynamic_linker::respawn' unloads the current binary, loads the one
specifed as first argument, and looks up the entry point symbol of the
new binary, which would be "main" for POSIX programs.

In addition to implementing the new interface, the patch adjusts the
linker at various places that previously assumed the binary to be
constant over runtime.

Issue #3481
2019-08-28 14:18:45 +02:00
Norman Feske
3c6fe6e741 ldso: statically allocate initial heap block
This patch enables the fork.run script to run on base-linux. It should
be regarded as an interim solution, however, because the randomization
performed by the Linux kernel may still - by chance - produce a
situation where one of the libc's malloc heap regions intersects with
another dataspace dynamically attached to the child.

The better solution would be to make the 'Region_map_mmap'
implementation not depend on the kernel's allocation policy by using a
locally implemented allocator.

Issue #3478
2019-08-28 14:18:45 +02:00
Norman Feske
2cff12e1fb base: remove debug message 2019-08-28 14:18:44 +02:00