Commit Graph

1437 Commits

Author SHA1 Message Date
Johannes Schlatow
4d0cb175da base-hw: use global timer on Cortex A9
genodelabs/genode#4360
2023-02-27 08:20:45 +01:00
Christian Helmuth
25eac6b9e6 depot: update recipe hashes 2023-01-24 12:07:33 +01:00
Sebastian Sumpf
437fd21ba0 mk: use _file_content instead of echo | cat
Use _file_content function to retrieve port hash instead of 'echo | cat'
construct that lead to 'Broken pipe' erros in GNU Make 4.4.

issue #4725
2023-01-24 12:07:32 +01:00
Norman Feske
be7022dadc util/dictionary.h: alphabetically sorted for_each
This patch reverses the AVL-tree criterion to let 'for_each' traverse
the elements in alphabetical sorting order.

Issue #4610
2023-01-24 12:07:31 +01:00
Christian Prochaska
0c465fbb4d trace session: fix double quota accounting
Fixes #4707.
2023-01-24 12:07:29 +01:00
Christian Helmuth
b4f6f796d6 Clear board/pc/devices
Information about PS/2 and PIT where moved to app/pci_decode in the
following commit.

  pci_decode: report devices from ACPI info

We still provide an empty <devices> node as the file itself is used by
platform agnostic run scripts.
2023-01-24 12:07:29 +01:00
Norman Feske
2a1240d1e9 base: provide generic cpu/string.h
This patch uses the formerly x86-specific cpu/string.h for all
architectures if no spec/<arch> variant exists.

Issue #4456
2023-01-24 12:07:28 +01:00
Christian Helmuth
8661936d7d base: aquire context mutex in local_submit()
Some signal-heavy scenarios (e.g., libc_integration) produced the
following warning that hinted a data race on signal data in the context
object.

  Warning: returning signal with num == 0

The cause was the use of Signal_context::local_submit() in the libc
introduced in

  424ed1b79a libc: remove Reconstructible / use local_submit in kernel

in combination with a missing context-mutex aquisition resulting in a
data race on Signal_context::_curr_signal.

Issue #3923
2023-01-24 12:07:27 +01:00
Christian Helmuth
4c5db31110 base: ld-<platform>.abi.so depends on symbol.map
This prevents errors like the following during parallel builds.

      MERGE    ld-hw.abi.so
  /usr/local/genode/tool/21.05/bin/genode-arm-ld:symbol.map:0: syntax error in VERSION script
2022-12-01 11:47:32 +01:00
Christian Helmuth
b033b30f95 depot: update recipe hashes 2022-11-29 12:32:49 +01:00
Stefan Kalkowski
9e61fb90c5 Remove legacy platform_drv, API, and platform.inc
Fix genodelabs/genode#4671
2022-11-29 12:29:57 +01:00
Alexander Boettcher
fd2a216909 base: support ACPI suspend via Pd::managing_system
Issue #4669
2022-11-18 14:45:27 +01:00
Christian Helmuth
c58d799f16 depot: update recipe hashes 2022-11-17 08:00:37 +01:00
Sebastian Sumpf
0a8d6ddba9 core: Ignore constraints on allocations if allocator is exhausted
Try to allocate within constraint area first. In case the area is exhausted,
try allocation at other memory locations.

The motivation for this is to limit DMA allocations to 4GB (since some
devices require addresses below 4GB). On some platforms there is little
physical RAM in this area (<1GB) and the constrainted area exhausts. In
case an IOMMU is present, RAM at higher locations can still be mapped
below 4GB, which is done in the platform drivers.

issue #4665
2022-11-17 08:00:37 +01:00
Alexander Boettcher
7a5eab9541 grub2: make ISO bootable on hardware
With "grub2: update to newer grub2 2.06 version" a regression slipped in
which makes the ISO not bootable on real hardware. The commit reverts to
the previous behaviour, to load the GRUB2 modules after boot later one by
one in the ISO format case.

Fixes #4647
2022-11-17 08:00:34 +01:00
Christian Helmuth
df4c4d5be2 base: check for used blocks in Allocator_avl
The check is required for alloc_addr() as the desired range may already
be backed by a used block.
2022-11-17 08:00:34 +01:00
Christian Helmuth
847266d027 depot: update recipe hashes 2022-10-12 14:31:50 +02:00
Norman Feske
a77ceb6871 base: remove Trace::Session::rule RPC function
This part of the trace-session interface was merely a placeholder.

Fixes #848
2022-10-12 12:09:35 +02:00
Stefan Kalkowski
9f9a5186e0 ps2_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Martin Stein
c23b74e150 base-hw: problems with timeout lib in src recipe
This commit fixes two issues with the timeout lib and the base-hw src recipe:

* Add source files of timeout lib to recipe content.
  The files weren't copied to the depot until now. However, the archive
  nonetheless built successfully because of the second issue that is described
  below.

* Get rid of the usage of the BASE_DIR variable in the timeout lib.
  The BASE_DIR variable always resolves to the repos/base directory even when
  building in a depot. That said, the use of BASE_DIR in make-files that are
  not part of the build system itself must be avoided. Instead, REP_DIR,
  REP_INC_DIR, and $(call select_from_repositories, ...) should be used.

Ref #4209
2022-10-12 11:59:08 +02:00
Norman Feske
da150dbb1c Xml_node: allow whitespace around '=' characters
Fixes #4167
2022-10-12 11:59:08 +02:00
Christian Helmuth
3f1870841c depot: update recipe hashes 2022-09-21 12:19:10 +02:00
Johannes Schlatow
f25070d441 irq_connection: add constructor with session label
When creating an Irq connection to a component (not core), e.g. a pin
driver, we typically need a to provide a session label in order to apply
a session policy and to distinguish multiple sessions from the same
component.

genodelabs/genode#4606
2022-09-21 12:19:10 +02:00
Norman Feske
3be0136901 base: add util/dictionary.h utility
The new 'Dictionary' provides an easy way to access objects using
strings as key. The 'String' received the 'operator >' to simplify the
organization of strings in an AVL tree.

The patch removes the former definition of the 'operator >' from the
platform driver because it would be ambigious now.

Fixes #4610
2022-09-19 14:00:35 +02:00
Johannes Schlatow
7d143087c9 xml_node: change with_sub_node signature
The `with_sub_node` method is renamed to `with_optional_sub_node` to
better reflect that the non-existence of a sub node with the desired type is
ignored.
At the same time, the new `with_sub_node` now takes a second functor that is
called when no sub node of the desired type exists.

genodelabs/genode#4600
2022-09-19 14:00:33 +02:00
Norman Feske
f1f0ee3a21 base: disregard ld.lib.so stub as build artifact
The ld.lib.so stub library generated by base/lib/mk/ld.mk has no
purpose at runtime. On the contrary, it must not be integrated into the
boot image because its name collides with the kernel-specific dynamic
linker.
2022-09-19 14:00:32 +02:00
Norman Feske
9aab61f5a7 mk: allow declaration of build artifacts for libs
The build system automatically announces the names of shared libraries
as build artifacts. However, in rare cases, it is required to manually
define them. In particular, the 'ld' stub library plays no role at runtime
and should not be integrated into the boot image.

This patch adds a customization hook following the same pattern as used
for target.mk files, namely the BUILD_ARTIFACTS variable. If defined,
its value is taken as the list of boot artifacts generated by the
library-description file.

Issue #4368
2022-09-19 14:00:32 +02:00
Norman Feske
c560285d88 build: support library builds via lib/<libname>
This patch adds special handling for lib/<libname> arguments to the
build system, which supersedes the former LIB=<libname> mechanism.
Whereas the old mechanism was limited to a single library, the new
convention allows multiple library arguments, similar to regular
targets. The change brings the two immediate benefits.

