Commit Graph

975 Commits

Author SHA1 Message Date
Christian Helmuth b2c59576ae depot: update recipe hashes 2019-08-28 14:36:56 +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 a98f78afd9 ldso: avoid 'dd' output in build log
This patch is a follow-up commit for "ld: load dynamic linker at static
address on Linux". It suppresses the stderr output of 'dd' when marking
the ELF binary as executable.

Issue #3479
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 354e310c87 heap: interface for obtaining backing-store info
The new 'Heap::for_each_region' method provides information about the
heap's used virtual-memory regions. This method allows for the
mirroring of the heap state as needed by 'fork'.

Issue #3478
2019-08-28 14:18:44 +02:00
Norman Feske 2cff12e1fb base: remove debug message 2019-08-28 14:18:44 +02:00
Norman Feske 55e99e16ef base: add missing include in base/id_space.h 2019-08-28 14:18:44 +02:00
Norman Feske e499a04de7 ldso: config option to disarm ctors check
By specifying the config attribute 'check_ctors="no"', the dynamic
linker won't abort the program on a missing call of
'Env::exec_static_constructors'. This is the case for forked programs
where the ctors were already executed by the forking program prior the
fork operation.

Issue #3478
2019-08-28 14:18:44 +02:00
Norman Feske abdf422681 ldso: interface to get infos about loaded objects
This patch enhances the 'base/shared_object.h' interface of the dynamic
linker with the function 'for_each_loaded_object', which allows the
caller to obtain information about the currently loaded binary and
shared libraries.

The new interface is a base mechanism needed for implementing 'fork' in
the libc.

Issue #3478
2019-08-21 14:08:18 +02:00
Norman Feske b113f869bb Use I/O signals for resource-request responses 2019-08-21 13:39:44 +02:00
Norman Feske 6fb7022508 Cap-resource request on Pd_session::transfer_quota
This patch handles the case where a PD's cap quota becomes exhausted
on the attempt to transfer caps via 'Env::pd().transfer_quota'. The
solution mirrors the existing code for RAM quota.

Prior this patch, the 'transfer_quota' operation would trigger an
'Out_of_caps' exception.
2019-08-21 13:38:24 +02:00
Christian Helmuth 312f801f8a depot: update recipe hashes 2019-08-21 13:25:26 +02:00
Sebastian Sumpf 2fc6cedcc0 ld: load dynamic linker at static address on Linux
* move stack area to static address at beginning of binary
* set ELF type of linker from shared to executable

fixes #3479
2019-08-21 13:25:25 +02:00
Sebastian Sumpf f3a7d3750f base: Add Linux and GOT relative startup code on ARM
* Linux specific startup code for base-linux ARM
* load symbols global offset table relative in order to avoid text
  relocations

issue #3466
2019-08-21 13:25:25 +02:00
Johannes Kliemann 1bdd18a196 ada-runtime: update to 1.1 2019-08-21 13:25:25 +02:00
Christian Prochaska 85b1563e57 mk: generate .data symbols with distinct values/addresses
Prevent the static linker from assuming weak object symbols to be alias
symbols for unrelated non-weak symbols with the same value/address.

Fixes #3458
2019-08-21 12:37:01 +02:00
Norman Feske 686dd8affd ldso: ability to preload shared objects
Fixes #3472
2019-08-21 12:37:00 +02:00
Christian Prochaska b9f0318ab8 mk: print symbol assembler file lines only once
Fixes #3461
2019-08-21 12:36:59 +02:00
Stefan Thöni f018dac506 util/fifo: Change empty() method of fifo to const.
Fixes #3464
2019-08-13 12:02:27 +02:00
Martin Stein 1e379cb3a9 drivers/acpi: provide plain SMBIOS table as report
Ref #3430
2019-08-13 12:02:03 +02:00
Christian Prochaska 193a401097 Increase RAM quota of ACPI driver to 4M
On some machines, more than 3 MiB are needed. This finally equalizes all
occurences of RAM quotas with drivers_managed.