First, the streamlining of library and target arguments allows for the
building of libraries via the 'build' command of the run tool.

Second, it alleviates the need for pseudo target.mk files for building
shared libraries that have no direct dependencies, in particular VFS
plugins.

Since this change eases the explicit creation of shared libraries
from run scripts, we may reconsider the automatic implicit building
of shared libraries driven by targets. E.g., while developing a Qt
application, a run script could import the Qt libraries from the
depot and combine those with the developed (fresh built) target without
triggering the build of the Qt libraries in the build directory.

When issueing 'make' without arguments, all targets are built. This
patch applies this behavior to libraries as well, thereby removing the
need for the base/src/lib/target.mk pseudo target as used by the CI
tools to build all libraries.

Note that target.mk files located under src/lib/ are no longer
reachable. Therefore, all run scripts that used to trigger the
build of a shared library via a pseudo target must be adapted.
E.g., 'build lib/vfs/tap' must be replaced by 'build lib/vfs_tap'.

With this patch, the LIB=<libname> option is no longer supported.

Fixes #4599
2022-09-19 13:59:28 +02:00
Christian Helmuth
4dddc41b71 depot: update recipe hashes 2022-08-31 09:32:09 +02:00
Norman Feske
5319f36788 util/string.h: support 'int' for 'ascii_to'
This patch complements the 'long' version of the 'ascii_to' conversion
function by an 'int' version.

Fixes #4583
2022-08-17 14:28:12 +02:00
Christian Helmuth
44e2cd14a0 depot: update recipe hashes 2022-08-17 12:03:26 +02:00
Sebastian Sumpf
b5c780993c board: Rename virt_qemu to virt_qemu_<arch>
Instead of having a generic "virt_qemu" board use "virt_qemu_<arch>" in
order to have a clean distinction between boards. Current supported
boards are "virt_qemu_arm_v7a", "virt_qemu_arm_v8a", and
"virt_qemu_riscv".

issue #4034
2022-08-17 12:03:26 +02:00
Johannes Schlatow
cee0c9858c trace_buffer: add object() accessor
genodelabs/genode#4352
2022-08-17 12:03:07 +02:00
Johannes Schlatow
086f3efef2 trace: add trace_eth_packet event
genodelabs/genode#4352
2022-08-17 12:03:07 +02:00
Johannes Schlatow
80a422e590 trace: add GENODE_TRACE_CHECKPOINT macros
genodelabs/genode#4352
2022-08-17 11:54:19 +02:00
Johannes Schlatow
73dad70356 trace: add checkpoint event
genodelabs/genode#4352
2022-08-17 11:54:19 +02:00
Johannes Schlatow
735abca1b6 nic_router: avoid marginal timeout updates
The link dissolve timeout is updated for every packet, which leads to
trigger_once() RPCs that only marginally change the scheduled timeout but
significantly slow down the packet throughput.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Alexander Boettcher
c81b3d4757 base: add check whether stack belongs to ep
Add method to check whether a given pointer are part of the primary stack
of the rpc entrypoint.

Issue #4540
2022-08-10 13:33:01 +02:00
Alexander Boettcher
97d7d4b49d grub2: update to newer grub2 2.06 version
In UEFI case the lower RAM will not be used for internal allocation, which
should prevent overrides in the former legacy BDA (first page).

Issue #4426
2022-08-10 13:33:00 +02:00
Alexander Boettcher
88118b133a intel_fb: request copy of Intel opregion
acpica and the Intel display driver tries to use the Intel Opregion
simultaneously on Genode, which is not supported nor wanted for IO_MEM region as
which it is handled.

Attempts to remove the access to the region was not successful, since some
SSDT table contains ACPI AML code which is executed regularly and read/write
the Opregion.

The patch adds support to read in a copy of the Intel Opregion done by the
acpi_drv component. The copy was sufficient to make the Intel display driver
working to find and lookup the Intel VBT (video bios table) information to
setup all connectors on a Fujitsu U7411 docking station.

Fixes #4531
2022-08-10 13:32:57 +02:00
Sebastian Sumpf
fb7282f47a base: beautify error message if not mutex owner 2022-08-10 13:32:57 +02:00
Norman Feske
6326774056 mk: trigger CUSTOM_TARGET_DEPS from 'all' rule
Build description files that feature both an actual target and
CUSTOM_TARGET_DEPS happen to re-link the target each time whenever one
of the CUSTOM_TARGET_DEPS is phony, e.g., gems/src/app/menu_view/.
The re-linking of the actual target is of course not desired. By
triggering the creation of CUSTOM_TARGET_DEPS from 'all:' instead of
'$(TARGET)', the specified files do not implicitly become link
dependencies of the target.

Issue #3972
2022-06-01 17:37:44 +02:00
Christian Helmuth
3105fa9e0f depot: update recipe hashes 2022-05-25 12:23:04 +02:00
Johannes Schlatow
c38b71146b trace_buffer: only iterate after initialization
There is a race between the trace subject doing the buffer
initialization and the monitor trying to iterate the buffer entries. If
the monitor tries to iterate entries of an uninitialized buffer, it will
read the very first entry twice. The monitor should therefore only start
iteration when the buffer has been initialised.

genodelabs/genode#4513
2022-05-25 12:23:04 +02:00
Stefan Kalkowski
d0694b3e0b platform_drv: separate devices info from config
Fix genodelabs/genode#4491
2022-05-25 12:19:32 +02:00
Christian Helmuth
8ece236635 depot: update recipe hashes 2022-04-13 11:54:46 +02:00
Sebastian Sumpf
da1ef67064 base: Allocator_avl cleanup meta data
After reverting unused ranges during allocator destruction
'_meta_data.free_empty_blocks' may lead to more unused ranges because
meta data blocks maybe freed where the meta data for the blocks is
managed by other meta data blocks. This leads to dangling allocation
warnings which are caused by meta data. Therefore, we call
'_revert_unused_ranges' and 'free_empty_blocks' until no more ranges
can be freed.

issue #4466
2022-04-13 09:29:03 +02:00
Johannes Schlatow
410099df70 base/memset: speedup implementation
Compared to the bytewise memset, a wordwise memset (or even multi-word)
achieves a speedup of ~6.

On Zynq-7000/Cortex-A9:
317 MiB/s -> 2040 MiB/s

On base-linux x86_64:
3580 MiB/s -> 23700 MiB/s

genodelabs/genode#4456
2022-04-13 09:29:03 +02:00
Johannes Schlatow
9409f814a4 memcpy (x86): implement memcpy_cpu
By changing the bytewise copy into a wordwise copy, we get a speedup of
~3 (on base-linux x86_64).

genodelabs/genode#4456
2022-04-13 09:29:02 +02:00
Johannes Schlatow
0104a74028 memcpy (arm): cache align and use pld for speedup
Preloading a few cache lines ahead brings a significant speedup in
memcpy throughput. Note, the particular (optimal) value was empirically
determined on a Cortex-A9 (Zynq-7000) SoC @ 666Mhz. It is best combined
with L2 prefetching enabled (including double linefills and prefetch
offset 7). Yet, even without L2 prefetching this seems to be the sweet
spot.

genodelabs/genode#4456
2022-04-13 08:08:01 +02:00
Johannes Schlatow
4dcc095e5e memcpy (arm): remove unused vfp implementation
The implementation is not in use any more. Furthermore, on typical ARM
cores such as the Cortex-A9, the cached read appears to be the
bottleneck rather than instruction density. On a Zynq-7000 SoC, the vfp
implementation performed significantly worse than the standard load/store
multiple implementation with preloading.

genodelabs/genode#4456
2022-04-13 08:08:01 +02:00
Norman Feske
be0a1742ac base: distinct TRACED from ATTACHED trace subjects
This patch makes the trace-subject state as reflected to the trace
monitor more accurate.

Until now, a subject could be in UNTRACED or TRACED state. In reality,
however, there exists an intermediate state after the trace monitor
called 'trace' for the subject but before the subject locally activated
the tracing (done when passing a trace point). This intermediate state
was reflected as UNTRACED. Consequently, threads that never pass a trace
point (e.g., just waiting for I/O) would remain to appear as UNTRACED
even after enabling its tracing by the trace monitor. This is confusing.

This patch replaces the former UNTRACED and TRACED states by three
distinct states:

  UNATTACHED  prior any call of 'trace'
  ATTACHED    after a trace monitor called 'trace'
              but before the tracing is active
  TRACE       tracing is active

Fixes #4447
2022-04-13 08:07:58 +02:00
Norman Feske
f3984ba5a9 base: declare build artifact for core
This is a generalization of the recent commit "base-hw: declare build
artifact for core".
2022-04-13 08:07:58 +02:00
Norman Feske
34a3209e9b base/log.h: add GENODE_TRACE_TSC
The new macros GENODE_TRACE_TSC and GENODE_TRACE_TSC_NAMED complement
the existing GENODE_LOG_TSC and GENODE_LOG_TSC_NAMED macros to simplify
TSC measurements at a low overhead of the trace mechanism.
2022-04-13 08:07:57 +02:00
Johannes Schlatow
c763890f04 trace_buffer: partition trace buffer
Split the trace buffer into two partitions in order to prevent overwriting
of entries when the consumer is too slow. See file comment in buffer.h.

genodelabs/genode#4434
2022-03-21 13:42:16 +01:00
Johannes Schlatow
edc46d15f8 trace_buffer: revise trace buffer implementation
This commit simplifies the current implementation by overloading the
length field with a padding indicator in addition to the zero-length
head entry. This simplifies the iteration semantics as it eliminates
the need for determining whether a zero-length entries is the actual
head of the buffer or a padding at the buffer end.

genodelabs/genode#4434
2022-03-09 12:08:02 +01:00
Stefan Kalkowski
8a4cbe3cc9 io_port_session: make default ram quota explicit
Ref genodelabs/genode#4436
2022-03-02 15:04:18 +01:00
Christian Helmuth
2b3370c8d8 depot: update recipe hashes 2022-02-28 11:46:35 +01:00
Johannes Schlatow
e35837e14b trace_buffer: fix wrap condition
When committing a new entry, the buffer wrapped if the last entry fit
perfectly into the buffer. Otherwise, the length field of the next entry
was set to 0 to mark the new head. Yet, if there was still some padding but not
enough to hold the length field of another entry, we ended up with a
headless buffer.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Johannes Schlatow
91b6032a71 trace_buffer: eliminate race
Since the head of the buffer is marked by a zero-length entry, we must
only write the length field if a new head was set. Otherwise, the
consumer might already read the new entry and not find the new head as a stop
condition.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Johannes Schlatow
b57ccf3517 trace_buffer: fix wrap corner case
If the functor reading the first entry after wrap-around returned false,
the wrapping was not applied successfully.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Johannes Schlatow
44aefc8777 trace_buffer: fix out-of-bounds read
The calculation in next() actually checked whether the current entry
fitted into the buffer, not if another one fitted.

genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Stefan Kalkowski
14d1ca17a9 Use new pc_usb_host_drv in all recipes and tests
* Switch from the legacy usb_host driver to the new PC version
  in recipes and automated tests
* Update documentation snippets
* Remove outdated, unused usb_rndis run-script

Fix genodelabs/genode#4416
2022-02-21 15:47:50 +01:00
Norman Feske
c2efa5406e xml_node: support backslash as attribute value
XML allows attribute values like <node attr="\"/>. The XML parser
wrongly reflects this case as 'Invalid_syntax'. This behavior stems from
the implicit use of the 'end_of_quote' function, which considers the
sequence of '\"' as a quoted '"' rather than the end of a quoted string.

The patch solves this problem by making the 'end_of_quote' part of
the tokenizer's scanner policy.

The patch removes the 'end_of_quote' function from 'util/string.h'
because it is not universal, and to avoid the ambiguity with
'SCANNER_POLICY::end_of_quote'.

Fixes #4431
2022-02-21 15:44:22 +01:00
Stefan Kalkowski
494f881f27 core: don't use frame 0 for managing_system pd
When a PD owns the right to ask for a RAM dataspace's `dma_addr` it is
concurrently constrained to use allocations of a specific physical RAM area.
This commit further limits this area by removing RAM page frame zero.
Otherwise the return value of `dma_addr` for such a dataspace would be
erroneously interpreted as a fault, because zero is currently the error
return value of `dma_addr`.

Fix genodelabs/genode#4428
2022-02-21 15:44:22 +01:00
Norman Feske
4769e05626 mk: abi does not depend shared-lib dependencies
This patch cuts the superfluous dependency of abi.so files from the
library dependencies of the corresponding lib.so file. ABIs depend
only on symbol files.

Prior this patch, the second step of the following sequence would
wrongly re-build the abi.so file.

  arm_v6$ make init
  arm_v6$ make init KERNEL=hw

As the KERNEL argument does not affect the ABI, the abi.so should
better not be created twice.

Issue #4408
2022-02-21 15:44:22 +01:00
Piotr Tworek
dd1596aa53 base: Don't produce .gnu.hash tables for Genode.
Genode linker does not support .gnu.hash tables so they will never be
used. Tell the linker not to bother producing them. This should reduce
the size of Genode ELF files a tiny bit without loosing anything
important in the process.

Fixes #4423
2022-02-15 15:32:20 +01:00
Norman Feske
649647538b depot: update recipe hashes 2022-02-15 10:23:59 +01:00
Piotr Tworek
58e0b24006 base: Ignore empty constructors array.
This does not affect default Genode builds as far as I can tell. There
is always at least one global static CTOR which seems to be coming from
one of the GCC runtime libs bundled in the toolchain. The problem became
visible for me only after I've replated GCC runtime with LLVM based
one. In such setup I often see binaries that do not have any static ctors.
Such binaries end up crashing Genode ld.lib.so.

Make sure the code does handle empty constructors array.

Fixes #4422
2022-02-15 10:23:58 +01:00
Norman Feske
33b038e8a7 Consistent spelling of "writeable"
Fixes #4425
2022-02-15 10:23:58 +01:00
Norman Feske
0d48b74bec Remove Dataspace::phys_addr RPC function
The official way to obtain DMA addresses for RAM dataspaces is
the RPC function 'Pd_session::dma_addr' now. User-level device drivers
should not call this function directly but use the 'Platform_session'
interface of the platform driver instead.

Fixes #2243
2022-02-15 10:23:58 +01:00
Stefan Kalkowski
3966d6f16f usb_host_drv: move it to legacy_usb_host_drv
To make room for the re-newed usb_host_drv basing on Linux 5.14 and
the re-newed lx_kit/lx_emul we have to move the depot recipe and
consistently name the old drivers with a legacy_ prefix.

Ref genodelabs/genode#4416
2022-02-15 10:23:16 +01:00
Norman Feske
59936c22c0 depot: cut kernel dependency from api/base
This patch removes the implicit build of ld-$(KERNEL) by the generic
ld.mk file because the kernel-specific dynamic linker is unreachable
when building a regular binary archive.