Fixes #3443
2019-08-13 12:02:03 +02:00
Christian Helmuth 17d32b3e15 depot: update recipe hashes 2019-07-09 09:06:54 +02:00
Christian Helmuth 949130d80e Remove warning exec_static_constructors() warning
The warning falsely detected cases where shared objects where loaded before
exec_static_constructors() was called as unneeded even in cases were the
binary itself contained static globals.

The commit also removes one redundant call to exec_static_constructors()
from the block tester.
2019-07-09 08:58:38 +02:00
Martin Stein e199acca05 util/print_lines: don't skip end of long lines
Print the end of oversized lines (> 200 chars) to new lines instead of
skipping it

Fixes #3422
2019-07-09 08:55:24 +02:00
Sebastian Sumpf 24eea0b653 base: add 'trace' function to base/log.h
The 'Genode::trace' convenience function prints messages to Genode's
trace buffer (if tracing is enabled).

issue #3294
2019-07-09 08:55:23 +02:00
Sebastian Sumpf 25484f870e trace: make trace buffer resizeable
Trace buffers a re-allocated during subsequent calls to 'trace'.

issue #3294
2019-07-09 08:55:23 +02:00
Sebastian Sumpf ac0ecdf855 base: make trace resumable
revert relocations so a paused subject can resume without changing its
policy.

issue #3294
2019-07-09 08:55:23 +02:00
Sebastian Sumpf 1b489820a9 base: timestamp support for ARM 64-Bit
issue #3407
2019-07-09 08:55:23 +02:00
Sebastian Sumpf 790a57041c base: add ARM 64-Bit to base API
issue #3407
2019-07-09 08:55:23 +02:00
Stefan Kalkowski 90d07741aa hw: support for ARM64 Raspberry Pi 3
Restriction: enables only cpu core 0 and the timer interrupt by now.