Issue #4320
2022-02-15 10:20:59 +01:00
Norman Feske
23f92da02f mk/ld.mk: trigger kernel-dependent ld.lib.so build
When 'KERNEL' is specified, let the generic (pseudo) target of
lib/mk/ld.mk trigger the build of the actual dynamic linker named after
the used kernel. This way, we become able to remove the magic
linker-build step from the boot-image stage of the run tool.

Issue #4320
2022-02-15 10:20:59 +01:00
Norman Feske
f2f0711bf4 mk: don't link transitive shared-lib dependencies
This patch applies the existing "privatization" of transitive
shared-library dependencies from static lib dependencies to shared lib
dependencies. It thereby improves the consistency of binaries created in
a regular build directory with binaries created in depot archives.

Issue #4408
2022-02-15 10:20:59 +01:00
Norman Feske
50c2b0066f Remove 'Env::reinit' and 'Env::reinit_main_thread'
Fixes #4404
2022-02-15 10:17:28 +01:00
Stefan Kalkowski
cf0d007fd4 os: remove imx53 specific platform api and fb_drv
Fix #4402
2022-02-15 10:17:28 +01:00
Norman Feske
e4f62380d7 base: Pd_session::dma_addr, Pd_session::attach_dma
This patch enhances the PD-session interface with the support needed for
user-level device drivers performing DMA. Both RPC functions are
intended for the direct use by the platform driver only. If invoked for
PDs that lack the managing-system role, the operations have no effect.

The 'dma_addr()' RPC function allows the platform driver to request the
DMA address of a given RAM dataspace. It is meant to replace the
'Dataspace::phys_addr' RPC function.

The 'attach_dma' RPC function adds the given dataspace to the device
PD's I/O page table. It replaces the former heuristics of marking DMA
buffers as uncached RAM on x86.

With this patch, the UNCACHED attribute of RAM dataspaces is no longer
used to distinguish DMA buffers from regular RAM dataspaces.

Issue #2243
2022-02-15 10:16:52 +01:00
Johannes Schlatow
db3a647c6d allocator_avl: use Attempt for size_at
Fixes ambiguous interpretation of returned 0.

genodelabs/genode#4393
2022-02-15 10:16:51 +01:00
Johannes Schlatow
5aa0fea29b base: pass lambdas by reference in util/attempt.h
genodelabs/genode#4393
2022-02-15 10:16:51 +01:00
Johannes Schlatow
b821776b0d base: add == operator to util/attempt.h
This simplifies testing for early return conditions for which the use of
lambdas would be quite noisy.

genodelabs/genode#4393
2022-02-15 10:16:51 +01:00
Stefan Kalkowski
c99ca21649 rpi: remove drivers for platform, fb and sd_card
Fix #4396
2022-02-15 10:16:51 +01:00
Johannes Schlatow
0bb2e61e9e Allow derived classes of Genode::Array
genodelabs/genode#4382
2022-02-15 10:10:01 +01:00
Christian Helmuth
65284b29f8 depot: update recipe hashes 2022-01-19 12:38:13 +01:00
Christian Prochaska
8ced0f184e vfs: add 'with_xml_file_content()' and 'with_raw_file_content()'
Fixes #4372
2022-01-19 12:38:13 +01:00
Stefan Kalkowski
6bd7f167a4 hw: remove rpi1/3 board support
The code moved to https://github.com/skalk/genode-rpi

Ref #4363
2022-01-19 12:38:12 +01:00
Tomasz Gajewski
f79d5d640f hw: irq controller and timer improvements for Rpi
* renamed rpi pic to Bcm2835_pic
* renamed rpi3 pic to Bcm2837_pic
* added bcm2837 control for setting prescaler value (to fix timer_accuracy)
* changed handling of all interrupts for rpi3 by cascading to bcm2835 pic
* rpi3 irq controller base address made consistent with rpi
* added usb controller memory region for pic on rpi3 (for SOF interrupts)

Ref #3415
2022-01-19 12:38:12 +01:00
Stefan Kalkowski
7db602faec os: deprecate platform API for x86, rpi, imx53
* Move platform APIs to "legacy/" subdirectory
* Rename old pc, imx53, and rpi platform_drv
  to "legacy_*_platform_drv"

Fix #4359
2022-01-19 12:38:12 +01:00
Norman Feske
0eee5d5fc1 mk: record build artifacts in progress.log
Issue #4368
2022-01-19 12:38:11 +01:00
Norman Feske
88ca8d1a72 base: fix potential memory leak in allocator_avl
When used by the 'Allocator_avl' the slab allocator's backing store is
dynamically disabled and re-enabled while adding/freeing ranges.
However, during those operations, slab entries can be freed. This,
in turn, can result in the release of a slab block (when the freed slab
entry happens to be the last entry of the block). In this corner case,
'Slab::_release_backing_store' operation has no effect because no
backing-store allocator is set. As a result, the block is no longer
referenced but not physically freed.

The patch fixes the problem by skipping '_free_curr_sb' whenever
no backing store is defined. So the completely empty block remains
in the working set.

Thanks to Peter for reporting and fixing this issue!

Fixes #4367
2022-01-19 12:35:49 +01:00
Christian Prochaska
8e252f79f8 Remove mutex from 'Genode::Trace_output'
Fixes #4356
2022-01-19 12:35:49 +01:00
Piotr Tworek
d610f9f4f1 Fix some signed/unsigned implicit conversions.
Fix some trivial cases where the signedness of the constant value does
not match the signedness of type the code expects to see. GCC can be
asked to warn about those by passing Wsign-covnersion flag.

Issue #4354
2022-01-19 12:35:48 +01:00
Piotr Tworek
27b798fa4f base: Make int to access_t conversion explicit.
As far as I can tell this is not raised by any released GCC versions.
Clang 13 on the other hand warns about it due to implicit-int-conversion
warning which is automatically enabled together with Wconversion. The
problem is relatively simple, shifting access_t value does not always
produce result which is also of access_t type. For example, if access_t
is uint16_t, shifting it will produce integer result. This can be
observed even with GCC. Building the following C++ example will fail:

  #include <type_traits>
  #include <stdint.h>

  int test() {
      uint16_t a = 0xabcd;
      static_assert(std::is_same_v<decltype(a<<1), uint16_t>);
      return 0;
  }

Changing uint16_t in the static_assert to int, will allow the code to
build.

Make such int to access_t implicit conversion explicit to allow the code
to be compiled with both GCC and clang.

Issue #4354
2022-01-19 12:35:48 +01:00
Alexander Tormasov
b3f8b49873 mk: add golang as target for compilation
Fixes #4358
2022-01-19 12:35:48 +01:00
Norman Feske
5611fd2355 depot: update recipe hashes 2021-12-17 15:06:38 +01:00
Norman Feske
3cc6df3116 base: tighten affinity handling
This patch improves the robustness of the CPU-affinity handling.

- The types in base/affinity.h received the accessors
  'Location::within(space)' and 'Affinity::valid', which alleviates
  the fiddling with coordinates when sanity checking the values,
  in init or core.

- The 'Affinity::Location::valid' method got removed because its
  meaning was too vague. For sanity checks of affinity configurations,
  the new 'within' method is approriate. In cases where only the x,y
  values are used for selecting a physical CPU (during thread creation),
  the validity check (width*height > 0) was not meaningful anyway.

- The 'Affinity::Location::from_xml' requires a 'Affinity::Space'
  as argument because a location always relates to the bounds of
  a specific space. This function now implements the selection of
  whole rows or columns, which has previously a feature of the
  sandbox library only.

- Whenever the sandbox library (init) encounters an invalid affinity
  configuration, it prints a warning message as a diagnostic aid.

- A new 'Affinity::unrestricted' function constructs an affinity that
  covers the whole affinity space. The named functions clarifies
  the meaning over the previous use of the default constructor.

- Core's CPU service denies session requests with an invalid
  affinity parameter. Previously, it would fall back to an
  unrestricted affinity.

Issue #4300
2021-12-17 15:06:38 +01:00
Norman Feske
d370f56a77 Remove obsolete Trace::Session::subject_info RPC
Issue #3610
Fixes #4349
2021-12-17 15:04:49 +01:00
Stefan Kalkowski
2c569953d0 base: replace ELF flags bitfield with booleans
Instead of using a bitfield for storing rwx and skip boolean value,
take a boolean instead. This fixes a note giv]en by GCC 9.1 about
changes semantics of bitfields given as parameter by value on ARM.

Ref #4344
2021-12-17 15:04:48 +01:00
Sebastian Sumpf
75509d77b5 base-hw: Remove 'riscv_qemu' and move to 'genode-riscv'
issue #4312
2021-12-17 15:04:48 +01:00
Norman Feske
03047009b1 base: avoid implicit conversions
This patch is a prerequisite for compiling the code with
the warnings -Wconversion enabled.

Issue #23
2021-12-17 15:04:44 +01:00
Norman Feske
c79a59655d Add -Wconversion to strict build mode 2021-12-17 15:04:43 +01:00
Norman Feske
6d231597b4 allocator_avl.h: remove debug feature 2021-12-02 10:03:26 +01:00
Norman Feske
a0a1f6455a base/string.h: avoid fallthrough cases 2021-12-02 10:02:48 +01:00
Christian Helmuth
92b7be4d11 depot: update recipe hashes 2021-11-30 12:08:54 +01:00
Christian Helmuth
13dab699b1 base: invalidate entire range on VM-session detach
The requested guest-physical memory range may comprise multiple attached
dataspace regions, which must all be detached. This is not required for
the current vbox5 implementation, but for vbox6 as the current API
suggests these semantics.

This commit can be seen as intermediate fix as a real fix should change
the API to prevent long-running detach loops in core that may lock out
requests by other components.
2021-11-29 15:11:53 +01:00
Stefan Kalkowski
14de84fae6 base: be more restrictive with 'managing_system'
* Only give managing_system permission when all parent nodes of the
  corresponding component agree in doing so.
* Move the physical memory constrains heuristic from sandbox library to core

Fix #4335
2021-11-29 15:11:53 +01:00
Johannes Schlatow
7a2826a2fe base: fix use after free in Genode::Heap
Fixes genodelabs/genode#4334
2021-11-29 15:11:53 +01:00
Piotr Tworek
30b3ad218f virt_qemu: Use VirtIO fb driver instead of ramfb.
This driver should be better suited for VirtIO based board like
qemu_virt.
2021-11-29 15:11:53 +01:00
Norman Feske
dc39a8db62 base: introduce Allocator::try_alloc
This patch changes the 'Allocator' interface to the use of 'Attempt'
return values instead of using exceptions for propagating errors.

To largely uphold compatibility with components using the original
exception-based interface - in particluar use cases where an 'Allocator'
is passed to the 'new' operator - the traditional 'alloc' is still
supported. But it existes merely as a wrapper around the new
'try_alloc'.

Issue #4324
2021-11-29 15:11:52 +01:00
Josef Söntgen
98385a7658 allocator_avl: return 0 for improper size_at call
In case the given address is not the start of a block bail instead of
making improper size assumptions.

Issue #4325.
2021-11-29 15:10:53 +01:00
Norman Feske
231ac187fe base: introduce Ram_allocator::try_alloc
This patch replaces the 'Ram_allocator::alloc' RPC function by a
'try_alloc' function, which reflects errors as 'Attempt' return value
instead of an exception.

Issue #4322
Issue #3612
2021-11-29 15:10:53 +01:00
Norman Feske
959bcae557 base: add util/attempt.h utility
Fixes #4322
2021-11-29 15:10:52 +01:00
Norman Feske
694dff8a5c base: sort symbols/ld with LC_COLLATE=C 2021-11-29 15:10:52 +01:00
Christian Helmuth
68caa26407 virt_qemu: use "-device ramfb"
Issue #4282
2021-11-29 15:10:52 +01:00
Norman Feske
4cfd954e1e Remove dependency from 'which' utility
Debian declared the 'which' utility as deprecated.

Fixes #4319
2021-11-29 15:10:52 +01:00
Norman Feske
4df7e6adde util/list_model.h: Add update_list_model_from_xml
The new 'update_list_model_from_xml' function template simplifies the
use of the list model utility by alleviating the need for implementing a
custom policy class for each model. Instead, the transformation is done
using a few lambda functions given directly as arguments.

Issue #4317
2021-11-29 15:10:52 +01:00
Johannes Schlatow
2ecb09ba7e tool/run: move nic model to qemu_args file
Always instantiating a network device with id `net0`, removes the need to call
append_qemu_nic_args in run scripts unless we want to add forwarding
rules.

genodelabs/genode#4311
2021-11-29 15:10:52 +01:00
Johannes Schlatow
522a1cdc5b tool/run: read board-specific qemu args from file
Allow specifying additional qemu arguments for externally supported boards
(e.g. zynq_qemu) by adding a `qemu_args` file in the board-property directory.

The syntax of the qemu_args file is as follows:
- Arguments can appear in a single line or in multiple lines as the
  lines will be appended (separated by a whitespace) to the global
  qemu_args variable.
- If the line is prepended with a `foobar:` expression. The arguments
  are only added if the foobar spec is present.

Note, that a `-m` argument specified in the qemu_args file will
override the arguments provided by the run scripts.

genodelabs/genode#4311
2021-11-29 15:10:52 +01:00
Alexander Boettcher
533015b93e nova: support transfer of IA32_TSC_AUX MSR for vCPUs
The 32-bit MSR is returned by rdtscp in ecx register and used to detect
the CPU ID the timestamp was taken on.

Issue #4314
2021-11-29 15:10:52 +01:00
Stefan Kalkowski
b12b0ed93d imx8q_evk: remove board support from repository
Moved to separate repo at https://github.com/skalk/genode-imx/

Fix #4301
2021-11-29 15:10:51 +01:00
Johannes Schlatow
7917c5d9ec Remove zynq_qemu platform and zynq nic driver
Moved to separate repo at https://github.com/jschlatow/genode-zynq

Fixes genodelabs/genode#4280
2021-11-29 15:10:51 +01:00
Piotr Tworek
c38c2a6455 cxx: missing operator delete with align_val_t arg
When rebasing my local branch on top of sculpt-21.10 tag I've noticed
two problems.

The code in new_delete.cc does not include new header file. This works
fine with GCC, but fails with clang because std::align_val_t type is
not defined anywhere according to clang. It looks like GCC pulls this
header indirectly somehow.

The second problem can be seen if one disallows undefined symbols in
executables and shared_libraries. This can be seen with both GCC and
clang by adding --no-undefined to LD_OPT. With such change in place core
fails to link due to:

ld.lld: error: undefined symbol: operator delete(void*, std::align_val_t)
>>> referenced by thread.h:448 (/home/tworaz/devel/genode/repos/base-hw/src/core/kernel/thread.h:448)
>>>               thread.o:(Kernel::Core_main_thread::~Core_main_thread()) in archive debug/core-hw-virt_qemu.a
>>> referenced by thread.h:448 (/home/tworaz/devel/genode/repos/base-hw/src/core/kernel/thread.h:448)
>>>               thread.o:(non-virtual thunk to Kernel::Core_main_thread::~Core_main_thread()) in archive debug/core-hw-virt_qemu.a
>>> did you mean: operator delete(void*, unsigned long, std::align_val_t)
>>> defined in: debug/core-hw-virt_qemu.a(supc++.o)