Fix #3405
2019-07-09 08:55:22 +02:00
Tomasz Gajewski 0ecc48e6de Mini UART driver for Rpi3
Ref #3405
2019-07-09 08:55:22 +02:00
Christian Helmuth 3c4c460f82 depot: update recipe hashes 2019-06-13 13:40:37 +02:00
Christian Helmuth ed0d76552b Relax timing requirements in lazy timer test
The lazy-timer test depends on the faster-timer handler to be executed
before the fast timeout occurs, which was pretty hard to achieve on Qemu
and a busy host machine. Therefore, I increased the fast-to-faster
timeout ratio from 50/25 ms to 200/25 ms and set the test runtime to
4000 ms.
2019-06-13 12:22:49 +02:00
Christian Helmuth 5738e53be2 Warn about questionable call of wait_and_dispatch_one_io_signal
Issue #2399
2019-06-13 12:17:32 +02:00
Christian Helmuth 2b183f9497 depot: update recipe hashes 2019-05-29 10:20:52 +02:00
Christian Prochaska ca39a9ea61 tool_chain: versioned install location
Issue #3307
2019-05-29 10:20:52 +02:00
Alexander Boettcher ab6315d6b4 vm_session: add fpu state for x86
Issue #3111
2019-05-29 10:20:52 +02:00
Alexander Boettcher 9f70084524 base: add vm session API recipe
Issue #3111
2019-05-27 14:53:32 +02:00
Norman Feske 405a9d2144 Refinements for updated "Genode Foundations" book
- Improve API descriptions
- Remove obsolete Xml_node::value method (fixes #3323)
- Follow coding style 'const char' -> 'char const'
- Avoid '>>' when nesting templates (limitation of parse_cxx)
2019-05-27 14:52:53 +02:00
Christian Helmuth 9288fe63ad arg_string: return default value on parsing error 2019-05-27 14:52:53 +02:00
Pirmin Duss bd045c65a2 util/string.h: suppress case fallthrough warnings 2019-05-27 14:52:53 +02:00
Christian Prochaska 7fadfbbd9f Treat 'implicit fallthrough' errors as warnings
After fixing the warnings, the compiler option should be removed.

Issue #3307
2019-05-27 14:52:52 +02:00
Christian Prochaska 8e2e4374f5 sanitizer: update to version 8.3.0
Issue #3307
2019-05-27 14:52:52 +02:00
Christian Prochaska 61140380ee base: update 'ld' symbols for tool chain 19.05
Issue #3307
2019-05-27 14:52:52 +02:00
Sebastian Sumpf a8d856fb65 ldso: dynamic linking support for ARM 64-bit
* added relocation support
* added assembler invocation path for jump slot relocations

fixes issue #3260
2019-05-27 14:52:52 +02:00
Sebastian Sumpf 7dc875e8c7 base: dynamic linking support of crt0.s on ARM 64-bit
* added global offset table relative loading for global symbols
* removed 'initial_sp' and 'initial_x0' because they are currently not
  used on this platform. If required they are easy to resurrect.

issue #3260
2019-05-27 14:52:51 +02:00
Stefan Kalkowski 71a48c0a26 base: add initial support for ARM 64-bit
Ref #3260
2019-05-27 14:52:51 +02:00
Stefan Kalkowski c98597a2c0 base: increase initial stack
Ref #3260
2019-05-27 14:52:51 +02:00
Christian Prochaska 6af3899bcb Enable C++17 by default
Issue #3307
2019-05-27 14:52:51 +02:00
Christian Prochaska 74260c96bf tool_chain: integrate 'ali2dep' tool
Fixes #3361
2019-05-27 14:52:51 +02:00
Christian Prochaska fe878e65de base: add copy constructor to 'Genode::Session_label'
Fixes #3333
2019-05-27 14:46:54 +02:00
Christian Prochaska c2c33d6808 base: save FPU registers in '_jmp_slot' function (x86_64)
Issue #3355
2019-05-27 14:46:53 +02:00
Stefan Kalkowski a1e70b9ba4 kernel: differentiate board-specific components
Components like kernel, core, and bootstrap that are built for a
specific board need to reside inside the same architectural dependent
build directory. For instance there are sel4, foc, and hw kernel builds
for imx6q_sabrelite and imx7d_sabre, which have to reside inside the same
arm_v7 build directory.
This commit names those components explicitely, and adapts the run-tool to it.

Fix #3316
2019-05-27 14:46:52 +02:00
Christian Prochaska 02afb04b7d base: fix 'test-sanitizer' compile error with GCC 8.3.0
Fixes #3343
2019-05-16 13:11:03 +02:00
Martin Stein 8fb0d668e0 heap: fix exception handling in _allocate_dataspace
Previously, only Invalid_dataspace, Region_conflict, and Out_of_ram were
handled for both allocate and attach with the same handlers. However,
both operations can also throw Out_of_caps and for all exceptions during
attach, the dataspace must be freed again whereas this is not the case
when the exception occured during allocate.

Issue #2953
2019-05-16 13:11:02 +02:00
Sebastian Sumpf 467b96abf4 ldso: lazy binding support for RISC-V
* added assembler invocation path for jump slot relocations
* fix GOT initialization (jmp_slot pointer goes to GOT[0] not GOT[2] on
  RISC-V)

Fixes #3339
2019-05-16 13:11:02 +02:00
Christian Prochaska 96627df4d4 base: fix cxx library compile errors with GCC 8.3.0
Fixes #3322
2019-05-16 13:11:02 +02:00
Christian Prochaska 47a2ad604c base: fix xml_node test compile error with GCC 8.3.0
Fixes #3324
2019-05-16 13:11:02 +02:00
Stefan Kalkowski 4fa34190de platform_drv: check acpi ability by platform_info
Instead of retieving the information about the underlying platform from
the configuration, check the running kernel from the platform_info. This
commit removes the undocumented "acpi" config attribute.
2019-05-16 13:11:01 +02:00
Ehmry - d2ab699cd5 Remove Post_signal_hook from Entrypoint
The Post_signal_hook mechanism has been completely replaced by
Io_progress_handler and can be removed.

Ref #3132
Fix #3302
2019-05-16 13:11:00 +02:00
Stefan Kalkowski 312499a1ef os: name lan9118 nic driver explicitly
* it is not dependent on pbxa9 anymore, but configureable
* rename it to lan9118_nic_drv

Ref #2190
2019-05-16 13:11:00 +02:00
Stefan Kalkowski dcc28b65cb run: use driver_nic-* pkg where possible (fix #3180) 2019-05-16 13:10:06 +02:00
Stefan Kalkowski 7c1e3c84ba os: name gpio_drv unambigously (ref #2190) 2019-05-16 12:52:59 +02:00
Stefan Kalkowski 911f4ada0a os: make platform_drv package ready for ARM
* Make target binaries independent of board SPECS
* Name binaries of one architecture unambigously
* Extend include path to match board specifics
* Adapt run-scripts to use the right binary

Ref #2190
Ref #3180
2019-05-16 12:52:59 +02:00
Christian Helmuth ba51800b31 depot: update recipe hashes 2019-05-06 16:15:27 +02:00
Alexander Boettcher c0a00019c0 foc/sel4: place vcpu thread on same cpu as ep
Issue #3111
2019-05-06 16:15:27 +02:00
Stefan Kalkowski b85071174a base: wait a bit at the end of the smp test
Fix #3306
2019-05-06 16:15:27 +02:00
Alexander Boettcher 05fa063068 vm_session: support to trace vCPU
Issue #3111
2019-05-06 16:15:26 +02:00
Martin Stein 0b9916cae2 Timer::Connection: simplify curr_time
With the new fact that plain time values are always 64 bit unsigned, the
timestamp type is never bigger than the plain time type. Therefore, a code path
in the curr_time interpolation that treated this condition is not neccessary
anymore.

Ref #3208
2019-05-06 16:15:26 +02:00
Martin Stein 181c78d482 timeout: use uint64_t for all plain time values
This enforces the use of unsigned 64-bit values for time in the duration type,
the timeout framework, the timer session, the userland timer-drivers, and the
alarm framework on all platforms. The commit also adapts the code that uses
these tools accross all basic repositories (base, base-*, os. gems, libports,
ports, dde_*) to use unsigned 64-bit values for time as well as far as this
does not imply profound modifications.

Fixes #3208
2019-05-06 16:15:26 +02:00
Stefan Kalkowski 4bcd9169c0 sel4: add timer for imx7d_sabre
Fix #3292
2019-05-06 16:15:26 +02:00
Alexander Boettcher 8950de5a89 base: support whole addressable range in allocator
Issue #3111
2019-05-06 16:15:26 +02:00
Alexander Boettcher 393643515c base: extend attach of vm_session
by offset, size, writeable and executable parameter

Issue #3111
2019-05-06 16:15:25 +02:00
Stefan Kalkowski 7a45867841 vmm_arm: support for i.MX7 Dual SABRE board
Fix #3285
2019-05-06 16:15:25 +02:00
Norman Feske ea6b1c255e base: add const version of 'Fifo::Element::object' 2019-05-06 16:15:25 +02:00
Alexander Boettcher 35cf804471 base: free up all blocks on avl destruction
Issue #3111

remove_range may deny to the job on memory pressure or insane ranges,
which ends up in an endless loop when the Avl allocator is in destruction.

Since the Avl gets destructed, solely the memory free up is of importance,
not the correct range adjustments during remove_range.
2019-05-06 16:15:25 +02:00
Alexander Boettcher d2229ab381 vm_session: evaluate priority
Issue #3111
2019-05-06 16:15:25 +02:00
Alexander Boettcher 450c8dc149 vm_session: track dataspaces used by attach
Track the dataspaces used by attach and add handling of flushing VM space
when dataspace gets destroyed (not triggered via the vm_session interface).

Issue #3111
2019-05-06 16:15:25 +02:00
Alexander Boettcher 169c51d50d base: remove error message in slab block
Issue #3111
2019-05-06 16:15:25 +02:00
Alexander Boettcher d1f37e66eb base: fix _sum_in_range in avl structure
Handles corner case when addr + size becomes exactly 0. Before the commit
the function returned that sum is not part of the range, which is wrong.

Issue #3111
2019-05-06 16:15:24 +02:00
Alexander Boettcher 812149ed29 core: add Region_map_detach interface
Issue #3111
2019-05-06 16:15:24 +02:00
Norman Feske 10c567daee base: add 'aligned' function to util/misc_math.h
This function simplifies the sanity checking of values that are expected
to be aligned, e.g., data offsets within packet streams.
2019-05-03 13:31:39 +02:00
Christian Helmuth 6ea1179145 depot: update recipe hashes 2019-04-09 12:30:35 +02:00
Alexander Boettcher ae16edf1d6 trace: support more facets of execution time
- execution time per thread context
- execution time per scheduling context
- quantum and priority

Issue #3192
2019-04-09 12:30:34 +02:00
Norman Feske d027f12764 depot: update recipe hashes 2019-04-02 09:36:39 +02:00
Alexander Boettcher 483de40c96 base: remove message in sliced_heap.alloc()
Issue #3111
2019-04-01 19:33:52 +02:00
Alexander Boettcher 5fa91a1bcc base: add x86 vm_state
Issue #3111
2019-04-01 19:33:51 +02:00
Stefan Kalkowski baf815d099 hw: add support for i.MX7 Dual SABRE board
Fix #3251
2019-04-01 19:33:49 +02:00
Stefan Kalkowski 8f28f884ee hw: name vm_state header explicitely
Ref #3251
2019-04-01 19:33:49 +02:00
Stefan Kalkowski 4c492a3be7 imx7d_sabre: add board for sel4 and foc
Ref #3251
2019-04-01 19:33:49 +02:00
Christian Helmuth f0a3377247 Remove obsolete symbols from symbols/ld ABI 2019-04-01 19:33:48 +02:00
Christian Helmuth 37a93f53c4 Provide Genode::cache_coherent() consistently
It got lost on base-foc and also was not put into Genode namespace in
the default implementation.
2019-04-01 19:33:48 +02:00
Martin Stein b04a70177b base & arm: simplify and optimize cmpxchg
The old inline assembly provided two output operands that were afterwards
combined for a return value. However, the second output operand isn't
necessary when using the "Acquiring a Lock" example-code of the ARM manual
"Barrier Litmus Tests and Cookbook". This saves two logical operations
per acquisition try. Additionally better documentation is now provided.

Fixes #1292
2019-04-01 19:33:47 +02:00
Ehmry - 5efa6d5273 Stack smashing test
A test to check if -fstack-protector can be enabled and is effective.

Ref #3066
2019-04-01 19:33:46 +02:00
Ehmry - 6819c43a05 Add stack protector storage to base library
This patch adds the items necessary for building Genode components with
stack protection enabled, but it is not initialized at runtime. They are
provided at the moment as a convenience and do not implement a security
feature.

Fix #3066
2019-04-01 19:33:46 +02:00
Tomasz Gajewski 35c17ced72 Trivial doc fix for Register_set_plain_access::read
Fix #3229
2019-04-01 19:33:46 +02:00
Christian Helmuth ebe71a12ed depot: update recipe hashes 2019-03-19 11:12:36 +01:00
Norman Feske 9438caa6a3 base: never throw in Xml_node::for_each_sub_node
Fixes #3231
2019-03-18 15:56:59 +01:00
Christian Prochaska 67fd77d10a base: catch 'Ipc_error' in 'Expanding_parent_client::exit()'
If a component is being destroyed just before it calls `exit()` at its
parent, the `exit()` call causes an `Ipc_error` exception, which leads to
an `abort()` loop with repeated error messages, because `abort()` calls
`exit()` too. Catching the exception in `Expanding_parent_client::exit()`
avoids this problem.

Fixes #3228
2019-03-18 15:56:59 +01:00