If the code would somehow manage call such undefined symbol it'd crash.
Since I generally prefer link time failures to runtime crashes I link
all genode binaries with --no-undefined.

To fix this problem just add a dummy implementation of missing delete
operator.

Fixes #4298
2021-11-29 15:10:50 +01:00
Piotr Tworek
e748efacd8 reconstructible: Fix alignas specifier placement.
Alignas should be placed before the type. Placing it after it works for
GCC, but fails when building the same codee with clang. The error
message is:

reconstructible.h:48:27: error: 'alignas' attribute cannot be applied to types
    char _space[sizeof(MT)] alignas(sizeof(addr_t));
                            ^
Issue #4298
2021-10-15 15:45:52 +02:00
Christian Helmuth
abc9a2f232 depot: update recipe hashes 2021-10-14 13:46:25 +02:00
Norman Feske
6f1d3862cd base: introduce Env::try_session
The new 'Env::try_session' method mirrors the existing 'Env::session'
without implicitly handling exceptions of the types 'Out_of_ram',
'Out_of_caps', 'Insufficient_ram_quota', and 'Insufficient_cap_quota'.
It enables runtime environments like init to reflect those exceptions to
their children instead of paying the costs of implicit session-quota
upgrades out of the own pocket.

By changing the 'Parent_service' to use 'try_session', this patch fixes
a resource-exhaustion problem of init in Sculpt OS that occurred when
the GPU multiplexer created a large batch of IO_MEM sessions, with each
session requiring a second attempt with the session quota upgraded by
4 KiB.

Issue #3767
2021-10-14 11:02:12 +02:00
Martin Stein
f1b72d0281 cxx: define delete operator with alignm. arg
Using 'alignas' in declarations might cause GCC to request for an
implementation of 'operator delete(void*, unsigned long, std::align_val_t)'
although it might actually never be called. This commit adds a dummy
implementation to 'cxx/new_delete.cc' that does nothing more than printing an
error to the log that a proper implementation is missing. This approach is
coherent with our treatment of other global delete operators.

Ref #4217
2021-10-13 14:01:02 +02:00
Martin Stein
ebd140cacb reconstructible: respect alignment of payload
If one has an object X that has a minimum alignment requirement specified
through 'alignas' this requirement is normally inherited by objects that have
object X as member, and by those that have objects as member that have X as
member, and so on... . However, this chain used to get silently interrupted
(dropping the minimum alignment requirement to 8 again) at objects that are
managed with Genode::Reconstructible or Genode::Constructible. In order to fix
this, the commit ensures that Genode::Reconstructible (and therefore also
Genode::Constructible) has at least the minimum alignment requirement (using
'alignas') as the object it manages.

Ref #4217
2021-10-13 13:59:57 +02:00
Christian Helmuth
83c5648d33 depot: update recipe hashes 2021-08-30 15:00:39 +02:00
Johannes Schlatow
2b0bb6dda0 trace: comment x86 timestamp() implementations
Fixes genodelabs/genode#4243
2021-08-30 15:00:38 +02:00
Norman Feske
040628894c build: introduce GLOBAL_DEPS variable
The new varible can be used to trigger the rebuild of the entire target
whenever any of the listed files changes.

Fixes #4255
2021-08-30 15:00:37 +02:00
Johannes Schlatow
88b3880c77 base: fix shift overflow error in Bitfield::mask()
Fixes genodelabs/genode#4249
2021-08-30 15:00:35 +02:00
Johannes Schlatow
5e284bfb35 trace: disable tracing when owner disappears
* Disable trace source and release ownership on subject destruction.
* Note, since the policy module is also destroyed on descruction of the
  session component, the traced component must not access the policy
  module when acknowledging the disabled state (else: page fault).

Fixes genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Sebastian Sumpf
fd9bc43be1 ldso: Fix RISC-V support with 21.05 tool chain
- force inlining of more functions
- force -O2 for RISC-V (even if -O0 is set globally)
- intialize cxx guard after self relocation

issue #4094
2021-06-25 11:56:22 +02:00
Christian Helmuth
ece33d37f8 depot: update recipe hashes 2021-06-25 11:46:37 +02:00
Stefan Kalkowski
e7067050be base: extend cache maintainance functionality
Introduce two new cache maintainance functions:
* cache_clean_invalidate_data
* cache_invalidate_data
used to flush or invalidate data-cache lines.

Both functions are typically empty, accept for the ARM architecture.
The commit provides implementations for the base-hw kernel, and Fiasco.OC.

Fixes #4207
2021-06-25 11:43:41 +02:00
Norman Feske
5b85bd9602 mk: make LD_SCRIPT_DYN customizable
This way, a target.mk becomes able to override the default linker
script, e.g., for adding custom symbols.
2021-06-25 11:41:45 +02:00
Christian Helmuth
1d52bd017d depot: update recipe hashes 2021-05-28 14:16:46 +02:00
Stefan Kalkowski
6780cf0790 base: introduce array utility
Fixes #4170
2021-05-28 14:16:45 +02:00
Sebastian Sumpf
9209dfc9d5 ldso: output loaded objects of 'Shared_object' interface
When loading shared libraries via the 'Shared_object' interface display
all additionaly loaded libraries in case 'ld_verbose' is configured. Up
until now, only the loaded library was displayed. In order to determine
if a dependend library had arlready been loaded prior to loading the
'Shared_object' the reference counter is used.

fixes #4147
2021-05-28 14:15:26 +02:00
Christian Prochaska
4a4b754bf2 gcov: update to version 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
9c05cda6e7 tool_chain: update gcc to version 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Helmuth
777923f9bd depot: update recipe hashes 2021-05-10 11:18:12 +02:00
Norman Feske
2f9d430c00 base-linux: 64-bit ARM support
This patch adds support for running Genode/Linux on the AARCH64
architecture.

- The kernel-agnostic startup code (crt0) had to be extended to
  capture the initial stack pointer, which the Linux kernel uses
  to pass the process environment. This is in line with the
  existing startup code for x86_32 and x86_64.

- The link order of the host libraries linked to lx_hybrid
  programs had to be adjusted such that libgcc appears at last
  because the other libraries depend on symbols provided by
  libgcc.

- When using AARCH64 Linux as host, one can execute run scripts
  via 'make run/<script> KERNEL=linux BOARD=linux' now.

Issue #4136
2021-05-10 11:17:20 +02:00
Christian Helmuth
718f44ae5b Check max_len before dereferencing pointer in Cstring constructor
Fixes #4112
2021-05-10 11:17:20 +02:00
Norman Feske
516a9a6925 depot: update recipe hashes 2021-05-05 11:35:31 +02:00
Christian Prochaska
9b854e1496 Prevent recursive 'memset()' calls with gcc 10
Fixes #4125
2021-05-05 11:35:31 +02:00
Christian Prochaska
66e8f8d764 base: increase bss alignment to 8 bytes
Fixes #4127
2021-05-05 11:35:30 +02:00
Christian Prochaska
84e4cbb54c cxx: add 'strchr()'
Fixes #4122
2021-05-05 11:35:30 +02:00
Johannes Schlatow
2db94b8438 platform_drv/x86: support to disable MSI-X
+ disable for wifi driver MSI-X

Issue #4079
2021-05-05 11:35:28 +02:00
Christian Prochaska
190eafeaa6 base: handle 'unpack_string()' error in 'Arg::string()'
Fixes #4100
2021-05-05 11:21:43 +02:00
Norman Feske
efbed6f7bf depot: update recipe hashes 2021-04-20 12:10:58 +02:00
Sebastian Sumpf
80cf47d906 ldso: protect object list with mutex
When we allowed symbol resolution during exceptions, we used the shared
object lock to protect ELF object list manipulation (e.g., dlopen,
dclose) when executing exception unwinding code in the linker.
Unfortunately, sometimes libraries that are loaded by 'dlopen' may raise
exceptions in the process, leading to a deadlock within the unwind code.
In order to resolve this, we now protect the object list operations
(i.e., enqueue, removal, iteration) by a separate mutex. This allows
the shared object interface to throw exceptions.

issue #4071
2021-04-20 12:10:58 +02:00
Norman Feske
dc89ebf978 core: kernel-agnostic 'Mapping' type
This patch unifies the core-internal 'Mapping' type across all base
platforms.

As one minor downside on seL4, the diagnostic error messages when
observing faults other than page faults no longer print the faulting
thread and PD names.

Issue #2243
2021-04-20 12:10:57 +02:00
Norman Feske
4e714d3f3a base: handle cap depletion during session upgrade
When the own cap quota of a client does not suffice for a cap upgrade of
an existing session to a server, the client must issue a cap-resource
request to the parent. This logic was already in place for RAM quota but
was missing for cap quota.

Issue #4072
2021-04-20 12:10:57 +02:00
Sebastian Sumpf
9c9302e51d ldso: allow symbol resolution during dl_itera_phdr
When callback functions of `dl_iterate_phdr` required further jump slot
relocations this lead to a deadlock. Therefore, we allow the resolution
of further symbols from callback functions, but protect the ELF object
list during the iteration, which blocks any dynamic loading (e.g.,
dlopen/dlcose) of shared object by other threads while in program header
iteration.

fixes #4071
2021-04-20 12:10:57 +02:00
Norman Feske
468e7a825c base/cache.h: rename Cache_attribute to Cache
The short name is better because the type will become prominently
visible at the API.

Issue #2243
2021-04-20 12:10:31 +02:00
Norman Feske
f925fef17b base: Refine Range_allocator::alloc_aligned
This patch changes the 'alloc_aligned' interface as follows:

- The former 'from' and 'to' arguments are replaced by a single
  'range' argument.

- The distinction of the use cases of regular allocations vs.
  address-constrained allocations is now overed by a dedicated
  overload instead of relying on a default argument.

- The 'align' argument has been changed from 'int' to 'unsigned'
  to be better compatible with 'addr_t' and 'size_t'.

Fixes #4067
2021-04-20 12:03:04 +02:00
Tomasz Gajewski
f3f8d9a6de build system: support for CUSTOM_TARGET_DEPS 2021-04-20 12:03:03 +02:00
Norman Feske
99f4b3cd07 Debug macros for easy performance profiling
The debug macros 'GENODE_LOG_TSC' and 'GENODE_LOG_TSC_NAMED' allow for
the easy gathering of the TSC ticks consumed by the calling scope.

Fixes #4066
2021-04-20 12:03:03 +02:00
Norman Feske
49481dd3fb timer: restore semantics of periodic timeout 0
The 'Timer::Session::trigger_periodic' RPC function used to accept 0 as
a way to de-schedule the periodic processing. Several components such as
nitpicker relied on this special case. In "timeout: rework timeout
framework", the value of zero was silently clamped to 1, which has the
opposite effect: triggering signals at the maximum rate. This results in
a visible effect in Sculpt where the leitzentrale-nitpicker instance
produces a constant load of 2% CPU time.

This patch restores the original timer semantics by

- Documenting it in timer_session.h,

- Handling the case explicitly in the timer implementation, and

- Replacing the silent clamping of the unexpected value 0 passed
  to the timeout framework by a diagnostic error message.

Issue #3884
2021-04-20 12:03:03 +02:00
Norman Feske
dc8dd3396d base: move Xml_generator::Node::Node behind ABI
Fixes #4063
2021-04-20 12:03:03 +02:00
Norman Feske
5c5b56d1e0 depot: update recipe hashes 2021-03-12 12:08:24 +01:00
Alexander Boettcher
18182b11da base: exit loop on cpu session close
if session can't be closed immediately, e.g. if the service is provided by
a child (cpu_balancer) and not by the parent.

Issue #4029
2021-03-12 12:01:39 +01:00
Alexander Boettcher
9b5bedefc7 expanding_pd_session: remove cap warning message
which are caused often when a component runs a bit longer and has dynamic
resource usage, e.g. running Genode's tool chain.
2021-03-12 12:01:39 +01:00
Norman Feske
935bb36fe4 base: fix child destruction while close requested
This patch fixes a corner case where a child is destructed while a
asynchronous close request to a sibling server is still pending.

The child immediately discarded the session ID as the end of the
close-session processing, assuming that this ID is never to be needed
again. The session-state continues to exist to handle asynchrous close
protocol with the server.

However, if the child is destructed at this point (before the server
responded to the session request), the destruction of the child would
not cover the discharging of the session state because the session state
was no longer be part of the client's ID space. So once the asynchronous
close response from the server came in, the session state contained
stale information, in particular a stale closed_callback pointer.

The patch fixes the problem by deferring the discarding of the client ID
to the point where the session state is actually destructed. So the
session of a pending close response is covered by the child destructor.

Thanks to Pirmin Duss for reporting this issue along with a test
scenario for reproducing it!

Fixes #4039
2021-03-12 12:01:38 +01:00
Norman Feske
9de61e7014 base: detect truncated session args
This patch reflects the truncation of session arguments (e.g., by very
long session labels) by denying the session request.

Fixes #4037
2021-03-12 12:01:37 +01:00
Sebastian Sumpf
f68e655312 mk: link core to library archive instead of .o file
Do not link base and core libraries into on large relocatable .o file,
which is linked later to core - causing long link times. Create an
independent library archive out of the base and core libraries that can
be linked faster.

issue #4027
2021-02-23 12:17:04 +01:00
Norman Feske
64165d829e depot: update recipe hashes 2021-02-23 12:07:18 +01:00
Christian Helmuth
219809ffed base: refactor VM/vCPU API
Issue #3554
2021-02-23 12:07:18 +01:00
Christian Prochaska
59459e60e7 libc: pthread TLS optimizations
Fixes #4024
2021-02-23 12:07:17 +01:00
Sebastian Sumpf
ccd9ba4161 riscv: move CPU header from base-hw to base
issue #4021
2021-02-23 12:07:16 +01:00
Pirmin Duss
190b4784c5 openssl: do not depend on ARM CPU probing
With this commit libcrypto does not use ARM NEON extension as long as
SPECS includes "neon". arm_v7a does declare "neon" per default while
arm_v8a does.

Issue #3773
2021-02-23 12:07:16 +01:00
Sebastian Sumpf
f5cd12dcf9 base/base-hw: unify startup library builds
- Use 'select_from_repositories' for crt0.s of startup library
- Move RISC-V crt0.s to base (where the other archs are located)

issue #4019
2021-02-23 12:07:15 +01:00
Norman Feske
048a4625c5 base: remove stale spec/fpu_vfpv3.mk file 2021-02-23 12:02:45 +01:00
Sebastian Sumpf
fd0e6685fc riscv: Use Qemu and update to ISA v1.10
- remove Spike/BBL support in favour of Qemu (>=4.2.1)
- add 'riscv_qemu' board, remove 'spike' board'
- update to privileged ISA v1.10 (from v1.9.1)
- use direct system calls for privileged core threads (they call into
  the kernel and don't use mode changing system calls, i.e. 'ecall',
  semantics)
- use 'OpenSBI' semtantics for SBI calls (to machine mode) instead of
  BBL

issue #4012
2021-02-23 12:02:44 +01:00
Alexander Boettcher
18e282ab8a allocator_avl: avoid false dangling warnings
By first removing unused ranges, implicitly meta data allocations are freed
up. This leads to more unused slab blocks and freed up meta data allocations
in the avl tree.

Issue #4014
2021-02-23 12:02:44 +01:00
Alexander Boettcher
1e84b46c3f slab: add option to free empty blocks
explictly by a method

Issue #4014
2021-02-23 12:02:44 +01:00
Sebastian Sumpf
cb2e27f8e4 riscv: Fix link errors for Genode nightly
- add .got filter rule for trace policies, otherwise ld raises a
  segmentation fault
- force soft-float for binary sources (SRC_BIN)

issue #4012
2021-02-23 12:02:43 +01:00
Alexander Boettcher
c58acd0b2b allocator_avl: avoid memory leakage
Fixes #4013
2021-02-23 12:02:43 +01:00
Christian Helmuth
210f5073e3 platform_drv.inc: check board=pc not spec=x86
Fixes run scripts for Linux/x86.
2021-02-23 12:02:43 +01:00
Alexander Boettcher
d186e4361e Measure TSC variance of CPUs in test-smp
Issue #3965
2021-02-23 12:02:42 +01:00
Emery Hemingway
2acfacb639 genode_dyn.ld: do not emit PHDR segment
Recent versions of binutils check that PHDR segments are covered
by a LOAD segment. In this case the unloaded PHDR segment can be
ommited.

Fix #4003
2021-02-23 12:02:42 +01:00
Alexander Boettcher
e3233a4824 ldso: turn deadlock message into Linker message
Issue #3991

[init -> ...] Error: LD: jump slot relocation failed for symbol: 'XYZ'
[init -> ...] Error: deadlock ahead, mutex=0x161860, return ip=0xeb870

turns into:

[init -> ...] Error: LD: jump slot relocation failed for symbol: 'XYZ'
[init -> ...] Error: Uncaught exception of type 'Linker::Not_found'
[init -> ...] Warning: abort called - thread: ep

Fixes #4002
2021-02-23 12:02:42 +01:00
Christian Helmuth
91a7fb1da7 cxx: localize operator new(unsigned long) in supc++.o
Otherwise, base code in ld.lib.so may accidentally use 'new' without
passing an allocator.
2021-02-23 12:02:41 +01:00
Norman Feske
8cc2662aac Remove support for the Muen separation kernel
Fixes #3995
Fixes #3994
2021-02-23 11:55:44 +01:00
Christian Helmuth
9f3c5d92b3 base: cleanup Noncopyable declarations/coding style 2021-02-23 11:51:57 +01:00
Alexander Boettcher
6789ce8b83 platform_drv(x86): support dynamic reconfiguration
Fixes #3989
2021-02-23 11:51:39 +01:00
Norman Feske
a981fb864c depot: update recipe hashes 2021-01-25 14:00:43 +01:00
Norman Feske
ff28ed0f8c base: avoid superfluous postprocessing of ldso
Even though the binary patching of ldso must be performed only once,
this postprocessing step was executed on each run because the
postprocess.tag rule is phony (the tag file is never created).
This patch removes this phony behavior by creating the tag file.

Issue #3974
2021-01-25 14:00:43 +01:00
Tomasz Gajewski
693a4d78dd lib.mk: avoid checking abi on every build
Fixes #3974
2021-01-25 14:00:43 +01:00
Piotr Tworek
8b172bf22e base: Explicitly state ELF segment flags
The code in base-hw/src/bootstrap/platform.cc uses segment flags for
identification purposes. Based on this information the code decides
what to do with each segment. Unfortunately the linker script does
not actually ensure the flags for a specific named segment match
expectations. The code relies on implicit linker behaviour.
This implicit behaviour can vary between linkers. This breaks
arm_v7a base-hw builds linked with LLVM's lld linker. The segment
named "ro" ends up having writeable flag set when using LLD.

This patch ensures that all ELF segments in genode.ld have their
required perimssion flags set explicitly.

Fixes #3988
2021-01-25 13:58:10 +01:00
Piotr Tworek
80e8cf99e2 base: Make Genode::List clang friendly.
Clang is generally fine with Genode::List and compiles code using it
without emitting any warnings. There is however one exception. Clang
fails hard when building base-hw/src/core/kernel/object.cc.
This is due to a call to Genode::List::remove made from
Object_identity::invalidate function. The error message clang
produces is:

  list.h:96:33: error: 'Genode::List<Kernel::Object_identity_reference>::Element::_next'
  is not a member of class 'const Kernel::Object_identity'
                              _first = le->List::Element::_next;
                                           ~~~~~~~~~~~~~~~^

When we look at the declaration of the Kernel::Object class on which
the remove method is called. as expected it does inherit Genode::List:

using Object_identity_list
	= Genode::List<Kernel::Object_identity>;

class Kernel::Object : private Object_identity_list
{
...
}

Given the error message we see that List::Element should be resolved to
Genode::List<Kernel::Object_identity>::Element, and not
Genode::List<Kernel::Object_identity_reference>::Element. But how does
clang manage to figure out we're talking about Object_identity_refecence
list here? Well, I admit I don't know the exact steps it takes to arrive
at this conclusion, but it is not entirely wrong. If we take a look at
what Kernel::Object_identity is we'll see:

class Kernel::Object_identity
: public Object_identity_list::Element,
  public Kernel::Object_identity_reference_list
{
...
}

Where as one can guess Object_identity_reference_list is defined as:

using Object_identity_reference_list
	= Genode::List<Object_identity_reference>;

Long story short Kernel::Object has Genode::List of both Kernel::Object_identity
and Kernel::Object_identity_reference in its inheritance chain and clang
is not really sure to which of those the code refers to in
Genode::List::remove method by using List::Element::.

The fix for this is relatively simple, explicitly state the full type of
the base class the code intends to refer to. Replacing List::Element,
with List<LT>::Element makes the code buildable with both clang and GCC.

Fixes #3990
2021-01-25 13:58:10 +01:00
Stefan Kalkowski
bdd923406f base: remove SPEC variables of boards (fix #3971)
* Remove SPEC declarations from mk/spec
* Remove all board-specific REQUIRE declaratiions left
* Replace [have_spec <board>] run-script declarations with have_board where necessary
* Remove addition of BOARD variable to SPECS in toplevel Makefile
* Move board-specific directories in base-hw out of specs
2021-01-25 13:58:09 +01:00
Christian Helmuth
6cfaac182a Remove Cpu_session::Native_cpu definition from API
This type can be a forward declaration in the public API because its
definition is required only in kernel-specific code.

Related to #3979
2021-01-25 13:58:09 +01:00
Alexander Boettcher
5f7fe7498f platform_drv: add mmio delayer support
required after power on and function level reset

Issue #3963
2021-01-25 13:48:08 +01:00
Norman Feske
f57519397b Remove Pd_session::Native_pd definition from API
This type can be a forward declaration in the public API because its
definition is required only in kernel-specific code.

Fixes #3979
2021-01-25 12:51:54 +01:00
Tomasz Gajewski
98798f18b5 Fix minor inconsistencies in mk files
Fixes #3972
2021-01-25 12:50:54 +01:00
Christian Helmuth
8bed4c1d54 base: support hexa-decimal values in ascii_to(long)
This aligns the behavior of ascii_to(long&) with the behavior of
unsigned integer types, e.g., when parsing XML nodes into signed long
variables.
2021-01-25 12:50:54 +01:00
Christian Helmuth
1bef11accf depot: update recipe hashes 2020-12-18 09:10:52 +01:00
Alexander Boettcher
c5de2acf57 vm_session(x86): support cstar register
Fixes #3964
2020-12-09 14:02:12 +01:00