Compare commits

..

1873 Commits

Author SHA1 Message Date
Michael Mueller
23c0069588 Updated recipe for mxtasking to include new header files. 2024-10-28 13:42:24 +01:00
Michael Mueller
0fb4f00a8b Microbenchmark creating synthetic work to measure impact of CPU core allocator on application performance. 2024-10-24 14:35:10 +02:00
Michael Mueller
8904022415 Scenario with blinktree getting interference from antagonist. 2024-10-24 14:33:16 +02:00
Michael Mueller
4d0acbf4e5 Baseline scenario for B-link tree server. 2024-10-24 14:31:30 +02:00
Michael Mueller
c87c607003 Mutlithreaded netty server. 2024-10-24 14:30:38 +02:00
Michael Mueller
92f5d52134 More hash updates. 2024-10-24 14:29:30 +02:00
Michael Mueller
20da017b17 Allow use of aligned new in MxTasking. 2024-10-24 14:28:52 +02:00
Michael Mueller
7ffafddee7 Updated hash for NOVA. 2024-10-24 14:28:23 +02:00
Michael Mueller
4f364c4548 Added antagonist to create synthetic interference on caches, CPU and memory controllers. 2024-10-24 14:28:01 +02:00
Michael Mueller
15f7092285 Revised blinktree to include core allocation times in measurements. 2024-10-24 14:26:41 +02:00
Michael Mueller
d3377454d6 Changed compilation flags for blinktree. 2024-10-24 14:25:25 +02:00
Michael Mueller
635d1a637c Networked version of B-link tree benchmark. 2024-10-24 14:24:36 +02:00
Michael Mueller
ee5502ed34 Updated hashes. 2024-10-24 14:22:47 +02:00
Michael Mueller
0f51994e54 Removed log output from sandbox. 2024-10-24 14:22:02 +02:00
Michael Mueller
b2283a69e0 Fixed use after free in ram_file_system. 2024-10-24 14:20:57 +02:00
Michael Mueller
46fc5f748a Updated VSCode config. 2024-09-15 19:51:03 +02:00
Michael Mueller
3019ed2688 Rewrote some microbenchmarks. 2024-09-15 19:50:32 +02:00
Michael Mueller
7408bd2cd5 Updated more hashes. 2024-09-15 19:49:04 +02:00
Michael Mueller
809b54e524 Implemened stub for NUMA-aware try_alloc. 2024-09-15 19:48:13 +02:00
Michael Mueller
e7181adc88 Adapted blinktree application to changes in MxTasking. 2024-09-15 19:47:21 +02:00
Michael Mueller
7aaffa7f20 Enable debugging flag for MxTasking. 2024-09-15 19:46:28 +02:00
Michael Mueller
a71cc4fd0d Remove SSE3 from compile flags for NOVA as this caused a bootloop on some machines. 2024-09-15 19:45:55 +02:00
Michael Mueller
62f033ddaf Removed console log due to occassional livelocks. 2024-09-15 19:45:19 +02:00
Michael Mueller
e69d5847f2 Reduced time quantum for NOVA. 2024-09-15 19:44:43 +02:00
Michael Mueller
6e6c4411ce Added TOPO as provided service and increase RAM quota. 2024-09-15 19:44:18 +02:00
Michael Mueller
00c9932d5c Updated hashes. 2024-09-15 19:42:10 +02:00
Michael Mueller
0d9f359ec9 Increased number of caps available to core. 2024-09-15 19:40:48 +02:00
Michael Mueller
8120c5b47d mxtasking: Always use branch yritys. 2024-03-12 12:50:38 +01:00
Michael Mueller
060c9f44b1 hoitaja: Fixed compile error. 2024-03-12 11:13:41 +01:00
Michael Mueller
a788e80fee base-nova: Enable SSE3 2024-03-11 14:49:12 +01:00
Michael Mueller
0a0263c70a Added microbenchmark to evaluate the overhead for core allocation and withdrawal. 2024-03-11 14:45:51 +01:00
Michael Mueller
48b2d725a8 hoitija: Removed old TASKING service. 2024-03-11 14:44:11 +01:00
Michael Mueller
13c22bc404 base-nova: Added new hypercalls for reserving a specific CPU, creating a habitat and querying the physical CPU ID. 2024-03-11 14:34:59 +01:00
Michael Mueller
0dbbca2af4 hoitaja: Use global affinity space for filtering affinities. 2024-03-11 14:31:54 +01:00
Michael Mueller
b38f6ee39a hoitaja: Create habitat on startup. 2024-03-11 14:30:52 +01:00
Michael Mueller
cafee5c615 hoitaja: Print affinity of newly created cell to log. 2024-03-11 14:30:09 +01:00
Michael Mueller
d11ff63b6d Simple component to create background noise for benchmarking. 2024-03-11 14:29:26 +01:00
Michael Mueller
77cf5143ea mxtasking: Added missing includes in target.mk. 2024-03-11 14:27:39 +01:00
Michael Mueller
f5ed9c1e43 base: Print label of component that has exceeded its quota. 2024-03-11 14:25:12 +01:00
Michael Mueller
6609ad03e6 Added new RPCs to query global affinity space and physical CPU IDs from TOPO session. 2024-03-11 14:24:17 +01:00
Michael Mueller
79bdea2977 hoitaja: Upon starting a new child component, create a cell for it at the hypervisor. 2024-01-30 18:08:17 +01:00
Michael Mueller
90fd2368d0 base-nova: Changed mapping of cores so that for each cores x and y, it is guaranteed that if x is greater than y, the NUMA ID of x is always greater than or equal to that of y. 2024-01-30 18:04:29 +01:00
Michael Mueller
20be3b397f base: Changed API for cell management. 2024-01-30 18:00:14 +01:00
Michael Mueller
5ddeb09107 base-nova: Changed hypercall interface for cell management to reflect the change of API in the hypervisor. 2024-01-30 17:58:42 +01:00
Michael Mueller
e7d6363362 base-nova: Synchronize output to serial console with the hypervisor. 2024-01-30 17:56:51 +01:00
Michael Mueller
1fd735989f base-nova: Adapted PD session to the change of NOVA's API for cell management. 2024-01-30 17:55:25 +01:00
Michael Mueller
c455e9266e base: Added operatiors for comparing affinities. 2024-01-30 17:53:41 +01:00
Michael Mueller
a2a03fafd2 Hoitaja: Update core allocation range in kernel when affinity is changed due to growing or shrinking a cell. 2024-01-18 18:55:35 +01:00
Michael Mueller
d1e7654652 Hoitaja: A Hoitaja cell now creates a kernel object for the cell. This way the core affinity of a cell, that was calculated by Hoitaja, is communicated to the kernel's core allocator. 2024-01-18 18:54:37 +01:00
Michael Mueller
5cbac9f128 base: New RPCs to allow to associate a PD with a Cell and growing and shrinking a cell's core allocation. 2024-01-18 18:51:49 +01:00
Michael Mueller
fe4c8e1dfe NOVA: Added new hypercalls for Cell management. 2024-01-18 18:49:49 +01:00
Michael Mueller
3c133b459e NOVA: Added new hypercalls for cell management and CPU core allocation. 2023-12-15 14:35:04 +01:00
Michael Mueller
705f262eb9 Always use branch tukija for NOVA. 2023-12-15 14:27:57 +01:00
Michael Mueller
539bb07995 Made TASKING service, Suoritin, a member of the Habitat rather than Hoitaja. This way the habitat has direct access to the Suoritin sessions without sending pointers around. Also added new entrypoint for Hoitaja's timer. 2023-10-13 19:01:45 +02:00
Michael Mueller
80bde5fd90 Updated session interface and fixed off-by-one bug in interface allocator. 2023-10-13 18:59:29 +02:00
Michael Mueller
02de7a4e56 Suoritin: Redefined TASKING session interface. 2023-10-13 18:58:49 +02:00
Michael Mueller
ec52fd1e8b Suoritin: Added file description to component.h. 2023-10-10 17:37:58 +02:00
Michael Mueller
29eaa64d2e Added Suoritin client component for testing. 2023-10-10 16:41:38 +02:00
Michael Mueller
7a127d5402 Moved code into a header file. 2023-10-10 16:39:59 +02:00
Michael Mueller
cd124b4860 Updated vscode run script to include Suoritin example. 2023-10-10 16:39:19 +02:00
Michael Mueller
22b814489c Removed source file from Hoitaja's Makefile due to refactoring. 2023-10-10 16:38:33 +02:00
Michael Mueller
1bcc85e556 Announce Suoritin as one of Hoitaja's services. 2023-10-10 16:37:41 +02:00
Michael Mueller
e614c0fb33 Implemented session and root component for Suoritin 2023-10-10 16:36:14 +02:00
Michael Mueller
0b5b89a469 Made Suoritin tasking service more verbatim for debugging. 2023-10-10 16:35:02 +02:00
Michael Mueller
f362843245 Fixed broken link for paper 2023-10-10 11:48:57 +02:00
Michael Mueller
1205032bd6 Use absolute path to resize2fs as on Debian /sbin is not in PATH by default. 2023-08-07 18:33:24 +02:00
Michael Mueller
6f60db5209 blinktree: More complex scenario using TRACE service and top. 2023-08-07 18:31:51 +02:00
Michael Mueller
02dd7fdb78 Updated vscode configuration. 2023-08-07 18:23:21 +02:00
Michael Mueller
1b3eef72f7 Example for using the low-level interface for PMCs. 2023-08-07 18:18:58 +02:00
Michael Mueller
d1ee1e82a4 top: Changed CPU configuration to work with topology used by blinktree. 2023-08-07 18:14:40 +02:00
Michael Mueller
667e272a8a hoitaja: Added Suoritin as service to Hoitaja. 2023-08-07 18:13:34 +02:00
Michael Mueller
6b31730301 Removed default memory configuration for qemu. 2023-08-07 18:12:51 +02:00
Michael Mueller
ecf760f4b5 Print directories for verbose build to create build.log for vscode. 2023-08-07 18:11:32 +02:00
Michael Mueller
e4f43c1edd hoitaja: Added new CPU interface providing abstraction for task-parallelism. 2023-08-07 18:09:58 +02:00
Michael Mueller
278fbb2281 hoitaja: Added state_handler callback for notifying hoitaja about a cells construction or termination. 2023-08-07 18:07:49 +02:00
Michael Mueller
025a7ce667 hoitaja: Dummy classes for functions to be implemented later. 2023-08-07 18:06:26 +02:00
Michael Mueller
fd216a5613 hoitaja: Implemented core (re-)allocation upon Cell construction/destruction. 2023-08-07 18:05:14 +02:00
Michael Mueller
01cf697875 hoitaja: First version of static core allocator. 2023-08-07 18:03:45 +02:00
Michael Mueller
d603ea90c0 hoitaja: Added class representing Cells. 2023-08-07 18:03:11 +02:00
Michael Mueller
6f3449f568 hoitaja: Fixed include error in cell_controller.h. 2023-08-07 18:02:07 +02:00
Michael Mueller
2dd211a1b3 Updated hash for shim. 2023-08-07 18:00:09 +02:00
Michael Mueller
c39a9201e7 Added priorities to yield testing scenario. 2023-08-07 17:59:31 +02:00
Michael Mueller
0f3368cbe4 base: Updated symbols table. 2023-08-07 17:58:03 +02:00
Michael Mueller
260079b5c4 Print directory when VERBOSE= is given on make cmdline. 2023-08-07 17:57:34 +02:00
Michael Mueller
550c376e40 sandbox: Refactored sandbox library to make it extensible via inheritance. 2023-08-07 17:56:28 +02:00
Michael Mueller
b711e0d091 Example for a cell that voluntarily terminates after a period of time. 2023-08-07 17:54:24 +02:00
Michael Mueller
4ee2070573 Example code for persistent cell. 2023-08-07 17:53:44 +02:00
Michael Mueller
e58e468808 blinktree: Use PMCs by default. 2023-08-07 17:52:04 +02:00
Michael Mueller
6d53c9c874 blinktree: Updated PMC definitions for AMD Epyc. 2023-08-07 17:51:37 +02:00
Michael Mueller
1245236ee2 Convenience scenario creating build.log for vscode's Intellisense. 2023-08-07 17:49:48 +02:00
Michael Mueller
fa1e794c4d Example scenario for PMC usage. 2023-08-07 17:48:38 +02:00
Michael Mueller
df48b8b963 hoitaja: Example scenario for long-term scheduling of cells. 2023-08-07 17:47:58 +02:00
Michael Mueller
44166feb15 base: Updated hash. 2023-08-07 17:46:42 +02:00
Michael Mueller
316f12855a base: Added RPC to allow to change affinity of CPU and TOPO session after creation. This is necessary, as a cell might be pushed out of its original CPU region by Hoitaja. 2023-08-07 17:45:54 +02:00
Michael Mueller
e002117098 Implemented Genode::print for Affinities to make printing affinities to console more convenient. 2023-08-07 17:41:51 +02:00
Michael Mueller
005b3dfdf4 base_nova: Include hotfix for performance counters. 2023-08-03 13:03:11 +02:00
Michael Mueller
2c5ebb131c Makefile for Hoitaja. 2023-06-13 18:52:04 +02:00
Michael Mueller
a72727fd45 Defined method prototypes for the internal interfaces of Hoitaja. 2023-06-13 18:51:25 +02:00
Michael Mueller
aa183af6a4 Added run script to produce dry-run output for VSCode. 2023-06-13 18:47:58 +02:00
Michael Mueller
1f7bfe1426 Benchmarks to evaluate cost of resource yield requests and resource allocation notifications. 2023-06-13 18:46:55 +02:00
Michael Mueller
c1b8001cb9 Small test app for new resource allocation interface. 2023-06-13 18:44:59 +02:00
Michael Mueller
5c13d93050 Refactored sandbox implementation to make its functionality available to alternative implementations of Init, e.g. Hoitaja. 2023-06-13 18:44:04 +02:00
Michael Mueller
04264bc678 Fixed bug in enumeration of performance counters. 2023-06-13 18:40:38 +02:00
Michael Mueller
fb03597775 Updated symbol table to include new symbols for class Child. 2023-06-13 18:40:07 +02:00
Michael Mueller
c72849ee95 Provide children with information about what new resources have been allocated. 2023-06-13 18:39:23 +02:00
Michael Mueller
d72527809b Updated NOVA. 2023-06-01 15:52:26 +02:00
Michael Mueller
a913fbd62c Removed debug messages from performance counter code. 2023-03-30 15:57:25 +02:00
Michael Mueller
32a4d09d04 Added README for EalánOS. 2023-03-27 17:31:05 +02:00
Michael Mueller
412cf94f59 Added simple example for using the performance counter syscalls in EalánOS. 2023-03-27 17:22:00 +02:00
Michael Mueller
561a2ddbf9 blinktree: Added scenario from FOSDEM talk. 2023-03-27 17:19:49 +02:00
Michael Mueller
f91d1900ac mxtasking: Updated revision and hash. 2023-03-27 17:19:14 +02:00
Michael Mueller
3d41f682a6 blinktree: Updated Makefile to include performance counters. 2023-03-27 17:16:21 +02:00
Michael Mueller
aeb402ad50 libc: Increased stack size. 2023-03-27 17:15:31 +02:00
Michael Mueller
7ac39fb7a7 base-nova: Use larger frame limit for NOVA. 2023-03-27 17:15:00 +02:00
Michael Mueller
a088b5696c base-nova: Updated Makefile. 2023-03-27 17:14:25 +02:00
Michael Mueller
48543e93cc base: Added symbols for performance counter syscalls to ld script. 2023-03-27 17:13:36 +02:00
Michael Mueller
7cc6d4e828 base-nova: Added syscall for querying the CPU vendor. This is helpful to implement CPU vendor-specific features in userspace drivers. 2023-03-27 17:11:00 +02:00
Michael Mueller
9dc7af6ba8 base: Preserve 1MB more of memory for core to accomodate for larger memory consumption by TOPO. 2023-03-27 17:09:41 +02:00
Michael Mueller
3f690a1e32 base: Increased RAM quota for TOPO session to accomodate for larger CPU counts. 2023-03-27 17:08:04 +02:00
Michael Mueller
d74754adb5 base: Use define MAX_SUPPORTED_CPUS for dimensioning affinity array. 2023-03-27 17:07:13 +02:00
Michael Mueller
dec071829d blinktree: Implemented performance counter interface for Genode. 2023-03-27 17:05:05 +02:00
Michael Mueller
b9e1da2ad1 base: High-level interface for hardware performance counters. 2023-03-27 17:00:58 +02:00
Michael Mueller
e5c8167992 base-nova: Added hypercalls to access hardware performance monitoring counters. 2023-03-27 17:00:18 +02:00
Michael Mueller
0f1002fab8 base: Set affinity of platform thread according to its location. 2023-03-27 16:57:48 +02:00
Michael Mueller
072a65623d base: Added more detailed error message on insufficient quota. 2023-03-27 16:55:57 +02:00
Michael Mueller
43df00ea55 base: Zero attached dataspace upon creation. 2023-03-27 16:54:37 +02:00
Michael Mueller
2042a2083f blinktree: Always stop measurement on core 0. 2023-03-27 16:51:26 +02:00
Michael Mueller
b2397cfac3 Updated parameters for blinktree benchmark. 2023-03-27 16:50:41 +02:00
Michael Mueller
917c5fa261 blinktree: Compile with clang. 2022-12-08 11:25:26 +01:00
Michael Mueller
32f42d693a mxtasking: Made hello world example working again. 2022-12-08 11:23:26 +01:00
Michael Mueller
fb91e40f0c libports: Ported libpfm4 to Genode. 2022-12-08 11:20:24 +01:00
Michael Mueller
84a5e1ac0a NOVA: Added syscall to read and write MSRs. This enables core to use performance counters. 2022-12-08 11:18:30 +01:00
Michael Mueller
e0a9f13197 core: Clear dataspace on free() by default. 2022-12-08 11:15:37 +01:00
Michael Mueller
0fc7184eb9 base: Added missing symbols. 2022-11-29 12:34:43 +01:00
Michael Mueller
6603f4d147 stdcxx: Use atomics for 64-bit integers instead of 32-bit. 2022-11-29 12:33:50 +01:00
Michael Mueller
e539d12b86 mxtasking.port: Updated revision. 2022-11-29 12:32:46 +01:00
Michael Mueller
a73bcf8bc1 mxtasking: Updated hash. 2022-11-29 12:32:10 +01:00
Michael Mueller
484d6714c3 mxtasking: Use clang to build. 2022-11-29 12:31:53 +01:00
Michael Mueller
9d0298f5fd libc and stdcxx: added missing symbols used by clang. 2022-11-29 12:31:26 +01:00
Michael Mueller
7144a96a00 core-nova: Removed debug messages. 2022-11-29 12:28:59 +01:00
Michael Mueller
cd7780fd50 libc: Allocate memory cacheline-aligned by default to prevent false sharing. 2022-11-29 12:27:18 +01:00
Michael Mueller
2a8fe2b335 blinktree: Updated run script to include topology service. 2022-11-29 12:26:00 +01:00
Michael Mueller
e2ddc82102 blinktree: Use Genode::timestamp() instead of std::chrono's functions. 2022-11-29 12:24:55 +01:00
Michael Mueller
70869735d7 blinktree: Start measurement via task to avoid measuring worker thread creation. 2022-11-29 12:23:58 +01:00
Michael Mueller
195be5ff6e core: Export interface for explicit thread migration and pinning. 2022-11-29 12:21:02 +01:00
Michael Mueller
a894a008eb core: Allocate dataspaces with cache-alignment. 2022-11-29 12:18:50 +01:00
Michael Mueller
2115c5557f core: Allow pinning and migration of threads from userspace components. 2022-11-29 12:17:51 +01:00
Michael Mueller
c2c66bbcb5 core-nova: Use shorter time quantum. 2022-11-29 12:16:53 +01:00
Michael Mueller
a8d64786bd core-nova: Fixed wrong report of memory ranges for NUMA nodes. 2022-11-29 12:15:09 +01:00
Michael Mueller
1746f55306 core: Removed zeroing of new dataspace, as this takes a lot of time for huge dataspaces. 2022-11-29 12:14:16 +01:00
Michael Mueller
9980c4f0b5 blinktree: Print runtime parameters at start. 2022-11-29 12:11:44 +01:00
Michael Mueller
f4e1b9faaa Updated makefiles and ABI symbols for base. 2022-10-20 17:04:52 +02:00
Michael Mueller
e4041147ff core: New heap allocator for NUMA-regional allocations. 2022-10-20 17:03:46 +02:00
Michael Mueller
59d06871a3 nova: Store memory ranges for NUMA nodes. 2022-10-20 17:02:27 +02:00
Michael Mueller
0761449e9f core: Extended Ram_allocator by NUMA-specfic allocation and deallocation. 2022-10-20 17:01:48 +02:00
Michael Mueller
63d6827f16 core: Added interface to allocate memory from a given NUMA region. 2022-10-20 17:00:30 +02:00
Michael Mueller
953afdaff3 topo: Added RPC to query the NUMA information to a given NUMA node ID. 2022-10-20 16:58:45 +02:00
Michael Mueller
20ef1af61b vscode: Added file associations for C++ header files without suffix. 2022-10-18 15:40:32 +02:00
Michael Mueller
310418667a vscode: Added configuration for IntelliSense. 2022-10-18 15:37:53 +02:00
Michael Mueller
7920207bdb thread_test: Resolved ambiguity of uint_16t. 2022-10-18 15:36:53 +02:00
Michael Mueller
f3301f0049 nova: Fixed garbled CPU-NUMA mapping. 2022-10-17 18:52:09 +02:00
Michael Mueller
5866364d6b Merge branch 'master' into ealan to sync with upstream. 2022-10-14 16:56:15 +02:00
Michael Mueller
b8285e34fb nova: Updated ports file to latest NOVA version. 2022-10-14 16:49:48 +02:00
Michael Mueller
14f6f35eba nova: Do not use vanilla version, as we need custom extensions that are not merged yet. 2022-10-14 14:50:57 +02:00
Michael Mueller
f38762f9f0 Merge branch 'master' of github.com:mmueller41/genode 2022-10-14 14:31:37 +02:00
Michael Mueller
36663b0856 Updated hash for MxTasking. 2022-10-14 13:55:54 +02:00
Michael Mueller
b35664e0f4 nova: Allocate pages for Report ROM module depending on max count of CPUs supported by NOVA. 2022-10-14 13:53:58 +02:00
Michael Mueller
bad3ae4bd0 Expanded thread playground scenario with topology session. 2022-10-13 16:11:47 +02:00
Michael Mueller
51818bd0fc Added source file for Topo_session_component to source includes for NOVA. 2022-10-13 16:10:31 +02:00
Michael Mueller
a81b3198ac Added topology service to Libc::Env. 2022-10-13 16:08:57 +02:00
Michael Mueller
4673f0354e Removed redundant NUMA affinity attribute from class thread. The topology service provides this info now. 2022-10-13 16:08:19 +02:00
Michael Mueller
fa7e2a0e5d Fixed remapping skipping every second virtual CPU ID. 2022-10-13 16:01:51 +02:00
Michael Mueller
90b921b3cd Automatically create a topology session when a new component is created. 2022-10-13 16:00:18 +02:00
Michael Mueller
f2386c623e Fixed confused affinity spaces and locations. 2022-10-13 15:58:59 +02:00
Michael Mueller
e2e6153e7e Renamed Genode::Node to Topology::Numa_region to avoid name clash with VFS plugin. 2022-10-13 15:56:13 +02:00
Christian Helmuth
9079a083d2 depot: update recipe hashes 2022-10-13 12:35:27 +02:00
Norman Feske
ee969efe5f News item for Sculpt 22.10 2022-10-13 12:35:27 +02:00
Norman Feske
fd174d7e92 Update Sculpt documentation to version 22.10 2022-10-13 12:35:27 +02:00
Martin Stein
e052dc282b Revert "nic_router: incremental L4 checksum updates"
This reverts commit 9a37ccfe29 except for the
new declarations in public headers (in order to not change any APIs again).

We revert the commit as we found that there are corner cases in which it
produces a bad UDP checksum. The bad UDP checksum was observed via Wireshark at
a TFTP server in a Sculpt 22.10 Debian 11 VM on the first request of fetching a
file with the TFTP client of the uboot on our iMX8 test board.

Ref #4636
2022-10-13 12:35:27 +02:00
Christian Helmuth
847266d027 depot: update recipe hashes 2022-10-12 14:31:50 +02:00
Christian Helmuth
f53daa4450 Remove vbox6-capture from sculpt 2022-10-12 14:19:43 +02:00
Christian Helmuth
2fa547cdea pkg/vbox6-capture: adapt to current pkg/vbox6 2022-10-12 12:20:54 +02:00
Sebastian Sumpf
ac9ca67861 acpica: Increase RAM quota
Increase RAM quota to 6MB.

issue #4631
2022-10-12 12:09:37 +02:00
Josef Söntgen
a420670217 pci_decode: disable MSI on HDAUDIO cards
According to OpenBSD's azalia driver some AMD HDAudio devices do not
play nice with MSIs although the capability is set. At least the
0x1457 device was tested and worked using GSIs only.

genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Stefan Kalkowski
bc1e231775 platform_drv: implement PCI powering and reset
Ref genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Alexander Boettcher
8f0a012345 acpica: adjust to new platform driver
genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Alexander Boettcher
3e8ffe179b pci_decode: check sys_rom on boot
If the ROM is already available, no signal will wakeup the pci_decode app on
sigh registration.

 genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Sebastian Sumpf
1286b967ed virtualbox5/6: handle NIC setup correctly
During initialization _handle_link_state may be called concurrently from EMT and
"nic_ep" (signal handler). Therefore, sent signal to "nic_ep" instead of calling
_handle_link_state from EMT thread.

issue #4632
2022-10-12 12:09:37 +02:00
Martin Stein
c83f307b62 nic_router: consider DHCP client optimization
Some DHCP clients (Debian VM in Sculpt) persistently store the last lease they
obtained and try to directly DHCP REQUEST it on a new startup whithout doing
DHCP DISCOVER beforehand. In case the NIC router doesn't know about the lease
anymore (timeout, new router instance), the router used to just ignore the DHCP
REQUEST. This led to significant delays in the network startup of the client
(delayed retries until give-up and DHCP DISCOVER). With this commit, the router
answers such packets with a DHCP NAK instead, causing the client to directly
switch to DHCP DISCOVER.

Fixes #4634
2022-10-12 12:09:37 +02:00
Norman Feske
5dfd0274b9 sculpt: avoid depot queries during installation
This patch removes the intermediate querying of the depot while the
installation of packages is in progress. This avoids misleading warning
messages and reduces superfluous file-system load during the
installation of large packages.

Issue #4631
2022-10-12 12:09:37 +02:00
Norman Feske
0ccf11256f sculpt: remove vbox5 from default index
Issue #4631
2022-10-12 12:09:37 +02:00
Sebastian Sumpf
7f0c89f378 pci_decode: enable all bridges
set I/O port, MMIO, and bus master to enabled for bridges where
disabled.

issue #4578
2022-10-12 12:09:37 +02:00
Christian Helmuth
e7ba0b7371 pci: initialize BAR config on demand only
On-demand initialization prevents read-write operations on BARs of
invalid devices at construction time, which may result in surprising
behavior later on, for example, when resetting X260 notebooks via ACPI
information.
2022-10-12 12:09:37 +02:00
Stefan Kalkowski
ba97415ef9 pci_decode: prefer MSI over MSI-x
Ref genodelabs/genode#4578
2022-10-12 12:09:36 +02:00
Norman Feske
eb6a745a18 platform: add Guard utils for Clock/Reset/Power
These utilities simplify the control of clocks, resets, and power
domains from within the platform driver.

This is needed when driving a low-level device directly from the
platform driver, for example for driving the mbox mechanism to access
the system-control processor of the PinePhone.
2022-10-12 12:09:36 +02:00
Norman Feske
add4990044 sculpt: distinguish devices,pci_devices in /report
This patch reflects both the pci_decode results and the platform
driver's aggregated device information in Sculpt's /report/drivers/ in
the form of pci_devices and devices files respectively.
2022-10-12 12:09:36 +02:00
Stefan Kalkowski
3841ee1d51 platform_drv: implement MSI-x support
Ref genodelabs/genode#4578
2022-10-12 12:09:36 +02:00
Josef Söntgen
9c3867e173 libc: increase stat I/O blksize hint to 64 KiB
The configured 'st_blksize' influences the sizing of the FILE buffer,
see '__swhatbuf()'. Increasing the blksize hint can lead to larger
'fread()' requests and in return to fewer roundtrips.
2022-10-12 12:09:36 +02:00
Josef Söntgen
75f7fd546c depot_download_manager: increase fs buffer
Default tx buffer size of 128 KiB will cut 64 KiB due to packetstream
overhead, increase it to 144 KiB.
2022-10-12 12:09:36 +02:00
Josef Söntgen
7e4154b063 sculpt_manager: increase inspect fs buffer size
128 KiB (apparent cp(1) default size) + 16 KiB.
2022-10-12 12:09:36 +02:00
Josef Söntgen
f4f1092f1d verify: increase IOBUF size to 64 KiB
The old value of 8192 seems to be conservative. By increasing it we
can make better use of the available I/O bandwidth.
2022-10-12 12:09:36 +02:00
Sebastian Sumpf
7cbf5cd075 sculpt_manager: Increase RAM quota for file systems
With the increased allocation size to 4MB in rump
(20df224b19), the supplied quota by the
sculpt_manager does not suffice any more.

issue #4631
2022-10-12 12:09:36 +02:00
Josef Söntgen
e0f5cdacf0 dde_bsd: update audio driver to OpenBSD 7.1
This commit updates the driver from version 6.6 to 7.1. In contrast
to the old driver the new one will now probe all available HDA devices
and will drive the first usable one, e.g.:

```
[init -> audio_drv] azalia0 [8086:160c]
[init -> audio_drv] :
[init -> audio_drv] azalia0: no supported codecs
[init -> audio_drv] azalia1 [8086:9ca0]
[init -> audio_drv] :
[init -> audio_drv] azalia1: codecs: Realtek ALC292
[init -> audio_drv] audio0 at azalia1
```

Fixes #4629.
2022-10-12 12:09:36 +02:00
Josef Söntgen
3186e47807 dde_bsd: adapt Audio_in script to new platform_drv
Issue #4629.
2022-10-12 12:09:36 +02:00
Josef Söntgen
a78a7e1f67 platform_drv: disable no snoop for ATI/AMD HDA
Implemented as depicted in the OpenBSD driver, register description
found in 'AMD SB700/710/750 Register Reference Guide'
(43009_sb7xx_rrg_pub_1.00.pdf).

Issue #4629.
2022-10-12 12:09:36 +02:00
Norman Feske
cdff00970b sculpt/pc: increase acpi driver RAM quota
This is needed for the Framework laptop.
2022-10-12 12:09:36 +02:00
Norman Feske
ccb8fe908a driver_manager: whitespace fixes 2022-10-12 12:09:36 +02:00
Stefan Kalkowski
b88959f60c sculpt: use pc_platform_drv instead of generic one
Ref genodelabs/genode#4578
2022-10-12 12:09:36 +02:00
Stefan Kalkowski
1504041c82 pc_platform_drv: introduce pc-specific driver
This driver observes a "system" ROM, as well as the acpi ROM to implement
reset functionality.

Ref genodelabs/genode#4578
2022-10-12 12:09:35 +02:00
Norman Feske
dc228b952a intel_fb_drv: add gpu/drm/drm_scdc_helper.c
With this patch, the Dell UltraSharp 4K display works in principle when
connected via HDMI to a Lenovo x260 laptop.

Fixes #4630
2022-10-12 12:09:35 +02:00
Norman Feske
a630563cbc intel_fb_drv: add kvfree_call_rcu to lx_emul.c
Issue #4630
2022-10-12 12:09:35 +02:00
Norman Feske
80e2cea4aa dde_linux: enable Intel Alderlake graphics
With this patch, the Intel framebuffer driver works on the Framework
Gen12 laptop.

Fixes #4627
2022-10-12 12:09:35 +02:00
Stefan Kalkowski
243c819257 pci_decode: use MSI enumerator as function value
Instead of using a global value to enumerate the MSIs, use a function argument
instead. Whenever the process of PCI device reporting gets started again,
due to an initially too small report buffer, the MSI enumeration value is reset
again. Formerly, we wasted MSI numbers.

Ref genodelabs/genode#4628
2022-10-12 12:09:35 +02:00
Christian Helmuth
08f1f94fcb pci_decode: IRQ reporting for MSI/MSI-X only devices
Don't skip IRQ reporting if legacy IRQ/GSIs are not supported as the
device may support MSI/MSI-X exclusively.

The commit also enables reserved_memory reporting of devices without
IRQs.

Ref genodelabs/genode#4578
2022-10-12 12:09:35 +02:00
Sebastian Sumpf
8855e5bfc9 Revert "usb_block_drv: allow for using UAS devices via BOT"
This reverts commit 87021d9fb1.

Commit breaks some USB storage devices, mostly Intenso, on Sculpt

issue #4494
2022-10-12 12:09:35 +02:00
Josef Söntgen
427bd93921 wifi/pc: add FW image for new so devices
The Framework laptop with the 12the Generation CPU contains such a
device.

Fixes #4626.
2022-10-12 12:09:35 +02:00
Christian Helmuth
ee19426f4d lx_emul: validate endpoint for isochronous URB
Thanks to Andreas for the patch.
2022-10-12 12:09:35 +02:00
Norman Feske
f81f075670 sculpt: allow for dynamic managed/system state
Until now, the /config/system ROM was not handled by the sculpt manager
but solely managed by the user. Its main purpose was the ability to
reset or power-down the machine by manually modifying the 'state'
attribute. However, down the road, we'd like to enable the sculpt
manager to drive this state, e.g., to implement the multi-staged
loading of drivers, or to drive suspend-resume states.

The support such scenarios, the 'system' state has been moved from
/config/system to /config/managed/system.
2022-10-12 12:09:35 +02:00
Stefan Kalkowski
2ccdbf1050 platform_drv: implement shared interrupt support
Ref genodelabs/genode#4578
2022-10-12 12:09:35 +02:00
Stefan Kalkowski
fa124dd340 lx_kit: do not close/re-open IRQ session
Instead of dynamically close/open IRQ session whenever an IRQ
gots masked/unmasked, track the state internally and resp.
deliver an interrupt delayed.
2022-10-12 12:09:35 +02:00
Stefan Kalkowski
00c9ac363f platform_drv: add EHCI PCI quirk, apply in order
* Add EHCI PCI quirk
* Add UHCI reset to UHCI quirk
* Apply all PCI quirks in order of the PCI bus numbering
  otherwise the machine might stall

Ref genodelabs/genode#4578
2022-10-12 12:09:35 +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
Christian Prochaska
48cc52be07 tool chain: tool check cleanup
- look for autoconf 2.69 on Ubuntu 22.04
- remove obsolete checks
- add new checks

Fixes #4622
2022-10-12 12:09:35 +02:00
Alexander Boettcher
9e33e57294 nova: support more MSIs
Issue #4578

Ref alex-ab/nova#8
2022-10-12 12:09:34 +02:00
Christian Helmuth
b20cabb6e4 pci: fix PCIe extended capability definition
Also removed the warning about unhandled capability IDs.

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
6a7247ab44 platform: remove cache attribute from io_mem call
Instead of allowing the client to set a caching attribute
in the io_mem() call of the device interface, which was
only used to decide in between of the memory  being
write-combined or not, remove it from the API.
Instead use the information delivered by the devices ROM,
whether memory from a PCI BAR is prefetchable or not,
to decide whether it is mapped write-combined or not.

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
7334128a2e pci_decode: export prefetchable attribute of BARs
Memory descriptors in PCI BARs have a prefetchable bit, which can
be used to optimize memory access when setting, e.g. write-combined
in page-table entries.

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Christian Prochaska
1d0b9ed302 qt5: fix build errors with GCC 11 host tool chain
Fixes #4621
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
6a36e8a8dc pci_decode: count MSI numbers beginning from one
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Norman Feske
5956dd591f sculpt: version 22.10 2022-10-12 12:09:34 +02:00
Sebastian Sumpf
e1e70dd927 platform_drv: fix Intel graphics PCI infos
GMCH is at offset 50 on Gen8+.

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
85e69f6882 driver_time.run: remove legacy platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
5600e21d16 virtualbox_auto tests: remove legacy platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Martin Stein
f59ee209d2 nic_router: use exact packet sizes in dhcp client
The DHCP client used to always send packets with a size of 1024 regardless of
the size of the actual content, which was always significantly lower. 1024
bytes was simply a guess to provide enough space for all types of DHCP client
packets. As we know the exact size of each packet the DHCP client sends even
before packet creation, this commit makes use of the knowledge resulting in
much smaller packets sent by the DHCP client.

Fixes #4619
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
c7c460f6e0 os: add include/pci/* to os api
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Martin Stein
665a551fcd base-hw & cortex_a9: consider timer IRQ unreliable
On some Cortex A9 platforms (Qemu 4.2.1 PBXA9), the IRQ status register is not
reliable. Sometimes, it indicates an IRQ too early, i.e., shortly before the
counter wraps. Therefore we have to accomplish wrap detection via counter
comparison only. We check whether the current counter value is higher than the
start counter value of the current timeout.

However, this implies that we have to take care to always read out the counter
before it hits the max timout value again. And, therefore, the max timeout
value has to be far away from the first value the counter has after wrapping.
Consequently, we propagate a max timeout value of half the max counter value.

Fixes #4209
2022-10-12 12:09:34 +02:00
Johannes Schlatow
32efbdfb32 vfs_tap: fix README (mode attribute) 2022-10-12 12:09:34 +02:00
Christian Helmuth
57f510d67f run/load/ipxe: spawn lighttpd on demand
An installed lighttpd HTTP server can now optionally be started to serve
the boot image with the follow run options.

--load-ipxe-lighttpd             run lighttpd automatically (default: off)
--load-ipxe-lighttpd-port <port> TCP port to run lighttpd on (default: 8080)
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
afa0bed5fc platform_drv: add USB4 pci class, update README
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
ec6f89111e virtio_pci: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
fdba7259ab platform_drv: provide Virtio PCI information
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
de0c339e0b pci: remove pci test of legacy platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
b8eab65536 dde_linux: remove legacy usb_host_drv for x86
Remove legacy platform_session API usage from legacy lx_kit/lx_emul

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
91e64c3f27 vbox5_genode_usb_hid: remove legacy platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
71eefc3315 nic_router_uplinks.run: remove legacy platform_drv
Ref genodelabs/genode#4511
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
203f24742a netperf tests: remove legacy platform_drv
Ref genodelabs/genode#4511
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
9b38af4d7d smartcard.run: remove legacy platform_drv
Ref genodelabs/genode#4511
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
c8f055c9e3 smbios_decoder.run: remove legacy platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
e7571c539c sculpt: use generic platform driver
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
250275fbfb gpu_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
03cec5cdd7 dde_bsd: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
8d746a701e drivers_nic-pc: use generic platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
7cf6651d2c ipxe_nic_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
feaaaa3e8b drivers_interactive-pc: use generic platform_drv
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
92b5dda2bc vesa_fb_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
ed8f71e459 ahci_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
5528434fb6 lx_kit & lx_emul: use generic platform API
* Remove wrapper for legacy x86 platform API
* Move PCI configuration space quirks to corresponding driver
  (pc_usb_host_drv, pc_wifi_drv, pc_intel_fb_drv)
* Adapt driver test run-scripts to changed configuration

Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
9f9a5186e0 ps2_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
71129fca2d nvme_drv: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:33 +02:00
Stefan Kalkowski
42a46b75f1 depot: add recipe for pc devices rom
Ref genodelabs/genode#4578
2022-10-12 11:59:09 +02:00
Stefan Kalkowski
5e42f347d8 platform_drv: attach reserved memory to device PD
Consumes the information about reserved memory region reports from
the devices ROM, and adds appropriated mappings to the corresponding
device PD.

Ref genodelabs/genode#4578
2022-10-12 11:59:09 +02:00
Stefan Kalkowski
85dc2e5b9b pci_decode: interpret reserved memory from ACPI
We need the information about reserved memory region reports
from the ACPI tables within the platform driver to pre-fill
IOMMU tables with the corresponding mappings. Therefore,
the pci_decode component now parses the information from the
ACPI ROM, and adds "reserved_memory" nodes to all related
devices in the devices report.

Ref genodelabs/genode#4578
2022-10-12 11:59:08 +02:00
Stefan Kalkowski
281785f6bd platform API: make MMIO dataspace cap accessible
In case of the GPU multiplexer, we need to delegate MMIO memory
to the framebuffer client in form of a managed dataspace. To be
able to attach a given Platform::Device::Mmio object to a region map
we need to access its capability.

Ref genodelabs/genode#4578
2022-10-12 11:59:08 +02:00
Stefan Kalkowski
c583446ade platform_drv: add HDAUDIO PCI quirks
Ref genodelabs/genode#4578
2022-10-12 11:59:08 +02:00
Stefan Kalkowski
b85b3abe20 base-hw: update cpu_scheduler unit test
* Modernize routines, eliminate pointers, use constructibles, etc.
* Use absolute time instead of relative time consumption when
  updating the scheduler

Ref genodelabs/genode#4151
2022-10-12 11:59:08 +02:00
Stefan Kalkowski
debd41081e base-hw: optimize & cleanup scheduler
* Remove useless `ready_check` function
* Implement fine-grained checking when schedule updating is necessary

Ref genodelabs/genode#4151
2022-10-12 11:59:08 +02:00
Christian Helmuth
13bfe50d00 Update expat to version 2.4.9
The tar.gz archive of version 2.4.6 vanished from sourceforge.
2022-10-12 11:59:08 +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
ef269ea2e0 sd_card_bench: disable on rpi 2022-10-12 11:59:08 +02:00
Christian Helmuth
0ead7eacfd tool_chain_auto: disable on unsupported platforms
all: imx53_qsb_tz, rpi
foc: imx6q_sabrelite
2022-10-12 11:59:08 +02:00
Christian Helmuth
c8dd433e8b depot_autopilot: disable unsupported tests on foc/pbxa9 2022-10-12 11:59:08 +02:00
Stefan Kalkowski
0231ee4ad3 hw: don't halt kernel due to unknown cpu exception
Fix genodelabs/genode#4617
2022-10-12 11:59:08 +02:00
Christian Helmuth
6c6ce30389 depot_autopilot: disable unsupported tests on riscv 2022-10-12 11:59:08 +02:00
Martin Stein
88cddc35dd nic_router: use the dictionary data structure
This commit gets rid of the router-local wrapper of Genode's AVL string tree
and replaces it with Genode's new Dictionary structure. The Dictionary is now
used for managing domains and NIC clients. Due to this change, the formerly
necessary helper classes Domain_base and Nic_client_base could be removed as
well.

Ref #4610
2022-10-12 11:59:08 +02:00
Michael Mueller
c89715f905 Make Topology service part of a component's environment, just like CPU. 2022-10-11 18:00:47 +02:00
Michael Mueller
579b4833fb Introducing new topology service to query NUMA information from within a component. 2022-10-11 17:58:24 +02:00
Michael Mueller
bdb1b222cd Store NUMA node for memory descriptors in HIP. 2022-10-06 16:08:00 +02:00
Michael Mueller
ce1a137ddb Store NUMA core mapping in platform interface. 2022-10-06 16:07:01 +02:00
Martin Stein
3a616fed4d nic_router: rename is_ready() to ready()
Ref #4612
2022-09-21 14:03:31 +02:00
Christian Helmuth
3f1870841c depot: update recipe hashes 2022-09-21 12:19:10 +02:00
Christian Helmuth
548c3b46ad test-trace_buffer: increase thread stack to 8K
Prevents warnings on x86_32/linux.
2022-09-21 12:19:10 +02:00
Stefan Kalkowski
dda168fc10 platform API: simplify _wait_for_device
Fix genodelabs/genode#4615
2022-09-21 12:19:10 +02:00
Sebastian Sumpf
0370b0fa23 platform_drv: fix reference count in "Switch" class
Only decrement by 1 in the "unuse" function.
2022-09-21 12:19:10 +02:00
Stefan Kalkowski
4b9fb10fdb platform_drv: aquire_single_device return first
* Only acquire and return the first device

Fix genodelabs/genode#4614
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
c0e303632e gems: fix clipping in polygon_gfx/line_painter.h
This clipping check happened to wrongly test the surface's clipping area
instead of the by 1x1 pixel reduced 'clip' rectangle.
2022-09-21 12:19:10 +02:00
Norman Feske
0ff755b236 menu_view: remove minor code redundancy
This is a follow-up commit for "menu_view: configurable alpha channel
and bg color", which simplifies the code. The '_no_alpha' surface is not
needed because the 'Gui_buffer' provides a 0x0 alpha surface when using
the opaque mode.
2022-09-21 12:19:10 +02:00
Norman Feske
8bccc6e68f cached_fs_rom: increase fs buffer size to 4 MiB
The default file-system communication-buffer size of 128 KiB combined
with the clamping of requests to 1/4th the buffer size results in the
fragementation of read operations into 32 KiB chunks. This is overly
conservative and causes high context-switch overhead down the storage
stack (vfs server -> part_block -> block driver).

Related to #4613
2022-09-21 12:19:10 +02:00
Norman Feske
20df224b19 dde_rump: increase max I/O request size to 1 MiB
With the increase of MAXPHYS, the rump kernel requests a contiguous
allocation of 2101248 bytes, which exceeds the allocator's block size of
2 MiB.

  Error: backend allocator: Unable to allocate memory (size: 2101248 align: 12)

The patch avoids this corner case by increasing the allocator's block
size to 4 MiB.

Fixes #4613
2022-09-21 12:19:09 +02:00
Martin Stein
99254b4d52 nic_router: bind link state to remote DNS config
The NIC router README claims that the 'dns_config_from' attribute in a DHCP
server configuration binds the propagated link state of all interfaces at the
domain of the server to the validity of the IP config of the domain that is
given through 'dns_config_from'.

However, this was not true. The router missed to implement this detail which
led to clients of such a DHCP server sending DHCP DISCOVER packets too early.
These early DHCP DISCOVER packets were dropped by the router potentially
causing a big delay until the client started a new attempt. Unnecessary long
network boot-up delays were observed with at least the lwip run script and
Sculpt on the PinePhone and could be tracked down to this former
inconsistency in the router.

This commit fixes the inconsistency.

Fixes #4612
2022-09-21 12:19:09 +02:00
Johannes Schlatow
4fd1b52d1f trace_recorder: adopt Genode::Dictionary
genodelabs/genode#4610
2022-09-21 12:19:09 +02:00
Norman Feske
ab7c0b40f2 depot_query: avoid repetitive file accesses
This patch changes the access of pkg-archives files such that the file
read only once per pkg, not for each ROM module used by the package.

Issue #4611
2022-09-21 12:19:09 +02:00
Norman Feske
851ae574d1 depot_query: add directory cache
By caching directory listings, the performance of depot_query is no
longer impeded by a massive amount of stat calls while searching for ROM
module locations.

Issue #4611
2022-09-21 12:19:09 +02:00
Norman Feske
b4441bff04 depot_query: remove ineffective caches
Upon closer inspection of real-world access patterns, it turns out that
the 'Stat_cache' and 'Cached_rom_query' are not as effective as hoped
for because cache hits are rare while querying pkg blueprints.

However, by increasing the initial size of the blueprint reporter from 4
KiB (default) to 64 KiB has a great effect. With the small default
report size, the querying of blueprints is repeated until the buffer
size suffices, incrementing the buffer size by 4 KiB in each iteration.

Issue #4611
2022-09-19 14:00:36 +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
Norman Feske
6df66a77d0 sculpt: avoid superfluous depot queries
This patch avoids repetitive depot queries at the start of the Sculpt
system.

We don't need to trigger a query unconditionally whenever the
managed/deploy changes because the call of 'handle_deploy' triggers a
query when needed.

We don't need to trigger a query once the prepare step is completed
because the depot_query component is spawned at this point. The initial
blueprint produced by the depot_query component, in turn, triggers the
'handle_deploy' mechanics in the sculpt manager.

The constructor of the Sculpt manager's 'Main' does not need to call
'depot_deploy' because the prepare step - which is a precondition for
the deployment - cannot be completed at this point anyway.
2022-09-19 14:00:35 +02:00
Sebastian Sumpf
003247d883 dde_bsd: audio do not advance on silence
Do not advance ring buffer positions when playing silence, additionally
to not send progress signals when playing silence. Silence implies
underrun in the client side - not progress.

issue #4609
2022-09-19 14:00:35 +02:00
Sebastian Sumpf
e0c4d5068d audio_out_session: reset changes to 'pos = tail'
In case a driver is waiting for data, is should only investigate 'pos'.
It should not advance the ring in any way until there is data available.

issue #4609
2022-09-19 14:00:35 +02:00
Norman Feske
907641f6ea lx_fs: improve safety when using dir handles
This patch consolidates the repetitive error handling across the RPC
functions, which take node handles or directory handles as arguments.

During this change, I noticed that directory handles - which are values
provided by the client - were not checked for their type before being
used. A misbehaving client may open a file, manually construct a
directory handle using the number of the file handle, and invoke a
directory operation at lx_fs, which would then wrongly access a file
node as directory node.

This patch solves this issue by introducing two distinct methods
_with_open_node and _with_open_dir_node, which perform the respective
safety checks.

Fixes #4608
2022-09-19 14:00:35 +02:00
Martin Stein
79cc9af212 nic_router: intf. con/destruct reports link state
Creating and destructing an interface was not considered a change of its real
link state as defined in the description of the <report link_state_triggers="">
config attribute in the router's README. In case of Uplink sessions this is
obviously a problem as they communicate their real link state through session
lifetime. But also in case of NIC sessions it's a possible to create an
interface that is immediately "up" after creation or destruct an interface
without its link state going "down" beforehand.

Taking into account also the practical application of the
<report link_state_triggers=""> attribute, reporting only on destruction and
construction of interfaces that are "up" seems shorthanded. This is because a
report-receiver most likely needs to be able to synchronize the lifetime of
the objects that keep track of the link states with the lifetime of the
corresponding sessions.

That said, with this commit, the router triggers a report update on each
session construction/destruction when <report link_state_triggers=""> is
set.

Fixes #4462
2022-09-19 14:00:35 +02:00
Martin Stein
aff1db1543 nic_router: generate reports asynchronously
The NIC router used to generate reports triggered by IP config changes or link
state changes synchonously, i.e., inline with the activation context that
caused the change. This has two disadvantages. First, it can lead to an
excessive number of report updates in situations with quick bursts of
triggering changes. In such situations it is preferable to collect the changes
and reflect them with only one final report update.

Second, synchronous reporting may happen while the router is in a state that
leads to an incorrect report (e.g. during reconfiguration). To prevent this
from happening, the router so far explicitely switched off reporting when
entering incoherent states and back on when leaving them. However, this
solution is error-prone as the exclusion windows must be maintained manually.

Both issues can be solved by not directly generating a report when necessary
but instead submitting a signal and letting the signal handler do the work in
a dedicated activation context.

Ref #4462
2022-09-19 14:00:35 +02:00
Christian Helmuth
a573d3a332 Adapt tested log pattern in vbox5_genode_usb_hid_raw 2022-09-19 14:00:35 +02:00
Christian Helmuth
82f96668fa Increase cpu_burner RAM quota in test-trace_logger
Now, the test also succeeds on sel4.
2022-09-19 14:00:35 +02:00
Norman Feske
cc9368ccb4 os: add File_system_session::num_entries RPC
This patch splits the querying of the number of directory entries from
the directory's 'status' information. Subsuming the number of directory
entries as part of the status makes 'stat' calls too costly for some
file systems that need to read a directory for determining the number of
entries. So when stat'ing the entries of one directory that contains sub
directories, all entries of each sub directory are visited.

Thanks to Cedric Degea for pointing out this performance bottleneck!

With this change, the 'status' function returns a 'Status::size' value
of 0 when called for a directory handle.

Fixes #4603
2022-09-19 14:00:35 +02:00
Norman Feske
5b4b243e3d sculpt.run: distinguish DEPOT=list from DEPOT=omit
This patch splits the former DEPOT=omit option into two variants.
The new 'list' option behaves like the former 'omit' option, skipping
the creation of the tar archive from the depot content referenced by the
deploy configuration but showing a list of depot archives that need to
be published for the deployment.

When specifying 'omit' in th new version, the local depot is not queried
for the packages referenced in the deploy configuration. So the
deployment can refer to packaged hosted only remotely.

Fixes #4605
2022-09-19 14:00:34 +02:00
Norman Feske
96191fe577 gems: reanimate depot_deploy.run 2022-09-19 14:00:34 +02:00
Christian Helmuth
c8b4b83b71 base-linux: inhibit tracing in region-map attach/detach
Tracing must be inhibited in attach/detach as RPC trace points may
trigger attachment of trace dataspaces, which would result in nested
mutex acquisition.

This prevents errors in test-trace_logger like follows.

  [init -> depot_autopilot] 0.140 [init -> dynamic_rom] Error: deadlock ahead, mutex=0x500e6f00, return ip=0x50053ed7

Fixes #4607
2022-09-19 14:00:34 +02:00
Johannes Schlatow
80a2f7224e gems: src/lib/trace_recorder -> src/trace_recorder
The target.mk files for building the trace policies are no longer
reachable under src/lib/ by the build system.

genodelabs/genode#4599
2022-09-19 14:00:34 +02:00
Martin Stein
b82d83e271 nic_router: handle bad DNS in DHCP ACK gracefully
The DHCP client of the NIC router used to end up in an uncaught exception if
an IP address in the DNS server option of a DHCP ACK was invalid. This commit
makes the 'Dns_server' constructor (where the exception originated from)
private and instead introduces a public lambda method 'construct' that calls
one lambda argument on success and another on failure. This is also in line
with the most recent changes to the 'find_by_*' methods of other classes in
the NIC router and contributes to the goal of reducing expensive exception
handling.

Fixes #4465
2022-09-19 14:00:34 +02:00
Martin Stein
054990aafa nic_router: fix net session aliases
The Interface class of the router is an abstraction for NIC client sessions,
NIC server sessions, and Uplink sessions. Nonetheless, Interface generally used
to use the packet stream types of the Nic namespace and it worked because the
Uplink packet stream types are factually the same (the are typedef'd from the
same base type templates with the same parameters).

The initial intention of this issue was to remove dependency on the diverse
packet stream stream types from Interface. However, this turned out to be more
tricky than thought. The Interface class calls function templates on the packet
stream types, making a generic virtual interface impossible. And moving the
calling code to the session classes as well would produce a lot of redundancy.

Therefore, this commit removes only the use of the Nic namespace in the
interface.* files by typedef'ing the packet stream types from the generic
Genode type templates with the same parameters as in Nic and Uplink.

Fixes #4385
2022-09-19 14:00:34 +02:00
Martin Stein
ede007c2dd Bender: Intel HWP mode configurable via RUN_OPT
The updated Bender version is configurable regarding the mode in which to run
the Intel HWP plugin. This can now be controlled via the new run option
'--bender-intel-hwp-mode' (only when running on NOVA). The option knows 4 valid
values 'off', 'performance', 'balanced', and 'power_saving'. When running on
NOVA, the default value applied by the run tool is 'performance'. when running
on any other kernel, the default value of Bender ('off') is used. Therefore,
when not setting the new '--bender-intel-hwp-mode' flag, the behavior is the
same as before this commit.

Fixes #4224
2022-09-19 14:00:34 +02:00
Martin Stein
d9b5e4ae8d libc: warn on missing std*="" or <fd path=""> file
The libc kernel used to silently go on if one of the files given through
stdin/stdout/stderr or <fd path=""> was missing (with possibly vital
functionality for the component not working). A pointer to the presumably
simple configuration issue of the underlying scenario was not given to the
user.

With this commit, the libc kernel prints a descriptive warning before
proceeding with the invalid file descriptor

Fixes #4218
2022-09-19 14:00:34 +02:00
Martin Stein
5e9e003bb0 libc: warn on missing std*="" or <fd path=""> dirs
The libc kernel used to end up in an uncaught exception if one of the
directories in the paths given through stdin/stdout/stderr or <fd path=""> was
missing. The resulting error didn't point the user to the presumably simple
configuration issue of his scenario in any way and killed the affected
component.

With this commit, the libc kernel prints a descriptive warning instead and
simply continues to run the component with the corresponding file descriptor
missing. At least in case of stdin/stdout/stderr, the libc deals gracefully
with this approach.

Ref #4218
2022-09-19 14:00:34 +02:00
Christian Helmuth
5b25060730 libc: prevent compiler warning 2022-09-19 14:00:34 +02:00
Christian Helmuth
8186a1d7f8 Support seconds in vfs/rtc plugin and libc backend
Fixes #3886
2022-09-19 14:00:33 +02:00
Johannes Schlatow
4689275845 depot_deploy: do not fail on missing nodes
If provided with a config that does not include a `<static>` or
`<common_routes>` node, depot_deploy exits due to a `Nonexistent_sub_node`
exception. Instead, we should output a more useful warning.

Fixes genodelabs/genode#4600
2022-09-19 14:00:33 +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
Christian Helmuth
f0e9881c7e intel_fb: prevent compiler warning 2022-09-19 14:00:33 +02:00
Stefan Kalkowski
f2c52d1570 usb c-api: manage lifetime of session handles
Fix genodelabs/genode#4602
2022-09-19 14:00:33 +02:00
Stefan Kalkowski
3d26ce9f8d usb_host: acknowledge all requests asynchronously
Fix genodelabs/genode#4601
2022-09-19 14:00:33 +02:00
Norman Feske
7c3b9c843f base-hw: tighten src-archive content of lib/mk/
This patch refines the rules for generating a base-hw src archive
for a given board by enumerating the content of the lib/mk/spec/*
directories instead of including entire directories. This avoids
the inclusion of lib.mk files found in SoC-specific repositories
(like genode-allwinner) in the kernel source archives.

When building a binary archive from such a src archive with the changes
of issue #4599, the build system would otherwise try (and fail) to build
the libraries for the accidentally included lib.mk files.
2022-09-19 14:00:33 +02:00
Norman Feske
4c1ec0404a Remove unused target from recipes/src/libc 2022-09-19 14:00:32 +02:00
Norman Feske
bd9478204d Exclude file lib from gems API
The 'file' library makes the gems API depend on the libc, which is not
desireable because most users of the gems API have no direct libc
dependency.

With the changes of issue #4599, the build of each src archive that
depends on the gems API would attempt to build the 'file' library and
thereby demand the libc.

Note that the 'file' library is a relic that should better not be
promoted as part of the gems API. Hence, this patch removes the file
library from the gems API and adds it to the src archives of the few
remaining users.

Issue #4599
2022-09-19 14:00:32 +02:00
Norman Feske
35661d065e base-linux: omit unused lib/mk/ from API recipe
The 'base-linux' API is used by hybrid Genode/Linux programs for the
lx_hybrid library. This API archive happend to contain other libraries -
like seccomp - that are solely needed for building core. With the change
of the build system in issue #4599, the build system would attempt to
build all libraries instead of merely the library dependencies of the
available targets. Hence, it would trigger the build of, e.g.,  the
seccomp library for each user of the base-linux API.

This patch avoids these superfluous build steps by pruning the content
of lib/mk/ to the libraries actually needed for lx_hybrid users.

Issue #4599
2022-09-19 14:00:32 +02:00
Norman Feske
7be98166ee run: improve 'build_boot_image [build_artifacts]'
This patch make the use of the result of the 'build_artifacts' function
as input for 'build_boot_image' more robust. Since 'build_artifacts'
obtains binary names from the progress.log, the names of core,
ld.lib.so, and the timer correspond to the kernel-specific names.

However, 'build_boot_image' expects the kernel-agnostic names as
arguments. Kernel-specific files need special treatment when integrated
in the boot image: the kernel-specific file is copied and renamed to the
kernel-agnostic name. Without this patch, the kernel-specific file is
copied as is (e.g., ld-nova.lib.so). So the name of the ROM module is
wrong. This patch resets the kernel-specific names to the generic names
so that the special-case handling comes into effect.
2022-09-19 14:00:32 +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
dd9e12601e Remove pseudo targets for building shared libs
Thanks to the change "build: support library builds via lib/<libname>",
shared libraries can now be built directly by the build system.

Issue #4599
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
Norman Feske
f50971b6a9 os: src/lib/trace/policy -> src/trace/policy
The target.mk files for building the trace policies are no longer
reachable under src/lib/ by the build system.

Issue #4599
2022-09-19 13:59:27 +02:00
Norman Feske
88e13bb236 base-linux: src/lib/initramfs -> /src/initramfs
Move the target for initramfs outside the src/lib/ directory because
target.mk files within src/lib/ are no longer reachable.

Issue #4599
2022-09-19 13:59:27 +02:00
Johannes Schlatow
bc57e9e647 vfs: add Append_file class
This reverts commit cf904e0a5d and
introduces the Append_file class instead.

genodelabs/genode#4352
2022-09-19 13:59:27 +02:00
Norman Feske
06f24a73d2 doc/release_notes/22-08: minor style fix 2022-08-31 15:54:08 +02:00
Alexander Boettcher
354667bb6d lx_emul: validate USB endpoint and settings param
to avoid pagefaults and general protection faults on access to unpaged memory
regions.

Fixes #4596
2022-08-31 15:10:17 +02:00
Alexander Boettcher
b888c95024 qemu-usb: reread settings on configuration profile
changes. The alternative settings get reread on all interfaces as done before
"qemu-usb: fix device endpoint update" commit by introducing specific
reset_alt_settings function. The fallthrough case was intentionally before
the "qemu-usb: fix device endpoint update" case, which now is wrong.

Issue #4596
2022-08-31 15:10:17 +02:00
Alexander Boettcher
adc4d47251 usb_host: use Expanding reporter for device report
Issue #4596
2022-08-31 15:09:23 +02:00
Christian Helmuth
c333fc6f04 version: 22.08 2022-08-31 14:04:57 +02:00
Norman Feske
71571c4072 News item for version 22.08 2022-08-31 13:49:11 +02:00
Norman Feske
6c3d6253ef Release notes for version 22.08 2022-08-31 12:13:10 +02:00
Christian Helmuth
4dddc41b71 depot: update recipe hashes 2022-08-31 09:32:09 +02:00
Christian Prochaska
85044d65af qt5: add missing include in qtwebengine
Fixes #4595
2022-08-31 09:32:09 +02:00
Christian Helmuth
0368601b16 Prevent warning in trace-recorder policy
Make warned about

  make[2]: Circular /plain/krishna/build/genode_staging/x86_64/bin/ctf0_pcapng <- ctf0_pcapng dependency dropped.
2022-08-31 09:32:09 +02:00
Norman Feske
60194d666d menu_view: add 'important' frame style
This style is used by the upcoming phone version of Sculpt for GUI
elements that are supposed to stand out a little bit more than the
regular frame style.
2022-08-31 09:32:09 +02:00
Norman Feske
461a27a674 sculpt_manager: support opaque menu_view instances
Related to issue #4592.
2022-08-31 09:32:09 +02:00
Norman Feske
2772abc8d7 menu_view: configurable alpha channel and bg color
This patch enhances menu_view with the optional configuration attributes
'opaque' and 'background'. Setting 'opaque' to "yes" suppresses the use
of the alpha channel at the GUI session. This improves the drawing
performance by 20% on the PinePhone. Since the menu_view uses the
gems/gui_buffer.h utility, the 'Gui_buffer' received a new 'Alpha'
argument at construction time.

The 'background' attribute can be specified to define the reset color of
the GUI buffer. It alleviates the need to create a frame widget for the
top level.

The patch also switches the optimization level for compiling menu_view
to -O3, which increases the drawing performance on the PinePhone by 30%.

Fixes #4592
2022-08-31 09:32:09 +02:00
Norman Feske
bd8c7f84dd touch_keyboard: tweaks for PinePhone display
This change increases the quota to allow the use of bigger fonts, and
tweaks the style such that the keyboard gets a decent appearance on the
PinePhone's 1440x720 display.
2022-08-31 09:32:09 +02:00
Norman Feske
697d2e86d7 sculpt: add modem support via USB net
This patch adds principle support for using a USB-net modem as
mobile-data uplink. The change is motivated by the upcoming phone
manager for the PinePhone where the modem serves as the primary network
uplink. For the regular PC version of Sculpt, the feature is not needed
(hence remains disabled) because USB net can be deployed from a package
as described in:

  https://genodians.org/jschlatow/2021-07-21-mobile-network

The patch also renames the "Local" network option to "Disconnected" to
be more intuitive.
2022-08-31 09:32:09 +02:00
Norman Feske
5a0b4c98aa sculpt_manager: move Network::_menu_view to Main::
By decoupling the network dialog's menu view from the 'Network' class,
we become able to host the network dialog in the same menu view instance
as other dialogs.
2022-08-31 09:32:09 +02:00
Norman Feske
6f2237fc46 sculpt_manager: add missing includes 2022-08-31 09:32:09 +02:00
Norman Feske
4f4f270d35 sculpt.run: expose leitzentrale state to manager
This patch allows the sculpt manager hosted in the leitzentrale
subsystem to observe the toggling between the runtime and the
administrative GUI. This enables alternatives to the use of the
gui_fader for switching between both views. In particular, the
upcoming phone_manager toggles the visibility of its own GUI
depending on the leitzentrale state.
2022-08-31 09:32:09 +02:00
Norman Feske
8b85eb9b34 sculpt.run: customize initial /config/managed/
In a Sculpt system based on the upcoming phone_manager, the event filter
obtains its static configuration from /config/managed/event_filter.
Without the requirement for changes at runtime, there is no need to
have the phone_manager in the loop after all.

Without this patch however, this file was always initialized with the
template gems/sculpt/event_filter/default, which was presumably used
only at boot time until the sculpt manager has produced the first
generated event-filter configuration.

This patch applies the choice of optional configs - i.e., a custom
event_filter config - to both the config/ and the initial content of
config/managed/. So in cases where the /config/managed/event_filter
remains entirely static, the latter properly reflects the choosen
variant.
2022-08-31 09:32:09 +02:00
Norman Feske
236ebecf44 event_filter: new touch-key filter
The new <touch-key> filter type can be used to trigger artificial
press/release events for predefined touch-screen areas.

Fixes #4587
2022-08-31 09:32:09 +02:00
Christian Helmuth
59f1fe7625 rump: ext2_fs depot package
Usable via Sculpt /config/deploy, e.g. via

  <start name="nvme-0.4.fs" pkg="ext2_fs">
    <route>
      <service name="Block">
        <child name="nvme-0.part_block" label="4"/>
      </service>
      <service name="RM">
        <parent/>
      </service>
    </route>
  </start>

Fixes #4590
2022-08-31 09:32:09 +02:00
Christian Helmuth
d82d67a4b2 part_block depot package
Usable via Sculpt /config/deploy, e.g.,

  <start name="nvme-0.part_block" pkg="part_block">
    <route>
      <service name="Block">
        <parent label="nvme-0"/>
      </service>
      <service name="Report" label="partitions">
        <parent/>
      </service>
    </route>
  </start>

Issue #4590
2022-08-31 09:32:09 +02:00
Christian Prochaska
8f9f0f1d7f qt5_textedit: add mesa driver requirement to runtime
Fixes #4591
2022-08-31 09:32:09 +02:00
Christian Helmuth
6fbc953dbd Declare missing exception types thrown in USB session 2022-08-31 09:32:09 +02:00
Christian Prochaska
82a57a10e7 qt5: update to version 5.15.2
Fixes #4589
2022-08-31 09:32:08 +02:00
Christian Prochaska
6d172b8e7a qt5.run: provide mesa driver route for children
Fixes #4588
2022-08-31 09:32:08 +02:00
Norman Feske
08279e6288 Create Point, Area, Rect via 'from_xml' functions
By using the new functions provided by the base API, this patch removes
the dependency of several components from include/decorator/xml_utils.h.

Issue #4584
2022-08-31 09:32:08 +02:00
Martin Stein
f64d1bbc30 vfs_libusb: fix missing dependency to libusb
Ref #4582
2022-08-19 07:59:10 +02:00
Norman Feske
381a3406ba sculpt: evaluate initial manual nic_router config
Fixes #4586
2022-08-17 16:33:14 +02:00
Christian Prochaska
fb454a28fe libc: support 'thread_local' variable destructors
Fixes #4585
2022-08-17 14:51:50 +02:00
Norman Feske
42edac8a34 util/geometry: support 'Rect::from_xml'
This patch eases the creation of 'Point', 'Area', and 'Rect' objects
from XML attribute values.

Fixes #4584
2022-08-17 14:28:12 +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
Martin Stein
d0a33e34da pcsc-lite: fix inc dir base in depot case
Fixes #4582
2022-08-17 12:26:44 +02:00
Martin Stein
3286d37c64 pcsc-lite: src and api recipe
Ref #4582
2022-08-17 12:26:44 +02:00
Roland Bär
8f228e3035 nic_router: no ICMP on unroutable IPv4 multicast
The NIC router used to send an ICMP "Destination Unreachable" packet as
response to every unroutable IPv4 packet. However, RFC 1812 section 4.3.2.7
defines certain properties that must be fullfilled by an incoming packet in
order to be answered with this type of ICMP. One requirement is that the packet
is no IPv4 multicast.

This commit prevents sending the mentioned ICMP response for unroutable IPv4
multicasts and instead drops them silently.

Fixes #4563
2022-08-17 12:26:01 +02:00
Christian Helmuth
44e2cd14a0 depot: update recipe hashes 2022-08-17 12:03:26 +02:00
Norman Feske
48711c6f8b sculpt: hook for audio-driver integration
This patch allows the leitzentrale subsystem to control an audio driver
hosted in the drivers subsystem. An example use case is the toggling of
the speaker during phone calls.
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
c462720c28 trace_recorder: add TraceCompass analyses
Define custom analyses that can be imported into TraceCompass (>= 7.3)
for evaluating the traced component interactions and checkpoints.

genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
e4aceb7845 trace_recorder: add combined ctf + pcapng policy
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
ef742001e8 trace_recorder: implementation
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
53f576e50e trace_recorder: add pcapng policy
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
be20b715ca trace_recorder: add ctf policy
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
758ba3855e trace: add types for trace_recorder policies
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
062881a484 trace: add types for ctf tracing
genodelabs/genode#4352
2022-08-17 12:03:26 +02:00
Johannes Schlatow
810bbc0484 nic_router: add trace_packets config option
genodelabs/genode#4352
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
cf904e0a5d vfs: add append mode to New_file
genodelabs/genode#4352
2022-08-17 11:54:19 +02:00
Michael Mueller
3e736fc888 posix_playground: Added test for unique_ptrs. 2022-08-10 16:33:35 +02:00
Michael Mueller
304b61613b blinktree: Use all cores from assigned affinity space. 2022-08-10 16:32:20 +02:00
Michael Mueller
a91c4bc8ae blinktree: Readded Chronometer to get performance measurements back. 2022-08-10 16:31:21 +02:00
Michael Mueller
9320380efd blinktree: Removed unnecessary mutexes. Console output is already synchronized internally. 2022-08-10 16:30:47 +02:00
Michael Mueller
84a79c2168 blinktree: Removed stdc++ I/O functions because they cannot be called from within a worker thread. 2022-08-10 16:29:54 +02:00
Michael Mueller
a8f6fc42cc blinktree: Use std::thread for fill and mixed threads. 2022-08-10 16:28:56 +02:00
Michael Mueller
8b9d93259f blinktree: Made perf functions configurable, so that Chronometer can be used without them. 2022-08-10 16:28:27 +02:00
Michael Mueller
6e9b070758 posix_playground: Updated Qemu parameters. Removed memory parameter. 2022-08-10 16:27:21 +02:00
Michael Mueller
8ff310b40d hello_mxtask: Removed GDB stub. 2022-08-10 16:26:49 +02:00
Michael Mueller
4710b24e99 mxtasking: Added missing header files in ports file. 2022-08-10 16:26:26 +02:00
Michael Mueller
918cac3cca blinktree: Defined affinity space and added POSIX library for posix_memalign(). 2022-08-10 16:25:37 +02:00
Michael Mueller
835408a828 Fixed Core crashing in creating CPU report when using more than 29 CPU cores. 2022-08-10 16:23:30 +02:00
Michael Mueller
5b44b54065 Always use COM1. Bender does not work well with SOL solutions. 2022-08-10 16:21:51 +02:00
Christian Helmuth
2e266dfe3c vbox5_genode_usb_hid_raw: support --depot-auto-update
... in nested run.
2022-08-10 13:33:04 +02:00
Christian Helmuth
eeb40d0cc2 vbox5_genode_usb_hid_raw: configure static RTC
This prevents

  Warning: clock_gettime(): missing real-time clock

log messages.

Related to #4561
2022-08-10 13:33:04 +02:00
Peter Krummenacher
11b964b759 audio_in_session: fix wrong buffer in content
Fixes #4573
2022-08-10 13:33:04 +02:00
Christian Prochaska
3f8bde1254 vbox6: don't call blocking 'read()' to start audio recording
Fixes #4580
2022-08-10 13:33:04 +02:00
Christian Prochaska
bda276f498 vfs_oss: implement 'SNDCTL_DSP_SETTRIGGER' command
Fixes #4579
2022-08-10 13:33:04 +02:00
Martin Stein
a4ec06a3b7 nic_router: no empty DNS servers opt in DHCP reply
The NIC router used to add the DNS servers field to DHCP replies regardless of
whether there were DNS servers or not. As reported by a Genode user, the empty
DNS server field irritated at least Windows 10 guests (Vbox 6) that connected
to the NIC router. This resulted in Windows 10 ignoring DHCP offers from the
router with such characteristic.

With this commit adding the DNS server DHCP option is skipped if there are no
DNS servers at the corresponding DHCP server or the domain IP config the server
shall fetch its DNS servers from.

Fixes #4581
2022-08-10 13:33:04 +02:00
Christian Helmuth
1dd69eeb6c lx_emul: skip USB config setting if already set
Skip SET_CONFIGURATION requests if the device already has the selected
config as active config. This workaround prevents issues with Linux
guests in VirtualBox and SDC-reader passthrough.

Thanks to Peter for the patch.
2022-08-10 13:33:04 +02:00
Josef Söntgen
3d8c1080b1 dde_linux: remove exited tasks
The commit introduces means to mark a task for destruction that is
removed on the next scheduling cycle. This fixes stack leakage from
dynamic kworker tasks.

Issue #4575.
2022-08-10 13:33:04 +02:00
Josef Söntgen
bc665384c3 dde_linux: free stack on task destruction
Issue #4575.
2022-08-10 13:33:04 +02:00
Stefan Kalkowski
8255053242 platform_drv: export Intel graphics PCI infos
Provide additional PCI register information inside the pci-config part
of the devices ROM for clients able to access an Intel graphic card,
namely the GMCH control register content, which contains for instance
the GTT size and stolen memory size.

Ref genodelabs/genode#4578
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
9dfc2caa11 platform_drv: add UHCI PCI quirks
Implement BIOS handover and Intel resume register update
apart from device driver to circumvent export of PCI
config space to drivers.

Ref genodelabs/genode#4578
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
413e2baa1c platform_drv: PCI assignment failure is no error
When there is no I/O MMU available the assignment is failing too,
although this is no error but normal behaviour.

Ref genodelabs/genode#4578
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
8f9b5e9bd2 depot: src package for pci_decode
Ref genodelabs/genode#4578
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
2cc6c1adef pci: export BAR indices, sub-vendor, -product, rev
The pci_decode has to extract the additional fields from the PCI configuration
space. The platform driver again has to parse and forward the knowledge too.
The PCI BAR indices are exported when info="yes" is set in the policy node for
the corresponding session.

Fix genodelabs/genode#4577
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
5bf3e72d37 pci: return correct I/O port base from BAR
The base address of I/O ports has a different encoding than
those of I/O memory. This needs to be encountered in the PCI
config helper utilities.

Fix genodelabs/genode#4576
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
49c6e01049 qemu-usb: ignore invalid USB data packets
Fix genodelabs/genode#4574
2022-08-10 13:33:03 +02:00
Johannes Schlatow
a6a856cb70 dde_ipxe: fix allocation errors under high TX load
Under high TX load, 'irq_handler()' is rarely executed but packets
are still received since 'netdev_poll()' is called for every TX packet.

'netdev_poll()' not only handles completed transmissions but also
puts the IO buffers of received packets into the RX queue and refills the RX
ring by allocating more IO buffers. However, the IO buffers can only be freed
after they have been dequeued and passed to the 'rx_callback()'. Since
this was only done by 'irq_handler()', we exhaust the slab allocator
under high TX load.

A fix for this is to process the RX queue not only in the IRQ handler
but also when transmitting packets.

genodelabs/genode#4555
2022-08-10 13:33:03 +02:00
Alexander Boettcher
e2b61231ae pc: avoid use usleep_range in m/udelay emulation
m/udelay is called with closed interrupts. Linux contrib code expects no
other task to be run respectively to be re-scheduled. usleep_range leads to
executing other tasks, which causes assertions in "spinlock taken twice" or
"unexpected preempt count" errors, seen on runtime with wifi_drv and intel_fb.
The assertion triggered with the changes by #4562.
2022-08-10 13:33:03 +02:00
Alexander Boettcher
6c5d2253c9 sel4: increase caps in filesystem tests
fixes x86_32/64 libc_vfs_fs_ext2 and libc_vfs_fs_fat
2022-08-10 13:33:03 +02:00
Martin Stein
3868df9f8b nic_router_dhcp_*: raise timeouts
On okl4, pistachio, sel4 the test didn't come up fast enough in order to still
experience the first configuration of NIC router #1. This commit doubles the
lifetime of the first configuration of NIC router #1 to 4 seconds and raises
the overall test timeout accordingly.

Ref #4555
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
89f9e7a3ee lx_emul: consolidate SMP + NO_HZ_IDLE
* Move common SMP and NO_HZ_IDLE variables and functions into
  generic lx_emul shadow implementations, and integrate them
  into the common lx_emul import rules
* Enable SMP and NO_HZ_IDLE within virt_linux kernel configuration
* Adapt pc drivers and wireguard accordingly
* Use original Linux softirq implementation in wireguard
* Remove erroneous softirq shadow implementation

Ref genodelabs/genode#4540
Ref genodelabs/genode#4562
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
48eacb6f79 qemu-usb: handle Interface_not_found exceptions
Fix genodelabs/genode#4572
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
560747c22e lx_emul: active config validation in usb driver
Fix genodelabs/genode#4567
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
92a5fa9bed lx_emul: remove usb device reset in session close
Ref genodelabs/genode#4566
2022-08-10 13:33:03 +02:00
Martin Stein
e32157e21b nic_router: packet allocation w/o exceptions
In overload situations, i.e. when a sender fills up the entire buffer, we land
in situations where the sender receives an ack_avail signal, releases one
packet, allocates and sends a packet and fails to allocate a second packet.
This is especially relevant if the receiver does not batch ack_avail signals
(such as vfs_lwip). In those ping-pong scheduling scenarios, the overhead from
catching the Packet_alloc_failed exception becomes significant. In case of the
NIC router, we will land in an overload situation if the sender is faster than
the receiver. The packet buffer will be filled up at some point and the NIC
router starts to drop packets. For every dropped packet, we currently have to
catch the Packet_alloc_failed exception.

This commit adds a new method alloc_packet_attempt to Packet_stream_source that
has almost the same signature as the older alloc_packet method but returns
an Attempt<Packet_descriptor, Alloc_packet_error> object. As the method already
used the allocator back end exception-less, changes on lower levels were not
needed. Furthermore, the NIC router was modified to use the new exception-less
alloc_packet_attempt instead of alloc_packet.

Ref #4555
2022-08-10 13:33:03 +02:00
Alexander Boettcher
3f69457a94 pc/intel: add intel_fb test to autopilot 2022-08-10 13:33:03 +02:00
Martin Stein
433029c3a6 nic_router: find ARP cache entries w/o exceptions
Replaces the former implementation of the 'find_by_ip' method at the data
structure for ARP cache entries. This method used to return a reference to the
found object and threw an exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Ref #4555
2022-08-10 13:33:03 +02:00
Johannes Schlatow
e2086ac8e4 nic_router: change max_packets_per_signal default
According to a benchmarking series on Zynq (base-hw) and x260 (base-nova) using
test-nic_perf_router, increasing the 'max_packets_per_signal' has a significant
effect on the packet throughput. By increasing the default value from 32
to 150, we could gain a few hundred Mbit/s. Increasing the value further
does not seem to have such a strong effect, though.

genodelabs/genode#4555
2022-08-10 13:33:03 +02:00
Johannes Schlatow
a2b74af59a depot: add nic_perf recipes
genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
3e562bc9bb os: add nic_perf component
The nic_perf component is used for benchmarking the throughput of Nic
and Uplink sessions.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
8df8f78fe2 nic_router_dhcp: fix signal handler in test client
The test client did not react upon packet_avail and ack_avail signals.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Martin Stein
9a37ccfe29 nic_router: incremental L4 checksum updates
The checksums for forwarded/routed UDP, TCP and ICMP, used to be always
re-calculated from scratch in the NIC router although the router changes only
a few packet fields. This commit replaces the old approach whereever sensible
with an algorithm for incremental checksum updates suggested in RFC 1071.
The goal is to improve router performance.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
b6d15fa3ab nic_router: incremental IPv4 checksum updates
The checksums for forwarded/routed IPv4, used to be always re-calculated from
scratch in the NIC router although the router changes only a few packet fields.
This commit replaces the old approach whereever sensible with an algorithm for
incremental checksum updates suggested in RFC 1071. The goal is to improve
router performance.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
d69e89f5cb internet checksum: use signed long for accumulator
We used to use 'unsigned long' for the accumulating variable when calculating
internet checksums. However, 'signed long' is more in accordance with RFC 1071
and will allow us to share the same back end for folding, once we implement
incremental updating of internet checksums.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
6b3ed6c75b internet checksum: no default arg value
Prevent public reflection of the only internally used 'init_sum' argument in
'uint16_t internet_checksum(...)' that, in addition, added a default value to
the function interface.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
07d4a7c11f nic_router: no IPv4 checksum update on ICMP echo
When sending an ICMP ECHO reply, the router merely swaps SRC and DST of the
IPv4 header of the corresponding request and these changes cancel each other
out in checksum calculation. Therefore, with this commit, the router skips
updating the IPv4 checksum in this context.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
865ee192b4 nic_router: no checksum update on IP routing
The router used to update IPv4 checksums when routing via an <ip> rule
despite the fact that it doesn't change any IPv4 header fields in this case.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
95b3b36cd9 nic_router: update checksums only once per packet
The NIC router used to update IPv4 and layer 4 checksums of a packet for each
interface it was sent to (say, all interfaces of the domain the packet was
routed to). However, there was and is no technical reason for not doing it
only once and then iterating over the interfaces with the already updated
packet. This is what this commit does in an intent to raise the router's
performance.

Ref #4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
01c9c32573 nic_router: relax timer accuracy for timestamps
The NIC router uses the timer for relatively coarse-grained timeouts.
It therefore suffices to update and store the current time when the NIC router
is signalled and use the cached time instead. This prevents frequent
syscalls or RPCs when acquiring the current time for every packet.

genodelabs/genode#4555
2022-08-10 13:33:02 +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
Johannes Schlatow
3ea910bf83 packet_stream: reset wakeup_needed on wakeup()
The wakeup call only emits a single signal as it assumed both are
handled by the same signal handler. However, the original implementation
did not reset the wakeup_needed variable properly.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
6a308dacd7 packet_stream: always emit ack_avail
When using signal batching, ack_avail and packet_avail should always
be emitted and preferred over ready_to_submit and ready_to_ack.
A signal receiver might decide to not register the ready_to_* signals when it
handles congestion by dropping packets. The Nic router is an example of
such a signal receiver.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
8193f5571a nic_router: batch packet stream signals
genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Alexander Boettcher
359283968a vbox6: improve NMI handling
Fixes #4568
2022-08-10 13:33:02 +02:00
Christian Helmuth
eda6c6607c Restore dynamic on/off in usb_webcam test
Issue #4565
2022-08-10 13:33:02 +02:00
Christian Helmuth
8d7ade5604 lx_emul: fix single USB interface claim/release
Fixes #4565
2022-08-10 13:33:02 +02:00
Stefan Kalkowski
596c20c199 pc: enable SMP and softirq/tasklets in lx_emul
Enables symetric-multi-processor support in the Linux kernel configuration
used as base for the driver ports for PC. This is done to be compliant with
common usage of x86 drivers today.
Moreover, this commit uses the original kernel source for softirq/tasklet
implementation to get rid of the insufficient shadow implementation
in the lx_emul sources.

Ref genodelabs/genode#4562
2022-08-10 13:33:02 +02:00
Stefan Kalkowski
ec1b060fc5 dde_linux: x86 requirements for SMP
Prepare shadow implementations in spinlocks, pagetable defines,
and irq_stack assembler macros to be able to enable SMP on x86/PC.

Ref genodelabs/genode#4562
2022-08-10 13:33:02 +02:00
Stefan Kalkowski
c898a4770b dde_linux: initialize wait_bit subsystem
This is needed to compile kernel/sched/wait_bit.c needed by
x86 SMP as prerequisite for kernel/softirq.c.

Ref genodelabs/genode#4562
2022-08-10 13:33:01 +02:00
Josef Söntgen
558e2fc35e libdrm/etnaviv: fix DRM version implementation
Issue #4559.
2022-08-10 13:33:01 +02:00
Josef Söntgen
da25b288ee libports: add mesa/lima driver
This commit introduces the Mesa3D lima driver for Mali 400 series
GPUs.

Issue #4559.
2022-08-10 13:33:01 +02:00
Josef Söntgen
d2c26fd504 libdrm: introducde DRM dispatcher
The dispatcher will select between the various DRM drivers. For
now it is only used by the etnaviv driver.

Issue #4559.
2022-08-10 13:33:01 +02:00
Josef Söntgen
1f819a26e5 mesa/etnaviv: use VFS Gpu plugin to acquire Env
Issue #4559.
2022-08-10 13:33:01 +02:00
Josef Söntgen
02f3b965b9 mesa/etnaviv: move to arm_v8 spec
Issue #4559.
2022-08-10 13:33:01 +02:00
Josef Söntgen
2e81137a80 mesa/iris: build dummy only on x86
Issue #4559.
2022-08-10 13:33:01 +02:00
Alexander Boettcher
b03cb94b43 pc: add linux driver timer test
The test runs as lx_user task and uses several *delay and wait queue test
cases happened to be used in real ported linux drivers. The test shows
the time spent with several time sources, e.g. jiffies, rdtsc,
lx_time_counter_count etc.

Issue #4540
2022-08-10 13:33:01 +02:00
Alexander Boettcher
46b487c2f7 pc: consolidate __const_udelay for linux drivers
Use common implementation used by wifi and (not merged) audio driver.
Avoid usage of lib/delay.c since lpj and loop_for_jiffies are not calibrated
for the ported drivers as done on native Linux during boot and leads to wrong
delays for usb and intel_fb.

Issue #4540
2022-08-10 13:33:01 +02:00
Alexander Boettcher
7b4556e546 intel_fb: remove schedule_timeout wrap
Issue #4540
2022-08-10 13:33:01 +02:00
Alexander Boettcher
9ecbe51e34 pc_linux: enable NO_HZ_IDLE
the option enables support to stop periodic ticking when in idle task.

Adjust dummies of intel_fb, wifi, usb drivers accordingly.

Issue #4540
2022-08-10 13:33:01 +02:00
Alexander Boettcher
ce67be5a86 lx_kit: sanitize that solely ep calls schedule()
with expected primary stack.

Issue #4540
2022-08-10 13:33:01 +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
Christian Helmuth
fb0fe8617c dde_linux: re-enable -Wformat
Fixes #4542
2022-08-10 13:33:01 +02:00
Christian Helmuth
0f009ecbdd lx_emul: add lx_emul_backtrace()
Issue #4542
2022-08-10 13:33:01 +02:00
Christian Helmuth
3b3eef5307 lx_emul: add devm_ioremap_uc()
Issue #4542
2022-08-10 13:33:01 +02:00
Christian Helmuth
ea8df22dbb dde_linux: fully enable printk format specifiers
The new Lx_kit::Console::print_string() method skips leading
log-level markers in strings if detected.

Issue #4542
2022-08-10 13:33:00 +02:00
Johannes Schlatow
7d2f019681 libc: output warning if RTC is not present
genodelabs/genode#4561
2022-08-10 13:33:00 +02:00
Alexander Boettcher
01d7c07920 pc/linux: add contrib patches
- intel_fb: avoid pagefault in fliphandler
- usb_host: avoid hang of usb xhci hardware

Fixes #4556
2022-08-10 13:33:00 +02:00
Peter Krummenacher
f859cd11bd rom_filter: support sub nodes outside of <inline>
Fixes #4560
2022-08-10 13:33:00 +02:00
Josef Söntgen
9183870b9e gpu: add information for lima driver
Issue #4559.
2022-08-10 13:33:00 +02:00
Josef Söntgen
b6cfb5a8fe gpu_session: add PPGTT address query function
Using the 'query_buffer_ppgtt()' function allows for retrieving the
virtual address of the buffer in the PPGTT.

This is for components that manage the GPU virtual addresses rather than
the client as is the case with the lima driver.

Issue #4559.
2022-08-10 13:33:00 +02:00
Alexander Boettcher
757fdba9fd dde_linux: set max timeout for rcu_needs_cpu
Adhere to include/linux/rcutiny.h behaviour, which sets the max timeout
for rcu_needs_cpu. Without the commit, in the most cases the timeout value
is zero (or random since the pointer is on stack uninitialized), which leads
to programming very short timeouts again and again, making the system never
idle.

Issue #4540
2022-08-10 13:33:00 +02:00
Alexander Boettcher
a23f6209ae lx_emul: stop ticking in idle task
Fixes #4540
2022-08-10 13:33:00 +02:00
Norman Feske
d27c504261 menu_view: increase local font cache to 1 MiB
This allows the use of font sizes up to 50 px without constant cache
misses.
2022-08-10 13:33:00 +02:00
Norman Feske
202bb707ce menu_view: ignore zero-sized widgets in box layout
The box layout evenly distributes the child widgets according to the
number of children. This is not desired in the special case where a
child widget has a size of zero. The patch changes the layout algorithm
such that zero-sized widgets are not taken into account for distributing
residual space.
2022-08-10 13:33:00 +02:00
Norman Feske
b4ded050e1 sculpt: hook for modem-driver integration
This patch the interplay between the leitzentrale subsystem and a modem
driver hosted in the drivers subsystem.
2022-08-10 13:33:00 +02:00
Norman Feske
a9b4be3883 menu_view: make menu_view_styles.tar more obvious
This patch replaces the former implicit "phonyness" of the rule by an
explicit .PHONY and installs a symlink from the target's build directory
to bin/ as is the usual practice for regular targets.

Related to issue #3972
2022-08-10 13:33:00 +02:00
Christian Helmuth
9a47f7bf71 sandbox: prevent non-empty list model on destruction
The parent-provides model is destroyed if no <parent-provides> node is
found in the configuration, which resulted in

  Warning: list model not empty at destruction time

and leaking memory for the allocated nodes. The commit now explicitly
empties the list model in the destructor of ~Parent_provides_model.

Note, the case is implicitly tested in pkg/test-init by step "denial of
forwarded session request" and <init_config version="empty">.

Thanks to Peter for reporting this issue.

Fixes #4547
2022-08-10 13:33:00 +02:00
Christian Helmuth
f14b68202c dde_linux: shadow evdev.c and use event C API
Fixes #4543
2022-08-10 13:33:00 +02:00
Christian Helmuth
4550ec4716 genode_c_api: key-press/release and relative-motion events
Issue #4543
2022-08-10 13:33:00 +02:00
Christian Helmuth
393766a931 legacy_platform_drv: ACPI devices in configuration
Known ACPI device resources can be statically configured on startup like
follows.

  <config>
    <policy label_prefix="driver">
      <device name="ACPI0000"/>
    </policy>
    <device name="ACPI0000" typee="acpi">
      <irq number="99" mode="level" polarity="low"/>
      <io_mem        address="0xfc000000" size="0x100000"/>
      <io_port_range address="0x4000"     size="4"/>
    </device>
  </config>

Fixes #4545
2022-08-10 13:33:00 +02:00
Christian Helmuth
c5bdc1ccbe acpica: configure SCI IRQ mode
Issue #4553
2022-08-10 13:33:00 +02:00
Christian Helmuth
924e1d741d lx_emul: cleanup naming of lx_emul_random_gen*
Issue #4544
2022-08-10 13:33:00 +02:00
Martin Stein
1fbe72b7dd lx_emul: fixed types in lx_emul_gen_random_u*
* Rename lx_emul_gen_random_uint lx_emul_gen_random_u32.
* Use genode_uint*_t as return types for the lx_emul_gen_random_u* functions.

Ref #4544
2022-08-10 13:33:00 +02:00
Alexander Boettcher
5a4efcad0a tool: update to uefi mode aware bender
Fixes #4426
2022-08-10 13:33:00 +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
Martin Stein
d5b1d9466a nic_router: clear ARP cache when domain is down
Whenever a domain looses all its interfaces or the link state of all attached
interfaces is down at once, the domain potentially moves to another Ethernet
segment and should therefore consider its ARP cache to be outdated.

RFC 826 states that "... If a host moves, any connections initiated by that
host will work, assuming its own address resolution table is cleared when it
moves. ...".

Therefore, this commit introduces clearing the ARP cache and the initially
stated events.

This commit was motivated by an issue with the PinePhone Modem and USB NIC.
On the PinePhone, the Modem has its own OS and acts as direct gateway to the
outer world for the USB NIC that is driven by Genode. However, whenever the
Modem gets restarted, Modem and USB NIC receive a new MAC address. This used
to conflict with the NIC routers ARP entry for the Modem that didn't cease to
be valid.

With this commit, the integrator of such a scenario at least has a convenient
way of fixing this by ensuring that all interfaces at the USB NIC domain go
down when resetting (e.g. by ensuring that the USB NIC is the only interface at
that domain).

Fixes #4558
2022-08-10 13:32:59 +02:00
Sebastian Sumpf
64c81e2846 usb_net: Add cdc_ether ECM support
* Enable ECM devices
* Allow disconnect of devices
* Handle link state correctly
* Required by PinePhone's USB modem

issue #4557
2022-08-10 13:32:59 +02:00
Sebastian Sumpf
96b147b63d dde_linux/usb/legacy: only free completed URBs
In case a USB client cancelled URBs, do not free them, wait until the
packets/URBs are acked by the USB session.

issue #4557
2022-08-10 13:32:59 +02:00
Sebastian Sumpf
87aa456bfd lx_emul: remove 'shadow/softirq.c' from common imports
softirq.c implements tasklets that need on the PinePhone cannot be
called directly.

issue #4557
2022-08-10 13:32:59 +02:00
Christian Helmuth
ab9a2107e4 nova: support interrupt mode config in assign_gsi
Fixes #4553
2022-08-10 13:32:59 +02:00
Christian Helmuth
47c924d1f5 pc: use lx_emul_gen_random_bytes() for randomness
Fixes #4544
2022-08-10 13:32:59 +02:00
Christian Helmuth
427f3bb634 run/load/ipxe: support ISO and UEFI images
Patch by Roman Iten and Pirmin Duss.
2022-08-10 13:32:59 +02:00
Roland Bär
789a60278c gmp: extensions for chrony
- compile nextprime, sec_div and sqr_diag_addlsh1
- updated symbols and hash

Fixes #4526
2022-08-10 13:32:59 +02:00
Roland Bär
88db584566 libc: timex, socket_fs_recvmsg and sendmsg
- Added timex.h as provided header file
- implementation of socket_fs_recvmsg
- implementation of sendmsg

Changes needed for chrony port.

Issue #4526
2022-08-10 13:32:59 +02:00
Roland Bär
18b022bf6b rtc_drv: log 'set time' message on verbose
The "verbose" config attribute instructs the driver to log 'set time'
messages when the RTC updated initially or from the 'set_rtc' ROM.

Fixes #4526
2022-08-10 13:32:59 +02:00
Johannes Schlatow
1c5db07342 lxip: add warning when schedule_timeout is called
genodelabs/genode#4551
2022-08-10 13:32:59 +02:00
Johannes Schlatow
a8070a429a libc: propagate fd flags in socket_fs_plugin
When creating a socket, fd flags can be specified by ORing them with the
socket type. Most importantly, the flag SOCK_NONBLOCK must be propagated
to the Socket_fs::Context in order to support non-blocking recv/send.

genodelabs/genode#4550
2022-08-10 13:32:59 +02:00
Josef Söntgen
7c340b1cc9 pc/wifi: implement iput dummy
The 'iput()' function is called from '__sock_release()' when the sock
object has no valid file object. The release function on the other hand
is called when the supplicant closes a socket.

Fixes #xxx.
2022-08-10 13:32:59 +02:00
Christian Prochaska
fd8d439e39 qt5: add 'QtGraphicalEffects' QML plugin
Fixes #4549
2022-08-10 13:32:59 +02:00
Christian Prochaska
91c0cde742 qt5: provide all 'qt5_declarative' QML plugins
Fixes #4548
2022-08-10 13:32:59 +02:00
Christian Prochaska
e7cc54204f qt5: add CMake support
Fixes #4546
2022-08-10 13:32:59 +02:00
Christian Prochaska
079fd0071a qt5: update port for Morph browser support
- fix OpenGL issues
- pass touch press location with touch release event to
  fix button clicks with touch screen
- fix AVX alignment error in ffmpeg code on base-linux
- add generated cmake support files

Fixes #4541
2022-08-10 13:32:59 +02:00
Martin Stein
925d229d67 nic_router: find AVL string nodes w/o exceptions
Replaces the former use of the 'find_by_name' method of the AVL string tree.
This method returned a reference to the found object and threw an exception if
no matching object was found.

The locally implemented replacement doesn't return anything and doesn't throw
exceptions. It takes two lambda arguments instead. One for handling the case
that a match was found with a reference to the matching object as argument and
another for handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Furthermore, this commit modifies the local wrapper for the  insert method of
the AVL string tree, so, that it follows the above mentioned concept as well.

Ref #4536
2022-08-10 13:32:59 +02:00
Martin Stein
6294167eff nic_router: find nat rules w/o exceptions
Replaces the former implementation of the 'find_by_domain' method at the data
structure for NAT rules. This method used to return a reference to the found
object and threw an exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Ref #4536
2022-08-10 13:32:58 +02:00
Martin Stein
65955601f0 nic_router: find permit rules w/o exceptions
Replaces the former implementation of the 'find_by_port' method at the data
structure for permit rules. This method used to return a reference to the found
object and threw an exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Furthermore, the commit introduces a convenience wrapper for finding the best
matching pair of transport rule and corresponding permit rule for a given
destination IP and port. This method as well follows the above mentioned
concept.

Ref #4536
2022-08-10 13:32:58 +02:00
Martin Stein
0f6714c6d7 nic_router: find forward rules w/o exceptions
Replaces the former implementation of the 'find_longest_prefix_match' method at
the data structure for direct rules. This method used to return a reference to
the found object and threw an exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Ref #4536
2022-08-10 13:32:58 +02:00
Martin Stein
5d14adebb5 nic_router: find direct rules w/o exceptions
Replaces the former implementation of the 'find_longest_prefix_match' method at
the data structure for direct rules. This method used to return a reference to
the found object and threw an exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Ref #4536
2022-08-10 13:32:58 +02:00
Martin Stein
baf4a85d23 nic_router: find link sides w/o exceptions
Replaces the former implementation of find_by_id at the data structure for
links. This method used to return a reference to the found object and threw an
exception if no matching object was found.

The new implementation doesn't return anything and doesn't throw exceptions. It
takes two lambda arguments instead. One for handling the case that a match was
found with a reference to the matching object as argument and another for
handling the case that no object matches.

This way, expensive exception handling can be avoided and object references
stay in a local scope.

Ref #4536
2022-08-10 13:32:58 +02:00
Stefan Kalkowski
4234659cac pci_decode: fix iteration bounds of PCI buses
Fix #4539
2022-08-10 13:32:58 +02:00
Stefan Kalkowski
0b5ad90bde usb_host: handle control URBs asynchronously
In the Genode C API and the DDE Linux USB host driver, turn control
URBs into asynchronously handled ones.

Fix genodelabs/genode#4535
2022-08-10 13:32:58 +02:00
Josef Söntgen
1ca2265fd4 pc/wifi: do not execute driver on user stack
The 'with_libc' call at this point is not necessary and could be
harmful as it forces the usage of the user stack for the driver.
All code depending on this distinction should only be executed
from within the pthread.

Issue #4537.
2022-08-10 13:32:58 +02:00
Josef Söntgen
a90abbc22e pc/wifi: get RFKILL state on frontend construction
Issue #4537.
2022-08-10 13:32:58 +02:00
Josef Söntgen
10451652f4 pc/wifi: avoid late frontend construction
Dissolve unintentional dependency between wifi management layer and the
control interface of the supplicant.

Issue #4537.
2022-08-10 13:32:58 +02:00
Josef Söntgen
9393c0136c pc/wifi: prevent calling driver from pthread
Querying the RFKILL state led to execution of the Lx_kit::scheduler by
the pthread running the wpa_supplicant. As this may not happen the
RFKILL state is now solely managed by the driver and only the cached
state is read by the supplicant.

Fixes #4537.
2022-08-10 13:32:58 +02:00
Piotr Tworek
9d417ee2f5 os: Allow VirtIO drivers to be built for RISC-V
Just add riscv spec files. The riscv versions should use MMIO transport
as ARM versions do. They also should work fine for riscv_qemu machine
from genode-riscv repository.
2022-08-10 13:32:58 +02:00
Piotr Tworek
e7fb38834a virtdev_rom: Add RISC-V platform support.
The location of the VirtIO device block is different on RISC-V virt qemu
machine.
2022-08-10 13:32:58 +02:00
Stefan Kalkowski
6e4c3b2fd6 sculpt: support to skip depot archive integration
To not integrate referenced depot packages when building a sculpt image,
just set the environment variable DEPOT= to be empty. This allows to produce
slim images to the price that you have to publish the packages yourself.
In that case the sculpt run-script reminds you, and prints the package
versions.

Fix genodelabs/genode#4530
2022-08-10 13:32:58 +02:00
Alexander Boettcher
f1265205b9 sculpt: add intel_opregion report/rom routing
Issue #4531
2022-08-10 13:32:58 +02:00
Alexander Boettcher
f1af654502 intel_fb: add apply_on_hotplug attribute
Make it configurable, whether on a hotplug event the current valid Genode
config for the driver will be re-evaluated. By default it will be re-evaluated.

Issue #4531
2022-08-10 13:32:57 +02:00
Alexander Boettcher
80981dbefb intel_fb: re-evalute max resolution on unplug
On connector unplug the overall resolution of all available active connectors
can shrink and must be considered to potentially re-create the Capture
connection with smaller resolution size. Additionally, update the documentation.

Issue #4531
2022-08-10 13:32:57 +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
Alexander Boettcher
c2d9fbca9b acpi_drv: report Intel opregion copy
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 make a copy of the Intel Opregion and report it as
is. 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.

Issue #4531
2022-08-10 13:32:57 +02:00
Alexander Boettcher
b1195508ba platform_drv: avoid filtering of dev in ALL policy
ACPICA needs access to the host bridge 0:0.0 on Intel, which is also
accessed by the Intel display driver. Since for the Intel display driver the
PCI device is specified in the policy explicitly, the PCI device is filtered
out for the ACPICA driver which uses the policy "ALL".

Issue #4532
2022-08-10 13:32:57 +02:00
Stefan Kalkowski
f4f2b456b6 base-hw: invalidate VM TLB entries in deletion
This commit introduces a hypervisor calling interface. The host kernel can
use it to either switch to a guest VM, or to invalidate the TLB with
regard to a specified VM id.
The VM-specific TLB invalidation is called whenever a VM (Vcpu)
gets destroyed.

Fix genodelabs/genode#4528
2022-08-10 13:32:57 +02:00
Stefan Kalkowski
4382d29422 base-hw: invalidate TLB only once on ARMv8
Fix genodelabs/genode#4529
2022-08-10 13:32:57 +02:00
Stefan Kalkowski
d6592ca2cb base-hw: unset deleted PD values in MMU
When a PD gets deleted check whether it is active on the current CPU resp. MMU.
If yes, switch to core/kernel's PD to prevent that invalid page-tables or
address-space IDs are still in use. Moreover, whenever we switch to an idle
thread, we switch to kernel/core's PD too. Thereby, we prevent that vanished
PDs are still active on CPUs different from the one, where the core entrypoint
is active, which does the PD deletion.
This whole scheme is only valid under the assumption that core has only one
entrypoint running on one CPU.

Fix genodelabs/genode#4527
2022-08-10 13:32:57 +02:00
Stefan Kalkowski
5cfb9e3e9d base-hw: distinguish core, idle, user threads
Do not only distinguish core and user threads, but the idle threads too.
Instead of a boolean value, introduce a new thread type.

Ref genodelabs/genode#4527
2022-08-10 13:32:57 +02:00
Sebastian Sumpf
c74a8c9fa8 lx_emul: support for 'alloc_pages_exact' 2022-08-10 13:32:57 +02:00
Sebastian Sumpf
dc77417396 lx_emul: add 'virt_range_start' to memory model
Returns the start address of are memory region for given virtual
address.
2022-08-10 13:32:57 +02:00
Sebastian Sumpf
151a5e2d7f lx_emul: add 'pgprot_noncached' to pgtable.h 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
Alexander Boettcher
9b5840cb70 acpica: remove diagnostic messages
during PCIe config access.

Issue #4532
2022-08-10 13:32:57 +02:00
Alexander Boettcher
438e0adc77 acpica: remove support to access pci via i/o ports
All access to PCI devices can be handled nowadays via the platform session.
The I/O port access seems also to work not properly on newer UEFI machines.

Fixes #4532
2022-08-10 13:32:57 +02:00
Josef Söntgen
b77f59286f gpu/intel: abort client on accounting mismatch
Issue #4525.
2022-08-10 13:32:57 +02:00
Josef Söntgen
1010267dee gpu/intel: increase worst case CAP estimate
It may happen that 1 additional CAP is used during buffer allocation.

Fixes #4525.
2022-08-10 13:32:57 +02:00
Josef Söntgen
d9f6882a2a libports: update e2fsprogs to 1.46.5
Brings in Ext4 support.

Fixes #4524.
2022-08-10 13:32:57 +02:00
Josef Söntgen
0ffc55a20a Remove unneeded session_size check
As accommodating the session component object is already taken care of
be the root component implementation, remove the remaining redundant
checks.

Fixes #4521.
2022-08-10 13:32:57 +02:00
Josef Söntgen
d3e53b3cca pc_wifi_drv: unblock pthread via signal
Since unblocking the pthread directly may lead to corruption we need
to post-pone it. So we send a signal that should be handled by the EP
after the EP has finished its current line of work.

Fixes #4523.
2022-08-10 13:32:56 +02:00
Josef Söntgen
9d383037e4 lx_emul: set task 'stack' member
Instead of allocating the stack via 'kmalloc' point it to the actual
stack used by the task. This addresses issues with the USB
host-controller driver where sometimes hub port enumeration is not
working.

Fixes #4522.
2022-08-10 13:32:56 +02:00
Martin Stein
9375e8d010 wireguard: no warning about possible alignm. issue
We locally disable 'address-of-packed-member' warnings because GCC complained
about possible alignment issues when returning a reference to a packed member
as naturally aligned pointer (for some reason only on arm_v8a). We know that
the member is aligned to NETDEV_ALIGN via __attribute__ and that the warning
is therefor unnecessary.

Ref #4519
2022-08-10 13:29:40 +02:00
Martin Stein
48e396913c wireguard: don't always rebuild device.c/netlink.c
We have to correct the CC_OPT_* variable for these files and used to do so via
phony pre-requisite for the corresponding object files because the correction
had to take place after the variable initialization in
import-lx_emul_common.inc and before the creation of the object files. However,
this caused the objects to always rebuild.

This commit fixes this issue by using Make's feature of target-specific
variables instead. The drawback of this solution is that we can no longer
override CC_OPT_* with a modification of its original value but instead have to
override with a completely new value. This is because otherwise, Make would
either complain about recursive assignment or produce an empty value.

Ref #4519
2022-08-10 13:29:40 +02:00
Martin Stein
b1c77dc42b wireguard: enable WARN_STRICT_CONVERSION in lib
The strict conversion warnings were disabled during development when the
contrib code was still compiled with the wireguard lib. Now this isn't
necessary anymore as the contrib code is in the wireguard_lx_inc_dirs lib.

Ref #4520
2022-08-10 13:29:40 +02:00
Martin Stein
6f777f90a8 wireguard: test multiple peers at a time
Extends the wg_reconfig run script to test that the WireGuard component is able
to handle multiple peers at the same time if configured.

Ref #4520
2022-08-10 13:29:40 +02:00
Martin Stein
36d2374ff9 wireguard: exit on invalid configurations
With this commit, the WireGuard component exits with a descriptive uncaught
exception on invalid configurations or when the user attempts to re-configure
attributes that are not re-configurable (private_key, listen_port, interface).

This is particularly important when it comes to the not re-configurable private
key. If the component would just ignore the attempt to override the private
key, the user may come to believe that his old (potentially compromised)
private key is not in use anymore.

The fact that the component now exits instead shouldn't be a problem, as the
user would have to restart the component anyway in order to apply the new
attribute values.

The commit also extends the wg_reconfig run script to test that WireGuard
exits on the attempt to re-configure the private key.

Ref #4520
2022-08-10 13:29:40 +02:00
Martin Stein
86259b998e wireguard: support removing peers
Support removing peers by removing them from the component configuration.
This commit also introduces the wg_reconfig run script that tests adding and
removing single peers.

Ref #4520
2022-08-10 13:29:39 +02:00
Martin Stein
560a166613 wireguard: flags value via enum when adding a peer
I used to set the peer flags to 2 when adding a peer but merely because I
observed that value in my reference Linux. I now found that the flag 1<<1 means
'WGPEER_F_REPLACE_ALLOWEDIPS' and is ignored whenever the peer is new. Anyway,
I keep setting the flag but with the clearer enum name because the wg tool is
doing it as well when adding new peers and we want to stay close to how the
original code interacts.

Ref #4520
2022-08-10 13:29:39 +02:00
Christian Helmuth
871ee04ed6 wireguard: enable wg_fetchurl.run on sel4 2022-08-10 13:29:39 +02:00
Michael Mueller
99286e0c5c Updated mxtasking. 2022-07-26 17:37:22 +02:00
Michael Müller
ad0f2d3933 hello_mxtask: Turnoff optimization and compile with debug flags. 2022-07-21 13:56:51 +02:00
Michael Müller
f76aaa0abf hello_mxtask: Added config for gdb and qemu. 2022-07-21 13:43:32 +02:00
Michael Müller
668ea3f253 hello_mxtask: Needed more build modules. 2022-07-21 13:36:23 +02:00
Michael Müller
d015297925 hello_mxtask: Missed closing start tag. 2022-07-21 13:27:49 +02:00
Michael Müller
0191b42e51 hello_mxtask: Removed demo import. 2022-07-21 13:26:15 +02:00
Michael Müller
68e4ef34d3 hello_mxtask: Start drivers service. 2022-07-21 13:24:10 +02:00
Michael Müller
4af23e023f hello_mxtask: Missed tag. 2022-07-21 13:19:04 +02:00
Michael Müller
a921845e36 hello_mxtask: Added vfs for gdb_monitor. 2022-07-21 13:17:35 +02:00
Michael Müller
06fd884ef4 hello_mxtask: Missed plugin for pipe. 2022-07-21 13:13:44 +02:00
Michael Müller
2b66139f49 hello_mxtask: Missed function definition in runscript. 2022-07-21 13:07:44 +02:00
Michael Müller
8bb247da0e hello_mxtask: Integrated into gdb_monitor. 2022-07-21 13:05:26 +02:00
Michael Müller
8acd0741d4 hello_mxtask: Store tasks in std::vector. 2022-07-21 12:40:55 +02:00
Michael Müller
a7aaad6dae blinktree: Allocate Benchmark from component's heap. 2022-07-21 12:27:55 +02:00
Michael Müller
1dbdf5bd96 blinktree: Skip options. 2022-07-21 11:59:40 +02:00
Michael Müller
7d5338a393 blinktree: Fixed wrong order of cmdline arguments. 2022-07-21 11:53:52 +02:00
Michael Müller
bce0fbdc4f blinktree: Do not call std::cout outside of Libc::with_libc. 2022-07-21 11:50:32 +02:00
Michael Müller
fcaffab7d5 blinktree: Forgot to adapt call to create_benchmark in main.cpp. 2022-07-21 11:41:48 +02:00
Michael Müller
8c0ecf9ac9 Removed duplicate file. 2022-07-21 11:37:52 +02:00
Michael Müller
57662d5c8c blinktree: Use Genode::Threads for fill and mixed workload threads. 2022-07-21 11:37:13 +02:00
Michael Müller
ea036537c5 blinktree: Do not compile perf.cpp. 2022-07-20 18:44:20 +02:00
Michael Müller
6ba44cbe70 blinktree: Removed reference to chronometer from benchmark. 2022-07-20 18:41:13 +02:00
Michael Müller
1e7cd10657 blinktree: Put performance counter back as it is need for linking. 2022-07-20 18:28:26 +02:00
Michael Müller
0b42ee3da2 blinktree: Initalized arguments outside of call to main(). 2022-07-20 18:22:45 +02:00
Michael Müller
4afed37ffd blinktree: Superflous comma removed. 2022-07-20 18:17:24 +02:00
Michael Müller
bfcf897893 blinktree: Fixed compiler errors. 2022-07-20 18:15:40 +02:00
Michael Müller
fc7bdd97e0 blinktree: Fixed wrong path. 2022-07-20 18:01:40 +02:00
Michael Müller
a0c5ad77c9 blinktree: Added application path to include path. 2022-07-20 17:56:14 +02:00
Michael Müller
28a142821b blinktree: Removed perf.cpp from build. 2022-07-20 17:53:44 +02:00
Michael Müller
48b042564d Added B-link tree benchmark. 2022-07-20 17:50:56 +02:00
Michael Müller
f3eb97bf1c Hello_mxtask: Needed filename string instead of std::cout. 2022-07-20 15:09:09 +02:00
Michael Müller
d0d08c68aa Added vfs-plugins for libc to hello_mxtask.run. 2022-07-20 15:06:51 +02:00
Michael Müller
f94d7c40d1 Added profiling to hello_mxtask. 2022-07-20 15:00:17 +02:00
Michael Müller
0fdb9c7a4c Replaced Genode::Log with stdc++ iostream. 2022-07-20 14:40:56 +02:00
Michael Mueller
604a5f1f8e Merge branch 'master' of github.com:mmueller41/genode 2022-07-20 14:30:54 +02:00
Michael Mueller
0f565ba253 Removed nodiscard and added output via stdout. 2022-07-20 14:30:45 +02:00
Michael Müller
836bd76106 Added RTC to posix_playground. 2022-07-20 14:29:47 +02:00
Michael Müller
256c509550 Typo in runscript. 2022-07-20 14:23:18 +02:00
Michael Müller
c33e8cae4a Updated config for posix_playground. 2022-07-20 14:19:27 +02:00
Michael Müller
29b00817ed Fixed broken thread_test. 2022-07-15 15:05:35 +02:00
Michael Müller
a68cc9d6ee Minor changes. 2022-07-12 17:31:47 +02:00
Michael Mueller
e6da335de9 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 14:41:59 +02:00
Michael Müller
213fe79900 hello_tutorial: Corrected type for _id. 2022-07-11 14:41:44 +02:00
Michael Mueller
3b32c3f785 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 14:40:24 +02:00
Michael Müller
23b527ba85 hello_tutorial: Added RPC call to query session private _id. 2022-07-11 14:40:04 +02:00
Michael Mueller
a1856ca6d9 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 14:31:19 +02:00
Michael Müller
b8f6e86fa3 Removed unused variables. 2022-07-11 14:30:41 +02:00
Michael Mueller
544057fea1 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 14:26:49 +02:00
Michael Müller
f98359cbe6 hello_tutorial: Made hello session stateful. 2022-07-11 14:26:28 +02:00
Michael Mueller
1c3c8ca98f Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:35:26 +02:00
Michael Müller
481a26d286 hello_tutorial: Fixed broken scenario. 2022-07-11 12:35:02 +02:00
Michael Mueller
480bb08429 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:31:15 +02:00
Michael Müller
db3b242acb hello_tutorial: Adapted scenario. 2022-07-11 12:30:50 +02:00
Michael Müller
9399b07d0c hello_tutorial: Let hello_clients run periodically. 2022-07-11 12:28:26 +02:00
Michael Mueller
ed008edef8 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:19:54 +02:00
Michael Müller
baa130db17 Changed type for attributes _a and _b. 2022-07-11 12:19:35 +02:00
Michael Mueller
5a4de94aa8 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:17:27 +02:00
Michael Müller
5d6d54c066 Register config handler. 2022-07-11 12:17:09 +02:00
Michael Mueller
f8f8ea229a Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:08:34 +02:00
Michael Müller
2644b7d5aa Initialize _a and _b in constructor (-Weffc). 2022-07-11 12:08:07 +02:00
Michael Mueller
f0340b12a3 Merge branch 'master' of github.com:mmueller41/genode 2022-07-11 12:02:11 +02:00
Michael Mueller
1ff4093b40 Specified used APIs for MxTasking 2022-07-11 12:01:24 +02:00
Michael Mueller
e5b58e1eb6 Updated MxTasking example 2022-07-11 12:00:09 +02:00
Michael Mueller
0c1f727871 Working mxtasking port 2022-07-11 11:59:11 +02:00
Michael Müller
e6b09edaca Extended hello tutorial with second client and configurable parameters. 2022-07-11 11:57:05 +02:00
Michael Mueller
7d405d8f6a Updated include path 2022-07-06 17:48:26 +02:00
Michael Mueller
16f5ad55c8 Working ports file for mxtasking 2022-07-06 17:47:49 +02:00
Michael Müller
142ef47861 Added port of MxTasking with sample application. 2022-07-06 15:32:47 +02:00
Michael Müller
6b7fae0643 Start thread count with 1. 2022-07-04 16:35:56 +02:00
Michael Müller
64a2307c08 Forgot posix.lib.so as boot module. 2022-07-04 16:33:03 +02:00
Michael Müller
d0416903dc Typo in boot_modules. 2022-07-04 16:29:54 +02:00
Michael Müller
d1c240c6c5 Genode's stdcxx doesn't support std::make_unique(). 2022-07-04 16:28:50 +02:00
Michael Müller
48cbe050f7 Fixe type errors. 2022-07-04 16:25:50 +02:00
Michael Müller
55f07a89c6 Fixed type of thread_objs. 2022-07-04 16:20:49 +02:00
Michael Müller
33ff8591f0 Genode::log cannot print objects of type std::chrono::*. 2022-07-04 16:18:51 +02:00
Michael Müller
45fef3c8be Fixed makefile for posix_playground. 2022-07-04 16:17:05 +02:00
Michael Müller
834bebf3e5 Added POSIX playground for trying out POSIX and stdlib-related functions. 2022-07-04 16:14:55 +02:00
Michael Müller
d931e6a56e Do not use std::unique_ptr as it causes pagefaults. 2022-07-04 15:13:35 +02:00
Michael Müller
ff525b743f Use Genode timer for time measurement. 2022-07-04 15:10:53 +02:00
Michael Müller
7d9db940e2 Use component's heap for allocation. 2022-07-04 15:03:11 +02:00
Michael Müller
08ebbf001e Use correct thread type and fixed wrong call to exec_static_constructors. 2022-07-04 14:54:10 +02:00
Michael Müller
2888391eec Execute static constructors when creating component. 2022-07-04 14:50:27 +02:00
Michael Müller
95faab73fa Test for std::chrono and std::unique_ptr. 2022-07-04 14:43:48 +02:00
Michael Müller
9c4a683b33 Print affinity space before starting threads. 2022-07-01 16:42:54 +02:00
Michael Mueller
db81856dac Removed libc from LIBS in target.mk but added libc and stdcxx as boot modules for cstdint to be found 2022-07-01 16:34:58 +02:00
Michael Müller
c4a73980da Removed dependencies on stdcxx and libc. 2022-07-01 16:28:47 +02:00
Michael Müller
14ee3c0d36 Removed posix module. 2022-07-01 16:27:02 +02:00
Michael Müller
c4d4e12f7e Fixed wrong order in initializer list. 2022-07-01 16:22:54 +02:00
Michael Müller
6c0f4e232c Fixed typo in intializer list. 2022-07-01 16:20:57 +02:00
Michael Müller
a649cd8633 Use native threads. 2022-07-01 16:14:04 +02:00
Michael Mueller
71314a9ca3 Test of std::thread with posix sleep 2022-07-01 15:12:02 +02:00
Michael Mueller
29c00310ad Added missing dependencies 2022-07-01 15:11:18 +02:00
Michael Mueller
d4073612cb Removed libc from LIBS as it causes namespace mismatches. 2022-06-30 12:35:54 +02:00
Michael Müller
de772a6fc1 Wrong namespace for Component::Construct. 2022-06-30 12:28:16 +02:00
Michael Müller
f07003f2b8 Added correct namespace for Component::construct. 2022-06-30 12:26:15 +02:00
Michael Müller
ff9d123000 Fixed wrong type for parameter env. 2022-06-30 12:24:01 +02:00
Michael Müller
b5449df554 Fixed compiler errors. 2022-06-30 12:22:08 +02:00
Michael Müller
b255eb14fe Fixed wrong directory structure. 2022-06-30 12:13:19 +02:00
Michael Müller
f9d28eb8e0 Test scenario for std::thread. 2022-06-30 12:03:50 +02:00
Christian Helmuth
83f5dd8a8b pc/wifi: shared library depends on symbol.map
CUSTOM_TARGET_DEPS does not trigger relinking the lib but recreates the
.tag file only.
2022-06-02 09:33:27 +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
b6d313bbe6 version: 22.05 2022-05-31 13:34:17 +02:00
Norman Feske
dc0a0e0700 News item for version 22.05 2022-05-31 12:23:28 +02:00
Norman Feske
33a51ee20d Release notes for version 22.05 2022-05-31 12:23:28 +02:00
Christian Helmuth
a037fac5c5 depot: update recipe hashes 2022-05-31 10:52:11 +02:00
Stefan Kalkowski
e6602d527c lx_emul: remove duplication of ZERO_PAGE for ARM
The extra definition introduced by commit:
"lx_emul & arm: define ZERO_PAGE" re-defined the macro included
by a header of the contrib sources. This commit removes the
contrib header and defines thereby missing macros.
2022-05-31 10:52:11 +02:00
Stefan Kalkowski
d213cfa897 lx_emul: fix spinlock header for ARM
Fixes wrong atomic_*(ptr) usage with u32 pointer introduced by
commit "lx_emul: eliminate wrong include pathes". Atomic read or
write is nt needed in our case, we always schedule cooperatively.
2022-05-31 10:52:11 +02:00
Christian Helmuth
f4dabf08e2 Fix nested run in vbox5_genode_usb_hid_raw
Since "Consolidate USB test run-scripts" usb_hid_raw.run depends on
depot archives. Therefore, '--depot-dir' and '--depot-user' must be
passed to the nested run tool to cover cases that customize the depot
(e.g., our nightly CI).

Issue #4511
2022-05-31 10:52:00 +02:00
Martin Stein
aea993b96a wireguard: sculpt package
Introduces the pkg/wireguard archive that depends on the new src/wireguard
archive and deploys one WireGuard component with an empty configuration (can
be configured by the user via a launcher, for instance).

Fixed #4519
2022-05-31 10:52:00 +02:00
Martin Stein
520742cf3e wireguard: generic target.mk
Introduce an arch-specific wireguard lib that contains all code from the
former arch-specific target.mk files. This allows us to create a generic
target.mk that merely depends on the library and a dummy.cc file. The latter
ensures that building/linking of the target isn't skipped by the build system.

Ref #4519
2022-05-31 10:52:00 +02:00
Martin Stein
83408ef35c wireguard: rename wireguard lib
The wireguard library's purpose is having a separate INC_DIR setting for the
files that need Linux include paths that would clash with Genode include paths.
Therefore, the name wireguard_lx_inc_dirs is more descriptive. Furthermore,
this allows us to create a new arch-specific wireguard lib in a future commit
in the course of preventing arch-specific target.mk's (a commonly used
approach in Genode).

Ref #4519
2022-05-31 10:52:00 +02:00
Norman Feske
823d0d5360 doc/news.txt: minor spelling fix 2022-05-31 10:52:00 +02:00
Christian Helmuth
3105fa9e0f depot: update recipe hashes 2022-05-25 12:23:04 +02:00
Norman Feske
4727c18531 News item for Genode Platforms 22.05 2022-05-25 12:23:04 +02:00
Johannes Schlatow
3b0995cb49 platform_drv: fix uncaught exception
Calling alloc_dma_buffer() with size=0 will cause an exception in the
ram allocator.

genodelabs/genode#4518
2022-05-25 12:23:04 +02:00
Josef Söntgen
df5cadc8ad pc_wifi_drv: only disable failed access-point
The driver wrongfully disabled all APs if it was configured with an
auto-connect list containing multiple APs when one of those was
disabled as a result of using wrong credentials.

This commit changes the way network enable- and disablement are
handled by only operating on the given access-point in question.
It also removes unused code touched by these changes.

Thanks to Peter for bringing this problem to our attention.

Fixes #4517.
2022-05-25 12:23:04 +02:00
Josef Söntgen
03b2e3bda1 libports: rename jitterentropy's memcpy
To prevent symbol aliasing when using the static jitterentropy library
rename it to 'jent_memcpy'.

Fixes #4516.
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
Norman Feske
f87209f822 Mention supplemental repos in top-level README 2022-05-25 12:23:04 +02:00
Norman Feske
e2267d2737 doc: update repos/README 2022-05-25 12:23:04 +02:00
Norman Feske
31fe7afbc4 doc: update components.txt 2022-05-25 12:23:04 +02:00
Norman Feske
8b4f12f2b0 menu_view: add new frame style 'full'
This style is useful as top-level frame whenever menu_view should cover
its entire geometry with no visible border around it.
2022-05-25 12:23:04 +02:00
Norman Feske
7adbb7c06e menu_view: menu_view_styles.tar is build artifact
By declaring the generated menu_view_styles.tar archive as build
artifact, it is automatically picked up whenever menu_view appears as
build ingredient of sculpt.

  build: app/menu_view
2022-05-25 12:23:03 +02:00
Norman Feske
a8631aeae9 sculpt: let touch input drive the input seq number
This change allows the use of the sculpt manager with touch-only input.

Issue #4514
2022-05-25 12:23:03 +02:00
Stefan Kalkowski
115ac58fd0 lx_emul: increase usb driver dynamic robustness
* Prevent page-faults when the active interface of a device got unset
  during elimination of the device
* Resets devices, where a corresponding session got closed to
  be re-useable when a new session gets opened

Ref #4512
2022-05-25 12:23:03 +02:00
Stefan Kalkowski
ba6a3526a9 libusb: when USB device vanishs throw exception
* Instead of repeatedly spam the log with errors and
  bring heavy load to the USB host controller driver
  abort yourself when the device vanishs

Fix genodelabs/genode#4515
2022-05-25 12:23:03 +02:00
Martin Stein
03349f9fff lx_emul/random: re-seed the local PRNG regularly
With this commit, the Xoroshiro128+ PRNG in lx_emul/random.cc gets wrapped
by a new class that automatically re-seeds the PRNG with jitterentropy every
1024 * 1024 + random(0..4095) bytes of generated output.

Ref #4397
2022-05-25 12:23:03 +02:00
Martin Stein
ab0bce77ec lx_emul & wireguard & wifi: centralized random.cc
Both the Wifi driver and the WireGuard port used local implementations for
their source of randomness. Wifi used a Xoroshiro128+ PRNG for rapid generation
of random values but initialized this PRNG always with the same static seed
value. WireGuard, in contrast, requested each random byte directly from the
jitterentropy lib, which is considered to be very time intensive.

This commit removes the local variants of random.cc and introduces a new
centralized lx_emul/random.cc . The new variant combines the former approaches,
so, that jitterentropy is accessed only in order to generate a random seed for
a Xoroshiro128+ PRNG. Front-end requests for random values are then fulfilled
efficiently via the PRNG.

:Warning:

The output of the Xoroshiro128+ PRNG that is used in the new implementation of
the lx_emul randomness functions has known statistical problems (see
https://en.wikipedia.org/wiki/Xoroshiro128%2B#Statistical_Quality).
Furthermore, the integration of Xoroshir128+ with the lx_emul code was not
reviewed/audited for its security-related properties, so far, and has the
known deficiency of seeding the PRNG only once during initialization. Thus,
we strongly advise against the use of the lx_emul randomness functions for
security-critical purposes.

Ref #4397
2022-05-25 12:23:03 +02:00
Norman Feske
63b0f1a2f7 wm: transpose touch events to window positions
This patch enhances the window manager with the ability to transform
touch events analogously to absolute motion events.

Issue #4514
2022-05-25 12:23:03 +02:00
Norman Feske
e3f00ce5fc menu_view: update hover in primary touch events
This patch simplifies the use of the menu_view in scenarios where no
absolute motion events but only touch events occur. Previously, such
scenarios required the creation of artificial absolute motion events
via the event filter.

Issue #4514
2022-05-25 12:23:03 +02:00
Norman Feske
1f3b6490f2 nitpicker: update hover state on touch events
The hover state is evaluated for the routing of input events. When
routing a touch event, the decision should be based on the most recently
observed touch position. Without this patch, however, the hover state kept
referring to the initial pointer position (screen center) in the absence
of any other motion events.

Issue #4514
2022-05-25 12:23:03 +02:00
Norman Feske
c4f2ceb1ca sculpt: add missing include 2022-05-25 12:23:03 +02:00
Stefan Kalkowski
f652657d9d Consolidate USB test run-scripts
Ref genodelabs/genode#4511
2022-05-25 12:23:03 +02:00
Martin Stein
4869349d57 lx_emul & x86: no unnecessary memset of zero page
Ref #4397
2022-05-25 12:23:03 +02:00
Martin Stein
a845dffa63 dde_linux: port of WireGuard kernel module
A userland component that ports the Linux WireGuard kernel module (originally
from kernel version 5.14.21) and integrates it via a NIC session (public
network side) and an Uplink session (private network side). The
WireGuard-specific device configuration is done through the component
configuration. The port is done using lx_emul, lx_kit and the virt_linux
targets. The commit adds also 4 corresponding run scripts of which 3 are fully
automated of which 1 is added to the autopilot.

:Warning:

Although in principal functioning, the WireGuard port has not been exposed to a
sufficient amount of real-world testing, so far. Therefore, we strongly
recommend not to use it in any security-critical scenarios! There is no
guarantee that the port meets any of the security goals pursued by the
WireGuard protocol or other WireGuard implementations!

Ref #4397
2022-05-25 12:23:03 +02:00
Martin Stein
f84e512ded virt_linux: support arm_64
This feature was motivated and used only by the WireGuard port, so far.

Ref #4397
2022-05-25 12:23:02 +02:00
Martin Stein
cded594346 lx_emul & arm: define ZERO_PAGE
The implementation was copied from the already existing LX-emul implementation
for x86 but the commit additionally page-aligns the array that serves as
backing store for the zero page as we assume this to be expected by the contrib
code. However, this commit doesn't apply the alignment also to the x86
implementation as we agreed, that this should be done in a separate commit.

Ref #4397
2022-05-25 12:23:02 +02:00
Martin Stein
bd501404db net: add methods required for WireGuard port
* Adds methods for copying raw data to the data field of Ethernet frames and
  UDP packets. This is used in the port to wrap the higher-layer packet data
  prepared by the contrib code with the additionally required headers before
  sending it at a network session.
* Adds a method to cast raw data to an IPv4 packet. This is required in the
  port in order to check values in stand-alone IP packets produced by the
  contrib code before sending them at a network session.
* Adds methods for setting UDP ports given big endian port values without
  having to convert to little endian in the app and then back to big endian in
  the net lib.

Ref #4397
2022-05-25 12:23:02 +02:00
Martin Stein
679be47def net: fix conversion compiler errors
Ref #4397
2022-05-25 12:23:02 +02:00
Martin Stein
99eca9fa7e nic_router: fix bad gateway values in README
Gateway configuration values contained a subnet prefix-length which is
not required nor accepted by the router.

Ref #4397
2022-05-25 12:23:02 +02:00
Stefan Kalkowski
c049aed44f lx_emul: eliminate wrong include pathes
Fix genodelabs/genode#4510
2022-05-25 12:23:02 +02:00
Stefan Kalkowski
081b878bbd lx_emul: align zero page to page size
Fix genodelabs/genode#4509
2022-05-25 12:23:02 +02:00
Alexander Boettcher
38e5972e45 Remove legacy intel display driver
The driver is superseded by the new driver located in the 'pc'
repository.

Issue #4508
2022-05-25 12:23:02 +02:00
Josef Söntgen
f146f9acb6 Move wpa_supplicant to own port
Issue #4508.
2022-05-25 12:22:10 +02:00
Josef Söntgen
fd14cf9f1e Move libnl to own port
Issue #4508.
2022-05-25 12:22:10 +02:00
Josef Söntgen
573cabaf24 Remove legacy wifi driver
The driver is superseded by the new driver located in the 'pc'
repository.

Fixes #4508.
2022-05-25 12:22:10 +02:00
Norman Feske
14bc7b9c6a tool/parse_cxx: handle 'alignas' specifier 2022-05-25 12:22:10 +02:00
Josef Söntgen
868447126f pc_wifi_drv: use arch hweight implementation
Using the generic version leads to stack corruption on x86_32.

Fixes #4507.
2022-05-25 12:22:10 +02:00
Josef Söntgen
69b5048728 pc_wifi_drv: remove inactive disable 11n option
The driver did not allow for setting module parameters and so far
no one complained. Remove the option to prevent the misleading of
users.

Issue #4506.
2022-05-25 12:22:10 +02:00
Josef Söntgen
d92b84fbc3 pc_wifi_drv: add RFKILL support
This commits hooks up a RFKILL management to the driver. The
'README' contains instructions on how to use it.

Fixes #4506.
2022-05-25 12:22:10 +02:00
Josef Söntgen
913aec1667 pc_wifi_drv: dissolve user tasks interdependence
The 'uplink' task was created by the 'socketcall' task although both
may operate independently.

Issue #4506.
2022-05-25 12:22:10 +02:00
Norman Feske
0cffda3cfe tool/depot: pass make flags to dependencies cmd
This patch harmonizes the tool/depot/download with the version of the
Goa tool.
2022-05-25 12:22:10 +02:00
Norman Feske
2691f2073a tool/depot: minor documentation fixes 2022-05-25 12:22:10 +02:00
Norman Feske
1b96d01690 tool/depot: allow versioned entries in used_apis
Normally, the APIs listed in 'used_apis' files do not carry a version
but implictly refer to the current version. This patch allows for
specifiying an concrete version. This is a useful feature in the context
of the Goa tool.
2022-05-25 12:22:10 +02:00
Norman Feske
b081988e66 tool/depot: make DEPOT_TOOL_DIR customizable
By replacing the formerly hard-coded $(GENODE_DIR)/tool/depot/ by the
variable DEPOT_TOOL_DIR, the depot tools can be hosted outside the
Genode source tree, i.e., as part of the Goa tool.
2022-05-25 12:22:10 +02:00
Norman Feske
19b6f88c33 tool/ports: customization hooks
The hooks added by this patch allow for the reuse of the hash.inc and
install.mk by Goa as is.
2022-05-25 12:22:10 +02:00
Stefan Kalkowski
f9a29f291e pci: extend Pci utilities for bridge drivers 2022-05-25 12:22:10 +02:00
Johannes Schlatow
55795127a3 lx_emul(arm): add Cortex-A9 irqchip
genodelabs/genode#4499
2022-05-25 12:22:09 +02:00
Johannes Schlatow
547db8531b lx_emul: use generic preempt_count accessor
genodelabs/genode#4499
2022-05-25 12:22:09 +02:00
Johannes Schlatow
4cdba04c88 lx_emul: fix spinlock implementation for ARM
Since Linux does not use the arch-independent spinlock structs for ARM,
we must use different members when accessing the lock value.

genodelabs/genode#4499
2022-05-25 12:22:09 +02:00
Johannes Schlatow
ba04aab75f lx_emul: initialise preempt_count for ARM 32bit
genodelabs/genode#4499
2022-05-25 12:22:09 +02:00
Stefan Kalkowski
6731067116 lx_emul: add basic ARM 32-bit support
genodelabs/genode#4499
2022-05-25 12:22:09 +02:00
Norman Feske
19574f7897 Fix spelling of PinePhone 2022-05-25 12:19:33 +02:00
Norman Feske
97b5e96e0e sculpt: mention all needed repos in documentation
The documentation missed to mention the need for the 'pc' and 'dde_rump'
repositories for building the boot image from source.
2022-05-25 12:19:33 +02:00
Stefan Kalkowski
19f50a9a45 platform_drv: enhance coding practice
* more constness where possible
* hide device reporter functionality in Device_reporter interface
2022-05-25 12:19:33 +02:00
Alexander Boettcher
91a569ac7f virtualbox6: adjust developer run script
to work again. The drivers interactive package does not provide a Platform
service anymore, so remove the audio driver. A lot more mesa related libraries
are required now.
2022-05-25 12:19:33 +02:00
Christian Helmuth
2a76ae002e vbox6: enable VM reset 2022-05-25 12:19:33 +02:00
Josef Söntgen
6954547b4c pc: consoldiate LX emul of current drivers
This commit de-duplicates the redundant dummy implementations and
to some degree also the 'lx_emul.c' implementations while also
decluttering the various 'dep.list' files.

The code is moved into 'src/lib/pc/lx_emul' where it becomes part
of the 'pc_lx_emul' library.

Fixes #4500.
2022-05-25 12:19:33 +02:00
Josef Söntgen
e313059dd5 lx_emul_common: prevent override of CC_OPT_$(1)
This allows for extending such compilation unit specific options
for down by users of the library.

Issue #4500.
2022-05-25 12:19:33 +02:00
Josef Söntgen
d324331325 pc: centralize initcall header
Instead of each driver providing its own header file use a central
header as the initcall order header should cover _all_ provided
initcalls resulting from the used 'pc_linux' kernel config.

Note that the 'pc_linux' configuration was extended with the
'USB_USBNET' option because the module's initcall is needed for the
Genode C API for USB glue-code and the 'PACKET' option needed by
the wireless lan driver.

The lack of theses options was not noticed as each driver used its
own initcall header so far that stemmed from the initial porting
effort.

Issue #4500.
2022-05-25 12:19:33 +02:00
Josef Söntgen
3fdf4c56ba pc: sort source.list files
Those are purely cosmetic changes.

Issue #4500.
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
e9b666d1a8 platform_drv: some small and cosmetic fixups
* Some fixups for the README
* Make config ROM const when used for the session policies
* Turn Reporter into Expanding_reporter
* Always first register ROM signal handler before parsing it the first time
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
14f192fb00 platform_drv: make devices ROM name configureable
Fix genodelabs/genode#4504
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
438870e223 platform_drv: outsource common parts for derivate
Outsource parts of the Main object into a common compound object,
common parts of the Makefile description and depot source package.

Fix genodelabs/genode#4503
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
9370e5e4d0 platform_drv: add PCI device support
* Parse PCI specific information from devices ROM
* Enable DMA, I/O memory and I/O port access dependent on BARs in config space
* Introduce device PD for Nova + IOMMU support
* Enable MSIs if available
* Add PCI specific policy rules

Fixes genodelabs/genode#4502
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
6b92006565 platform_drv: consider IRQ type, mode, polarity
Parse the devices ROM for additional interrupt information, and
pass them to the IRQ connection when needed.

Fix genodelabs/genode#4497
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
de7fdd3e1a platform_drv: wait for device's availability
Instead of returning an invalid device capability when a device
is (not yet) available, e.g. a PCI device is requested before the
PCI bus got parsed accordingly, we check the device capability
within the Platform::Connection utilities, and register temporarily
an Io_signal_handler to wait for changes of the devices ROM, and
try the device aquisition again. Thereby, simple drivers so not have
to take the burden to do so.

To enable this feature for all drivers, we always have to export a
devices ROM, but limit the information about physical resources
(I/O memory addresses, IRQ numbers, I/O port ranges) to clients with
'info=yes' in their policy description.

Fix genodelabs/genode#4496
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
a1564d1826 platform_drv: add report facility
By adding a 'report' node to the platform driver's configuration
one can enable either devices or config reports. The devices
report contains all devices and their detailed state, as well as
whether it is already in use or not. The config report contains
one by one the current configuration of the platform driver.
Moreover, this commit adds a README file describing the facilities
of the platform driver.

Fix genodelabs/genode#4386
2022-05-25 12:19:32 +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
f032bdf81c legacy_platform_drv: configurable PCI BAR remapping
If PCI devices happen to miss complete configuration after boot, the
platform driver supports <pci-fixup> nodes for concrete devices
(specified by bus-device-functions tuples). The
<bar> node instructs the platform driver to remap BAR id 0 to address
0x4017002000, which amends the BIOS configuration and is stringently
required for BARs with address 0.

! <pci-fixup bus="0" device="0x15" function="3">
!   <bar id="0" address="0x4017002000"/>
! </pci-fixup>

The issue was discovered with Intel LPSS devices in Fujitsu notebooks.

Fixes #4501
2022-05-25 12:19:32 +02:00
Norman Feske
16cf1f48d3 libc: make app stack size configurable
This patch changes the libc to query the stack size from the
config attribute <libc> <stack size=""/> </libc> for regular
components, not only cloned processes.
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
cacb6136fa app/pci_decode: prepare pci device information
To discharge the generic platform driver from certain PCI bus scanning,
and ACPI + kernel specifics, this commit introduces a new component,
which consumes the acpi drivers report and the platform_info from core
to prepare a devices ROM for the platform driver that contains all
PCI devices and its resources.

Fix genodelabs/genode#4495
2022-05-25 12:19:32 +02:00
Josef Söntgen
87021d9fb1 usb_block_drv: allow for using UAS devices via BOT
USB Attached SCSI devices might expose a bulk-only interface
as fall-back at interface 0 and alternate setting 0. This commit
allows for probing all alternate settings of the active interface
to be able to use such devices.

The configuration was extended so that in case the device interface
is known beforehand the driver can be configured accordingly.

Fixes #4494.
2022-05-25 12:19:32 +02:00
Josef Söntgen
27444617e1 ports: use expanding reporter in verify app
Deploying an overly large meta-pkg in Sculpt leads to an
'Xml_generator::Buffer_exceeded' exception. Using the expanding
reporter solves this problem.

Fixes #4493.
2022-05-25 12:19:32 +02:00
Josef Söntgen
74b5a4ae7a pc_wifi_drv: handle reauth silently
In case we are instructed to reauthenticate and were already
authenticated we ignore the request in the management layer
and let 'wpa_supplicant' deal with that.

Fixes #4488.
2022-05-25 12:19:32 +02:00
Alexander Boettcher
a8402ae782 qemu-usb: solely support labels in policy
Remove vendor/product/bus/dev from policy parsing and as criteria to decide
whether to keep USB devices.

Issue #4492
2022-05-25 12:19:32 +02:00
Alexander Boettcher
dada0dff78 qemu-usb: support policy labels w/o vendor/product
Fixes #4492
2022-05-25 12:19:32 +02:00
Alexander Boettcher
858505918a nova: support EC time in trace subject info
The vanilla NOVA kernel solely supports tracking and exporting of execution
times per SC kernel object, but not per thread (EC object). The commit extends
to track execution times per EC in the NOVA kernel, exporting it to Genode's
'core' roottask and populating Genode's Trace::Subject_info structure.

Fixes #4481
2022-05-25 12:19:32 +02:00
Alexander Boettcher
f6fedd5348 x86: remove special GPE handling nova <-> acpica
Remove handling of ACPI (SCI) interrupt from kernel and thereby let the
handling of the ACPI irq exclusively to an Genode driver. On Genode the ACPICA
library+app handles the ACPI irq, where we can now remove the contrib patches
related to the synchronization between NOVA kernel and ACPICA library.

Fixes #4479
2022-05-25 12:19:31 +02:00
Christian Helmuth
65d7b3e652 Remove unused Nic::Root implementation (nic/root.h)
Issue #3961
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
6eac4276d5 filesystem tests: remove block devices/drivers
Fix genodelabs/genode#4490
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
18dcf8af68 Remove NIC server role from drivers
* Remove "mode" attribute utility and XML description
* Remove unused nic/stat.h header

Fix genodelabs/genode#3961
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
e3d08893b7 lan9118_nic_drv: remove deprecated server mode
Ref genodelabs/genode#3961
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
56831a247f usb_net_drv: remove deprecated server mode
Ref genodelabs/genode#3961
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
0ba911bf12 virtio_nic_drv: remove deprecated server mode
Ref genodelabs/genode#3961
2022-05-25 12:19:31 +02:00
Christian Helmuth
766ac5ea27 Update download URL of e2fsprogs to https
This prevents

  warning: redirecting to https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/
2022-05-25 12:17:37 +02:00
Norman Feske
7cf1a39b99 News item for Sculpt 22.04 2022-05-25 12:17:37 +02:00
Christian Helmuth
0768185fea depot: update recipe hashes 2022-04-28 11:52:06 +02:00
Josef Söntgen
3e45b8aace pc_wifi_drv: implement kmem_cache_free_bulk
So far this dummy was only triggered on AX devices after the driver
has been used for a few hours.

Issue #4488.
2022-04-28 08:02:33 +02:00
Josef Söntgen
481b4fde25 pc_intel_fb_drv: fix Shuttle DS57U
When using the framebuffer driver on this machine the
'cpu_latency_qos_request_active' dummy is triggered. Removing the
trace-and-stop call makes the driver usable.

In addition, 'cpu_latency_qos_remove_request' is changed as well
although it is guarded by 'cpu_latency_qos_request_active'.

Fixes #4489.
2022-04-28 08:02:33 +02:00
Norman Feske
6cab572b8f sculpt: increase lowest-possible font size
This patch fixes rare freezes of menu view instances, which could happen boot
time whenever the leitzentale GUI happens to get initialized before the display
driver finished setting up a reasonable mode. In this case, the resolution-
dependent font size can temporarily get almost zero, tripping up the glyph
renderer.
2022-04-28 08:02:33 +02:00
Norman Feske
df789b943c Update Sculpt documentation to version 22.04 2022-04-28 08:02:33 +02:00
Josef Söntgen
952c2f2f8b gpt_write: alloc packet with proper alignment
The component wrongly ignored the advertised requst aligment of the
block provider.

Fixes #4486.
2022-04-28 08:02:33 +02:00
Josef Söntgen
b8e2b780e3 nvme_drv: reject requests with unaligned offset
Since the driver relies on all requests being Nvme::MPS_LOG2 aligned
as advertised in its Block::Info the added check will reject any
misaligned requests (using 'gpt_write' led to an IOMMU write fault).

Issue #4486.
2022-04-28 08:02:33 +02:00
Sebastian Sumpf
8d00af1d7b gems/decorators: adjust resources for WQHD displays
2560x1440 resolutions require more RAM resources. Additionally, make
sure that the decorator 'init' receives enough CAPs to service the
decorator configuration.

fixes #4485
2022-04-28 08:02:33 +02:00
Josef Söntgen
754d35244f pc_wifi_drv: do not reset call result
Issue #4983
Issue #4455
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
2df0bbf387 pc_usb_host_drv: implement sysfs dummy function
Due to changes in the lx_emul USB driver, a further function
sysfs_delete_link gets called.

Ref genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
af0531398a lx_emul: cleanup URBs in USB driver in release
* Claim and release USB interfaces
* Collect URBs in flight in anchor list
* When releasing interfaces, wait until all
  anchored URBs finally got killed successfully

Fix genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
4b983f92c5 lx_emul: support execution till condition applies
In rare cases it is necessary to execute Linux contributed code
until certain work is finished, e.g. when in a synchronous RPC call,
a session construction or destruction a result is needed. Therefore,
we introduce a new lx_emul function called lx_emul_execute_kernel_until.

Ref genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Stefan Kalkowski
8ca2c597e0 os: extend USB C-API with claim/release
To signal that a device gets used and released by a session
introduce claim, release, and release all callbacks in the
USB interface of the C-API.

Ref genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Josef Söntgen
2e9e5c37b5 pc_usb_host_drv: supress '__printk_ratelimit' 2022-04-28 08:02:33 +02:00
Josef Söntgen
2fd2b7d628 lx_kit: map I/O mem with proper offset
In case multiple devices shared the same memory-mapped I/O page
we have to take the offset into account. This commit fixes the
'pc_usb_host_drv' on the Thinkpad X201 where the two EHCI host
controller share the some I/O memory page.

Fixes #4477.
2022-04-28 08:02:33 +02:00
Sebastian Sumpf
396cc53020 libc: update download url to archive repo
FreeBSD 12.0 was moved to archive url:
http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/12.0-RELEASE/

fixes #4478
2022-04-25 14:42:43 +02:00
Alexander Boettcher
240ec72086 nova: handle invalid SVM exit correctly
With issue #4391 a regression was introduced, which makes VMs on AMD SVM non
working.
2022-04-25 14:40:04 +02:00
Alexander Boettcher
0d163915d0 nova: avoid hangs on AMD with IOMMUs
With the new usb driver #4399 and usage of the updated dde_linux lx_eml/lx_kit
approach a much higher rate of IRQ session construction/destruction and signal
handler assignment (irq->sigh) are caused. This trickles down to the kernel,
which causes an hang of the AMD IOMMUs due to not setting reserved bits
adequately. The commit fixes the root cause in the kernel and add a guard
into core's to limit such driver behaviour.

Fixes #4482
2022-04-23 22:53:03 +02:00
Johannes Schlatow
260d7aa701 sculpt: fix clipboard routing in deploy/example
Fixes genodelabs/genode#4475
2022-04-13 16:29:19 +02:00
Christian Helmuth
b66650c2e8 lx_emul: remove forward declaration in clocksource 2022-04-13 15:17:49 +02:00
Martin Stein
25eb24299c machine.vbox6: add audio enabledIn/Out options
The file listed only enabled="false" in the audio adapter tag. However,
setting only this option to true isn't sufficient for guest audio to work.
One has to set also enabledIn respectively enabledOut in the same tag. The
new default vbox6 file reflects this.

Fixes #4476
2022-04-13 15:01:46 +02:00
Norman Feske
25ae54223a os/part_block: simplify split block-I/O handling
Issue #4474
2022-04-13 14:08:46 +02:00
Norman Feske
b3678f44b7 libports/fatfs: handle split block I/O jobs
Issue #4474
2022-04-13 14:08:40 +02:00
Norman Feske
68af13bb34 os/vmm: handle split block I/O jobs
Issue #4474
2022-04-13 14:08:34 +02:00
Norman Feske
7d6c592417 vfs/rump: handle split block I/O jobs
This patch fixes a potential data corruption issue that could occur when
issuing large I/O requests to vfs/rump, which don't fit into the default
block I/O buffer of 128 KiB. Note that we haven't observed the problem
in practice (Sculpt hosts vfs/rump in a dedicated vfs server, which
fragments requests) but spotted the issue while reviewing the code. We
could trigger problem by explicitly changing the I/O buffer size to 32
KiB.

Issue #4474
2022-04-13 14:08:25 +02:00
Norman Feske
d815322efe os: simplify split block operations
This patch changes the meaning of the 'offset' parameter of the
'produce_write_content' and 'consume_read_result' hook functions.
The value used to reflect the absolute byte position but in practice,
a job-relative byte offset is desired.

Issue #4474
2022-04-13 14:08:15 +02:00
Christian Helmuth
8ece236635 depot: update recipe hashes 2022-04-13 11:54:46 +02:00
Christian Helmuth
a45aabe68c usb_block: handle block requests in Signal_handler only
Before this commit, the block-request handler was implemented as
Io_signal_handler and, additionally, the USB driver called the
block-request handler on request completion directly on I/O level. This
is generally a bad idea because I/O handlers should avoid to have direct
global side effects. In contrast, application logic should be
implemented in way that it consumes atomic state changes after I/O
completed. Now USB I/O completion locally submits a signal to the
block-request Signal_handler.
2022-04-13 09:29:06 +02:00
Alexander Boettcher
2ec6a8249a pc: intel display driver: avoid sysfs related hang
Issue #4450
2022-04-13 09:29:06 +02:00
Sebastian Sumpf
2a47379ab5 vbox6: display cause of error on failed 'initFromSettings'
Use 'ErrorInfoKeeper' to retrieve current error from XPCOM service and
log message.

fixes #4473
2022-04-13 09:29:06 +02:00
Christian Prochaska
f91ece78e0 dde_rump: move periodic sync into rump kernel thread
Issue #4459
2022-04-13 09:29:06 +02:00
Christian Prochaska
d8211b65a5 dde_rump: fix clock functions
Issue #4459
2022-04-13 09:29:06 +02:00
Christian Prochaska
95aba3feef dde_rump: dispatch I/O signals in Timed_semaphore
Issue #4459
2022-04-13 09:29:05 +02:00
Christian Prochaska
af80ecb651 dde_rump: check blocking condition right before blocking
Issue #4459
2022-04-13 09:29:05 +02:00
Christian Helmuth
2da57613bf depot_deploy: support usb service provider
Now, Usb sessions can be effectively routed to the black-hole component
in Sculpt.

Issue #4419
2022-04-13 09:29:05 +02:00
Norman Feske
4dbe1588a6 sculpt: relax heartbeat rate
This patch reduces the response time of supposedly stuck situations like
an unresponsive part_block component. First, it reduces the heartbeat
rate from 1 to 2 seconds to make it consistent with the frequency of
state reports. Second, it allows up to four skipped heartbeats until
regarding the situation as stuck. With those changes, the prolonged
initialization sequence of a USB ZIP drive succeeds with Sculpt.
2022-04-13 09:29:05 +02:00
Christian Helmuth
02693734d3 black_hole: increase RAM quota in test-black_hole
Issue #4419
2022-04-13 09:29:05 +02:00
Martin Stein
b9141f98af test/black_hole: fix "packet alloc failed"
The Uplink_test used to end in an uncaucht exception about a failed packet
allocation on several x86_32 platforms.

* Destruct and re-construct the corresponding TX packet allocator during a
  link-down-up step in the Uplink test. Fixes the exceptions but results in a
  never ending test.
* Decouple the link-down-up steps from the handling of packet stream signals
  by simply triggering it with a local periodic timeout of 1 sec period.
  This prevents that the Uplink_test never finishes because it destructs the
  Uplink connection too often.
* The test finishes not before at least 3 link-down-up steps were executed.
* Replace the Allocator_avl's used for the TX packet allocators of the Nic
  and Uplink Connection with the better suited Nic::Packet_allocator.

Ref #4419
2022-04-13 09:29:05 +02:00
Martin Stein
6a61b60a5d black_hole: serve real USB sessions
* The server now answers session requests with a session instead of an
  exception#
* The test expects a session but doesn't access it so far

Ref #4419
2022-04-13 09:29:05 +02:00
Alexander Boettcher
40a5eabf88 pc: shadow schedule_timeout in intel_fb_drv
Issue #4450
2022-04-13 09:29:05 +02:00
Christian Helmuth
db90656483 vbox6: sync capslock state on boot / LED change
Thanks to Peter for the initial patch.
2022-04-13 09:29:05 +02:00
Alexander Boettcher
9965b2b72a pc: disable dsb unit in intel_fb_drv (gen12)
The error message
"Command buffer creation failed" in intel_dsb.c repeatedly appears
during connector hotplug. Since the driver works also without this DMA offload
optimization, disable the functionality.

Issue #4450
2022-04-13 09:29:05 +02:00
Martin Stein
ecd4006514 black_hole: initial support for Usb service
The service is merely announced but trying to request a session always causes a
Service_denied exception. This helps in scenarios where the client is
won't open a session anyway but expects the service to be available. This is
considered a temporary solution.

Ref #4419
2022-04-13 09:29:05 +02:00
Norman Feske
78d7a08618 wm: hide child views if top-level view vanishes
This patch handles the corner case of switching virtual desktops while
child views are visible. Examples of such child views are tool tips,
pull-down menus, or the graph of the top-view utility. The switch to
another virtual desktop would implicitely turn the child views into
top-level views of the root nitpicker GUI server until switching back
to the original virtual desktop.

The patch implements the expected behavior of hiding all child views
that belong to a disappearing top-level view.
2022-04-13 09:29:05 +02:00
Christian Helmuth
d21464399f vfs_rump: use dynamic_cast for safe downcasts
As it stands, the implementation requires minimal reflection measures to
implement correct cleanup procedure. static_cast<> cannot be used as it
does not implement runtime type casting as dynamic_cast<> does.
2022-04-13 09:29:05 +02:00
Christian Helmuth
8a4f4fcea9 vfs_rump: reflect resource shortage as return values
The function Vfs::Directory_service::watch() is not expected to throw
Out_of_ram/Out_of_caps but use dedicated Watch_result errors.
2022-04-13 09:29:05 +02:00
Christian Helmuth
eb895975e2 lib/vfs: clear BUILD_ARTIFACTS in dummy targets 2022-04-13 09:29:05 +02:00
Norman Feske
79279b93fb vfs server: fix dangling alloc on watch failure
This patch reverts the vfs-watch-handle creation whenever the subsequent
allocation of the VFS server's 'Watch' object fails. This can happen
when the session RAM or cap quota is depleted.

Fixes #4472
2022-04-13 09:29:05 +02:00
Christian Helmuth
df1767b784 vbox6: tidy up devxhci poweroff
The issue came apparent with Windows Guests and USB passthrough of
smart-card readers. If the VM is powered off, PDMR3Term cleans up all
devices incl. (first) acpi and (later) devxhci. The latter used a
dangling reference to ACPI structs in a indirect call to
apicIsLogicalDest() from xhciR3Destruct().

  VMMR3_INT_DECL(int) PDMR3Term(PVM pVM)
      virtualbox6/src/VBox/VMM/VMMR3/PDM.cpp:817

      "apic" (pDevIns->pReg->szName)

          static void apicR3TermState(PVM pVM)
              virtualbox6/src/VBox/VMM/VMMR3/APIC.cpp:1235

      "qemu-xhci" (pDevIns->pReg->szName)

          static DECLCALLBACK(int) xhciR3Destruct(PPDMDEVINS pDevIns)
              repos/ports/src/virtualbox6/devxhci.cc:431

          void usb_detach(USBPort *port)
              <qemu-usb>/src/lib/qemu/hw/usb/core.c:70

          static void xhci_port_notify(XHCIPort *port, uint32_t bits)
              <qemu-usb>/src/lib/qemu/hw/usb/hcd-xhci.c:2592

          static DECLCALLBACK(void) pciSetIrq(PPDMDEVINS pDevIns, PPDMPCIDEV pPciDev, int iIrq, int iLevel, uint32_t uTagSrc)
              virtualbox6/src/VBox/Devices/Bus/DevPCI.cpp:398

          static bool apicIsLogicalDest(PVMCPUCC pVCpu, uint32_t fDest)
              virtualbox6/src/VBox/VMM/VMMAll/APICAll.cpp:797

The fix removes our Qemu library reset from xhciR3Destruct() and
registers xhciR3Reset() as PowerOff hook.

Thanks to Raphael for the thorough investigation.
2022-04-13 09:29:05 +02:00
Christian Helmuth
e345b56719 vbox6: remove redundant ahci/serial patches
The issue alleviated by the patches was fixed by

  5fed1641a4 virtualbox6: reduce 'Vm_connection' priority

Issue #4361
2022-04-13 09:29:05 +02:00
Norman Feske
ddc83df4b6 sculpt: support leitzentale GUI on 2560x1440
The quota adjustments prevent the leitzentrale's decorator from running
out of RAM, and allow the nitpicker GUI server to preserve buffer
content during resize (reducing flickering artifacts) when using a
screen resolution up to 2560x1440.
2022-04-13 09:29:04 +02:00
Alexander Boettcher
daa6195732 pc: report all modes by intel display driver
Issue #4450
2022-04-13 09:29:04 +02:00
Norman Feske
0c5d8f1156 depot: exclude plugins from vfs src archive
This fixes the following warning when building the binary archive:

  Library-description file vfs_capture.mk is missing
  Library-description file vfs_tap.mk is missing
2022-04-13 09:29:04 +02:00
Sebastian Sumpf
7a06a6ac59 legacy_platform_drv: update quotas on 'attach_dma_mem'
'Platform::Device_pd::attach_dma_mem' may lead to insufficient resources
for meta data, which is reflected to the client via 'Out_of_caps' or
'Out_of_ram'. In case the client upgrades its session the quotas need to
be passed to core as done by
'Platform::Device_pd::Expanding_region_map_client::attach'.

issue #4451
2022-04-13 09:29:04 +02:00
Sebastian Sumpf
abc0bf3220 gpu/intel: account resources using 'avail_' not'used_'
Use 'avail_caps' and 'avail_ram' for resource guards because 'used_caps'
and 'used_ram' do not account for resources given to the platform
driver. This lead to incorrect resource accounting by the GPU
multiplexer.

issue #4451
2022-04-13 09:29:04 +02:00
Christian Helmuth
fd9648f919 vfs/block: correct transfer size allocation
The calculations of packet_size and packet_count in the block_io() did
not consider rounding errors. This resulted in diverging values over
several bisecting operations (/= 2) and wrongly-size packet allocations
as well as memcpy operations.

Related to #2263 (comments about partial block accesses and
_block_io()).

Fixes #4471
2022-04-13 09:29:04 +02:00
Christian Helmuth
dedcd0e294 vbox6: silence debug log in runtime 2022-04-13 09:29:04 +02:00
Josef Söntgen
2e47eb6fb9 dde_linux: use new wifi driver in uplinks test
Issue #4455.
2022-04-13 09:29:04 +02:00
Martin Stein
ef8c98cb71 nic_router: merge packet stream signal handlers
The NIC router used to handle each type of packet-stream signal with a distinct
method in the Interface class. However, merging those methods has advantages.

It ensures that sent packets that were already acknowledged by the counter side
are always released before handling received packets. This frees packet stream
memory which facilitates the potential allocation of response packets while
handling received packets. Furthermore, it simplifies the code and reduces the
number of entry points into the router.

This commit also removes the installation of signal handlers at packet streams
for events that are of no interest for the router (TX-ready-to-ack /
RX-ready-to-submit at NIC sessions and RX-ready-to-ack / TX-ready-to-submit at
Uplink sessions).

Fixes #4470
2022-04-13 09:29:04 +02:00
Christian Helmuth
7e2cfc30f0 sculpt: version 22.04 2022-04-13 09:29:04 +02:00
Christian Helmuth
520a08b205 Remove pkg runtime for pc_wifi_drv/legacy_pc_wifi_drv
Both runtimes were broken due to missing requirement for "Uplink"
service and thus unused.

Issue #4455
2022-04-13 09:29:04 +02:00
Josef Söntgen
b6471a83aa ports: use new wifi driver in netperf
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
dd09e900c0 sculpt: use pc_wifi_drv
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
e7e7893f22 pc: update wifi driver
The driver falls in line with the previous 'legacy_wifi_drv' component
where the ported wireless LAN stack and device driver is encapsulated
in a library. This library in return is used by the 'Libc::Component'
providing the necessary environment for the 'wpa_supplicant'.

In constrast to the old driver a 'wifi' VFS plugin is in charge of
initalizing the 'Lx_kit::Env' prior to executing any static
constructors.

Fixes #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
8056811b4f Rename wifi_drv to legacy_wifi_drv
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
0bd1a53326 dde_linux: add linux-firmware port
Move 'linux-firmware' portion from 'dde_linux' into its own port,
while it is used by the upcoming new WLAN driver keep it in place
for the legacy one.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
838bae964b pc: update framebuffer/intel for new Linux config
This is needed because now 'kobject_uevent.c' pulls netlink related
code in.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
c9d9ec0d63 pc_linux: add wlan stuff to config
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
0a6baff26d pc: extended pc_linux api archive for wifi driver
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
56427da393 wifi: add interface query functions
Various libraries, like libnl and wpa_driver_nl80211, used hardcoded
values for the interface index (ifindex) and name (ifname).
To accomdate the legacy as well as the upcoming new driver we add
functions to query these information where at least the index differs.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
c1fea8c002 wpa_supplicant: remove hard lx_printf dependency
Not needed and breaks 'pc_wlan_drv'.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
447f3fcb35 libnl: use MSG_DONTWAIT
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
f5eddce1d1 wifi/socket_call: add MSG_DONTWAIT
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
24c0bb95ef pc_lx_emul: allow for being used in a library
The location of the used 'source.list' file is hard-coded and will not
work when the ported driver is implemented as a shared library. For
this use-case provide means to set the location differently.

Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
7cd8285251 pc_lx_emul: use page alloc shadow implementation
Issue #4455.
2022-04-13 09:29:04 +02:00
Josef Söntgen
b2e11f1e9e pc_lx_emul: add __put_user
Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
edb08770dc lx_emul: initialize task members needed by network
Those members are access via static inline functions in the network
core code and from certain protocols, e.g. AF_NETLINK.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
77cdceabaa lx_emul: add additional atomic64 functions
Needed by the WLAN driver on x86_32.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
0c617366e5 lx_emul: get pid from task
Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
4b43b5c1c1 lx_kit: handle %hu specifier in console
Prevent '<warning unsupported format specifier>' when encountering
'%hu'.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
ffea0bf857 lx_kit: remove execution of static ctors
In case where the ported driver or protocol stack is executed from
an already managed environment, e.g. the libc, the execution
of the static constructors will be performed at the appropriate
time.

Issue #4455.
2022-04-13 09:29:03 +02:00
Josef Söntgen
aa7303f19f nic_router: drop ARP requests when unconfigured
Whenever the nic_router encounters ARP requests on an interface
that does not have a valid IP config it will ignore them. However,
When increasing the verbosity of the component for diagnostic
purposes the resulting 'Bad network protocol' message is misleading.

Issue #4455.
2022-04-13 09:29:03 +02:00
Christian Prochaska
80f85a854c qt5: fixes and improvements for WebRTC support
Fixes #4453
2022-04-13 09:29:03 +02:00
Christian Prochaska
6c2ac345fd Add 'webcam_vfs' run test
Issue #4458
2022-04-13 09:29:03 +02:00
Christian Prochaska
6a874498f7 vfs: implement plugin for 'Capture' session
Fixes #4458
2022-04-13 09:29:03 +02:00
Martin Stein
9de4ecf8b6 run/nic_router_dhcp: DHCP RENEW and some fixes
* Test DHCP RENEW by the test client in the unmanaged variant.
* Add event IDs to log output of test client in order to prevent false positive
  result in the managed variant.
* Let managed and unmanaged variant have separate string patterns for
  'run_genode_until' because they already had different output and it will
  differ even more as we don't want to test DHCP RENEW with the managed
  variant.
* Delay first test client DHCP in order to fix unexpected sporadic initial IP
  config.
* Remove some unnecessary code from the run script

Fixes #4460
2022-04-13 09:29:03 +02:00
Martin Stein
7fc20e9ae8 NIC router: update IP config on DHCP RENEW/REBIND
The NIC router did update the IP config of a domain on a completed DHCP
REQUEST but not on completed DHCP RENEW or DHCP REBIND. Thus, it didn't adapt
to "real" DHCP servers (not NIC router servers) that got restarted with a
changed configuration by the means of RENEW/REBIND. The commit fixes this.
Note, that testing this is complicated as we don't have the necessary
infrastructure (we cannot simply use the DHCP server of the NIC router as this
would apply a link down/up sequence in order to let the client restart DHCP)

Ref #4460
2022-04-13 09:29:03 +02:00
Sebastian Sumpf
f085fc9dd2 libdrm/iris: free objects in Drm_call destructor
Make sure to remove all buffers, sync objects, and contexts during
destruction.

Fixes #4466
2022-04-13 09:29:03 +02:00
Sebastian Sumpf
d4390adb68 mesa: use 'strdup' for driver names
The 'iris' and 'etnaviv' strings are freed using 'free' by mesa.

issue #4466
2022-04-13 09:29:03 +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
Christian Helmuth
f704a50e9f prepare_ports: prevent regeneration of aclocal.m4
Related to #4350
Fixes #4467
2022-04-13 09:29:03 +02:00
Christian Helmuth
904c8e3636 vbox6: disable asseertions in depot pkg
Issue #4464
2022-04-13 09:29:03 +02:00
Alexander Boettcher
6994354b8f platform(x86): avoid multiple assignment messages
The new ported linux drivers multiple times trigger this assignment,
whereby exactly one time is sufficient.

Issue #4416
Issue #4450
Issue #4455
2022-04-13 09:29:03 +02:00
Josef Söntgen
1dc92c49ed genode_c_api/usb: report iface class and protocol
Enrich the device report with interface class and protocol information
for the current active setting of the device.

Fixes #4463.
2022-04-13 09:29:03 +02:00
Alexander Boettcher
664676a2b4 intel/gpu: support 64bit pci bars
by using the io_mem RPC of the platform session instead of parsing the
bar resources manually. This commits avoids and breakage on systems where
the Intel graphic cards just uses 64bits with addresses above 4G.

Issue #4450
2022-04-13 09:29:03 +02:00
Johannes Schlatow
e955444302 ports/coreutils: ignore inodes when copying
genodelabs/genode#4461
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
Johannes Schlatow
052c33fc8c test/cache: refine test pattern
- run multiple access patterns (touch words, touch lines, memcpy)
- add make file for linux

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
5a0e22eb98 test/memcpy: tweak test timing
add some log calls to give run script a bit more time to catch the next
output

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
92bcc50c0a test/memcpy: test with a more consistent alignment
On some platforms, the page index affects the measurements.

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
07736d1689 test/memcpy: fix optimistic results on Linux
When executed on Linux, the test was impaired by the copy-on-write
optimisation since the source buffer was never initialised. By default,
Linux only maps a zeroed page until the first write access to the page
occurs. Since the source buffer was never written, the corresponding
page was always present in the physically-indexed data cache. In
consequence, the test merely measured write performance (similar to memset).

genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
62f37c5b1b test/memcpy: disable Thumb when compiled on linux
genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
85daf1b3b2 cpu_bench: disable Thumb when compiled on linux
genodelabs/genode#4454
2022-04-13 08:08:01 +02:00
Johannes Schlatow
d372afd81e base-hw: add bitfield to pl310
Enabling double linefills improves memcpy throughput.

genodelabs/genode#4456
2022-04-13 08:08:01 +02:00
Christian Helmuth
d1f9434fd5 qemu-usb: send usb ctrl transfers with timeout
Send usb ctrl transfers with one second timeout as some devices (e.g.,
smartcard readers) do not response to certain control transfers.

Thanks to Peter for the investigation.
2022-04-13 08:08:00 +02:00
Alexander Boettcher
00479aea29 lx_emul(x86): shadow cpu_relax to advance jiffies
The i2c code has a busy loop (see commit for the location), which expects that
the jiffies advances without a cooperative scheduling decision.

Issue #4450
2022-04-13 08:08:00 +02:00
Christian Helmuth
18c5f1e90d tool/run: improve disk image size automatic
Set disk size to 1.5 times the run folder size and shrinked later to
real content.

Thanks to Roland for the patch.
2022-04-13 08:08:00 +02:00
Christian Helmuth
108fe84f5a Remove SIGNAL/CAP/RAM services from run scripts
Related to #2407
2022-04-13 08:08:00 +02:00
Christian Helmuth
77b572f36a platform: distinct USB4 from other USB PCI devices
Our usb_host driver supports UHCI, OHCI, EHCI, and XHCI host
controllers. The USB4 host interface / Thunderbolt is currently not
supported and must therefore not be passed to the USB host driver.
2022-04-13 08:08:00 +02:00
Christian Helmuth
1b4cd93dc2 lx_kit/x86: clamp PCI interrupt PIN to 1
If any PCI device reports 0 as interrupt PIN, drivers may try to force
MSI setup (e.g., xhci). So, we clamp the interrupt PIN to 1 to let
drivers finish initialization and don't bother the platform driver.
2022-04-13 08:08:00 +02:00
Josef Söntgen
afe02efb8f pc_usb_host: implement 'dma_pool_destroy'
Encountered on the Fuji5 where for reasons currently unknown the
first xHCI HC (0:0d.0) could not be initialize due to incomplete
interupt informations. The other HCs appear to work fine (tested
with a USB low-speed mouse).
2022-04-13 08:08:00 +02:00
Josef Söntgen
c6cc43f0e4 lx_kit/x86: use virtual information for PCI
This commit removes all physical notions from the information given
to the Linux kernel regarding PCI BARs.

With the exception for the host bridge that needs to be located at
'0:00.0' as required by the Intel FB driver, all other devices are
announced at the PCI BUS in an ascending order.

Additionally the MMIO regions start at 1 GiB and are capped at 32 bit
to prevent unnecessary access to 64 bit addresses.
2022-04-13 08:08:00 +02:00
Christian Helmuth
1c79c95868 acpi_drv: skip tables outside predefined region
With this fix, the driver no longer aborts on the Tigerlake notebook and
just skips the out-of-region ACPI table. Issue #4452 is not fixed by
this commit, but in this specific case the table is not used anyway.
2022-04-13 08:08:00 +02:00
Sebastian Sumpf
49b8232ebd libdrm: simplify resource accounting
Upgrade to the well known worst cases by the GPU multiplexer. Do not
keep track of resources locally, in case resources are exceeded the
remain so anyway.

issue #4451
2022-04-13 08:08:00 +02:00
Sebastian Sumpf
105e82ad84 gpu/intel: check resources before any operation
Check if there are a least 4 caps + 2MB (heap) + possible buffer size
available before any resource allocation. Only account resources that are
actually used.

issue #4451
2022-04-13 08:08:00 +02:00
Christian Helmuth
7f0403c8c1 tool/run: multiple attempt for AMT SOL connection
Some devices do not answer connection attempts timely, which leads
amtterm to time out (after 60s). Using multiple attempts in 500 ms
intervals results in timely connection and complete boot logs.

Issue #4429
2022-04-13 08:08:00 +02:00
Christian Helmuth
c1c94d37d7 microcode_intel: update to version 20220207 2022-04-13 08:08:00 +02:00
Alexander Boettcher
c0560ab0cb pc: update intel display driver
Fixes #4450
2022-04-13 08:08:00 +02:00
Alexander Boettcher
7813fca946 gpu/intel: report all devices via next_device
The former implementation relied on the behaviour of how the old
intel fb driver requested the pci devices. The new lxkit however actually
really want to have all available pci devices.

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
2548830140 pc_linux: add ACPI config
required by the upcoming update of the intel display driver. Make this addition
explicit, because it triggers adjustment also on the new pc_usb_host_drv.

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
6d924d3285 lx_kit(x86): restrict usb heuristics to usb
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
cda0fafbd1 lx_emul: remove sw_width/height from common_dummies
required by the new upcoming intel display driver. Make the step explicit,
because it needs adjustment on the new usb driver as well.

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
b6c1b7806b lx_kit: io_mem_map with write combined support (x86)
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
6f64917e8f lx_emul: add ioremap_cache/_wc to shadow/asm/io.h
used by intel_fb for write combined allocation

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
8dbcda9943 lx_emul: x86_32 shadow header adaptations
required for upcoming intel display driver in 32bit

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
7c3f010cd6 lx_emul: shadow asm/uaccess_32/64.h
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
cdf1b39c5e lx_emul: shadow asm/special_insns.h
wbinvd is not supported in user mode

Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
88a6a9d628 lx_emul: add missing fpu/api.h to shadow pgtable.h
Issue #4450
2022-04-13 08:07:59 +02:00
Alexander Boettcher
279f038b9e lx_emul: shadow asm/cpufeature and asm/page_64
Issue #4450
2022-04-13 08:07:58 +02:00
Josef Söntgen
fd8df3a623 lx_emul: handle page refcount 2022-04-13 08:07:58 +02:00
Alexander Boettcher
4474460377 lx_emul: __alloc_pages support in shadow/mm/page_alloc.c 2022-04-13 08:07:58 +02:00
Alexander Boettcher
a222df31ba platform_drv(x86): avoid exception in alloc_dma
If size is zero, the platform goes out of service by:

[init -> platform_drv] Error: Uncaught exception of type 'Genode::Ram_allocator::Denied'
[init -> platform_drv] Warning: abort called - thread: e

Issue #4450
2022-04-13 08:07:58 +02:00
Alexander Boettcher
dd10e5d977 intel_fb: move to legacy_intel_fb
Move the depot recipe and consistently name the old drivers with a legacy_
prefix as done with the old usb_host driver.

Issue #4450
2022-04-13 08:07:58 +02:00
Christian Helmuth
42fed1a16c tool/run: retry with optional timeout utility
Issue #4429
2022-04-13 08:07:58 +02:00
Christian Helmuth
2723614d58 tool/run: restrict close to amtterm spawn_id
Issue #4429
2022-04-13 08:07:58 +02:00
Christian Helmuth
fec5c03612 tool/run: option to skip AMT SOL availability test
Issue #4429
2022-04-13 08:07:58 +02:00
Christian Helmuth
1a2677ebe6 dde_ipxe: update Intel NIC support list from upstream
Also, the repository URL was adapted to the permanent redirect to github
to prevent the following warning.

  dde_ipxe  download http://git.ipxe.org/ipxe.git
  dde_ipxe  git Cloning into 'src/lib/dde_ipxe'...
  dde_ipxe  git warning: redirecting to https://github.com/ipxe/ipxe/
  dde_ipxe  update src/lib/dde_ipxe
2022-04-13 08:07:58 +02:00
Christian Helmuth
ad4fb2b088 nova: fix IOTLB flush for global mode
Issue alex-ab/nova#6
2022-04-13 08:07:58 +02:00
Christian Helmuth
c56ac3e909 nova: support extended addresses in FADT
Issue alex-ab/nova#5
2022-04-13 08:07:58 +02:00
Martin Stein
50fc2aa251 black_hole: provide Gpu service
Ref #4419
2022-04-13 08:07:58 +02:00
Martin Stein
046ebc3d34 black_hole: provide ROM service
Ref #4419
2022-04-13 08:07:58 +02:00
Norman Feske
bb26a986e6 sculpt: add trace_logger as optional launcher
This patch adds the trace-logger utility to the default set of packages
along with an optional launcher. With this change, only two steps are
needed to use Genode's tracing mechanism with Sculpt:

- Add 'trace_logger' to the 'launcher:' list of the .sculpt file

- Either manually select the 'trace_logger' from the '+' menu,
  or add the following entry to the deploy configuration:

    <start name="trace_logger"/>

By default, the trace logger is configured to trace all threads
executed in the runtime subsystem and to print a report every 10
seconds. This default policy can be refined in the launcher's <config>
node. Note that the trace logger does not respond to configuration
changes during runtime. Changes come into effect not before restarting
the component.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
3394f97f86 trace_logger: make output format more concise
This patch changes the output format of the trace logger to become
better suitable for human consumption. For example, when instrumenting
the VFS server in Sculpt using the GENODE_TRACE_TSC utility, the
trace logger now generates tabular output as follows.

  Report 4

  PD "init -> runtime -> arch_vbox6 -> vbox -> " ----------------
   Thread "vCPU"           at (0,0)  total:12909024 recent:989229
   Thread "vCPU"           at (1,0)  total:5643234  recent:786437

  PD "init -> runtime -> ahci-0.fs" -----------------------------
   Thread "ahci-0.fs"      at (0,0)  total:910497   recent:6335
   Thread "ep"             at (0,0)  total:0        recent:0
    71919692932: TSC process_packets: 8005M (4998 calls, last 4932K)
    71921558516: TSC process_packets: 8006M (4999 calls, last 1596K)
    71922760220: TSC process_packets: 8007M (5000 calls, last 1006K)
    71929853586: TSC process_packets: 8009M (5001 calls, last 1840K)
    71931315246: TSC process_packets: 8011M (5002 calls, last 1253K)
    72127999920: TSC process_packets: 8016M (5003 calls, last 5606K)
    72129568198: TSC process_packets: 8018M (5004 calls, last 1345K)
    77161908178: TSC process_packets: 8029M (5005 calls, last 11349K)
    77643225736: TSC process_packets: 8029M (5006 calls, last 217K)
    89422100594: TSC process_packets: 8035M (5007 calls, last 5656K)
    89422123632: TSC process_packets: 8035M (5008 calls, last 1342)
   Thread "signal handler" at (0,0)  total:36329    recent:3001
   Thread "signal_proxy"   at (0,0)  total:51838    recent:13099
   Thread "pdaemon"        at (0,0)  total:97184    recent:332
   Thread "vdrain"         at (0,0)  total:1266     recent:286
   Thread "vrele"          at (0,0)  total:1904     recent:516

  PD "init -> runtime -> nic_drv" -------------------------------
   Thread "nic_drv"        at (0,0)  total:34044    recent:897
   Thread "signal handler" at (0,0)  total:369      recent:142

  ...

Subjects that belong to the same PD are grouped together. The formerly
optional affinity and activity options have been removed. Those
information are now unconditionally displayed. The trace entries
belonging to a thread appear as slightly indented.

The patch also updates the coding style, avoiding excessively long
lines.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
f7270c44cb trace_logger: omit inactive subjects by default
This patch reduces repetitive log output by omitting inactive trace
subjects from the log output. The information about all subjects can
still be dumped by setting 'verbose="yes"'.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
ceb91732bf trace_logger: update state after adding subjects
This patch splits the creation and updating of monitor objects into two
stages. The creation of a monitor object changes the state of the
associated trace subject. The patch ensures that the new state is
captured by the update of the monitor object.

Issue #4448
2022-04-13 08:07:58 +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
Norman Feske
232a45bc14 os: add util/formatted_output.h utilities
The utilities of the new util/formatted_output.h header complement the
existing base/output.h with the text-formatting support needed to
produce tabular output.

Fixes #4449
2022-04-13 08:07:57 +02:00
Norman Feske
a5c9830706 Minor doc fixes in the release notes 2022-04-13 08:07:57 +02:00
Christian Helmuth
bde3be787e qemu-usb: fix device endpoint update
First, the endpoint update has to comply with the current alternate
settings of all interface, which are stored in USBDevice::altsetting[]
(one value per interface). Second, a SET_INTERFACE control request via
Packet_type::ALT_SETTING must update USBDevice::altsetting for the
interface.

Now, USB devices with multi-setting interface like the Joulescope JS110
with mixed bulk/isochronous endpoints are supported.
2022-04-13 08:07:57 +02:00
Christian Helmuth
49efff1fef Remove tool/create_sdk
Fixes #4446
2022-04-13 08:07:57 +02:00
Christian Helmuth
c5f9e61d3a driver_manager: adapt config attributes for usb_host 2022-04-13 08:07:57 +02:00
Norman Feske
26acd6c65a sculpt: suppress non-critical warning 2022-04-13 08:07:57 +02:00
Norman Feske
33c71d1d2c usb_host: change error to warning message
An insufficient session quota as offered by a USB client is not an
erroneous situation of the USB driver.
2022-04-13 08:07:57 +02:00
Norman Feske
b4aa0a20dd os: refine default USB session quota
This commit adjusts the value such that USB sessions requested by
VirtualBox6 on Sculpt OS can get established on the first try without
invoking the session-retry mechanism. This reduces the number of
diagnostic log messages like:

 Error: Insufficient 'ram_quota',got 6296372 need 6297928
2022-04-13 08:07:57 +02:00
Norman Feske
fa5f8dbd55 sculpt: reduce NIC driver CPU quota
The value of 50% as assigned by commit "sculpt: add basic support for
i.MX8 Quad EVK" leaves too little room for other components of the
runtime subsystem. With the adjustements of commit "sculpt: assign CPU
quotas" the sum exeedcs 100%. Hence this commit tunes down the value to
sensible 10%.
2022-04-13 08:07:57 +02:00
Norman Feske
a9022d8451 sandbox: improve CPU-quota accounting
The existing assignment of CPU quotas did not anticipate the dynamic
reconfiguration of init. It merely tracked the available CPU quota by
deducing the consumed amount from a global variable but never
replenished the value. This worked for static scenarios but failed in
situations where components are dynamically re-started.

So far this deficiency remained detected because CPU quotas were not
used in highly dynamic systems like Sculpt OS. However, this has
recently changed by commit "sculpt: assign CPU quotas".

The patch improves the accounting by mirroring the existing handling of
RAM and cap quotas. Note that the CPU-quota accounting is still rather
limited. In particular the dynamic rebalancing is not yet supported.

Issue #4445
2022-04-13 08:07:57 +02:00
Christian Helmuth
d182b20705 build: ensure rules with pipes might fail
.SHELLFLAGS is extended by option pipefail to make pipes fail if any pipe
element fails. As .SHELLFLAGS is exported into sub-make instances it
must be unexported before calling third-party build systems recursively.
2022-03-21 13:43:13 +01:00
Christian Helmuth
7da691b52a pc/usb: defer startup until config is available
The commit also adds lx_kit/initial_config.h as utility.
2022-03-21 13:42:17 +01:00
Norman Feske
e3706837b9 VFS server: foster batching of acknowledgements
With the consolidation of the file-system session's signal handlers
implemented by commit "file_system_session: merge ack and submit sigh",
we can now change the VFS server to produce batches of acknowledgements
before explicitly waking up the client. (in contrast to the traditional
'acknowledge_packet', the new 'try_ack_packet' triggers no signal)

Issue #4388
2022-03-21 13:42:17 +01:00
Johannes Schlatow
f4d0f1624a test/trace: use for_each_new_entry
genodelabs/genode#4434
2022-03-21 13:42:17 +01: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
Johannes Schlatow
d24552f5e2 trace/policy: fix event size in log_output
Returning 0 for max_event_size() can lead to writing out of buffer bounds.

Fixes genodelabs/genode#4435
2022-03-09 12:04:44 +01:00
Stefan Kalkowski
e95f0a409d lx_emul: add implementation for Genode's USB C-API
Fix #4444
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
9713014130 dde_linux: add virt_linux lx_emul flavor
To support device-less protocol-stacks only ports, we can use a
Virt I/O Linux kernel flavor, and export the lx_kit/lx_emul parts
not depending on platform API and devices.

Ref #4397
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
35cf8aada4 lx_emul(x86): fill zero page with zeroes
Ref #4397
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
13c4abf4ad lx_emul: add static_cpu_has macro to shadow header
Ref #4397
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
0fa695dbd7 lx_kit/lx_emul: make memory backend configureable
* Drivers have to use lx_kit/memory_dma.cc
* Protocol-stacks use lx_kit/memory_non_dma.cc
* Moreover the device-dependent lx_emul parts get removed
  from the common lx_emul import rules

Fix #4443
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
d473bed4b7 platform api: export dma buffer capability
Ref #4443
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
5c71a8d74d lx_emul: extract common lx_emul import makefile
Fix #4442
2022-03-09 10:55:16 +01:00
Stefan Kalkowski
b80146a6f7 genode_c_api: unify shared dataspace callbacks
* Unifies the declaration of callbacks which manage driver/client
  shared dataspaces
* Move the Linux driver-specific callback implementation to the
  lx_emul library from the PC's USB host driver

Fix genodelabs/genode#4439
2022-03-09 10:55:16 +01:00
Norman Feske
b1e2e654a9 sculpt: support uplink and event service providers
This patch enhances Sculpt with the ability to route uplink and event
sessions to the optional black-hole component.

Issue #4419
2022-03-08 15:48:53 +01:00
Christian Helmuth
a941dfe7b2 gpt_write: adapt to changed packet stream blocking semantics
Issue #4390
2022-03-08 15:37:04 +01:00
Robin Eklind
1142ef91df base-linux: fix build (BOARD=pc)
Fix a few build errors related to required type conversions
and handling of references.

Fixes #4440
Fixes #4441
2022-03-08 14:23:28 +01:00
Norman Feske
4056fb9127 pc/usb: fix ret value of handle_altsetting_request
The logic got accidentally reversed during the transition from the
legacy USB driver.

Since the function drops error details, this patch adds a diagnostic
message with the error code as returned by the Linux driver.
2022-03-08 12:46:11 +01:00
Norman Feske
0325be0827 virtualbox6: service lib target has no artifacts
This patch declares that the pseudo target virtualbox6/services/ does
not produce any build artifact. This allows the adding of virtualbox6
to Sculpt's 'build:' list.
2022-03-08 10:51:19 +01:00
Christian Helmuth
29e6537939 pc: fix dependency to generated crc32table.h 2022-03-07 16:43:12 +01:00
Stefan Kalkowski
600997d8d6 usb_hid_raw: don't use deprecated qemu option
* Use -device instead of deprecated -usbdevice
* Use the same xhci model as in usb_hid_reconnect
2022-03-07 16:43:12 +01:00
Josef Söntgen
67f797abf2 pc: enable UHCI driver in usb_host
Fix genodelabs/genode#4438
2022-03-07 16:43:12 +01:00
Stefan Kalkowski
2a35c8f9e7 lx_emul: add page macros to x86 shadow headers
* Add page_to_phys and dummy macro for pgprot_device

Original commit provided by Josef Soentgen

Ref genodelabs/genode#4438
2022-03-07 16:43:12 +01:00
Josef Söntgen
2760b67902 lx_kit/lx_emul: add I/O port support
Ref genodelabs/genode#4438
2022-03-07 16:43:12 +01:00
Stefan Kalkowski
57aab46fc3 platform: introduce I/O ports in API
* Introduces Platform::Device::Io_port client utility
* Implements I/O ports as common device resources in platform driver

Fix genodelabs/genode#4436
2022-03-07 16:42:56 +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
Roland Bär
d45b60ceeb sntp_client.run: redundant aritfacts in image build
The run script uses core, ld.lib.so, and init from depot packages, thus
these cannot be integrated in the image explicitly from the build
directory.

Also, removed special build of report_rom, which is not subject of the
test.

Fixes #4437
2022-03-02 07:56:20 +01:00
Christian Helmuth
4591d501b4 version: 22.02 2022-02-28 15:47:43 +01:00
Norman Feske
36957cb4d3 News item for version 22.02 2022-02-28 15:43:17 +01:00
Norman Feske
8b2247e21b Release notes for version 22.02 2022-02-28 15:43:17 +01:00
Norman Feske
cdb2f624de Update doc/components.txt 2022-02-28 15:43:17 +01:00
Christian Helmuth
2b3370c8d8 depot: update recipe hashes 2022-02-28 11:46:35 +01:00
Christian Prochaska
88dec4cc94 dde_rump: support blocking I/O operations from non-ep threads
Issue #4433
2022-02-28 11:45:19 +01:00
Martin Stein
87c5f91a74 test/black_hole: test link-state change at uplink
Ref #4419
2022-02-28 11:45:19 +01:00
Martin Stein
fa3a195077 test/black_hole: split-up test classes
Ref #4419
2022-02-28 11:45:18 +01:00
Martin Stein
4f640dacab test/black_hole: fix failing packet allocation
* The problem occured only on OKL4, seL4, and L4/Fiasco
* The test used to continue submitting packets regardless of how many were in
  flight
* This commit limits the in-flight packets at the Uplink/Nic connections to 40
  each

Ref #4419
2022-02-28 11:45:18 +01:00
Christian Prochaska
351439b4ab Add vfs_gpu.lib.so to Qt5 run scripts and recipes
Issue #4380
2022-02-28 11:45:18 +01:00
Norman Feske
44282da30d Add vfs_gpu.lib.so to Mesa run scripts
This follow-up commit to "vfs_gpu: VFS plugin that handles GPU
completions" is needed to excute the mesa-gears.run script.

Issue #4380
2022-02-28 11:45:18 +01:00
Norman Feske
668258746b Update expat to version 2.4.6
The tar.gz archive of version 2.4.1 vanished from sourceforge.
2022-02-28 11:45:18 +01:00
Norman Feske
ca9460aead event_filter: touch/press untouch/release sequence
This commit changes the touch-click filter to adhere the following
sequence:

  touch         (physical)
  press         (artifically generated)
  release       (artificially generated)
  release_touch (physical)

This order is important because nitpicker's focus handling takes
press/release events into account. If the release-touch event appears
before the release event, nitpicker subsumes the release-touch event
to the sequence that started with the press event, instead of handling
it as a free-standing event.

Issue #4332
2022-02-28 11:45:18 +01:00
Norman Feske
55492fbe5b sculpt: assign CPU quotas
By assigning CPU budgets, base-hw's priorities come into effect.
Even though the chosen values are rather guessed than informed, they
yield a visibly improved responsiveness on the Pinephone.
2022-02-28 11:45:18 +01:00
Norman Feske
a084f6c835 sculpt: suppress log_kernel on Pinephone
The log_kernel component exists only for NOVA.
2022-02-28 11:45:18 +01:00
Norman Feske
e162317afa sculpt: add nitpicker domain for touch keyboard
Issue #4432
2022-02-28 11:45:18 +01:00
Norman Feske
ac3069ebfa sculpt: launcher for touch_keyboard
Issue #4432
2022-02-28 11:45:18 +01:00
Norman Feske
620a274c82 Touch-screen keyboard
Fixes #4432
2022-02-28 11:45:18 +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
Johannes Schlatow
d7c4265089 trace_buffer: add test pkg for depot_autopilot
genodelabs/genode#4430
2022-02-28 11:45:18 +01:00
Norman Feske
b39c124628 base-okl4: remove non-critical error message 2022-02-28 11:45:18 +01:00
Stefan Kalkowski
b5b958c276 hw: unify architectural kernel interface header
Fix genodelabs/genode#4345
2022-02-28 11:45:18 +01:00
Stefan Kalkowski
b5e327e3e9 platform_drv: do not return cap of device twice
When a device got already acquired by a platform session client, do not
return the same capability again, even if the same platform session
client requested it. Therefore, make doubtful behaviour of client components
visible, and do not have to struggle with Platform::Device instances
instantiated multiple times, which care of the lifetime of the device
capability internally.

Fix genodelabs/genode#4379
2022-02-21 15:47:51 +01:00
Piotr Tworek
e595b0b782 base-hw: Make sure MMU is initially disabled on ARMv8.
Genode code already expects MMU to be disabled when starting the
kernel. It is enabled eventually in Bootstrap::Platform::enable_mmu,
after setting up translation tables. Unfortunately nothing ensures
this is actually the case. If MMU happens to be enabled when entering
the kernel things go downhill pretty fast after we start messing with
TTBR.

This patch ensures MMU is disabled for EL1, EL2, EL3 dependent on the
exception level of the CPU core, which is entering the kernel.

This should allow base-hw to start correctly on Quartz64 A board.
2022-02-21 15:47:51 +01:00
Stefan Kalkowski
0c67d0838a hw: restrict page-table lookup to rw-pages
The `lookup_translation` function got introduced and is used only in the
context to proof whether a cache maintainance function can be executed
safely by the kernel. Unfortunately, it did not checked write permissions,
which can lead to permission faults. This commit restricts the lookup
function to only succeed when the target page is writeable. Consequently,
the lookup function gets renamed to `lookup_rw_translation`.

Fix genodelabs/genode#4348
2022-02-21 15:47:51 +01:00
Stefan Kalkowski
e1a2b5c8d4 pc: build lx_emul and linux driver code with -O2
Ref genodelabs/genode#4416
2022-02-21 15:47:51 +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
Stefan Kalkowski
a30c4281d2 genode_c_api: report usb config on demand
Do not only report devices, but the current configuration of the driver too,
as long as the `report` node in the configuration states it.

Ref genodelabs/genode#4416
2022-02-21 15:47:50 +01:00
Stefan Kalkowski
938ac716a8 genode_c_api: make usb devices report configurable
To stay consistent with the configuration of the legacy usb_host_drv
and other components as well, do not report USB devices by default,
but when the following XML node is set within the component's
configuration:

  <report devices="yes"/>

Ref genodelabs/genode#4416
2022-02-21 15:44:23 +01:00
Stefan Kalkowski
a04d0b9a0f usb_session: increase default ram quota
The new usb_host driver for PC by default needs more RAM quota in contrast
to the old one. To minor warnings and repeated attempts to open a USB
session from a client, this commit increases the default RAM quota by one
page.

Ref genodelabs/genode#4416
2022-02-21 15:44:22 +01:00
Stefan Kalkowski
3c07bf4e86 genode_c_api: support to handle empty usb session
Adds a function to the USB part of the Genode's C API, to enable
usb_host drivers to acknowledge USB request in client's packet buffer
although they are not assigned to an USB device. The requests are
marked with a "no device" error.

This commit fixes a regression originally solved in genodelabs/genode#4149

Ref genodelabs/genode#4416
2022-02-21 15:44:22 +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
429d078de7 log_core.run: RAM-quota adjustment for sel4
Issue #4400
2022-02-21 15:44:22 +01:00
Norman Feske
ef732f480f mk: pass KERNEL as environment variable
This is a follow-up fix for "mk/ld.mk: trigger kernel-dependent
ld.lib.so build", which alleviates the need to specify the KERNEL at the
build-system command line. Thanks to Piotr Tworek for reporting.

Issue #4320
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
Johannes Schlatow
019cacf07e vfs_tap: VFS plugin for Uplink/Nic session access
This plugin emulates a `/dev/tapX` device as found on FreeBSD. See
README for more information.

genodelabs/genode#4394
2022-02-21 15:44:22 +01:00
Johannes Schlatow
19958eafcf vfs: add notify_read_ready() to Single_vfs_handle
The Single_file_system now forwards the
`File_io_service::notify_read_ready` method to the
handle as it already did for most of the other methods.

genodelabs/genode#4394
2022-02-15 17:14:34 +01:00
Johannes Schlatow
f33916e2dc vfs: remove check_unblock from File_io_service
genodelabs/genode#4394
2022-02-15 17:14:34 +01:00
Christian Helmuth
1d5af600cc test-init: increase LOG server cap quota for sel4 2022-02-15 17:14:34 +01:00
Sebastian Sumpf
8edb7b28a0 sculpt_manager: initial mode for 'Managed_config'
Do not set '_mode' per default to MANANGED. Check if a manual config ROM
is present during construction and set '_mode' to MANUAL in case it is.

issue #4369
2022-02-15 16:33:38 +01:00
Norman Feske
14b93c5ff3 run: handle empty create_tar_from_depot_binaries
This patch works around 'tar' erroring out when faced with an empty list
of files:

  tar: Cowardly refusing to create an empty archive

This can happen when using sculpt.run for a scenario with only a runtime
but no deploy or launcher configuration.

Issue #4369
2022-02-15 16:13:54 +01:00
Sebastian Sumpf
300cdc435d expanding_report: make expandable for XML node generation
'generate(Xml_node node)', as used by the Sculpt manager, calls this
function instead of the lambda version. The 'report' function of the
'Genode::Reporter' does not throw an exception in case there is not
enough backing storage for the 'generate' request. Therefore, we have to
check this condition in a loop and call '_increase_report_buffer' in
case size limits are reached.

Patch by Norman Feske.

issue #4369
2022-02-15 16:13:53 +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
Martin Stein
3e460211c8 black_hole: provide Uplink service
Ref #4419
2022-02-15 15:28:58 +01:00
Piotr Tworek
bade0a85e7 base-hw: Implement CPU core identification for Cortex-A55.
According to ARM Cortex-A55 Core Technical Reference Manual r1p0 the
lowest 8 bits (Aff0) of MPIDR register represent thread IDs within a
multi-threaded core. The actual core identification bits are in Aff1.
This layout can be identified by checking the MT bit of MPIDR register.
Basically, if MT=1 core id is in Aff1, if MT=0 core id is in Aff0.

Without this change Genode will identify all CPU cores on A55 as primary
(0) core.

Its worth to mention that Cortex-A55 by itself is not a multi-threaded
CPU. Aff0 values are always expected to be 0 for pure A55 cores. A55
cores can however be paired with cores that are multi-threaded. To
support such big.LITTLE CPUs in Genode we'd probably need to add a
different mechanism for mapping MPIDR values to logical, contignous
core IDs which Genode expects.

Ref:
https://developer.arm.com/documentation/100442/0100/register-descriptions/aarch64-system-registers/mpidr-el1--multiprocessor-affinity-register--el1?lang=en
2022-02-15 15:27:29 +01:00
Johannes Schlatow
c265218ba8 netperf: output more metrics
* use netperf omnitest output selectors to acquire more metrics
* remove packet_size argument that was not interpreted by netperf

genodelabs/genode#4427
2022-02-15 15:25:56 +01:00
Norman Feske
8b7067d289 sd_card_bench.run: assign 'managing_system' role
Issue #2243
2022-02-15 15:18:04 +01:00
Norman Feske
649647538b depot: update recipe hashes 2022-02-15 10:23:59 +01:00
Johannes Schlatow
70bf0cbe84 vfs/lwip: add missing signal handlers
Note, without batching from the Nic server this may slow down the
throughput a bit.

genodelabs/genode#4427
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
Piotr Tworek
05e4993d2e gems: Avoid flexible array member in Cached_font.
Switch the code to 0 lengh array instead. The code in
Lru_cache::element_size calls sizeof on this structure. This works in
gcc, but fails when using clang. Even for GCC however the documentation
states:

  "Flexible array members have incomplete type, and so the sizeof operator
   may not be applied. As a quirk of the original implementation of
   zero-length arrays, sizeof evaluates to zero."

Basically its an implementation quirk that clang does not support. Both
GCC and clang do support zero sized arrays however so using them here
allows both compilers to process this code.

Ref: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
c1a566ce63 gems: Remove unused lambda capture in vfs/ttf.
Clang complains "this" captured by the lambda is not used. Remove the
capture to make it happy.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
ec7d0efddf os: Drop unused Net::Dhcp_client::_alloc member.
This reference member is not used anywhere in the code. This prompts
clang to complain about it. Eliminate the member and all the plumbing
associated with it to silence the warning.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
15c8cac78b os: Don't use char as array subscript.
Clang really doesn't like char subscripts. I can't say I blame it. Fix
the warning by an explicit cast to unsigned.

include/nitpicker_gfx/tff_font.h:230:53: error:
    array subscript is of type 'char' [-Werror,-Wchar-subscripts]
Tff::Vertical_metrics const m = _vertical_metrics['m'];
                                                 ^~~~
Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
9dd04ad268 os: Drop unused lambda captures in VFS code.
Clang likes to complain when lambdas capture parameters without
actually using them. This patch fixes a couple of such problems in VFS
related os module code.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
14c36efbab os: Disambiguate Genode::destroy in route_model.h
Clang can't figure it out on its own. I can't blame it for this to be
honest. Lets be clear which destroy method we're talking about here.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
f1f3b423ec os: Disambiguate friend Avl_node.
It seems clang does not take "using namespace Genode" statement in
Driver namespace into account when parsing those friend Avl_node
lines.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
5e93a5806b base-hw: Use softfp ABI on virt_qemu ARMv7.
The soft ABI implies purely software floating point implementation.
This is not the case for Genode however. For example core's
exception_vector.S uses vmsr instruction. This builds fine with with
GCC based toolchain, but clang with integrated-as complains:

src/core/spec/arm/exception_vector.S:122:2: error: instruction requires: VFP2
 vmsr fpexc, r1
 ^

Fix this by passing softfp to mfloat-abi command on ARMv7. This allows
usage of FP HW, but implies soft-floating point ABI.

Issue #4421
2022-02-15 10:23:58 +01:00
Piotr Tworek
4ae78639f5 base-hw: Fix invalid structure alignments.
According to C++11 reference:

  "If the strictest (largest) alignas on a declaration is weaker than
   the alignment it would have without any alignas specifiers (that is,
   weaker than its natural alignment or weaker than alignas on another
   declaration of the same object or type), the program is ill-formed:"

https://en.cppreference.com/w/cpp/language/alignas

The code requests 4 byte alignment for Genode::Arm_cpu::Context.
The Context structure inherits Genode::Arm_cpu::Fpu_context which
has minimum alignment requirement of 8 bytes, due to uint64_t d0_d31
member. This makes the 4 byte value in Context's alignas specifier
invalid (smaller than allowed minimum).

Similar situation takes place in Arm_64 case. The claimed minimum
alignment of Context is 8 bytes, but the fpu_state member imposes 16
bytes alignment (explicitly specified in Fpu_state declaration).

In both cases the code builds fine with GCC 8.3.0, but fails with
clang which claims that "requested alignment is less than minimum
alignment of X for type", where X is 8 on ARM and 16 on AArch64.

Ref: https://eel.is/c++draft/dcl.align#5

Issue #4421
2022-02-15 10:23:58 +01:00
Martin Stein
468057638b black_hole: provide Nic service
Ref #4419
2022-02-15 10:23:58 +01:00
Stefan Kalkowski
3edec0c6ca pc: new usb host driver based on Linux 5.14.21
Original commit by Josef Soentgen.

Ref genodelabs/genode#4416
2022-02-15 10:23:58 +01:00
Stefan Kalkowski
e72f39b484 Provide pc specific lx_emul API
This commit contains:

* Minimal Linux kernel target: pc_linux
* Library to generate a Linux build directory, config, generated headers
* API depot package

The actual work was provided by Josef Soentgen.

Ref genodelabs/genode#4416
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
Norman Feske
84435662aa os/block: Remove use of Dataspace::phys_addr
Issue #2243
2022-02-15 10:23:58 +01:00
Norman Feske
de6c65c453 sd_card/pl180: remove unused code 2022-02-15 10:23:16 +01:00
Martin Stein
7945bcb353 black_hole: add config.xsd
Ref #4419
2022-02-15 10:23:16 +01:00
Martin Stein
ca49e94a87 black_hole: test recipe for the depot_autopilot
* Creates sessions to all supported services of the black hole component
* Test-drives the Event and Capture session with dummy input
* Adds the test to the default list of depot_autopilot.run
* Test-driving the Audio_in and Audio_out sessions is still missing and should
  be added via a dedicated commit

Ref #4419
2022-02-15 10:23:16 +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
Stefan Kalkowski
17f3e7a38f Introduce pc repository for PC board support
Fix genodelabs/genode#4415
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
da55425114 lx_emul: finalize support for x86_32 and x86_64
Original commit by Josef Soentgen.

Fix genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
5a48f8ab0f lx_kit/lx_emul: support for executing PCI fixups
Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
2515196b82 lx_kit: add Platform session wrapper for x86
The x86 platform driver uses a different API than the one for ARM for
which the lx_kit glue code was designed. Since the x86 platform driver
will eventually adopt a similar interface we implement a wrapper that
encapsulates the old interface.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
77ab7bf68b lx_emul: add PCI config space handling
Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
c851b189c5 lx_emul: add wake_q_add/wake_up_q in shadow impl.
The function within this commit were taken verbatim from the
original Linux implementation.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
0f70212139 lx_emul: import shadow sched.c from allwinner repo
Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Josef Söntgen
96ca806e0d lx_emul: fix conversion warnings on 32bit
This change is necessary for also supporting 32bit platforms.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
7809b9e8ad lx_emul: move arm_64 specifics, add x86 specifics
Split in between x86 and arm code. Move arm-specifics away from
generic include pathes.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
d7963be212 lx_emul: update to linux kernel 5.14 as default
Until now, the lx_emul layer addressed a 5.11 Linux Kernel port,
now that we add new architectures it is better to update the default version
first. There are especially changes in the task_struct code,
and the signature of some functions in the paging subsystem changed.

Ref genodelabs/genode#4411
2022-02-15 10:23:16 +01:00
Stefan Kalkowski
742c40a60a dde_linux: add linux kernel 5.14.21 port
Ref genodelabs/genode#4411
2022-02-15 10:23:15 +01:00
Stefan Kalkowski
1e41c6daa4 lx_kit: move setjmp/longjmp away from legacy
We use the architecture-specific setjmp/longjmp implementation without
modification in the newer lx_kit implementation as well. There is no
need for a duplication.

Ref genodelabs/genode#4411
2022-02-15 10:23:15 +01:00
Stefan Kalkowski
ed1b8fb3f9 sculpt_manager: increase ram quota of nic driver
When running Sculpt OS on i.MX8 MW EVK or MNT Reform 2 the NIC driver
is far more hangry with respect to memory usage.

Fix genodelabs/genode#4407
2022-02-15 10:23:15 +01:00
Martin Stein
fcb3e32fee black_hole: provide Event service
Fixes #4419
2022-02-15 10:23:15 +01:00
Norman Feske
53dea7e623 Move exec_terminal to genode-world
This is a leftover of issue #4258.
2022-02-15 10:23:15 +01:00
Norman Feske
f9f79af5bd tool/tool_chain: fix condition of ali2dep build
Thanks to Tomasz Gajewski for reporting this issue and suggesting the
fix.

Fixes #4365
2022-02-15 10:23:15 +01:00
Martin Stein
6f571a1e80 port/cbe: update to newest version
The new version fixes a bug that led to the regular attempt of encrypting
invalid block encryption keys at the crypto back-end.

Ref #4355
2022-02-15 10:23:15 +01:00
Norman Feske
4f40a607ea Remove ROM prefetcher
Fixes #4418
2022-02-15 10:23:15 +01:00
Johannes Schlatow
392a2cba66 libc: fix page fault in socket_fs_plugin
In the error case of socket_fs_accept() the Unconfirmed utility was
incompletely applied with the result of executing the cleanup routines
in the wrong order.

Fixes #4417
2022-02-15 10:23:15 +01:00
Stefan Kalkowski
50c7104e22 nic_router tests: remove unused platform driver 2022-02-15 10:23:15 +01:00
Christian Helmuth
a9b8b6e6c2 Move lua/moon to genode-world
Issue genodelabs/genode-world#282
Fixes #4414
2022-02-15 10:23:15 +01:00
Christian Helmuth
76dde9d0ec libports: remove ancient unused readline library 2022-02-15 10:23:15 +01:00
Alexander Boettcher
888b89c1c0 nova: avoid pagefault on invalid SVM exit
Fixes #4391
2022-02-15 10:23:15 +01:00
Alexander Boettcher
35489aa708 seoul: move to genode-world
Fixes #4412
2022-02-15 10:23:15 +01:00
Alexander Boettcher
baea48fbec iso9660: move to genode-world
Fixes #4413
2022-02-15 10:23:15 +01:00
Norman Feske
ec559b85e2 Add missing shared-object link dependencies
Issue #4408
2022-02-15 10:23:14 +01:00
Stefan Kalkowski
144cc8ac54 create_dummies: fix detection of out-of-tree build
Fix genodelabs/genode#4410
2022-02-15 10:21:00 +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
368730ce0b run: don't build ld at boot-dir stage
With the kernel-specific build of the dynamic linker triggered
automatically at the build stage, the artificial build step at the
boot-dir stage can be skipped.

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
bdc766980e tool/run/boot_dir/linux: improve error message
Also fix white space
2022-02-15 10:20:59 +01:00
Norman Feske
3b8fe1b410 nitpicker: reflect seq number in clicked report
This patch makes nitpicker's "clicked" report useful for the detection
of clicks outside of any client. This is needed in situations where the
dialog should close when clicking outside its screen area. In the new
version, a click outside any client results in a report without a
'label' attribute. Furthermore, the report is augmented by the sequence
number of the click, which allows for freshness checks by the consumer of
the report (i.e., sculpt_manager).

Issue #4398
2022-02-15 10:20:59 +01:00
Norman Feske
616a92a193 test-vfs_stress_fs: adjust cap quota for seL4 2022-02-15 10:20:59 +01:00
Johannes Schlatow
47cb44c6eb os/trace_buffer.h: fix wraparound
If the buffer contains padding at the end, the iteration must continue
in order to restart iteration from the start of the buffer.

genodelabs/genode#4244
2022-02-15 10:20:59 +01:00
Martin Stein
b31bbfe14c jpeg: update hash of downloaded archive
The archive contents are equivalent except the creation date of the
top-level directory.

  -drwxr-xr-x guivol/users      0 2021-01-07 12:54 jpeg-9d/
  +drwxr-xr-x guivol/users      0 2022-01-04 12:02 jpeg-9d/

Fixes #4406
2022-02-15 10:20:59 +01:00
Norman Feske
36162f5ccf Remove fs_log component
Fixes #4400
2022-02-15 10:20:59 +01:00
Stefan Kalkowski
cd0cfc34a3 create_builddir: add imx repository for arm_v7 2022-02-15 10:20:59 +01:00
Norman Feske
d93d3fbfca log_core.run: use terminal_log instead of fs_log
Issue #4400
2022-02-15 10:20:59 +01:00
Norman Feske
51134a6897 cpu_burner: coding style 2022-02-15 10:17:28 +01:00
Norman Feske
26d9bac78f os: remove outdated test/block components
The functionality of the test-block-client, test-block-server, and
test-block-bench components is now covered by the block_tester
application and the vfs_block server.

Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
378e2d9e74 Use block_tester instead of test/block/client
Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
76c090b694 Remove block_cache server
Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
9478c3cc7c Remove http_block server
Issue #4405
2022-02-15 10:17:28 +01:00
Norman Feske
479f2e0d1f trace_logger: remove false warnings from the log
This patch eliminates warnings that occurred as side effect of using the
'Session_policy' utility ("Warning: no policy defined for label...").
The new version uses the 'with_matching_policy' function instead, which
has the nice side effect of simplifying the error handling.
2022-02-15 10:17:28 +01:00
Norman Feske
6eaeb61d58 os/session_policy.h: add 'with_matching_policy'
This patch makes the server-side policy-matching logic available outside
the 'Session_policy' class. Given that the new 'with_matching_policy'
function does not throw any exception, it gives server implementations
the freedom to avoid the C++ exception mechanism for the policy handling.
2022-02-15 10:17:28 +01:00
Stefan Kalkowski
bb285bf758 Convert virtio to use Platform::Session::dma_addr
Issue #2243
2022-02-15 10:17:28 +01:00
Norman Feske
7e26d3ef3f Give diagnostic aid to callers of 'dma_addr'
If the platform driver lacks the 'managing_system="yes"' attribute,
requests for DMA addresses return 0. This patch is meant to help
diagnosing such configuration issues.

Issue #2243
2022-02-15 10:17:28 +01:00
Norman Feske
cbe3e49c7f os: Input::Event:Axis event type
This event type can be used to propagate analog values such as joypads.

Issue #3669
2022-02-15 10:17:28 +01:00
Norman Feske
50c2b0066f Remove 'Env::reinit' and 'Env::reinit_main_thread'
Fixes #4404
2022-02-15 10:17:28 +01:00
Norman Feske
62b4871c5c Remove gems/magic_ring_buffer.h
Since its introduction four years ago, the utility remained
largely unused.

Fixes #4403
2022-02-15 10:17:28 +01:00
Christian Prochaska
d4d875f2e6 libusb: handle 'ack_avail' signals in a VFS plugin
Issue #4392
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
Stefan Kalkowski
fe009fd66d usb_hid_raw: add configuration for rpi_platform_drv
Ref #4396
2022-02-15 10:16:52 +01:00
Norman Feske
51479e6be0 Convert drivers to use Platform::Session::dma_addr
This patch eliminates several calls of 'Dataspace::phys_addr'.

Issue #2243
2022-02-15 10:16:52 +01:00
Norman Feske
90a6f55f88 os: add platform_session/dma_buffer.h
The new 'Dma_buffer' utility simplifies the allocation of DMA-capable
RAM by device drivers.

Issue #4401
2022-02-15 10:16:52 +01:00
Norman Feske
997a24e91a dde_rump: remove use of Dataspace::phys_addr
This patch removes dead code. The Rump kernel does not need to know any
physical addresses of allocated memory.

Issue #2243
2022-02-15 10:16:52 +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
Norman Feske
024b987e4c os: change Input::Touch_id from int to unsigned
There no sensible meaning for negative touch IDs.

Issue #3669
2022-02-15 10:16:51 +01:00
Norman Feske
8e9cabf819 sculpt_manager: touch-screen compatibility
This patch makes Sculpt's leitzentrale GUI able to respond to touch events. It
formerly assumed that click/clack events are always preceded by hover reports
that identify the clicked-on widgets. For touch events, however, the most
up-to-date hover information referred to the previous click because there is no
motion without touching. So the GUI tended to identify the wrong widgets as
click targets.

The patch solved this problem by testing the freshness of the hover information
at the time of the click. If the hover information is older than the click, the
action is deferred until up-to-date hover information becomes available.

Fixes #4398
2022-02-15 10:16:51 +01:00
Norman Feske
cdbb929125 nitpicker: forward Input::Seq_number events
Issue #4398
2022-02-15 10:16:51 +01:00
Norman Feske
a824632d95 menu_view: report input seq number in hover info
Issue #4398
2022-02-15 10:16:51 +01:00
Norman Feske
4dfa7902db os: Input::Event:Seq_number event type
The new event type allows for the propagation of sequence numbers as a means to
validate the freshness of input handling. E.g., an menu-view-based application
can augment artificial sequence numbers to the stream of motion events supplied
to 'menu_view'. Menu view, in turn, can now report the latest received sequence
number in its hover reports, thereby enabling the application to robustly
correlate hover results with click positions.

Issue #4398
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
Stefan Kalkowski
00f7819623 rpi_gpio_drv: remove dep from rpi board header
Ref #4396
2022-02-15 10:11:11 +01:00
Stefan Kalkowski
10d7741a26 Add board-specific rpi repo to .gitignore
Ref #4396
2022-02-15 10:11:11 +01:00
Christian Prochaska
f773c46b5d libusb: adapt to changed packet stream blocking semantics
Issue #4390
2022-02-15 10:11:11 +01:00
Norman Feske
ad2c5fe4b4 sculpt: check XML syntax of ingredients
Issue #4369
2022-02-15 10:11:11 +01:00
Norman Feske
a8667a55bd test/framebuffer/intel: use VFS, not of fs session
This patch updates the intel_fb_controller test component to use the VFS
API instead of interacting with an file-system session directly.

Issue #4390
2022-02-15 10:11:11 +01:00
Norman Feske
22cce07ec8 fs_log: remove blocking call of get_acked_packet
This patch replaces formerly blocking packet-stream operations by
the explicit use of 'wait_and_dispatch_io_signal' for blocking.
It also removes a misleading comment that promised a fire-and-forget
behavior whereas the implementation relied on blocking I/O anyway.

Issue #4390
2022-02-15 10:11:11 +01:00
Norman Feske
480c0a7dee base-fiasco: silence recv_and_wait error messages
Errors during IPC receive-and-wait can occur at the server side when
a client is killed. This condition is not an error from the server's
perspective. We used to print a message nevertheless, since the
condition is rather exceptional. However, when printed during the
test-sequence test, the messages interfere with the pattern matching of
the depot_autopilot, flagging the successful test as an error.
2022-02-15 10:11:11 +01:00
Norman Feske
df2e7fa842 vfs_block_file_system: remove Signal_receiver
The VFS block plugin used to depend on the blocking semantics of the
packet stream's 'get_acked_packet'. This patch replaces this dependency
by the use of 'wait_and_dispatch_one_io_signal'. However, in order to
implement this change, the custom instance of a 'Signal_receiver' had to
be removed as well.

To keep this patch as little invasive as possible, it does not touch the
direct use of the block session's packet stream, which should better be
replaced by the 'Block::Connection::Job' API.

Issue #4390
2022-02-15 10:11:11 +01:00
Johannes Schlatow
7aa9cf9b37 uplink_client_base: add handlers for zynq_nic_drv
The zynq_nic_drv follows a zero-copy approach and thus uses the packet
buffers as DMA memory. In order to know when the RX DMA memory can be used
for another packet, a custom ack_avail_handler is needed.
Similarly, packets received from the Uplink session are not copied to a
DMA buffer but to directly passed on as DMA memory. For this purpose,
a a custom packet_avail handler is needed.

genodelabs/genode#4384
2022-02-15 10:11:11 +01:00
Norman Feske
ac691eb229 file_system/util.h: remove packet-stream helpers
The 'read' and 'write' utilities are from a time before the VFS API
as os/vfs.h was available. They rely on the (now removed) blocking
semantics of the packet-stream interface.

The only remaining legitimate use case of the direct interaction with
the file-system session without VFS is the back end of gcov, which needs
a way to exfiltrate the statistical data using a channel that is
independent from the libc or the VFS.

Issue #4390
2022-02-15 10:11:10 +01:00
Norman Feske
0f56e76e7a rom_to_file: use VFS instead of fs session
This patch replaces the former direct use of a file-system session by
the use of the VFS API.

Issue #4390
2022-02-15 10:11:10 +01:00
Norman Feske
84f8305cdf usb_report_filter: use VFS instead of fs session
This patch replaces the direct use of a file-system session via the
'file_system/util.h' helpers by the VFS using the os/vfs.h API. This
makes the component more flexible while removing the dependence from
read and write utilities of file_system/util.h, which happen to rely on
the (now removed) blocking packet-stream semantics.

Issue #4390
2022-02-15 10:10:03 +01:00
Norman Feske
911ff31709 dde_rump: use Block::Connection::Job API
This patch replaces the direct interaction with the packet stream of
the block session by the use of the 'Block::Connection::Job' API,
removing the reliance on blocking packet-stream semantics.

Since I/O signals can now occur during 'Backend::submit', the patch
conditions the periodic calls of 'rump_sys_sync' by taking the backend
state into account.

Issue #4390
2022-02-15 10:10:03 +01:00
Norman Feske
7605101665 fatfs: use Block::Connection::Job API
This patch removes the use of blocking packet-stream calls from the
backend of the fatfs library.

Issue #4390
2022-02-15 10:10:03 +01:00
Norman Feske
2b0e64e061 os: remove blocking semantics from packet stream
Fixes #4390
2022-02-15 10:10:03 +01:00
Norman Feske
59ca8f2489 block_request_stream.run: use valid length value
Since the change "block_tester: limit batching in sequential test", the
sequence test blocks infinitely when encountering a length value smaller
than the block size.
2022-02-15 10:10:02 +01:00
Norman Feske
f7ee1f64a9 block_tester: warn on wrong length argument
When specifying a low value, the tester won't spawn any job but stay
silent. The message helps diagnosing such configuration problems.
2022-02-15 10:10:02 +01:00
Norman Feske
64af1d2d84 test/fs_packet: don't block
This patch takes precautions against the use of blocking packet-stream
operations like 'submit_packet'.

With the change of issue #4388, the ready-to-submit signals are no
longer implicitly handled. Hence, a call of submit_packet to a
saturated submit queue blocks infinitely.

Issue #4390
2022-02-15 10:10:02 +01:00
Norman Feske
7e3828b726 test/fs_packet: coding style 2022-02-15 10:10:02 +01:00
Norman Feske
11622fa038 file_system_session: merge ack and submit sigh
Fixes #4388
2022-02-15 10:10:02 +01:00
Christian Prochaska
2591c61e7d libusb: guard USB session packet allocator
Fixes #4389
2022-02-15 10:10:02 +01:00
Norman Feske
e98760a3d5 cpu_sampler.run: increase timeout
The previous timeout sometimes triggered with nova and foc on x86_32.
2022-02-15 10:10:02 +01:00
Norman Feske
ab0cba8ead base-hw: improve comments in kernel/interface.h 2022-02-15 10:10:02 +01:00
Norman Feske
90c446e565 base-hw: remove throw from ipc_reply_wait
Even though the use of the C++ exception mechanism (and the implicit use
of the cxx heap) is not a problem at the server side, this patch
nevertheless replaces the exception-based return-value handling to make
the code consistent with the ipc_call path.

Issue #3612
2022-02-15 10:10:02 +01:00
Norman Feske
3e4af3a567 base-hw: remove throw from ipc_call code path
This eliminates the dependency of the IPC-call operation from the cxx
heap.

Fixes #3612
2022-02-15 10:10:02 +01:00
Johannes Schlatow
0bb2e61e9e Allow derived classes of Genode::Array
genodelabs/genode#4382
2022-02-15 10:10:01 +01:00
Christian Helmuth
41a579e978 vbox6: fix warnings on disabled assertions 2022-02-15 10:10:01 +01:00
Sebastian Sumpf
299a35d943 libdrm/iris: check if VFS '<gpu/>' is present
On startup check if '/dev/gpu' is present and issue an error in case it
is not.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
cd4d00f31a gpu/intel: remove deadlock during session destruction
* use 'Id_space::apply_any' instead of 'for_each' to destroy session local
  buffer objects
* save session capability in session because 'cap()' is not valid in
  'Session_component' destructor because it was dissolved before calling
  'Root::_destruct_session', the cap is necessary to remove owned
  buffers from the EP

issue #4380
2022-02-15 10:10:01 +01:00
Stefan Kalkowski
7248957553 rpi_fb_drv: avoid alignment fault by own blit func
Fix #4331
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
4cb8c91b08 libdrm/iris: import GPU buffers lazy optimization
Do not import a freshly allocated buffer to all contexts eagerly.
Instead check buffer list in context's 'exec_buffer' call and import
only buffers needed and not present before GPU execution. This leads to
improved performance for applications that use many OpenGL contexts
(e.g., VirtualBox 6).

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
3c97fdbc0e libdrm/mesa/iris: Don't use Genode::Env any more
'vfs_gpu_env' handles this now for all applications.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
a3976f0468 vfs_gpu: offer 'vfs_gpu_env' call
* retrieve Genode::Env from plugin, this way no mesa applications need to
  be changed.
* add 'vfs_gpu' api
* remove when all required functionality is implemented within the plugin.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
b98e07ed34 vbox6: basic 3D support
Implement GLX and X functionality through Mesa's EGL interface. This
requires multiple OpenGL contexts and in turn GEM context support in
libdrm/iris, as implemented in libdrm and intel_gpu_drv.

Update recipes and machine.vbox6 files accordingly,

issue #4380
2022-02-15 10:10:01 +01:00
Christian Helmuth
27883c976c vbox6: 3D support skeleton
files required for VBox6's VMSVGA/VBoxSVGA with 3D accelaration
(accelerate3D="true").

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
c35d2aff45 libdrm/iris: add gem context support
Retrieve multiple GPU sessions from VFS plugin, take advantage of buffer
import/export functionallity in order to implement gem context support.
Multiple contexts share all GPU buffers, but use different GPU sessions
and thus, differnt page tables and hardware contexts.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
7cc1741611 gpu/intel: buffer import/export support
Implement the import/export functionality of GPU buffers.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
a900594978 gpu_session: add import/export of buffers
Add 'export_buffer'/'import_buffer' calls in order to support buffer
sharing between GPU sessions.

Reduce CAP costs for Gpu::Connection from 256 to 32.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
567b9dfa39 libdrm/iris: use VFS/GPU plugin
Synchronize GPU completion by calling 'read' of the vfs_gpu plugin. This
enables pthreads to wait for GPU completions instead of the main EP.

issue #4380
2022-02-15 10:10:01 +01:00
Sebastian Sumpf
b3e12dcece vfs_gpu: VFS plugin that handles GPU completions
When a <gpu> node is present in the VFS, the plugin opens a
Gpu::Connection for each open call to the 'gpu' node and installs a
completion signal handler. A read only to the fd returned only comes
back if a completion signal has been received between two read
transctions to the fd.

For now the Gpu::Connections can be retrieved by calling the
'vfs_gpu_connection(unsigned long id)' function. The id can be obtained
using 'stat' on the 'gpu' device and is located in the inode (st_ino)
field of the stat buffer.

issue #4380
2022-01-19 15:01:26 +01:00
Sebastian Sumpf
b7d25636e5 mesa_gpu-iris: iris is linked into mesa already
* remove from library dependency

issue #4380
2022-01-19 15:01:24 +01:00
Sebastian Sumpf
ce409a2438 libdrm/iris: map PPGTT buffers lazy + lseek
* let iris handle buffer management, this implies that BOs are mapped to
  the PPGTT during buffer execution and unmapped by iris later, for this
  to work buffers need to be unmapped when allocating cached BOs
  (vma_free) which requires a patch

* support lseek (drm_lseek for now) for determining object size

issue #4380
2022-01-19 15:01:22 +01:00
Sebastian Sumpf
96ab58691a gpu/intel: PPGTT allocation optimization
Use range allocator as cache for page mappings instead of allocating
from platform driver for each page table.

issue #4380
2022-01-19 15:01:19 +01:00
Josef Söntgen
94405e9280 libdrm/iris: remove tiling short-cut
Instead of ignoring the request, we store the tiling information and
apply them when the buffer is mapped via 'MMAP_GTT'.

issue #4380
2022-01-19 15:01:11 +01:00
Josef Söntgen
e77a54614d libdrm/iris: introduce session resource accounting
Track RAM and CAP resource usage locally and upgrade the session quota
on demand.

issue #4380
2022-01-19 15:01:05 +01:00
Josef Söntgen
83cc36ef0b gpu/intel: account session resources
Account RAM and CAP resources for GPU sessions and trigger client
upgrades before allocating resources at the multiplexer. This prevents
the multiplexer from running out of resources.

issue #4380
2022-01-19 15:00:47 +01:00
Alexander Boettcher
3a39cb86e9 nova: read out more accurate tsc frequency
on newer CPUs.

Fixes #4336
2022-01-19 14:16:53 +01:00
Martin Stein
94121e7cd7 uplink_client_base: no deref of invalid connection
Imagine receiving the signal for an available TX ack or an available RX packet
at the Uplink connection but a later received signal for a link-state change
(to link state "down") at the same connection is handled first and destructs
the Uplink connection before the handling of the former signals. In this case,
the methods 'Uplink_client_base::_conn_tx_handle_ack_avail' and
'Uplink_client_base::_conn_rx_handle_packet_avail' must be guarded against an
unconstructed '_conn' member, but they weren't so far.

Fixes #4384
2022-01-19 14:13:48 +01:00
Martin Stein
83626b18f0 uplink_client_base: remove unused code
So far, the generic Uplink connection code considered NIC drivers to transmit
connection RX packets in three different manners. Most of the drivers follow
the "normal" way of transmission with only one driver callback from generic
code. The monolithic USB NIC-driver, however, used to send in a "burst" mode
that required a dedicated path with multiple driver callbacks in the generic
code. And then there were drivers that had a fully custom function for doing
transmissions.

Also for handling connection TX acks, there was a "normal" and a
"custom handler" way.

Today, all NIC drivers in the Genode repos and the Genode-World repo follow the
"normal" way. Therefor, the unused code can be removed.

Ref #4384
2022-01-19 14:13:38 +01:00
Christian Helmuth
65284b29f8 depot: update recipe hashes 2022-01-19 12:38:13 +01:00
Christian Helmuth
36b46f30f5 Add board-specific allwinner repo to .gitignore 2022-01-19 12:38:13 +01:00
Norman Feske
388a29b299 Road map for 2022 2022-01-19 12:38:13 +01:00
Sebastian Sumpf
f16c1b5ea8 usb_host: handle full packet stream correctly
Thanks to Peter for the fix!

Fixes #4383
2022-01-19 12:38:13 +01:00
Christian Helmuth
a80b2ee6e2 Increase cap quota of drivers_nic-imx6/7 for sel4 2022-01-19 12:38:13 +01:00
Christian Helmuth
02eea3ecf0 More robust output parsing in ieee754 test
Only parse output of the test programs one-by-one and ignore log
messages from other components not starting with '[init -> test$number]'.

Fixes sporadic failures on KERNEL=sel4 due to the following warning from
core.

  Warning: flush page table entries - mapping cache full - PD: init -> test1
2022-01-19 12:38:13 +01:00
Christian Prochaska
d3adadf4cf virtualbox6: adapt watchdog timer interval dynamically
Issue #4381
2022-01-19 12:38:13 +01:00
Christian Prochaska
95d9c15607 libc vfs: open OSS 'info' file only once
Issue #4372
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
Christian Prochaska
8fd2847a48 Audio_out::Stream: initialize members
Issue #4373
2022-01-19 12:38:12 +01:00
Christian Helmuth
b7cf316f24 mesa: exclude .git directory from src archive 2022-01-19 12:38:12 +01:00
Christian Prochaska
2143bea176 virtualbox6: add 'Audio_in' session requirement to pkg
To actually receive audio input in a particular VM, it also
needs to be enabled in the vbox file:

<AudioAdapter controller="HDA" driver="OSS" enabled="true"
              enabledOut="true" enabledIn="true"/>

Fixes #4377
2022-01-19 12:38:12 +01:00
Christian Prochaska
3f656bcf84 black_hole: provide 'Audio_in' and 'Capture' sessions
Fixes #4376
2022-01-19 12:38:12 +01:00
Christian Prochaska
33402e407f vfs_oss improvements
Fixes #4375
2022-01-19 12:38:12 +01:00
Christian Helmuth
a1cac9b837 Fix warnings in test/audio_in 2022-01-19 12:38:12 +01:00
Christian Prochaska
7f8a94bb70 Audio_in::Stream: add 'queued()' function
Fixes #4374
2022-01-19 12:38:12 +01:00
Christian Prochaska
7b40ccea85 audio_in: fix compile errors with strict warnings enabled
Fixes #4373
2022-01-19 12:38:12 +01:00
Norman Feske
3ba316b015 base-hw: declare build artifact for core 2022-01-19 12:38:12 +01:00
Stefan Kalkowski
bed7f13008 create_builddir: add rpi and allwinner repos 2022-01-19 12:38:12 +01:00
Josef Söntgen
713c841965 vfs/rump: enable update mtime
Although support was added some time ago (#1784) the commit missed
executing the code from the 'Vfs::File_system' interface.

Fixes #4371.
2022-01-19 12:38:12 +01:00
Stefan Kalkowski
426f52068b hw: avoid 'cps' instruction in ARM hyp mode
On some boards or emulators a CPU might be executing in hyp mode
when entering Genode's bootstrap code. In that mode the 'cps' instruction
is not defined. Therefore, we change the way the boot cpu is identified.

Ref #3415
2022-01-19 12:38:12 +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
622ddb5b49 base-linux: declare build artifact for lib/ld
This enables the run tool's new [build_artifacts] function to return the
correct binary name for 'build lib/ld'.
2022-01-19 12:38:11 +01:00
Norman Feske
813731a1e0 base-linux: permit rt_sigreturn on 64-bit ARM 2022-01-19 12:38:11 +01:00
Norman Feske
ab9b75236d base-linux: remove residual use of 'which' command
This is a follow-up commit for "Remove dependency from 'which' utility".

Issue #4319
2022-01-19 12:38:11 +01:00
Sergey Platonov
ef130a027b libc: fix type handling on socket creation
The socket type (in the lower bits) maybe ORed with SOCK_CLOEXEC and
SOCK_NONBLOCK options (in the higher bits). Currently, supported values
are SOCK_STREAM (1) and SOCK_DGRAM (2), so just take the lower 2 bits.

This fixes treating `SOCK_STREAM` sockets as UDP if additional flags
were set.

Fixes #4370
2022-01-19 12:38:11 +01:00
Norman Feske
b723b11b30 Modularize Sculpt OS image creation
This patch equips Sculpt with the ability to customize the system image
in very flexible ways.

All customizable aspects of the image have been relocated from the
former sculpt.run script and the accompanied gems/run/sculpt/ directory
to a new location - the sculpt/ directory - which can exist in any
repository. The directory at repos/gems/sculpt/ serves as reference.

The sculpt directory can host any number of <name>-<board>.sculpt files,
each containing a list of ingredients to be incorporated into the
Sculpt system image. The <name> can be specified to the sculpt.run
script. E.g., the following command refers to the 'default-pc.sculpt'
file:

  make run/sculpt KERNEL=nova BOARD=pc SCULPT=default

If no 'SCULPT' argument is supplied, the value 'default' is used.

A .sculpt file refers to a selection of files found at various
subdirectries named after their respective purpose. In particular, There
exists a subdirectory for each file in Sculpt's config fs, like
nitpicker, drivers... The .sculpt file selects the alternative to use
by a simple tag-value notation.

  drivers: pc

The supported tags are as follows.

*Optional* selection of /config files. If not specified, those files are
omitted, which prompts Sculpt to manage those configurations
automatically or via the Leitzentrale GUI:

  fonts
  nic_router
  event_filter
  wifi
  runtime
  gpu_drv

Selection of mandatory /config files. If not specified, the respective
'default' alternative will be used.

  nitpicker
  deploy
  fb_drv
  clipboard
  drivers
  numlock_remap
  leitzentrale
  usb
  system
  ram_fs

Furthermore, the .sculpt file supports the optional selection of
supplemental content such as a set of launchers.

  launches: nano3d system_shell

Another type of content are the set of blessed pubkey/download files
used for installing and verifying software on target.

With the new version, it has become possible to supply a depot with the
the system image. The depot content is assembled according to the 'pkg'
attributes found in launcher files and the selected deploy config.
The resulting depot is incorporated into the system image as 'depot.tar'
archive. It can be supplied to the Sculpt system by mounting it into the
ram fs as done by the 'ram_fs/depot' configuration for the ram fs.

It is possible to add additional boot modules to the system image. There
are two options.

  build: <list of targets>

This tag prompts the sculpt.run script to build the specified targets
directly using the Genode build system and add the created artifacts
into the system image as boot modules.

  import: <list of depot src or pkg archives>

This tag instructs Sculpt to supply the specifid depot-archive content
as boot modules to the system image. This change eliminates the need for
board-specific pkg/sculpt-<board> archives. The board-specific
specializations can now be placed directly into the respective .sculpt
files by using 'import:'.

To make the use of Sculpt as testbed during development more convenient,
the log output of the drivers, leitzentrale, and runtime subsystems
can be redirected to core using the optional 'LOG=core' argument, e.g.,

  make run/sculpt KERNEL=linux BOARD=linux LOG=core

The former pkg/sculpt-installation and pkg/sculpt-installation-pc
archives have been replaced by pkg/sculpt_distribution-pc, which
references the generic pkg/sculpt_distribution archive. Those pkgs are
solely used for publishing / distribution purposes.

Fixes #4369
2022-01-19 12:38:11 +01:00
Norman Feske
fcc96a2c46 tool/run: way to obtain list of build artifacts
The new function 'build_artifacts' returns a list of artifacts created
by the Genode build system. The list can be supplied as argument to
the 'build_boot_image' function.

Note that the list covers only program targets and shared libraries.
Other artifacts created as side effects of custom rules are not covered.

Fixes #4368
2022-01-19 12:38:11 +01:00
Norman Feske
0eee5d5fc1 mk: record build artifacts in progress.log
Issue #4368
2022-01-19 12:38:11 +01:00
Norman Feske
93d431a831 tool/run: skip build if build-target list is empty
This patch prevents the run tool from issuing 'make' in the build
directory if no build targets are specified, which prompts the build
system to build everything.
2022-01-19 12:35:49 +01:00
Norman Feske
410cd9cfc4 run: avoid superfluous call of depot auto update
If only versioned archives are supplied to a depot function like
'create_tar_from_depot_binaries', the depot/create tool is called
with zero arguments, resulting in a help message. The patch detects
this case and skips the call.
2022-01-19 12:35:49 +01:00
Norman Feske
48f0307234 create_builddir: remove 'linux' option
Since unifying the build directories accross architectures, the special
case of the 'linux' platform is no longer needed. Linux can be targeted
from regular CPU-architecture-specific build directories via:

  KERNEL=linux BOARD=linux

Fixes #4366
2022-01-19 12:35:49 +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
Tomasz Gajewski
3bbe7d9d07 tool/depot/create: typo fix 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
Christian Helmuth
e6c5e5e8b9 dde_bsd: update mirror URL
OpenBSD 6.6 disappeared from fau.de, so we switch to ftp.openbsd.org.
2022-01-19 12:35:49 +01:00
Norman Feske
ce53d88235 sculpt: support base-linux
- Consider 'sdl' as source of input events in the event-filter
  configuration as generated by the sculpt manager

- Supply an artificial 'platform_info' ROM as requested by the
  sculpt manager to obtain the affinity-space information

- Substitute 'fs_rom' for 'cached_fs_rom' as a workaround for the
  lack of support for managed dataspaces on Linux

Fixes #4362
2022-01-19 12:35:49 +01:00
Norman Feske
fd105e16aa tool/run: add install_boot_module function
This function largely alleviates the need to manually open/close files
in run scripts such as sculpt.run.
2022-01-19 12:35:49 +01:00
Alexander Boettcher
46c9927294 foc: disable thread execution time readout
Issue #4357
2022-01-19 12:35:49 +01:00
Alexander Boettcher
4ac553e5ff cpu_balancer.run: disable testing on foc
Due to some kernel issue the test will not finish, see #4357

Fixes #4357
2022-01-19 12:35:49 +01:00
Norman Feske
f1b46c3205 Move depot keys to repos/gems/sculpt/depot
This change keeps the version-controlled 'pubkey' and 'download' files
separate from files generated via depot/create or downloaded via
depot/download. So one can remove the entire depot/ directory without
interfering with git.

Furthermore, depot keys can now be hosted in supplemental repositories
independent from Genode's main repository.

Fixes #4364
2022-01-19 12:35:49 +01:00
Norman Feske
03cbf435e5 base-linux: increase global cap limit to 20000
This is a prerequisite for executing sculpt.run on Linux.

Issue #4362
2022-01-19 12:35:49 +01:00
Norman Feske
2134792e4c tool: remove obsolete download_sigver/hashver
Those scripts are a left-over from the time before the introduction of
the tool/ports mechanism.
2022-01-19 12:35:49 +01:00
Christian Prochaska
5fed1641a4 virtualbox6: reduce 'Vm_connection' priority
Fixes #4361
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
f2dab083f6 os: Properly initialize File_system::Watch_handle.
This comes up when building the code with clang 13. It happens due to
recently enabled Wconversion warning, which in case of clang also
enables implicit-int-conversion warning. The warning reads:

  fs_file_system.h:937:44: error: higher order bits are zeroes after
  implicit conversion [-Werror,-Wimplicit-int-conversion]
                        ::File_system::Watch_handle fs_handle { -1U };
                                                    ~~~~~~~~~   ^~~

This can be fixed by properly specifying fs_handle value to be of
unsigned long type.

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
Alexander Boettcher
507e5ac776 vmm_x86: fix sporadic test failures on x86_32 nova
Explicitly configure wanted exits instead of using the "random" primary
ctrl value.
2022-01-19 12:35:48 +01:00
Sergey Platonov
81acd46518 libc: nameserver file in configured socket directory
The path for the `nameserver` file was fixed to `/socket/nameserver`.
So, if the socket directory was configured differing from `/socket`, DNS
did not work. Now the default path for the `nameserver` takes into
account the path configured in the `socket` libc config attribute.

Fixes #4318
Fixes #4343
2022-01-19 12:35:48 +01:00
Johannes Schlatow
2e1a1c199e lwip plugin: support large backlog values
iperf, e.g., uses INT_MAX as backlog argument to the listen() call

Fixes genodelabs/genode#4341
2022-01-19 12:35:48 +01:00
Sebastian Sumpf
79e69a5549 nic_loopback: Adjust to packet allocator changes
Remove '_expected_offset' check on round trip test from RX packet,
because allocators between RX/TX can have different allocation
strategies. Rely on 'pattern' check for RX packets only.

In loopback server alloc size must match actual packet size.

issue #4312
2022-01-19 12:35:48 +01:00
Josef Söntgen
94a7c32fb4 libports: remove FUSE fs run script snippet
This file is only needed by the FUSE-based file system servers in
the world repository.

Fixes #4353.
2022-01-19 12:35:48 +01:00
Christian Helmuth
18e00c7772 depot_autopilot: enable riscv 2022-01-19 12:35:48 +01:00
Sebastian Sumpf
08c1e69d71 nic/packet_allocator: align allocations to 2 bytes
Override 'try_alloc/free' because ethernet frame headers are 14 bytes
(src/dst mac (12) + ethertype (2)) causing the IP header to be 2 byte
aligned, leading to problems on platforms that require load/store
operations to be naturally aligned when reading, for example, 4 byte IP
addresses. Therefore, we align the allocation to 2 bytes, so the IP
header is aligned to 4.

issue #4312
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
d658648a09 test/block_cache: tweak RAM quota for base-nova 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
Christian Helmuth
e21ca736b8 fetchurl: remove duplicate from used_apis in recipe 2021-12-17 15:06:38 +01:00
Christian Helmuth
a80a22c819 recipes: don't declare implemented API in used_apis
Prevents "*** detected duplicates in REPOSITORIES" on recipe build.
2021-12-17 15:06:38 +01:00
Norman Feske
4f820cf1e5 prepare_ports: prevent execution of automake
This patch discharges the dependency of Makefile.in from Makefile.am
files whenever both files are present in a downloaded archive.

Being based on make, the trigger of running automake is based on the
timestamps for the extracted archive content. However, since we reset
the timestamps (via 'tar -m') at extraction time, no assumptions about
the timestamp relations between the extracted files can be made. In the
event automake is triggered, we are faced with the tool dependency from
a specific automake version on the host.

The patch enforces the unconditional use the 'Makefile.in' version
supplied by the archive.

Fixes #4350
2021-12-17 15:04:49 +01:00
Christian Helmuth
c8a3497662 build: detect duplicates in REPOSITORIES 2021-12-17 15:04:49 +01:00
Sebastian Sumpf
7dcd9a9f8d vfs_trace: remove Trace::Session::subject_info
issue #4349
2021-12-17 15:04:49 +01:00
Norman Feske
d370f56a77 Remove obsolete Trace::Session::subject_info RPC
Issue #3610
Fixes #4349
2021-12-17 15:04:49 +01:00
Sebastian Sumpf
43da93bb6f noux: add RISC-V gnu build support
issue #4312
2021-12-17 15:04:49 +01:00
Stefan Kalkowski
6dbdb966fc virtio: remove bitfield in Index template
Eliminates note of GCC about bitfield as parameter semantic change.

Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
609af0037f liblzma: silent some warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
f6dd1c96f6 libdrm: silent warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
793a667872 gmp: silent warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
1779cc7a2f freetype: silent some warnings
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
86df5b1285 jitterentropy: fix if condition, fix warning
Ref #4344
2021-12-17 15:04:48 +01:00
Stefan Kalkowski
f5193874c8 e2fsprogs: eliminate warnings, fix strncat bug
Ref #4344
2021-12-17 15:04:48 +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
Stefan Kalkowski
b11731d6b2 dde_linux: silent warning in fork
When initializing a task_struct within the lx_emul library
we have to temporarily use a big object on the stack.

Ref #4344
2021-12-17 15:04:48 +01:00
Josef Söntgen
f9e0548d0c sculpt_manager: integrate GPU device access
Similar to other devices allow for selecting a graphics device as
well. This is currently only useful on iMX8-based systems like
iMX8Q-EVK and MNT Reform2 where the driver is explicitly started
from a pkg.

Fixes #4342.
2021-12-17 15:04:48 +01:00
Piotr Tworek
1a9fad4022 virtio_nic: Tweak default buffer sizes.
After VirtIO::Queue refactoring buffers no longer share the same
dataspace as VirtIO rings. This makes optimal buffer calculations a lot
easier. In this case 64 buffers 2kB each will need precisely 128kB of
RAM. Previous value of 2016 will just waste 768b.

Fixed #4347
2021-12-17 15:04:48 +01:00
Piotr Tworek
643747b912 os: Refactor VirtIO::Queue implementation.
The key changes in this patch are:
* Buffer allocation is moved into a separate Buffer_pool helper. The
  implementation of the buffer allocation strategy does not change.
  The helper allocates a single RAM dataspace and splits it in multiple,
  equally sized chunks.
* Management of main descriptor ring is enacapsulated in Descriptor_ring
  helper class.
* Use separate RAM dataspaces for descriptor rings and buffers.
  Previously both of them were packed into a single dataspace. This
  might have been more RAM efficient, but IMO it made the code uglier and
  harder to understand.
* All of the VirtIO::Queue members are now initialized on the class member
  initializer list. This is possible due to previously listed changes.
* Since all VirtIO::Queue members are initalized on member initalizer
  list, some additional ones can be marked as const, ex _avail, _used ring
  pointers.
* Move descriptor writing code into a common method used by both
  write_data and write_data_read_reply members. This avoids some code
  duplication between those methods.
* Get rid of request_irq argument that most public VirtIO::Queue methods
  accept. None of the existing drivers use it and I doubt this will
  change any time soon.
* Use Genode namespace by default in Virtio.

This patch also fixes at least one bug that I discovered while working
on VirtIO block device driver. Namely, when chaining descriptors only the
first descriptor in the chain should be exposed in the available ring.

Issue #4347
2021-12-17 15:04:48 +01:00
Norman Feske
aaf9e992da run: remove residual use of 'which' command
This is a follow-up commit for "Remove dependency from 'which' utility".

Thanks to John Karcher for reporting.

Fixes #4319
2021-12-17 15:04:48 +01:00
Christian Helmuth
e4ee30abf1 Add board-specific repos to .gitignore 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
Sebastian Sumpf
0fc2db50f0 ieee754: add test for riscv
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
ee5d300f72 stdcxx: riscv support
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
a4d67c3262 libm: riscv support
issue #4312
2021-12-17 15:04:47 +01:00
Sebastian Sumpf
7c976a83e0 libc: riscv support
libc-gen, libc-setjmp, task startup

issue #4312
2021-12-17 15:04:47 +01:00
Norman Feske
890842dce2 base-hw/lib/mk/spec/cortex_a8/core-hw.inc (usb_armory) 2021-12-17 15:04:47 +01:00
Norman Feske
63f78b6255 ports: avoid implicit conversions
Issue #23
2021-12-17 15:04:47 +01:00
Norman Feske
dea467f692 libports: avoid implicit conversions
Issue #23
2021-12-17 15:04:47 +01:00
Norman Feske
8a1675e12e gems: avoid implicit conversions
Issue #23
2021-12-17 15:04:46 +01:00
Norman Feske
5bd8fa9678 dde_linux: avoid implicit conversions
Issue #23
2021-12-17 15:04:45 +01:00
Norman Feske
1aa4f29300 demo: avoid implicit conversions
Issue #23
2021-12-17 15:04:45 +01:00
Norman Feske
04cf6ea3ab os: avoid implicit conversions
Issue #23
2021-12-17 15:04:45 +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
Johannes Schlatow
b1bbd72e84 net: fix tail size calculation in Ethernet_frame
The const-variant of the data() method contained an erroneous
calculation of the tail size. This led to the size guard throwing
exceptions when trying to parse TCP packets that only contained the
TCP header.

Fixes genodelabs/genode#4340
2021-12-17 15:04:43 +01:00
Norman Feske
162ddb1fdb virtio: fix len calculation
Thanks to Piotr Tworek for the fix and his explanation as follows:

The basic idea is to try to fit payload data into the descriptor used to
send the header. If there is no payload, or the payload fits exactly
into the remaining space in the header decriptor, len should be 0 and
only one descriptor should be used. In such case the "next" and "flags"
members of the descriptor structure should be set to 0.

In case there is some extra payload data to send, but its size is
bigger than the remaining free space in the descriptor used to send the
header, len should contain the remaining size of the payload that
can't be sent via the header descriptor. The code will then chain
additional descriptors to handle this remainder.

With the len variable shadowing, the code will never queue the remaining
data.

Issue #4327
2021-12-17 15:04:43 +01:00
Stefan Kalkowski
6cc6047962 platform_drv: introduce clocks, power, reset
Share datastructures for clock, power and reset related configurations
per device. In the generic platform driver component these structures
are kept empty. Driver derivates can fill the clocks settings, power and
reset switches with life. The former Driver::Env gets removed.

Fix #4338
2021-12-17 15:04:39 +01:00
Stefan Kalkowski
f11d2b5b54 autopilot: automated stress test for platform_drv
Fix #4330
2021-12-17 14:56:53 +01:00
Stefan Kalkowski
132e4fe815 platform_drv(arm): robust re-configuration support
This change of the inner working of the platform driver for ARM allows
clients to have permanent open sessions, as long as a policy node matches
the client. If devices disappear from the policy resp. from the set of
available devices (hotplug), the devices ROM of the session gets updated,
and a corresponding device session gets closed. If the device remains
untouched in the configuration but other devices appeared/disappeared, the
device session is not affected.

Ref #4330
2021-12-17 14:56:46 +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
4188427596 version: 21.11 2021-11-30 14:34:09 +01:00
Norman Feske
ea6f90ec17 News item for version 21.11 2021-11-30 14:32:17 +01:00
Norman Feske
c528cd7819 Release notes for version 21.11 2021-11-30 14:32:17 +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
7eb3da71b5 base-hw: check managing_system property for SMC
* When issuing a secure-monitor-call on behalf of a PD session client
  first check the permission via the 'managing_system' property.

Fix #4321
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
916683b6d6 platform_drv(arm): fix cap and memory leaks
* Track all caps and ram quotas of the sub-sessions properly
* Release DMA buffers, it is not done implicitely when destroying
  the Constrained_ram_allocator
* Do not replenish quota before really releasing memory from
  the allocator

Issue #4330
2021-11-29 15:11:53 +01:00
Johannes Schlatow
e256969489 platform_drv(arm): fix destruction order
The Session_component must be destroyed before updating the device
model because the Session_component must also release all previously
acquired devices. If the device model is updated before, the devices
might have been removed.

Issue #4330
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
Alexander Boettcher
45cebd774d cpu_balancer: avoid dynamic policy allocation
Pre-allocate all possible type of policy objects as part of the thread meta
state to avoid increased memory consumption due to different policy object
sizes. The cpu_balancer accounts the memory per client and can't forward
potentially occurring out-of-ram exceptions during config-ROM update phases.

Fixes #4333
2021-11-29 15:11:53 +01:00
Alexander Boettcher
1f58b05255 cpu_balancer: limit mem increase on config update
The commits avoids reading in and allocating memory for all potentially
threads, which are potentially currently not existent (but configured in the
policy beforehand). Instead the policy is read in and evaluated when a thread
is created and policy changes are solely applied to existing/running threads.
By this the commit avoids the increase of memory consumption during the
evaluation of policies during config ROM updates.

Issue #4333
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
Piotr Tworek
7c1888644a os: Add VirtIO framebuffer driver.
This implements the necessary bits to provide 2D framebuffer support on
top of VirtIO GPU device as implemented in Qemu. I don't know if any
other implementation of this specific device exists.

Compared to the ramfb driver which already exists in Genode Virtio FB driver
has one major benefit. It allows Qemu window to be dynamically resized at
runtime. The driver will treat this as resolution change and act accordingly.
Ramfb driver can currently only use the hardcoded 1024x768 screen size. Changing
screen resolution might not sound like a big deal, but it is rather useful to
run Genode on Qemu in full screen mode.
2021-11-29 15:11:53 +01:00
Piotr Tworek
2ec9e69fd4 os: Add support for reading VirtIO responses.
Some more advanced devices like VirtIO GPU do expect they can receive
responses to VirtIO commands they issue via VirtIO queue. Such responses
are not sent via a separate device writeable queue. Instead the driver
is expected to queue some additional descriptors and buffers which the
device can then use to provide the reply.

This patch adds support for such write-data-read-response opeartion to
Genode VirtIO::Queue implementation. The implementation is pretty simple
and does not support any fancy features like receiving the response
asynchronously. Instead the operation will use caller provided callback
to wait for the device to process the command. Once this callback
returns the write-data-read-response VirtIO::Queue function will invoke
another callback passing received response as argument.
2021-11-29 15:11:53 +01:00
Christian Helmuth
0bb0ac079a sculpt: version 21.11 2021-11-29 15:11:53 +01:00
Josef Söntgen
fcc236d906 libports: add mesa_gpu-etnaviv recipe
Similar to the existing 'mesa_gpu' pkgs add one for 'etnaviv'
as well.

Issue #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
17da7c88d0 import-libdrm: fix building etnaviv as recipe
Make sure all needed headers are found when building via depot.

Issue #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
4d93187d31 libdrm: introduce Gpu session for etnaviv
* The Gpu session back end translates all DRM API requests of the
  client into matching Gpu session operations.

* Enable ioctl for etnaviv

Fixes #4329.
2021-11-29 15:11:53 +01:00
Josef Söntgen
645e51dc1d gpu: add information for etnaviv driver
Mesa queries information about the underlying device and this header
denotes the layout of the information. It is also used by the driver
itself to populate the 'info_dataspace'.

Issue #4329.
2021-11-29 15:11:52 +01:00
Josef Söntgen
8155505b41 mesa/etnaviv: guard unmapImage call
We may call this function only in case mapImage was successful.

Issue #4329.
2021-11-29 15:11:52 +01:00
Josef Söntgen
d39af2206c mesa_gpu-etnaviv: etnaviv already part of mesa
Since the parts of the 'etnaviv' library are already part of the
'mesa.lib.so' that is normally loaded along-side remove the
duplication here.

Issue #4329.
2021-11-29 15:11:52 +01:00
Norman Feske
133d21ad38 event_filter: add touch-click filter
This filter bridges the gap between a touchscreen driver, which
generates raw touch events and traditional GUI applications that expect
a pointer (absolute motion, press/release of the left mouse button).

Fixes #4332
2021-11-29 15:11:52 +01:00
Norman Feske
09d020508c depot: recipes for pin-control/state session APIs
Issue #4315
2021-11-29 15:11:52 +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
Christian Helmuth
9591e6caee vbox6: CPU halt/wakeup via RTSEMEVENTMULTI
The former use of Pthread conditionals did not cover the corner case of
early wakeups just before halting the CPU. These wakeups were simply
lost which resulted in sporadic halts of about 500 ms (the maximum timeout
of all halts in VirtualBox). RTSEMEVENTMULTI preserves early wakeups
and effectively prevents the CPU from halting.

Additionally, we now wakeup the target CPU on VMMR0_DO_GVMM_SCHED_POLL
and, thus, mimic the behavior of the original implementation slightly
better,

Slightly related to #4313
2021-11-29 15:10:53 +01:00
Johannes Schlatow
a65807ff08 rom_filter: optionally skip top-level node
Since the top-level node of the output ROM is always generated by the
rom_filter, there is no way to pass-through the content of an input ROM
without wrapping in an addition XML node.

genodelabs/genode#4326
2021-11-29 15:10:53 +01:00
Josef Söntgen
059c7ed74a dde_linux: prevent debug message in memory backend
The Allocator_avl back end will display diagnostic messages if the
address to be freed is not at the beginning of a block. This happens
regulary when 'struct page' objects are not freed in allocation order.

Issue #4325.
2021-11-29 15:10:53 +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
Josef Söntgen
49bf58a2ae lx_kit: free dataspace interface
Allow for freeing of manually managed dataspaces.

Fixes #4325.
2021-11-29 15:10:53 +01:00
Josef Söntgen
327ec61ee3 lx_kit: get buffer dataspace from virt addr
Introduce a method to access the dataspace capability of the underlying
backing store for a memory allocation. This is necessary for drivers
where the memory is managed manually and the capability needs to be
given to a client.

Issue #4325.
2021-11-29 15:10:53 +01:00
Josef Söntgen
cd7a65a313 dde_linux: extended pgtable header for etnaviv
The 'pgprot_noncached' function is referenced by the driver code.

Issue #4325.
2021-11-29 15:10:53 +01:00
Stefan Kalkowski
23514bf5c2 dde_linux: add runqueues symbol for -O0 build 2021-11-29 15:10:53 +01:00
Christian Helmuth
974627f700 vbox6: adapt to GUI framebuffer size on startup
Explicitly, adapt to current framebuffer/window size after
initialization finished. This ensures the use of the correct framebuffer
dimensions in scenarios without a window manager.

Thanks to Raphael for the patch.
2021-11-29 15:10:53 +01:00
Norman Feske
3b456e0037 test/resource_request: ignore spurious requests
This patch makes the test less dependent on the rate of state updates by
calculating the upgraded quota from the values found in the state report
instead of simply increasing the '_ram_quota' for each incoming report.
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
293d545b97 sandbox: use Genode::update_list_model_from_xml
This patch replaces the former local implementation by the function
provided in 'util/list_model.h'.

Issue #4317
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
Norman Feske
449f647e58 dde_linux: lx_emul interface for GPIO pin access
This patch introduces the lx_emul/pin.h interface that enables GPIO stub
drivers to interact with Genode's Pin_control and IRQ sessions via a
simple C API.

Fixes #4316
2021-11-29 15:10:52 +01:00
Norman Feske
f2a627c107 os: Pin_control and Pin_state session interfaces
The new interfaces are meant to gradually replace the existing
Gpio_session interface.

- Each session refers to a single pin.
- The session types distiguish the direction of the signal as input or
  output.
- Pin coordinates can be selected via session labels.
- GPIO interrupts are covered by the regular IRQ session interface.

The interfaces are accompanied by framework utilities and interfaces:

- os/pin_driver.h
- pin_control_session/component.h
- pin_state_session/component.h

These headers relieve GPIO drivers from implementing boilerplate code by
providing device-agnostic portions. The A64 pio driver serves as
reference for using those utilities.

  https://github.com/nfeske/genode-allwinner/tree/master/src/drivers/pin/a64

Fixes #4315
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
Johannes Schlatow
c0c2ed2bf5 tool/run: make qemu RAM sanity check more robust
First, the former implementation has only considered the pure numerical
variant of the -m argument. Yet, qemu also allows specifying the amount
of memory by `-m 1G`, `-m size=1G` and more.

Second, the default amount of memory for BOARD=pc was 512M (800M in case of okl4).
Since the depot_autopilot.run also required at least 768M on all
platforms it seems reasonable to take 800M as a default value for BOARD=pc and
thereby remove the special treatment of okl4.

genodelabs/genode#4311
2021-11-29 15:10:52 +01:00
Alexander Boettcher
c774272366 vbox5/6: set ia32_tsc_aux for rdtscp usage
Fixes #4314
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
Alexander Boettcher
f4e52863c0 vbox6: exit on rdtsc and rdtscp (intel)
Otherwise Windows 10 shows 50 Ghz frequency in task manager and other
strange things may happen.

Issue #1769
Issue #4314
Fixes #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
7a06633173 nova: FPU handling for vCPUs in VM session
- request FPU state on VM exit in portal config

- transfer FPU state on VM entry

- save fpu state early

  Avoid any FPU instructions (for example during base API calls), which
  use the FPU and overwrite FPU registers holding the guest vCPU FPU
  state.

- don't save fpu state of EP

Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
1a79bf2be2 vbox6: avoid race for NEM state checking
The commit avoids the race between checking for the NEM state and the decision
to notify (poke) the NEM backend (nem.cc).

- ever notify about POKE flag for remote vCPU
- check synchronized for NEM state
- store recheck flag and apply on next switch_to_hw

Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
3701733c8f vbox6: add POKE calls in TM for remote vCPUs
and return to VMM if TM_TIMER flag is set

Issue #4313
2021-11-29 15:10:52 +01:00
Christian Helmuth
5a21431c31 vbox6: check for pending IRQs in sup_vcpu
Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
00eadf9791 vbox6: adjust TPR handling according to HMVMXR0
Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
33bf926b50 vbox6: add SIPI patch improving vCPU startup
Issue #4313
2021-11-29 15:10:52 +01:00
Alexander Boettcher
4798ffd055 vbox6: initialize more vcpu state in sup_vm.cc
Issue #4313
2021-11-29 15:10:51 +01:00
Christian Helmuth
228d1c27b7 vbox6: fix npt_ept fault calculation
Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
68878ca98a vbox6: implement SUPSemEventMulti*() functions
Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
28db5cadee vbox5: generic - discharge by default
intr_state and actv_state are now charged only if required and with
valid values.

Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
8d5903cba9 vbox6: avoid unintended state transfer on hw enter
intr_state and actv_state are now charged only if required and with
valid values.

Issue #4313
2021-11-29 15:10:51 +01:00
Alexander Boettcher
74a8a801e4 nova: report vCPU prio & quantum in trace conn
Issue #4313
2021-11-29 15:10:51 +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
Josef Söntgen
6ecae6adb3 qemu-usb: increase USB2/3 root ports to 8 each
In the default setting the number of root ports is set to 4. This
also limits the number of USB host devices that may be attached to
the VM. Since the USB webcam shares the slots, that leaves us with
only 3 available USB2 slots to attach USB host devices. Depending on
the use-case that might not be enough.

This commit statically increases the number of ports to 8 each and
adapts the qemu-usb glue-code accordingly.

Many thanks to Raphael for initial investigation and workaround.

Fixes #4310.
2021-11-29 15:10:51 +01:00
Stefan Kalkowski
6d991313b1 nvme_drv: get I/O resources from platform API only
Do not use the I/O memory service from core directly,
but instead use the I/O resources the platform session
provides to the driver anyway.

Fix #4309
2021-11-29 15:10:51 +01:00
Stefan Kalkowski
43ef9b5a3a platform_drv: do not account IOMEM as ram quota
Accidentally, the size of IOMEM dataspace got accounted within the
implementation of the platform driver for ARM. Instead we should
only account a bit for the metadata and paging of the I/O memory.

Fix #4307
2021-11-29 15:10:51 +01:00
Johannes Schlatow
87bb81cd66 nic: add _custom_conn_tx_ack_avail_handler()
The custom ack avail handler is required for zero-copy nic drivers (e.g.
the zynq nic driver), which must release the corresponding DMA buffers.

Fixes genodelabs/genode#4277
2021-11-29 15:10:51 +01:00
Tomasz Gajewski
332cfb38c1 usb_host: fix MMU fault on rpi2 and rpi3 2021-11-29 15:10:51 +01:00
Norman Feske
275479867d window_layouter: handle decorator margins at start
This patch adds a missing call of '_handle_decorator_margins' at
construction time. Up to commit "report_rom: versioning and explicit
notification" this problem was masked by an unconditional signal, which
implicitely triggered the call.

Issue #4274
Fixes #4306
2021-11-29 15:10:51 +01:00
Piotr Tworek
4f1e9fd256 os: Use VirtIO input drivers for virt_qemu.
This makes Genode's interactive test scenarios run on virt_qemu board
actually interactive.

Issue #4282
2021-11-29 15:10:51 +01:00
Piotr Tworek
80d11ca751 tool: Add keyboard and mouse devices to virt_qemu.
Now that we have appropriate native driver for them add keyboard and
mouse devices to virt_qemu machine. Make sure qemu exposes those new
devices in modern, VirtIO 1.0 mode. At leasts qemu 5.1.0 still uses
pre 1.0 mode in default setup.

Issue #4282
2021-11-29 15:10:51 +01:00
Piotr Tworek
60f1a1a554 os: Add VirtIO input driver.
This component can service Qemu VirtIO mouse, keyboard and tablet
devices. The implementation is based on VirtIO 1.1 device spec. Its
described in section 5.8 "Input Device".

Issue #4282
2021-11-29 15:10:51 +01:00
Josef Söntgen
851d96de8a Fix misleading DosBox snippet in porting-guide
The included 'target.mk' snippet of DosBox suggests to use the contrib
source directory directly to reference source files.

Fixes #4305.
2021-11-29 15:10:50 +01:00
Tomasz Gajewski
ecb1a6187c ssh_terminal: moved to genode world
Fixes #4258
2021-11-29 15:10:50 +01:00
Sebastian Sumpf
d4a6342295 tool_chain: remove Go support from bootstrap compiler
Fixes #4292
2021-11-29 15:10:50 +01:00
Piotr Tworek
a10903a197 libm: fix undefined __isinff / __isinfl symbol references
Those symbols are not satisfied by any code or dependency of libm. As
result calling cprojf function will always crash on Genode. This crash
can be turned into link time error by adding --no-undefined to LD_OPT.

This patch provides the missing symbols by including isninf.c in libm
build.

Fixes #4299
2021-11-29 15:10:50 +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
42ff902576 vbox6: settings version 1.18-genode in machine.vbox6
At least the audio backend depends on the correct .vbox settings version
for VirtualBox 6.1 which is 1.18 as of VirtualBox.xidl.
2021-10-15 12:17:05 +02:00
Norman Feske
7e2716800b News item for Sculpt 21.10 2021-10-14 14:40:08 +02:00
Christian Helmuth
abc9a2f232 depot: update recipe hashes 2021-10-14 13:46:25 +02:00
Norman Feske
0a35e02961 sculpt: documentation update
Issue #4281
2021-10-14 13:22:18 +02:00
Christian Helmuth
98ffa60577 Increase cap quota for system-shell terminal 2021-10-14 11:48:23 +02:00
Josef Söntgen
9980718c92 libyuv: build unoptimized on ARMv8 2021-10-14 11:46:42 +02:00
Josef Söntgen
2e0d9c8521 libdrm: short-cut tiling in iris back end
Apparently the iris driver does not make use of tiling by the kernel, so
we shortcut the 'SET_TILING' call to keep iris happy with this quickfix.

However, tiling information may get lost, if the iris driver ever calls
'MMAP_GTT' and no fence is configured for the buffer. A follow-up commit
should address this shortcoming in the future.

Issue #4284
2021-10-14 11:40:39 +02:00
Norman Feske
31567c8e46 sculpt: curate default index / installation
- CPU-architecture annotations
- Change order of top-level menu, moving Mesa driver to the end
- Add black_hole, recall_fs, file_fault
- Add usb_webcam, test-capture
- Add audio driver and mixer
- Add vbox6, keeping vbox5-nova-sculpt as fallback
- Remove recall_fs launcher, which is obsolete with the recall_fs pkg
- Replace system_clock by system_clock-pc pkg

Issue #4281
2021-10-14 11:02:18 +02:00
Norman Feske
006e807103 sculpt: version 21.10 2021-10-14 11:02:18 +02:00
Norman Feske
4dac2fd008 sculpt: increase RAM of leitzentrale nitpicker
This follow-up commit to "sculpt: avoid flickering of leitzentrale"
allows nitpicker to double-buffer pixels during resize operation on a
screen size of 1920x1200.
2021-10-14 11:02:17 +02:00
Norman Feske
68e8d1fd21 cached_fs_rom: remove diagnostic message
The message "defer transfer..." spams the log on Sculpt OS.

Issue #4281
2021-10-14 11:02:17 +02:00
Norman Feske
6a89f8b19e wm: fix key_cnt consistency glitch
This patch presents all press and release events to the pointer state,
fixing the problem that _key_cnt was decreased but never increased.
However, the inconsistency had no observable effects in practice.

Issue #4176
2021-10-14 11:02:17 +02:00
Norman Feske
ee463b21ae nitpicker: fix interplay of hover with dragging
This patch extends the notion of having only one uniquely hovered client
in the presence of held keys.

If motion occurs once a key is pressed (e.g., while dragging), the
receiver of the key sequence observes the motion events. In this case,
we have to submit an artificial leave event to the originally hovered
client so that no more than one client observes itself as being hovered
at the same time. Once the key sequence is finished, the hovering is
updated again, eventually presenting a motion event to the originally
hovered client and a leave event to the receiver of the key sequence.

Issue #4176
2021-10-14 11:02:17 +02:00
Norman Feske
1088035f8e wm: defer pointer report update
This patch ensures that the pointer report is updated not before all
input events are handled. The change does not solve any observed
practical issue but the potential problem was spotted while reviewing
the code.

Issue #4176
2021-10-14 11:02:17 +02:00
Christian Helmuth
b2ff2a2950 vbox6: configure OSS plugin only once (as /dev/dsp) 2021-10-14 11:02:16 +02:00
Stefan Kalkowski
c976a1d7e0 dde_linux: iterate over device names not types
To clearly identify the correct device use the unique device's name
not the type. Otherwise a driver cannot drive several devices of the
same type.

Fix #4297
2021-10-14 11:02:15 +02:00
Stefan Kalkowski
98400a68c9 os: extend ARM Platform::Device constructor
Enable construction by explicitely naming a specific device,
if more than one device of the same type exist.

Ref #4297
2021-10-14 11:02:15 +02:00
Josef Söntgen
8679f32d0b dde_linux: backport update event ring for usb_host
This commit contains a backport of commit [1] that deals with updating
the event ring dequeue pointer more often to prevent unnecessary
'Event Ring Full' errors.

  [1] 'usb: host: xhci: update event ring dequeue pointer on purpose'
      (dc0ffbea5729a3abafa577ebfce87f18b79e294b)

Fixes #4296.
2021-10-14 11:02:15 +02:00
Stefan Kalkowski
1d1379430a genode_c_api: safeguard session-policy parsing
Fix #4294
2021-10-14 11:02:15 +02:00
Stefan Kalkowski
b7a379546e genode_c_api: delay USB service announcement
Ref #4294
2021-10-14 11:02:14 +02:00
Stefan Kalkowski
873eb687b0 genode_c_api: reduce USB session ram requirements
Ref #4294
2021-10-14 11:02:14 +02:00
Stefan Kalkowski
1508fdc276 usb_block_drv: handle USB state at startup
Fix #4293
2021-10-14 11:02:14 +02:00
Sebastian Sumpf
c79cdc7b39 gpu/intel: use managed dataspace for aperture mappings
Use 'Region_map_client' for aperture mappings through the GGTT instead
of 'Io_mem_connections'.

issue #4284
2021-10-14 11:02:14 +02:00
Norman Feske
440debfc39 depot_query: filter index by CPU architecture
This patch changes the depot_query tool to filter the returned index
data depending on the 'arch' as specified for the query. This way, one
index file can support multiple CPU architectures while allowing
individual entries to be architecture-specific.

Fixes #4295
2021-10-14 11:02:14 +02:00
Norman Feske
28a71f4a73 cpu_balancer.run: adjust caps for sel4/x86_64 2021-10-14 11:02:14 +02:00
Christian Helmuth
4fd2c9c618 libuvc: exclude .git directory from src archive 2021-10-14 11:02:13 +02:00
Norman Feske
96997ead62 sculpt: fix warning during prepare step
This patch adds the missing definition of 'prio_levels' in the prepare
sub init, fixing the warning:

  [init -> runtime -> prepare] Warning: vfs: invalid priority, upgrading from -2 to 0

Issue #4281
2021-10-14 11:02:13 +02:00
Norman Feske
a12168e1bb pkg/mesa_gears: display frames per second 2021-10-14 11:02:13 +02:00
Sebastian Sumpf
d1461f6a72 vbox6: machine power-down support
Use 'StateChange' event to check for machine's 'PowerOff' state, close
Gui connections and submit exit signal to EP which in turns calls exit.

Fixes #4291
2021-10-14 11:02:13 +02:00
Christian Helmuth
c7abc9f983 vbox6: add pkg with webcam capture support
Issue #4281
Issue #4287
2021-10-14 11:02:13 +02:00
Christian Helmuth
d078f7db76 qemu-usb: adapt to webcam capture on/off changes
Issue #4287
2021-10-14 11:02:13 +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
Christian Prochaska
d5d7915b4d audio_in: fix compile errors when strict warnings are enabled
Fixes #4290
2021-10-14 11:02:11 +02:00
Christian Prochaska
b337ee2f2b vfs_oss: fix output fragment limit calculations
Fixes #4289
2021-10-14 11:02:11 +02:00
Johannes Schlatow
ef8a43c546 base-hw: cache maintenance
touch each page before flushing to ensure that it's present in the page table

genodelabs/genode#4279
2021-10-14 11:02:10 +02:00
Sebastian Sumpf
350353885e vbox6: add shared folder support
builds virtualbox6-sharedfolders.lib.so from unmodified VirtualBox6
sources.

fixes #4288
2021-10-14 11:02:10 +02:00
Norman Feske
eb80d6ce66 usb_webcam: on/off dependent on capture client
This commit removes the report service from the usb_webcam pkg, which
was used to enable or disable the webcam driver. The on/off state is
instead controlled by the presence of a capture client. That is, once a
capture client appears, the webcam driver is started. Vice versa, once
no capture client exists, the webcam driver is removed automatically.

Internally, the detection of presence of a capture client is based on
nitpicker's 'displays' report, which is consumed as input of the
rom_filter, which in turn generates the configuration of a dynamic sub
init.

Fixes #4287
2021-10-14 11:02:10 +02:00
Norman Feske
bc5a7eb495 rom_filter: support default input values
Fixes #4286
2021-10-14 11:02:10 +02:00
Stefan Kalkowski
cb67d07e61 lx_emul: be compliant to original softirq impl.
Ref #4268
2021-10-14 11:02:10 +02:00
Christian Helmuth
96ebed6c31 vbox6: use configuration from machine.vbox6
There are some subtle incompatibilities in VirtualBox 6 with settings we
used in version 5. Therefore, the vbox6 package uses machine.vbox6 as
configuration file. An example configuration is provided by the
raw/vbox6 package.

Issue #4281
2021-10-14 11:02:10 +02:00
Josef Söntgen
6093f8ad81 gpu/intel: deal with insufficient amount of CAPS
'Out_of_ram' was so far the only exception a client had to deal with
during buffer managment. Allocating memory, however, does not only
consume RAM quota but CAP quota as well.

This commit tries to mitigate that shortcoming by reflecting the
'Out_of_caps' state back to the client. Furthermore it allows for
resource accounting on certain client allocations, e.g. buffers.

Fixes #4284.
2021-10-14 11:02:09 +02:00
Josef Söntgen
f6d845e630 gpu: reflect CAP shortage during buffer management
Allocating and mapping buffers not only consumes RAM quota, it consumes
CAP quota as well. Extended the Gpu session to allow for dealing with
that on the client side.

On a side note, the amount of initial CAP quota needed to establish
a connection is increased to cover the current costs of the Intel
GPU multiplexer.

Issue #4284.
2021-10-14 11:02:09 +02:00
Josef Söntgen
27e55dab3e platform_drv: check quota before allocating buffer
The platform driver uses a 'Constrained_ram_allocator' to allocate
meta-data on behave of a client. It uses the PD session as
'Ram_allocator' back end that in return is implemented via the
'Expanding_pd_session_client'.

Whenever the PD client itselft comes into resource shortage it will
ask its parent unconditionally. However, depending on the integration,
such a request may be left unanswered.

This commit introduces a check to prevent that situation from
occurring. In case the platform driver notices the resource shortage
it will reflect that back to the client.

Issue #4284.
2021-10-14 11:02:09 +02:00
Norman Feske
05b451c563 pkg/mesa_gpu: use cached_fs_rom
By using the cached_fs_rom instead of fs_rom, each client obtains the
same (read-only) copy of the shared library, avoiding a RAM resource
request when running mulitple GPU applications at the same time.
With this patch, Sculpt is able to host at least 3 Mesa applications.

Issue #4263
Issue #4281
2021-10-14 11:02:09 +02:00
Sebastian Sumpf
2604c3cca6 vbox6: add mouse pointer shape support
Implement 'MousePointerShapeChanged' event, retrieve parameters from
COM pointer, and update shape report.

fixes #4283
2021-10-14 11:02:09 +02:00
Norman Feske
8ebc185caf depot: merge rtc_drv into system_clock runtime pkg
This new version of the system_clock pkg does no longer depend on the
presence of an external 'Rtc' service as previously provided by the
Sculpt base system. Instead, it hosts the rtc_drv inside the subsystem.
Because rtc_drv is board-dependent, the system_clock pkg is named
system_clock-pc now.

Issue #4281
2021-10-14 11:02:08 +02:00
Norman Feske
6e32102cc6 depot: add recall_fs runtime pkg
Issue #4281
2021-10-14 11:02:08 +02:00
Norman Feske
42541fcc92 sculpt: limit depot selection
This patch reduces the items of the default depot-selection menu to
users that actively maintain a Sculpt index.

Issue #4281
2021-10-14 11:02:08 +02:00
Norman Feske
7cae324726 sculpt: remove RTC driver from base system
The RTC driver is not needed by the base system and can thereby be
handled as a user-installable component.

Issue #4281
2021-10-13 14:50:46 +02:00
Sebastian Sumpf
1072a91592 qemu-usb: disable remote wake up in config descriptors
Some guests don't handle remote wake up correctly causing devices to
stop functioning. Therefore, we disable the remote wake up bit (5) in
`bmAttributes` of the device configuration descriptor.

Thanks to Peter for the initial fix.

Fixes #4278
2021-10-13 14:50:46 +02:00
Christian Helmuth
07bb3fc1ec Initial update of init-state ROM in init_loop test
ROM clients have to request an initial update of dynamic ROMs explicitly
and should not depend on artificial signals from the ROM session on
signal-handler registration.

Issue #4274
2021-10-13 14:50:46 +02:00
Johannes Schlatow
93583cce3b sequence: immediately stop child on exit
The sequence app should immediately stop the child when it called
parent().exit(). Otherwise, the child will continue execution which
causes a race condition: The child's ld.lib.so will eventually destruct
an Attached_rom_dataspace for the config rom. If sequence destructed the
corresponding service first, we will get an Ipc_error.

genodelabs/genode#4267
2021-10-13 14:50:46 +02:00
Josef Söntgen
e6bd9fd7da libc: implement SNDCTL_DSP_GETFMTS ioctl
This I/O control is used to query the audio format, e.g. AFMT_S16_LE
in our case.

Fixes #4276.
2021-10-13 14:50:46 +02:00
Martin Stein
870c5c7a81 file_vault: GUI control for encrypted virtual FS's
Warning!

The current version of the file vault is not thought for productive use but
for mere demonstrational purpose! Please refrain from storing sensitive data
with it!

The File Vault component implements a graphical frontend for setting up and
controlling encrypted virtual file systems using the Consistent Block Encrypter
(CBE) for encryption and snapshot management. For more details see
'repos/gems/src/app/file_vault/README'.

Fixes #4032
2021-10-13 14:50:46 +02:00
Martin Stein
3e375e4315 cbe tools: log less by default
Previously unconditional calls to Genode::log in cbe init and the cbe trust
anchor VFS plugin were made dependent on a verbosity flag that is set to
"false" by default.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
8dfa586462 vfs/cbe_trust_anchor: fix bug in key decrypt
The plugin used the ciphertext instead of the plaintext buffer for key
decryption which led to bogus ciphertext keys.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
a661aa79de vfs/cbe_trust_anchor: AES-key-wrap private key
Instead of simply encrypting the private key with AES-256 when storing it to
the 'encrypted_private_key' file, wrap it using the AES-key-wrap algorithm
described in RFC 3394 "Advanced Encryption Standard (AES) Key Wrap Algorithm".
This is more secure and enables us to directly check whether the passphrase
entered by the user was correct or not.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
94701eec09 vfs/cbe_trust_anchor: rename secured_superblock
As the file formerly named 'secured_superblock' actually contains the hash of
the superblock that was secured, it was renamed 'superblock_hash'.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
a28ca44101 vfs/cbe_trust_anchor: rename keyfile
As the file formerly named 'keyfile' actually contains the encrypted private
key of the Trust Anchor, it was renamed 'encrypted_private_key'.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
641a738e3d vfs/cbe_trust_anchor: encrypt symmetric keys
By now, the symmetric keys were only XOR'ed with the private key as placeholder
for a real encryption. Now they are encrypted using AES256 with the TA's
private key as key

Ref #4032.
2021-10-13 14:50:46 +02:00
Martin Stein
f41dec67e1 vfs/cbe_trust_anchor: use secure private key
A private key of 256 bits is generated pseudo-randomly using the jitterentropy
VFS plugin on initialization. The private key is stored in the key file
encrypted via AES256 using the SHA256 hash of the users passphrase. When
unlocking the CBE device, the encrypted private key is read from the key file
and decrypted with the hash of the users passphrase.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
75a55b62a3 vfs/cbe_trust_anchor: use hash of passphrase
Instead of using the user passphrase directly, use its SHA256 hash calculated
using libcrypto. The passphrase hash is still stored in the key file to be
used as base for the very primitive way of generating the private key.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
989b7f39e1 vfs/cbe_trust_anchor: use secure symmetric keys
Use the jitterentropy vfs plugin for the generation of new symmetric block
encryption keys in the cbe trust anchor vfs plugin.

Ref #4032
2021-10-13 14:50:46 +02:00
Martin Stein
a2d2b874ec vfs/cbe_trust_anchor: sync keyfile-handle close
Closing the keyfile handle after a write operation wasn't synchronised to the
actual end of the write operation.

Issuing a write operation at the back end returns successfull as soon as the
back end has acknowledged that it will execute the operation. However, the
actual writing of the data might still be in progress at this point. But the
plugin used to close the file handle and declare the operation finished at this
point which led to warnings about acks on unknown file handles and leaking
resources. Now, the plugin issues a sync operation directly after the write
operation and waits for the sync to complete. This ensures that the plugin
doesn't declare the operation finished too early.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
42490208c2 vfs/cbe_trust_anchor: fix unlocking
The unlocking operation in the trust anchor was broken wich caused bad keys in
the CBE. This rewrites the whole operation to work as desired. Note that this
doesn't make it more safe! The private key is still almost the same as the
passphrase and stored plaintext.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
95639a7492 vfs/cbe_trust_anchor: close handles correctly
The plugin used to close file handles via the 'vfs_env.root_dir.close'.
However, this lead to resource leaks and apparently isn't the right way to
do it. Other VFS plugins do it by calling 'close' directly on the handle and
doing it in the trust anchor plugin also, fixes the leaks.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
df7de17435 vfs/cbe_trust_anchor: sync hashfile-handle close
Closing the hashfile handle after a write operation wasn't synchronised to the
actual end of the write operation.

Issuing a write operation at the back end returns successfull as soon as the
back end has acknowledged that it will execute the operation. However, the
actual writing of the data might still be in progress at this point. But the
plugin used to close the file handle and declare the operation finished at this
point which led to warnings about acks on unknown file handles and leaking
resources. Now, the plugin issues a sync operation directly after the write
operation and waits for the sync to complete. This ensures that the plugin
doesn't declare the operation finished too early.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
1b4a80ffae vfs/cbe: control/deinitialize file
There were no means for issuing a Deinitialize request at the CBE using the
CBE VFS plugin. The new control/deinitialize file fixes this. When writing
"true" to the file, a Deinitialize request is submitted at the CBE. When
reading the file, the state of the operation is returned as a string of the
format "[current_state] last-result: [last_result]" where [current_state] can
be "idle" or "in-progress" and [last_result] can be "none", "success", or
"failed".

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
88e6991083 vfs/cbe: fix ID argument on discard_snap
When discarding a snapshot, the CBE VFS plugin didn't communicate the ID of
the snapshot to the CBE. Instead it set the ID argument to 0. Therefore the
operation never had any effect.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
9b953e79ba vfs/cbe: support watching the snapshots fs
The snapshots file system couldn't be watched. But it's of interest to watch
for appearing and disappearing snapshots.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
4c1eae97cf vfs/cbe: fix result of SnapshotsFS.num_dirent("/")
The snapshots file system used to return the number of snapshots on
'num_dirent' when called for the root directory although it was expected to
return 1. This confused the tooling ontop of the VFS.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
f051bfa90d vfs/cbe: support watching "rekey" file
The control/rekey file couldn't be watched although it was meant to be used
to watch the current state of the rekey operation.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
4ed45dd303 vfs/cbe: support watching "extend" file
The control/extend file couldn't be watched although it was meant to be used
to watch the current state of the extend operation.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
2d0ac161cb vfs/cbe: mark extend/rekey fs readable
Despite being readable, the files control/extend and control/rekey proclaimed
that they were not when asked. This caused the fs_query tool to not report the
content of the files although it could have.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
34245376ba vfs/cbe: fix size of extend/rekey fs
Stat calls on the control/extend and control/rekey files returned a bogus file
size that led to an error in the VFS File_content tool. The tool complained
that the size of the file determined while reading the content differs from the
one reported by the stat operation. Now, the stat call will always determine
the actual size of what would be read.  However, it isn't guaranteed that this
size doesn't change in the time after the stat operation and before the read
operation.

Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
bd79f93657 cbe/types: invalid generation, generation string
Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
731df4b037 recipes/src/cbe: build also cbe_init_trust_anchor
Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
d3cc5c9cd2 gems/recipes: api/cbe
Ref #4032
2021-10-13 14:50:45 +02:00
Martin Stein
ff656401b3 gems: update cbe port
This update fixes a bug when discarding snapshots.

Ref #4032
2021-10-13 14:50:45 +02:00
Christian Helmuth
46ee872b50 vbox6: shared clipboard service
The service is loaded dynamically VBoxSharedClipboard.so at runtime. The
VFS configuration mounts the shared object at /VBoxSharedClipboard.so as
the file is checked by contrib code before loading. An init
configuration in pkg/vbox6/runtime illustrates this and how to re-label
the VBoxSharedClipboard.so ROM to its real name
virtualbox6-sharedclipboard.lib.so.
2021-10-13 14:50:45 +02:00
Christian Helmuth
5aee693f70 vbox6: limit wait for ack to 15 ms in AHCI model
During Windows 10 boot with sequential block requests, the AHCI request
worker finished earlier than the EMT thread signals hEvtProcess and
begins waiting for hEvtProcessAck indefinitely. The timeouts helps to
survive this short phase.

A better solution would use conditional variables, which are not
provided in VirtualBox's runtime.
2021-10-13 14:50:45 +02:00
Josef Söntgen
f21cf3f8b1 mesa: name driver library appropriately
Rename the 'egl_drv' library and the various back ends to 'mesa_gpu_drv'
and 'mesa_gpu-<backend>'.

Fixes #4275.
2021-10-13 14:50:37 +02:00
Norman Feske
32c283d26f os: introduce C API for generating Genode events
This patch introduces a C API to be used by input drivers to generate
Genode events. The initial version is limited to multitouch events only.

Fixes #4273
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
f4cb5cc299 dde_linux: preserve Io_signal_handler for IRQs
Do not construct/destruct signal handlers for interrupts dynamically,
but only the Irq session to prevent a deadlock.

Fix #4272
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
6ae55d490b lx_emul: restrict allocations to minimal alignment
* Use the architecture-dependent minimal alignment for all allocations,
  e.g. on ARM it is necessary to have cacheline aligned allocations for DMA
* Remove the allocation functions without alignment from generic API
* Fix a warning

Fix #4268
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
2ac8620f44 lx_emul: invalidate cache for DMA-read only
After a DMA transaction do only invalidate cachelines from the
corresponding DMA buffers if data got transfered from device to
CPU, and not vice versa. Otherwise it might result in data corruption.

Ref #4268
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
d8c344f6b9 lx_emul: do not block kworkers unconditionally
Ref #4268
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
f8cf0442ed lx_emul: implement lookup of dma-addr to virt-addr
* Use the new Lx_kit::Map as lookup structure for virt-to-dma and vice versa,
  instead of a list-based registry

Ref #4268
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
9bc7ecb605 lx_emul: provide alignment for DMA allocations
Ref #4268
2021-10-13 14:46:54 +02:00
Christian Helmuth
4c4ce2f899 report_rom: versioning and explicit notification
The former implementation did not internally track ROM changes notified
vs. delivered to the client. We adapt the versioning implementation
implemented in dynamic_rom_session.h and enable explicit notification of
the current version.

The feature is used by the clipboard to notify permitted readers of the
clipboard ROM service on focus change via the newly created private
Rom::Module::_notify_permitted_readers() function.

Fixes #4274
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
4803937dd2 os: introduce C-API to provide USB service
Fix #4270
2021-10-13 14:46:54 +02:00
Stefan Kalkowski
6789b86871 base-hw: optimize cache maintainance for ARMv8
* Remove the data-synchronization barrier from the inner-loop
* Instead add a system-wide barrier at the end of the operation

Fix #4269
2021-10-13 14:46:54 +02:00
Martin Stein
9542bcf88c base-hw: reduce includes in board.h
The includes for the address-space-ID allocator and the translation table are
usually specific to the CPU in use. Therefore these includes can be moved from
their current location in the board header to the CPU headers. This reduces the
number of decisions a board maintainer has to make if the CPU model he's aiming
for is already available.

This can probably also be applied for other includes in the board headers but I
intentionally leave it for a future commit as I don't have the time to do it
all now.

Ref #4217
2021-10-13 14:46:54 +02:00
Martin Stein
ad059362d2 base-hw: reduce hardware-specific include paths
For base-hw Core, we used to add quite some hardware-specific include paths
to 'INC_DIR'. Generic code used to include, for instance, '<cpu.h>' and
'<translation_table.h>' using these implicit path resolutions. This commit
removes hardware-specific include paths except for

1) the '<board.h>' include paths (e.g., 'src/core/board/pbxa9'),
2) most architecture-specific include paths (e.g., 'src/core/spec/arm_v7'),
3) include paths that reflect usage of virtualization or ARM Trustzone
   (e.g., 'src/core/spec/arm/virtualization').

The first category is kept because, in contrast to the former "spec"-mechanism,
the board variable used for this type of resolution is not deprecated and the
board headers are meant to be the front end of hardware-specific headers
towards generic code which is why they must be available generically via
'<board.h>'.

The second category is kept because it was suggested by other maintainers that
simple arch-dependent headers (like for the declaration of a CPU state) should
not imply the inclusion of the whole '<board.h>' and because the architecture
is given also without the former "spec"-mechanism through the type of the build
directory. I think this is questionable but am fine with it.

The third category is kept because the whole way of saying whether
virtualization resp. ARM Trustzone is used is done in an out-dated manner and
changing it now would blow up this commit a lot and exceed the time that I'm
willing to spend. This category should be subject to a future issue.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
49b09702b8 base-hw: don't include board.h from hardw. headers
The 'src/core/board/<board>/board.h' header is thought as front end of
hardware-specific headers of a given board towards the generic base-hw Core
code. Therefore it leads to problems (circular includes) if the board.h header
is included from within another hardware-specific header.

If hardware-specific headers access declarations from namespace Board in a
definition, the definition should be moved to a compilation unit that may
include board.h. If hardware-specific headers access declarations from board.h
in a declaration, they should either use the primary declaration from the
original header or, if the declaration must be selected according to the board,
another board-specific header should be introduced to reflect this abstraction.

This is applied by this commit for the current state of base-hw.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
5d74509b2d base-hw: get rid of static perf counter object
It is not necessary to have a class, an object, and a generic header for the
perfomance counter. The kernel merely enables the counter using cpu registers
('msr' instructions, no MMIO) on arm_v6 and arm_v7 only. Therefore this commit
makes the header arm-specific and replaces class and global static object with
a function for enabling the counter.

Fixes #4217
2021-10-13 14:46:53 +02:00
Martin Stein
b817e1977c base-hw: serial output as Main member
Let the kernel's serial-output driver be a member of the one Kernel::Main
object instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
910788313e base-hw: get rid of static variable in Kernel::Pd
Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
02f00a999c base-hw: global IRQ controller as Main member
Let the kernel's driver for the global IRQ controller be a member of the one
Kernel::Main object instead of having it as static variables in the drivers for
the local IRQ controllers. Note that this commit spares out renaming 'Pic' to
'Local_interrupt_controller' which would be more sensible now with the new
'Global_interrupt_controller' class. Furthermore, on ARM boards the commit
doesn't move 'Distributer' stuff to the new global IRQ controller class as they
don't have real data members (only MMIO) and can be instanciated for each CPU
anew. However, the right way would be to instanciate them only once in Main as
well.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
441d137482 base-hw: Address-Space-ID allocator as Main member
Let the kernel's Address-Space-ID allocator be a member of the one
Kernel::Main object instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
0c61b25bcf base-hw: no unmanaged_singleton in kernel thread
The unmanaged-singleton approach was used in this context only because of the
alignment requirement of the Core main-UTCB. This, however can also be achieved
with the new 'Aligned' utility, allowing the UTCB to be a member of the Core
main-thread object.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
b6641eaa25 base-hw: Core PD as Main member
Let the Core protection-domain object be a member of the one Kernel::Main
object instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
d6e347163d base-hw: unnecessary unmanaged-singleton includes
Remove some deprecated include directives for the unmanaged-singleton header.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
5dd8ee5840 base-hw: global IRQ pool as Main member
Let the global kernel IRQ-pool be a member of the one Kernel::Main object
instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
c49db16762 base-hw: don't use boot_info() outside main.cc
It's sufficient to access the boot info only on kernel initialization time.
Therfore, it can remain completely hidden to the rest of the kernel inside
kernel/main.cc in the initialization function.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
b247def09a base-hw: Core main-thread as Main member
Let the Core main-thread object be a member of the one Kernel::Main object
instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
2b89cd66cb base-hw: kernel CPU-pool as Main member
Let the kernel CPU-pool be a member of the one Kernel::Main object instead of
having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
be3d5232c8 base-hw: kernel-data lock as Main member
Let the global kernel-data lock be a member of the one Kernel::Main object
instead of having it as global static variable.

Ref #4217
2021-10-13 14:46:53 +02:00
Martin Stein
82cf31ac27 base-hw: introduce Kernel::Main class
This commit introduces the Kernel::Main class that replaces the former way of
initializing the kernel (former 'kernel_init' function) and calling the C++
kernel entry handler (former 'kernel' function). These two are now
'Main::initialize_and_handle_kernel_entry' and 'Main::handle_kernel_entry'.
Also reading the execution time of the idle threads was already moved to
'Main'. The one static Main instance is meant to successivly replace all the
global static objects of the base-hw kernel with data members of the Main
instance making the data model of the kernel much more comprehensible. The
instance and most of its interface are hidden in kernel/main.cc. There are only
rare cases where parts of the Main interface must be accessible from the
outside. This should be done in the most specific way possible (see main.h)
and, if possible, without handing out references to Main data members or the
Main instance itself.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
9de43a48b6 base-hw: conform pc board header
Normally, the board header can be found for each supported board under
'src/core/board/<BOARD>/board.h'. This was not the case for the board 'pc'
that was located under 'src/core/spec/x86_64/board.h'. The commit fixes this.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
a9563bfd4c base-hw: rename Core_thread Core_main_thread
The class name Core_thread in Kernel for the object of the first thread of
core is too generic as there can be an arbitrary number of threads in core
besides this one. Furthermore, creating a core thread has its own syscall
'new_core_thread' that isn't related in any way to Core_thread. Therefore
this commit introduces the more specific name Core_main_thread as replacement
for Core_thread.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
693a2b5421 base-hw: get rid of cpu_pool() in platform.cc
The function was only still used for reading the execution time of idle threads
of CPUs. Certainly, it is technically fine and more performant to read these
values directly from the kernel objects without doing a syscall. However,
calling cpu_pool() for it provides read and write access to a lot more than
only the execution time values. The interface via which Core directly reads
state of the kernel should be as narrow and specific as possible.
Perspectively, we want to get rid of the cpu_pool() accessor anyway. Therefore
this commit introduces Kernel::read_idle_thread_execution_time(cpu_idx) as
replacement. The function is implemented in kernel code and called by Core in
platform.cc.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
277adcacb0 base-hw: make Trace_source in Platform() a class
Apparently, there is no need for exposing the data members of Trace_source, so,
we sould better make them private before someone gets the impression that they
are meant to be accessed directly.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
aa6a7db50a base-hw: communicate kernel irqs via boot info
Core used to read the kernel-reserved IRQs from the timer objects in the
kernel's CPU objects and the PIC class (inter-processor IRQ). Besides not
being "good style" to access a kernel object in Core, this becomes a problem
when trying to prevent CPU pool from being accessed via global functions.

As a solution, this commit extends the boot info to also carry an array of all
kernel-reserved IRQs.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
8b69bc96f9 base-hw: separate variants of Kernel_object(...)
For the constructor of Kernel_object<T> there are two variants. One for the
case that it is called from Core where the kernel object (type T) must be
created via a syscall and one when it is called from within the kernel and the
kernel object can be created directly. Selecting one of these variants was done
using a bool argument to the constructor. However, this implies that the
constructor of Kernel_object<T> and that of T have the same signature in the
variadic arguments, even in the syscall case, although technically it would
then not be necessary.

This becomes a problem as soon as kernel objects created by Core shall receive
additional arguments from the kernel, for instance a reference to the global
CPU pool, and therefore stands in the way when wanting to get rid of global
statics in the kernel. Therefore, this commit introduces two constructors that
are selected through enum arguments:

! Kernel_object(Called_from_kernel, ...);
! Kernel_object(Called_from_core, ...);

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
6e4ef43bf0 base-hw: always use 'unsigned' for priorities
At some points in the code, 'signed' was used instead of the more appropriate
'unsigned' type.

Ref #4217
2021-10-13 14:46:52 +02:00
Martin Stein
b922dc5c10 base-hw: fix self-include in kernel/types.h
That this header apparently used to include itself didn't cause any problems
so far but still remained bad style.

Ref #4217
2021-10-13 14:46:52 +02:00
Josef Söntgen
cacb83b163 gpu: introduce mapping attributes
The various mapping methods are modelled after the requirements of
the Intel GPUs or rather the Mesa driver back end.

With upcoming support for other driver back ends, we need to
sequeeze their requirements in as well. For now hijack 'map_buffer'
to provide for specifying the kind of attributes the client needs.

For now all buffers mapped in the GGTT for Intel GPUs are treated
as RW.

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
90e151e2c4 gpu: add 'complete' RPC call
This call allows for checking if the given execution buffer has been
completed and complements the completion signal. Initially the GPU
multiplexer always sent such a signal when the currently scheduled
execution buffer has been completed. During enablement of the 'iris'
driver it became necessary to properly check of sequence number.

In case of the Intel GPU multiplexer the sequence numbers are
continous, which prompted the greater-than-or-equal check in the
DRM back end. By hidding this implementation detail behind the
interface, GPU drivers are free to deal with sequence numbers any
way they like and allows for polling in the client, where the
completion signal is now more of a progress signal.

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
e37792ce94 gpu: introduce information dataspace
The current info implementation (as RPC) is limited in a few ways:

  * The amount of data that may be transferred is constrained by the
    underlying base platform
  * Most information never changes during run time but is copied
    nonetheless
  * The information differs depending on the used GPU device and
    in its current implementation only contains Intel GPU specific
    details

With this commit the 'info' RPC call is replaced with the
'info_dataspace' call that transfers the capability for the dataspace
containing the information only. This is complemented by a client
local 'attached_info' call that allows for getting typed access to
the information. The layout of the information is moved to its own
and GPU-specific header file, e.g., 'gpu/info_intel.h'

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
cfb170c719 gpu: move exec sequence number to Gpu namespace
Moving the type definition removes the aritifial linkage to the Gpu
information structure.

Issue #4265.
2021-10-13 14:46:52 +02:00
Josef Söntgen
3b40790e02 gpu: use Buffer_id to identify buffers
Rather than using the dataspace capability directly, let the client
choose its own local identifier that is linked to the underlying
capability.

Fixes #4265.
2021-10-13 14:46:52 +02:00
Stefan Kalkowski
9a80c3a618 depot: suppress error when copying empty package
Instead of failing, ignore empty packages when copying over
depot packages to a run-script environment.

Fix #4271
2021-10-13 14:46:52 +02:00
Josef Söntgen
ba430dfeac libdrm/iris: destroy Buffer_handle object
When the client frees the buffer, destroy the corresponding
Buffer_handle as well.

Fixes #4266.
2021-10-13 14:46:52 +02:00
Piotr Tworek
b157256a2b uplink client: Add missing space in warning message.
Right now the warning about failure to forward packet from driver to
uplink RX connection reads:

  "exception while trying to forward packet from driverto Uplink
   connection TX"

Add missing space between "driver" and "to".

Issue #4264
2021-10-13 14:46:52 +02:00
Piotr Tworek
60980045ea virtio_nic: Increase default TX & RX virtqueue sizes.
32KB is a rather small value. The driver can cope with it now, but
it does not perform as well as it should. This visible especially
in scenarions like nic_router_flood where we still often hit
synchronous wait path. Bump the size to 256kB.

Issue #4264
2021-10-13 14:46:51 +02:00
Piotr Tworek
880cd3a490 virtio_nic: Fix packet transmission handling.
The problem can be seen when running nic_router_flood scenarion on arm
qemu_virt boards. With the amount of data this scenario tries to send
the driver quickly complains it has failed to push data into TX VirtIO
queue. After this warning message is printed nothing really happens and
after a while the test scenario fails.

The fact that we can't write all available data to the device is not
unexpected. VirtIO queue size is slected at initialization time and we
don't change it during driver lifetime. It can be tweaked via driver
config, but this does not change the fact that we'll always be able to
produce more data packets than we have free space in the VirtIO queue.

IMO the expected behavior of the driver in such case should be to:
1. Notify the device there is data to process.
2. Wait for the device to process at least part of it.
3. Retry sending queued packets.

One could expect returning Transmit_result::RETRY from _drv_transmit_pkt
would produce such result. Unfortunately it seems that Uplink_client_base
treats RETRY return value as indication of link being down. It'll retry
sending the packet only after the device notifies it the link is once
again up. This is the reason why nothing happens when running
nic_router_flood on top of virtio_nic driver. The link never goes down
in this case so once we fill the TX VirtIO queue and tell the base class
to retry the send, we'll be stuck waiting for link up change event
which will never arrive.

To fix this problem, when sending a packet to the device fails, do a
synchrnonus TX VirtIO queue flush (tell device there is data to process
and wait until its done with it).

With this fix in place nic_router_flood test scenario passes on both arm
qemu_virt boards.

Issue #4264
2021-10-13 14:46:51 +02:00
Piotr Tworek
b7f66626c2 virtio: Make avail and used ring pointers volatile
The contents of those descriptor rings can be modified by the device.
Mark them as volatile so the compiler does not make any assumptions
about them.

Issue #4264
2021-10-13 14:46:51 +02:00
Christian Helmuth
c0a7696c71 tool/dts/extract: convert regex strings to latin1
The former encoding was UTF-8, which works quite well if LC_CTYPE is
ensured to be an UTF-8 codeset (e.g., en_US.UTF-8 or C.UTF-8 . But, if
LC_CTYPE is set to C or latin1 for example, the Tcl regex library enters
an infinite loop because of unexpected characters used as markers
n the strings (e.g., SECTION SIGN U+00A7).

Therefore, the extract tool was converted to latin1 with the following
commands and now works for LC_CTYPE C and UTF-8 codesets.

   iconv -f utf-8 -t latin1 tool/dts/extract > /tmp/e
   cp /tmp/e tool/dts/extract
2021-10-13 14:46:51 +02:00
Alexander Boettcher
d85a448c52 gpu/intel: provide supported devices as config
Adjust drivers_managed and sculpt accordingly.

Issue #4260
2021-10-13 14:46:51 +02:00
Sebastian Sumpf
d67899be95 gpu/intel: enable 32 bit CPU support
* use Gpu::addr_t (64 Bit) where necessary instead of Genode::addr_t.

issue #4260
2021-10-13 14:46:51 +02:00
Alexander Boettcher
6112c0df6d mesa: rename gpu-* pkg to mesa_gpu-*
for easier linking by user with the Mesa client ROM requests, which will be
mesa_gpu-drv.lib.so. Adjust mesa-gears demo accordingly.

Issue #4263
2021-10-13 14:46:51 +02:00
Alexander Boettcher
367385aed7 gpu/intel: add more supported Intel GPUs
- Lenovo T470p, T490, T490s

Issue #4260
2021-10-13 14:46:51 +02:00
Alexander Boettcher
0f72356570 gpu/intel: use read out gttm size
and don't assume 8M, which leads to Region_conflicts if size is >8M (X201).

Issue #4260
2021-10-13 14:46:51 +02:00
Christian Helmuth
727fa86088 autopilot: support additional repo directories
-a <repo-dir> appends repo-dir to REPOSITORIES in build.conf
2021-10-13 14:46:51 +02:00
Christian Helmuth
32394c0733 hello: fix resource config / add to autopilot list 2021-10-13 14:46:51 +02:00
Alexander Boettcher
5aa3c56e5c mesa: add gears package
Issue #4263
2021-10-13 14:46:51 +02:00
Alexander Boettcher
0c2edce8ac sculpt: add Gpu service support
Fixes #4263
2021-10-13 14:46:51 +02:00
Alexander Boettcher
2d2ef2a763 mesa: add gpu-iris package providing IRIS driver
Issue #4263
2021-10-13 14:46:51 +02:00
Alexander Boettcher
b6beff673a mesa: add gpu-cpu package providing SWRAST driver
Issue #4263
2021-10-13 14:46:51 +02:00
Sebastian Sumpf
07881f90a9 mesa/libdrm: remove signal EP
This is a left over from Mesa-11 and we exchanged it with a
'wait_and_dispatch_one_io_signal' for synchronous signal waits.

issue #4260
2021-10-13 14:46:50 +02:00
Sebastian Sumpf
3daa94ff2e gpu/intel: Add support for Gen9+
This commit contains features and buf fixes:

* Catch errors during resource allocation

* Because Mesa tries to allocate fence (hardware) registers for each
  batch buffer execution, do not allocate new fences for buffer objects
  that are already fenced

* Add support for global hardware status page. Each context additionally
  has a per-process hardware status page, which we used to set the
  global hardware status page during Vgpu switch. This was obviously
  wrong. There is only one global hardware status page (set once during
  initialization) and a distinct per-process page for contexts.

* Write the sequence number of the currently executing batch buffer to
  dword 52 of the per-process hardware status page. We use the pipe line
  command with QW_WRITE (quad word write), GLOBAL_GTT_IVB disabled
  (address space is per-process address space), and STORE_DATA_INDEX
  enabled (write goes to offset of hardware status page). This command
  used to write to the scratch page. But Linux now uses the first
  reserved word of the per-process hardware status page.

* Add Gen9+ WaEnableGapsTsvCreditFix workaround. This sets the "GAPS TSV
  Credit fix Enable" bit of the Arbiter control register (GARBCNTLREG)
  as described by the documentation this bit should be set by the BIOS
  but is not on most Gen9/9.5 platforms. Not setting this bit leads to
  random GPU hangs.

* Increase the context size from 20 to 22 pages for Gen9. On Gen8 the
  hardware context is 20 pages (1 hardware status page + 19 ring context
  register pages). On Gen9 the size of the ring context registers has
  increased by two pages to 21 pages or 81.3125 KBytes as the IGD
  documentation states.

* The logical ring size in the ring buffer control of the execlist
  context has to be programmed with number of pages - 1. So 0 is 1 page.
  We programmed the actual number of pages before, leading to ring
  buffer execution of NOOPs if page behind our ring buffer was empty or
  GPU hangs if there was data on the page.

issue #4260
2021-10-13 14:46:50 +02:00
Sebastian Sumpf
59b23bc7e1 libdrm: Iris - execute batch buffer synchronous
* Wait for for completion before return from 'execbuffer2'. This makes
  buffer execution synchronous.

* Because the Iris driver manages the virtual address space of the GPU
  and creates one GEM context for each batch buffer we have to map/unmap
  all buffer objects before and after batch buffer execution.

issue #4260
2021-10-13 14:46:50 +02:00
Norman Feske
b7bb6869b4 drivers_interactive-pc: remove platform service
The platform driver should better stay internal to the drivers subsystem
to reinforce the consistency with other drivers_interactive packages.
2021-10-13 14:45:24 +02:00
Norman Feske
e6cdaafb20 tool/ports: use current time as modification time
Fixes #4262
2021-10-13 14:02:16 +02:00
Norman Feske
d072c408ab dde_linux: call init_page_count for each page
The lx_emul_virt_to_pages implementation initialized the page ref
counter only for the first page, leaving the remaining elements in
uninitialized state. This, in turn, rendered the Linux page_pool (as
used by the emac network driver) ineffective, ultimately leading the a
memory leak. The fix changes the call of 'init_page_count' to take the
loop variable as argument.

Issue #4225
2021-10-13 14:02:16 +02:00
Johannes Schlatow
4dacac3dbb depot_autopilot: fix test-trace
Increased number of trace subjects since the test sporadically fails on
some platforms.

Also added a sanity check to print an error message in case we run into
the same issue again.

Fixes genodelabs/genode#4261
2021-10-13 14:02:16 +02:00
Norman Feske
914a41a8bd dde_linux: adjustments for Linux 5.14.1
Issue #4259
2021-10-13 14:01:03 +02:00
Tomasz Gajewski
e6c915ae06 libssh port: immediate mode for ssh poll
This patch adds a switch to internal poll function in libssh that
allows to force this function to immediately return without actually
polling for data and in consequence processing this data. This switch
is used to avoid calling callback functions when flushing output
streams which caused locks due to recursive access to internal
ssh_terminal sessions registry.

Issue #4258
2021-10-13 14:01:02 +02:00
Tomasz Gajewski
6ef6f16cb3 libssh port: backported sftp_server_free
sftp_server_free function was added in 0.9 version of libssh and is
required to avoid memory leaks when clients are disconnecting.

Issue #4258
2021-10-13 14:01:02 +02:00
Tomasz Gajewski
f327a40bbb libssh port: required modifications for sftp
This patch allows to replace sftp packet read and write with
completely asynchronous versions needed to properly hook in existing
ssh_terminal implementation.

Issue #4258
2021-10-13 14:01:02 +02:00
Tomasz Gajewski
e34d1550a4 ssh_terminal: added missing include
Issue #4258
2021-10-13 14:01:02 +02:00
Christian Helmuth
77a5cf7fd4 vbox6: enable audio via OSS plugin 2021-10-13 14:01:02 +02:00
Christian Helmuth
2ba5e4a5b1 libc/oss: check argp per ioctl
... as some ioctls do not require a valid pointer.
2021-10-13 14:01:02 +02:00
Christian Helmuth
5c82045170 vbox6: enable mouse wheel reporting 2021-10-13 14:01:02 +02:00
Christian Helmuth
4a87fcc4cf vbox6: fix TPR handling 2021-10-13 14:01:02 +02:00
Christian Helmuth
e5b828ae8f Switch to genodelabs depot in depot_download test 2021-10-13 14:01:02 +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
64e2912a2f version: 21.08 2021-08-31 12:02:22 +02:00
Norman Feske
339dda8b43 News item for version 21.08 2021-08-31 12:02:22 +02:00
Norman Feske
397a3e45d1 Release notes for version 21.08 2021-08-31 12:02:22 +02:00
Norman Feske
f8898f3a56 doc: add server/black_hole to components.txt 2021-08-31 12:02:22 +02:00
Christian Helmuth
83c5648d33 depot: update recipe hashes 2021-08-30 15:00:39 +02:00
Martin Stein
7fdebc6a09 nic_router: let DHCP client request domain name
The NIC router parses, stores and forwards DNS domain names from DHCP replies.
Yet the routers DHCP client used to not request DNS domain-name information on
DHCP requests. This caused DHCP servers to skip this information on their
replies although it was available. This commit fixes the issue by adding the
DNS domain name code to the request parameter list of requests from the routers
DHCP client.
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
4782f9376c recipe: Qt5 texedit adjust to new Mesa version
Add dependency to 'libdrm' as it is required by Mesa 21

issue #4254
2021-08-30 15:00:38 +02:00
Christian Helmuth
a362505e8a usb_host: report bInterfaceProtocol too
Thanks to Raphael for the patch.
2021-08-30 15:00:38 +02:00
Christian Prochaska
ece837e8b8 qt5: prepare QtWebEngine sndio backend
Fixes #4257
2021-08-30 15:00:38 +02:00
Christian Prochaska
eedbcf88ec os: add black hole component
The 'black_hole' component provides dummy implementations of common
session interfaces.

At this time, only the 'Audio_out' session is provided if enabled
in the configuration of the component:

<config>
	<audio_out/>
</config>

Issue #3653
2021-08-30 15:00:38 +02:00
Johannes Schlatow
2b0bb6dda0 trace: comment x86 timestamp() implementations
Fixes genodelabs/genode#4243
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
31b049864c qt5_opengl: Disable Vulkan feature
With Mesa-21, Qt5 detects Vulkan to be enabled, even though it is not
supported in Genode. Also add DRM library in Qt5 run script.

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
46be4f1145 mesa_demo: adjust to Mesa 21.0.0
* support argc/argv + double buffering (Alexander Boettcher)
* Route intel/gpu driver to platform driver
* Use Gui session instead of framebuffer session (Josef Söntgen)

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
e4ae817e82 ram_fb_drv: RAM framebuffer driver for Qemu
Enable "-device ramfb" to use in Qemu. Also add drivers interactive
using this framebuffer for the "virt_qemu" platform.

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
38d731bd79 libports: Add Mesa-21.0.0 support
* Switch mesa support from DRI to gallium
  Supported drivers are
    - softpipe (Sebstian Sumpf)
    - iris for Intel GPUs (Alexander Boetcher)
    - etnaviv for Vivante GPUs (Josef Söntgen)

* Mesa's generated files are placed into 'contrib/mesa-<hash>/generated'
  and are cloned per default from a separate Git repo in order to avoid
  hash updates upon package build. In case you need to generate files
  yourself use
  ! prepare_port mesa GENERATE_FILES=1

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
9041567f14 libports: Remove Mesa-11.2.2
issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
b6ec4bdf05 libc/stdcxx ABI: symbols for Mesa-21.0.0
issue #4254
2021-08-30 15:00:38 +02:00
Josef Söntgen
dd90424129 libports: libdrm-2.4.105 update
Support for iris and etnvaviv

* entaviv:
  - libdrm on FreeBSD is not prepared for !PCI (and libc our is missing
    <sys/pciio.h>
  - missing <sys/types.h> include in xf86drmMode.c
  - etnaviv relies on linux header files - dummy in $(INC_DIR)
  - IOCTL FreeBSD ↔ Linux have swapped IO/OUT bit
  - O_CLOEXEC differs between FreeBSD ↔ Linux

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
c26c50e59b libports: remove libdrm 2.4.21
issue #4254
2021-08-30 15:00:38 +02:00
Josef Söntgen
ac9e0947fd libc: add HM_REALMEM sysctl
Used by Mesa in the Gallium etnaviv driver.

issue #4254
2021-08-30 15:00:37 +02:00
Josef Söntgen
fb4d357b59 libc: pull in sys/pciio.h
This header is needed by recent versions of libdrm that feature
FreeBSD support.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
7a4626861e gpu/intel: add w/a for gen9 kabylake a0-b0 stepping
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
bac7381be3 gpu/intel: adjust submit batch to linux 5.13 handling
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
6b1f1794c4 gpu/intel: add gen9 forcewake support
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
eab92f8d6f gpu/intel: add clock gating for kabylake
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
ee283c0d12 gpu/intel: dump more in error case
- show hardware read tail & head pointer of ring buffer

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
c5d8a43418 gpu/intel: sanity check tail pointer alignment
According to spec the tail pointer points to the next qword instructions
which will be used by the software.

p 1354, Doc Ref # IHD-OS-BDW-Vol 2c-11.15

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
cc2363d421 gpu/intel: report slice, subslice, eu via gpu info
used by libdrm & mesa-21 clients

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
b287c4888a gpu/intel: update context inhibit setup
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
66ac2dc635 gpu/intel: avoid one-by-off in ring buffer
during wrap.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
6c7bcdd32e gpu/intel: add gen9 w/a for submit batch
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
b2440a72c3 gpu/intel: add more debug registers
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
8a285a7bee gpu/intel: add more debug registers
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
c9809fde67 gpu/intel: remove unused superpage scratch code
Superpages (2M, 1G) are not supported by now, but partially copied over code
from base-hw was around. Remove unused register definitions and remove
non-working super page code do avoid confusion.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
de8327c11a gpu/intel: add more supported chips
support for Gen > 8

+ determine platform, revision and stepping

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
0aa17661cc gpu/intel: avoid overlapping ggtt range allocation
Size argument of ggtt free range check is ignored, which leads to
overlapping allocations inside, which leads to unavailable IO-MEM exceptions
thrown by core.

issue #4254
2021-08-30 15:00:37 +02:00
Norman Feske
82a51d8eaa build: operate ccache in preprocessor mode
This avoids consistency problems when header files are shadowed.

Fixes #4256
2021-08-30 15:00:37 +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
b5dd1dd01b trace: consolidate Trace_buffer implementations
Both, trace_logger and vfs_trace had their own trace_buffer.h. This
commit consolidates the existing implementations and provides the
resulting trace_buffer.h at 'include/trace/'. It thereby becomes part of
the trace api archive.

genodelabs/genode#4244
2021-08-30 15:00:37 +02:00
Johannes Schlatow
ffbd26d63f depot: add trace policy api
genodelabs/genode#4244
2021-08-30 15:00:36 +02:00
Johannes Schlatow
1416b2258f Trace_buffer: do not reprocess last read entry
genodelabs/genode#4244
2021-08-30 15:00:36 +02:00
Norman Feske
436d946300 recipes/api/genode_c_api: add src/lib/genode_c_api
The source codes are needed to use the API because they are statically
linked.
2021-08-30 15:00:36 +02:00
Norman Feske
324ad33736 lx_emul: prevent clk_disable_unused
Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
2cb4157211 lx_emul: support IRQCHIP_DECLARE initcalls
Similar to CLK_OF_DECLARE, this patch extends lx_emul with ability to
extend the __irqchip_of_table with secondary interrupt controllers.

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
c95af254f4 lx_emul: sanitize size 0 for __kmalloc
Driver code such as mfd-core.c may pass 0 as argument n to kcalloc,
which eventually results in an allocation size 0.

  res = kcalloc(cell->num_resources, sizeof(*res), GFP_KERNEL);

Since 'res' is checked against NULL for success, kmalloc must not return
a NULL pointer in this case. The patch works around this issue by
forcing an allocation size of 1 byte in this case.

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
29032caf40 lx_emul: support CLK_OF_DECLARE initcall mechanism
Clock providers such as drivers/clk/sunxi-ng/ccu-sun8i-r.c don't use
regular init calls but declare their init functions via CLK_OF_DECLARE,
which fill the __clk_of_table. Linux populates the table statically by
using special sections declared in the linker script. In contrast, we
populate the table by expanding the macro to global constructor
functions.

The __clk_of_table is then processed by the call of of_clk_init(NULL).

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
36af114d78 lx_emul: enhance krealloc implementation
Issue #4253
2021-08-30 15:00:36 +02:00
Christian Prochaska
149bd999f3 vfs_oss: support more commands for VirtualBox 6 and sndio
Fixes #4252
2021-08-30 15:00:36 +02:00
Christian Helmuth
a6fb61dbf2 vbox6: support dynamic framebuffer resolution
Issue #4031
2021-08-30 15:00:36 +02:00
Johannes Schlatow
50cc51f132 tool: support new u-boot FIT image format
Fixes genodelabs/genode#4250
2021-08-30 15:00:36 +02:00
Christian Helmuth
c54473abea vbox6: update to version 6.1.26
Issue #4031
2021-08-30 15:00:35 +02:00
Christian Helmuth
611e93a5f2 vbox6: kick AHCI asynchronous IO thread
Issue #4031
2021-08-30 15:00:35 +02:00
Christian Helmuth
d6bde82894 vbox6: add libyuv to pkg recipe
Issue #4031
2021-08-30 15:00:35 +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
Christian Helmuth
7618c9410a depot: update recipe hashes 2021-08-18 15:06:12 +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
Johannes Schlatow
81d939f947 test-trace: test destruction of trace subjects
If the trace subjects are not properly destructed when the TRACE client
disappears, enabled sources will be owned by a non-existing client.
In other words, when a TRACE client disappears all sources owned by the
client must be disabled.

genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Johannes Schlatow
9898341d4a depot_autopilot: fix ineffective test-trace
test-trace always passed, although tracing was never enabled because the
trace subject was not within the first 32 subjects.

* increase number of queried subjects
* output error if trace subject was not found

genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Martin Stein
812fdec27c nic_router: propagate dns domain name via dhcp
With this commit, the NIC router DHCP client reads out the first DNS domain
name (DHCP option 15) if any from a DHCP reply that generates an IPv4 config
for a domain and stores the name together with the IPv4 config for that domain.
DNS domain names are reported via the new report tag '<dns-domain>' if the
'config' attribute in the config tag '<report>' is set.

Furthermore, the NIC router DHCP server becomes able to obtain a DNS domain
name from another domain that has a DHCP client dynamically (given the config
attribute 'dns_config_from' is set and no static DNS config is given) or
statically from its configuration (new config tag '<dns-domain>') and propagate
this name with DHCP replies (DHCP option 15).

The 'nic_router_dhcp_*' tests are adapted to test the new feautures.

The commit also gets rid of some mirrored files in
'test/nic_router_dhcp/manager'.

Fixes #4246
2021-08-18 15:06:12 +02:00
Martin Stein
fa64aae7f8 nic_router: config attribute 'dns_config_from'
WARNING: BREAKS CONFIG COMPATIBILITY!

This commit changes the configuration interface of the NIC router in a way that
may break systems that use the component without proper adjustment!

How to adjust:
At each occurrence of the 'dns_server_from' attribute in a NIC router
configuration replace the attribute name with 'dns_config_from'. The attribute
value remains unaltered.

DETAILED DESCRIPTION

The new attribute name 'dns_config_from' reflects that also other aspects of
the DNS configuration of the denominated domain are used by the DHCP server
that holds the attribute. This commit is a preparation for forwarding also the
domain name (DHCP option 15) with the mechanism behind the attribute.

Ref #4246
2021-08-18 15:06:12 +02:00
Martin Stein
1111472af7 nic_router: make Ipv4_config a class
The fact that the IPv4 config was a struct with all data members public was a
mere leftover of an early state of the NIC router. Today, the router
implementation style is to avoid structs and public data members wherever
possible.

This commit slightly changes the behavior of the router regarding log output.
The router used to print malformed IPv4 configurations to the log only if
the 'verbose' config flag was set using this style:

! [my_domain] malformed dynamic IP config: interface 10.0.2.1/24 ...

Now, malformed IPv4 configurations are only printed if the
'verbose_domain_state' config flag is set (like with any IP4v configuration
states) using this style:

! [my_domain] dynamic IP config: malformed (interface 10.0.2.1/24 ...)

Fixes #4242
2021-08-18 15:06:12 +02:00
Martin Stein
9e6f7988c2 nic_router: list dns servers in one dhcp option 6
The NIC router DHCP server used to add an extra option 6 field to DHCP replies
for each DNS server address. This conflicts with RFC #2132 section 3.8 which
states that the addresses should be listed within one option 6 field without
delimiter. The discrepancy is fixed by this commit.

Ref #4242
2021-08-18 15:06:12 +02:00
Johannes Schlatow
80c1459e79 fs_query: catch File::Truncated_during_read
Fixes genodelabs/genode#4241
2021-08-18 15:06:12 +02:00
Johannes Schlatow
0840cfe834 vfs_trace: report correct size for value files
File size must be the same as the number of bytes that can be read from
the file. Otherwise, this will trigger a `Truncated_during_read`
exception.

Fixes genodelabs/genode#4240
2021-08-18 15:06:12 +02:00
Martin Stein
e648e7255a nic_router: optional icmp type 3 on fragm. ipv4
Via a new configuration attribute, the user can decide whether the router
should answer dropped fragmented IPv4 with an ICMP "destination unreachable"
packet and, if so, which value the ICMP code field of this packet should have.
The default is that the router doesn't send such responses (silently dropping
fragmented IPv4). The behavior is tested by the 'nic_router_ipv4_fragm' test.

Fixes #4236
2021-08-18 15:06:12 +02:00
Martin Stein
06a4608f4a nic_router: report dropped fragmented IPv4
If the new attribute 'dropped_fragm_ipv4' of the <report> tag in the NIC router
config is set "yes", the router will report the number of packets that were
dropped per interface respectively domain because fragmented IPv4 is not
supported. The default is not to report the counter. The behavior is tested by
the 'nic_router_ipv4_fragm' test.

Ref #4236
2021-08-18 15:06:12 +02:00
Martin Stein
619474bc90 nic_router: drop fragmented IPv4
The NIC router used to ignore the IPv4 header fields "More fragments" and
"Fragment offset" completely. Therefore higher-level protocols of fragmented
IPv4 were interpreted wrong because each fragment was considered a self-
standing packet, expecting, for instance UDP/TCP headers somewhere inside of
the UDP/TCP data field. Normally, such packets were dropped as soon as the
UDP/TCP checksum check failed because of the misinterpretation. However,
it was also possible for fragmented IPv4 to pass the router although normally
only partially.

IPv4 fragmentation support in the router would introduce some potential
security risks and is presumably not an easy endeavor. So, for now, we settled
on not supporting IPv4 fragmentation. With this commit, the router simply drops
all fragmented IPv4. This is reflected to the log for each fragment as "drop
packet (fragmented IPv4 not supported)" when 'verbose_packet_drop="yes"' is
configured.

The new test 'run/nic_router_ipv4_fragm' is an automated test for this
behavior. The test is added to the autopilot list.

Ref #4236
2021-08-18 15:06:12 +02:00
Martin Stein
b0e558f486 net/icmp: cast from integer to 'Code' enum
Add a function to the header for doing this cast.

Ref #4236
2021-08-18 15:06:12 +02:00
Christian Prochaska
d7a27c448d qt5: implement 'CancelableSyncSocket::Shutdown()'
Fixes #4239
2021-08-18 15:06:12 +02:00
Martin Stein
626b2f9cf2 run/libc_vfs_fs_fat: add to autopilot
Excludes board 'virt_qemu' from the test as we don't have block device drivers
for this board.

Ref #4220
2021-08-18 15:06:12 +02:00
Martin Stein
2533d7b4b6 vfs/fatfs: cleanup implementation
- remove redundant file system factory

- remove dead code block

  The code was guarded by preprocessor directives checking whether the
  contrib code define "_USE_MKFS" is 1. As "_USE_MKFS" is not set one
  for our port of FAT, the code was never executed and can be removed.

- remove uneffective config attributes

  Apparently, the former XML attributes to the plugin 'drive' and
  'codepage' had no effect. I tested them in a scenario with the VFS
  block server on a disk-image boot-module as back end. Regardless of
  the 'drive' value, the block session label was always "0". Regardless
  of the 'codepage' value, the FAT on the disk image succeeded to mount
  when not using '--codepage' for 'mkfs.fat' and failed to mount when
  using '--codepage' to specify a supported but foreign codepage for
  'mkfs.fat' (e.g. "720").

Ref #4220
2021-08-18 15:06:12 +02:00
Martin Stein
60c8369718 lib/fatfs: get rid of global static constructors
There was one global static constructor:

! namespace Fatfs { static Constructible<Platform> _platform; }

This caused applications that used the lib or the <fatfs> VFS plugin to end up
in an uncaught exception due to Genode::Component complaining that method
'construct' returned without executing pending static constructors if they
didn't call Genode::Env::exec_static_constructors().

As the use of Genode::Env::exec_static_constructors() is discouraged in Genode,
this commit rather moves the '_platform' object to the scope of the
initializing function and introduces a global static pointer to the object that
gets set by the initializing function. Although this prevents the exception, it
is, technically speaking even worse than the former solution as the new pointer
isn't checked for validity in contrast to the 'Constructible' object.

However, so far, I don't see a clean solution to this problem without the need
for Genode::Env::exec_static_constructors().

Fixes #4220
2021-08-18 15:06:12 +02:00
Christian Helmuth
b59e2ba677 microcode_intel: archive moved to GitHub finally
As version 20180807a is not provided on GitHub, I updated the port to
the most recent release 20210608.

Issue #2762
2021-08-18 15:06:12 +02:00
Sebastian Sumpf
c3e8c22a6d sculpt: integrate intel_gpu_drv
* the GPU multiplexer now offers the platform service to the Intel
  framebuffer driver (driver_manager)
* ajdusted drivers_managed-pc to hand out resources to the GPU driver
* adjust quotas

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
2fe70f111b intel_fb_drv: Aperture exhaustion and display IRQ patch
* display an error in case the aperture is too small for all
  framebuffers
* handle display engine IRQs only

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
1727de30b7 gpu/intel: free DMA, clear ggtt
* free DMA caps in case platform client's session is closed
* clear GGTT of platform client upon session close

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
6c003a13d2 gpu/intel: add platform service for display handling
The platform services is intented to be used by dde_linux's intel_fb_drv
in order to initlialize displays.

* implement and announce platform session
* limit accessible GTT and aperture of client to 64 MB
* forward display engine IRQs to platform client
* move all PCI resources to 'Igd::Resources' class in order to make them
  accessible by the platform service and the GPU driver
* fix fence register allocation for id zero (return true)

issue #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
11192b18e6 gpu/intel: dump status context register bits
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
fe867765a8 gpu/intel: support multiple exec buffer per client
required for mesa-21

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
ffc89f3edf gpu/intel: let guard page handling up to client
For mesa-21 the client takes care and manages
the virtual address space of the vGPU by itself and the intel/gpu driver
can't add silently a guard page anymore. Move the patch to the drm/ioctl
of the former mesa version.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
067b7d7c67 gpu/intel: deny virtual address above 1 << 48
commit avoids memory corruption in the ppgtt page insertion code

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Josef Söntgen
4b653fbac1 gpu/intel: handle double insertion in PPGTT
As the PPGTT is populated by the client, the client has to account for
guard pages and so forth.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Josef Söntgen
7dc997c8e6 gpu/intel: handle CSB correctly
As it turns out reading both dwords as qword results in mirrored
values, DDTT.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
5d6ea5ef22 gpu/intel: allocate vcpu/engine as part of session
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
a721933771 gpu/intel: move context/ring handling into objects
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
c949e5c90d gpu/intel: remove allocator_guard
Issue #3759 #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
243a9ec3ca gpu/intel: free up context/memory ring
_unmap_dataspace_ggtt requires the cap of Ggtt::Mapping (ring_map, ctx_map)
in order to find the right metadata and to free up the ggtt entries. Also the
pte range is removed already if the metadata was found.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
b3147050cc gpu/intel: add support to report finished batches
- extend gpu multiplexer to report last completed execution buffer
- on client side lookup finished buffers and disable busy state

issue #4233
2021-08-18 15:06:11 +02:00
Martin Stein
f8953de7ac nic_router: replace term "uplink" with "NIC client"
BREAKS CONFIG COMPATIBILITY:
This commit changes the configuration interface of the NIC router in a way that
may break systems that use the component without proper adjustment!

HOW TO ADJUST:
At each occurrence of the '<uplink ...>' tag in a NIC router configuration
replace the tag name 'uplink' with 'nic-client'. The rest of the tag stays the
same.

The term "uplink" for network interfaces in the router that have a NIC session
client as back end was introduced in a time when Uplink sessions didn't yet
exist. Now, they do and, although both an uplink and an Uplink session
normally describe a network session between router and network device driver,
they are based on two different service types (NIC and Uplink). This can easily
cause confusion when integrating the router (the <uplink> is not related to
Uplink sessions) or trying to understand its functioning (an 'Uplink' object
has nothing to do with the Uplink service).

Therefore, this commit introduces the more specific term "NIC client" for an
interface that is based on a NIC session requested by the router. This doesn't
imply any semantic changes at the NIC router. However, the commit also brings a
broader update of the router's README and removes the term "downlink" that was
used only in documentation to refer to interfaces backed by a NIC session
provided by the router. The term was only associated with this meaning because
it is the natural counterpart to an uplink. This isn't appropriate anymore as
the terms for interface types have moved to a more technical level.

The commit adjusts all scenarios in the basic Genode repositories properly.

Fixes #4238
2021-08-18 15:06:11 +02:00
Christian Helmuth
fce525f122 depot: update recipe hashes 2021-07-28 11:27:05 +02:00
Martin Stein
2afae7e7c1 nic_router: uncaught exc. on handling link state
An interface that received a signal for a link-state change accessed its
domain reference without assuming that it could not be attached to a domain
at that moment. This caused the NIC router to crash with an uncaught exception
of type 'Net::Pointer<Net::Domain>::Invalid'. The commit adds a catch
directive for this exception resulting in the handler doing nothing if not
attached to any domain.

Fixes #4222
2021-07-28 11:27:05 +02:00
Martin Stein
d06773b957 run/tz_vmm: remove usb_armory support
The test script failed during preparation of the on-target execution for
USB Armory with the following error:

! can't read "tz_vmm_block_irq": no such variable

Presumably, the script wasn't run anymore since the introduction of the
'tz_vmm_block_irq' variable for i.MX53 QSB. As we do not have infrastructure
for automated testing of the USB Armory and there seems to be not much
interest in using Genode on this platform, this commit simply removes the
support from the script.
2021-07-28 11:27:05 +02:00
Martin Stein
c8a8cbd7be run/tz_vmm: fix deprecated use of board specs
Filtering boards in a run script by specs isn't the right way anymore (the
specs do not exist anymore). Nowadays, we have to use [have_board] instead.

Ref #4229
2021-07-28 11:27:05 +02:00
Martin Stein
00e8e363d8 run/tz_vmm: fix broken network test
For unknown reasons, the former 'wget genode.org' call, that was meant to test
network in the Trustzone guest on imx53_qsb_tz, didn't succeed anymore although
the same call succeeded on my Sculpt VM Linux. However, 'ping 1.1.1.1' still
works, so, the script now uses this as test for networking instead.

Fixes #4229
2021-07-28 11:27:05 +02:00
Martin Stein
8bc861ca71 nic_router: do not re-use ARP request as reply
So far, in order to create an ARP reply, the NIC router merely created a copy
of the corresponding ARP request and modified only those values that differ.
This approach has the disadvantage of re-using bad parameters from a broken
request. The specific use-case that made this visible was an early version of
the Pine board network driver that used to forward ARP requests with a greater
size than required. The ARP replies of the router re-used this size and
confused other network nodes with that. In general, the NIC router should
rely on the data of incoming packets the least possible. Therefore, with this
commit, the router creates a new ARP reply from scratch and uses only those
values required from the corresponding ARP request.

Fixes #4235
2021-07-28 11:27:04 +02:00
Martin Stein
9384e075cb ipv4: get rid of C++ bitsets, add DF/MF flags
The former declaration of the IPv4 packet did not only use the questionable
tool of implementation-defined C++ bitsets but also lacked access to flags
"don't fragment" (DF) and "more fragments" (MF). This commit replaces the
C++ bitsets by using the register framework and introduces accessors for the
missing flags.

Ref #4236
2021-07-28 11:27:04 +02:00
rolandbaer
52011ec034 smbios_decoder: fix timer error message
added timer to run file to fix error message.

Fixes #4237
2021-07-28 11:27:04 +02:00
Alexander Boettcher
908d581a8c qemu-usb/webcam: reset delay packet state
on feature reset initiated by guest

Issue #4078
2021-07-28 11:27:04 +02:00
Johannes Schlatow
b38ec9f238 usb_webcam: correctly enable auto exposure mode
genodelabs/genode#4231
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
9334ec09e2 sculpt: route non-usb block sessions to 'drivers' 2021-07-28 11:27:04 +02:00
Johannes Schlatow
1bfc828826 libuvc: add UVC 1.50 support
genodelabs/genode#4231
2021-07-28 11:27:04 +02:00
Johannes Schlatow
b51b9e1ef3 libusb: fix size of control messages
Fixes genodelabs/genode#4230
2021-07-28 11:27:04 +02:00
Norman Feske
3d36291d7f run/load/fastboot: support 64-bit ARM
This patch lifts the limitation for 32-bit ARM platforms and makes the
parameter --load-fastboot-device optional. If only one device is
present, it can be omitted.

Fixes #4232
2021-07-28 11:27:04 +02:00
Johannes Schlatow
2afb7c5567 nic_router: fix Tcp_packet header fields
data_offset and NS flag were incorrectly read due to missing endianess
conversion. Also fix name of CWR flag.

Fixes genodelabs/genode#4227

genodelabs/genode#4227
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
ee045a68cc os: introduce C-API to Genode services
This commit introduces a C-API to the Uplink session, as well as to
serve as a Block service. It can be used by drivers ported from
C-only projects, like the Linux kernel, or BSD kernels for instance.

Fix #4226
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
1a526e73a3 dde_linux: introduce new lx_emul/lx_kit library
The re-newed approach currently supports ARM 64-bit only.
It depends on the Platform API of the ARM architecture.
It tries to meet the original semantic of the Linux kernel
functions as far as possible. To achieve this, device drivers
using this library should reference the original Linux kernel
headers at foremost. Only the headers in `src/include/lx_emul/shadow`
have to shadow clone the original ones.

Fix #4225
2021-07-28 11:27:04 +02:00
Johannes Schlatow
1aba330ae6 dde_linux: fix packet size calc. of Nic drivers
skb_push() already increases the skb->len by ETH_HLEN, hence adding
ETH_HLEN to the packet_size is redundant.

A too large packet size becomes a problem for large MTUs. With a maximum
MTU of 1500, adding ETH_HLEN twice will lead to a packet size of 1528.
Since this is larger than what we expect for good-old Ethernet (max. 1522),
some clients (e.g. the e1000 model in vbox5) may drop these packets.

Fixes genodelabs/genode#4228
2021-07-28 11:27:04 +02:00
Christian Helmuth
119d72ad94 fetchurl: User-Agent header and HTTP response code
I discovered thinkbroadband.com requires the User-Agent header field and
rejects requests missing it with HTTP response code 403 "access to the
requested resource is forbidden". Now, fetchurl always adds the
User-Agent header fetchurl/LIBCURL_VERSION.

Also the error message now contains the HTTP response code.
2021-07-28 11:25:21 +02:00
Stefan Kalkowski
b16bb82f8b dde_linux: mark lx_emul and lx_kit as legacy
* Move headers in src/include into legacy sub-directory
* Move src/lx_kit to src/lib/legacy/

Fix #4223
2021-07-28 11:25:21 +02:00
Stefan Kalkowski
f939b9ffb5 base-hw: print addr as hex value in cache warning
Ref #4207
2021-07-28 11:25:21 +02:00
Norman Feske
45f5ed173a tool/run: use [board] for naming driver packages
This patch replaces the enumeration of boards in the drivers_nic_pkg and
drivers_interactive_pkg functions by inferring the package names from
the [board] name. This eases the addition of driver packages in external
repositories.

Fixes #4221
2021-07-28 11:25:21 +02:00
Norman Feske
6de19e4a9b tool_chain_auto.run: exercise 'ln -s'
as a regression test for issue #4219.
2021-07-28 11:25:21 +02:00
Norman Feske
5138aeba80 libc: fix nested monitor call in 'symlink'
The symlink implementation wrongly constructed a 'Sync' object within
the context of a monitor call. The 'Sync' constructor indirectly
depended on libc I/O for obtaining the current time, ultimately
resulting in a nested attempt of a monitor call. This could be
reproduced via the base.run script:

  $ cd /home
  $ ln -s a b

The 'ln' command resulted in the following log message:

  [init -> /bin/bash -> 7] Error: deadlock ahead, mutex=0x10ff8c70, return ip=0x500583a7

The patch fixes the problem by splitting the single monitor call into
two monitor calls and moving the construction of the 'Sync' object
in-between both monitor calls, thereby executing the constructor at the
libc application level.

Fixes #4219
2021-07-28 11:25:21 +02:00
Norman Feske
f3908b8283 tool: refine help text of list_dependencies
Issue #4204
2021-07-28 11:25:21 +02:00
Christian Helmuth
fdc4bd2f90 tool/run: absolute source path for load_tftp_inst_cmd 2021-07-28 11:25:21 +02:00
Sebastian Sumpf
4d4cc4fd02 libm: use libm from libc and remove openlibm
- enable libm for x86/arm
- update ieee754 to slightly changed output
- remove openlibm from port

fixes #4213
2021-07-28 11:25:21 +02:00
Sebastian Sumpf
4b10aa94ec base-hw: save/restore fpcr register for ARM_V8
The floating-point (fpcr) control register is user land accessible and
controls, for example, rounding mode.

fixes #3723 and related to #4213
2021-07-28 11:25:20 +02:00
Martin Stein
688379d1ed sel4: fix segmentation fault with CCACHE=yes
Building the elfloader in kernel-sel4.inc has a problem with Genodes CCACHE
make variable. When issuing ...

! ./tool/depot/create mstein/bin/*/base-sel4-* CCACHE=yes

..., building the elfloader used to consume all memory of the host system and
then run into a segmentation fault:

! make[6]: *** [elfloader/elfloader.o] Segmentation fault (core dumped)

This is because the other build system invokes the CCACHE variable as a command
in front of the compiler command. If CCACHE is set to 'yes', the 'yes' command
is called and produces an endless output into some output file. The problem
can be fixed by locally re-setting the CCACHE variable for the
'make ... elfloader' command to 'ccache' (Genode CCACHE==yes) or '' (Genode
CCACHE!=yes).

Fixes #4212
2021-07-28 11:25:20 +02:00
Martin Stein
0074a7c4ac tool/depot: fix forwarding of CCACHE
The depot tool 'build_bin_archive' used to ask only whether CCACHE is empty or
not and, if it wasn't empty, the tool added 'CCACHE := yes' to the build.conf
of the temporary build dir. This caused the sub-build processes to use ccache
even when the top-level CCACHE variable was set to a bogus value.

Also adds documentation of the CCACHE variable to the help message of the
'build' and 'build_bin_archive' tool.

Ref #4212
2021-07-28 11:24:56 +02:00
Martin Stein
388e2a0e6d fec nic driver: fix compiler warnings
Fixes #4178
2021-07-28 11:24:55 +02:00
Christian Prochaska
a856bfb4ab qt5: implement 'SyncSocket' with pipes on Genode
Fixes #4208
2021-07-28 11:24:55 +02:00
Christian Prochaska
3824c0ca5f qt5: ignore 'fcntl(F_SETLK)' error in sqlite3 implementation
Fixes #4194
2021-07-28 11:24:55 +02:00
Robin Eklind
40e2aa6617 builddir/run_x86: add note regarding missing -no-kvm switch
Also, add -enable-kvm notes as commented out QEMU_OPT option.

Updates #500.
2021-06-28 11:38:20 +02:00
Martin Stein
2d017ad7b7 nic_router: guard against exception in free_ip
Adds try-catch-statement with diagnostic errors in Dhcp_server::free_ip in
order to guard against exceptions from the underlying bit allocator. These
exceptions should never happen given that the router is programmed correctly
and always feeds Dhcp_server::free_ip with sane arguments (which it should).
However, should this not be the case, we can assume that the failed IP freeing
indicates that the IP isn't allocated anyway and it's fine to continue using
the router. Furthermore, IP allocations are a mere client service and not
relevant for the integrity or safety of the router.

Ref #4200
2021-06-25 11:57:28 +02:00
Martin Stein
be644098d7 nic_router: fix exc. in Interface::handle_config_3
When Interface::handle_config_3 (third step of applying a new configuration to
interfaces) tried to detach the interface from the current IP config because
the old and new IP config differed, it did so using the new domain. The former
steps of the reconfiguration already installed the new domain reference at the
interface. Therefore, also the DHCP server of the new domain was used. This,
however caused uncaught exceptions because detaching from an IP config
includes dissolving all DHCP allocations. This dissolving of DHCP allocations
now operated on a DHCP server (the one of the new domain) that wasn't related
to the allocations and, in the worst case, caused an uncaught exception
because the IPs were out of its range.

That said, this commit ensures that detaching an interface from an IP config
is always done on the domain from which the IP config originated. Normally,
this is the domain the interface is attached to. But in the case of
Interface::handle_config_3, it is another - the former domain the interface
was attached to.

The commit also adapts the nic_router_dhcp_* tests in a way that they
reconfigure the router in a way that would trigger the uncaught exception
without the fix.

Fixes #4200
2021-06-25 11:57:24 +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
Sebastian Sumpf
a6fe6c90d4 tool_chain: add ENABLE_FEATURE support
default: "c c++ ada go gdb"

This allows to build a subset of the Genode tool chain

issue #4094
2021-06-25 11:55:41 +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
Stefan Kalkowski
ed0cc5330e tool/dde_linux: add list_dependencies utility
Fix #4204
2021-06-25 11:43:41 +02:00
Johannes Schlatow
b83c8f35c6 depot: ffi for x86_32
genodelabs/genode#4201
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
a242bfce48 libports: ffi for x86_32
- Required by glib

issue #4201
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
19a7997734 qemu-usb: consume device report during controller construction
Initially parse the USB devices report after the signal handler is
registered, do not rely on a signal to be triggered (issue #1788).

Fixes #4206
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
a58473dece autopilot: add usb_hid_reconnect run script
- Adjust script to run on Qemu x86 only

fixes #4205
2021-06-25 11:43:41 +02:00
Christian Helmuth
cd25dc4e6a dde_bsd: prevent ‘nonnull’ argument warning
The implementation conflicted with the implicit declaration of bzero:

.../repos/dde_bsd/src/lib/audio/mem.cc: In function ‘void bzero(void*, size_t)’:
.../repos/dde_bsd/src/lib/audio/mem.cc:377:2: warning: ‘nonnull’ argument ‘b’ compared to NULL [-Wnonnull-compare]
2021-06-25 11:41:46 +02:00
Christian Helmuth
c585e008b1 acpica: prevent recursive 'memset()' calls with gcc 10
Thanks to Peter for the patch.

Issue #4125
2021-06-25 11:41:45 +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
Martin Stein
0dc7084b0f wifi_drv: fix compile warnings with gcc 10
Fixes #4202
2021-06-25 11:41:45 +02:00
Martin Stein
16c4aacf34 vfs/dir_fs: allow opening empty dirs
Adapts Dir_file_system::open_composite_dirs in a way that it returns "success"
when the leaf node of the path is an empty directory but "lookup failed", as
usual, if one of the other directories on the way to the leaf node is empty.

I couldn't find a technical reason why we used to return "lookup failed" when
only the leaf node was empty.

The commit also adds a test for en empty root directory and empty
sub-directories to the fs_query run script.

Fixes #4198
2021-06-25 11:41:45 +02:00
Martin Stein
6bfdddd0b5 fs_query: gracefully deal with missing directories
The fs_query component used to exit with an uncaught exception if a queried
directory didn't exist. Now, fs_query will catch this event and simply skip the
affected query, thereby indicating to the user the inexistence of the
queried directory.

Ref #4032
2021-06-25 11:41:45 +02:00
Johannes Schlatow
026b117a63 separate sandbox api from os
genodelabs/genode#4191
2021-06-25 11:41:45 +02:00
Norman Feske
e5600fea06 dde_linux/extract_initcall_order: support v5.12
This patch adjusts the 'extract_initcall_order' utility to the changed
initcall symbol syntax introduced in Linux by the following commit:

   https://github.com/torvalds/linux/commit/a8cccdd9

It uses an additional sed step to strip away the kmod prefix,
__COUNTER__, and __LINE__ information so that the symbol names match
those of earlier kernel versions.

Issue #4188
2021-06-25 11:41:45 +02:00
Norman Feske
f541668604 dde_linux/create_dummies: show objs for variables
Issue #4188
2021-06-25 11:41:45 +02:00
Norman Feske
bf7500ad7b dde_linux/create_dummies: out-of-tree build dir
This patch enables the tool/dde_linux/create_dummies tool to operate on
a out-of-tree build directory. The Linux source tree is determined by
examining the build directory's Makefile.

Issue #4188
2021-06-25 11:41:45 +02:00
Norman Feske
29b7c5a202 dde_linux/create_dummies: show symbol details
When combining the 'show' command with a defined LINUX_KERNEL_DIR,
each symbol gets annotated with the object file where it is defined.

Issue #4188
2021-06-25 11:41:45 +02:00
Johannes Schlatow
7346defc26 usb_modem_drv: remove nic_server mode
genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
dff1df0b49 usb_modem: do not fail on netif_stop_queue
genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
2c87c68a5d depot: add ffi api and src archives
Fixes genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
52a4293bbc depot: add usb_modem_drv archives
genodelabs/genode#4201
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
ff57bf617b usb_webcam: webcam run script
Run script for quickly testing webcams in Qemu or on target.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
818f1682ee qemu-usb: flush EP improve isochronous handling
- Patch the XHCI model in order to handle frame wrapping correctly. For
  this adjust 'mfindex_kick' to the correct period (same, before, or after
  'mfindex').

- Flush EP when it is stopped, this causes all pending packets for the EP
  to be acked. Correct counting of packets in flight.

- Add BEI patch by Josef.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
eabda8907f usb_host: add support to flush EP transfers
This causes all pending transfers of a EP to be canceled and in turn to
be acked by the raw session.

issue #4196
2021-06-25 11:41:44 +02:00
Alexander Boettcher
4aa99fd1a9 qemu-usb: reduce cpu load by webcam model
if no new frame is available for capturing

Fixes #4078 #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
ff452619e3 vbox5-nova-capture: Set camera to 640x480@30fps
Default to 30fps

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
19a5fee70b depot_deploy: add <capture> session announcement
Announce Capture session if node is present in runtime.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
c66a196f76 usb_webcam: package recipes
- API packages for: libusb, libuvc, and libyuv
- Source packages for: API packages + USB webcam app
- Meta package for USB webcam
- Raw package for USB webcam configuration

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
9165c7601d libyuv: make shared object
- Adjust port to Genode expected layout
- Make shared library
- Adjust dependent infrastructure to change

issue #4196
2021-06-25 11:41:44 +02:00
Martin Stein
ff128df131 dde_linux/fec: fix unsynchronized TX DMA write
Unfortunately, our current implementation of 'wmb()' doesn't seem to do what we
want it to do. On base-hw + imx6q_sabrelite, the write of bdp->cbd_sc seems to
get re-ordered after the write to txq->bd.reg_desc_active in the transmission
path of the contrib code. Due to this, the transmission of the packet is only
triggered the next time a packet is sent. However, we only quick-fix it by
enforcing the execution of the write with a volatile global read as we will
soon update the FEC NIC port with a new DDE approach anyway.

Fixes #4010
2021-06-25 11:41:44 +02:00
Christian Prochaska
747d01e854 qt5: adapt QtWebEngine contrib code for use of nss
Fixes #4192
2021-06-25 11:41:44 +02:00
Christian Helmuth
331844c979 vbox6: support capslock="rom" mode
In ROM mode the global CapsLock state is controlled by the capslock ROM
by virtual KEY_CAPSLOCK events.

Guests are easily confused by spurious KEY_CAPSLOCK input events in
caps="rom" mode. These spurious events may reach the VMM if KEY_CAPSLOCK
is not pressed as first key in a combination and, therefore, is not
filtered as global key. We filter KEY_CAPSLOCK in ROM mode in the VMM
explicitly, but let it pass in non-ROM mode.

Per default RAW mode is used and CapsLock key events are sent unfiltered
to the guest.
2021-06-25 11:41:44 +02:00
Christian Helmuth
434d007dc1 stdcxx: some missing symbols for basic_string
Revealed with -O0 when linking test/lx_fs_notify/file_writer.

Issue #4070
2021-06-25 11:41:44 +02:00
Pirmin Duss
7db6f457d4 lx_fs: enable watch
Enable watching files via the inotify interface of the Linux Kernel.

Delivery of watches to components is staggered in order to prevent an
overflow of the ACK queue in cases when a lot of changes are made to the
file system from the Linux side.

Fixes #4070
2021-06-25 11:41:44 +02:00
Christian Helmuth
37f1873f2e vbox5: drop KEY_CAPSLOCK events on capslock="rom"
Guests are easily confused by spurious KEY_CAPSLOCK input events in
caps="rom" mode. These spurious events may reach the VMM if KEY_CAPSLOCK
is not pressed as first key in a combination and, therefore, is not
filtered as global key. Now, we filter KEY_CAPSLOCK in ROM mode in the
VMM explicitly, but let it pass in non-ROM mode.

Fixes #4087
2021-06-25 11:41:43 +02:00
Christian Helmuth
002037ce15 vbox6: support MAC address overwrite 2021-06-25 11:41:43 +02:00
Christian Helmuth
2a1a47b598 vbox6: update to version 6.1.22 2021-06-25 11:41:43 +02:00
Alexander Boettcher
ab31de0f6a libc_integration: reduce rounds for x86_32
autopilot mode. The test machine is less powerful as the x86_64 one.

Issue #3967
2021-06-25 11:41:43 +02:00
Pirmin Duss
a37ff1d985 lx_fs: enable session quota upgrades
Issue #4070
2021-06-25 11:41:43 +02:00
Pirmin Duss
4053e1628b lx_fs: support for unlink
This is based on the work of @ehmry and @sidhussmann.

Issue #4070
2021-06-25 11:41:43 +02:00
Alexander Boettcher
27004e1fd5 usb: remove monolithic usb driver
+ adjust README files

Fixes #4173
2021-06-25 11:41:43 +02:00
Johannes Schlatow
b09e69a444 ports: change bashrc path
genodelabs/genode#4163
2021-06-04 11:29:04 +02:00
Johannes Schlatow
758c0a21cc depot: add jschlatow download and pubkey
Fixes #4185
2021-06-03 08:23:50 +02:00
Christian Prochaska
60eec251e0 qt5: increase stack size of QtWebEngine render thread
Fixes #4168
2021-06-02 10:36:01 +02:00
Stefan Kalkowski
336350fe60 sculpt: enable support for MNT Reform2 2021-06-01 15:53:48 +02:00
Stefan Kalkowski
8408bf6ac0 fec_nic_drv: remove nic_server mode
Issue #4133
2021-06-01 15:51:22 +02:00
Alexander Boettcher
73d87073af vbox5/6: avoid negative timeouts in xhci model
Fixes #4184
2021-05-31 15:36:53 +02:00
Sebastian Sumpf
cf2527269f qemu-usb: allocate host devices after webcam
Because qemu-usb allocated host devices after 'USB_HOST_DEVICE' in the
object array and 'USB_WEBCAM' is loacated after 'USB_HOST_DEVICE' the
webcam model can overwrite an already allocated pass-through device. As
a solution add the 'USB_FIRST_FREE' to make it clear from where host
devices can be allocated. Also increase the number of supported host
devices to eight.

fixes #4182
2021-05-31 15:19:46 +02:00
Christian Prochaska
520b69ef0d libports: update expat port
Fixes #4183
2021-05-31 15:19:44 +02:00
Christian Helmuth
c0150f97e5 version: 21.05 2021-05-31 13:24:05 +02:00
Norman Feske
5dc7d55cc0 News item for version 21.05 2021-05-31 13:24:04 +02:00
Norman Feske
fd2f137a9b Release notes for version 21.05 2021-05-31 12:41:38 +02:00
Christian Helmuth
1d52bd017d depot: update recipe hashes 2021-05-28 14:16:46 +02:00
Josef Söntgen
e06f3bba27 drivers_managed-imx8q_evk: fix hdmi device node
By now the 'compatible' name is set via the 'type' attribute.

Fixes #4181.
2021-05-28 14:16:46 +02:00
Stefan Kalkowski
1d12755401 depot: add i2c api package
Fixes #4180
2021-05-28 14:16:46 +02:00
Stefan Kalkowski
f2ac341003 depot: add architectural content to os api package
Fixes #4179
2021-05-28 14:16:45 +02:00
Christian Prochaska
f2ff1a6d52 dde_linux: save and restore ARM FPU state in setjmp.S
Fixes #4161
2021-05-28 14:16:45 +02:00
Johannes Schlatow
4383579db6 window_layouter: improve focus history
If no window has ever been focused, next() always returns an invalid
window id. As a consequence, there is no way to cycle through the focus
history without an explicit focus event (e.g. mouse hover).

Instead, next() should return the first window from the focus history if the
currently focused window is not present.

Fixes genodelabs/genode#4164
2021-05-28 14:16:45 +02:00
Christian Helmuth
f0b9549376 wifi_drv: optionally report MAC address
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
aab6f52325 wifi_drv: remove nic_server mode
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
6e85a73a28 ipxe_nic_drv: optionally report MAC address
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
4abc530974 ipxe_nic_drv: remove nic_server mode
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
583ba0e9db ipxe_nic_drv: eliminate static constructors
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
62f83b7198 linux_nic_drv: optionally report MAC address
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
464f0eaf8b linux_nic_drv: remove nic_server mode
Issue #4133
2021-05-28 14:16:45 +02:00
Josef Söntgen
0f72a342f3 wifi_drv: fix setting 'bssid' in config
The wpa_supplicant refuses to set the BSSID in case it is quoted.
Removing the quotes allows for specifying the BSSID in the
configuration.

Fixes #4175.
2021-05-28 14:16:45 +02:00
Alexander Boettcher
3dff399fba netperf_*_usb: fix cap quota for sel4+hw x86
Fixes #4016
2021-05-28 14:16:45 +02:00
Alexander Boettcher
0aa99648d7 run: use usb/hid driver in VM tests
Issue #4173
2021-05-28 14:16:45 +02:00
Alexander Boettcher
6b9fcc9449 drivers_interactive-rpi: use usb host/hid driver
Issue #4173
2021-05-28 14:16:45 +02:00
Alexander Boettcher
f9c7947c45 drivers_interactive-pc: use usb host/hid driver
Issue #4173
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
28189ba77a tool: simplify initcall order extraction
The new tool `extract_initcall_order` generates a header file out of a
Linux kernel build, which provides a sorted array with the initcall function
names of the kernel build. The order states the order in which the initcall
have to be called. It gets extrated out of the Linux kernel System.map.

Fixes #4172
2021-05-28 14:16:45 +02:00
Alexander Boettcher
fc5903c917 themed_decorator: upgrade cap and memory on demand
Issue #4150
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
7f6f710bd2 imx8mq_platform_drv: introduce reset domains
A reset domain can consist of one or several reset-pins
denoted by name that are assigned to a device.
When the device gets acquired via the Platform RPC API,
the pins are de-asserted, and asserted again when the
device gets released.

A configuration looks like the following:

  <device name="mipi_dsi>
    <reset-domain name="mipi_dsi_pclk"/>
    ...
  </device>

Fixes #4171
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
ed7d6c74f4 i2c: extend API to support transactions
Introduces the notion of a transaction that consists of one or more
messages. Whereby a message has a read or write direction and consists
of one or more bytes.

Issue #4170
Fixes #4169
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
9f099bd61c base-hw: use generalized util/array.h
Issue #4170
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
6780cf0790 base: introduce array utility
Fixes #4170
2021-05-28 14:16:45 +02:00
Christian Prochaska
7b197d54ed tool chain: update gdb to version 10.2
Issue #4094
2021-05-28 14:16:44 +02:00
Alexander Boettcher
933de21339 base: add platform_info to microkernel platforms
Add to older platforms also the info ROM to avoid confusion/red messages.

Issue #4016
2021-05-28 14:16:44 +02:00
Alexander Boettcher
509e5aa776 platform(x86): report features via platform_info
Report via platform_info the capabilities of the kernel, e.g. ACPI and MSI.

With the commit the try-catch pattern on IRQ session creation by the platform
driver is avoided.

Issue #4016
2021-05-28 14:16:44 +02:00
Christian Prochaska
e1abd2db4e base-linux: update arm32 seccomp policy
Issue #4136
Issue #3466
2021-05-28 14:16:44 +02:00
Christian Helmuth
faf491ce92 smartcard: replace usb_drv by usb_host_drv 2021-05-28 14:16:44 +02:00
Alexander Boettcher
98f524bb41 qemu-usb/webcam: signal capturing off earlier
based on comment in Linux sources. Reduce fallback off-capturing detection
to 1s.

Issue #4078
2021-05-28 14:16:44 +02:00
Sebastian Sumpf
7fcf9053b9 usb_hid: perform device destruction on unplug signal only
- Do not perform desctruction on report updatea in EP because
  'unregister_device' may block on Led state 'update' (synchronous
  control message) leading to the driver being stuck because no more
  signals are received
- Check if device is present in 'submit_urb' calls

fixes #4166
2021-05-28 14:16:44 +02:00
Sebastian Sumpf
6910b880e7 usb_host: make device creation/destruction robust
- Signal device ready depending on state (ready or not) immediately or
  when "actconfig" is set
- Report new devices when ready
- Drain packet stream in case there is no device present (needed for
  synchronous operations at client side)
- Do not use 'session_device' on device destruction, check pointer
  directly instead

issue #4149
2021-05-28 14:16:44 +02:00
Alexander Boettcher
708b7f4619 cpu_balancer.run: adjust quota for seL4 2021-05-28 14:15:28 +02:00
Alexander Boettcher
921a99bb9b tool/run: option to copy tftp served files (x86)
Fixes #4153
2021-05-28 14:15:28 +02:00
Norman Feske
a13dee8d19 tool/dts: for extracting content from dts files
The new tool eases the inspection and pruning of device-tree source
files.

Fixes #4165
2021-05-28 14:15:28 +02:00
Martin Stein
0069660958 rump: fix compiler warning
Fixes two warnings of this type:

! src/lib/vfs/rump/vfs_rump.cc:214:52: warning: narrowing conversion of
! ‘(s.stat::st_mode & 64)’ from ‘__mode_t’ {aka ‘unsigned int’} to ‘bool’
! [-Wnarrowing]
!
!  214 |                           .executable = (s.st_mode & S_IXUSR) };
!      |                                         ~~~~~~~~~~~^~~~~~~~~~

Fixes #4160
2021-05-28 14:15:28 +02:00
Johannes Schlatow
7b09675236 depot: add less recipe
genodelabs/genode#4162
2021-05-28 14:15:28 +02:00
Johannes Schlatow
4bed825956 depot: add diffutils recipe
genodelabs/genode#4162
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
5135ff2dc2 usb_webcam: An app using libuvc for USB webcams
issue #4158
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
4a56171a77 libports: port of libuvc
by Josef Soentgen

issue #4158
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
ae5b4c9624 libusb: Make USB library more robust
- Add reference count for open/close
- Add cancel transfer support
- Handle packet stream correctly

issue #4158
2021-05-28 14:15:28 +02:00
Josef Söntgen
46c846ef91 libports: add iso handling to libusb
issue #4158
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
c8c589d91a libyuv: enable MJPEG support
issue #4158
2021-05-28 14:15:28 +02:00
Josef Söntgen
5254930930 libports: update jpeg library to v9d
issue #4158
2021-05-28 14:15:28 +02:00
Martin Stein
70797fe879 fs_tool: add <new-file> operation
Adds the <new-file> operation to the fs_tool. When configured, the
<new-file path="...">...</new-file> tag will cause creation or overwriting of
the file given through the 'path' attribute. The file will contain the text
content of the tag.

Ref #4032
2021-05-28 14:15:28 +02:00
Norman Feske
100583e262 os/vfs.h: New_file utility
This patch moves the utility from the app/text_area to os/vfs.h to make
it easier to use by other components. By hosting the 'New_file' as a
friend alongside the 'Directory', we can now pass a 'Directory' as
constructor argument, which is consistent with other utilities such as
'File_content'.

As a further improvement, the new version supports the implicit creation
of the directory hierarchy leading to the new file.

Issue #4032
2021-05-28 14:15:27 +02:00
Norman Feske
57fbd2b658 os/vfs.h: Directory::create_sub_directory
This method can be used to create a directory hierarchy within a
'Directory'.

Issue #4032
2021-05-28 14:15:27 +02:00
Alexander Boettcher
9549eeeca4 ssh_terminal: avoid deadlock during bind callback
Issue #4095
2021-05-28 14:15:27 +02:00
Christian Helmuth
9166a75f2c foc: map uncached normal memory bufferable
Mapping normal memory bufferable restores support for unaligned reads on
DMA memory and prevents the following errors on imx6q_sabrelite.

  KERNEL0: alignment error at 18003061 (PC: 0102e3f8, SP: 401ffb18, FSR: 90000001, PSR: 20000110)

Issue #4094
Issue #4157
2021-05-28 14:15:27 +02:00
Martin Stein
dd587c6712 fs_query: support querying file sizes
By adding an attribute 'size="yes"' to a query, one instructs fs_query to
report also the size of each queried file as attribute 'size' of the
corresponding 'file' node.

Ref #4032
2021-05-28 14:15:27 +02:00
Martin Stein
3ed26e7bb2 fs_query: watch only readable files
The fs_query component used to try watching all files it found resulting in
errors on files that are not watchable. For some files, however, the watch-
feature doesn't make sense as they are not readable (no content, no size).
Now, fs_query will check first whether a file is readable and skip watching
if it isn't.

Ref #4032
2021-05-28 14:15:27 +02:00
Martin Stein
6e900f147c fs_query: read content only from readable files
When configuring fs_query to print the content of files it used to try so for
all files it found resulting in errors on files that are not readable. Now,
fs_query will check first whether a file is readable and skip printing the
content of those that are not.

Ref #4032
2021-05-28 14:15:27 +02:00
Tomasz Gajewski
0507d3f44b ssh_terminal: fixed managing ssh file descriptors
Managing ssh event file descriptors was performed from two different
threads which could cause reallocation of structure used in other thread
in a call to 'poll' function.

Splitted initialization to parts and moved ssh event part into ssh loop.

Issue #4095
2021-05-28 14:15:27 +02:00
Tomasz Gajewski
0b641ba581 ssh_terminal: fixed race condition during startup
Moved creating ssh loop thread after initialization of wake up server
file descriptors to make sure that they will be properly handled even in
first loop run.

Issue #4095
2021-05-28 14:15:27 +02:00
Martin Stein
b3a229eebb vfs_block: write less to the log
Remove calls to the Genode log functions that were done unconditionally or
according to a static verbosity flag.

Ref #4032
2021-05-28 14:15:27 +02:00
Martin Stein
fd0a4e78c8 rump: write less to the log
Remove calls to the Genode log functions that were done unconditionally or
according to a static verbosity flag.

Ref #4032
2021-05-28 14:15:27 +02:00
Stefan Kalkowski
74d826d1ad tool: simplify Linux dummy function generation
The new tool `create_dummies` easily lists missing references,
while porting subsystems of the Linux kernel to Genode, e.g., device drivers.
Moreover it can automatically generate dummy implementations for functions
and global variables.

Fixes #4156
2021-05-28 14:15:27 +02:00
Alexander Boettcher
b6b9801c20 seoul: fix ahci model busy bit handling
A warning, discovered during GCC 10.3 update, got fixed wrongly.

Issue #4097
2021-05-28 14:15:27 +02:00
Stefan Kalkowski
b22d9385f1 imx8mq_platform_drv: enable root clock div setting
Fixes #4155
2021-05-28 14:15:27 +02:00
Stefan Kalkowski
516601b7ba os: add Platform::Device::sigh_omit_initial_signal
Add possibility to register an interrupt handler without triggering
an initial spurious interrupt for ported device driver code.

Fixes #4154
2021-05-28 14:15:27 +02:00
Alexander Boettcher
67a8f29697 rump_ext2.run: increase cap quota for sel4 2021-05-28 14:15:27 +02:00
Josef Söntgen
3e284558a1 drm: account for guard page
This makes the rendering issue with mesa gears disappear.

Issue #4148
2021-05-28 14:15:27 +02:00
Alexander Boettcher
04d8e03ecb mesa: use 32bit RGB in egl platform lib
Fixes distortion in mesa gears i965

Issue #4148
2021-05-28 14:15:27 +02:00
Alexander Boettcher
cfe29b0e52 libc_integration.run: specify random source
After update of stdcxx, either hardware (CPU) random sources are taken
or, if not available/insufficient, /dev/urandom is used.

Issue #3967
Issue #4094
2021-05-28 14:15:27 +02:00
Alexander Boettcher
d4b9be8d44 stdcxx: support /dev/urandom
when cpu does not provide sufficient hardware support. (happens on our
nightly test machine as also build machine).

Issue #4094
2021-05-28 14:15:27 +02:00
Johannes Schlatow
db97af8dec vfs: fix read of large files in fs_file_systems
For fs_file_systems, reads are limited to the size of the packets from the
File_system session. Hence, we cannot read the large files in one go.

This fix is particularly helpful for fonts_fs, as it enables including font
files from a File_system.

genodelabs/genode#4135
2021-05-28 14:15:27 +02:00
Johannes Schlatow
4daf19ec7e vfs_ttf: update glyphs when font file changes
genodelabs/genode#4135
2021-05-28 14:15:27 +02:00
Christian Prochaska
18a43c1afd base-foc: fix assignment in 'Ipc_pager::acknowledge_exception()'
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Helmuth
813f4d976b lxip: allocate skb with properly aligned IP header
Comment in Linux sources:

  Since an ethernet header is 14 bytes network drivers often end up with
  the IP header at an unaligned offset. The IP header can be aligned by
  shifting the start of the packet by 2 bytes. Drivers should do this
  with:

  skb_reserve(skb, NET_IP_ALIGN);

This is ensured when using netdev_alloc_skb_ip_align().

Issue #4094
2021-05-28 14:15:26 +02:00
Sebastian Sumpf
a24224ffc3 usb_host: improve isochronous performance on Intel
This patch takes advantage of block transfer interrupts on Intel XHCI
controllers which is used during isochronous transfers. Because of a bug
in hardware (see usb_host_isoc_bei.patch header), this feature has been
disabled for Intel leading to up to 8000 interrupts/s for isochronous
transfer causing severe CPU consumption on Genode. With this commit we
lower host driver consumption to normal levels.

issue #4149
2021-05-28 14:15:26 +02:00
Sebastian Sumpf
9543161827 usb_host: Move task to device in USB session
A Lx::Task is now associated to a USB device not the session any more.
This implies that a task lives as long as the device making it possible
to gracefully handle outstanding requests (i.e., synchronous) in case
the session has been closed.

issue #4149
2021-05-28 14:15:26 +02:00
Martin Stein
a0517686ca ports/libsparkcrypto: update for GCC 10
The old port version contained '*.ali' files that were build with an older GCC
which led to problems when compiling packages that use the port with the new
GCC 10. The '*.ali' files of the new port version were generated with GCC 10.

Fixes #4145
2021-05-28 14:15:26 +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
Alexander Boettcher
f8d0552d52 libc_integration: fix out-of-bound access
which leads to sporadic pagefaults/segmentation faults.

Fixes #3967
2021-05-28 14:15:26 +02:00
Martin Stein
139a2cfae9 tool: use local LC_ALL=C instead of LC_COLLATE=C
We used to export 'LC_COLLATE=C' for the environment of Genode tools. This was
meant to ensure that sorting is always done C-style and not dependent on the
users locale settings. This is required, for instance, to ensure that the same
archive always yields the same hash.

However, 'export LC_COLLATE=C' is not sufficient. It can be outruled by an
'LC_ALL' setting in the users environment. The manual of 'sort' recommends to
set 'LC_ALL=C' locally if you want reliable results and this is what this
commit does. Furthermore it removes the former 'export LC_COLLATE=C'
directives.

Note that I couldn't find a way to set 'LC_ALL' local to 'exec ... sort' in
TCL. This is why I set it global instead using TCLs 'env' array.

Note that the Make directive '$(sort ...)' and the TCL directive 'lsort',
unlike the Shell directive 'sort', are not affected by the users locale
settings.

Fixes #4144
2021-05-28 14:15:26 +02:00
Alexander Boettcher
1c20ed12c1 qemu: sanity check misconfigured memory for okl4
Issue #4095
2021-05-28 14:15:26 +02:00
Alexander Boettcher
d516544a1f ssh_exec_channel.run: use default Qemu memory size
The default size is on most kernels 512M. On OKL4 we have to use 800M,
because of the statically configured memory ranges in the OKL4 kernel.

By avoiding a specific amount of memory, the default Qemu memory sizes are
used.

Issue #4095
2021-05-28 14:15:26 +02:00
Martin Stein
f8b2fd522b ports/ada-runtime: update to support gcc 10
Fixes #4128
2021-05-28 14:15:26 +02:00
Christian Prochaska
471d34a367 Remove mpc and mpfr ports
These ports are not needed anymore with the 21.05 tool chain update.

Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
d5e4ffd191 sanitizer: update to version 10.3.0
Issue #4094
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
a0f5d34e25 stdcxx: update to version 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
9a3d5dcf21 tool_chain: update ali2dep for gcc 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
Sebastian Sumpf
6639261126 binutils: augment equally-named sections again
Revert GNU ld to the old behavior where sections with the same name in multiple
ld scripts are merged. Binutils 2.36.1 creates two sections with the same name.

Fixes #4126
2021-05-10 11:52:27 +02:00
Christian Prochaska
fc902d9e66 tool_chain: update binutils to version 2.36.1
Issue #4094
2021-05-10 11:19:13 +02:00
Christian Prochaska
6a11b78cdf tool_chain: use gcc-provided dependency libraries
Download gmp, mpc and mpfr with the download script provided by the
gcc source tree and let the gcc build system handle the build of these
libraries with the correct compile options. This fixes build issues on
armhf Linux and removes the need to maintain mpc and mpfr ports in
the Genode tree.

Issue #4094
2021-05-10 11:19:11 +02:00
Christian Prochaska
7fd598f0c1 tool_chain: build 'gprbuild' from source
The 'gprbuild' version which is provided by Ubuntu 18.04 has a bug
which prevents it from building 'ali2dep' with gcc/gnat 10. With
this commit, a newer 'gprbuild' version is built from source.

Issue #4094
2021-05-10 11:19:09 +02:00
Christian Helmuth
777923f9bd depot: update recipe hashes 2021-05-10 11:18:12 +02:00
Martin Stein
d2bf565503 nic/zynq: fix packed conversion error with gcc 10
Fixes #4142
2021-05-10 11:17:21 +02:00
Alexander Boettcher
384a8da50b ssh_terminal: use pthread_mutex
to avoid sporadic deadlocks between EP thread and the server loop pthread.

Issue #4095
2021-05-10 11:17:20 +02:00
Alexander Boettcher
b6bdd91cfa nova: avoid unaligned warnings by gcc10
Issue #4126
2021-05-10 11:17:20 +02:00
Christian Helmuth
a5385cebf4 block_cache: explicitly instantiate template function
The explicit instantiation is required because the function is defined
in the compilation unit only but referenced externally.

Fixes #4108
2021-05-10 11:17:20 +02:00
Josef Söntgen
c5c3d7ca98 gpt_write: address unaligned access for name
Turn member into byte array to prevent unaligned memory access.

Fixes #4141.
2021-05-10 11:17:20 +02:00
Norman Feske
d19b751632 nano3d: remove surface-clear optimization
This patch fixes a GCC-10 compile error. Even though the optimization
was quite effective - I measured a speedup of factor 2 - it is not all
that important for the overall application performance. In the nano3d
case, we are talking about 1 vs. 2 percent of CPU time.

Fixes #4140
2021-05-10 11:17:20 +02:00
Christian Prochaska
ff160decec gdb: fix build errors with gcc 10
Fixes #4139
2021-05-10 11:17:20 +02:00
Norman Feske
a4115cfea9 base-linux: discharge timestamp on AARCH64
The kernel-agnostic 'Trace::timestamp' function for arm_64 executes the
'mrs %0, pmccntr_el0' instruction, which is not permitted for user-level
programs on Linux. This patch shadows the generic timestamp.h header
with dummy that returns zero. This return value prompts the timeout
framework to disable the interpolation of time based on timestamps. This
avoid the illegal-instruction abort but comes with two llimitations:

First, time measurements are effectlively limited to a granulariry of 1
millisecond (deliberately constrained by the timer driver).

The quirk is applied when using the base-linux API. Should a generic
application (that uses the base API only) call 'Trace::timestamp'
directly, the illegal instruction is executed.

Issue #4136
2021-05-10 11:17:20 +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
Martin Stein
66feb939e6 cbe_tester: compile errors/warnings with gcc 10
Fixes #4113
2021-05-10 11:17:20 +02:00
Christian Helmuth
1baf844e20 vfs_stress: fix handling of 'char' in error message
Issue #4112
2021-05-10 11:17:20 +02:00
Martin Stein
5fa2efa745 net/dhcp: print readable message types
When a DHCP packet is printed out, it first tries to determine the most
specific message type from the DHCP options and print its human-readable name
right after the protocol name. If finding the message type fails, the less
specific opcode is printed instead, but also in a human-readable way.

Fixes #4131
2021-05-10 11:17:20 +02:00
Norman Feske
ad847d0543 sculpt: fix glitch in fs-browser back arrow
Fixes #4124
2021-05-10 11:17:20 +02:00
Norman Feske
0b36d81c0c base-linux: separate x86-specific code
By moving core's build-description to a library - a pattern already
employed for the other base platforms - we become able to cleanly split
x86-specific code (I/O-port access) from generic code. This is a
prerequisite for enabling non-x86 architectures such as AARCH64.

Issue #4136
2021-05-10 11:17:20 +02:00
Jean-Adrien DOMAGE
a4727c90a8 lx_fs: add os/run/lx_fs_import.run run script
This new runscript demonstrates how a file can be overwritten by vfs
import with the flag overwrite set to false. This is due to a bug
in lx_fs that is not propagating an ernno EEXIST syscall error.

Issue genodelabs#4104
2021-05-10 11:16:24 +02:00
Jean-Adrien DOMAGE
e65b7f3b82 lx_fs: fix errno EEXIST not propagated
This commit introduces a fix for lx_fs to propagate errno EEXIST error.
This prevents vfs <import overwrite="false"> to overwrite an imported
file, if it already exists, without the overwrite flag set to true.

Issue genodelabs#4104
2021-05-10 11:16:24 +02:00
Josef Söntgen
0f0edc0134 usb_host: implement sg_pcopy_* as TRACE dummies
The former implementation called 'TRACE_AND_STOP' which led to the
'usb_host_drv' to stop whenever such a function was called. Rather
than stopping return '0' and let the contrib code deal with this
situation.

Issue #4116.
2021-05-10 11:16:24 +02:00
Josef Söntgen
d0f084d449 usb_host: backport xhci bounce-buffer fix
This commit backports the Linux upstream commit (d4a6106) [*]
that introduces a check to prevent the sglist from being used
unconditionally.

[*] 'xhci: fix bounce buffer usage for non-sg list case'

Fixes #4116.
2021-05-10 11:16:24 +02:00
Christian Prochaska
c7b2314d23 foc: fix errors with gcc 10 and binutils 2.36
Fixes #4118
2021-05-10 11:16:24 +02:00
Christian Helmuth
eb94f03416 microcode.run: do not twiddle with MAKEFLAGS
Unconditionally setting MAKEFLAGS to just 's' is not nice because other
flags cannot be passed through the run script. What the script desires
is to disable the automatically enabled '--print-directory' for sub-make
instances when calling tool/port/current by declaring
'--no-print-directory'.
2021-05-05 11:55:27 +02:00
Norman Feske
516a9a6925 depot: update recipe hashes 2021-05-05 11:35:31 +02:00
Norman Feske
fdb1a4dd88 base-linux: avoid legacy syscalls
Until now, Genode's Linux system call bindings were based on original
Unix system calls that were later superseded by more flexibile variants.
E.g., 'openat' is a modern version of 'open'. Even though Linux upholds
the compatiblity with the original versions for existing architectures
like x86, the legacy syscalls are absent for the recently added AARCH64
architecture. A good overview of the system calls accross the prominent
architectures can be found at

https://chromium.googlesource.com/chromiumos/docs/+/master/constants/syscalls.md

This patch updates Genode's syscall bindings to avoid legacy versions,
thereby easing the support for AARCH64. The used "modern" versions
were introduced back in Linux version 2 days. So we are fine to rely
on them.

The patch slightly changes the signature for lx_stat because this system
call is merely used to check for the existance of a file and its size.
The new name 'lx_stat_size' draws a closer connection to its use case.
That said, the stat syscall has not been updated to the modern statx
since statx is still a fairly recent addition.

Issue #4136
2021-05-05 11:35:31 +02:00
Norman Feske
d477062c56 base-linux: simplify clone syscall binding
This patch simplifies the use of the clone system call for creating
processes and threads. Until now, the binding used an opaque pointer
argument to pass context information to the newly created process or
thread. However, upon close inspection, this is not a strict
requirement.

A newly created thread accesses its contextual information by
using its stack pointer as key. The pointer argument is not used.

The creation of processes is strictly serialized because the
intermediate stack used in-between clone and execve is a global
variable. Since we rely on the serialization anyway, we can pass the
context information of a new process via a global variable as well.

This change simplifies the syscall binding for the upcoming AARCH64
support, which would otherwise require us to deal with the notion
of TLS on Linux.

Issue #4136
2021-05-05 11:35:31 +02:00
Norman Feske
811009d18b News item about Sculpt 21.03b update 2021-05-05 11:35:31 +02:00
Christian Prochaska
00d13cf304 qt5: fix build errors with gcc 10
Fixes #4132
2021-05-05 11:35:31 +02:00
Martin Stein
49184fb938 net: circumvent stringop-overflow error
With the update to GCC 10, the compiler stopped with an error when compiling
places where a MAC address is copied from outside into a packed object using
the Net::Netaddress::copy method (e.g. in
Net::Arp_packet::dst_mac(Mac_address)):

! error: writing 6 bytes into a region of size 4 [-Werror=stringop-overflow=]

While trying to find a clean solution for this error, I found posts on
gcc.gnu.org and github that stated that the size calculations that cause these
errors are incorrect. Indeed, I could verify that the actual size of the two
regions was static and exactly the same in places were the error occured.

Furthermore, I couldn't find a way of making it more clear to the compiler
that the sizes are the same. By accident, we found that using the address of
the first element of the array that forms the second region instead of the
array address itself, somehow circumvents the error.

Fixes #4109
2021-05-05 11:35:31 +02:00
Martin Stein
52e8c95321 net: fix packed-conversion compiler warning
With the update to GCC 10 the compiler used to warn when using the internet
checksum functions on packet classes (like in
Net::Ipv4_packet::update_checksum):

warning: converting a packed ‘Net::[PACKET_CLASS]’ pointer
         (alignment 1) to a ‘const uint16_t’ {aka ‘const short
         unsigned int’} pointer (alignment 2) may result in an
         unaligned pointer value

Apparently, the 'packed' attribute normally used on packet classes sets the
alignment of the packet class to 1. However, for the purpose of the
internet-checksum functions, we can assume that the packet data has no
alignment. This is expressed by casting the packet-object pointer to a pointer
of the new packed helper struct 'Packed_uint16' that contains only a single
uint16_t member before handing it over to the checksum function (instead of
casting it to a uint16_t pointer).

Ref #4109
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
d5e7870532 virtualbox5: fix build errors with gcc 10
Fixes #4106
2021-05-05 11:35:31 +02:00
Christian Prochaska
bc8dbc6b1a bash: fix build error with gcc 10
Fixes #4107
2021-05-05 11:35:31 +02:00
Christian Prochaska
8f23e377d9 lxip: fix build error with gcc 10
Fixes #4102
2021-05-05 11:35:31 +02:00
Christian Prochaska
aebece5110 readline: fix build error with gcc 10
Fixes #4103
2021-05-05 11:35:31 +02:00
Christian Prochaska
82604f2c2b lx_fs: fix build errors with gcc 10
Fixes #4123
2021-05-05 11:35:31 +02:00
Norman Feske
4563baae77 app/text_area: fix build error with gcc 10
Fixes #4098
2021-05-05 11:35:30 +02:00
Christian Prochaska
c4e3d3dbc4 hw: fix build error with gcc 10
Fixes #4115
2021-05-05 11:35:30 +02:00
Alexander Boettcher
eb53f8c113 seoul: adjust to GCC 10.03
Fixes #4097
2021-05-05 11:35:30 +02:00
Christian Prochaska
07649b667b sel4: fix build errors with gcc 10
Fixes #4121
2021-05-05 11:35:30 +02:00
Christian Prochaska
0f679bb35e pistachio: fix build error with gcc 10
Fixes #4119
2021-05-05 11:35:30 +02:00
Christian Prochaska
d6e9d74038 nitpicker: fix build error with gcc 10
Fixes #4110
2021-05-05 11:35:30 +02:00
Christian Prochaska
405e6744fb nova: update kernel for gcc 10
Fixes #4114
2021-05-05 11:35:30 +02:00
Christian Prochaska
fad85c3fd5 virtualbox6: fix build errors with gcc 10
Fixes #4105
2021-05-05 11:35:30 +02:00
Christian Prochaska
49392dfa44 dde_ipxe: fix build error with gcc 10
Fixes #4101
2021-05-05 11:35:30 +02:00
Christian Prochaska
e627f8320f verify: fix build error with gcc 10
Fixes #4099
2021-05-05 11:35:30 +02:00
Christian Prochaska
8196e229b0 netperf: fix build error with gcc 10
Fixes #4096
2021-05-05 11:35:30 +02:00
Christian Prochaska
0a8394c891 depot_autopilot: store signal context capability as copy
Fixes #4129
2021-05-05 11:35:30 +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
Tomasz Gajewski
23b21812dd Fixes in gdb_monitor_interactive/target_config.run
Fixes #4134
2021-05-05 11:35:30 +02:00
Norman Feske
d66e55ec37 aes_cbc_4k.run: increase timeout
needed for foc/qemu/x86_32
2021-05-05 11:35:29 +02:00
Martin Stein
5dbc9ef244 nic_router: more descriptive port allocator code
This renames some members and local variables in the port allocator in order to
make the code more descriptive.

Fixes #4086
2021-05-05 11:35:29 +02:00
Sid Hussmann
4e822436fc nic_router: use increasing src port for new nat
The NAT feature of the NIC router used to prefer re-using source ports that
have been freed recently. From an external server's perspective, if a client
dies and restarts, chances are high that the new connect arrives with the same
source-IP/source-port as the old connection. The server has to forcefully reset
the connection. If that happens a lot, the server may even start to ignore
further connections from this IP/port combination for a while as a mitigation.

This patch adds a continuous counter feature that makes sure that every new
port allocation will increment and result in a port that hasn't been used for a
long time.

The NAT feature of the nic_router is now more in line with RFC 6056 chapter 4.

Ref #4086
2021-05-05 11:35:29 +02:00
Alexander Boettcher
ce75b25fd4 ssh_exec_channel: adjust cap quota for seL4
Issue #4095
2021-05-05 11:35:29 +02:00
Josef Söntgen
118e8ee6e1 ssh_terminal: flush buffer on Terminal cleanup
Issue #4095.
2021-05-05 11:35:29 +02:00
Alexander Boettcher
f236e99b5c ssh_terminal: avoid deadlock of EP and pthread.0
pthread.0 acquires a write buffer mutex and calls potentially
blocking fs operations. The EP thread handles session requests and tries to
acquire the same write buffer lock. IO progress events for pthread.0 are
handled by the EP thread, which however is blocking on the write buffer mutex.

The commit uses two write buffers, one which is filled by the EP and a second
which is used by pthread.0. The two buffers are swapped protected by a mutex
without invoking blocking fs operations.

Issue #4095
2021-05-05 11:35:29 +02:00
Alexander Boettcher
86e09b60c4 exec_terminal: sandbox errors about unknown node
The exec_terminal generates a config report which is used as input ROM for
sandbox/init, which does not support an "<empty>" node.

An empty config node is empty, without an node.

Issue #4095
2021-05-05 11:35:29 +02:00
Johannes Schlatow
373b45a0f0 depot: fix content.mk of drivers_managed-pc
Was still using the event_filter.config from drivers_interactive-pc
although a dedicated file is present in the raw archive.

The fix is just for consistency reasons, as sculpt manager is generating the
event_filter.config anyway.
2021-05-05 11:35:29 +02:00
Johannes Schlatow
a2491c30b3 event_filter: add new test cases
genodelabs/genode#4069
2021-05-05 11:35:29 +02:00
Johannes Schlatow
d80b2a150a event_filter: add <log> node
genodelabs/genode#4069
2021-05-05 11:35:28 +02:00
Johannes Schlatow
c802de2cf9 event_filter: add <ignore-key> node
Fixes genodelabs#4069
2021-05-05 11:35:28 +02:00
Johannes Schlatow
e86387d557 event_filter: allow remapping of KEY_UNKNOWN
KEY_UNKNOWN is a collective symbols for all unknown keycodes.
Remapping thus requires iterating through all corresponding codes
instead of only applying the policy to the first match.

Issue genodelabs#4069
2021-05-05 11:35:28 +02:00
Norman Feske
f6aabfe233 Sculpt: prevent nitpicker's resize warnings
This patch increases the RAM quota of the top-level nitpicker instance
to 12 MiB so that resize operations can be buffered for resolutions up
to 2560x1080. It mutes diagnostic messages of the form "Warning: Gui
(...) not enough RAM to preserve buffer content during resize" and
improves the window-resize experience.
2021-05-05 11:35:28 +02:00
Norman Feske
8617e5cee0 Sculpt: un-inspect failed USB storage
With this patch, the user is able to re-gain access to the inspect view
by toggling the inspect button of a file system unrelated to the failed
USB storage device.

Fixes #4090
2021-05-05 11:35:28 +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
Alexander Boettcher
7b9e7361ba vbox5: add capture pkg version
Issue #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
910ea16405 qemu-usb: restrict build to x86
Issue #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
58db8c647a qemu-usb: add usb webcam model
Fixes #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
4826bd82fe qemu-usb: fix spelling
Issue #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
7b90f8f857 libports: add libyuv support
Issue #4078
2021-05-05 11:35:28 +02:00
Johannes Schlatow
bf3ad3baff vbox5/6: pass extra mouse buttons to VM
Fixes #4120
2021-05-05 11:35:28 +02:00
Johannes Schlatow
8a4b52d9e3 vbox: only clear screen if virtual_fb_mode changed
Fixes genodelabs/genode#4085
2021-05-05 11:35:28 +02:00
Johannes Schlatow
a47fd36b9f vbox: fix high VM load after resize
break circle of repeated guest notifications if the guest never
acknowledges a VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST

genodelabs/genode#4084
2021-05-05 11:35:28 +02:00
Christian Prochaska
a2e62db6ec qt5: fix libpng vulnerabilities
Fixes #4089
2021-05-05 11:35:28 +02:00
Alexander Boettcher
7503472ae6 stdcxx: add missing symbols for istream and thread
Issue #3967

triggers using -O0 with test-libc_integration:

libc_integration/main.cc:146: undefined reference to `std::istream::operator>>(unsigned long&)'

contrib/stdcxx-80f380143250d4f951433876698b54fdac32b95f/include/stdcxx/std/thread:67: undefined reference to `vtable for std:🧵:_State'
2021-05-05 11:35:27 +02:00
Johannes Schlatow
1c49da8ce4 terminal: don't overwrite last column until eol
Introduce a new _overflowed state variable to indicate whether the
horizontal boundary was reached already and to omit subsequent character
output.

This state is necessary to maintain a valid cursor position at all
times. The _overflowed attribute is reset once the cursor is moved into
a valid position again.

To harmonise the bounds checking for _cursor_pos modifications, the
`constrain()` method was added.

Fixes genodelabs/genode#4093

Also fixes a bug in `vpa()` and `vpb()` which moved the cursor
horizontally instead of vertically.
2021-05-05 11:35:27 +02:00
Norman Feske
9cb8c37e3a terminal: fix sporadic freeze on font-size changes
The direct execution of application-level code by a watch handler is
troublesome because those handlers are executed at the I/O signal level.
In the concrete case, the watch handler got recursively called because
the handler called _handle_config (application-code), which called the
VFS, which in turn performed a wait_and_dispatch_one_io_signal, which
again invoked the watch handler.

The patch works around the problem by letting the watch notification
trigger the application-level signal for the _config_handler.

Fixes #4091
2021-05-05 11:35:27 +02:00
Pirmin Duss
bb6617ad03 New libc_integration test
I created a test program which stresses the interplay between libc,
pthreads and vfs_pipe and may detect regressions.

The program starts a thread that spawns a bunch of workers, sends and
receives data to them through a pipe. When all data of a worker is
collected, the worker is finished (join()) and a new worker is started.
Both the number of bytes sent to the worker and the size of its
answer are random.

Issue #3967
2021-05-05 11:35:27 +02:00
Tomasz Gajewski
f49ec5b171 tool/run: extract function to copy files
Issue #4073
2021-05-05 11:32:09 +02:00
Tomasz Gajewski
507a7789fb tool/run: avoid error if init.xsd is missing
Issue #4073
2021-05-05 11:32:09 +02:00
Stefan Kalkowski
421d2bed40 platform driver: make device info XML optional
* The device XML information dataspace is only provided,
  when the client's policy states `info="yes"`
* The device XM information gets changed to include the
  physical resource names (I/O memory and IRQ addresses)
  instead of virtual ids and page offset

Fix #4077
2021-05-05 11:31:16 +02:00
Norman Feske
6caa74a18e Remove os/slave.h API
Fixes #3754
2021-05-05 11:21:43 +02:00
Norman Feske
5ac3c335dc Remove pkg/test-dynamic_config_slave
Issue #3754
2021-05-05 11:21:43 +02:00
Norman Feske
e8b97ad684 test/resource_yield: don't use os/slave.h
Issue #3754
2021-05-05 11:21:43 +02:00
Christian Helmuth
3f450a77e1 Fix touchscreen config in usb_hid README 2021-05-05 11:21:43 +02:00
Johannes Schlatow
462bff5aef dde_linux: test subdevice id for device matching
As linux drivers may distinguish device configuration by pci subdevice id in
addition to the pci device id, the former must also be used for finding the
matching entry. Otherwise, e.g., the iwlwifi driver might load the wrong
firmware.

Side note: Add break statement to save superfluous iterations after
match was identified.

Fixes genodelabs#4076
2021-05-05 11:21:43 +02:00
Norman Feske
ace7c9172b Disambiguate Mmio::local_addr
This is a follow-up fix for "Streamline platform-device API on ARM".
There is an ambiguity of the 'local_addr' method between the inherited
'Attached_dataspace' and the local declaration, which results in the
double application of the sub-page Range::start.

Issue #4075
2021-05-05 11:21:43 +02:00
Emery Hemingway
173264ed1e depot: remove ehmry
Fixes #4082
2021-05-05 11:21:43 +02:00
Christian Prochaska
190eafeaa6 base: handle 'unpack_string()' error in 'Arg::string()'
Fixes #4100
2021-05-05 11:21:43 +02:00
Josef Söntgen
ddf6a0c276 os: add invalid path exception to Path_base
In case the path is invalid during import raise the 'Path_invalid'
exception.

Issue #4088
2021-05-05 11:21:42 +02:00
Josef Söntgen
8f30fc993d libc: check path pointer in file I/O functions
Fixes #4088
2021-05-05 11:21:42 +02:00
Alexander Boettcher
33a64f79dc libc: place pthreads round-robin
if the number of threads started exceed configured placement configuration

Issue #3967
2021-05-05 11:21:42 +02:00
Pirmin Duss
7de62734e5 libc: add pipe2 symbol to symbols
Issue #3967
2021-05-05 11:21:42 +02:00
Norman Feske
d73eaaa14c libc: exclude arm_initfini.c
This compilation unit contains a global constructor, which violates our
assumption that the libc is free of global constructors on ARMv7.
Specifically, the graphical terminal fails with the following message:

[init -> terminal] Error: Component::construct() returned without executing
                          pending static constructors (fix by calling
                          Genode::Env::exec_static_constructors())
[init -> terminal] Error: Uncaught exception of type 'Linker::Fatal'

In this case, the libc-less terminal uses the VFS. The VFS mounts the
ttf VFS plugin. The ttf VFS plugin depends on the libc.

The compilation unit 'arm_initfini.c' can safely be excluded because it
merely initializes the global '_libc_arm_fpu_present' variable, which
is not used by the current version of our libc/libm.

Fixes #4080
2021-04-20 12:12:48 +02:00
Norman Feske
efbed6f7bf depot: update recipe hashes 2021-04-20 12:10:58 +02:00
Norman Feske
5ca024ff8b vfs_block.run: adjust cap quota for seL4 2021-04-20 12:10:58 +02:00
Norman Feske
dc8c899c1d Streamline platform-device API on ARM
This API rework eases the access to memory-mapped I/O registers and
interrupts when using the platform driver. It introduces the notions of

- Platform::Device       - one device obtained from a platform session
- Platform::Device::Mmio - locally-mapped MMIO registers of a device
- Platform::Device::Irq  - interface for receiving device interrupts

The patch touches several drivers. Some drivers would require a
significant structural change to adopt the new API (e.g., net/virtio,
dde_linux drivers, imx gpio). In these cases, the patch adds
compatibility shims meant to be temporary. In other cases (e.g., imx
i2c), the adaptation was simple enough to carry through.

Fixes #4075
2021-04-20 12:10:58 +02:00
Stefan Kalkowski
d1cf9c86b8 os: introduce device type in platform driver
* Move "compatible" property value to "type" attribute
* Turn device_by_property helper in Platform::Connection into device_by_type

Fix #4074
2021-04-20 12:10:58 +02:00
Norman Feske
46ca576eac Adjust gcov cap quota for seL4 2021-04-20 12:10:58 +02:00
Norman Feske
70281715c6 ssh_exec_channel.run: fix server IP pattern
This patch adjusts the matching of the IP address such that the external
IP address is used as opposed the the NAT-local address. It is follow-up
fix of the conversion to the uplink session interface.

Issue #3961
2021-04-20 12:10:58 +02:00
Norman Feske
4546148ab7 Adjust test-libc_fifo_pipe cap quota for seL4 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
7c01053842 Adjust test-fault_detection cap quota for seL4 2021-04-20 12:10:58 +02:00
Norman Feske
e28709d54d acpi_drv: use expanding reporter
This makes the driver work on newer machines that produce reports larger
than 16 KiB. E.g., Sculpt OS boots successfully on a Lenovo P53s laptop
now.
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
7ae1210531 fs_rom: remove "ROM file is missing" messages
These messages pollute the boot log of Sculpt OS when ROM modules are
requested for files of the config fs before the sculpt manager has
created their first version.
2021-04-20 12:10:57 +02:00
Norman Feske
c9d904df71 vfs/tar: remove "tar archive ..." message
This diagnostic output is a mere debugging artifact. By removing them,
we make the boot of Sculpt less noisy.
2021-04-20 12:10:57 +02:00
Norman Feske
21e9e1840a chroot: forward cap-quota upgrades to the server
Fixes #4072
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
Martin Stein
2084404aba nic_router: explain state report in README 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
af490bdd5b Revert "sculpt: tweak window motions in leitzentrale"
Apparently the skewed motion timings came from the issue fixed by
"timer: restore semantics of periodic timeout 0". With the current
version of the timer, the original motion parameters work just fine.
2021-04-20 12:10:57 +02:00
Norman Feske
0339318572 platform_session: cache arg for alloc_dma_buffer
This patch extends the 'Platform_session::alloc_dma_buffer' interface
with a 'Cache' argument that corresponds to the argument accepted by
'Ram_allocator::alloc', which is used by the platform driver under the
hood.

Since the x86 platform driver used to be hardwired to allocate DMA
buffers as UNCACHED, I adjusted all drivers by specifying the UNCACHED
argument. Right now, this is needed as a hint for core to steer the
allocation of I/O page tables. Once we eliminate the need for such hints
(by introducing an explicit 'Region_map::attach_dma' operation), we can
revisit the drivers individually because cached DMA buffers should
generally be fine on the x86 architecture.

Issue #2243
2021-04-20 12:10:57 +02:00
Norman Feske
53e44f8bfd x86/platform_session: import Genode namespace
This change avoids many repetetive Genode:: prefixes, making the code
easier to read. The patch also includes a few consistency fixes
regarding include guards and file headers. It also renames
Platform_device::String to Platform_device::Device:name.

Issue #2243
2021-04-20 12:10:57 +02:00
Norman Feske
a839b4f0bb gdb_monitor: adapt to sandbox library changes
Issue #4068
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
3ed8df9089 x86/platform_drv: add Platform::Session::dma_addr
This patch adds the designated alternative to Dataspace::phys_addr to
the platform-session interface. Under the hood, the platform driver
still calls Dataspace::phys_addr but it should eventuelly become the
only caller before we can abolish this function.

Issue #2243
2021-04-20 12:03:05 +02:00
Norman Feske
97a9ad114c platform_session: bus_addr_dma_buffer to dma_addr
Issue #2243
2021-04-20 12:03:04 +02:00
Norman Feske
f5f5b8c1f1 sandbox/init: route model
This commit optimizes the 'Child::resolve_session_request'
implementation by introducing an internal 'Route_model' for quickly
traversing routing rules instead of parsing XML on each session request.

Fixes #4068
2021-04-20 12:03:04 +02:00
Norman Feske
b661459aca sandbox/init: parse config using 'List_model'
This commit replaces the hand-crafted config processing by the use of
the 'List_model' utility. This has the following advantages:

- The parsing follows a common formalism that makes the code
  easier to maintain and to understand. Several parts of the code
  had to be changed (for the better) to make it fit the list model
  approach. E.g., the child states have become more expressive
  and logical.

- In the common case, the XML data is traversed only once, which
  increases the parsing speed in dynamic scenarios.

- The code becomes easier to optimize. In particular, the patch skips
  the re-evaluation of the session routing if no service is affected
  by the config change.

The patch also revisits the init test by removing overly long sleep
phases and extending a few sleep phases that were too short when
executing the test on Qemu.

Issue #4068
2021-04-20 12:03:04 +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
97d44c5a79 app/menu_view: use CUSTOM_TARGET_DEPS 2021-04-20 12:03:04 +02:00
Tomasz Gajewski
1867cf4967 iwl_firmware: use CUSTOM_TARGET_DEPS 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
ac07f9d08e sculpt: skip GUI handling until framebuffer is up
This avoids unneeded activity of the Leitzentrale GUI (e.g., the
decorator) at the early boot phase of Sculpt.
2021-04-20 12:03:03 +02:00
Norman Feske
ed9487b452 rtc_drv: defer init until first use
This patch avoids the RTC driver's aggressive polling during the
(CPU-bounded) boot of Sculpt OS. As the RTC is not needed during bootup,
this patch reduces the boot time (on Qemu) by 2-4 seconds.

Fixes #4065
2021-04-20 12:03:03 +02:00
Norman Feske
729b22f04f rtc_drv/x86: code structure
Give the driver code a proper context in the form of a 'Driver' class.

Adjusted while investigating issue #4065.
2021-04-20 12:03:03 +02:00
Norman Feske
698f6eb86c gdb_monitor: weaken reliance on sandbox internals
GDB monitor re-uses internal parts of the sandbox library. It thereby
relies on the internal detail of how local headers are included (using
"" instead of the now usual practice <>). A seemingly unrelated change
"init/sandbox: avoid repetitive state reports" eventually broke the
build of the GDB monitor.

This patch makes the GDB monitor less reliant on the way of how the
sandbox includes headers internally.

It also fixes a few warnings caused by the double definition of
__GENODE__ (adding an missing include guard and making the #define
conditional).

Related to issue #4064
2021-04-20 12:03:03 +02:00
Norman Feske
73e8d64c34 init/sandbox: avoid repetitive state reports
Fixes #4064
2021-04-20 12:03:03 +02:00
Christian Helmuth
cb9a26f1ed vbox6: sculpt runtime package
Issue #4031
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
Christian Helmuth
9ac23a18d4 vbox6: synchronize guest-memory handling 2021-04-20 12:03:03 +02:00
Norman Feske
ae8050bb82 wm.run: let nitpicker request fb and input
This patch restores the ability to launch nitpicker within a gui_fb
window. It is a follow-up fix for "nitpicker: make framebuffer and input
optional".

Issue #3812
2021-04-20 12:03:02 +02:00
Tomasz Gajewski
0a849a1681 prepare_port: cache handling for files with paths
This patch is a follow-up fix for issue #4028 that fixes #4061.
2021-04-20 12:03:02 +02:00
Christian Prochaska
f89414c637 libports: update expat port
Fixes #4060
2021-04-20 12:03:02 +02:00
Christian Helmuth
4cdfeb13e2 vbox6: cleanup code and log output
Issue #4031
2021-04-20 12:03:02 +02:00
Christian Helmuth
1a57a5a959 vbox6: refactor vcpu implementation
Also add recent SVM changes from vbox5.

Issue #4031
2021-04-20 12:03:02 +02:00
Norman Feske
96cc660f95 sculpt: system reset via PS/2 and ACPI
This patch enables sculpt to utilize the CPU reset mechanism via the
PS/2 controller as well as the information provided via the ACPI FADT
information. Whenever the /config/system file is changed to <system
state="reset"/>, both mechanisms are triggered.

Supporting both mechanisms is useful because the PS/2-based reset does
not work reliably on modern machines. The PS/2-based reset is useful in
the case when the FADT reset information refers to the PS/2 command
port. In this case, the platform driver is unable to access this port
because it is already handed out to the PS/2 driver. In this case, the
PS/2 driver kicks in.

Issue #2726
2021-04-20 12:03:02 +02:00
Norman Feske
2c7c7767fc platform_drv: respond to <system state="reset"/>
If 'system="yes"' is specified in the <config>, the platform driver now
monitors the content of the system ROM. Should the value become "reset",
a reset is triggered using information obtained from the ACPI driver.

Related to issue #2726
2021-04-20 12:03:02 +02:00
Norman Feske
9f8c555e7d ps2_drv: respond to <system state="reset"/>
This patch adds the option for monitoring a system ROM to the PS/2
driver and issuing a CPU reset whenever the state becomes "reset".

Issue #2726
2021-04-20 12:03:02 +02:00
Norman Feske
fb9f6812e1 acpi_drv: export ACPI reset info from FADT
The change of the platform driver is needed to avoid a parsing error of
the ACPI ROM when encountering an unexpected <reset> node.

Thanks to Alexander Boettcher for the preventing the regression of #3829
and improving the adherence to the ACPI spec when parsing the reset type.

Related to issue #2726
2021-04-20 12:00:09 +02:00
Christian Helmuth
839183d2b6 vbox6: unify EMT and vCPU entrypoint
Issue #4031
2021-04-20 11:57:19 +02:00
Christian Helmuth
c67e78a7f0 vbox6: update to version 6.1.18
Issue #4031
2021-03-29 15:49:59 +02:00
Christian Helmuth
0ac4d1d411 libc: rename special-purpose pthread creation functions
The functions are used by our VirtualBox ports to hook into thread
creation and, thus, are listed in the ABI symbols.

Issue #4031
2021-03-29 15:48:11 +02:00
4599 changed files with 172993 additions and 118756 deletions

5
.gitignore vendored
View File

@@ -7,5 +7,10 @@
/contrib
/depot
/public
/repos/allwinner
/repos/imx
/repos/riscv
/repos/rpi
/repos/world
/repos/zynq

78
.vscode/c_cpp_properties.json vendored Normal file
View File

@@ -0,0 +1,78 @@
{
"configurations": [
{
"name": "EalánOS",
"includePath": [
"${workspaceFolder}/depot/genodelabs/api/libc/**",
"${workspaceFolder}/depot/genodelabs/api/stdcxx/**",
"${workspaceFolder}/repos/**",
"${workspaceFolder}/repos/mml/**",
"${workspaceFolder}/repos/libports/include/**",
"${workspaceFolder}/contrib/mxtasking-07a3844690ae8eb15832d93e29567a5a8e6e45af/include/**",
"${workspaceFolder}/contrib/libpfm4-b0ec09148c2be9f4a96203a3d2de4ebed6ce2da0/include/**",
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/libc/**",
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/spec/x86_64/libc",
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/libc/sys/**",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/std",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/c_std",
"${workspaceFolder}/repos/libports/include/spec/x86_64/stdcxx",
"${workspaceFolder}/repos/base-nova/src/core/include/**",
"${workspaceFolder}/repos/base-nova/src/include/**",
"${workspaceFolder}/repos/base-nova/include/**",
"${workspaceFolder}/repos/base/src/core/include/**",
"${workspaceFolder}/repos/base/src/include/**",
"${workspaceFolder}/repos/base/include/**",
"/usr/local/genode/tool/21.05/lib/gcc/x86_64-pc-elf/10.3.0/include",
"/home/mml/loopbench/**"
],
"defines": [
"__GENODE__",
"__FreeBSD__=12",
"_GLIBCXX_HAVE_MBSTATE_T",
"_GLIBCXX_ATOMIC_BUILTINS_4",
"_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC"
],
"compilerPath": "/usr/local/genode/tool/21.05/bin/genode-x86-gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64",
"compilerArgs": [
"-nostdinc",
"-m64"
],
"configurationProvider": "ms-vscode.makefile-tools",
"forcedInclude": [
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/libc/stdint.h"
],
"mergeConfigurations": true,
"browse": {
"limitSymbolsToIncludedHeaders": true,
"path": [
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/libc/**",
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/spec/x86_64/libc",
"${workspaceFolder}/contrib/libc-c7cd230b11ca71979f32950803bc78b45adfa0ce/include/libc/sys/**",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/std",
"${workspaceFolder}/contrib/stdcxx-d2865c41fafbbf66051d38e7b742c4d5bc2f05a3/include/stdcxx/c_std",
"${workspaceFolder}/repos/libports/include/spec/x86_64/stdcxx"
]
}
},
{
"name": "Genode",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/repos/base/**"
],
"defines": [],
"compilerPath": "/usr/local/genode/tool/21.05/bin/genode-x86-gcc",
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "${default}",
"configurationProvider": "ms-vscode.makefile-tools",
"mergeConfigurations": true
}
],
"version": 4
}

167
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,167 @@
{
"files.associations": {
"*.rasi": "css",
"*.bbmodel": "json",
"*.sublime-snippet": "xml",
"*.hbs": "html",
"*.ejs": "html",
"*.emu": "html",
"lesskey": "lesskey",
"*.Xresources": "xdefaults",
"i3/config": "i3",
"i3/*.conf": "i3",
"polybar/config": "ini",
"polybar/*.conf": "ini",
"*.S": "gas",
"*.html.en": "html",
"*.html.de": "html",
"stop_token": "cpp",
"*.tcc": "cpp",
"initializer_list": "cpp",
"streambuf": "cpp",
"tuple": "cpp",
"memory": "cpp",
"*.def": "cpp",
"array": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"string": "cpp",
"vector": "cpp",
"any": "cpp",
"executor": "cpp",
"internet": "cpp",
"io_context": "cpp",
"memory_resource": "cpp",
"socket": "cpp",
"string_view": "cpp",
"timer": "cpp",
"functional": "cpp",
"rope": "cpp",
"slist": "cpp",
"coroutine": "cpp",
"future": "cpp",
"scoped_allocator": "cpp",
"valarray": "cpp",
"regex": "cpp",
"cstdint": "cpp",
"bitset": "cpp",
"random": "cpp",
"optional": "cpp",
"dynamic_bitset": "cpp",
"mutex": "cpp",
"shared_mutex": "cpp",
"algorithm": "cpp",
"atomic": "cpp",
"bit": "cpp",
"cassert": "cpp",
"cctype": "cpp",
"cerrno": "cpp",
"chrono": "cpp",
"ciso646": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"map": "cpp",
"unordered_map": "cpp",
"exception": "cpp",
"fstream": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"new": "cpp",
"numeric": "cpp",
"ostream": "cpp",
"queue": "cpp",
"ranges": "cpp",
"ratio": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"system_error": "cpp",
"thread": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"utility": "cpp",
"variant": "cpp",
"charconv": "cpp",
"cfenv": "cpp",
"cinttypes": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cuchar": "cpp",
"set": "cpp",
"unordered_set": "cpp",
"codecvt": "cpp",
"condition_variable": "cpp",
"iomanip": "cpp",
"*.run": "xml",
"span": "cpp",
"config.h": "c",
"bench.h": "c",
"hash_map": "cpp",
"hash_set": "cpp",
"strstream": "cpp",
"decimal": "cpp",
"buffer": "cpp",
"netfwd": "cpp",
"propagate_const": "cpp",
"source_location": "cpp",
"complex": "cpp",
"numbers": "cpp",
"typeindex": "cpp",
"bool_set": "cpp"
},
"vscode-as-git-mergetool.settingsAssistantOnStartup": false,
"makefile.makeDirectory": "build/x86_64",
"C_Cpp.errorSquiggles": "enabledIfIncludesResolve",
"C_Cpp.default.cppStandard": "gnu++17",
"C_Cpp.default.cStandard": "gnu17",
"C_Cpp.workspaceSymbols": "Just My Code",
"C_Cpp.inlayHints.parameterNames.enabled": true,
"C_Cpp.inlayHints.autoDeclarationTypes.showOnLeft": true,
"C_Cpp.intelliSenseMemoryLimit": 16384,
"makefile.makefilePath": "",
"makefile.dryrunSwitches": [
"--keep-going",
"--print-directory",
"KERNEL=nova",
"BOARD=pc",
"run/vscode",
"VERBOSE="
],
"C_Cpp.default.intelliSenseMode": "linux-gcc-x64",
"C_Cpp.default.mergeConfigurations": true,
"C_Cpp.autocompleteAddParentheses": true,
"C_Cpp.intelliSenseCacheSize": 20480,
"makefile.buildBeforeLaunch": false,
"makefile.extensionOutputFolder": ".vscode",
"makefile.configurationCachePath": ".vscode/configurationCache.log",
"explorer.excludeGitIgnore": true,
"makefile.buildLog": ".vscode/build.log",
"definition-autocompletion.update_index_on_change": true,
"definition-autocompletion.update_index_interval": 5,
"C_Cpp.intelliSenseEngineFallback": "enabled",
"makefile.extensionLog": ".vscode/extension.log",
"makefile.ignoreDirectoryCommands": false,
"html.format.wrapLineLength": 80,
"editor.wordWrap": "bounded",
"editor.wordWrapColumn": 90,
"editor.fontSize": 12,
"terminal.integrated.shellIntegration.suggestEnabled": true,
"git.mergeEditor": true,
"merge-conflict.autoNavigateNextConflict.enabled": true,
"git.ignoreLimitWarning": true,
"customizeUI.statusBarPosition": "under-panel"
}

15
README
View File

@@ -13,8 +13,8 @@ the project's official website:
[https://genode.org/documentation/general-overview]
The current implementation can be compiled for 8 different kernels: Linux,
L4ka::Pistachio, L4/Fiasco, OKL4, NOVA, Fiasco.OC, seL4, and a custom
kernel for running Genode directly on ARM-based hardware. Whereas the Linux
L4ka::Pistachio, L4/Fiasco, OKL4, NOVA, Fiasco.OC, seL4, and a custom "hw"
microkernel for running Genode without a 3rd-party kernel. Whereas the Linux
version serves us as development vehicle and enables us to rapidly develop the
generic parts of the system, the actual target platforms of the framework are
microkernels. There is no "perfect" microkernel - and neither should there be
@@ -85,6 +85,17 @@ The source tree is composed of the following subdirectories:
keys and download locations of software providers.
Additional hardware support
###########################
The framework supports a variety of hardware platforms such as different ARM
SoC families via supplemental repositories.
:Repositories maintained by Genode Labs:
[https://github.com/orgs/genodelabs/repositories]
Additional community-maintained components
##########################################

24
README.md Normal file
View File

@@ -0,0 +1,24 @@
# EalánOS — An Operating System for Heterogeneous Many-core Systems
EalánOS is a research operating system, based on the [Genode OS Framework](https://genode.org/), that explores new architectural designs and resource management strategies for many-core systems with heterogeneous computing and memory resources. It is a reference implementation of the [MxKernel](https://mxkernel.org/) architecture.
## MxKernel Architecture
The MxKernel is a new operating system architecture inspired by many-core operating systems, such as [FOS](https://dl.acm.org/doi/abs/10.1145/1531793.1531805) and [Tesselation](https://www.usenix.org/event/hotpar09/tech/full_papers/liu/liu_html/), as well as hypervisors, exokernels and unikernels.
Novel approaches of the MxKernel include the use of tasks, short-lived closed units of work, instead of threads as control-flow abstraction, and the concept of elastic cells as process abstraction. The architecture has first been described in the paper [MxKernel: Rethinking Operating System Architecture for Many-core Hardware](https://ess.cs.uos.de/research/projects/MxKernel/sfma-mxkernel.pdf) presented at the [9th Workshop on Systems for Multi-core and Heterogeneous Architectures](https://sites.google.com/site/sfma2019eurosys/).
## Task-based programming
EalánOS promotes task-parallel programming by including the [MxTasking](https://github.com/jmuehlig/mxtasking.git) task-parallel runtime library. MxTasking improves on the common task-parallel programming paradigm by allowing tasks to be annotated with hints about the tasks behavior, such as memory accesses. These annotations are used by the runtime environment to implement advanced features, like automatic prefetching of data and automatic synchronization of concurrent memory accesses.
## Documentation
Because EalánOS is based on Genode, the primary documentation, for now, can be found in the book [Genode Foundations](https://genode.org/documentation/genode-foundations-22-05.pdf).
## Features added to Genode
EalánOS extends the Genode OS framework by functionality needed and helpful for many-core systems with non-uniform memory access (NUMA), such as
- A topology service that allows to query NUMA information from within a Genode component.
- A port of [MxTasking](https://github.com/jmuehlig/mxtasking.git), a task-based framework designed to aid in developing parallel applications.
- (WiP) A extension of Genode's RAM service that enables applications to allocate memory from a specific NUMA region, similar to libnuma's `numa_alloc_on_node`, and thus improve NUMA-locality of internal data objects.
- (WiP) An interface for using Hardware Performance Monitoring Counters inside Genode components. Currently, performance counters are only implemented for AMD's Zen1 microarchitecture.
### Acknowledgement
The work on EalánOS and the MxKernel architecture is supported by the German Research Foundation (DFG) as part of the priority program 2037 "[Scalable Data Management on Future Hardware](https://dfg-spp2037.de/)" under Grant numbers SP968/9-1 and SP968/9-2.
The MxTasking framework is developed as part of the same DFG project at the [DBIS group at TU Dortmund Universitiy](http://dbis.cs.tu-dortmund.de/cms/de/home/index.html) and funded under Grant numbers TE1117/2-1.

View File

@@ -1 +1 @@
21.02
22.08

View File

@@ -1 +0,0 @@
https://depot.1337.cx

View File

@@ -1,37 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQENBFm3BlYBCADR2ZGIWiYurf/urQ+rAZs3HMobXQ/fckc3FOAdY9qiklrvPr9s
maZZyMF+Wn4J2AmsGctJbBUt3ujcmk09AgZIzrHpVJRagUSz9q+bK7NvAfenDC2q
w4HS5yE9DYxXOjxrcS5a2HhKfE5sZef1zPtFIkEZCJXCvh4IL6maLijOrUZPf9R6
VJ+0itNh0hK9KiYsKA7CwrWuFaw7ZenVkEBV1HGXybFh9aInTTSqopyU6qYLDK1X
U0NG24cjM8TDbMGTaoScpLchcftBGEhjYg7Y2FCu455MDVdrmoOoxDINYgDU1KN6
8GBKKJ+xqG703/o550l+rCMB+TxMN5zKTFhXABEBAAG0IkVtZXJ5IEhlbWluZ3dh
eSA8ZWhtcnlAcG9zdGVvLm5ldD6JAVQEEwEIAD4CGwMFCwkIBwIGFQgJCgsCBBYC
AwECHgECF4AWIQRuEEFO5xYHgfX+6P+xTQQ6JrPSxwUCWgHubgUJAZm9OgAKCRCx
TQQ6JrPSxyJ0B/0eBOIloo3zJwtuQnNXe2ZFAmHFF7MJhrr0IpZ0n5K0OHTFPqXN
VJ+vhTGuI/SlF3a9YEHohIT2KKal1aq+/wVkX6Kdi4G4nGTEXdRsTwlzN/GXHBPF
IW0iUOInJOliKReaamsR/rgXXH5sstq2IU4x+NpHMT/OrkQPNSqVX0RjS9i76Awo
+EqdtW8g3y8qWd8WtTfhbMlQLhuzm99aADbspr4nK9WhZ7UHYLJAz/u7LzZlRiI5
hNa85BCPhNuYz5NTHhn4L9r6PdbKPzUV173XrlAtlteYuGIHk4d/zSAwlgDevChL
0MDRq1vvgfQ2V0SwIqRqIfnO31Ph8uktJ8WRiQEfBBABCAAJBQJaAReyAgcAAAoJ
EIZq4LBroLaERpQH/3Dw0H6N9YF2ATmkse6NNNQjxhKSUoA34UBWj0v4Q1AvXEe6
nHRR0mAa9Gije9ixKUg85VbKM3lUhXCFqW5jzyzpF1rzzTpAHaUTYKb8M2D9iRKo
9ejTK3KrgpstYJ8jthfosxeC+lK24WUXKKWPjgoIhv7Thd31ea/PZdkFVd1MpSwg
5BHRHcogsJI9uou7zWYbap9/k0lxKHJWklLh/oXet+aAoUIL0kTU+nILy3/RZJGW
9WlnZR9g3qSQ8YNpgNSrraEtXpcs6MGsWZSzbzJ1U95NL87NbWEOYgHZA++vhEy5
EXVrd8SuSHbUbqNF36gz1cxmEuKwxAaWZ1/UbGW5AQ0EWbcGVgEIANC9LozG/TXV
4j0TniuLrsq7kkNH+OJQexcD19pBrmEV4eYYD6c8BB9CaBITqvKIqtG0VJrmB5S5
D0oW4mQI+TkcX+Q7y3S7dUkc856d03aUX3vVcNhXEbNgM19qxAGieC8WH2kr4XU1
psu1WvFCXOktrE5c8H0rPCQ1jseB0S67XCA9BLwAqlqu0OuTpbWddjXuE1ahi0ig
Yt5YsHvgCMLup208azQqGCnJ5tFotqzbLg3I6+QzMcLySqsN4BzYmUGbOSSZdUhX
DWxwAK1dB8qa27iwsxCMncdGnqOTkq+mXRmu8ztPTUivyC6YHJ+O5lXvMMADZi4j
8RpQQlh5gFkAEQEAAYkBNgQYAQgAIBYhBG4QQU7nFgeB9f7o/7FNBDoms9LHBQJZ
twZWAhsMAAoJELFNBDoms9LHTmIH/0PuzpA3Ezdrb4xfVwnhUUZGiqfNzULCZipT
qtfym6Ove6To4BbXAihWwnCYs4sgipabW1WaXsDDvU+AmOmz4EPyTna23fUzYRSL
MT/kk77d+BGRGeA8/Gj/BgjPlHlFa7ukbT1DL1lSV0RMQ32tDGnhJ7wMBx4GoYU+
xjlsxrYKKdvZKOQVCCFn4KY/GavqT+8pYYI63stSPGspboQR2iboKqc350MVMvzz
IaDt14YiOYlgV6LoNj2VaPJvFqm9ML+plYl4PPQZTV6KAhFWCDJq2DzEQqwG6RU4
SsneHAqMlG4A5SSMTLEd9F2gZ2sJicybr1WbNLj1KF74ckUhpM4=
=p4q9
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -362,6 +362,20 @@ in its 'LIBS' declaration and refers to the tools relative to
'$(BUILD_BASE_DIR)'.
Building additional custom targets accompanying library or program
==================================================================
There are cases when it is important to build additional targets
besides standard files built for library or program. Of course there
is no problem with writing specific make rules for commands that
generate those target files but for them to be built a proper
dependency must be specified. To achieve it those additional targets
should be added to 'CUSTOM_TARGET_DEPS' variable like e.g. in
iwl_firmware library from dde_linux repository:
! CUSTOM_TARGET_DEPS += $(addprefix $(BIN_DIR)/,$(IMAGES))
Automated integration and testing
#################################

View File

@@ -66,7 +66,13 @@ Device drivers
Device drivers usually reside in the _src/drivers/_ subdirectory of source-code
repositories. The most predominant repositories hosting device drivers are
'os', 'dde_ipxe', 'dde_linux'.
'os', 'dde_ipxe', 'dde_linux', 'pc'. The main source tree is accompanied
by a variety of optional source-code repositories, each hosting the support of
a different SoC family such as NXP's i.MX, Allwinner, Xilinx Zynq, or RISC-V.
:Repositories maintained by Genode Labs:
[https://github.com/orgs/genodelabs/repositories]
Platform devices
@@ -138,12 +144,6 @@ capture-session and event-session interfaces respectively.
:_os/src/drivers/framebuffer/pl11x/_:
Driver for the PL110/PL111 LCD display.
:_os/src/drivers/framebuffer/imx53/_:
Driver for LCD output on i.MX53 SoCs.
:_os/src/drivers/framebuffer/rpi/_:
Driver for the HDMI output of the Raspberry Pi.
:_os/src/drivers/framebuffer/sdl/_:
Serves as both framebuffer and input driver on Linux using libSDL. This
driver is only usable on the Linux base platform.
@@ -151,21 +151,17 @@ capture-session and event-session interfaces respectively.
:_os/src/drivers/gpu/intel/_:
An experimental Intel Graphics GPU multiplexer for Broadwell and newer.
:_dde_linux/src/drivers/framebuffer/intel/_:
:_pc/src/drivers/framebuffer/intel/_:
Framebuffer driver for Intel i915 compatible graphic cards based on
the Linux Intel KMS driver.
:_dde_linux/src/drivers/usb_host/_:
:_pc/src/drivers/usb_host/_:
USB host-controller driver that provides an USB session interface to
USB drivers.
:_dde_linux/src/drivers/usb_hid/_:
USB Human Interface Device driver using the USB session interface.
:_os/src/drivers/usb_block/_:
USB storage driver that uses the USB session interface and provides
a block-session interface.
Timer drivers
=============
@@ -209,22 +205,14 @@ Block drivers
All block drivers implement the block-session interface defined at
_os/include/block_session/_.
:_os/src/drivers/sd_card/spec/pl180/_:
:_os/src/drivers/sd_card/pl180/_:
Driver for SD-cards connected via the PL180 device as found on the PBX-A9
platform.
:_os/src/drivers/sd_card/spec/imx53/_:
:_os/src/drivers/sd_card/imx53/_:
Driver for SD-cards connected to the Freescale i.MX53 platform like the
Quick Start Board or the USB armory device.
:_os/src/drivers/sd_card/spec/rpi/_:
Driver for SD-cards connected to the Raspberry Pi.
:_dde_linux/src/drivers/usb/_:
USB driver that makes USB storage devices available as block sessions.
For an example of using this driver, refer to the run script at
_dde_linux/run/usb_storage.run_.
:_os/src/drivers/ahci/_:
Driver for SATA disks and CD-ROMs on x86 PCs.
@@ -232,7 +220,8 @@ _os/include/block_session/_.
Driver for NVMe block devices on x86 PCs.
:_os/src/drivers/usb_block/_:
USB Mass Storage Bulk-Only driver using the USB session interface.
USB Mass Storage Bulk-Only driver using the USB session interface and provides
a block-session interface.
Network interface drivers
@@ -245,7 +234,7 @@ defined at _os/include/nic_session/_.
Driver that uses a Linux tap device as back end. It is only useful on the
Linux base platform.
:_os/src/drivers/nic/spec/lan9118/_:
:_os/src/drivers/nic/lan9118/_:
Native device driver for the LAN9118 network adaptor as featured on the
PBX-A9 platform.
@@ -253,27 +242,17 @@ defined at _os/include/nic_session/_.
Device drivers ported from the iPXE project. Supported devices are Intel
E1000 and pcnet32.
:_dde_linux/src/drivers/wifi/_:
The wifi_drv component is a port of the Linux mac802.11 stack, including the
:_pc/src/drivers/wifi/_:
The wifi driver component is a port of the Linux mac802.11 stack, including the
iwlwifi driver. It enables the use of Intel Wireless 6xxx and 7xxx cards.
:_dde_linux/src/drivers/usb/_:
For the OMAP4 platform, the USB driver contains the networking driver.
:_dde_linux/src/drivers/usb_net/_:
USB network driver using the USB session interface.
:_dde_linux/src/drivers/nic/fec/_:
Driver for ethernet NICs of the i.MX SoC family.
General-purpose I/O drivers
===========================
:_os/src/drivers/gpio/spec/imx53/_:
Driver for accessing the GPIO pins of i.MX53 platforms.
:_os/src/drivers/gpio/spec/rpi/_:
Driver for accessing the GPIO pins of Raspberry Pi platforms.
Resource multiplexers
#####################
@@ -351,10 +330,6 @@ Separate components
Provides each file contained in a tar file obtained via Genode's ROM session
as separate ROM session.
:_os/src/server/iso9660/_:
Provides each file of an ISO9660 file system accessed via a block session as
separate ROM session.
:_os/src/server/lx_fs/_:
A file system server that makes the file system of a Linux base platform
available to Genode.
@@ -369,9 +344,6 @@ Separate components
:_os/src/server/log_terminal/_:
Adapter for forwarding terminal output to a LOG session.
:_os/src/server/fs_log/_:
Adapter that writes LOG messages to files on a file system.
:_demo/src/server/nitlog/_:
Provides a LOG session, printing log output on screen via a GUI session.
@@ -385,9 +357,6 @@ Separate components
switching between configuration variants dependent on the state of
the system.
:_os/src/server/log_terminal/_:
Forwards terminal output to a LOG session.
:_gems/src/server/file_terminal/_:
Provides terminal sessions that target files on a file system.
@@ -403,10 +372,6 @@ Separate components
The terminal crosslink service allows to terminal clients to talk to each
other.
:_gems/src/server/http_block/_:
A block service that fetches a virtual block device over the network from
a HTTP server.
:_os/src/server/fs_rom/_:
A ROM service that translates the 'File_system' session interface to the
'ROM' session' interface. Each request for a ROM file is handled by looking
@@ -450,6 +415,12 @@ Separate components
A wrapper for nitpicker's GUI session interface that applies alpha-blending
to the of views a GUI client.
:_os/src/server/black_hole/_:
Mockup implementation of Genode session interfaces.
:_dde_linux/src/app/wireguard/_:
Port of the Linux implementation of the WireGuard VPN as Genode component.
VFS plugins
===========
@@ -459,6 +430,9 @@ implement the VFS-plugin interface. They can be combined with any application
based on Genode's C runtime, with the VFS server, and with non-POSIX
components that use the Genode's VFS library directly.
:_os/src/lib/vfs/tap/_:
A VFS plugin that allows for packet-level access of a NIC or uplink session.
:_gems/src/lib/vfs/trace/_:
A VFS plugin that makes core's TRACE service accessible as a pseudo
file system.
@@ -489,6 +463,9 @@ components that use the Genode's VFS library directly.
:_libports/src/lib/vfs/fatfs/_:
A VFS plugin that allows for the mounting of FAT-formatted block devices.
:_os/src/lib/vfs/tap/_:
A VFS plugin for the interaction with raw network packets.
:_dde_rump/src/lib/vfs/rump/_:
A VFS plugin that enables the use of NetBSD's file-system drivers such
as ext2 or msdos.
@@ -614,15 +591,11 @@ Package-management components
Runtime environments
####################
:_ports/src/app/seoul/_: Seoul is a virtual-machine monitor developed for
the use with the NOVA platform. It virtualizes 32bit x86 PC hardware
including various peripherals.
:_os/src/server/loader/_: A service that allows the creation and destruction
of Genode subsystems via a session interface. For further information,
refer to _os/src/server/loader/README_.
:_ports/src/virtualbox5/_: VirtualBox running on top of the NOVA hypervisor.
:_ports/src/virtualbox6/_: VirtualBox running on top of the NOVA hypervisor.
:_os/src/server/vmm/_: A virtual machine monitor that is based on
hardware-assisted virtualization of ARM platforms. It is supported on

View File

@@ -4,6 +4,443 @@
===========
Sculpt OS release 22.10 | 2022-10-13
####################################
| Sculpt OS 22.10 is a maintenance release of our Genode-based
| general-purpose OS. It imposes a new rigid regime to the management of
| low-level devices, improves USB hotplug support, and comes with numerous
| performance optimizations.
The just released version 22.10 of the Sculpt operating system bears the fruit
of our year-long effort to apply the rigidity of Genode's architecture to the
management of PCI configuration and device interrupts. This sweeping change
left no single device driver unturned. If we did our job right, you should not
notice any visible difference from the previous Sculpt version.
However, you should definitely _feel_ a difference when using the new version.
We put several performance optimizations in place - from accelerated system
startup, over increased network thoughput, to improved user-interface
responsiveness. Moreover, we put much emphasis on stressing Sculpt's USB
hotplug support, which includes the dynamic assignment and revocation of
USB devices to and from virtual machines.
With respect to available software, Sculpt users can enjoy an updated
Chromium engine - via the Falkon or Morph web browsers - and an updated
audio driver based on OpenBSD 7.1.
Sculpt OS 22.10 is available as ready-to-use system image at the
[https://genode.org/download/sculpt - Sculpt download page] along with
updated [https://genode.org/documentation/articles/sculpt-22-10 - documentation].
Genode OS Framework release 22.08 | 2022-08-31
##############################################
| The overarching theme of Genode 22.08 is the emerging phone variant of
| Sculpt OS, touching topics as diverse as USB ECM, Mali-400 GPU, SD-card
| access, telephony, mobile-data connectivity, the Morph web browser, and a
| custom user interface. Among the further highlights are new tracing tools,
| improved network performance USB smart-card support, and VirtIO drivers for
| RISC-V.
The vision of a Genode-based smart phone is certainly our most ambitious
undertaking since we created Sculpt OS for the PC. Over the past two years, we
relentlessly pursued this vision while targeting the PinePhone hardware.
The scope of work reaches from custom firmware for the system-control
processor, over kernel development, a staggering variety of device drivers, to
the user-interface and application level. With Genode 22.08, those efforts
culminate in a first complete system - a phone variant of Sculpt OS. The
[https://genode.org/documentation/release-notes/22.08 - release documentation]
tells the story behind this line of work in great detail.
Beside phone-related topics, the new release features new tooling for
gathering and analyzing system traces that allow for holistic performance
studies covering the interplay between components. One particular success
story of the new trace recorder is a profoundly improved network performance.
Further highlights are the support for USB smart cards via PKCS#11, VirtIO
drivers for RISC-V, and the update of Qt5 to version 5.15.2.
For the complete picture, please enjoy the official
[https:/documentation/release-notes/22.08 - release documentation of version 22.08...]
Genode OS Framework release 22.05 | 2022-05-31
##############################################
| The highlights of Genode 22.05 are the new support for WireGuard virtual
| private networks and a fresh lineup of PC device drivers. Further topics are
| basic telephony with the PinePhone and dynamic device management on Xilinx
| Zynq.
Version 22.05 closely adheres the goals as set forth in our
[https://genode.org/about/road-map - roadmap].
In particular, the envisioned support of WireGuard VPNs came to fruition
in the form of a dedicated VPN component based on the Linux implementation of
the WireGuard protocol. Thanks to this component, the network access of Genode
systems like [https://genode.org/download/sculpt - Sculpt OS] can now be
protected using state-of-the-art VPN security.
The second prominent topic is the new lineup of PC device drivers, which had
been developed using Genode's novel Linux device-driver environment that
allows the reuse of Linux kernel subsystems as individually sandboxed Genode
components. The work comprises complex drivers like the wireless LAN stack
including Intel's Wifi driver and the latest Intel display driver. The
revamped drivers not only bring the modern feature set of the respective Linux
5.14.21 subsystems to Genode, but they also validate the efficiency of the new
porting approach.
The vision of a Genode-based smartphone appears as a recurring topic throughout
the year, with the current release not being an exception. Three achievements
stand out. First, Genode gained the principle ability to issue and receive
voice calls with the PinePhone. Second, in anticipation of sophisticated
energy-management, the release introduces a Genode-specific custom firmware
for the PinePhone's system-control processor. And third, it is accompanied
with the second revision of the
[https://genode.org/documentation/genode-platforms-22-05.pdf - Genode Platforms]
document that covers the porting process of Genode to a mobile platform in a
tutorial of over 200 pages.
Besides those prominent topics, the release comes with numerous framework
improvements, reaching from a forthcoming new PC platform driver, over
performance optimizations and usability refinements, to dynamic device
management on FPGA-based Xilinx Zynq devices.
Discover these and more topics of the new version in the official
[https:/documentation/release-notes/22.05 - release documentation of version 22.05...]
Genode SoC porting guide | 2022-05-25
#####################################
| In the second revision of the Genode Platforms document, Genode Labs shares
| its former in-house expertise about moving Genode to new hardware devices.
If you ever wondered how to make sense of highly-complex ARM SoCs without
accurate public documentation, what it takes to bring a modern microkernel
from one SoC to another, how to transplant and re-animate individual Linux
kernel subsystems into sandboxed user-level components, or how to craft a
custom bare-bones operating system out of Genode's components, the new
revision of the Genode Platforms document is for you.
[https://genode.org/documentation/genode-platforms-22-05.pdf - Genode Platforms 22.05] (PDF)
During the past two years, Genode developer Norman Feske captured his
practical experience with enabling Genode on a new hardware platform, namely
the PinePhone.
The process starts with basics like executing tiny bits of custom code, and
continues with the porting of the microkernel, creating work flows for testing
and packaging, and bringing up the Genode user land.
With those fundamentals covered, the main part is concerned with the
complexities of driving the device hardware of modern SoCs, ranging from
low-level pin controls, over networking, up to driving sophisticated devices
like the display and touch screen. For the latter, the ability of reusing
device drivers from the Linux kernel plays a crucial role. Hence, the guide
presents Genode's practical methodology and tooling behind the black art of
transplanting and reanimating unmodified Linux kernel code into Genode
components. Along the way, there are countless little tips and tricks that
help to turn low-level grunt work into a fun and worthwhile experience.
The document closes with a glimpse at real-world scenarios, culminating in
the setup of the modem and the routing of audio signals to issue voice calls.
Sculpt OS release 22.04 | 2022-04-28
####################################
| Sculpt OS version 22.04 introduces the concept of service-level sandboxing
| and features completely new drivers for wireless, graphics, and USB.
On the user-visible surface, the new version of Sculpt OS looks and feels
familiar to users of the previous version. Under the hood, however, at the
nitty-gritty hardware-support level, it features completely revamped device
drivers for Intel wireless, Intel graphics, and USB.
In a major surgery, the new drivers got transplanted from the Linux kernel
version 5.14.21 using Genode's unique
[https://genode.org/documentation/release-notes/21.08#Linux-device-driver_environment_re-imagined - DDE]
approach.
In contrast to Linux where the drivers are part of the almighty operating-system
kernel, Sculpt OS hosts each of the drivers in a dedicated sandbox as plain
user-level component. So Sculpt users can enjoy the broad hardware support
of up-to-date Linux drivers without ultimately trusting those staggeringly
complex driver stacks.
Closely related, the support of hardware-accelerated graphics that we
introduced with the previous version
[https://genode.org/news/sculpt-os-release-21.10 - 21.10]
received substantial optimization and stabilization. With the new version,
Sculpt users can not only run native OpenGL applications but can even go as far
as using hardware-accelerated graphics via guest operating systems hosted
within VirtualBox on top of Sculpt.
Being a component-based operating system following the principle of least
privilege, Sculpt OS gives users ultimate control over the system resources
exposed to each component. The new version equips the user with additional
means to exercise control over the deployed software: A new optional
component called black hole can now be used as placeholder for various system
resources when deploying an application. For example, a virtual machine can
be shielded from the network by connecting its network traffic to the black
hole. This also works for audio, video capturing, USB, and other commonly used
system resources. As this mechanism works at the level of individual services,
the documentation refers to it as _service-level sandboxing_, resembling a
poster-child for the natural power of capability-based security.
Sculpt OS 22.04 is available as ready-to-use system image at the
[https://genode.org/download/sculpt - Sculpt download page] and is accompanied
with updated [https://genode.org/documentation/articles/sculpt-22-04 - documentation].
Genode OS Framework release 22.02 | 2022-02-28
##############################################
| With Genode 22.02, 3D acceleration becomes available to guest operating
| systems running in VirtualBox 6, Sculpt OS evolves into a versatile framework
| for building special-purpose operating systems, and Genode starts to interact
| with the modem of the PinePhone.
The features mentioned above are merely the tip of the iceberg of version
22.02. In fact, the majority of the development work during the release cycle
was focused on topics beyond the visible surface, ranging from the
reorganization of the code base for streamlining the targeting of new hardware,
over the tightening of foundational framework APIs, to the raising of the
default warning level used when building genuine Genode components. Over the
course of this infrastructural work, almost no component was left unturned.
Functionality-wise, improvements of the Genode-based Sculpt OS are at the
center stage of the release. Originally pursued with the vision of a
Genode-based general-purpose OS that is fit for day-to-day use on commodity PC
hardware, the current release lifts the potential of Sculpt's architecture for
the creation of special-purpose operating-system appliances. The gained
flexibility took even us developers by surprise! Thanks to the new modular
approach, we were able to demonstrate a bare-bones version of Sculpt OS on
the PinePhone at FOSDEM, or accelerate our development workflow by routinely
running Sculpt OS directly on the Linux kernel.
The intensive device-driver-related developments of the previous releases
continued as well. This time, we took our new approach for running Linux
drivers in Genode to PC hardware, starting with a fresh port of the USB host
controller driver. The Intel GPU driver received numerous performance
improvements and can now even be combined with guest operating systems running
in VirtualBox 6. Further notable driver-related improvements are the new
ability to interact with the modem on the PinePhone and largely streamlined
driver infrastructure for the Raspberry Pi.
All the details of the new version can be found in the
[https:/documentation/release-notes/22.02 - release documentation of version 22.02...]
Road Map for 2022 | 2022-01-18
##############################
| Our plans for 2022 envision the use of Genode for advanced mobile
| use cases such as video chat.
Following Genode's major technical breakthroughs in the areas of reusing Linux
drivers, hardware-accelerated graphics, and the native execution of Chromium
during 2021, we will pursue _mobile usability_ as overarching theme in 2022.
Specifically, we aspire the routine use of Genode on the PinePhone as a
platform for video chat, using WireGuard to protect the communications.
This vision motivates a large variety of challenging technical topics.
To name a few, we have to squeeze good performance out of the
resource-constrained PinePhone hardware, focus on UI latency and the quality
of service of audio streaming, come up with a somewhat usable touch-based
user interface, and get to the guts of power management.
Aside this guiding theme, we put a broad update of our PC drivers on our
agenda so that Sculpt OS remains a suitable basis for our day-to-day
computing needs on recent generations of Intel hardware.
As an additional line of development, we are excited to intensify the
combination of Genode with reconfigurable hardware.
More information about our review of the past year, this year's focus, and a
rough schedule are presented at our official
[https:/about/road-map - road-map page].
Genode OS Framework release 21.11 | 2021-11-30
##############################################
| Genode 21.11 puts the spotlight on device drivers. Interactive Genode
| scenarios come to the PinePhone, hardware-accelerated graphics becomes
| available on Intel Gen9+ and Vivante GPUs, and Xilnx Zynq receives
| new love.
The previous release presented our new take on porting drivers from Linux, and
the architectural integration of hardware-accelerated graphics in Genode-based
systems. The just released version 21.11 is the continuation of both topics.
Thanks to our streamlined approach for transplanting Linux drivers to Genode, we
were able to reuse the PinePhone's Linux drivers for the display and
touchscreen without modification. But, in contrast to running those drivers in
the Linux kernel, we are walking on new ground by confining each driver in a
separate sandbox.
With our GPU line of work, we followed two major directions during the release
cycle. For one, we applied our architectural approach to a second GPU vendor
besides Intel, namely the Vivante GPU as used by the i.MX SoC family.
Combined with the etnaviv Gallium driver of the Mesa library, Genode thereby
becomes able to render graphics with hardware acceleration on the MNT Reform
open-hardware laptop. The second branch is the promised extension of our
custom Intel GPU multiplexer to GPUs of generation 9 or newer. Thereby, GPU
support has now become a regular feature of the Genode-based Sculpt OS that
can be taken for a spin on commodity PC hardware.
Regarding 32-bit ARM platforms, the current release revives our engagement
with Xilinx Zynq devices, which combine FPGA fabric with a 32-bit ARM CPU.
In particular, the release brings the framework to the USRP E310 board,
opening new hardware-software co-design opportunities.
Besides the many hardware-related topics outlined above, two functional
improvements stand out. First, the Genode version of VirtualBox 6 has reached
feature parity with version 5. Both versions can now be used interchangeably
on Sculpt OS. Finally, libSDL2 got upgraded with support for audio and OpenGL,
which is a nice pathway for hosting games on Genode.
The new version is described in full detail by the
[https:/documentation/release-notes/21.11 - release documentation of version 21.11...]
Sculpt OS release 21.10 | 2021-10-14
####################################
| Sculpt OS version 21.10 introduces GPU-accelerated graphics on Intel,
| media playback in the web browser, VirtualBox 6, and USB webcam support.
At the first glance, the just released Sculpt 21.10 looks and feels nearly
identical to the time-tested previous version 21.03. However, a look at the
installable packages reveals a firework of exciting new features.
First and technically most exciting, the new version enables the use of
hardware-accelerated graphics on Intel GPUs, paving the ground for
graphics-intensive applications and games. The GPU support is based on the
combination of the Mesa library stack with our custom GPU multiplexer
as featured in
[https://genode.org/documentation/release-notes/21.08#Advancing_GPU_driver_stack - Genode 21.08].
_Note that this fresh new feature should best be regarded as experimental_
_and be used with caution._
Second, our port of the Chromium-based Falkon web browser has become able to
present media content like videos and sound. Look out for the browser in the
tools menu of cproc's depot. It is accompanied with a ready-to-use audio
driver and a mixer component. In cases where audio output is not desired, the
browser - or any other component that requests audio output - can be connected
to a new component called black hole, which merely mimics an audio driver
without any audible effect.
Third, with the addition of the new file-vault component, Sculpt now provides
an easy way to setup and use an encrypted file store using our custom CBE
block encrypter as underlying crypto container. The file vault is especially
useful in combination with the recall-fs component that provides each client
with a distinct storage compartment.
Finally, the support for USB webcams as introduced with
[https://genode.org/documentation/release-notes/21.05#Webcam_support - Genode 21.05]
has entered Sculpt OS in the form of a new webcam package. The webcam support
can best be combined with our new port of VirtualBox 6 that is available in
addition to VirtualBox version 5. With Sculpt 21.10, both VirtualBox versions
can be used in parallel.
Sculpt OS 21.10 is available as ready-to-use system image at the
[https://genode.org/download/sculpt - Sculpt download page] and is accompanied
with updated [https://genode.org/documentation/articles/sculpt-21-10 - documentation].
More details about individual new features of Sculpt 21.10 will be covered
soon by dedicated articles at [https://genodians.org].
Genode OS Framework release 21.08 | 2021-08-31
##############################################
| The highlights of Genode 21.08 are revamped GPU support as well as new
| drivers for the PinePhone and MNT-Reform laptop based on a new streamlined
| approach for porting Linux kernel code. Further topics range from VirtualBox
| improvements, over media playback in the native web browser, to LTE
| connectivity in Sculpt OS.
For complex driver stacks, Genode largely relies on code ported from other
operating systems. The Linux kernel plays a special role because - being the
basis for Android - it is the de-facto reference for driving the peripherals
of most ARM SoCs. Up to now, however, the porting efforts of driver code from
Linux to Genode used to be a time-intensive affair, which forced a narrow
focus on very few SoCs on us. With the streamlined porting approach introduced
with the new release, we become able to dramatically reduce the costs,
creating the prospect of a much broader hardware support. The first success
stories of the new way of porting are added graphics drivers for the PinePhone
and the MNT-Reform laptop, a network driver for the Pine-A64-LTS board, and an
SD-card driver for the MNT-Reform.
The second spotlight of the release is the largely revamped support for Intel
GPUs. In contrast to our experimental GPU-related work of the past, we have
now identified a way to cleanly integrate GPU support into the GUI
architecture of sophisticated Genode systems such as Sculpt OS. This work is
accompanied with an up-to-date version of the Mesa library stack. In
combination with the improvements of our custom GPU multiplexer, we are now on
a good track to make the use of hardware-accelerated graphics a commodity on
Genode.
Even though most topics of the current release revolve around low-level
driver-related work, the new version improves higher-level functionality as
well. In particular, it adds the modular integration of mobile-data
connectivity to Sculpt OS and enables media playback for our port of the
Chromium web engine. Those and more topics are described in the detailed
[https:/documentation/release-notes/21.08 - release documentation of version 21.08...]
Genode OS Framework release 21.05 | 2021-05-31
##############################################
| Version 21.05 introduces webcam support, features an encrypted file vault
| for Sculpt OS, and adds new drivers for the i.MX8 SoC and Pine-A64.
| Furthermore, it is accompanied with a new tool chain based on GCC 10
| and new guidance documentation for driver development.
Device-driver support remains a prominent topic for almost every release.
The just released version 21.05 is no exception, touching hardware topics
ranging from USB, over I2C on i.MX8, over GPIO on Pine-A64, to networking on
RISC-V. Until now, such nitty-gritty driver-development work has been pursued
almost exclusively by the core team at Genode Labs. To encourage developers
outside the inner circle to join the fun, the release is accompanied with the
initial version of a comprehensive guidance documentation for
hardware-related topics.
Feature-wise the two highlights of the new version are webcam support and an
easy-to-use encrypted file store based on our custom CBE block encrypter.
As detailed by the release documentation, both features leverage Genode's
architecture in unique ways to attain high flexibility without an inflation of
complexity.
The release is rounded up by a new tool chain based on GCC 10 and Binutils
2.36, profound performance optimizations, framework refinements, and new
assistive tooling for porting Linux drivers. All the details of the new
version are covered by the official
[https:/documentation/release-notes/21.05 - release documentation of version 21.05...]
Sculpt OS 21.03 boots now in 2.5 seconds | 2021-05-03
#####################################################
| We have released an updated Sculpt 21.03 image featuring several
| hardware-compatibility tweaks and performance improvements.
Since the official Sculpt OS 21.03 release end of March, we continued our
efforts with refining the user experience and broadening hardware
compatibility, thanks to the user feedback we received. We have now released
an updated system image that includes those refinements as well as several
performance optimizations that boost the boot time of Sculpt to less than 2.5
seconds from the first life sign of the kernel to the graphical user
interface (measured on a 5-years old Lenovo x250 laptop).
You can get the new version of the system image named sculpt-21-03b at the
[https://genode.org/download/sculpt - Sculpt OS download] page.
It is binary compatible with the original release version. So you can use it
as a drop-in-replacement.
For manually reproducing the image, please refer to the corresponding
[https://github.com/chelmuth/genode/commits/sculpt_21_03b - Git branch].
Sculpt OS release 21.03 | 2021-03-24
####################################
@@ -62,7 +499,7 @@ Genode OS Framework release 21.02 | 2021-02-25
| support for the Pine-A64-LTS board, and revived work on RISC-V.
Many topics of the current release draw a connection to our overarching goal
to use Genode on the Pinephone by the end of the year. Besides the obvious
to use Genode on the PinePhone by the end of the year. Besides the obvious
steps of enabling the hardware - starting with the Pine-A64-LTS board - the
release introduces mobile-data connectivity as a Genode feature, and changes
the network-driver architecture in anticipation of dynamic power-management
@@ -86,7 +523,7 @@ For the full story, please refer to the
Road Map for 2021 | 2021-01-15
##############################
| In 2021, we plan to bring Genode to the Pinephone, advance the framework's
| In 2021, we plan to bring Genode to the PinePhone, advance the framework's
| GPU support, and focus on development workflows.
During the annual road-map discussion on Genode's public
@@ -94,13 +531,13 @@ During the annual road-map discussion on Genode's public
the following hot topics for this year emerged.
First and most inspiring for many Genode developers, we aspire to have
Genode running on the Pinephone with basic feature-phone functionality by the
Genode running on the PinePhone with basic feature-phone functionality by the
end of the year. Since this will involve substantial device-driver-related
developments, the team will take this line of work as an opportunity to
advance the tooling and workflows for carrying out such tasks. This, in turn,
will hopefully ease the on-boarding of new driver developers in the future.
Closely related to the Pinephone scenario, the project will make optimizations
Closely related to the PinePhone scenario, the project will make optimizations
a top priority this year. The opportunities are plenty, ranging from
micro-optimizations, over API refinements, to architectural changes if
needed.

View File

@@ -289,9 +289,9 @@ Examining the log file leaves us with the following list of source files:
! FILTER_OUT_dos = cdrom_aspi_win32.cpp cdrom_ioctl_linux.cpp cdrom_ioctl_os2.cpp \
! cdrom_ioctl_win32.cpp
! SRC_CC_dos = $(filter-out $(FILTER_OUT_dos), \
! $(notdir $(wildcard $(DOSBOX_DIR)/src/*.cpp)))
! $(notdir $(wildcard $(DOSBOX_DIR)/src/dos/*.cpp)))
! […]
! SRC_CC = $(DOSBOX_DIR)/src/dosbox.cpp
! SRC_CC = $(notdir $(DOSBOX_DIR)/src/dosbox.cpp)
! SRC_CC += $(SRC_CC_cpu) $(SRC_CC_debug) $(SRC_CC_dos) $(SRC_CC_fpu) \
! $(SRC_CC_gui) $(SRC_CC_hw) $(SRC_CC_hw_ser) $(SRC_CC_ints) \
! $(SRC_CC_ints) $(SRC_CC_misc) $(SRC_CC_shell)

View File

@@ -219,8 +219,9 @@ Base framework and OS-level infrastructure
Increased default warning level
===============================
For building Genode components written in C++, the compiler flags -Wextra,
-Weffc++, and -Werror are now enabled in addition to -Wall by default.
For building Genode components written in C++, the compiler
flags -Wextra, -Weffc++, and -Werror are now enabled in addition
to -Wall by default.
If this strict warning level is inapplicable for a given component or
library, it is possible to explicitly disable the strictness in the

View File

@@ -21,7 +21,7 @@ disrupting network-application stacks.
Second, the release features the infrastructure needed for mobile-data
communication over LTE, which is a prerequisite for our ambition to use Genode
on the Pinephone. Section [LTE modem stack] gives insights into the involved
on the PinePhone. Section [LTE modem stack] gives insights into the involved
components and the architecture.
Third, we are happy to feature the initial version of VirtualBox 6 for
@@ -518,7 +518,7 @@ Pine-A64-LTS single board computer
==================================
Our [https://genode.org/about/road-map - road map] envisions
the use of Genode on the Pinephone by the end of the year. As a first stepping
the use of Genode on the PinePhone by the end of the year. As a first stepping
stone, the current release adds basic board support for the
[https://pine64.com/product-category/pine-a64-ltslong-term-supply/ - Pine-A64-LTS]
single-board computer. We take this line of work as a welcome opportunity to

817
doc/release_notes/21-05.txt Normal file
View File

@@ -0,0 +1,817 @@
===============================================
Release notes for the Genode OS Framework 21.05
===============================================
Genode Labs
The most prominent user-visible features of Genode 21.05 are the support for
webcams and an easy-to-use component for file encryption on
[https://genode.org/download/sculpt - Sculpt OS]. Both topics greatly benefit
from Genode's component architecture. The video-conferencing scenario
described in Section [Webcam support] sandboxes the webcam driver in a
disposable Genode component while using a second instance of the nitpicker GUI
server as a video bridge. This design strikes a beautiful combination of
simplicity, robustness, and flexibility.
The new file vault described in Section
[File vault based on the CBE block encrypter] leverages Genode's dynamic
sandboxing capabilities to manage the creation and operation of an encrypted
file store. Even though the underpinnings can be described as nothing less
than sophisticated machinery, the package presented to the user combines ease
of use with a great sense of control.
The second focus of the current release are the manifold improvements of
Genode's driver and platform support as described in Sections [Device drivers]
and [Platforms]. Our USB support received the attention needed to accommodate
the webcam scenario, the arsenal of i.MX8 drivers got enriched with I2C and
power-domain control, the Pine-A64 board support is growing, Genode has become
able to run on 64-bit ARM Linux, and we enabled principle networking for
RISC-V.
Speaking of platforms, this release features the first version of a new
"Genode Platforms" documentation (Section [Updated and new documentation])
that aids the porting of Genode to new ARM SoCs. With this document, we share
our former in-house know-how and methodology about the porting and development
of drivers with developers outside of Genode Labs.
The release is rounded up by several performance optimizations
(Section [Performance optimizations]) to the benefit of most Genode system
scenarios. Furthermore, it is accompanied with an updated tool chain,
following our established two-years rhythm
(Section [Tool-chain update to GCC 10.3 and binutils 2.36]).
Webcam support
##############
During 2020, the amount of home office and remote work took an unexpected turn.
Video conferences and video chats have become the norm, which people and
companies rely upon. Even though, not to be found on our
[https://genode.org/about/road-map - road map] for 2021, this development
prompted the Genode team to explore the field of webcam and video chat support
on Genode.
Webcams are generally connected via USB to a host device and implement the USB
video device class
([https://www.usb.org/sites/default/files/USB_Video_Class_1_5.zip - UVC spec]).
Therefore, it is possible to drive many different webcam devices using the
same USB interface. To support this protocol, we enabled
[https://ken.tossell.net/libuvc/doc - libuvc], which offers fine-grained control
over UVC exporting USB devices. In order to enable _libuvc_ on Genode, we
simply integrated the library into Genode's port system with no further
changes required. _libuvc_ depends on [https://libusb.info - libusb] as a back
end to access the actual webcam device. While there exists a port of _libusb_
for Genode - that connects through Genode's USB session interface to the USB
host controller - the port still lacked support for isochronous USB transfers
as required by UVC devices. Isochronous transfers represent a continuous
stream of data (either input or output) with a constant rate without delivery
guarantees. We extended _libusb_ to handle isochronous transfers, which were
already supported by Genode's USB session. Observing that this kind of
transfers can cause high load within the USB host driver, we optimized
isochronous transfer support at the host driver level (Section [USB]).
At the front-end side, we created a small _usb_webcam_ component that uses
_libuvc_ in order to enable, disable, and configure the camera. The component
connects to a GUI session, and thus, can be interfaced directly, for example,
to the Nitpicker component for rendering webcam images natively on screen.
Whereas Genode's pixel format is 32 bit RGB, webcams stream data in the YUV2,
MJPEG, or H.264 formats. To handle the conversion of these formats to Genode's
pixel format, we utilize the
[https://chromium.googlesource.com/libyuv/libyuv - libyuv] library and thereby
support the YUV2 as well as the MJPEG pixel format for webcams.
Additionally, we wanted to be able to transfer the webcam data directly into
our VirtualBox port, thus enabling, sophisticated video conference systems
like Jitsi or Skype.
[image webcam]
Our USB host-controller support for VirtualBox is based on the ported Qemu USB
3.0 (XHCI) controller model. Since no USB webcam device model is available for
Qemu, we were required to develop a one from scratch. The new USB webcam model
is attached to the QEMU USB XHCI controller and operates as a bulk endpoint.
In contrast to an isochronous endpoint, the model causes less CPU load and
fewer virtual interrupts. The supported formats offered to the guest are YUV2
and BGR3. By enabling the USB webcam model within the Genode VirtualBox
configuration, a _Capture_ session is used to capture pictures at the rate of
a configured _fps_ value. The following snippet shows the default values of
the supported configuration attributes.
!<config ...>
! ...
! <webcam width="640" height="480" fps="15" vertical_flip="false"
! screen_size="false" report="false"/>
! ...
!</config>
If the _screen_size_ attribute is set to _true_, the device model determines
the resolution from the established capture session. Otherwise, the specified
_width_ and _height_ values are used. The _vertical_flip_ attribute is useful
for the BGR3 format, which is - when interpreted by Linux guests - flipped
vertically and can be flipped back by setting the attribute to _true_.
If the _report_ attribute is set to _true_, a report will be generated
whenever the guest changes the state of the webcam model, either by switching
capturing on/off or by changing the pixel format.
! <capture enabled="true/false" format="YUV2/BGR3"/>
[image webcam_chat]
Finally, our developers, croc and lion, setup the Webcam scenario in Sculpt
and test drive the new feature fascinated. The picture shows a session via
Jitsi, on the right side croc participates at the meeting via a Win10 VM on
Sculpt and lion sitting left joined via an Android tablet.
Performance optimizations
#########################
One of the overarching topics of this year's
[https://genode.org/about/road-map - roadmap] is optimization.
As part of working on the Sculpt OS
[https://genode.org/news/sculpt-os-21.03-boots-now-in-2.5-seconds - version 21.03],
we identified several optimization vectors with the potential for user-visible
improvements. In particular, while interacting with the system, a few effects
made us curious.
Operations that involved changes to the runtime subsystem, e.g., adding or
reconfiguring a component, seemed to interfere with multi-media workloads.
When running a graphical animation, we could see it stutter in such
situations. Another direction of our curiosity was the boot time of the
system. The boot time of Sculpt OS has always been relatively quick compared
to commodity operating systems. E.g., on a 5-years old laptop like a Lenovo
x260, the system used to boot in about 5 seconds to the graphical user
interface. However, with the anticipation of Sculpt OS on lower-end platforms
like the PinePhone and with the vision of instant-on systems, we wondered
about the potential for improvement.
While gathering a CPU-load profile of the boot process using the top tool, we
learned that the boot time was bounded not by I/O but by the CPU load (the
kernel's idle thread did not appear in the profile). Interestingly, a
significant portion of the cycles were consumed by various instances of the
init component, which prompted us to turn our attention to the implementation
of init.
Clock-cycle measurements
------------------------
The next natural step was the benchmarking of various code paths of init using
a cycle-accurate time-stamp counter (TSC). Even though Genode has a
'Trace::timestamp' utility readily available, it remains barely used for
manual instrumentation because such instrumentations require too much labor:
allocation of state variables for gathering the statistics, computing time
differences, traffic-shaping of the debug noise (needed whenever investigating
highly frequently called code). These tasks should better be covered by a
utility so that friction-less performance analysis can become a regular part
of our development work. As a side effect of our investigation, we came up
with a new utility called GENODE_LOG_TSC. This utility is covered by a
dedicated article.
:Performance analysis made easy:
[https://genodians.org/nfeske/2021-04-07-performance]
Thanks to GENODE_LOG_TSC, we were able to identify three concrete
opportunities for optimization in a course of one evening. First, the dynamic
reconfiguration of init apparently did not scale well with a growing number of
components. The code for analysing differences of configuration versions
relied on doubly nested loops in order to stay as simple as possible. With the
typical number of 30 or more components/subsystems hosted in Sculpt's runtime,
we passed a tipping point where quadratic time complexity is justifiable.
Second, during a configuration update, the XML data is evaluated in multiple
passes, which puts pressure on the efficiency of Genode's XML parser. This
pressure could in principle be relieved. Third, the process of taking
session-routing decisions involved XML parsing. In scenarios as sophisticated
as Sculpt, the routing rules can become quite elaborate. Since the rules are
consulted for each session route, the costs for the rule evaluations stack up.
Init optimizations
------------------
These realizations motivated us to replace the hand-crafted configuration
processing by the use of Genode's generic 'List_model' utility. This way, the
parsing follows a common formalism that makes the code easier to maintain and
to understand while reducing the XML parsing to a single pass. The increased
formality cleared the way for further optimizations. In particular, init
became able to skip the re-evaluation of the session routing whenever no
service is affected by the configuration change. This is actually the common
case in Sculpt.
To alleviate the costs for evaluating session routes, we introduced an
internal data model for the routing rules that is optimized for the matching
of routes. With this model, the detection of a definite mismatch (the common
case) comes down to a comparison of a single numeric value.
Combined, those optimizations yield a great effect. In a typical Sculpt
system, the time of a dynamic reconfiguration got reduced by factor 10 to the
order of 10 to 20 milliseconds. Hence, the visual stuttering we observed
during structural changes of the runtime are completely eliminated.
Besides the major optimization of init, we were able to shave off a few
milliseconds from the boot procedure here and there. For example, by deferring
the initialization of the real-time clock driver to its first use, we avoid a
potentially expensive active polling loop during the highly contended boot
phase. Another obvious heuristic improvement is the skipping of the GUI
handling until the framebuffer driver is up because all the nice pixels would
not be visible anyway.
Combined, these optimizations were able to reduce the boot time of Sculpt from
the entering of the kernel up to the graphical user interface down to only 2.3
seconds. The improved performance of init is impactful beyond Sculpt OS
because it is a central component of all Genode systems large and small.
Updated and new documentation
#############################
Genode Platforms
----------------
We are proud to introduce the first version of a new "Genode Platforms"
document, which complements the existing Genode Foundations book with
low-level hardware-related topics. It is primarily intended for integrators
and developers of device drivers.
: <div class="visualClear"><!-- --></div>
: <p>
: <div style="clear: both; float: left; margin-right:20px;">
: <a class="internal-link" href="https://genode.org">
: <img class="image-inline" src="https://genode.org/documentation/genode-platforms-title.png">
: </a>
: </div>
: </p>
In this first edition, the document features a practical guide for the steps
needed to bring Genode to a new ARM SoC. The content is based on the ongoing
Pine Fun article series at [https://genodians.org - Genodians.org].
We plan to continuously extend it with further practical topics as we go.
:Initial revision of the Genode Platforms document:
[https://genode.org/documentation/genode-platforms-21-05.pdf]
Genode Foundations
------------------
The "Genode Foundations" book received its annual update. It is available at
the [https://genode.org] website as a PDF document and an online version.
The most noteworthy additions and changes are:
: <div class="visualClear"><!-- --></div>
: <p>
: <div style="clear: both; float: left; margin-right:20px;">
: <a class="internal-link" href="https://genode.org">
: <img class="image-inline" src="https://genode.org/documentation/genode-foundations-title.png">
: </a>
: </div>
: </p>
* Adaptation to the re-stacked GUI stack introduced in
[https://genode.org/documentation/release-notes/20.08#The_GUI_stack__restacked - version 20.08]
* Coverage of the new uplink, capture, and event session interfaces
* Updated API documentation
: <div class="visualClear"><!-- --></div>
To examine the changes in detail, please refer to the book's
[https://github.com/nfeske/genode-manual/commits/master - revision history].
Base framework and OS-level infrastructure
##########################################
API refinements
===============
VFS-access utilities
--------------------
Low-complexity native Genode components do not depend on a C runtime. To allow
such components to still enjoy the power and flexibility of the Genode's VFS
infrastructure, we provide an evolving front-end API
[https://github.com/genodelabs/genode/blob/master/repos/os/include/os/vfs.h - os/vfs.h]
first introduced in version
[https://genode.org/documentation/release-notes/19.11#Virtual_file-system_infrastructure - 19.11].
The API is tailored and refined according to the relatively simple use cases
of low-complexity Genode components. The current release introduces a new
utility for the creation of new files, appropriately named 'New_file'. The
change is accompanied by a new 'Directory::create_sub_directory' method for
the easy creation of directory hierarchies.
Safeguarded arrays
------------------
To handle arrays in a safe and C++-like fashion, a new helper class has become
available at _base/include/util/array.h_. It accommodates an increasingly used
pattern where elements are dynamically added at construction time but stay the
same once the array is constructed.
Cosmetic changes
----------------
We refined the 'Range_allocator::alloc_aligned' interface to make it more
safe. 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 covered 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'.
The 'Cache_attribute' type has been renamed to 'Cache'.
Input-event handling
====================
A central component for Genode's input-event handling functionality is the
event filter. It merges input events from multiple event sources and passes
them to the event sink (typically the GUI server). In between, it performs
low-level key remapping and applies character mapping rules. Character mapping
rules are essential for supporting different keyboard layouts (including
dead-key sequences). Low-level key remapping is, for instance, used for
changing the emitted key codes of the Num Pad keys according to the Num Lock
state. The different filter functionalities can be arbitrarily assembled into
a filter chain and provided as a dynamic config ROM to the event filter
component. The event sink then receives and processes the filtered events.
Some input devices emit unusual and/or extra key codes in certain situations,
which impedes the event sink's ability to detect key combos correctly. We
therefore added the functionality to completely mute certain key codes. In
order to ignore all unknown key codes for instance, we can now add an
'<ignore-key>' node to the config of the event filter.
! <remap>
! <ignore-key name="KEY_UNKNOWN"/>
! ...
! </remap>
Note, that '<ignore-key>' is part of the '<remap>' filter. The name attribute
refers to the low-level key name before any remapping rule has been applied.
As a second addition, we implemented a '<log>' filter that allows low-level
debugging of the event-filter component and its configuration. The '<log>'
filter can appear at each stage in the filter chain. For instance, we can log
the input events before and after the remap filter as follows.
! <log prefix="REMAPPED ">
! <remap>
! <log prefix="RAW ">
! ...
! </log>
! </remap>
! </log>
The optional 'prefix' attribute thereby helps to distinguish the log output
from different stages.
File-system helpers
===================
The
[https://genode.org/documentation/release-notes/18.08#New_component_for_querying_information_from_a_file_system - fs_query]
component is a simple helper to query information from a file system. E.g., it
is used by the file browser of Sculpt OS to obtain the directory structure.
The component received two welcomed improvements. First, directory content is
now reported in alphabetic order. Thereby, all consumers of the reports become
able to rely on deterministic output. For example, the file browser of Sculpt
OS, the launcher menu items, and the depot-selection items will appear in a
predictable way. Second, the size of files can be queried now. By adding an
attribute 'size="yes"' to a query, fs_query is instructed to report the size
of each queried file as attribute 'size' of the corresponding 'file' node.
Whereas fs_query inspects a file system without changing it, its sister
component fs_tool is able to perform file-system modifications. The new
version adds a '<new-file path="...">' operation, which writes the content of
the XML node into the file specified as 'path' attribute. The directory
structure leading to the file is implicitly created if needed. Should a file
with the specified name already exist, the original file will be overwritten.
Applications
############
File vault based on the CBE block encrypter
===========================================
Over several releases
([https://genode.org/documentation/release-notes/19.11#Preliminary_block-device_encrypter - 19.11],
[https://genode.org/documentation/release-notes/20.05#Feature-completeness_of_the_consistent_block_encrypter - 20.05],
[https://genode.org/documentation/release-notes/20.08#Consistent_Block_Encrypter - 20.08],
[https://genode.org/documentation/release-notes/20.11#Consistent_Block_Encrypter__CBE_ - 20.11]),
we persistently worked at a native solution for modern block encryption - the
SPARK-based CBE-library - and its integration into Genode's VFS. Even though,
this work was already suitable for real-world scenarios like
[https://genodians.org/m-stein/2020-06-12-cbe-linux-vm - hosting a Linux VM on top of an encrypted block device],
it still lacked stress-testing by a regular user base because its integration
into an end-user system - like Sculpt - required tedious low-level wizardry.
This situation had to change because we want to encourage as many people as
possible to expose the codebase around the CBE to their workflows and let it
mature. Therefore, we came up with a new package called file vault that can be
readily deployed on Sculpt OS. It is a graphical front end that aims at making
the creation, use, and maintenance of a CBE-based encrypted file store as
intuitive and secure as possible.
:Introducing the file vault:
[https://genodians.org/m-stein/2021-05-17-introducing-the-file-vault]
[image file_vault_setup]
The file vault only requires two file-system sessions from you (the trust
anchor is stored separately from the payload data). With that, it will
automatically create and connect a trust anchor, set up a CBE image, prepare
an ext2 FS on top of the CBE image and provide it through a file system
service - ready to be used like a simple directory. The directory can be
locked by closing the file vault and unlocked by starting the file vault on
the same trust anchor and entering the correct user passphrase. All controls
for the file vault's underlying CBE encrypter - like for its re-sizing and
re-keying functionality - are presented through a simple and guiding UI that
also provides you with the most relevant status information of your vault.
The file vault package is accompanied by some notable improvements regarding
CBE's key management. Whereas in the previous release, this aspect was still
merely a prototype with almost no protective value, the current implementation
embraces well-known algorithms to generate and encrypt the keys used within
the CBE respectively the file vault. This is explained in detail in the
aforementioned article.
As a note of caution, the primary purpose of the current version of the file
vault is to lift native block encryption in Genode from the development stage
to product quality. At the current stage, it is neither time-tested nor
reviewed by independent cryptography experts. Consequently, you should use it
with a healthy dose of suspicion, for non-critical data only! We would be more
than happy to receive feedback on your experience with the file vault.
VirtualBox
==========
Since the previous release, we continued the enablement of VirtualBox 6 on
Genode and put efforts into stabilizing the port. Therefore, we updated to
version 6.1.18 and reorganized the internal structure for a more
comprehensible execution model with fewer threads. Further, we improved
synchronization in multi-processor use cases and added a Sculpt runtime
package for vbox6.
Finally, as a little treat, our ports of VirtualBox now support to pass extra
buttons of five-button mice to the guest.
Device drivers
##############
Platform driver on ARM
======================
The current release streamlines Genode's API for interacting with the platform
driver on ARM platforms. It eases the access to memory-mapped I/O registers
and interrupts by introducing the notions of
:'Platform::Device': one device obtained from a platform session
:'Platform::Device::Mmio': locally-mapped MMIO registers of a device
:'Platform::Device::Irq': interface for receiving device interrupts
The API is covered in detail by the following article.
:One Platform driver to rule them all:
[https://genodians.org/nfeske/2021-04-29-platform-driver]
It goes without saying that this change touches most ARM-specific drivers.
Closely related, we also revised the concept of the XML based device-info
mechanism provided by the platform driver to accommodate both complex drivers
operating on multiple devices simultaneously such as driver stacks ported from
Linux as well as low-complexity drivers for simple devices. In the new
version, the device XML-information dataspace is only provided if the client's
session policy states 'info="yes"'. The format of the XML information got
refined to include the physical resource names (I/O memory and IRQ addresses)
instead of virtual IDs and page offsets and by using a 'type' attribute
instead of a '<compatible>' node to uniquely identify devices.
Changes specific to i.MX8
-------------------------
The platform driver incarnation specific to i.MX8 got slightly improved. It
can handle the configuration of reset-pins now. Analogously to the already
existent power domains, one can assign reset domains per device. Whenever a
device with a reset domain gets acquired, its reset-pins are de-asserted. When
the device gets released again, its reset-pins are asserted to put it into
reset state. A sample configuration looks as follows:
! <device name="mipi_dsi>
! <reset-domain name="mipi_dsi_pclk"/>
! ...
! </device>
Technically, those reset domains map to pin settings of the System Reset
Controller (SRC) that is part of the i.MX8 SoC. The SRC is under control of
the platform driver now. Currently, only the pins for the MIPI DSI Phy get
exported. They are used by the graphical subsystem to handle panels connected
via MIPI DSI.
I2C driver for i.MX8
====================
Thanks to Jean-Adrien Domage from [https://www.gapfruit.com - gapfruit], an
API for I2C bus transactions and a new I2C bus driver for the i.MX8 SoC
entered our framework. Coincidentally, the need to use the new I2C API more
intensively arose soon after his initial contribution. As a consequence, the
API got extended a bit. The result is a nice joint venture, and looks like the
following:
! void transmit(Transaction & t);
Hereby a 'Transaction' is a simple array of 'Message' objects, and a 'Message'
is an array of bytes that are either read or written. For very simple
use-cases, e.g., a client that polls single bytes from a temperature sensor,
some convenience utilities are incorporated into the 'I2c::Connection'.
USB
===
The USB-driver system has received quite a few refinements, performance
improvements, and robustness handling efforts during the current release
cycle. The HID subsystem is now capable of handling devices where the HID USB
interface is at an arbitrary location within the device descriptors - as
opposed to the assumption that the HID interface is always at the first
position in the interface list of the device. Also, the HID driver now handles
session destruction more gracefully and supports unlimited plug and unplug
events of an associated HID device.
For the USB host driver, various fixes of newer Linux kernel versions have
been back ported, which concern the handling of DMA memory. Error code and
timeout handling have been improved in order to support more corner cases, and
the USB session handles outstanding USB requests (synchronous and
asynchronous) on sudden session disconnects gracefully now.
The CPU usage of the host driver for isochronous transfers has been reduced
significantly for Intel XHCI controllers by adding a fix that reduces the
triggering of an interrupt for every completed isochronous packet to one
interrupt per eight packets, bringing the worst case scenario down to 1000
interrupts per second from a possible 8000 IRQs before.
NIC drivers
===========
Drivers for iPXE-supported Ethernet devices, Wifi adapters, and Linux TAP
devices now support the reporting of the MAC address of detected adapters.
The feature can be enabled by a '<report>' node in the driver configuration as
follows, prompting the driver to request a report session with the label
_devices_.
! <config>
! <report mac_address="true"/>
! </config>
The resulting report is depicted below.
! <devices>
! <nic mac_address="02:00:00:00:00:01"/>
! </devices>
Platforms
#########
Genode/Linux on 64-bit ARM
==========================
The release introduces the support for running the Linux version of Genode on
64-bit ARM platforms. As a part of this line of work, Genode's system call
bindings for Linux underwent a modernization to harmonize the system calls
across the supported CPU architectures. Furthermore, we took the opportunity
to simplify the use of the clone system call by eliminating the need for
passing a TLS pointer.
Expecting that the 64-bit Genode/Linux version will remain a niche use case of
Genode in the foreseeable future, we do not provide a pre-built tool chain.
Hence, as a preparatory step for using this version of Genode, the tool chain
must be built manually via Genode's _tool/tool_chain_ script.
As a known limitation, Genode's 'Trace::timestamp' function is not available
on this version of Genode because Linux prevents the user land from accessing
the cycle counter (pmccntr_el0). So the accuracy of timing is somewhat impeded
to the order of milliseconds. Also, the jitterentropy random-number generator
cannot be used.
Those limitations notwithstanding, one can successfully execute scenarios as
complex as _leitzentrale.run_. When using AARCH64 Linux as host, run scripts
can be executed with the same convenience as on Linux on a PC.
! $ make run/<script> KERNEL=linux BOARD=linux
Pine-A64-LTS single board computer
==================================
The current release continues
[https://genode.org/documentation/release-notes/21.02#Pine-A64-LTS_single_board_computer - our story]
of porting Genode to the
[https://pine64.com/product-category/pine-a64-ltslong-term-supply/ - Pine-A64-LTS]
board. We document the progress in great detail as we go.
# [https://genodians.org/nfeske/2021-03-05-pine-fun-testing - Kernel packaging and testing]
# [https://genodians.org/nfeske/2021-03-17-pine-fun-device-access - Device access from the user level]
# [https://genodians.org/nfeske/2021-04-29-platform-driver - One Platform driver to rule them all]
# [https://genodians.org/nfeske/2021-05-12-pine-fun-linux - Taking Linux out for a Walk]
# [https://genodians.org/nfeske/2021-05-19-pine-dts-pruning - Pruning device trees]
The accumulated material forms the basis for the evolving Genode Platforms
document introduced in Section [Updated and new documentation].
The code of this line of work is available at a dedicated repository:
:Genode board support for Allwinner SoCs:
[https://github.com/nfeske/genode-allwinner]
RISC-V
======
The support for the RISC-V architecture has further been developed into the
direction of a fully supported Genode platform. With this release, we wanted
to enable basic device driver support, which requires a working interrupt
controller. Since the "platform-level interrupt controller" (PLIC) is now
present on most hardware as well as on the Qemu emulator, we have added
support for the PLIC within our base-hw kernel.
With the interrupt controller in place, we implemented a driver for the
[https://opencores.org - OpenCores] Ethernet device as present on the
[https://hensoldt-cyber.com/mig-v - MiG-V] board. The driver component runs on
Qemu (with OpenCores enabled) as well as on the MiG-V board itself. Our RISC-V
board specific line of work can now be found within a separate
[https://github.com/ssumpf/genode-riscv - repository].
With driver support in place, the final step for full RISC-V support in Genode
is to extend our C library for this architecture.
Build system and tools
######################
Tool-chain update to GCC 10.3 and binutils 2.36
===============================================
About every two years, we update our tailored Genode tool chain to recent
versions. This year's update includes GCC 10.3.0, binutils 2.36.1 and GDB 10.2
together with their corresponding Genode libraries and tools (stdcxx, ADA
runtime, libsparkcrypto, gcov, sanitizer).
Feature-wise, changes are not as significant this time as with the
[https://genode.org/documentation/release-notes/19.05#Tool_chain_based_on_GCC_8.3.0_and_binutils_2.32 - previous update],
nevertheless we had to overcome some hurdles worth noting.
* The _gprbuild_ tool, which is needed to build the _ali2dep_
tool had a bug in the version provided by Ubuntu 18.04, which prevented it
from building _ali2dep_ with GCC/GNAT 10. To still be able to build the
tool chain on Ubuntu 18.04, the _gprbuild_ tool is now built from
source (of a newer version) when running the _tool_chain_ script.
* When building the tool chain on armhf Linux, errors occurred because
of mismatching float-abi compiler flags used when building the
dependency libraries (_gmp_, _mpc_, _mpfr_) with the host tool chain and
when building the Genode tool chain with the intermediate bootstrap
tool chain. To solve this problem, the dependency libraries are now
downloaded and built using the GCC build system. This also had the
effect that the _mpc_ and _mpfr_ Genode ports were not needed anymore
and got removed.
* GCC 10 reports more compile errors, which had to be fixed. The most common
errors related to narrowing conversions and potential unaligned pointers
from packed members.
* GCC 10 has the _-fno-common_ option set by default, which caused link
errors especially with some 3rd party ports.
* GCC 10 generated 'memset()' calls in implementations of 'memset()',
which caused stack overflows from this recursion.
* The ARM compiler generates more VFP instructions now, especially when
building for armv6, so we had to update the 'setjmp()' and 'longjmp()'
functions used by _dde_linux_ drivers to additionally save and restore the
FPU registers on ARM.
* With the new binutils version, linker sections with the same name in
multiple linker scripts are not merged anymore. Since we rely on this
behavior when building _core_ for NOVA, we reverted the corresponding change
with a patch.
* With the new binutils version, executable files are not allowed as input
when linking executable output files anymore. The build process of the
Fiasco.OC kernel relied on this behavior and needed to be adapted by the
upstream developers.
The new tool chain has not been enabled for RISC-V yet, because of an unsolved
issue on initialization (resp. initial relocation) of our dynamic linker.
Until we finalized the RISC-V support, we recommend using the tool chain
version 19.05 for this CPU architecture by adding the following two lines to
your build directory's _etc/tools.conf_.
! CROSS_DEV_PREFIX = /usr/local/genode/tool/19.05/bin/genode-riscv-
! REQUIRED_GCC_VERSION = 8.3.0
The updated tool chain can be built from source or downloaded in binary form
as described in this [https://genode.org/download/tool-chain - document].
Utilities for porting Linux drivers
===================================
Dummy-function generator
------------------------
While porting device drivers from the Linux kernel to Genode, one has to
tailor the environment that replaces the original kernel code. Thereby, tons
of missing function and variable implementations have to be written. Most of
them won't even be called by the driver under normal circumstances, but
nonetheless they are needed to link the executable binary.
The production of these dummy functions in the first place is a tiresome and
somewhat annoying work. To free developers from this burden, a new tool
entered the Genode framework under _tool/dde_linux/create_dummies_. Apart from
the creation of missing kernel functions and variables, it can also be used to
easily summarize all missing symbols during the porting work.
For a more detailed explanation of the new tool, please have a look at the
following article.
:Linux device driver ports - Breaking new ground:
[https://genodians.org/skalk/2021-04-08-dde-linux-experiments-1]
Device-tree source processing
-----------------------------
Device-tree source files as featured in the source tree of the Linux kernel
contain valuable information about the structure and parameters of SoCs and
boards. The porting and implementation of device drivers for Genode calls for
tooling that is able to extract and convert this information into digestible
forms. The current release introduces the first version of a new tool set at
_tools/dts/_ for this purpose.
[image dts_extract]
The tool aids the understanding of the hardware and allows for the pruning of
device trees down to a manageable complexity. As an illustration, the
spiderweb on the left shows the device-interdependencies of the Pine-A64-LTS
board. On the right, the device tree is pruned to cover only what's needed to
use Ethernet. The tool is covered in more detail by the following dedicated
article.
:Pruning device trees:
[https://genodians.org/nfeske/2021-05-19-pine-dts-pruning]
Cache for downloaded ports
==========================
When working with ports, it is not uncommon that a port hash is changed due to
some minor change like the addition of a patch. A subsequent call of
'prepare_port' would download the same files that were already downloaded
while preparing a previous version of the port even if the downloaded content
remains the same. This wastes internet bandwidth and developer time. The
current release introduces a simple cache for downloaded archives, which
alleviates these costs.
_Thanks to Tomasz Gajewski for his continuous contributions to improve our_
_development workflows._
Common hook for custom build rules
==================================
There are cases that call for building custom targets in addition to a regular
library or program. For example, the executable binary of an application may
be accompanied by generated data files. The creation of such build artifacts
can be expressed by custom make rules. However, a rule is triggered only if it
is a dependency of the build target. This can now be achieved by adding the
rule to the 'CUSTOM_TARGET_DEPS' variable. For example,
! CUSTOM_TARGET_DEPS += menu_view_styles.tar
!
! menu_view_styles.tar:
! $(VERBOSE)cd $(PRG_DIR); tar cf $(PWD)/bin/$@ styles
_Thanks to Tomasz Gajewski for this welcome contribution._

671
doc/release_notes/21-08.txt Normal file
View File

@@ -0,0 +1,671 @@
===============================================
Release notes for the Genode OS Framework 21.08
===============================================
Genode Labs
Genode 21.08 puts device drivers into the spotlight. It attacks the costs of
porting drivers from the Linux kernel and takes a leap forward with respect to
GPU support. This low-level work is complemented by several topics that
contribute to our vision of hosting video-conferencing scenarios natively on
Genode.
For those of you who follow Genode's release notes over the years, the
so-called DDE-Linux is a recurring topic. DDE is short for device-driver
environment and denotes our principal approach of running unmodified Linux
device-driver code inside Genode components. For over a decade, we iterated
many times to find a sustainable and scalable solution for satisfying Genode's
driver needs. Thanks to this enduring work, Genode enjoys support for modern
hardware such as Intel wireless chips or Intel graphics devices. However, when
looking beyond PC hardware, in particular at the plethora of ARM SoCs as
potential target platforms for Genode, we found our existing DDE-Linux
approach increasingly prohibitive because the investment of manual labour per
driver would become unbearable. It was time to recollect, draw from our
collective experience gathered over the past years, and re-envision what
DDE-Linux could be. Section [Linux-device-driver environment re-imagined]
presents the results of this recent line of development that promises to dwarf
the costs of driver-porting work compared to our time-tested approach. The
results have an immediate impact on our ambition to bring Genode to the
PinePhone as our added network and framebuffer drivers for the Allwinner A64
SoC leverage the new DDE already.
The challenge of using hardware-accelerated graphics (GPUs) on Genode makes a
guest appearance in the release notes on-and-off since version
[https://genode.org/documentation/release-notes/10.08#Gallium3D_and_Intel_s_Graphics_Execution_Manager - 10.08].
However, until now, GPU support has not become a commodity for Genode yet.
With the work presented in Section [Advancing GPU driver stack], we hope to
change that. For the first time, we identified a clear path to the
architectural integration of GPU support in sophisticated Genode scenarios
such as Sculpt OS. This outlook prompted us to revive the GPU stack in a
holistic way, including our custom Intel GPU multiplexer as well as the Mesa
stack.
Further highlights of the current release are an improved and updated version
of VirtualBox 6, refined user-level networking, the maturing integration with
host file systems when running Genode on top of Linux, and new media-playback
capabilities for our port of the Chromium web engine.
Linux-device-driver environment re-imagined
###########################################
Over more than a decade, the domestication of Linux device drivers for Genode
has evolved into a quest of almost epic proportions. This long-winded story
has been covered by a recent series of Genodians articles
([https://genodians.org/skalk/2021-04-06-dde-linux-experiments - first],
[https://genodians.org/skalk/2021-04-08-dde-linux-experiments-1 - second],
[https://genodians.org/skalk/2021-06-21-dde-linux-experiments-2 - third]),
which also goes into a technical deep dive of our recent developments.
On the one hand, we draw an enormous value from the device drivers of the
Linux kernel. Genode would be nowhere as useful without the Intel wireless
stack, USB host-controller drivers, or the Intel graphics driver that we
ported over from Linux. On the other hand, those porting efforts are draining
a lot of our energy. Linux kernel code is not designed for microkernel-based
systems after all. Consequently, the transplantation of such code does not
only require a solid understanding of Linux kernel internals, but also ways to
overcome the friction between two radically different operating-system-design
schools (monolithic and component-based) and friction between implementation
languages (C and C++).
Even though we are not short of evidence of successful driver ports, we are
very well aware of several elephants in the room:
Economically, each driver port must be understood as a distinct project of
non-trivial costs. E.g., the port of the i.MX8 graphics driver took us two
months. That's certainly minuscule compared to a driver written from scratch.
But it is still expensive and we feel that those expenses hold us back.
Second, once ported, later updates of drivers to a new kernel version are
costly and risky. But such updates are unavoidable to keep up with new
hardware. The larger the arsenal of device drivers, the bigger this problem
becomes.
Third, the skill set of the porting work is the cross point of Linux kernel
competence and Genode competence. In other words, it's rare. To make Genode
compatible to a broader spectrum of hardware in the long run, driver porting
must become an easily attainable skill rather than black art.
With the current release, we introduce a vastly improved approach to the reuse
of Linux device drivers on Genode. It entails three aspects:
:Code: Reusable building blocks for crafting custom runtime environments
to bring Linux kernel code to fly, and for interfacing Genode's session
interfaces with Linux kernel interfaces.
:Tooling: A custom tool set that automates repetitive work such as generating
dummy implementations of Linux kernel functions.
:Methodology: Consistent patterns and exemplary test scenarios serving as
guiding rails for the development work.
The following illustration maps out the first aspect, the various pieces of
code involved in hosting unmodified Linux driver code on Genode.
The clear separation of those parts reinforces a degree of formalism - in
particular about separating C and C++ - that was absent in our previous takes.
[image dde_linux_parts]
A driver is a Genode component. So the outer border of the picture is Genode's
bare-bones C++ API. At the lower end, the API provides access to device
resources such as interrupts and memory-mapped device registers. At the higher
end, the API allows the driver to play the role of a service for other
components through one of Genode's session interfaces.
The lower (blueish) part of the picture is concerned with the runtime
environment needed to make the Linux kernel code feel right at home. The gap
between Genode's API and Linux kernel interfaces is closed in two steps.
First, the so-called *lx_kit* library implements handy mechanisms for building
the meaty parts of the runtime in C++. For example, it provides a user-level
task scheduling model that satisfies the semantic needs of Linux. The lx_kit
is located at _dde_linux/src/include/lx_kit_ and _dde_linux/src/lib/lx_kit/_
Second, the *lx_emul* (short for Linux emulation) code wraps the lx_kit
functionality into C interfaces. The functions of those interfaces are
prefixed with 'lx_emul_' and serve as basic primitives for re-implementing
(parts of) the original Linux kernel-internal ABI. Although the previous
version of DDE Linux already featured the principle lx_kit and lx_emul
fragments, the new design applies the underlying idea much more stringent,
fostering the almost galvanic separation between C and C++ code. In
particular, C++ code never includes any Linux headers. The lx_emul code also
comprises driver-specific dummy implementations of unused kernel functions.
The handy tool at _tool/dde_linux/create_dummies_ automates the creation of
those dummy implementations now. Finally, the lx_emul code drives the startup
of the Linux kernel code by executing initcalls in the correct order. The
reusable building blocks of lx_emul are located at
_dde_linux/src/include/lx_emul/_ and _dde_linux/src/lib/lx_emul/_
When looking from the upper (greenish) end, the *genode_c_api* library is a
thin wrapper around Genode's session interfaces. It enables C code to
implement a Genode service such as block driver or network driver. The
genode_c_api library is located at _os/include/genode_c_api/_ and
_os/src/lib/genode_c_api/_.
The red area contains sole C code, most of which is unmodified Linux kernel
code. It is supplemented with a small *lx_user* part that uses both the
genode_c_api as well as Linux kernel interfaces to connect the unmodified
Linux kernel code with the Genode universe.
We address the second aspect - the tooling - by the growing tool set at
_tool/dde_linux/_. The biggest time saver is the _create_dummies_ tool, which
automates the formerly manual task of implementing dummy functions to quickly
attain a linkable binary. It is complemented with the _extract_initcall_order_
tool, which supplements lx_emul with the information needed to perform all
Linux initialization steps in the exact same order as a Linux kernel would do.
The third aspect - the methodology - is embodied in two source-code
repositories that leverage the new DDE-Linux approach for two distinct ARM
SoCs, namely i.MX8MQ and Allwinner A64.
:Genode support for i.MX8MQ SoC:
[https://github.com/skalk/genode-imx8mq]
:Genode support for Allwinner A64 SoC:
[https://github.com/nfeske/genode-allwinner]
The most pivotal methodological change is the way how we deal with the
Linux-internal API now. In our previous work, we used to mimic the content of
kernel headers by a custom-tailored emulation header _lx_emul.h_ per driver.
Whereas these driver-specific API flavors catered our urge to keep transitive
code complexity at bay, they required significant and boring manual labour.
Now we changed our minds to reusing the original Linux headers, thereby
greatly reducing the amount of repetitive work while reducing the likelihood
for subtle bugs.
Success stories
---------------
Both repositories linked above employ the re-imagined DDE-Linux approach to
resounding success. The i.MX8MQ repository features drivers for framebuffer
output and SD-card access,
[https://genodians.org/skalk/2021-08-02-mnt-reform2-sdcard - targeting the MNT Reform laptop].
The Allwinner repository contains a network driver for the Pine-A64-LTS board
and a new framebuffer driver for the PinePhone. No single line of Linux code
had to be changed.
We found that the development of those driver components took only a fraction
of time compared to our past experiences. The most unnerving aspects of the
driver porting work have simply vanished: Subtle incompatibilities between C
and C++ are ruled out by design now. The hunt for missing initcalls is no
more. No dummy function must be written by hand. The compilation of arbitrary
Linux compilation units works instantly without manual labour.
This - in turn - brings the experimental addition or removal of kernel
subsystems down from hours to seconds, turning the development work into an
exploratory experience.
That said, it is not all roses. Components based on Linux drivers have to
carry substantial Linux-specific bureaucracy along with them. The resulting
components tend to be somewhat obese given their relatively narrow purpose.
E.g., the executable binary of the framebuffer driver for the PinePhone is
1.5 MiB in size, most of which is presumably dead weight.
Transition
----------
Our existing and time-tested Linux-based drivers located in the _dde_linux_
repository have remained untouched by the current release.
We plan to successively update or replace those drivers using the new
approach. Until then, the original components refer to the old approach as
"legacy". E.g., the former implementation of lx_emul has been moved to
_dde_linux/src/include/legacy/lx_emul/_.
Advancing GPU driver stack
##########################
With release 21.08, we take a major leap towards 3D and GPU support on Genode.
This topic has been on the slow burner for a while now and we were happy to be
able to finally revive this topic. On the Mesa front, we conducted an update
to version 21.0.0 (Section [Mesa update]), while adding more features and new
platforms to our
[https://genode.org/documentation/release-notes/17.08 - Intel GPU multiplexer].
On Intel platforms, there exists no hardware distinction between the display
controller and 3D acceleration, as both functions are provided by the GPU.
Other platforms, e.g. ARM based SoCs, often contain a separate display and a
GPU device, making it possible to isolate display configuration within a
separate driver. Therefore, we are glad to report that we found a solution on
how to separate display and 3D acceleration on Intel systems.
Mesa update
-----------
Genode's port of the
[https://www.mesa3d.org - Mesa 3D graphics library] dates back to version
11.2.2 that was released in 2016 while the current version is past 21 by now.
Because of this version gap, we decided to start with a fresh port of Mesa
instead of solely updating from version 11. The more recent version enabled us
to switch from Mesa's DRI drivers (i965) to the
[https://de.wikipedia.org/wiki/Gallium3D - Gallium] version (Iris) for Intel
GPUs.
[https://xdc2018.x.org/slides/optimizing-i965-for-the-future.pdf - Iris]
is Intel's redesigned version of the dated i965 driver that aims to lower CPU
usage and improved performance. It is the only driver that supports Gen 12
(Intel's current Xe GPU architecture) while also removing support for old
Intel generations. As Genode supports Gen 8 (Broadwell) platforms only, we
felt that Iris is the driver of choice for the future.
GPU multiplexer improvements
----------------------------
The GPU multiplexer received stability improvements, new features required by
Mesa's Iris driver, i.e. context isolation and sync objects, and bug fixes
prompted by supporting newer GPU generations. These generations include Gen 9
(Skylake) and Gen 9.5 (Kaby Lake), with more versions to come. Please note
that this line of work is not finished and is as of now in a preliminary state
with ongoing efforts.
The GPU multiplexer as a platform service
-----------------------------------------
As stated at the beginning of this chapter, Intel PC platforms have no
distinction between the display device and the 3D rendering. Both functions
are integrated into the GPU as display engine and render engine. This implies
that Genode's Intel framebuffer/display driver has to share resources with the
GPU multiplexer. The co-location of both drivers in one component, however,
violates Genode's core principle of a minimally-complex trusted computing
base. Whereas the complex display driver should best be a disposable component
([https://fosdem.org/2021/schedule/event/microkernel_pluggable_device_drivers_for_genode/ - FOSDEM talk]),
the GPU driver must ideally be realized as a low-complexity resource
multiplexer.
We eventually found a way to solve this contradiction: On Genode, each driver
requests the hardware resources to program a device from the platform driver
via the platform session. As these resources cannot be shared, we came up with
the idea that the GPU multiplexer requests all GPU resources and itself
provides a platform service for the display driver. It hands out the subset of
resources that are related to display handling and forwards display
interrupts. This approach is completely transparent to Genode's Intel display
driver.
[image gpu_architecture]
System integration of the GPU driver/multiplexer and the framebuffer driver
as distinct components
We already have implemented this solution for Gen 8 and are working on newer
generations.
Future prospects
----------------
In the current state, we are still working on newer Intel (Gen9+) GPU support
and are planning to integrate this line of work into Sculpt release 21.09 with
a small demo scenario (e.g., [https://github.com/glmark2/glmark2 - Glmark2]
that is now available in Genode world).
Additionally, there is ongoing work to support
[https://www.verisilicon.com/en/IPPortfolio/VivanteGPUIP - Vivante] GPUs as
utilized by i.MX SoCs. As of now Mesa's etnaviv driver is included in our
Mesa update and a GPU multiplexer component based on the Linux DRM driver is
available as a preview on
[https://github.com/cnuke/genode/commits/21.08-etnaviv - this] topic branch.
Base framework and OS-level infrastructure
##########################################
Revised cache-maintenance interface
===================================
The base library used to expose a single cache-maintenance function to
user-level components, namely 'cache_coherent'. It is primarily needed to
accommodate self-modifying code, e.g., for JIT compilers, to write back
data-cache lines, and invalidate the corresponding instruction-cache lines.
However, we found that the proper support for cached DMA buffers in Linux
device-driver ports calls for two additional semantic flavours.
One is needed whenever driver code initially writes data to a DMA buffer
before handing over the buffer to the device. Linux driver code usually issues
a 'dma_map_*' call in this case to ensure that data gets written out to memory
and the data cache is invalidated. This scenario is now covered by the new
'cache_clean_invalidate_data' function.
The other flavor is needed to invalidate data-cache lines before reading
device-generated content from a DMA buffer. Linux driver code usually calls a
'dma_unmap_*' function in this case. This case is now covered by the new
'cache_invalidate_data' function.
Both functions are provided for the base-hw and Fiasco.OC kernels on the ARM
architecture.
Improved host file-system access on Genode/Linux
================================================
Genode has included a component for host file-system access on Linux for
years, but the state of the implementation and the feature set limited its
application to mere debugging or development scenarios. This release improves
*lx_fs* in certain areas to permit common use cases and scenarios.
First, the file-system server gets support for the unlinking of files, which
was left out in the past to prevent accidental deletion of files on the host.
The current version includes a robust implementation of the feature, which is
confined to the configured sub-directory.
Further, sessions track client-specific consumption of resources (namely RAM
and capabilities) and also support dynamic resource upgrades. Last, we added
file-watching support to lx_fs, which enables monitoring files for changes
based on the inotify interface of the Linux kernel. The implementation is
prepared to handle bursts of changes by limiting the rate of notifications to
the client.
These improvements were contributed by Pirmin Duss.
New black-hole component
========================
A commonly requested feature for Sculpt OS is that it would be nice to have
the ability to wire up various sessions of a deployed component to a dummy
version of the required service. This way, the user could easily start an
application that would normally require, for example, an audio-out session but
connect it to a "black hole" component that simply drops all audio data. This
would be especially useful if no hardware driver for a specific device is
available on a particular platform, but would also allow for more fine-grained
privacy control.
For this release, we created a first version of the black-hole component,
which provides a dummy implementation of the audio-out session when enabled in
the configuration:
! <config>
! <audio_out/>
! </config>
More session types are intended to be added in future releases.
NIC router
==========
With this release, the NIC router receives an enhancement of its feature for
forwarding DNS configurations via DHCP, a sensible way of dealing with
fragmented IPv4 packets, and some minor cleanups regarding its configuration
interface. The update changes the configuration interface of the NIC router in
a non-compatible way. Hence, systems that integrate the router might require
adaptation. At the end of this section, you can find an overview of how to
adapt systems properly.
The NIC router now interprets the IPv4 flags "More Fragments" and "Fragment
Offset" in order to determine whether an IPv4 packet is fragmented or not.
Fragmented packets are dropped safely while the unfragmented ones are routed
as usual. The decision to drop fragmented packets by default is the result of
a long discussion among users and developers of the NIC router. That
discussion came to the conclusion that the complexity overhead and security
risks of routing fragmented IPv4 outrun its relevance in modern world
networks. Therefore, we assume that for the common user of the router, a
simple rejection of fragmented IPv4 is the better deal.
The consideration of IPv4 fragmentation is accompanied by several ways of
communicating the router's decision to drop fragmented packets. If the config
flag 'verbose_packet_drop' is set, the router prints a message "drop packet
(fragmented IPv4 not supported)" for each dropped fragment to the log. If the
new attribute 'dropped_fragm_ipv4' in the config tag '<report>' is set, the
router will report the number of packets dropped due to fragmentation. Last
but not least, the NIC router can also be instructed to inform the sender of a
dropped IPv4 fragment by sending an ICMP "destination unreachable" reply. Like
the other feedback mechanisms, this is deactivated by default and can be
activated by setting the new config attribute 'icmp_type_3_code_on_fragm_ipv4'.
The attribute must be set to a valid ICMP code number that is then used for
the replies.
The run script 'nic_router_ipv4_fragm' demonstrates the router's behavior
regarding fragmented IPv4.
For many years, the DHCP server of the NIC router is capable of sending DNS
configuration attributes with its replies. At first, this was only a single
DNS server address. With
[https://genode.org/documentation/release-notes/21.02#NIC_router - Genode 21.02],
this has been extended to a list of DNS server addresses. Sending such address
lists has now been made more conforming to the RFCs in that the server will
list them all in one option 6 field instead of adding one option 6 field per
address. Consequently, the DHCP client of the router now also considers only
the first option 6 field of a reply but may parse multiple addresses from it.
Another new feature is that the DHCP client of the router now remembers the
domain name (option 15) of a DHCP reply that leads to an IPv4 configuration.
Analogously, the DHCP server will send a domain name with DHCP replies if such
a name is at hand. As with DNS server addresses, the DHCP server can obtain
the domain name either statically through its configuration (new config tag
'<dns-domain>') or dynamically from the results of a DHCP client of another
domain. The latter is achieved by setting the new config attribute
'dns_config_from' that replaces the former attribute 'dns_server_from'. If
'dns_config_from' is set to the name of another domain, the DHCP server will
use both the DNS server addresses and the DNS domain name of the domain.
DNS domain names that were stored with a dynamic IPv4 configuration in the
router are also reported via the new report tag '<dns-domain>' whenever the
'config' attribute in the config tag '<report>' is set. As with DNS server
addresses, this allows for manual forwarding and filtering through individual
management components (see
[https://genode.org/documentation/release-notes/21.02#NIC_router - Genode 21.02]).
As a delayed adaption to the
[https://genode.org/documentation/release-notes/21.02#Pluggable_network_device_drivers - introduction of the Uplink session]
two Genode releases ago, the term "Uplink", that was used in combination with
the NIC router to refer to NIC sessions that the router requested itself, has
been re-named more accurately to "NIC client". This is meant to prevent
confusion with the new session type and, most notable to users, implies that
the tag '<uplink>' in router configurations got re-named to '<nic-client>'.
How to adjust Genode 21.05 systems to the new NIC router
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* At each occurrence of the '<uplink ...>' tag in a NIC router configuration,
replace the tag name 'uplink' with 'nic-client'. The rest of the tag stays
the same. This does not yield any semantic changes.
* At each occurrence of the 'dns_server_from' attribute in a NIC router
configuration, replace the attribute name with 'dns_config_from'. The
attribute value remains unaltered. Be aware that this will add forwarding of
DNS domain names to your system. Forwarding DNS server addresses but not DNS
domain names is not supported anymore.
RAM framebuffer driver for Qemu
===============================
During graphical application development on ARMv8, it became obvious that
Genode still lacked framebuffer-driver support on Qemu for ARMv8, thus
rendering test execution on real hardware mandatory. In order to speedup test
and development time for graphical applications, we enabled RAM framebuffer
support for the "virt_qemu" board by adding a 'driver_interactive-virt_qemu'
package. The package contains a 'ram_fb_drv' that configures a RAM framebuffer
through Qemu's firmware interface and uses the capture session interface to
provide access to the framebuffer.
To test drive the driver, you can execute any Genode run script that requires
graphical applications. The following example shows how to execute the demo
run script in Qemu:
* In _<genode_dir>/build/arm_v8a/etc/build.conf_ change
! # use time-tested graphics backend
! QEMU_OPT += -display sdl
to
! QEMU_OPT += -device ramfb
* In _<genode_dir>/build/arm_v8a_ execute
! make KERNEL=hw BOARD=virt_qemu run/demo
Sandbox API
===========
When using [https://github.com/nfeske/goa - Goa], we noticed that using the os
API caused binaries to be always linked against 'sandbox.lib.so' because its
symbols were part of the api archive as well. We therefore decided to separate
the sandbox API from the os API by moving the header files to
_repos/os/include/sandbox/_ and providing them in a distinct api archive along
with the library symbols.
Libraries and applications
##########################
Updated and improved VirtualBox
===============================
Our ongoing development efforts with VirtualBox 6.1 extended the
implementation in various aspects. With this release, we updated the version
to 6.1.26 published in July to stay in sync with upstream developments. This
version especially improves the audio back end for the OSS interface and
graphics.
On the integration side, VirtualBox 6 now supports dynamic framebuffer
resolutions and the capslock ROM mode. The latter is important to provide the
user a consistent system-wide capslock state, which is controlled by a global
capslock ROM and virtual KEY_CAPSLOCK events forwarded to guest operating
systems. Per default, a raw mode is used and capslock input events are sent
unfiltered to the guest. For ROM mode, VirtualBox may be configured like
follows.
!<config capslock="rom">
The network-device model in VirtualBox 5 uses the MAC address from the
connected NIC session. We added this behavior also to VirtualBox 6. During the
past months, we also observed significant performance issues with the AHCI
model, which we address in this release. The background is that our port of
VirtualBox 6 limits changes to the original code and execution model to a bare
minimum. This renders updates of the upstream version less expensive, but on
the other hand, uncovers some inherent assumptions about the runtime behavior
(i.e., scheduling of threads) in the original implementation that must be
addressed.
Qt5 and QtWebEngine
===================
In this release, we enabled SSL server certificate validation and support for
multimedia playback in our ports of QtWebEngine and the Falkon web browser.
More specifically, we ported the 'nss' library for the SSL certificate
validation and the 'sndio' library as back end for the audio playback
functionality and enhanced our OSS audio VFS plugin accordingly.
The following screenshot shows an example use case of Falkon as a private
multimedia browser, which stores all session data, like cookies, in RAM only.
In the future, we also want to enable support for multimedia input and,
consequently, private video conferences.
[image falkon_youtube]
Modular integration of LTE modem stack in Sculpt OS
===================================================
In version [https://genode.org/documentation/release-notes/21.02#LTE_modem_stack - 21.02],
we announced the LTE modem support as a prerequisite for using Genode on the
PinePhone. Since most of our development laptops also come with LTE modems or
an extension slot for installing one, we explored ways to augment the Sculpt
scenario with mobile networking on demand, i.e., by the installation of
additional components. The result is documented by means of an
[https://genodians.org/jschlatow/2021-07-21-mobile-network - article on genodians.org].
Webcam improvements using libuvc
================================
With webcam support added by the previous release, we discovered some
complications with devices that implement the UVC spec in version 1.5. We
found one of those devices in a Thinkpad T490s. Since
[https://ken.tossell.net/libuvc/doc - libuvc] did not fully implement this
version of the spec, we added a patch for this. The main issue was the
different size of the video probe and commit control messages. Interestingly,
the problematic device is quite picky in this regard and only responds when
the size was set correctly. In connection with this, we fixed a bug in our
[https://libusb.info - libusb] back end, which caused the size of USB control
messages being wrongly calculated.
Apart from these device-specific issues, the webcam driver now enables auto
exposure in order to adapt to different lighting conditions.
Sndio audio library
===================
To complement the VFS OSS-plugin introduced in release
[https://genode.org/documentation/release-notes/20.11 - 20.11], we ported the
[https://sndio.org - sndio] library to Genode. It contains an OSS back end
that prompted us to broaden the functionality of our VFS plugin to satisfy
the requirements of the library. This is in line with the envisioned plan to
extend the OSS plugin incrementally to cover more use cases.
The sndio framework features a server component besides the library but for
the moment, we focus solely on using sndio in a client context. Here the
component, e.g., cmus and Falkon, uses the library to access the sound device
directly.
Build system and tools
######################
Tool-chain support for RISC-V
=============================
As one might have noticed, Genode's RISC-V tool chain is absent in tool-chain
release
[https://sourceforge.net/projects/genode/files/genode-toolchain/21.05/genode-toolchain-21.05-x86_64.tar.xz/download - 21.05]
because it still had issues at the release time. These issues, namely the
problem of the dynamic linker's self relocation during program startup have
been resolved during this release cycle. The RISC-V tool chain can now be
built manually using Genode's regular 'tool_chain' script:
! <genode-dir>/tool/tool_chain riscv ENABLE_FEATURES="c c++ gdb"
Run tool
========
Genode's custom workflow automation tool called 'run' received the following
enhancements.
To ease the hosting of driver packages outside of Genode's main repository -
an emerging pattern for supporting new SoCs - we replaced the formerly
built-in names of board-specific 'drivers_nic' and 'drivers_interactive' depot
packages by the convention of appending the board name as a suffix, e.g.,
'drivers_nic-pine_a64lts'. Hence, new hardware support can now be added
without touching the run tool.
The ARM fastboot plugin can now be used on 64-bit ARM platforms in addition to
32-bit ARM. Its formerly mandatory parameter '--load-fastboot-device' has
become optional and can be omitted if only one device is present.
A new _image/uboot_fit_ plugin enables the use of U-Boot's new FIT (flattened
image tree) image format (carrying the extension 'itb'), which supersedes the
uImage format. The new format simplifies the booting of a Linux system, which
typically requires not only a kernel image but also a device-tree binary and a
RAM disk. A FIT image combines all ingredients into a single file and adds
some metadata like checksums. Note, however, that booting an _image.itb_,
which doesn't contain a device-tree binary may cause U-Boot's 'bootm' command
to fail. A workaround for this is to execute the individual boot steps
separately, which skips the Linux-specific preparatory steps that depend on
the device-tree binary:
! bootm start
! bootm loados
! bootm go
Removal of deprecated components
################################
In the release notes of version
[https://genode.org/documentation/release-notes/20.11#Retiring_the_monolithic_USB_driver - 20.11],
we announced the retirement of our traditional monolithic USB-driver
component, which used to combine host-controller drivers together with USB
storage, HID, and networking drivers in a single component. With the current
release, we ultimately completed the transition to our multi-component USB
stack and removed the deprecated monolithic USB driver.

835
doc/release_notes/21-11.txt Normal file
View File

@@ -0,0 +1,835 @@
===============================================
Release notes for the Genode OS Framework 21.11
===============================================
Genode Labs
Version 21.11 of the Genode OS Framework puts device drivers into the
spotlight. Where to begin? Back in
[https://genode.org/news/road-map-for-2021 - January], we envisioned Genode
running on the PinePhone. With the current release, the first interactive
Genode scenarios become alive on this platform. Unlike the regular Linux-based
systems used on the PinePhone, we are walking on new ground by running each
individual driver in a dedicated sandbox.
Speaking of 64-bit ARM platforms, Genode's support for the i.MX8 SoC family
received a new USB host driver as well as the first version of the Vivante GPU
driver. The latter is a continuation of our GPU-related work presented in the
[https://genode.org/documentation/release-notes/21.08#Advancing_GPU_driver_stack - previous release],
which proves that our approach of integrating hardware-accelerated graphics
into the framework's architecture is applicable across different GPU vendors.
As promised three months ago, we have also taken our custom Intel GPU
multiplexer to Gen9 or newer devices. In fact, GPU support has now become a
regular feature of the Genode-based Sculpt OS that can be taken for a spin on
commodity PC hardware.
Even though most efforts are nowadays spent on 64-bit platforms, we have
revived Genode's support for Xilinx Zynq devices in aspiration of future
hardware-software co-design work. Those chips combine FPGA fabric with 32-bit
ARM cores and thereby allow us to explore the combination of reconfigurable
hardware with Genode's component architecture.
For users who prefer the comforts of virtual hardware over the tinkering with
physical devices, new drivers for VirtIO input and graphics open up the use of
interactive Genode systems on Qemu's "virt" platform.
Besides the predominant device-driver topics of the release, one other
highlight is the feature completion of Genode's version of VirtualBox 6 on PC
platforms, which has now reached parity with the time-tested version 5. Now,
features like shared folders, shared clipboard, sound, or USB pass-through
have become readily available.
A little kingdom for each SoC family
####################################
With the number of supported boards and CPU architectures growing, our
existing maintenance structure of the central Genode code repository becomes
increasingly nonviable. We made the following observations.
First, with respect to drivers ported from Linux, each SoC tends to refer
to a different _flavour_ of the Linux kernel. This so-called vendor kernel
may be a specific version with a blessed kernel configuration, or even a
hard fork. In the past, we tried harmonizing drivers across SoCs by using
the vanilla Linux kernel as common ground. But in practice, this common
ground seems to be walked-on by only a few. Devices are shipped with vendor
kernels after all. To get the best supported drivers for a given hardware,
we have to port the drivers from the respective vendor kernel.
This realization, in turn, faces us with the problem of a growing number
of vendor kernels we have to work with whenever extending Genode's hardware
support to a new SoC. But there are only so many Linux kernels one can juggle
with.
Second, when using one monolithic code base for all SoCs, the coordination of
the code repository becomes a bottleneck when it comes to reviewing and
merging contributions, and the nurturing of a consistent level of quality
assurance. In the case of Genode, this responsibility is shared by two head
maintainers. However, their expertise lies in the Genode framework, not in the
peculiarities of specific SoC hardware. Hence, the review of such SoC-related
contributions must remain at surface level. But the burden of responsibility
still rests on the two.
Third, we ultimately want to encourage 3rd parties - like hardware vendors -
to supplement SoC support for Genode independently from us. Forcing such
independent developers to funnel their results into our code base is not
always natural and may even be legally impeded by Genode's need for a
[https://genode.org/community/contributions#Genode_Contributors_Agreement - contributor's agreement].
We want to avoid such artificial friction.
The consequence of these observations is the need to modularize our code base
around the idea of giving each SoC family a little kingdom of their own. We
envision a code repository with a different maintainer for each SoC family. As
a prerequisite, we had to cleanly separate SoC-specific code from the generic
code that will remain in the main Genode repository. To stress this approach,
each of four developers picked a dedicated SoC family and went with it. Stefan
Kalkowski took the i.MX-related code to his
[https://github.com/skalk/genode-imx - genode-imx] repository,
Johannes Schlatow took the Xilinx Zynq code to his
[https://github.com/jschlatow/genode-zynq - genode-zynq] repository,
Norman Feske
maintains the Allwinner code for the PinePhone in
his [https://github.com/nfeske/genode-allwinner - genode-allwinner]
repository, and Sebastian Sumpf gave the RISC-V support a new home
at his [https://github.com/ssumpf/genode-riscv - genode-riscv] repository.
By looking at this modularization from four different perspectives at the same
time, we reached satisfying interfaces between the generic and SoC-specific
code. We found that this maintenance model works as anticipated. In
particular, we hoped that each SoC can be shepherded by a single person
without stress. This turned out to be true.
We also found that the taken approach gives each maintainer a sense of
autonomy that was not possible with one monolithic code base. This is
particularly fruitful when drafting generic utilities for the eventual
inclusion into Genode's main repository. The drafts can first receive a test
of time at individual SoC repositories before integrating them into the common
code base, the pin I/O interfaces described in
Section [Pin I/O session interfaces] being a good example.
The supportive tooling for each SoC tends to differ between vendors, speaking
of custom system-image formats, boot loaders, or firmware. The SoC-specific
repositories provide a natural home for hosting such tools, custom work-flow
scripts, and configurations.
With this exploratory phase completed, we plan to move the SoC-specific
repositories - that currently reside at each maintainer's GitHub account -
under the banner of [https://github.com/genodelabs - genodelabs] during the
next release cycle.
NXP i.MX family
===============
Support for the family of i.MX SoC related boards is located in the
[https://github.com/skalk/genode-imx - genode-imx] repository.
By now, it contains far-reaching support for the i.MX 8M Quad evaluation kit,
and the MNT Reform2.
Besides the basic kernel support for Genode's custom base-hw microkernel,
it contains drivers for using SD and eMMC cards, HDMI, and MIPI-DSI connected
displays, Ethernet, and USB connected devices. Moreover, we are proud to
introduce support for the Vivante GPU used by the i.MX 8M SoC. All mentioned
device drivers were ported using the
[https://genode.org/documentation/release-notes/21.08#Linux-device-driver_environment_re-imagined - re-imagined approach to port Linux drivers]
that was introduced in the previous release.
To obtain a ready-to-use SD-card when testing an arbitrary run-script
scenario, it is sufficient to add the following value to the 'RUN_OPT'
variable:
! RUN_OPT += --include image/imx8mq_mmc
Depending on which board you've chosen, it will build the corresponding u-boot
bootloader, file system, Genode system image, and integrate those parts into
one SD-card image.
Xilinx Zynq
===========
Basic platform support for the Zynq-7000 SoC has already been added to Genode
with
[https://genode.org/documentation/release-notes/15.11#Xilinx_Zynq-7000 - release 15.11].
While the virtualized zynq_qemu board support resided in the main Genode
repository and was regularly tested, support files for real Zynq-hardware were
living in segregation within the Genode-world repository.
By creating a new realm in form of a
[https://github.com/jschlatow/genode-zynq - genode-zynq repository], we were
able to consolidate the Zynq-specific board support and drivers in one place.
Furthermore, we are currently intensifying our work on this platform and
documenting the journey on
[https://genodians.org/jschlatow/2021-11-29-zynq-guide-1 - genodians.org].
This particularly includes building ready-to-use SD card images with u-boot
and supporting run-time re-configuration of the FPGA.
In order to use the zynq repository, you only need to create a clone at
_repos/zynq_, create a new build directory for arm_v7a and uncomment the
corresponding line in your etc/build.conf. Step-by-step instructions for
individual boards can be found at _repos/zynq/doc/_.
Allwinner A64 (PinePhone)
=========================
During the release cycle, Genode's support for the Allwinner A64 SoC, and
the PinePhone in particular, made big leaps forward. The corresponding code
is hosted in the dedicated
[https://github.com/nfeske/genode-allwinner - genode-allwinner] repository.
First, the Linux version taken as the basis for ported device drivers has been
updated to 5.14.1 in order to support the revision v2 of the Pine-A64-LTS
board, which features a different Ethernet PHY, namely the Motorcomm YT8511
PHY. Genode's 'pine_a64lts' board supports both board revisions now.
To enable touchscreen input on the PinePhone, the corresponding driver for the
Goodix touchscreen controller has been ported from the Linux kernel. It
complements the framebuffer driver that we introduced with the previous
release. Combined, both drivers enable the use of Genode's regular interactive
scenarios based on the 'drivers_interactive' package. The biggest technical
challenge was the untangling of both drivers from the clock, reset, and power
control units (CCU, RSB, PMIC). Those low-level platform configurations are
now handled by a new A64-specific version of the platform driver.
[image pinephone_touch]
Genode's nano-3D example responding to touch input
The improved driver support is accompanied with new tooling for booting Genode
on the PinePhone, either via USB fastboot, or via SD-card. Both options are
described in the following Genodians article.
:Booting Genode on the PinePhone:
[https://genodians.org/nfeske/2021-09-20-pine-fun-pinephone-boot]
RISC-V
======
RISC-V board support for the base-hw kernel is now located at the
[https://github.com/ssumpf/genode-riscv - genode-riscv] repository. Currently,
the repository contains support for the
[https://hensoldt-cyber.com/mig-v - MiG-V] SoC including kernel specific parts
as well as a driver for MiG-V's network-interface controller.
Base framework and OS-level infrastructure
##########################################
New pattern for C++ error handling
==================================
Genode employs C++ exceptions for propagating errors, which is true to the
language. However, the use and the mechanics of C++ exceptions comes with its
own bag of problems. The current release introduces a new error-handling
pattern in the form of the so-called 'Attempt' utility. Its name reflects its
designated use as a carrier for return values. This new utility is described
by a dedicated article at Genodians.org:
:An 'Attempt' to avoid C++ exceptions:
[https://genodians.org/nfeske/2021-11-26-attempt-no-exceptions]
During the release cycle, we applied the 'Attempt' pattern to Genode's
low-level memory-allocation code, namely core's PD session interface (for the
allocation of RAM dataspaces), and the code related to the generic 'Allocator'
interface (for the allocation of bytes). The latter is an extensive change,
touching all implementations of this interface.
To largely uphold compatibility with components using the original
exception-based interface as a mere client - in particular use cases where an
'Allocator' is passed to the 'new' operator - the traditional 'alloc' is still
supported. But it exists merely as a wrapper around the new 'try_alloc'.
However, the change does not preserve compatibility with the original
'Range_allocator' interface. So uses of this interface must be adapted.
Pin I/O session interfaces
==========================
On ARM-based SoCs, the use of general-purpose I/O (GPIO) pins is omnipresent.
Traditionally, Genode features the "Gpio" session interface for this purpose.
This interface allows a client to access an individual pin. Once assigned to a
pin, the session grants the client the full responsibility for the pin. In
particular the direction of the I/O pin is laid into the hands of the client.
We later realized that the wiring and thereby the direction of a pin is
ultimately a board-level decision. Wrongly operating an input pin in output
mode can easily result in a short-circuit. Therefore, the client of an
individual pin should better not be burdened with the responsibility to
control the pin direction or pull resistors. To address this concern, it is
best to split the roles of GPIO pins into clear-cut session interfaces.
Those roles are:
* The sensing of the state of a GPIO pin, e.g., detecting whether a button is
pressed or not: operating a pin as an input signal. This role is now covered
by the "Pin_state" session interface with the single RPC function
! bool state() const;
By calling this function, the client can request the state of the pin.
That's it.
* Controlling the signal level of a pin: operating a pin as an output signal.
This role is now addressed by the "Pin_control" session interface that
provides an interface of only one rather unsurprising RPC function
! void state(bool);
* Receiving a notification of a change of the signal level of a GPIO pin:
operating a pin as an interrupt source. This role can be represented by
Genode's existing IRQ session interface - the same interface as provided by
Genode's core for GIC interrupts.
Since each pin corresponds to a separate session, per-pin access control
becomes possible by Genode's regular session-routing mechanisms.
In contrast to the original GPIO session, the role of each pin as output and
input becomes explicit. A client can no longer drive a pin that is an input
signal unless explicitly permitted.
The interfaces were created and time-tested in the context of our
PinePhone-related development, in particular during the work described in the
following two articles.
:Device access from the user level:
[https://genodians.org/nfeske/2021-03-17-pine-fun-device-access]
:One Platform driver to rule them all:
[https://genodians.org/nfeske/2021-04-29-platform-driver]
Pin-driver framework
--------------------
In real-world system scenarios, a variety of different components must
decidedly interact with individual GPIO pins. This is where a so-called pin
driver enters the picture. This component provides the pin-state, pin-control,
and IRQ services. Analogously to how the platform driver safeguards the access
to device resources by different - mutually distrusting - device drivers, the
pin driver's job is the safeguarding of GPIO pins.
To ease the implementation of such pin drivers, the new session interfaces are
accompanied by a set of new utilities in
[https://github.com/genodelabs/genode/blob/staging/repos/os/include/os/pin_driver.h - os/pin_driver.h].
The use of these utilities is best illustrated by the
[https://github.com/nfeske/genode-allwinner/tree/master/src/drivers/pin/a64 - pin driver for the A64 SoC].
Time-multiplexed pin direction
------------------------------
There exist rare use cases for changing the direction of an I/O pin during
runtime. For example, the Goodix touchscreen controller as found in the
PinePhone monitors the state of its interrupt signal during reset. During its
normal operation, this signal is driven by the touchscreen controller but
during reset, it is driven by the host to send one bit of information (I2C
address selection). We support this time-multiplexed use of one pin as both
input and output by the means of session lifetimes. The pin driver switches
the pin into output mode not before a client establishes a pin-control session
referring to this pin. The client can thereby control the direction by
creating or closing its pin-control session.
Genode C APIs
=============
USB host-controller service API
-------------------------------
While porting the Linux driver for the Designware USB host-controller used
within the i.MX 8M SoC, we introduced a new C API to serve Genode USB clients
from C driver ports. It enables drivers to:
* Announce and release USB devices,
* Ask for a session handle of an open session via the bus/device ID pair,
* Ask for a single USB request via a session handle,
* Acknowledge a USB request via a session and request handle, and
* Notify potential USB clients that I/O progress has been made.
You can find the new C API under _repos/os/include/genode_c_api/usb.h_. A
working example driver can be found within the 'genode-imx' repository under
_src/drivers/usb_host/imx8mq_.
Touchscreen driver API
----------------------
To accommodate input drivers written in C, like the ones ported from the Linux
kernel, we need a clean way to connect C code with Genode's event session
interface.
The current release introduces a C API to be used by input drivers to generate
Genode events. The interface is located at
_repos/os/include/genode_c_api/event.h_ whereas the implementation resides at
_repos/os/src/lib/genode_c_api/event.cc_.
The initial version is limited to multitouch events only.
As of now, it is used by the Goodix touchscreen driver for the PinePhone.
Event filter for converting touch to pointer input
==================================================
Unlike traditional pointer devices, touchscreens have no notion of a pointer
position, hovering, or mouse buttons. E.g., without touching, there is no
position. There exists a gap between those devices and regular GUI
applications, which respond to pointer events in terms of hovering motion (in
screen coordinates) and mouse clicks. Genode's existing touchscreen drivers
try to bridge this gap by translating touch input to pointer events in rather
pragmatic ways. This is not optimal for two reasons.
First, putting the burden of emulating traditional pointer devices on the
touchscreen drivers not only inflates their complexity but is also unnatural
when the calibration of touch coordinates to screen coordinates comes into
play. In this case, the touchscreen driver must be made aware of the display
resolution. Second, the heuristics of how touch events are best translated
into pointer events tend to differ from driver to driver, or between Genode
use cases. Any intelligence that is builtin in the drivers stands in the way
of interchanging the drivers or enhancing the translation across all drivers
(e.g., adding two-finger-scroll).
To solve this problem in a clean way, we added a new optional filter for
translating touch events to pointer events to Genode's event-filter component
(first introduced in
[https://genode.org/documentation/release-notes/17.02#Input-event_filter - 17.02]
as input filter, reworked in
[https://genode.org/documentation/release-notes/20.08#Replacing_the_input_filter_with_an_event_filter - 20.08]).
The new filter comes in the form of a new '<touch-click>' node in the filter's
'<output>' definition. For example, the configuration of the event filter that
sits in-between the Goodix touchscreen driver for the PinePhone and the
nitpicker GUI server looks as follows.
! <config>
! <output>
! <touch-click>
! <input name="touch"/>
! </touch-click>
! </output>
! <policy label="touch" input="touch"/>
! </config>
The filter augments touch events with artificial absolute motion and mouse
click/clack events as understood by regular GUI applications. The original
touch events are preserved, enabling touch-aware applications to interpret
touch gestures.
Device drivers
##############
Hardware-accelerated graphics
=============================
Generic GPU-session interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When we introduced the GPU session initially, it was modeled after the
perceived requirements of the Linux i915 DRM back end. In the meantime, with
the enablement of a more recent Mesa version and the addition of Vivante as
another GPU family, we learned that some of those requirements are obsolete.
First, we replaced the 'info' RPC by an information ROM dataspace to overcome
the following limitations.
* The amount of data that can be transferred in an RPC is constrained by the
underlying base platform,
* Most information never changes during run time but must be copied
nonetheless when using an RPC interface,
* The information presented differs depending on the used GPU device.
With the introduction of Vivante, the original Intel-centric implementation no
longer suffices.
* Sequence numbers of GPU execution buffers are not GPU-specific and, thus,
should be part of the generic GPU session interface.
Currently, the GPU-specific information is presented in binary format, which
is specified in _gpu/info_intel.h_ resp. _gpu/info_etnaviv.h_ for the Vivante
GPU. We entertain the idea to replace the current representation by an
XML-based ROM in the future to render the interface binary agnostic and also
backwards-compatible. The information ROM can be accessed via the
'attached_info' client API function.
Furthermore, we replaced the usage of heavy-weight dataspace capabilities with
light-weight client-local identifiers called 'Buffer_id' within the API. In
case the client requires a capability (e.g., for mapping the buffer in its
address space) it uses the corresponding ID to request it from the server.
With upcoming support for other driver back ends, we need to take their
requirements into account as well. We introduced abstractions that further
encapsulate the device-specific state and operations. The changes in this
release represent only the first consolidation steps of Genode's GPU support
and we will continue this work during the next months.
Intel GPU support for Gen9 and newer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As mentioned in the
[https://genode.org/documentation/release-notes/21.08#Advancing_GPU_driver_stack - 21.08]
release notes, we were fiercely working on Intel GPU Gen9+ support because
Gen8 (Broadwell) was the only stable running GPU on Genode at the time. For
Gen9+, we experienced severe GPU hangs after an undefined amount of rendering
passes. As promised in the previous release, we dove right in and were able to
identify the main causes of this behavior. This led to working Gen9+ support in
[https://genode.org/documentation/articles/sculpt-21-10#GPU - Sculpt OS release 21.10].
To go into a little more detail, we had to look into workarounds as described by the
[https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol16-workarounds_0.pdf - Intel documentation]
and the Linux kernel driver, and determine known workarounds that only apply
to Gen9 and above. After many iterations, we found one workaround that fixed
our GPU hang issue and now apply it during GPU initialization. Additionally,
we found the hardware context sizes (a memory region where the GPU stores its
state) vary between GPU generations, where Gen9 requires more space than Gen8.
Additionally, we found that some features like tiling or client mappings
through the global-graphics translation table are not required by our updated
Mesa 21.0.0 Iris Gallium driver. Since these resources are global and were
split between multiple GPU client applications, not using them lifts the
limits formerly imposed by the partitioning.
For the Sculpt integration, we added GPU-service support and are providing
various packages. A summary on how to test GPU acceleration on Sculpt can be
found at the following Genodians article.
:Test driving Sculpt's 3D support:
[https://genodians.org/ssumpf/2021-10-25-glmark2]
Vivante GPUs (i.MX8)
~~~~~~~~~~~~~~~~~~~~
With the previous release, we already foresaw adding support for Vivante
GPUs as found in i.MX8 SoCs by show-casing a work-in-progress driver
component based on the Linux 'etnaviv' DRM driver and using the also ported
'etnaviv' Gallium driver.
This driver component is now available in an updated fashion in the
[https://github.com/skalk/genode-imx - genode-imx] repository that
encapsulates support for the family of i.MX8 SoCs for Genode. In contrast to
our first prototype, the driver now relies completely on the new DDE Linux
approach and re-uses the existing 'lx_emul' and 'lx_kit' libraries. At the
moment, the driver does not make use of a C-API to Genode services for
accessing the GPU service like the other new DDE Linux drivers do but
implements the session directly. We decided against prematurely introducing
such an C-API while the GPU session itself is still in flux.
[image glmark_mnt_reform]
Glmark running via the ported Vivante GPU driver on the MNT Reform laptop
Briefly touching on the current implementation of the driver, we had to extend
the 'lx_kit' API slightly to implement the buffer-object allocation. Also, we
added a special-purpose interface called 'lx_drm' that comprises all Linux DRM
I/O controls that need to be performed for implementing the GPU session and
itself is a simple layer on top of 'drm_ioctl'.
The 'lx_drm' functions are executed within the context of an emulated Linux
kernel thread executed under a cooperative user-level scheduling scheme.
However, since the GPU session is based on synchronous RPCs and we do not know
in advance if a call into the ported driver code blocks at some point, we had
to ensure the RPC returns not before the operation completed. The completion
of operations may include several blocking states and concurrent event
handling (e.g., hardware interrupts).
For the time being, the driver component is still being worked on. We are, for
example, investigating overall performance regressions. Nevertheless, the
driver is functionally complete and currently supports one client at a time.
In addition to the driver component, we cleaned up the existing 'etnaviv'
libdrm back end and created a Sculpt pkg called *mesa_gpu-etnaviv* analogous
to the pkgs for 'iris' and 'softpipe' back ends. The most visible change is
the switch from the ad-hoc DRM session to the GPU session.
All in all, we are now at a stage were we can work on optimizing the graphics
stack on the Vivante GPU and are in particular looking forward to porting the
next Linux driver. After all, by doing so, we can flesh out and maybe
generalize the 'lx_drm' API so that for other drivers the porting effort gets
reduced even further.
VirtIO input and framebuffer drivers
====================================
_This section was co-authored by Piotr Tworek who created the_
_VirtIO driver support. Thanks Piotr for the welcome contribution!_
Over the
[https://genode.org/documentation/release-notes/21.02#VirtIO_block_devices_for_virtual_machines_on_ARM - previous]
[https://genode.org/documentation/release-notes/21.08#RAM_framebuffer_driver_for_Qemu - releases]
of Genode this year, the framework received steadily improved driver support
for virtual devices as supported by Qemu. The primary motivation behind this
line of work is the use of virtual hardware as an experimentation ground for
Genode on the AARCH64 and RISC-V architectures. The use of virtual hardware
nicely side-steps the costs and (un-)availability of suitable devices, and
avoids the extra effort that is usually involved when working with real
hardware. The current release further advances the virtual-device support by
the introduction of VirtIO input and graphics drivers.
VirtIO input
------------
The new input driver can service Qemu VirtIO mouse, keyboard, and tablet
devices. The implementation is based on the VirtIO 1.1 device specification,
Section 5.8 "Input Device". The driver can service three separate device
types, namely mouse, keyboard, and tablet. The main difference between mouse
and tablet devices is that the former produces relative events whereas the
latter produces absolute motion events.
By default, the driver tries to attach to the first VirtIO input device of any
of the listed types. Such behavior would pose a bit of a problem since in
Genode, we'd like to know that a specific instance of the driver will attach
only to a mouse for example. This way, we can define proper policies for it.
To allow such behavior, the VirtIO input driver has one configuration key
called 'match_product', which accepts the values of "mouse", "keyboard",
"tablet", and "any" (default). Using this config key, one can accomplish
exactly what is needed to tell the driver to only attach to a VirtIO input
device if it's of "match_product" type.
VirtIO framebuffer
------------------
The new VirtIO framebuffer driver implements the necessary bits to provide 2D
framebuffer support on top of a VirtIO GPU device as provided by Qemu. Compared
to the ramfb driver, which was introduced in Genode
[https://genode.org/documentation/release-notes/21.08#RAM_framebuffer_driver_for_Qemu - 21.08],
the VirtIO framebuffer driver has one major benefit: It allows the Qemu window
to be dynamically resized at runtime. The driver will treat this as resolution
change and act accordingly. In contrast to the VirtIO input driver, the
framebuffer driver does not support any extra config options.
Practical use
-------------
Thanks to the new drivers, the drivers_interactive package for the 'virt_qemu'
board has become fully interactively usable. The drivers subsystem spawns two
instances of virtio_input. One attaches to a keyboard device and the second to
a mouse. This is what the default virt_qemu board exposes. At this time, the
tablet device is not instantiated by default but it might become useful in the
future for testing Genode's touch support.
Make sure that Qemu exposes those new devices in the modern VirtIO 1.0 mode.
Versions up to Qemu 5.1.0 still use pre-1.0 mode in the default setup.
One thing to keep in mind is that the VirtIO framebuffer driver will change
the resolution of the virtual display whenever the Qemu window is resized.
This means that for high resolution screens, one might have to tweak the
default RAM quota for the driver. The default should be enough for 1080p
screens, but not much more than that.
Linux device-driver environment
===============================
While working on Linux device-driver ports that use the new DDE Linux
environment introduced in
[https://genode.org/documentation/release-notes/21.08#Linux-device-driver_environment_re-imagined - release 21.08],
we stumbled across some inaccuracies and missing pieces of the former
implementation.
For instance, kworker threads were blocked unconditionally before. But the
original Linux kernel semantics includes corner-cases that delay kworker
suspension. By adding them, we circumvent potential deadlocks. The cache
maintenance operations got optimized by checking the read/write direction of
the device with regard to DMA memory more accurately. Moreover, we had to
learn that on ARM the minimal alignment for all allocations within Linux have
to be of cache-line granularity.
Feature-wise, a new API got introduced to access the pin-control service and
IRQ sessions offered by it. This is useful when a Linux driver directly
depends on GPIO settings respectively uses GPIO pins as interrupt source.
Libraries and Applications
##########################
Feature completion of VirtualBox 6
==================================
With [https://genode.org/documentation/articles/sculpt-21-10 - Sculpt OS 21.10],
we released VirtualBox version 6 as experimental alternative to the existing
port of version 5. We also switched to version 6 as daily driver on our
development machines at Genode Labs. These steps yielded the following
improvements during the past Genode release cycle.
The integration features shared folders, shared clipboard, and guest
mouse-pointer shape were fully enabled. Most guest-integration modules in
VirtualBox are implemented as shared libraries/objects, which are loaded at
runtime on demand. Following our goal to keep changes to the upstream code
minimal, our version of VirtualBox 6 now provides VBoxSharedClipboard and
VBoxSharedFolders as dedicated libraries that must be integrated into the
system as follows. Note, the libraries are accessed by the VirtualBox code as
files before loading but must also be available as ROMs to our runtime dynamic
linker.
! <start name="virtualbox6">
! <config vbox_file="machine.vbox6">
! <vfs>
! <!-- original file names of shared objects -->
! <rom name="VBoxSharedClipboard.so"/>
! <rom name="VBoxSharedFolders.so"/>
! </vfs>
! </config>
! <route>
! <!-- map file names to Genode shared-object naming scheme -->
! <service name="ROM" label="VBoxSharedClipboard.so">
! <parent label="virtualbox6-sharedclipboard.lib.so"/> </service>
! <service name="ROM" label="VBoxSharedFolders.so">
! <parent label="virtualbox6-sharedfolders.lib.so"/> </service>
! </route>
! </start>
As depicted in the configuration snippet above, we use the file extension
_.vbox6_ for VirtualBox 6 configuration files. The background is that there
are some subtle incompatibilities in VirtualBox 6 with settings we used in
version 5. For example, the version of the configuration file must be set to
1.18+ for maximum compatibility of virtual-device configuration and guest
operating systems. An example configuration is provided by the pkg/vbox6 depot
archive and specifies the version like follows.
! <VirtualBox xmlns="http://www.virtualbox.org/" version="1.18-genode">
Unlike VirtualBox 5, the current version does not implement a custom Audio
back end for Genode but uses the existing OSS back end of the original
implementation. The feature can be enabled in .vbox and runtime configuration.
We recommend using the HDA controller.
! <AudioAdapter controller="HDA" driver="OSS" enabled="true" enabledOut="true" enabledIn="false"/>
! <start name="virtualbox6">
! <config>
! <vfs>
! <dir name="dev"> <oss name="dsp"/> </dir>
! <vfs>
! </config>
! </start>
More device-related improvements are the reporting of mouse-wheel events, the
support of up to 8 pass-through USB devices via the virtual XHCI USB3
controller, and a ready-to-use Sculpt package to capture webcam streams in the
VM (genodelabs/pkg/vbox6-capture).
Finally, this release includes a whole lot of stability improvements to bring
VirtualBox 6 on par with version 5 in daily use like robust machine state
handling including the FPU, fixed corner cases in the AHCI model and
Startup-IPI implementation as well as enhanced timeout and CPU wakeup
handling.
Sculpt OS for 64-bit ARM in addition to x86
===========================================
Up until now, the Genode-based [https://genode.org/download/sculpt - Sculpt OS]
was primarily targeted at the 64-bit x86 architecture. However, since the
hardware support of 64-bit ARM platforms like i.MX8 has reached almost feature
parity with the PC platform, it was time to introduce the notion of CPU
architectures to package index files.
In Sculpt OS, software packages are provided in a federated way from any
number of package providers. Each provider offers a so-called _index_ that
enlists the available package versions blessed for a specific Sculpt OS
release. See the release notes for Genode
[https://genode.org/documentation/release-notes/19.02#Announcing_software_packages - 19.02]
for more details.
Starting with [https://genode.org/news/sculpt-os-release-21.10 - Sculpt OS 21.10]
released in October, each index file features a declaration of the CPU
architectures supported by the package provider.
! <index>
! <supports arch="x86_64"/>
! <supports arch="arm_v8a"/>
! ...
Sculpt uses this information to decide whether to display the index or not by
comparing the architecture of the running machine with these declarations.
Individual entries of an index file can be tagged as being specific for one
architecture.
! <pkg path="mesa_gpu-intel" info="Intel GPU driver (IRIS)" arch="x86_64"/>
This annotation can also be specified for a sub index.
! <index name="Virtual machines" arch="x86_64">
! ...
! </index>
Thanks to this approach, most packages - which are architecture-agnostic - can
be offered for both x64_64 and arm_v8a with almost no manual work. In fact,
starting with Sculpt 21.10, all default packages offered by Genode Labs are
available for both architectures.
Audio and OpenGL support for libSDL2
====================================
With this release, we extend the features of our SDL2 port by enabling audio
support via the OSS back end and added basic support for using OpenGL.
Re-using the existing OSS back end via our VFS OSS plugin is in contrast to
how we enabled audio in our SDL1 port where we use Genode's audio-out
session directly. Instead of having to add a Genode specific back end to each
ported software, it is more reasonable to have just one implementation of a
somewhat common interface for which the back end already exists.
The OpenGL support, on the other hand, has not been thoroughly tested yet
but works well enough for one or the other game. It still suffers from the
same limitation as the normal video back end where resizing the window during
runtime is not supported. This feature is yet to be implemented.
Additionally, we made SDL2 now to use its existing pthread back ends,
rather than using the generic fallback ones, as we deem the current pthread
support in Genode sufficient.
SSH terminal moved to Genode world repository
=============================================
The SSH terminal component now resides in the world repository. When we
initially introduced this component, it complemented the existing TCP
terminal. Rather than using plain TCP to access a terminal server the
connection is secured by the SSH protocol.
In the meantime the component itself incorporated more and more features
that were not anticipated in the initial design. Since we have not used
the component much ourselves lately, albeit some features are tested in our
nightly CI, we decided to move it to the world repository.
On a different note, the component now features new support for SFTP that
enables one to access a Genode file system via SSH. Thanks to Tomasz Gajewski
for this welcome contribution.
Build system and tools
######################
Moving the platform-specific board support into extra repositories made it
necessary to review the run tool with respect to virtualized platforms. For
running Genode within Qemu, the run tool used to assemble the Qemu command
line depending on the target board. In order to achieve a clean cut between
the main repository hosting this part of the run tool and the
platform-specific repositories, we came up with a way to specify the Qemu
arguments outside the main repository.
The solution follows along our approach of how we already specify the
architecture and link address of a target board in distinct files within a
board-property directory _board/<board_name>/_. Similarly, the board-specific
Qemu arguments are now provided in a _board/<board_name>/qemu_args_ file. This
file may contain one or multiple lines that will be appended to the command
line generated by the run tool. Because it is required by virt_qemu, it is
possible to restrict particular arguments to a certain spec, e.g. arm_v8a, by
prefixing the line with 'arm_v8a:'. Note, that any '-m *' argument, which
specifies the amount of RAM, provided within a _qemu_args_ file will override
any memory setting provided in the run scripts.
Moreover, the _qemu_args_ file is obliged with instantiating a network
controller since this is also specific to the platform. For the zynq_qemu
board, e.g., this is achieved by the following arguments:
! -net nic,model=cadence_gem,netdev=net0 -netdev user,id=net0
Always instantiating a network device removes the need to call
'append_qemu_nic_args' in the run scripts. However, you can still use this
function to add forwarding rules to the netdev with id _net0_.

1070
doc/release_notes/22-02.txt Normal file

File diff suppressed because it is too large Load Diff

775
doc/release_notes/22-05.txt Normal file
View File

@@ -0,0 +1,775 @@
===============================================
Release notes for the Genode OS Framework 22.05
===============================================
Genode Labs
The Genode release 22.05 stays true to this year's
[https://genode.org/about/road-map - roadmap].
According to the plan, we continue our tradition of revising the framework's
documentation as part of the May release. Since last year, the Genode
Foundations book is accompanied with the Genode Platforms document that
covers low-level topics. The second revision has just doubled in size
(Section [Updated and new documentation]).
Functionality-wise, the added support for WireGuard-based virtual private
networks is certainly the flagship feature of the release.
Section [WireGuard] briefly introduces the new component while leaving
in-depth information to a
[https://genodians.org/m-stein/2022-05-26-wireguard-1 - dedicated article].
Among the other topics of the release, our continued work on device drivers
stands out. We managed to bring Genode's lineup of PC drivers ported from the
Linux kernel up to the kernel version 5.14.21 using Genode's unique DDE-Linux
porting approach.
As described by Section [New generation of DDE-Linux-based PC drivers], this
work comprises complex drivers like the wireless LAN stack including Intel's
Wifi driver and the latest Intel display driver. At the framework's side, the
modernization of Genode's platform driver for PC hardware is in full swing.
Even though not yet used by default, the new driver has reached feature parity
with the original PC-specific platform driver while sharing much of its code
base with the growing number of ARM platform drivers such as the FPGA-aware
platform-driver for Xilinx Zynq (Section [Xilinx Zynq]).
Regarding the PinePhone, Genode 22.05 introduces the basic ability to issue
and receive phone calls, which entails the proper routing of audio signals and
controlling the LTE modem. Furthermore, in anticipation of implementing
advanced energy-management strategies, the release features a custom developed
firmware for the PinePhone's system-control processor. Both topics are
outlined in Section [PinePhone] while further details and examples are given
in dedicated articles.
The release is wrapped up by usability improvements of the framework's
light-weight event-tracing mechanism, low-level optimizations, and API
refinements.
WireGuard
#########
[https://www.wireguard.com/ - WireGuard] is a protocol for encrypted, virtual
private networks (VPNs) with the goal of bringing ease-of-use and
state-of-the-art network security together. Furthermore, it is designed to be
implemented both light-weighted and highly performant at the same time. For
years now, we were keen to support WireGuard as a native standard solution for
peer-to-peer network encryption. With Genode 22.05, we could finally
accomplish that goal.
After we had considered various implementations as starting point, we chose to
port the Linux kernel implementation of WireGuard using our modernized
DDE-Linux tool set. The outcome is a user-land component that acts as client
to one NIC session and one uplink session. At the uplink session, the
WireGuard component plays the role of a VPN-internal network device that
communicates plain-text with the VPN participants. At the NIC session,
however, the component drives an encrypted UDP tunnel through the public
network towards other WireGuard instances.
In Genode, a WireGuard instance receives its parameters through the component
configuration with the peer configuration being re-configurable:
! <config private_key="0CtU34qsl97IGiYKSO4tMaF/SJvy04zzeQkhZEbZSk0="
! listen_port="49001">
!
! <peer public_key="GrvyALPZ3PQ2AWM+ovxJqnxSqKpmTyqUui5jH+C8I0E="
! endpoint_ip="10.1.2.1"
! endpoint_port="49002"
! allowed_ip="10.0.9.2/32" />
!
! </config>
A typical integration scenario would use two instances of Genode's NIC router.
One router serves the public network side of WireGuard and connects to the
internet via the device driver whereas the other router uses the private
network side of WireGuard as uplink interface. In this scenario, there is no
way around the WireGuard tunnel towards the Internet even when looking only at
components and sessions. Alternatively, we could accomplish the same goal with
only one router instance in contexts that allow us to trust in the integrity
of the router's own security domains.
[image wireguard_integration]
A typical integration scenario for WireGuard
For more details on how to integrate and route WireGuard in Genode, you may
refer to the new run scripts _wg_ping_inwards.run_, _wg_ping_outwards.run_,
_wg_lighttpd.run_, and _wg_fetchurl.run_, which are located at
_repos/dde_linux/run/_.
Please be aware that this is the first official version of the WireGuard
component. Although we are convinced of the quality of the underlying
time-tested Linux implementation, we strongly recommend against basing
security-critical scenarios on Genode's port before it had the time to mature
through real-world testing as well.
For the whole story behind the new WireGuard support in Genode, have a look at
the following dedicated article at [https://genodians.org]:
:Bringing WireGuard to Genode:
[https://genodians.org/m-stein/2022-05-26-wireguard-1]
New generation of DDE-Linux-based PC drivers
############################################
With the
[https://genode.org/documentation/release-notes/22.02#New_Linux-device-driver_environment_for_PC_drivers - previous release],
we started to apply the
[https://genode.org/documentation/release-notes/21.08#Linux-device-driver_environment_re-imagined - new DDE Linux approach]
to Linux-based PC drivers.
The first driver to be converted was the USB host-controller driver. In the
current release, we finished up this line of work. By now, all remaining
Linux-based PC drivers have been converted and updated. Those drivers now
share the same kernel version 5.14.21. The ports and configuration reside in
the _pc_ repository.
Based on the groundwork laid by the USB host-controller driver, we started
working on the Intel display and Intel wireless drivers. With the stumbling
blocks already out of the way, namely the x86 support in DDE Linux, we could
focus entirely on the intricacies of each driver.
In case of the Intel display driver, we could eliminate all our patches to the
kernel that we previously needed to manage the display connectors. Due to the
update, we gained support for newer Intel Gen11 and Gen12 graphics generations
as found in recent Intel CPUs. The old driver has been removed and the new
driver is now called _pc_intel_fb_drv_. Its configuration, however, remained
compatible and is documented in detail in the README of the driver.
The Intel wireless driver also profited from the version update as it now
supports 802.11ax capable devices. In particular, the driver was tested with
Intel Wi-Fi6 AX201 cards. The driver's unique physique - where the component
not only incorporates the driver but also the supporting user-land supplicant -
required changes to the way the Linux emulation environment is initialized.
We utilize a new VFS 'wifi' plugin that is executed during the component
start-up to prepare the emulation environment.
The following snippet shows how to configure the driver:
!<start name="pc_wifi_drv" caps="250">
! <resource name="RAM" quantum="32M"/>
! <provides><service name="Nic"/></provides>
! <config>
! <libc stdout="/dev/null" stderr="/dev/null" rtc="/dev/rtc"/>
! <vfs>
! <dir name="dev">
! <log/> <null/> <rtc/> <wifi/>
! <jitterentropy name="random"/>
! <jitterentropy name="urandom"/>
! </dir>
! </vfs>
! </config>
! <route>
! <service name="Rtc"> <any-child /> </service>
! <any-service> <parent/> <any-child /> </any-service>
! </route>
!</start
Apart from the added VFS plugin, the configuration remained unchanged.
So using the new driver is opaque to the user. The old driver was removed
and the new driver is now called _pc_wifi_drv_. Instead of preparing the
'dde_linux' port, the 'libnl' and 'wpa_supplicant' ports are now required for
building the driver.
! tool/ports/prepare libnl wpa_supplicant
Additionally to both driver updates, we wrapped up working on the USB
host-controller driver component by enabling the UHCI host-controller driver.
Support for such controllers was omitted in the previous release and
supporting the driver required us to add I/O port support to the 'lx_kit' for
x86. With this remaining feature gap closed, the _legacy_pc_usb_host_drv_
driver component has been removed in favour of the new one. Furthermore, the
Genode C-API for USB glue code, which was initially copied from the i.MX8 USB
host-controller driver, was consolidated and moved into the _dde_linux_
repository where it now is referenced by all recent USB host-controller
drivers.
With all updated drivers in place, it was time to make inventory and
de-duplicate the drivers since each driver accumulated redundant bits and
pieces of code. This consolidation effort simplified things greatly. We moved
most of the code shared by all drivers into a separate 'pc_lx_emul' library,
which is the back bone of those ported drivers. Since not all of them require
the same sophistication when it comes to the kernel API emulation, we followed
the same modular pattern already established in the _dde_linux_ repository,
which allows for mixing and matching of the available dummy implementations
individually per driver.
Updated and new documentation
#############################
Genode Platforms
----------------
The second revision of the "Genode Platforms" document condenses two years of
practical work with enabling Genode on a new hardware platform, taking the
PinePhone as concrete example. Compared to the first version published one
year ago, the content has doubled. Among the new topics are
: <div class="visualClear"><!-- --></div>
: <p>
: <div style="clear: both; float: left; margin-right:20px;">
: <a class="internal-link" href="https://genode.org">
: <img class="image-inline" src="https://genode.org/documentation/genode-platforms-title.png">
: </a>
: </div>
: </p>
* Working with bare-bones Linux kernels,
* Network driver based on DDE-Linux,
* Display and touchscreen,
* Clocks, resets, and power controls, and
* Modem control and telephony.
:Second revision of the Genode Platforms document:
[https://genode.org/documentation/genode-platforms-22-05.pdf]
Genode Foundations
------------------
The "Genode Foundations" book received its annual update. It is available at
the [https://genode.org] website as a PDF document and an online version.
The most noteworthy additions and changes are:
: <div class="visualClear"><!-- --></div>
: <p>
: <div style="clear: both; float: left; margin-right:20px;">
: <a class="internal-link" href="https://genode.org">
: <img class="image-inline" src="https://genode.org/documentation/genode-foundations-title.png">
: </a>
: </div>
: </p>
* Revised under-the-hood section about the base-hw kernel,
* Adaptation to changed repository structure (pc repository, SoC-specific
repositories),
* Updated API documentation, and
* Adjusted package-management description.
: <div class="visualClear"><!-- --></div>
To examine the changes in detail, please refer to the book's
[https://github.com/nfeske/genode-manual/commits/master - revision history].
Base framework and OS-level infrastructure
##########################################
Revised tracing facilities
==========================
Even though a light-weight event tracing mechanism has been with Genode since
[https://genode.org/documentation/release-notes/13.08#Light-weight_event_tracing - version 13.08],
in practice, this powerful tool remains sparingly used because it is arguable
less convenient than plain old debug instrumentation.
The trace-logger component introduced later in
[https://genode.org/documentation/release-notes/18.02#New_trace-logging_component - version 18.02]
tried to lower the barrier, but tracing remains being an underused feature.
The current release brings a number of usability improvements that will
hopefully make the tool more attractive for routine use.
Concise human-oriented output format
------------------------------------
First, we changed the output format of the trace logger to become better
suitable for human consumption, reducing syntactic noise and filtering out
repetitive information. For example, when instrumenting the VFS server in
Sculpt using the new GENODE_TRACE_TSC utility (see below), the trace logger
now generates tabular output as follows.
! Report 4
!
! PD "init -> runtime -> arch_vbox6 -> vbox -> " ----------------
! Thread "vCPU" at (0,0) total:12909024 recent:989229
! Thread "vCPU" at (1,0) total:5643234 recent:786437
!
! PD "init -> runtime -> ahci-0.fs" -----------------------------
! Thread "ahci-0.fs" at (0,0) total:910497 recent:6335
! Thread "ep" at (0,0) total:0 recent:0
! 71919692932: TSC process_packets: 8005M (4998 calls, last 4932K)
! 71921558516: TSC process_packets: 8006M (4999 calls, last 1596K)
! 71922760220: TSC process_packets: 8007M (5000 calls, last 1006K)
! 71929853586: TSC process_packets: 8009M (5001 calls, last 1840K)
! 71931315246: TSC process_packets: 8011M (5002 calls, last 1253K)
! 72127999920: TSC process_packets: 8016M (5003 calls, last 5606K)
! 72129568198: TSC process_packets: 8018M (5004 calls, last 1345K)
! 77161908178: TSC process_packets: 8029M (5005 calls, last 11349K)
! 77643225736: TSC process_packets: 8029M (5006 calls, last 217K)
! 89422100594: TSC process_packets: 8035M (5007 calls, last 5656K)
! 89422123632: TSC process_packets: 8035M (5008 calls, last 1342)
! Thread "signal handler" at (0,0) total:36329 recent:3001
! Thread "signal_proxy" at (0,0) total:51838 recent:13099
! Thread "pdaemon" at (0,0) total:97184 recent:332
! Thread "vdrain" at (0,0) total:1266 recent:286
! Thread "vrele" at (0,0) total:1904 recent:516
!
! PD "init -> runtime -> nic_drv" -------------------------------
! Thread "nic_drv" at (0,0) total:34044 recent:897
! Thread "signal handler" at (0,0) total:369 recent:142
!
! ...
Subjects that belong to the same protection domain are grouped together.
The formerly optional affinity and activity options have been removed.
These pieces of information are now unconditionally displayed. The trace
entries belonging to a thread appear as slightly indented. Trace subjects with
no activity do not produce any output. This way, the new version can be easily
used to capture CPU usage of all threads over time, as a possible alternative
to the top tool, which gives only momentarily sampled information.
Straight-forward trace logging with Sculpt OS
---------------------------------------------
Second, we added the trace-logger utility to the default set of packages along
with an optional launcher. With this change, only two steps are needed to use
the tracing mechanism with the
[https://genode.org/documentation/release-notes/22.02#Framework_for_special-purpose_Sculpt-based_operating_systems - modularized Sculpt]:
# Add 'trace_logger' to the 'launcher:' list of the .sculpt file
# Either manually select the 'trace_logger' from the '+' menu,
or add the following entry to the deploy configuration:
! <start name="trace_logger"/>
By default, the trace logger is configured to trace all threads executed in
the runtime subsystem and to print a report every 10 seconds. This default
policy can be refined in the launcher's '<config>' node. Note that the trace
logger does not respond to configuration changes during runtime. Changes come
into effect not before restarting the component.
Capturing performance measurements as trace events
--------------------------------------------------
Finally, to leverage the high efficiency of the tracing mechanism for
performance analysis, we complement the convenient
[https://genodians.org/nfeske/2021-04-07-performance - GENODE_LOG_TSC]
measurement device provided by _base/log.h_ with new versions that target the
trace buffer. The new macros GENODE_TRACE_TSC and GENODE_TRACE_TSC_NAMED
thereby simplify the capturing of highly accurate time-stamp-counter-based
measurements for performance-critical code paths that prohibit the use of
regular log messages.
Memcpy and memset optimization
==============================
With the improving support for the Zynq-7000 SoC, it was time to collect a few
basic performance metrics. For the purpose of evaluating memory throughput,
there exists a test suite in _libports/run/memcpy.run_. It takes a couple of
measurements for different memcpy and memset implementations. There also
exists a Makefile in _libports/src/test/memcpy/linux_ to build a similar test
suite for Linux that serves as a baseline. By comparing the results, we get an
indicator of whether our board support is setting up the hardware correctly.
Looking at the numbers for the Zynq-7000 SoC, however, we were puzzled about
why we achieved significantly less memcpy throughput on Genode than on Linux.
This eventually sparked an in-depth investigation of memcpy implementations
and of the Cortex-A9's memory subsystem.
As it turned out, the major difference was caused by our Linux tests hitting
the kernel's copy-on-write optimization and, therefore, accidentally mimicking
a memset scenario rather than a memcpy scenario. Nevertheless, in the
debugging process, we were able to identify a few low-hanging fruits for
general optimization of Genode's memset and memcpy implementations: Replacing
the bytewise memset implementation with a wordwise memset yielded a speedup of
~6 on Cortex-A9 (base-hw) and x86 (base-linux). Similarly, we achieved a
memcpy speedup of ~3 on x86. On arm_v7, we also experimented with the
preloading instruction (pld) and L2 prefetching. On Zynq-7000 (Cortex-A9), we
gained a speedup of ~2-3 by tuning these parameters.
Extended black-hole component
=============================
The black-hole component introduced in
[https://genode.org/documentation/release-notes/22.02#Black-hole_server_component - version 22.02]
provides pseudo services for commonly used session interfaces and is thereby
able to satisfy the resource requirements of a component without handing out
real resources. This is especially useful for deploying highly flexible
subsystems like VirtualBox, which supports many host-guest integration
features, most of which are desired only in a few scenarios. For example, to
shield a virtual machine from the network, the NIC session requested by the
VirtualBox instance can simply be assigned to the black-hole server while
keeping the network configuration of the virtual machine untouched.
The current release extends the black-hole component to cover ROM, GPU, and
USB services in addition to the already supported NIC, uplink, audio, capture,
and event services. The ROM service hands out a static '<empty/>' XML node.
The USB and GPU services accept the creation of new sessions but respond in a
denying way to any invocation of the session interfaces. The black-hole server
is located at _os/src/server/black_hole/_.
Refined low-level block I/O interfaces
======================================
In the original version of the 'Block::Connection::Job' API introduced in
[https://genode.org/documentation/release-notes/19.05#Modernized_block-storage_interfaces - version 19.05],
split read/write operations were rather difficult to accommodate and remained
largely unsupported by clients of the block-session interface. In practice,
this limitation was side-stepped by dimensioning the default I/O buffer sizes
large enough to avoid splitting. The current release addresses this limitation
by changing the meaning of the 'offset' parameter of the
'produce_write_content' and 'consume_read_result' hook functions. The value
used to reflect the absolute byte position. In the new version, it is relative
to the job's operation.
_This API change requires the adaptation of existing block-session clients._
We adapted all block-session clients accordingly, including part_block,
vfs/rump, vfs/fatfs, and Genode's ARM virtual machine monitor. Those
components thereby became able to work with arbitrary block I/O buffer sizes.
Improved touch-event support
============================
Until recently, Genode's GUI stack largely relied on the notion of an absolute
pointer position. For targeting touch-screen devices, our initial approach
was the translation of touch events to absolute motion events using the
event-filter component
([https://genode.org/documentation/release-notes/21.11#Event_filter_for_converting_touch_to_pointer_input - version 21.11]).
However, the event types are subtly different, which creates uncertainties.
Whereas a pointer has always a defined (most recent) position that can be used
to infer a hovered UI element in any situation, touch input yields a valid
position only while touching. Because both event types are different after all,
the conversion of touch input to pointer motion can only be an intermediate
solution. The current release enhances several components of Genode's GUI
stack with the ability to handle touch events directly.
In particular, the nitpicker GUI server has become able to take touch events
into consideration for steering the keyboard focus and the routing of
input-event sequences. The window-manager component (wm) has been enhanced to
transform touch events similarly to motion events by using one virtual
coordinate system per window. Finally, the menu-view component, which
implements the rudimentary widget set as used by Sculpt OS' administrative
user interface, evaluates touch events for generating hover reports now.
Combined, these changes make the existing GUI stack fit for our anticipated
touch-screen based usage scenarios such as the user interface for Genode on
the PinePhone.
Platform driver
===============
The architecture-independent platform driver that unified the platform API since
[https://genode.org/documentation/release-notes/22.02#Platform_driver - release 22.02],
still missed some features to replace the deprecated x86-specific variant.
Most importantly, it was not aware of PCI devices and their special treatment.
PCI decode component
--------------------
The platform driver is a central resource multiplexer in the system, and
literally all device drivers depend on it. Therefore, it is crucial to keep it
as simple as possible to minimize its code complexity. To facilitate
PCI-device resource handling of the platform driver, we introduce a new
component called _pci_decode_. It examines information delivered by the ACPI
driver about the location of the PCI configuration spaces of PCI host bridges,
as well as additional interrupt re-routing information, and finally probes for
all available PCI devices, and their functions. Dependent on additional
kernel-related facilities, e.g., whether the micro-kernel supports
message-signaled interrupts, it finally publishes a report about all PCI
devices and their related resources.
An example report looks like the following:
! <devices>
! <device name="00:02.0" type="pci">
! <pci-config address="0xf8010000" bus="0x0" device="0x2" function="0x0"
! vendor_id="0x8086" device_id="0x1616" class="0x30000"
! bridge="no"/>
! <io_mem address="0xf0000000" size="0x1000000"/>
! <io_mem address="0xe0000000" size="0x10000000"/>
! <io_port_range address="0x3000" size="0xffff0040"/>
! <irq type="msi" number="11"/>
! </device>
!
! ...
! </devices>
The device and resource description in this report is compatible with the
device configuration patterns already used by the platform driver before.
Devices ROM
-----------
To better cope with device information gathered at runtime, like the one
provided by the PCI decoder, the platform driver no longer retrieves the device
information from its configuration. Instead, it requests a devices ROM
explicitly. The policy information about which devices are assigned to which
client remains an integral part of the platform driver's configuration.
The devices ROM is requested via the label "devices" by default. If one needs
to name the ROM differently, one can state the label in the configuration:
! <config devices_rom="config"/>
Using the example above, the former behavior can be emulated. It prompts the
platform driver to obtain both its policy configuration and device information
from the same "config" ROM.
Static device information for a specific SoC respectively board does now
reside in the SoC-specific repositories within the _board/_ directory.
For instance, the device information for the MNT Reform 2 resides in the
genode-imx repository under _board/mnt_reform2/devices_. All scenarios and
test-scripts can refer to this central file.
Report facility
---------------
The platform driver can report its current view on devices as well as its
configuration. An external management component might monitor this information
to dynamically apply policies. With the following configuration switches, one
can enable the reports "config" and "devices":
! <config>
! <report devices="yes" config="yes"/>
! ...
! </config>
Interrupt configuration
-----------------------
The need for additional information to set up interrupts appropriately led to
changes in the interrupt resource description consumed by the platform driver.
It can now parse additional attributes, like mode, type, and polarity. It
distinguishes "msi" and "legacy" as type, "high" and "low" as polarity,
"level" and "edge" as mode. Dependent on the stated information in the devices
ROM, the platform driver will open the IRQ session for the client accordingly.
I/O ports
---------
A new resource type in the device description interpreted by the platform
driver is the I/O port range. It looks like the following:
! <devices>
! <device name="00:1f.2" type="pci">
! ...
! <io_port_range address="0x3080" size="0x8"/>
! ...
! </device>
! ...
! </devices>
The generic platform API's device interface got extended to deliver an IO_PORTS
session capability for a given index. The index is dependent on which I/O port
ranges are stated for a given device.
The helper utility 'Platform::Device::Io_port_range' simplifies the usage of
I/O ports by device driver clients. It can be found in
_repos/os/include/platform_session/device.h_.
DMA protection
--------------
The generic platform driver now uses device PDs and attaches all DMA buffers
requested by a client to it. Moreover, it assigns PCI devices to the device PD
too. On the NOVA kernel, this information is used to
configure the IOMMU correspondingly.
PCI device clients
------------------
The platform API and its utilities no longer differentiate between PCI and
non-PCI devices. However, under the hood, the platform driver performs
additional initialization steps once a PCI device gets acquired. Dependent on
the resources assigned to the device, the platform driver enables I/O and
memory access in the PCI configuration space of the device. Moreover, it
enables bus-master access for DMA transfers.
To assign PCI devices to a client, the policy rules in the platform driver can
refer to it either by a device/vendor ID tuple, or by stating a PCI class.
The PCI class names are the same supported by the previous x86-specific
platform driver. Of course, one can still refer to any device via its unique
name. Here is an example for a policy set:
! <config>
! <policy label="usb_drv -> ">
! <pci class="USB"/>
! </policy>
! <policy label="nvme_drv -> ">
! <pci vendor_id="0x1987" device_id="0x5007"/>
! </policy>
! <policy label="ps2_drv -> ">
! <device name="ps2"/>
! </policy>
! </config>
Wait for platform device availability
-------------------------------------
Now that device information can be gathered dynamically at runtime it might
happen that a client opens a session to the platform driver before the device
becomes available. As long as a valid policy is defined for the client, the
platform driver will establish the connection, but deliver an empty devices
ROM to the client.
To simplify the usage by device drivers, the utilities to acquire a device
from the platform driver in 'Platform::Device' and 'Platform::Connection' will
wait for the availability of the device. This is done by implicitly
registering a signal handler for devices ROM updates at the platform driver
when the acquisition failed, and waiting for ROM updates until the device is
available.
Any signal handler that was registered before gets lost in this case.
The developer of a device driver shall register a devices ROM signal handler
once its devices were acquired, or shall only acquire devices known to be
available, after inspecting the devices ROM independently.
Platforms
#########
PinePhone
=========
Telephony
~~~~~~~~~
The current release introduces the principle ability to issue and receive
voice calls with the PinePhone. This work involved two topics. First, we had
to tackle the integration, configuration, and operation of the LTE modem. The
second piece of the puzzle was the configuration of the audio paths between
the mic, the speaker, and the modem. Since the complexity of those topics
would exceed the scope of the release documentation, the technical details are
covered in a dedicated article.
:Pine fun - Telephony _(Roger, Roger?)_:
[https://genodians.org/ssumpf/2022-05-09-telephony]
[image pinephone_telephony]
The image above illustrates a simple system exemplified by the
[https://github.com/genodelabs/genode-allwinner/blob/master/run/modem_pinephone.run - modem_pinephone.run]
script. It allows a terminal emulator on a host machine connected to the
serial connector of the PinePhone to interact with the command interface of
the modem, e.g., allowing the user to unlock the SIM card via the 'AT+CPIN'
command, or to issue a call using the 'ATD' command.
Custom system-control processor (SCP) firmware
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Battery lifetime is one of the most pressing concerns for mobile phones. While
exploring the PinePhone hardware, we discovered early on that the key for
sophisticated energy management lies in the so-called system control processor
(SCP), which is a low-power companion microcontroller that complements the
high-performance application processor. The SCP can remain active even if the
device is visibly switched off.
Surprisingly, even though its designated purpose is rather narrow, the SCP is
a freely programmable general-purpose CPU (called AR100) with ultimate access
to every corner of the SoC. It can control all peripherals including the
modem, and access the entirety of physical memory.
In contrast to most consumer devices, which operate their SCPs with
proprietary firmware, the PinePhone gives users the freedom to use an
open-source firmware called [https://github.com/crust-firmware/crust - Crust].
Moreover, the Crust developers thoroughly documented their findings of the
[https://linux-sunxi.org/AR100 - AR100 limitations] and its
[https://linux-sunxi.org/AR100/HardwareSharing - interplay with the ARM CPU].
Given that the Crust firmware was specifically developed to augment a
Linux-based OS with suspend-resume functionality, its fixed-function feature
set is rather constrained. For running Genode on the PinePhone, we'd like to
move more freely, e.g., letting the SCP interact with the modem while the
application processor is powered off. To break free from the limitations of a
fixed-function feature set of an SCP firmware implemented in C, we explored
the opportunity to deploy a minimal-complexity Forth interpreter as the basis
for a custom SCP firmware. The story behind this line of development is
covered by the following dedicated article:
:Darling, I FORTHified my PinePhone!:
[https://genodians.org/nfeske/2022-03-29-pinephone-forth]
Inter-communication between SCP and ARM
---------------------------------------
To enable a tight interplay of Genode with the SCP, we introduce a new
[https://github.com/genodelabs/genode-allwinner/tree/master/include/scp_session - interface] and
[https://github.com/genodelabs/genode-allwinner/tree/master/src/drivers/scp/a64 - driver]
for supplying and invoking custom functionality to the SCP at runtime.
The new "Scp" service allows clients to supply snippets of Forth code for
execution at the SCP and retrieve the result. Both the program and the result
are constrained to 1000 bytes. Hence, the loading of larger programs may need
multiple subsequent 'Scp::Connection::execute' calls.
As illustrated by the example
[https://github.com/genodelabs/genode-allwinner/blob/master/run/a64_scp_drv.run - a64_scp_drv.run]
script, the mechanism supports multiple clients. Since the SCP's state is
global, however, all clients are expected to behave cooperatively. Given the
SCP's ultimate power, SCP clients must be fully trusted anyway.
As a nice tidbit for development, the PinePhone-specific SCP firmware features
a break-in debug shell for interactive use over UART that can be activated by
briefly connecting the INT and GND
[https://wiki.pine64.org/index.php/PinePhone#Pogo_pins - pogo pins].
Note that this interactive debugging facility works independently from the
application processor. Hence, it can be invoked at any time, e.g., to inspect
any hardware register while running a regular Linux distribution on the phone.
NXP i.MX8
=========
Analogously to the PCI decoder introduced in Section [Platform driver], a
component to retrieve PCI information on the i.MX 8MQ is part of this release.
It reports all PCI devices found behind the PCI Express host controller(s)
detected. In contrast to the PCI decoder, it has to initialize the PCI Express
host controller first, and needs device resources from the platform driver to
do so before. The component resides in the
[https://github.com/genodelabs/genode-imx - genode-imx]
repository and is called _imx8mq_pci_host_drv_.
Xilinx Zynq
===========
For the Zynq-7000 SoCs, we focused on two main topics in this release. First,
we leveraged the aforementioned improvements on the generic platform driver to
handle the (dis)appearance of devices in consequence of FPGA reconfiguration.
Second, we applied our new DDE Linux approach in order to port the SD-card
driver.
The platform driver for the Xilinx Zynq is now available in the
[https://github.com/genodelabs/genode-zynq - genode-zynq] repository as
_src/zynq_platform_drv_. The default devices ROMs are provided by the
_raw/<board>-devices_ archives. In addition to the generic driver, it features
the readout of clock frequencies. You can use _zynq_clocks.run_ to dump the
frequencies of all clocks.
Since the Xilinx Zynq comprises an FPGA that can be reconfigured at run time,
we also need to handle the appearance and disappearance of devices. For this
purpose, we added a driver manager that consumes the platform driver's devices
report and launches respectively kills device drivers accordingly. This
scenario is accompanied by the _pkg/drivers_fpga-zynq_ archive that assembles
the _devices_ ROM for the platform driver depending on the FPGA's
reconfiguration state. The figure below illustrates this scenario: The
subsystem provided by the _pkg/drivers_fpga-zynq_ archive is a replacement for
the platform driver. It consumes the _fpga.bit_ ROM that contains the FPGA's
bitstream. Once the bitstream has been loaded, the _fpga_devices_ ROM is
merged with the _devices_ ROM provided by the _raw/<board>-devices_ archive.
The _policy_ ROM contains the config of the internal zynq_platform_driver
(policies and reporting config). By enabling device reporting, the
zynq_driver_manager is able to react upon device changes and updates the
_init.config_ for a drivers subsystem accordingly. An example is available in
_run/zynq_driver_manager.run_.
[image zynq_driver_manager]
As a prerequisite for porting the first driver for the Zynq following our new
DDE Linux approach, we added a zynq_linux target that builds a stripped-down
Linux kernel for the Xilinx Zynq. Although Xilinx provides its own vendor
kernel, most drivers have been mainlined. To eliminate version mismatch
issues, we therefore use our mainline Linux port from _repos/dde_linux_
instead. With this foundation, we were able to port the SD card driver, which
is now available as _src/zynq_sd_card_drv_.

866
doc/release_notes/22-08.txt Normal file
View File

@@ -0,0 +1,866 @@
===============================================
Release notes for the Genode OS Framework 22.08
===============================================
Genode Labs
The overarching topic of version 22.08 is the emerging phone version of the
Genode-based Sculpt OS, targeting the PinePhone. The immense breadth and depth
of this line of work presented in Section [Genode coming to the phone]
touches topics as diverse as telephony, mobile-data connectivity, a custom
user interface, a mobile web browser, the GPU, SD-card access, USB, and audio
control.
With the growing sophistication of Genode-based systems, performance
optimizations come more and more into focus. Aided by the new tools introduced
in Section [Enhanced tooling for system tracing], we were able to profoundly
improve the network performance of Genode's user-level network routing
component. Speaking of optimizations, the current release reduces the CPU
overhead of our Linux device-driver environment
(Section [Linux-device-driver environment (DDE Linux)]) and
improves the responsiveness of GUIs based on Genode's menu-view component
(Section [Menu-view performance]).
Further topics of the new version reach from our forthcoming platform-driver
consolidation across PC and ARM-based devices, over the use of USB smart
cards, to new VirtIO drivers on RISC-V.
Genode coming to the phone
##########################
Our [https://genode.org/about/road-map - road map] for this year states the
goal of reaching a useful base line of functionality of Genode on the
PinePhone. This entails the principle ability to use the device as a phone -
receiving and issuing voice calls - and a mobile internet browser. Once
reached, this base line of functionality will allow us to routinely use Genode
on the device ("eating our own dog food"), experience pain points, guide
optimization efforts towards user-visible areas that matter, and faithfully
evaluate non-functional aspects like battery lifetime with real-world work
loads under realistic conditions.
For the Genode-based phone, we pursue the combination of a minimally-complex
trustworthy base system with a generally untrusted Web browser as application
runtime. The feature set of the base system corresponds to the bare-bones
[https://genode.org/download/sculpt - Sculpt OS] extended with appliance-like
feature-phone functionality. Thanks to Sculpt's rigid component-based
structure and the overall low complexity, it promises high reliability and
security. The application runtime is hosted on top of the base system without
tainting the assurance of the base system. In contrast to the appliance-like
and rather static feature set of the base system, the application runtime
anticipates a great variety of modern-day application scenarios, universally
expected commodity user-interface paradigms, and fast-paced software updates.
E.g., we aspire the use of WebRTC-based video conferencing via Jitsi as one
reference scenario.
Since we succeeded in bringing the Chromium web engine - the base technology
of most modern web browsers - to life as a
[https://genodians.org/nfeske/2022-01-27-browser-odyssey - native Genode component],
users of Sculpt OS are able to use a fully featured web browser without
relying on virtualization. With the use case of the browser on a mobile phone
in sight, we already ensured that the browser would work on 64-bit ARM
hardware. However, whereas we could showcase the technical feasibility of
Chromium on Genode, the practical usability eventually depends on a suitable
mobile user experience, which was largely disregarded by the desktop-oriented
Falkon browser that we enabled on Genode.
Assessment
----------
Fortunately, we discovered the Morph web browser while experimenting with
[https://xnux.eu/p-boot-demo/ - various Linux distributions] on the PinePhone.
Among the various alternatives to Android, the Ubuntu Touch UI - alongside
Sailfish OS - stood out for its refined user experience, subjectively.
The unobtrusive Morph browser as used by default on Ubuntu Touch left a
particularly good impression on us. To our delight, we found that this
browser relies on Qt5 and the Chromium web engine as its foundation, both of
which we already had enabled on Genode. Out of this observation grew the idea
of reusing the Morph browser as application runtime on our Genode-based phone.
But we had to consider several risks.
First, would the heaviness of Chromium overwhelm the rather resource-constrained
PinePhone hardware when executed on Genode? In contrast to Linux, Genode's
POSIX environment is less sophisticated and - most importantly - does not
provide the over-provisioning of memory resources. The latter could be a show
stopper.
Second, the build mechanics of the browser deviate from the beaten track we
covered so far, specifically the use of QMake. The Morph browser
unconditionally depends on CMake as build tool. Even though we gathered
[https://genodians.org/nfeske/2019-11-25-goa - early experiences], with using
CMake for building Genode executables, we did not attempt using CMake for
complex Qt5 applications targeting Genode so far.
Finally, we discovered a so-called Ubuntu-Touch-UI toolkit as an
additional dependency over Qt5. It presumably extends Qt5's QML with
custom user-interface widgets for mobile user interfaces. In contrast
to the multi-platform Qt5 framework, Ubuntu Touch generally targets
Linux only, which raised a number of concerns with respect to hidden
assumptions on the underlying platform. For example, the expectation
of a certain service manager, the direct use of the Linux kernel interface,
or accidentally complex library dependencies.
Methodology
===========
As practiced during our work with bringing the Chromium-based Falkon web
browser to Genode, we took several intermediate steps to mitigate technical
risks as far as possible.
Pruning dependencies
--------------------
The first step was building the Morph browser from source for its regular
designated target platform, namely Linux. This step allowed us to validate the
functionality of the browser built from source as opposed to merely testing a
binary package. During this process, we learned about the mandatory dependence
on CMake as build tool. We also identified the following library dependencies
as sources of uncertainty.
*Ubuntu-UI toolkit* is a collection of QML widgets for smartphone apps.
It is built via QMake and comes with its own set of dependencies.
We were specifically concerned by QtSystemInfo, QtOrganizer, D-Bus, and
gettext. Genode has no meaningful equivalent to any of these dependencies.
The *Ubuntu Themes* dependency comprises graphical assets, used on Ubuntu
Touch. *Ubuntu-UI extras* extends Qt's feature set by functionality like the
'TabsBar' QML-Widget introduces additional transitive dependencies
such as the [https://www.cups.org/ - CUPS printing system] or
the [https://exiv2.org/ - Exiv2] image metadata library.
Further dependencies worth noting are QNetworkInterface, QtConcurrent, QtDBus,
QtSystemInfo, unity-action-api, and D-Bus. Those libraries do not exist in
Genode and may even raise conceptual problems. For example, the D-Bus
inter-component mechanism on Linux is not in line with Genode's
capability-based inter-component communication.
With the first manually built executable of Morph created on Linux, we could
repeatedly remove dependencies piece by piece and validate the functioning of
the browser after each step. We ultimately reached a point where most of the
library dependencies could be cut off while the core functionality of the
browser - the ability to view web pages - stayed intact. The resulting
minimized version of the Morph browser thereby served as starting point for
the subsequent porting work to Genode.
Re-targeting to Genode
----------------------
To stay as close as possible to the original browser, we decided to reuse the
browser's build system by tweaking the CMake build tool such that the project
could be cross compiled for Genode, similar to the approach we successfully
employed for QMake in the past. At first, we targeted Genode/Linux on x86,
which is still close to the browser's natural environment. Once the first
version of the browser came to life, we immediately cross-validated the result
on the 64-bit ARM architecture as this is our primary target. Subsequently, we
moved away from Linux by moving the browser over to NOVA (on Sculpt) on PC
hardware as well as our custom base-hw microkernel in order to target the
actual PinePhone.
[image touch_ui]
Ubuntu-Touch UI gallery demo running on Genode
The methodology mirrored in large parts the approach we took for the original
porting of the Chromium web engine, but it was a much smoother experience
given that all road blocks we encountered during our Chromium work are solved
problems by now. Image [touch_ui] shows the browser's underlying
user-interface tool kit in action, running directly on Genode. Image [morph]
shows the Morph browser hosted in Genode's window system.
[image morph]
Morph browser running on Genode
Unexpected caveats
==================
However, the smooth ride of re-targeting the browser to Genode ended once
we discovered the extremely poor interactive performance of the browser
running on Genode. This is in contrast to our prior experience with the
Chromium-based Falkon browser which achieved comparable performance to Linux.
The performance degradation originated from the Ubuntu-UI toolkit, which
has a hard dependency on OpenGL despite being built atop the Qt5 framework.
In several instances, the Ubuntu-UI toolkit accesses the OpenGL context
directly, which is handled by a software fallback implementation in the
Mesa library. We found the removal of those offending accesses infeasible
because this change would cause several widgets appearing incomplete.
To attain the visual completeness of the user interface, we also had to
enhance the Genode-specific back end of Qt (QPA). However, even though
we achieved correctly looking results, the performance of Mesa3D without
GPU acceleration made the user interface practically unusable, even on
powerful PC hardware, not speaking of the resource-constrained PinePhone.
We came to the conclusion that the Morph browser's hard dependency
on hardware-accelerated graphics cannot be worked around. This realization,
in turn, spawned the line of work reported in
Section [Hardware-accelerated graphics].
As another - but arguably much less dramatic - caveat, we found the touch user
interface behaving strangely in some situations when running on Genode. The
reason turned out to be a disparity of Genode's notion of touch-release events
from the expectations of Qt. Whereas Genode's input-event interface does not
report a positional value of a touch-release event, Qt expects a positional
value that corresponds to the original touch event. Fortunately, once this
disparity had been identified, we could easily emulate the expected behavior
locally in Genode's QPA plugin.
Hardware-accelerated graphics
=============================
As mentioned above, we were taken by surprise by the hard dependency of the
Morph browser on GPU-accelerated graphics. Even though we have explored the
principle use of a GPU on an ARM-based platform before, our prior line of work
was targeting the Vivante GPU of the NXP i.MX8 SoC, which is different from
the Mali-400 GPU as present in the PinePhone's A64 SoC. Originally, we did not
plan to deal with the PinePhone's GPU at the current stage. But the
requirement of the Morph browser abruptly changed our priorities.
As a rapid experiment, we took the challenge to port the Lima driver for the
Mali-400 GPU from Linux to Genode and combine it with the matching user-level
driver code of the Mesa library. Even though this experiment was pursued on
short notice and risky, it was at least a tangible straw. To our delight,
however, the first functional rapid prototype came to life after merely two
weeks of work, which is almost an order of magnitude faster than our past
efforts. The reason of this success is many-fold. First, our recently
established methodology and tooling for porting Linux device drivers - as
described in our comprehensive
[https://genode.org/documentation/genode-platforms-22-05.pdf - Porting Guide] -
streamlines the formerly labor-intensive grunt work. Second, we greatly
benefited from our practical experience with GPUs accumulated over the past
few years. And third, even though the Mali-400 is different from the Vivante
GPU, the integration into the Linux GPU stack follows very similar patterns,
unlike Intel GPUs. So we found our existing knowledge largely applicable.
[image glmark2]
GLMark2 reference application using the GPU
Following the initial rapid prototype, we successively refined this work to
the point where the GPU driver became usable for the Morph browser on the
PinePhone. Thanks to the added driver, the interactive performance got boosted
to an acceptable level.
Mobile data connectivity
========================
It goes without saying that a web browser requires network connectivity,
which is a topic we had left unaddressed on the PinePhone until now.
However, given our
[https://genode.org/documentation/release-notes/22.05#Telephony - recent line]
of modem-related work in the context of telephony, we foresaw a low-complexity
solution to attain mobile data connectivity.
Today's LTE modems offer
[https://genodians.org/ssumpf/2020-12-04-mbim - QMI or MBIM] protocol support
in order to configure and handle mobile data connections. Both protocols are
in binary format and require a separate USB device (called Wireless Mobile
Communication Device). For Genode, this would mean to add support for this
device to USB while additionally the QMI or MBIM library would have to be
ported and adjusted to Genode. For the
[https://www.quectel.com/product/lte-eg25-g - Quectel EG25 modem]
in the PinePhone, we found a much simpler solution to handle mobile data
connections. The modem can be configured to emulate a USB Ethernet device
([https://en.wikipedia.org/wiki/Ethernet_over_USB - ECM device]).
In this operational mode, the modem will automatically connect to the carrier
and register itself as USB Ethernet device at the PinePhone's USB host
controller. Genode can thereby access the device through the USB networking
and CDC Ethernet drivers. The modem also offers a DHCP server and will hand
out a local IP address upon a DHCP request to Genode. Internally the modem
will use [https://en.wikipedia.org/wiki/Network_address_translation - NAT] in
order to translate IP requests from Genode to the address received from the
carrier.
As a prerequisite to conduct this solution, we had to enable a USB
host-controller driver for the PinePhone. Of course, we took advantage of our
modern DDE Linux porting approach for this work, which allowed to attain a
functional USB driver in merely two weeks. This driver must be combined with
our existing USB Ethernet driver (usb_net) that we swiftly extended to support
ECM based devices.
With this driver infrastructure in place, the USB network device of the modem
appears as uplink to Genode's NIC router. The NIC router, in turn,
successfully obtains a local IP address that is network-translated by the
modem. At the carrier side, IP network connectivity can be established by
issuing AT-protocol commands over UART. So the first prototype of the
low-level network connectivity worked as anticipated. With this practical way
of keeping the complexity of binary configuration protocols out of the loop,
we can maintain the low-complexity implementation of telephony and SIM
configuration via the UART control channel while regarding IP connectivity -
and the unavoidable complexity of USB - as an entirely complementary feature.
Phone flavor of Sculpt OS
=========================
Seeing the various puzzle pieces of the Morph browser scenario - GPU
acceleration, data connectivity, the browser itself - coming together, it was
time for the integration of those pieces into an overall system. The natural
basis of such a Genode-based system is
[https://genode.org/download/sculpt - Sculpt OS],
which complements Genode with universally expected operating-system features
such as interactive system configuration as well as the installation and
deployment of software packages.
Sculpt OS was originally designed for PC-based use cases. Its administrative
user interface is largely mouse and keyboard driven, and network connectivity
is usually attained by a wired or wireless LAN connection. Although we
presented a first version of
[https://fosdem.org/2022/schedule/event/nfeske/ - Sculpt OS on the PinePhone]
earlier this year, the call for a touch-oriented user interface is more than
obvious. Hence, we went forward with creating a phone-specific variant
of Sculpt. Similar to the original Sculpt OS, the system consists of two
largely isolated domains, the administrative domain called Leitzentrale and
the domain of user-installed components called desktop. The user can switch
between both domains at any time using a secure attention key or gesture.
On the phone, the Leitzentrale domain plays the role of a feature-phone
appliance that provides the most fundamental device functionality such
as the interaction with the SIM card, power control, telephony, network
configuration, storage management, and software installation. We approached
the concept of the user interface from a clean slate striving for simplicity.
[image sim_pin]
Emerging mobile-phone flavor of Sculpt OS
As the first use case, we addressed telephony, displaying incoming calls,
presenting the options for accepting/rejecting calls, and initiating calls
using a dial pad. By modelling these scenarios, we could validate the
user-interface concept of the evolving phone version of Sculpt's Leitzentrale.
User interaction with the SIM card
==================================
The administrative user interface mentioned above must be matched by the
underlying middleware that talks to the modem. Remember that our
[https://genode.org/documentation/release-notes/22.05#Telephony - original]
telephony scenario relied on the manual use of the modem's AT commands.
We ultimately have to control the modem's control channel by software using an
AT protocol stack. To bridge this gap with the lowest complexity possible, we
created a simple AT protocol implementation that is specifically designed for
Genode's state-driven component model.
The modem driver - hosting the AT protocol driver - accepts a configuration
that expresses the desired state (as opposed to desired actions). For example,
a configuration may look as simple as follows.
! <config speaker="yes" pin="1234">
! <call number="+49123123123"/>
! </config>
The AT protocol implementation takes this configuration and the current modem
state as the basis for determining a sequence of modem commands needed to
attain the desired state. For example, if the modem is not powered, the driver
steps through the powering sequence. Or in case the SIM PIN is required, the
driver supplies the corresponding command to supply the configured PIN.
To allow interactive usage, the driver supports dynamic reconfiguration.
E.g., to cancel the outbound call of the example above, the configuration
would be updated with the '<call>' node removed. Given this approach, an
interactive user interface comes down to generating such simple
configurations.
Vice versa, the driver exports the modem's state as a state report, which is
updated whenever the modem state changes. E.g., an incoming call is reflected
to the consumer of this state report with all information relevant for an
interactive user interface. For example, the state report entails the power
state, PIN state, and call states (incoming, outbound, alerting, rejected).
This design nicely hides the peculiarities of the AT protocol from Genode's
component interfaces.
At the current stage, with less than 1000 lines of code, the AT protocol
implementation suffices for basic telephony needs, supporting the interaction
with the SIM card, managing call states, initiating calls, and driving the
modem power up and down. It also takes care of establishing the modem
configuration needed for USB ECM networking.
Current state
=============
The current version of the phone variant of Sculpt OS is able to control the
power state of the modem, interact with the SIM card (PIN entry), initiate
phone calls via a dial pad, pick up inbound calls, establish mobile-data
network connectivity, and deploy a preconfigured application scenario.
The interactive switching between the base system and the application runtime
can be triggered at any time by touching the left border of the touch screen.
[image sculpt_pinephone]
The runtime graph of the base system (left) reveals the relationships of the
Morph browser with other components (right).
This flavor of Sculpt OS evolves in the
[https://github.com/nfeske/genode-allwinner - genode-allwinner] repository,
specifically within the _sculpt/_ and _src/app/phone_manager/_ directories.
The latter asserts the role of Sculpt's _gems/src/app/sculpt_manager_.
We invite seasoned developers - especially those who are following the
[https://genodians.org/nfeske/index - Pine-fun article series] - to experiment
with the new phone variant. It can be built via the following command:
! built/arm_v8a$ make run/sculpt KERNEL=hw BOARD=pinephone SCULPT=phone
For a broader audience, we plan to provide a ready-to-use SD-card image for
the PinePhone in tandem with the next release of Sculpt OS.
Enhanced tooling for system tracing
###################################
Since release 13.08, Genode features a
[https://genode.org/documentation/release-notes/13.08#Light-weight_event_tracing - light-weight event-tracing facility]
that comes in form of core's TRACE service. Up to now, it has merely been used
for capturing textual trace messages. The two prominent monitor components are
the
[https://genode.org/documentation/release-notes/18.02#New_trace-logging_component - trace_logger]
and the
[https://genode.org/documentation/release-notes/19.08#Tracing - VFS plugin]
The trace recorder is a new monitor component that is designed for binary trace
formats. Currently, it supports the Common Trace Format (CTF) and pcapng.
CTF is a compact and scalable format for storing event traces. It is supported
by [https://www.eclipse.org/tracecompass/ - TraceCompass], an Eclipse-based
tool for trace analysis and visualization. Pcapng is a packet-capture format
used by Wireshark.
In order to support capturing network packets, we added a 'trace_eth_packet()'
method to Genode's trace-policy API and equipped the NIC router with a
'trace_packets' option to control packet capturing on domain level. For manual
instrumentation of components, we also added a 'checkpoint()' method to the
trace-policy API.
For more details, please refer to the following Genodians article.
:Identifying network-throughput bottlenecks with trace recording:
[https://genodians.org/jschlatow/2022-08-29-trace-recorder]
Base framework and OS-level infrastructure
##########################################
Networking optimizations
========================
With the new trace recorder at hand, we took an effort in optimizing Genode's
network throughput. First, we implemented a benchmark component called
"nic_perf" that sends and/or receives an infinite stream of UDP packets in
order to stimulate the involved networking components in separation. As a
consequence of its central role, we particularly focused on the NIC router as
a starting point.
As a base line, we took two 'nic_perf' components: one as a sender and the other
as a receiver. By taking any copying or packet inspection out of the loop, we
could verify that the packet-stream interface holds up to our expectations with
respect to attainable throughput. However, as soon as we put a NIC router in
between, the throughput dropped to approx. 10% of our base line. On older
ThinkPads, this meant sub-gigabit throughput and on a Cortex-A9 @ 666MHz we
barely jumped over the 100Mbit mark.
Since we were not able to explain the substantial decrease in packet throughput,
we investigated with the help of the trace recorder and 'GENODE_LOG_TSC'.
As it turned out, the NIC router spent most of its time with exception handling
during routing-rule lookup, which is done for every packet. Since there are
multiple types of rules, a lookup takes place for every rule type. If no rule
was found for particular type, an exception was thrown and caught, which
turned out to be incredibly expensive. We therefore eliminated exceptions from
common-case code paths, more precisely from rule lookup, from ARP-cache
lookup, and from packet allocation. The result impressed us with a tripled
throughput.
Another bottleneck that we identified were frequent 'trigger_once' and
'elapsed_ms' RPCs. Given that the NIC router only maintains very
coarse-grained timeouts, such frequent RPCs to the timer seemed finical.
Sparing the details, we were able to significantly reduce the number of
these RPCs by relaxing the precision of the NIC router's time keeping.
Along the way, we identified a few more, minor, tweaks:
* We increased the default value of 'max_packets_per_signal' from 32 to 150.
This value determines the maximum number of packets that are consumed from an
interface at once.
* We eliminated eager packet-stream signalling from the NIC router to improve
batch processing of packets. With this change, packet-stream signals are only
emitted once the NIC router processed all available or
'max_packets_per_signal' packets.
* We implemented incremental checksum update for UDP/TCP according to RFC1071.
* We discovered and fixed a few corner cases in the packet-stream interface
with respect to the signalling.
* We fixed allocation errors in the 'ipxe_nic_drv' that popped up during high
TX load.
In the end, we attained a ~5x speed up (exact values depending on the hardware)
for the NIC router.
Event-filter improvements for touch devices
===========================================
The phone variant of Sculpt OS calls for a way to trigger certain low-level
buttons or keys using the touch screen. In particular, the switch between the
administrative user interface and the runtime system must be possible at any
time. On the [https://genode.org/download/sculpt - PC version], this switch
is triggered by pressing F12, which is remapped to KEY_DASHBOARD. Even though
a physical button could be used on the phone in principle, there are three
arguments in favor of a virtual key. First, there are only three physical
buttons available (volume +/- and power) on the PinePhone. Remapping one of
those buttons to KEY_DASHBOARD deprives the button of its original purpose.
Second, the force needed for pressing a physical button may impede the
ergonomics of the device depending on how often the switch is needed. And
third, the physical buttons require a driver. When enabling a new device, this
barrier can be nicely sidestepped by a virtual key.
Given this rationale, we extended Genode's event-filter component with a new
'<touch-key>' filter type. Once added to the filter chain, it triggers an
artificial key tap (a press event followed by a release event) whenever the
user touches a preconfigured area on the touch screen. The filter node can
host any number of '<tap>' sub nodes. Each sub node must define a rectangular
area - using the attributes 'xpos', 'ypos', 'width', and 'height' - and the
name of the tapped key as 'key' attribute.
! <touch-key>
! <tap xpos="0" ypos="400" width="25" height="600" key="KEY_DASHBOARD"/>
! ...
! </touch-key>
The example above repurposes the 25 left-most pixels of the touch screen as
dashboard key. When touched, a pair of press and release events is fired at
once.
Menu-view performance
=====================
The administrative user interface of Sculpt OS is based on Genode's custom
menu-view component, which renders and updates graphical dialogs based on
high-level XML descriptions. Up to now, the component operated on Genode's
GUI-session interface with alpha-channel support. However, the alpha channel
noticeably impedes the software-rendering performance on lower-end devices
like the PinePhone. In the latter case, we'd prefer to trade the nice-looking
alpha blending for a better UI responsiveness.
We have now enhanced the menu-view component with two new optional
configuration attributes 'opaque' and 'background'. Setting 'opaque' to "yes"
suppresses the use of the alpha channel at the GUI session. This improves the
drawing performance by 20% on the PinePhone. The 'background' attribute can be
specified to define the reset color of the GUI buffer. It alleviates the need
to create a frame widget for the top level, significantly reducing the costs
for drawing the background pixels.
Finally, we found that the use of GCC's optimization level -O3 instead of the
default level -O2 increases the drawing performance on the PinePhone by 30%.
Combined, those optimizations result in an acceptable user experience of
Sculpt's administrative user interface on the PinePhone.
Device drivers
##############
USB networking via Ethernet control model (ECM)
===============================================
To implement mobile data connectivity on the PinePhone
(Section [Mobile data connectivity]), we added USB host-controller support
(EHCI) for the Allwinner A64 SoC to Genode by porting the corresponding
host-controller driver from Linux using our DDE approach. Since our existing
USB-over-Ethernet
[https://github.com/genodelabs/genode/tree/master/repos/dde_linux/src/drivers/usb_net - driver]
on Genode lacked support for the Ethernet Control Model, which is provided by
the modem, we added support for ECM as well.
GPU and Mesa driver for Mali-400
================================
As mentioned in Section [Genode coming to the phone], we enabled the principle
ability to use the Mali-400 GPU of the PinePhone under Genode. This support
entails two parts. The first part is the low-level driver code called Lima
that normally resides in the Linux kernel. This component provides a GPU
session interface. We transplanted the driver code to a dedicated Genode
component, which is hosted at the
[https://github.com/genodelabs/genode-allwinner - genode-allwinner] repository.
The second part is the user-level Mesa3D driver stack - hosted at the libports
repository - that is linked local to the application and uses the GPU session
to access the GPU.
The combination of both parts was successfully tested on the PinePhone and
the Pine-A64-LTS V1.2 board. Given that the primary motivation for this
line of work was our ambition to run the Morph web browser, we disregarded the
multiplexing of the GPU for now. The GPU driver currently supports only one
client at a time.
SD-card driver for the PinePhone
================================
In anticipation of running Sculpt OS on the PinePhone, we ported the Linux
SD/MMC-card driver to Genode. The driver - hosted at the
[https://github.com/genodelabs/genode-allwinner - genode-allwinner] repository -
was successfully tested with the PinePhone and Pine-A64LTS V1.2 board. For the
moment, only SD cards (no eMMC) are supported.
The provided _a64_sd_card_drv.run_ script illustrates the integration and use
of the driver.
Linux-device-driver environment (DDE Linux)
===========================================
Tickless idle operation
-----------------------
The DDE-Linux emulation library and thereby all ported drivers now support
the NO_HZ_IDLE Linux kernel configuration option, which disables periodic
timer ticks when ported drivers are idle. With this option, energy and up to
3% CPU time per driver can be preserved, which becomes significant especially
if multiple ported drivers are in use in sophisticated scenarios like Sculpt
OS.
Consistent use of SMP configuration
-----------------------------------
All kernel threads in the Linux device driver ports are currently mapped to one
and the same native Genode thread, using cooperative scheduling within the
emulation environment. Intuitively, it does not make much sense to address
multi-processing support provided by the original Linux kernel code.
Nonetheless, the drivers that we ported are normally used in the context of
SMP-aware Linux kernel configurations only. To not leave the well tested and
beaten track, we decided to switch on SMP support in all kernel configurations
we use as porting base.
This especially applies to the Linux drivers within the _repos/pc_
sub-directory, and the WireGuard port. Other driver ports already used SMP
support in their configuration.
As a side effect, we removed the insufficient emulation of so called "softirqs"
formerly used by the non-SMP driver ports, and replaced them with the original
implementation.
Forthcoming platform-driver modernization
=========================================
During the past year, we switched from board-specific platform driver APIs
step-by-step to one generic interface. But PC-related drivers still depend on
the legacy x86-specific platform driver and API, especially to the PCI-related
part of it.
To finalize the unification and modernization of the platform driver and its
API, there were still some pieces missing, which we added with the current
release.
While trying to switch PC-related Linux device driver ports to the new API, we
recognized that some drivers depend on additional information of the PCI
configuration space that were not exported so far. Namely, the fields for
sub-vendor, sub-product, and revision IDs were needed. Moreover, some ported
drivers use hard-coded indices of PCI base-address registers (BAR) to refer to
I/O resources of the device.
Therefore, we extended the pci_decode tool to export this additional
information, and to annotate I/O port ranges and memory attributes with the
corresponding BAR index. The generic platform driver parses this additional
information from a given devices ROM, and exports it to the corresponding
clients accordingly. The correlation between I/O resources and BAR indices is
only unveiled to clients where the platform driver's policy states that
physical information has to be provided, like in this example:
! <config>
! <policy label="usb_drv -> " info="yes">
! <pci class="USB"/>
! </policy>
! ...
! </config>
UHCI-specific platform extensions
---------------------------------
Some device-specific registers are only present within the PCI configuration
space. For instance UHCI controllers in the PC architecture provide a special
legacy support register only accessible via the PCI configuration space. This
register is used to hand over the USB hardware from the BIOS to the operating
system.
We did not want to pollute the platform API with a lot of device specific
tweaks nor provide unlimited access to the PCI configuration space to a
driver. Therefore, we implement the hand-over of the UHCI PCI device in the
platform driver if available. Moreover, we handle the Intel-specific resume
register whenever a session to the corresponding UHCI controller is opened.
Intel GPU information from Host Bridge
--------------------------------------
Some information needed by Intel GPU and framebuffer drivers is derived from
the Intel Graphics and Controller HUB (GMCH) respectively its control
register. It is used to calculate the GPU's Global Translation Table (GTT),
and the stolen memory sizes. Again we do not want to give access to the whole
configuration space of this sensitive device to either the GPU or the
framebuffer driver. Instead, the platform driver now detects Intel PCI graphic
cards, and exports the information found within the GMCH control register to
the corresponding client as part of the platform session's devices ROM.
Transition of PC drivers
------------------------
Although there is everything in place now to switch the remaining PC-drivers
to the generic platform driver and its API, we decided to do this step after
the current release. This way, we have time to stress-test the drivers during
our daily use of Genode, the remaining transitional work is planned for the
upcoming Sculpt OS release instead.
Libraries and applications
##########################
Qt5 and Morph browser
=====================
As mentioned in Section [Genode coming to the phone], we had to improve
Genode's Qt support to get the Morph browser to work. This work includes
added support for building Qt projects with CMake, the addition of missing Qt
modules like QtGraphicalEffects, and improving the OpenGL support of the QPA
plugin. The latter was needed for the Ubuntu UI Toolkit to display its widgets
correctly. Note that this change implies that QtQuick applications now use
OpenGL by default instead of the QtQuick software rendering fallback back end.
This can improve the experience when an accelerated GPU driver is available
but can also slow down a QtQuick application if only the Mesa software driver
('softpipe') is available on the target platform. In that case, it is possible
to enforce the use of the software QtQuick renderer by setting the following
environment variable in the configuration of the application:
! <env key="QT_QUICK_BACKEND" value="software"/>
When we tried to use the free public Jitsi server at [https://meet.jit.si] with
our ported web browsers, we noticed that our QtWebEngine Chromium version was
too old and caused issues like a non-working join button and failed WebRTC
connections. For this reason, we updated our Qt port to the latest version with
QtWebEngine support on FreeBSD, which at this time is version 5.15.2.
To use this new version, it is necessary to update the Qt5 host tools with the
'tool/tool_chain_qt5' script.
We also updated the Falkon web browser to the latest version 3.2.0.
Up-to-date Sculpt packages of both the Falkon and Morph browsers for x86_64 are
available in the 'cproc' depot.
USB smart cards via PKCS#11
===========================
With this release, Genode gains support for accessing USB smart-card devices
via PKCS#11. This is achieved through a port of the OpenSC PKCS#11 tool that is
now available as package for the Sculpt OS. A quick look into the features and
integration of the tool is possible using the new _pkcs11_tool_ run script
hosted in the [https://github.com/genodelabs/genode-world - genode-world]
repository. For a more detailed guide to the tool, you may read the
corresponding Genodians article.
:USB smart cards via PKCS#11:
[https://genodians.org/m-stein/2022-08-18-pkcs11-tool-1]
Sculpt OS improvements
======================
In addition to the major developments described in
Section [Genode coming to the phone], Sculpt OS has received several minor
refinements.
When integrating a
[https://genode.org/documentation/release-notes/22.02#Framework_for_special-purpose_Sculpt-based_operating_systems - Sculpt-based appliance]
with a predefined deploy configuration, the _sculpt.run_ script automatically
adds the required software packages as tar archive to the boot image. However,
for complex scenarios, it is sometimes desirable to keep the boot image small
and fetch the packages at runtime over the network. To support such use cases,
we added the new run-script argument 'DEPOT' with the possible values 'tar'
(default) and 'omit'. If the latter is specified, the deployed software
packages are excluded from the boot image and the run script merely prints the
versions of the required packages. This information can conveniently be used
as input for publishing the packages.
We added two new packages 'part_block' and 'ext2_fs' that simplify the access
of multiple block devices and partitions in manually curated deploy
configurations. The part_block package can be used in Sculpt's
_/config/deploy_ as follows.
! <start name="nvme-0.part_block" pkg="part_block">
! <route>
! <service name="Block">
! <parent label="nvme-0"/>
! </service>
! <service name="Report" label="partitions">
! <parent/>
! </service>
! </route>
! </start>
It can be combined with the 'ext2_fs' package to access the files stored on a
particular partition.
! <start name="nvme-0.4.fs" pkg="ext2_fs">
! <route>
! <service name="Block">
! <child name="nvme-0.part_block" label="4"/>
! </service>
! <service name="RM">
! <parent/>
! </service>
! </route>
! </start>
Platforms
#########
Qemu virtual platform
=====================
Because more and more architectures on Genode now support VirtIO drivers on
Qemu (ARMv7, ARMv8, and RISC-V), the generic board name "virt_qemu" did not
suffice for keeping a clean distinction between the separate architecture
requirements. Therefore, we decided to make the board name architecture
specific. The following board names are now supported on base-hw:
"virt_qemu_arm_v7a", "virt_qemu_arm_v8a", and "virt_qemu_riscv".
The "virt_qemu" board name was removed.
RISC-V
======
As suggested above Genode's RISC-V support got extended by VirtIO drivers.
This includes a block driver, a networking driver, keyboard and mouse handling
as well as basic framebuffer support. This way, it has become possible to test
interactive and networking scenarios on Genode's RISC-V version using Qemu.
This work was contributed by Piotr Tworek. Thanks a lot!
Allwinner A64
=============
In the
[https://genode.org/documentation/release-notes/22.05#Custom_system-control_processor__SCP__firmware - previous release],
we introduced our custom firmware for the PinePhone's system-control processor
(SCP). We have now generalized the firmware to cover also the Pine-A64-LTS
board. By establishing our custom SCP firmware as a base line for all A64-based
boards, we can make our A64 platform driver depend on the SCP for accessing the
PMIC (power management chip) instead of driving the RSB and PMIC by itself.
Build system and tools
######################
In this release, we improve support for booting Genode/Sculpt on UEFI
platforms in several aspects. First, the Bender tool gains a more robust
UEFI-boot detection mechanism while retrieving serial-device parameters. Also,
the GRUB boot loader was updated to version 2.06 and now keeps lower RAM
untouched from internal memory allocations, which prevents nasty surprises on
booting some UEFI devices. And last, our [https://ipxe.org/ - iPXE-based] boot
option received support for UEFI images when using the following run-tool
configuration.
! RUN_OPT += --include image/uefi
! RUN_OPT += --include load/ipxe

View File

@@ -7,99 +7,89 @@
Herein, we lay out our plans for evolving Genode. Progress in addition to this
planning will very much depend on the degree of community support the project
will receive. The
[https://genode.org/about/challenges - Challenges] page collects some of our ideas to
advance Genode in various further directions.
[https://genode.org/about/challenges - Challenges] page collects some of our
ideas to advance Genode in various further directions.
The road map is not fixed. If there is commercial interest of pushing the
Genode technology to a certain direction, we are willing to revisit our plans.
Review of 2020
Review of 2021
##############
The overarching theme of our road map for 2020 was "Dwarfing the barrier of
entry", which expressed the ambition to reach a wider audience. On that
account, we identified four promising directions: First, making Sculpt OS
palatable for a wider circle. Second, fostering the public perception of the
high quality of Genode to reinforce the confidence of people who are sceptical
towards novel operating-system technology. Third, lowering the barrier of
entry by providing frictionless tooling. And fourth, publicly presenting use
cases that prove the fitness and flexibility of Genode. These directions
certainly did a good job of motivating the working topics of last year's four
releases
[https://genode.org/documentation/release-notes/20.02 - 20.02],
[https://genode.org/documentation/release-notes/20.05 - 20.05],
[https://genode.org/documentation/release-notes/20.08 - 20.08], and
[https://genode.org/documentation/release-notes/20.11 - 20.11].
Genode's year 2021 was defined by three extremely challenging lines of work.
The UI improvements of Sculpt OS in version 20.02 largely eliminated the need
to use the command line as presented
[https://www.youtube.com/watch?v=vmgWgzeKAjU - here].
The second direction - software quality - motivated the steady improvements of
our POSIX runtime, ultimately enabling highly sophisticated workloads like the
Chromium web engine on Genode. Regarding our stated commitment to 64-bit ARM
hardware, in particular supporting the NXP i.MX8 SoC, we covered 64-bit
multi-core virtualization, HDMI, touch input, OLED, networking, LTE, USB,
clock and power management, VirtIO, up to running Sculpt OS on this platform.
First, we conquered the territory of GPU support that was ridden with
uncertainties and seemed almost impenetrable when we started. But at the end
of the year, our custom Intel-GPU multiplexer has landed in Sculpt OS like it
always belonged there. In tandem with the Intel-GPU work, we explored the
Vivante GPU as a representative of an ARM platform. The work required a deep
dive into the respective GPU architectures and the Mesa software stack. It
eventually led us to the design of Genode's device-agnostic GPU interfaces.
Granted, Genode's audience hasn't increased by a large margin as a direct
result of these efforts. But as illustrated by the fruitful road-map
discussion for 2021 on the
[https://genode.org/community/mailing-lists - mailing list],
our community is more engaged and enthusiastic than ever before.
The second line of work was concerned with the reuse of Linux drivers as
Genode components. Over the year, the puzzle pieces of our new Linux
device-driver environment come together, replacing former confusion and chaos
with knowledge and order, ultimately uncovering the treasure of Linux drivers
for Genode with very little friction. On the way, we created new methodology
and tooling, as well as extensive documentation in the form of the "Genode
Platforms" document. Thanks to the new drivers ported from the Linux kernel,
we were able to witness interactive Genode scenarios becoming alive on the
PinePhone by the end of the year.
The third major topic was the growing sophistication of Genode-native
workloads, with the media features of the Chromium-based browser on 64-bit ARM
being the most impressive example. Apart from the apparent functional benefits
for Genode and Sculpt OS, this is the long outstanding validation of some bold
design decisions we took years ago, in particular the role and architecture of
the VFS and its interplay with the libc.
When reviewing the road map for 2021, some items remained uncovered. In
particular the seL4-related topics became stale. At the end of 2020 - when we
assembled the road map for the past year - there was a tangible prospect of
pursuing this topic as funded work. However, those plans were repeatedly
deferred and remained uncertain. Also, there are some items that have seen
healthy doses of progress - like the topics related to Ada/SPARK or Goa - but
received less attention than anticipated. On the other hand, the four releases
([https://genode.org/documentation/release-notes/21.02 - 21.02],
[https://genode.org/documentation/release-notes/21.05 - 21.05],
[https://genode.org/documentation/release-notes/21.08 - 21.08],
[https://genode.org/documentation/release-notes/21.11 - 21.11])
of 2021 covered quite a few topics not advertised at the road
map, e.g., webcam support, Xilinx Zynq, or RISC-V.
It is fair to say that the level of technical risks we took in 2021 had been
unprecedented in Genode's development history. We are more than proud of the
outcome, which will hopefully propel Genode to new heights in 2022.
2021 - Optimization and Platform diversity
##########################################
2022 - Mobile Usability
#######################
For the initial conquering of 64-bit ARM territory, restraining our focus to
one particular SoC - namely NXP i.MX8 - was a healthy approach. Now it is the
right time to optimize and to branch out the development to further
platforms. The following key aspects of our road map for 2021 reflect that.
After having enabled the first interactive Genode scenarios on the PinePhone
last year, we plan to take Genode on the PinePhone to a level where we can
routinely use it for advanced applications, in particular video chat. This
vision confronts us with a multitude of hard technical nuts to crack such as
power efficiency, UI latency, quality-of-service of audio processing, drivers
for multi-media devices, WebRTC performance, and usability. This grand theme
will not only address the PinePhone specifically. The efficiency gains will
benefit all Genode use cases large and small.
:Pinephone:
By the end of the year, we want be able to use Genode on the
[https://pine64.com/product-category/pinephone/ - Pinephone]
as a feature phone, covering basic web-browsing needs, placing calls, and
SMS.
Our theme of the Genode-based video chat on the PinePhone fuels several
ambitions in closely related areas. In particular, we aspire using WireGuard
to secure private communication, and experiment with the operation of
hardware-based trust anchors as the basis for encrypted storage and
communication.
:Linux-device-driver environment re-imagined:
We are convinced that we have to dramatically reduce the engineering
effort needed to port device drivers from the Linux kernel to Genode. With
many years of driver-porting experience under our belts, we plan to condense
the lessons learned in the form of new tooling and documentation. This, in
turn, will hopefully pave the ground for more and more developers
contributing to Genode's device-driver coverage in the future.
:Developer experience:
Speaking of new developers, we see Genode's existing tool set as a barrier
because it requires a rather steep learning curve. Hence, this year, we will
have a fresh take on tooling and workflows. The starting point will be the
experimental [https://github.com/nfeske/goa - Goa] tool, which in principle
allows developers to use familiar build systems for Genode development. We
plan to extend Goa to cover more build systems, and shape the tool towards
system-integration tasks and quick compile-test cycles targeting embedded
devices.
:Optimization:
Motivated by usage scenarios like the Pinephone, we are eager to tap into
plenty of opportunities for optimization. Based on data gathered by improved
system tracing, we consider interface refinements to improve the batching of
I/O (file-system access, networking), micro-optimizations of hot code paths
(like TLS lookup, parsers, and allocators), as well as structural changes
(like the consolidation of low-level services).
:GPU support:
Distantly related to optimization, GPU support is an increasingly requested
feature. We already
[https://genode.org/documentation/release-notes/17.08#Hardware-accelerated_graphics_for_Intel_Gen-8_GPUs - wetted our toes]
in the past. But GPU support has not yet become routinely supported in
system scenarios like Sculpt OS. In 2021, we want to change that, making GPU
support a feature that can be relied on. We will primarily address Intel
graphics first but also explore GPUs on ARM-based devices.
Besides the PinePhone, we will steadily nurture the quality and scope of
driver support on PC hardware, which remains the primary platform for the
day-to-day use of Sculpt OS. So you can expect us to keep up with recent
generations of Intel-based hardware. In this area, we plan to make IOMMU
support available with kernels beyond NOVA, and explore the use of
power-management features like suspend-resume with Sculpt OS.
Milestones for 2021
Milestones for 2022
###################
In the following, we present a rough schedule of the planned work. As usual,
@@ -107,65 +97,45 @@ it is not set in stone. If you are interested in a particular line of work,
please get in touch.
February - Release 21.02
February - Release 22.02
========================
* Pluggable device drivers (NIC, WLAN, framebuffer, input)
* VirtualBox 6
* Sculpt: basic UI for the consistent block encrypter (CBE)
* 64-bit ARM
* VirtIO block-device support for virtual machines
* Base platform support for the Pine A64 board (kernel base framework)
* OpenGL in VirtualBox 6
* Sculpt OS as tool kit for special-purpose OS images
* PinePhone
* Modem access
* Touch-screen compatibility of Sculpt OS
May - Release 21.05
May - Release 22.05
===================
* Annual documentation update, including the "Genode Foundations" book
* GPU support
* MESA update
* Experiments on ARM (e.g., Vivante on i.MX8, or Mali-400 on A64)
* Sculpt OS on Pine A64 (USB, input, framebuffer, SD-card, networking)
* 64-bit ARM
* Platform-driver consolidation between ARM and x86
* PCI-express support for MNT Reform (i.MX8)
* Tool-chain update (e.g., switching to hard-float on ARM)
* Modernized client-side NIC and uplink APIs
* Goa
* Broadened architecture support and testing workflow
* API projects
* Inter-project dependencies
* Annual update of the "Genode Foundations" book
* Second edition of the "Genode Platforms" documentation
* WireGuard VPN
* Updated drivers for PC hardware (Wifi, Intel framebuffer, USB)
* New tracing tool with support for CTF and PCAP
* PinePhone telephony
August - Release 21.08
August - Release 22.08
======================
* Linux DDE re-imagined
* Improved tooling
* Exploring Goa-based development workflow
* GPU support
* GPU multiplexer for Intel Gen9 graphics
* Harmonization of GPU driver with Intel framebuffer driver
* Initial version of a custom kernel (Spunky) implemented in Ada/SPARK
* System-level tracing infrastructure for guiding and validating optimizations
* Pinephone
* Touchscreen and display
* Mobile web browser
* Goa
* CMake-based Qt5 applications
* QML-based applications
* PinePhone
* Morph browser
* Media record and playback capabilities
* FPGA-powered DMA protection for the Zynq-7000 SoC
* Kernel-agnostic IOMMU support for PC hardware
* Optimized GUI latency and synchronization
November - Release 21.11
November - Release 22.11
========================
* Pinephone
* Mobile data connectivity (LTE)
* Phone calls (audio)
* SMS
* seL4
* Update to current kernel version, MCS scheduling
* Combining CAmkES with Genode
* SMMU (I/O-MMU for ARM) support for our custom (base-hw) kernel
* Multi-monitor support
* PinePhone
* WebRTC-based video chat
* Power management
* Base mechanism for suspend-resume on PC hardware
* Support for hardware-based trust anchor for CBE and WireGuard
* Software-hardware co-design example for the Zynq-7000 SoC

View File

@@ -26,22 +26,22 @@ but build upon of each other:
These directories contain platform-specific source-code repositories
complementing the 'base' repository. The following platforms are supported:
:'hw':
The hw platform hosts Genode on a custom microkernel specifically
developed for Genode. The name "hw" denotes that Genode is executed on
bare hardware without a 3rd-party kernel underneath.
:'linux':
Linux kernel (both x86_32 and x86_64)
:'nova':
NOVA hypervisor developed at University of Technology Dresden
NOVA hypervisor ([https://hypervisor.org])
:'foc':
Fiasco.OC is a modernized version of the Fiasco microkernel with a
completely revised kernel interface fostering capability-based
security. It is not compatible with L4/Fiasco.
:'hw':
The hw platform allows the execution of Genode on bare ARM and x86 hardware
without the need for a separate kernel. The kernel functionality is
included in core.
:'okl4':
OKL4 kernel (x86_32 and ARM) developed at Open-Kernel-Labs.
@@ -52,13 +52,12 @@ but build upon of each other:
L4/Fiasco kernel developed at University of Technology Dresden.
:'sel4':
seL4 microkernel developed at NICTA/General Dynamics
See[https://sel4.systems/]
seL4 microkernel ([https://sel4.systems/])
:'os':
This directory contains the non-base OS components such as the init process,
device drivers, and basic system services.
This directory contains the non-base OS components such as the init
component, device drivers, and basic system services.
:'demo':
@@ -78,18 +77,17 @@ but build upon of each other:
upstream source code but means to download the code and adapt it to Genode.
For instructions about how to use this mechanism, please consult the README
file at the top level of the repository. Among the 3rd-party libraries
are Qt5, libSDL, freetype, Python, ncurses, Mesa, and libav.
are Qt5, freetype, ncurses, and Mesa.
:'dde_linux':
This source-code repository contains the device driver environment for
executing Linux device drivers natively on Genode. Currently, this
repository hosts the USB stack.
executing Linux subsystems as Genode components.
:'dde_ipxe':
This source-code repository contains the device-driver environment for
executing drivers of the iPXE project.
executing network drivers of the iPXE project.
:'dde_bsd':
@@ -103,6 +101,10 @@ but build upon of each other:
The repository contains a server that uses a rump kernel to provide
various NetBSD file systems to Genode.
:'pc':
This source-code repository hosts device drivers that are specific for PC
platforms. It depends on the 'dde_linux' repository.
:'ports':
This source-code repository hosts ports of 3rd-party applications to

View File

@@ -6,22 +6,22 @@ FIASCO_SRC = $(L4_SRC_DIR)/kernel/fiasco
KERNEL_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [fiasco] /"
KERNEL_CXXFLAGS = -std=gnu++98 -fno-delete-null-pointer-checks $(CXXWARN) \
-Wno-address-of-packed-member
$(FIASCO_BUILD_DIR):
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FIASCO_SRC) BUILDDIR=$@ \
$(KERNEL_BUILD_OUTPUT_FILTER)
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $@ oldconfig \
$(KERNEL_BUILD_OUTPUT_FILTER)
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(FIASCO): $(FIASCO_BUILD_DIR)
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= CFLAGS="-std=gnu89 $(CWARN)" \
CXXFLAGS="-std=gnu++98 -fno-delete-null-pointer-checks $(CXXWARN)" \
$(VERBOSE_MK) MAKEFLAGS= CFLAGS="-std=gnu89 $(CWARN)" \
CXXFLAGS="$(KERNEL_CXXFLAGS)" \
$(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FIASCO_BUILD_DIR) \
$(KERNEL_BUILD_OUTPUT_FILTER)

View File

@@ -33,6 +33,9 @@ ifeq ($(VERBOSE),)
L4_VERBOSE = V=1
endif
# do not confuse third-party sub-makes
unexport .SHELLFLAGS
#
# Execute the rules in this file only at the second build stage when we know
# about the complete build settings, e.g., 'CROSS_DEV_PREFIX'.
@@ -61,8 +64,7 @@ CXXWARN = $(WARN) -Wno-bool-compare -Wno-c++11-compat -Wno-class-memaccess
# 'off64_t' type, which is used by bootstrap.
#
%.tag:
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= CPPFLAGS="$(CC_MARCH)" \
$(VERBOSE_MK) MAKEFLAGS= CPPFLAGS="$(CC_MARCH)" \
CFLAGS="$(CC_MARCH) -std=gnu89 $(CWARN)" \
CXXFLAGS="$(CC_MARCH) -D_GNU_SOURCE -std=gnu++98 $(CXXWARN)" \
ASFLAGS="$(CC_MARCH)" LDFLAGS="$(LD_MARCH)" \

View File

@@ -15,7 +15,7 @@ L4_BUILD_DIR := $(shell pwd)
.Makeconf.bid.old:
$(VERBOSE)mkdir -p $(dir $@)
$(VERBOSE)cp $(L4_CONFIG) $(@:.old=)
$(VERBOSE_MK) set -o pipefail; \
$(VERBOSE_MK) \
MAKEFLAGS= make $(VERBOSE_DIR) -C $(L4_SRC_DIR)/l4 \
O=$(L4_BUILD_DIR) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" oldconfig \
2>&1 | sed "s/^/ [l4build] /"

View File

@@ -21,6 +21,5 @@ content:
for spec in x86_32; do \
mv lib/mk/spec/$$spec/ld-fiasco.mk lib/mk/spec/$$spec/ld.mk; \
done;
sed -i "s/ld-fiasco/ld/" src/lib/ld/fiasco/target.mk
sed -i "s/fiasco_timer_drv/timer/" src/timer/fiasco/target.mk

View File

@@ -1 +1 @@
2021-03-11 d5d038d82badefdb0ec442be4dc7b23064ad2831
2022-10-11 1f0607de6493bad0e47b24e66d84474652e8b6be

View File

@@ -17,7 +17,6 @@
/* Genode includes */
#include <base/cache.h>
#include <base/ipc.h>
#include <base/stdint.h>
#include <base/native_capability.h>
#include <util/touch.h>
@@ -26,67 +25,12 @@
/* core includes */
#include <util.h>
#include <mapping.h>
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
class Mapping;
class Ipc_pager;
}
class Genode::Mapping
{
private:
addr_t _dst_addr;
Fiasco::l4_fpage_t _fpage;
public:
/**
* Constructor
*/
Mapping(addr_t dst_addr, addr_t src_addr,
Cache_attribute cacheability, bool,
unsigned l2size, bool rw, bool)
:
_dst_addr(dst_addr),
_fpage(Fiasco::l4_fpage(src_addr, l2size, rw, false))
{
if (cacheability == WRITE_COMBINED)
_fpage.fp.cache = Fiasco::L4_FPAGE_BUFFERABLE;
}
/**
* Construct invalid flexpage
*/
Mapping() : _dst_addr(0), _fpage(Fiasco::l4_fpage(0, 0, 0, 0)) { }
Fiasco::l4_umword_t dst_addr() const { return _dst_addr; }
Fiasco::l4_fpage_t fpage() const { return _fpage; }
/**
* Prepare map operation
*
* On Fiasco, we need to map a page locally to be able to map it to
* another address space.
*/
void prepare_map_operation()
{
addr_t core_local_addr = _fpage.fp.page << 12;
size_t mapping_size = 1 << _fpage.fp.size;
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
if (_fpage.fp.write)
touch_read_write((unsigned char volatile *)(core_local_addr + i));
else
touch_read((unsigned char const volatile *)(core_local_addr + i));
}
}
};
namespace Genode { class Ipc_pager; }
class Genode::Ipc_pager

View File

@@ -46,6 +46,7 @@ class Genode::Platform_pd : public Address_space
enum {
VERSION_BITS = 10,
VERSION_MASK = (1 << VERSION_BITS) - 1,
PD_FIRST = 0x10,
PD_MAX = (1 << 11) - 1, /* leave 0x7ff free for L4_INVALID_ID */
PD_VERSION_MAX = (1 << 10) - 1,
@@ -101,7 +102,7 @@ class Genode::Platform_pd : public Address_space
unsigned version : VERSION_BITS;
Pd_alloc(bool r, bool f, unsigned v)
: reserved(r), free(f), version(v) { }
: reserved(r), free(f), version(v & VERSION_MASK) { }
Pd_alloc() : reserved(0), free(0), version(0) { }
};

View File

@@ -38,61 +38,67 @@ static inline bool can_use_super_page(addr_t, size_t)
}
addr_t Io_mem_session_component::_map_local(addr_t base, size_t size)
addr_t Io_mem_session_component::_map_local(addr_t phys_base, size_t size)
{
using namespace Fiasco;
auto map_io_region = [] (addr_t phys_base, addr_t local_base, size_t size)
{
using namespace Fiasco;
l4_threadid_t const sigma0 = sigma0_threadid;
unsigned offset = 0;
while (size) {
/*
* Call sigma0 for I/O region
*/
/* special case for page0, which is RAM in sigma0/x86 */
l4_umword_t const request = (phys_base + offset == 0)
? SIGMA0_REQ_FPAGE_RAM
: SIGMA0_REQ_FPAGE_IOMEM;
size_t const size_log2 = can_use_super_page(phys_base + offset, size)
? get_super_page_size_log2()
: get_page_size_log2();
l4_umword_t dw0 = 0, dw1 = 0;
l4_msgdope_t result { };
l4_msgtag_t tag { };
int const err =
l4_ipc_call_tag(sigma0,
L4_IPC_SHORT_MSG,
request,
l4_fpage(phys_base + offset, size_log2, 0, 0).fpage,
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
L4_IPC_MAPMSG(local_base + offset, size_log2),
&dw0, &dw1,
L4_IPC_NEVER, &result, &tag);
if (err || !l4_ipc_fpage_received(result)) {
error("map_local failed err=", err, " "
"(", l4_ipc_fpage_received(result), ")");
return;
}
offset += 1 << size_log2;
size -= 1 << size_log2;
}
};
/* align large I/O dataspaces on a super-page boundary within core */
size_t alignment = (size >= get_super_page_size()) ? get_super_page_size_log2()
: get_page_size_log2();
size_t align = (size >= get_super_page_size()) ? get_super_page_size_log2()
: get_page_size_log2();
/* find appropriate region for mapping */
void *local_base = 0;
if (platform().region_alloc().alloc_aligned(size, &local_base, alignment).error())
return 0;
return platform().region_alloc().alloc_aligned(size, align).convert<addr_t>(
/* call sigma0 for I/O region */
int err;
l4_umword_t request;
l4_umword_t dw0, dw1;
l4_msgdope_t result;
l4_msgtag_t tag;
[&] (void *ptr) {
addr_t const core_local_base = (addr_t)ptr;
map_io_region(phys_base, core_local_base, size);
return core_local_base; },
l4_threadid_t sigma0 = sigma0_threadid;
unsigned offset = 0;
while (size) {
/* FIXME what about caching demands? */
/* FIXME what about read / write? */
/* special case for page0, which is RAM in sigma0/x86 */
if (base + offset == 0)
request = SIGMA0_REQ_FPAGE_RAM;
else
request = SIGMA0_REQ_FPAGE_IOMEM;
size_t page_size_log2 = get_page_size_log2();
if (can_use_super_page(base + offset, size))
page_size_log2 = get_super_page_size_log2();
err = l4_ipc_call_tag(sigma0,
L4_IPC_SHORT_MSG,
request,
l4_fpage(base + offset, page_size_log2, 0, 0).fpage,
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
L4_IPC_MAPMSG((addr_t)local_base + offset, page_size_log2),
&dw0, &dw1,
L4_IPC_NEVER, &result, &tag);
if (err || !l4_ipc_fpage_received(result)) {
error("map_local failed err=", err, " "
"(", l4_ipc_fpage_received(result), ")");
return 0;
}
offset += 1 << page_size_log2;
size -= 1 << page_size_log2;
}
return (addr_t)local_base;
[&] (Range_allocator::Alloc_error) -> addr_t {
error("core-local mapping of memory-mapped I/O range failed");
return 0; });
}

View File

@@ -130,7 +130,7 @@ Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
if (msi)
throw Service_denied();
if (irq_alloc.alloc_addr(1, _irq_number).error()) {
if (irq_alloc.alloc_addr(1, _irq_number).failed()) {
error("unavailable IRQ ", _irq_number, " requested");
throw Service_denied();
}

View File

@@ -29,6 +29,26 @@ using namespace Genode;
using namespace Fiasco;
/**
* Prepare map operation
*
* On Fiasco, we need to map a page locally to be able to map it to another
* address space.
*/
void Mapping::prepare_map_operation() const
{
addr_t const core_local_addr = src_addr;
size_t const mapping_size = 1UL << size_log2;
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
if (writeable)
touch_read_write((unsigned char volatile *)(core_local_addr + i));
else
touch_read((unsigned char const volatile *)(core_local_addr + i));
}
}
/***************
** Ipc_pager **
***************/
@@ -51,11 +71,13 @@ void Ipc_pager::wait_for_fault()
void Ipc_pager::reply_and_wait_for_fault()
{
l4_msgdope_t result;
l4_fpage_t const fpage { l4_fpage(_reply_mapping.src_addr,
_reply_mapping.size_log2,
_reply_mapping.writeable, false) };
l4_ipc_reply_and_wait(_last,
L4_IPC_SHORT_FPAGE, _reply_mapping.dst_addr(),
_reply_mapping.fpage().fpage, &_last,
l4_msgdope_t result;
l4_ipc_reply_and_wait(_last, L4_IPC_SHORT_FPAGE,
_reply_mapping.dst_addr, fpage.fpage, &_last,
L4_IPC_SHORT_MSG, &_pf_addr, &_pf_ip,
L4_IPC_SEND_TIMEOUT_0, &result);

View File

@@ -16,6 +16,7 @@
#include <base/allocator_avl.h>
#include <base/sleep.h>
#include <util/misc_math.h>
#include <util/xml_generator.h>
/* base-internal includes */
#include <base/internal/crt0.h>
@@ -444,28 +445,42 @@ Platform::Platform()
fiasco_register_thread_name(core_thread.native_thread_id(),
core_thread.name().string());
/* core log as ROM module */
auto export_page_as_rom_module = [&] (auto rom_name, auto content_fn)
{
void * phys_ptr = nullptr;
unsigned const pages = 1;
size_t const log_size = pages << get_page_size_log2();
size_t const size = 1 << get_page_size_log2();
ram_alloc().alloc_aligned(size, get_page_size_log2()).with_result(
ram_alloc().alloc_aligned(log_size, &phys_ptr, get_page_size_log2());
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
[&] (void *phys_ptr) {
void * const core_local_ptr = phys_ptr;
addr_t const core_local_addr = phys_addr;
/* core-local memory is one-to-one mapped physical RAM */
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
void * const core_local_ptr = phys_ptr;
/* let one page free after the log buffer */
region_alloc().remove_range(core_local_addr, log_size + get_page_size());
region_alloc().remove_range((addr_t)core_local_ptr, size);
memset(core_local_ptr, 0, size);
content_fn(core_local_ptr, size);
memset(core_local_ptr, 0, log_size);
_rom_fs.insert(new (core_mem_alloc())
Rom_module(phys_addr, size, rom_name));
},
[&] (Range_allocator::Alloc_error) {
warning("failed to export ", rom_name, " as ROM module"); }
);
};
_rom_fs.insert(new (core_mem_alloc()) Rom_module(phys_addr, log_size,
"core_log"));
/* core log as ROM module */
export_page_as_rom_module("core_log",
[&] (void *core_local_ptr, size_t size) {
init_core_log(Core_log_range { (addr_t)core_local_ptr, size } ); });
init_core_log(Core_log_range { core_local_addr, log_size } );
}
/* export platform specific infos */
export_page_as_rom_module("platform_info",
[&] (void *core_local_ptr, size_t size) {
Xml_generator xml(reinterpret_cast<char *>(core_local_ptr),
size, "platform_info",
[&] () {
xml.node("kernel", [&] () {
xml.attribute("name", "fiasco"); }); }); });
}

View File

@@ -58,10 +58,13 @@ void Platform_pd::init()
void Platform_pd::_create_pd(bool syscall)
{
enum { TASK_ID_MASK = (1 << 11) - 1,
VERSION_LOW_MASK = (1 << 10) - 1 };
l4_threadid_t l4t = l4_myself();
l4t.id.task = _pd_id;
l4t.id.task = _pd_id & TASK_ID_MASK;
l4t.id.lthread = 0;
l4t.id.version_low = _version;
l4t.id.version_low = _version & VERSION_LOW_MASK;
l4_taskid_t nt;
if (syscall)
@@ -203,8 +206,10 @@ bool Platform_pd::bind_thread(Platform_thread &thread)
}
thread_id = t;
enum { LTHREAD_MASK = (1 << 7) - 1 };
l4_thread_id = _l4_task_id;
l4_thread_id.id.lthread = thread_id;
l4_thread_id.id.lthread = thread_id & LTHREAD_MASK;
/* finally inform thread about binding */
thread.bind(thread_id, l4_thread_id, *this);

View File

@@ -15,6 +15,10 @@
#define _INCLUDE__FIASCO__SYSCALL_H_
namespace Fiasco {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#include <l4/sys/types.h>
#include <l4/sys/kdebug.h>
#include <l4/sys/ipc.h>
@@ -24,6 +28,8 @@ namespace Fiasco {
#include <l4/sys/ktrace.h>
#include <l4/sys/syscalls.h>
#include <l4/sigma0/sigma0.h>
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
}
#endif /* _INCLUDE__FIASCO__SYSCALL_H_ */

View File

@@ -32,9 +32,9 @@ class Msg_header
private:
/* kernel-defined message header */
l4_fpage_t rcv_fpage; /* unused */
l4_msgdope_t size_dope;
l4_msgdope_t send_dope;
l4_fpage_t _rcv_fpage; /* unused */
l4_msgdope_t _size_dope;
l4_msgdope_t _send_dope;
public:
@@ -52,6 +52,8 @@ class Msg_header
enum { MAX_CAPS_PER_MSG = Msgbuf_base::MAX_CAPS_PER_MSG };
enum { SIZE_DOPE_MASK = 0x3ffff };
l4_threadid_t _cap_tid [MAX_CAPS_PER_MSG];
unsigned long _cap_local_name [MAX_CAPS_PER_MSG];
@@ -68,7 +70,7 @@ class Msg_header
public:
void *msg_start() { return &rcv_fpage; }
void *msg_start() { return &_rcv_fpage; }
/**
* Load header fields according to send-message buffer
@@ -79,7 +81,8 @@ class Msg_header
num_caps = min((unsigned)MAX_CAPS_PER_MSG, snd_msg.used_caps());
size_t const snd_words = snd_msg.data_size()/sizeof(l4_umword_t);
send_dope = L4_IPC_DOPE(_num_msg_words(snd_words), 0);
_send_dope = L4_IPC_DOPE(_num_msg_words(snd_words) & SIZE_DOPE_MASK, 0);
/* reset _cap_tid and _cap_local_name */
for (unsigned i = 0; i < MAX_CAPS_PER_MSG; i++) {
@@ -107,7 +110,7 @@ class Msg_header
{
size_t const rcv_max_words = rcv_msg.capacity()/sizeof(l4_umword_t);
size_dope = L4_IPC_DOPE(_num_msg_words(rcv_max_words), 0);
_size_dope = L4_IPC_DOPE(_num_msg_words(rcv_max_words) & SIZE_DOPE_MASK, 0);
}
/**
@@ -234,11 +237,8 @@ Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &last_caller,
* error condition to the user but want to wait for the next proper
* incoming message.
*/
if (L4_IPC_IS_ERROR(ipc_result)) {
error("ipc_reply_and_wait error ", Hex(L4_IPC_ERROR(ipc_result)));
} else {
if (!L4_IPC_IS_ERROR(ipc_result))
need_to_wait = false;
}
}
while (need_to_wait) {

View File

@@ -25,8 +25,7 @@ using namespace Genode;
** Startup library support **
*****************************/
void prepare_init_main_thread() { }
void prepare_reinit_main_thread() { }
void prepare_init_main_thread() { }
/************

View File

@@ -1,2 +0,0 @@
TARGET = ld-fiasco
LIBS = ld-fiasco

View File

@@ -14,6 +14,9 @@
#ifndef _INCLUDE__FOC__SYSCALL_H_
#define _INCLUDE__FOC__SYSCALL_H_
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
namespace Foc {
#include <l4/sys/types.h>
#include <l4/sys/kip>
@@ -33,4 +36,6 @@ namespace Foc {
#include <l4/sigma0/sigma0.h>
}
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
#endif /* _INCLUDE__FOC__SYSCALL_H_ */

View File

@@ -26,7 +26,7 @@ namespace Genode { struct Foc_thread_state; }
struct Genode::Foc_thread_state : Thread_state
{
Foc::l4_cap_idx_t kcap; /* thread's gate cap in its PD */
int id; /* ID of gate capability */
uint16_t id; /* ID of gate capability */
addr_t utcb; /* thread's UTCB in its PD */
/**

View File

@@ -8,15 +8,13 @@ MAKEOVERRIDES := $(filter-out KERNEL=%,$(MAKEOVERRIDES))
unexport KERNEL
$(FOC_BUILD_DIR):
$(VERBOSE_MK) set -o pipefail; \
$(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) $(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FOC_SRC) BUILDDIR=$@ \
$(KERNEL_BUILD_OUTPUT_FILTER)
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(FOC): $(FOC_BUILD_DIR)
$(VERBOSE_MK) set -o pipefail; \
$(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) $(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
CC="$(CC)" CXX="$(CXX)" \
$(VERBOSE_DIR) -C $(FOC_BUILD_DIR) \
$(KERNEL_BUILD_OUTPUT_FILTER)

View File

@@ -39,6 +39,9 @@ PKG_TAGS = $(addsuffix .tag,$(addsuffix .$(BOARD),$(PKGS)))
BUILD_OUTPUT_FILTER = 2>&1 | sed "s~^~ [$*] ~"
# do not confuse third-party sub-makes
unexport .SHELLFLAGS
#
# Execute the rules in this file only at the second build stage when we know
# about the complete build settings, e.g., 'CROSS_DEV_PREFIX'.
@@ -55,8 +58,7 @@ endif
.NOTPARALLEL: $(PKG_TAGS)
%.$(BOARD).tag:
$(VERBOSE_MK) set -o pipefail; \
$(MAKE) $(VERBOSE_DIR) O=$(L4_BUILD_DIR) -C $(L4_PKG_DIR)/$* \
$(VERBOSE_MK) $(MAKE) $(VERBOSE_DIR) O=$(L4_BUILD_DIR) -C $(L4_PKG_DIR)/$* \
"$(L4_BUILD_OPT)" WARNINGS=$(WARNINGS) $(BUILD_OUTPUT_FILTER)
$(VERBOSE)mkdir -p $(dir $@) && touch $@

View File

@@ -37,7 +37,7 @@ CC_OPT += -DL4SYS_USE_UTCB_WRAP=1 -Wno-unused-function
# build system will stuble over predefined variables, i.e., 'LIB'
#
$(L4_BUILD_DIR)/.kconfig:
$(VERBOSE_MK) set -o pipefail; \
$(VERBOSE_MK) \
MAKEFLAGS= $(MAKE) $(VERBOSE_DIR) -C $(L4_SRC_DIR)/l4 \
B=$(L4_BUILD_DIR) DROPSCONF_DEFCONFIG="$(L4_CONFIG)" \
VERBOSE="$(VERBOSE)" CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \

View File

@@ -0,0 +1,15 @@
L4: enable GCC 10
diff --git a/l4/mk/Makeconf b/l4/mk/Makeconf
index eb59b51..a7b5955 100644
--- a/l4/mk/Makeconf
+++ b/l4/mk/Makeconf
@@ -52,7 +52,7 @@ L4_KIP_OFFS_SYS_DEBUGGER = 0x900
L4_STACK_ADDR ?= $(L4_STACK_ADDR_$(ARCH))
L4_STACK_SIZE ?= $(if $(L4_STACK_SIZE_MAIN_THREAD),$(L4_STACK_SIZE_MAIN_THREAD),0x8000)
-CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9
+CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9 10
CC_WHITELIST-clang := 3.5 3.6 3.7 3.8 3.9
# This is quite bad: There is no other chance to disable the page-alignedment

View File

@@ -0,0 +1,162 @@
From dd8842dbdae2bb11d4f726f8a49a6ecb4d5d6870 Mon Sep 17 00:00:00 2001
From: Frank Mehnert <frank.mehnert@kernkonzept.com>
Subject: [PATCH] Do not depend on any libstdc++ feature
The libc_minimal library does not provide support for libstdc++ so use
the normal libc headers instead and do not use any 'std' functions.
Change-Id: I9b4e04ddba0e3f366550265a2c30ef0f37df5534
---
server/src/boot_modules.cc | 2 +-
server/src/multiboot2.cc | 24 ++++++++++++------------
server/src/platform/exynos.cc | 2 +-
server/src/platform/x86_pc-base.h | 4 ++--
server/src/platform_common.cc | 2 +-
server/src/support.h | 4 ++--
6 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/server/src/boot_modules.cc b/server/src/boot_modules.cc
index 2446967..6100749 100644
--- a/server/src/boot_modules.cc
+++ b/server/src/boot_modules.cc
@@ -1,6 +1,6 @@
#include "support.h"
#include "panic.h"
-#include <cassert>
+#include <assert.h>
#include "mod_info.h"
#ifdef COMPRESS
#include "uncompress.h"
diff --git a/server/src/multiboot2.cc b/server/src/multiboot2.cc
index c7255a3..17a2fdd 100644
--- a/server/src/multiboot2.cc
+++ b/server/src/multiboot2.cc
@@ -18,7 +18,7 @@
#include <l4/sys/consts.h>
#include <l4/cxx/minmax>
-#include <cstring>
+#include <string.h>
#include <assert.h>
#include <stddef.h>
@@ -62,7 +62,7 @@ public:
// by some other tag type)
void process_modules(l4util_mb2_tag_t *tag)
{
- std::size_t cnt = 0;
+ size_t cnt = 0;
while (tag->type == L4UTIL_MB2_MODULE_INFO_TAG)
{
@@ -146,8 +146,8 @@ public:
void finalize()
{
assert(sizeof(_mbi) <= _size);
- std::memcpy(_buf, &_mbi, sizeof(_mbi));
- std::memset(_buf + sizeof(_mbi), 0, _size - sizeof(_mbi));
+ memcpy(_buf, &_mbi, sizeof(_mbi));
+ memset(_buf + sizeof(_mbi), 0, _size - sizeof(_mbi));
}
private:
@@ -157,25 +157,25 @@ private:
{
char buf[1024];
- std::size_t size = l4_round_size(tag->size, L4UTIL_MB2_TAG_ALIGN_SHIFT);
+ size_t size = l4_round_size(tag->size, L4UTIL_MB2_TAG_ALIGN_SHIFT);
l4util_mb2_tag_t *dst_tag =
reinterpret_cast<l4util_mb2_tag_t *>(end() - size);
char *_src = reinterpret_cast<char *>(tag);
while (size)
{
- std::size_t copied = cxx::min(sizeof(buf), size);
+ size_t copied = cxx::min(sizeof(buf), size);
char *_dst = end() - copied;
- std::memcpy(buf, _src, copied);
- std::memmove(_src, _src + copied, (end() - _src) - copied);
- std::memcpy(_dst, buf, copied);
+ memcpy(buf, _src, copied);
+ memmove(_src, _src + copied, (end() - _src) - copied);
+ memcpy(_dst, buf, copied);
size -= copied;
}
return dst_tag;
}
- void reserve_from_end(std::size_t size)
+ void reserve_from_end(size_t size)
{
size = l4_round_size(size, L4UTIL_MB2_TAG_ALIGN_SHIFT);
assert(_size >= size);
@@ -183,8 +183,8 @@ private:
}
char *_buf;
- std::size_t _size;
- const std::size_t _total_size;
+ size_t _size;
+ const size_t _total_size;
l4util_mb_info_t _mbi;
};
diff --git a/server/src/platform/exynos.cc b/server/src/platform/exynos.cc
index d10d70d..bcd6d02 100644
--- a/server/src/platform/exynos.cc
+++ b/server/src/platform/exynos.cc
@@ -17,7 +17,7 @@
#include "support.h"
#include <l4/drivers/uart_s3c2410.h>
-#include <cstdio>
+#include <stdio.h>
namespace {
class Platform_arm_exynos : public Platform_single_region_ram
diff --git a/server/src/platform/x86_pc-base.h b/server/src/platform/x86_pc-base.h
index d5d53bf..fe0e0dd 100644
--- a/server/src/platform/x86_pc-base.h
+++ b/server/src/platform/x86_pc-base.h
@@ -12,8 +12,8 @@
#include <l4/util/port_io.h>
#include <l4/cxx/static_container>
-#include <cassert>
-#include <cstdio>
+#include <assert.h>
+#include <stdio.h>
/** VGA console output */
diff --git a/server/src/platform_common.cc b/server/src/platform_common.cc
index 0503802..26ae0a9 100644
--- a/server/src/platform_common.cc
+++ b/server/src/platform_common.cc
@@ -1,6 +1,6 @@
#include "support.h"
#include <l4/cxx/minmax>
-#include <cassert>
+#include <assert.h>
#ifdef RAM_SIZE_MB
diff --git a/server/src/support.h b/server/src/support.h
index 472e40e..20d2c04 100644
--- a/server/src/support.h
+++ b/server/src/support.h
@@ -21,8 +21,8 @@
#include <l4/util/mb_info.h>
#include <stdio.h>
#include "region.h"
-#include <cstring>
-#include <cstdlib>
+#include <string.h>
+#include <stdlib.h>
L4::Uart *uart();
void set_stdio_uart(L4::Uart *uart);

View File

@@ -0,0 +1,25 @@
From a4d6d7877c0050308a9c28308fa8a233c86902e1 Mon Sep 17 00:00:00 2001
From: Alexander Warg <alexander.warg@kernkonzept.com>
Date: Mon, 29 Jul 2019 00:00:00 +0000
Subject: [PATCH] Fix amd64 build with binutils 2.32+
We have to make sure that a linker script is not given twice to ld.
Change-Id: Ibd0f8972083f665fb7824df2a65b319183d7b1e7
---
server/src/Make.rules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/src/Make.rules b/server/src/Make.rules
index 43e8775..c1bbfec 100644
--- a/server/src/Make.rules
+++ b/server/src/Make.rules
@@ -439,7 +439,7 @@ $(OBJ_DIR)/ARCH-amd64/libc32/OBJ-$(ARCH)_$(CPU)/libc32.a: FORCE
bootstrap32.elf: $(OBJ32) bootstrap32.bin $(SRC_DIR)/ARCH-amd64/boot32/bootstrap32.ld $(OBJ_DIR)/ARCH-amd64/libc32/OBJ-$(ARCH)_$(CPU)/libc32.a
@$(LINK_MESSAGE)
$(VERBOSE)$(CC32) -o $@ -nostdlib -static \
- -Wl,-T,$(SRC_DIR)/ARCH-amd64/boot32/bootstrap32.ld,--gc-sections $^ -lgcc
+ -Wl,-T,$(SRC_DIR)/ARCH-amd64/boot32/bootstrap32.ld,--gc-sections $(filter-out %/bootstrap32.ld,$^) -lgcc
$(VERBOSE)chmod 755 $@
bootstrap: bootstrap32.elf

View File

@@ -0,0 +1,15 @@
FOC: enable GCC 10
diff --git a/src/Makeconf b/src/Makeconf
index de5b656..7660daa 100644
--- a/src/Makeconf
+++ b/src/Makeconf
@@ -244,7 +244,7 @@ ifeq ($(CC_TYPE),gcc)
endif
-CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9
+CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9 10
CC_WHITELIST-clang := 3.6 3.7 3.8 3.9 4.0 5.0 6.0 7.0 8.0 9.0
CC_WHITELIST := $(CC_WHITELIST-$(CC_TYPE))

View File

@@ -0,0 +1,234 @@
From f29031cdbe8cebf6c39d02a72dd50c736cec3a69 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Jerm=C3=A1=C5=99?= <jakub.jermar@kernkonzept.com>
Subject: [PATCH] amd64: Split _syscall_entry into code and data
This change makes the entire syscall entry table smaller, sparing 32
bytes per a statically configured CPU. Note that some padding is still
used to achieve cacheline alignment of the per-CPU entries of the data
part of the table.
Furthemore, by moving the two data members into a data section and
allowing to modify the handler offset from JDB only, the amd64 kernel is
easier to make completely W^X in the future. The handler entry offset
remains a part of the jump instruction opcode (there is no data
indirection) and JDB is enhanced to be able to patch it when needed.
Change-Id: I22b91f9fd2b108d99e3ceea6611a15ab3db26bb6
Edit for Genode: UX changes not included because of more dependencies
---
src/jdb/ia32/jdb_trace_set-ia32-ux.cpp | 4 +-
src/kern/ia32/64/cpu-64.cpp | 31 +++++-------------
src/kern/ia32/64/entry.S | 29 +++++++++++++++++
src/kern/ia32/64/syscall_entry.cpp | 54 +++++---------------------------
4 files changed, 48 insertions(+), 70 deletions(-)
diff --git a/src/jdb/ia32/jdb_trace_set-ia32-ux.cpp b/src/jdb/ia32/jdb_trace_set-ia32-ux.cpp
index ec23322..0a2f309 100644
--- a/src/jdb/ia32/jdb_trace_set-ia32-ux.cpp
+++ b/src/jdb/ia32/jdb_trace_set-ia32-ux.cpp
@@ -39,7 +39,7 @@ Jdb_set_trace::set_ipc_vector()
Idt::set_entry(0x30, (Address) int30_entry, true);
Jdb::on_each_cpu([fast_entry](Cpu_number cpu){
- Cpu::cpus.cpu(cpu).set_fast_entry(fast_entry);
+ //Cpu::cpus.cpu(cpu).set_fast_entry(fast_entry);
});
if (Jdb_ipc_trace::_trace)
@@ -98,7 +98,7 @@ struct Jdb_ipc_log_pm : Pm_object
else
fast_entry = entry_sys_fast_ipc_c;
- Cpu::cpus.cpu(cpu).set_fast_entry(fast_entry);
+ //Cpu::cpus.cpu(cpu).set_fast_entry(fast_entry);
}
void pm_on_suspend(Cpu_number) override {}
diff --git a/src/kern/ia32/64/cpu-64.cpp b/src/kern/ia32/64/cpu-64.cpp
index 974c677..d18ad16 100644
--- a/src/kern/ia32/64/cpu-64.cpp
+++ b/src/kern/ia32/64/cpu-64.cpp
@@ -4,7 +4,8 @@ INTERFACE [amd64 && !kernel_isolation]:
EXTENSION class Cpu
{
- static Per_cpu_array<Syscall_entry> _syscall_entry;
+ static Per_cpu_array<Syscall_entry_data>
+ _syscall_entry_data asm("syscall_entry_data");
};
@@ -13,14 +14,7 @@ IMPLEMENTATION[amd64 && !kernel_isolation]:
#include "mem_layout.h"
#include "tss.h"
-Per_cpu_array<Syscall_entry> Cpu::_syscall_entry;
-
-PUBLIC
-void
-Cpu::set_fast_entry(void (*func)())
-{
- _syscall_entry[id()].set_entry(func);
-}
+Per_cpu_array<Syscall_entry_data> Cpu::_syscall_entry_data;
IMPLEMENT inline NEEDS["tss.h"]
Address volatile &
@@ -31,11 +25,13 @@ PUBLIC inline
void
Cpu::setup_sysenter()
{
+ extern Per_cpu_array<Syscall_entry_text> syscall_entry_text;
+
wrmsr(0, GDT_CODE_KERNEL | ((GDT_CODE_USER32 | 3) << 16), MSR_STAR);
- wrmsr((Unsigned64)&_syscall_entry[id()], MSR_LSTAR);
- wrmsr((Unsigned64)&_syscall_entry[id()], MSR_CSTAR);
+ wrmsr((Unsigned64)&syscall_entry_text[id()], MSR_LSTAR);
+ wrmsr((Unsigned64)&syscall_entry_text[id()], MSR_CSTAR);
wrmsr(~0U, MSR_SFMASK);
- _syscall_entry[id()].set_rsp((Address)&kernel_sp());
+ _syscall_entry_data[id()].set_rsp((Address)&kernel_sp());
}
IMPLEMENTATION[amd64 && kernel_isolation]:
@@ -43,16 +39,6 @@ IMPLEMENTATION[amd64 && kernel_isolation]:
#include "mem_layout.h"
#include "tss.h"
-PUBLIC
-void
-Cpu::set_fast_entry(void (*func)())
-{
- extern char const syscall_entry_code[];
- extern char const syscall_entry_reloc[];
- auto ofs = syscall_entry_reloc - syscall_entry_code + 3; // 3 byte movebas
- *reinterpret_cast<Signed32 *>(Mem_layout::Mem_layout::Kentry_cpu_page + ofs + 0xa0) = (Signed32)(Signed64)func;
-}
-
PUBLIC inline
void
Cpu::setup_sysenter() const
@@ -78,7 +64,6 @@ Cpu::init_sysenter()
{
setup_sysenter();
wrmsr(rdmsr(MSR_EFER) | 1, MSR_EFER);
- set_fast_entry(entry_sys_fast_ipc_c);
}
diff --git a/src/kern/ia32/64/entry.S b/src/kern/ia32/64/entry.S
index 1cb8137..ed5a04c 100644
--- a/src/kern/ia32/64/entry.S
+++ b/src/kern/ia32/64/entry.S
@@ -372,7 +372,36 @@ entry_\name:
jmp all_syscalls
.endm
+#ifndef CONFIG_KERNEL_ISOLATION
+#ifdef CONFIG_MP
+MAX_NUM_CPUS = CONFIG_MP_MAX_CPUS
+#else
+MAX_NUM_CPUS = 1
+#endif
+
+#define SYSCALL_ENTRY_DATA_SIZE 64
+#define SYSCALL_ENTRY_TEXT_SIZE (0f - 0b)
+#define SYSCALL_ENTRY_OFFSET ((0b - syscall_entry_text) / SYSCALL_ENTRY_TEXT_SIZE)
+#define SYSCALL_ENTRY_DATA (syscall_entry_data + SYSCALL_ENTRY_OFFSET * SYSCALL_ENTRY_DATA_SIZE)
+#define KERN_SP (SYSCALL_ENTRY_DATA + 0)
+#define USER_SP (SYSCALL_ENTRY_DATA + 8)
.section ".entry.text.syscalls", "ax", @progbits
+ .global syscall_entry_text
+ .align 64
+syscall_entry_text:
+.rept MAX_NUM_CPUS
+0:
+ mov %rsp, USER_SP(%rip)
+ mov KERN_SP(%rip), %rsp
+ mov (%rsp), %rsp
+ pushq $GDT_DATA_USER | 3
+ pushq USER_SP(%rip)
+ jmp entry_sys_fast_ipc_c
+ .align 32
+0:
+.endr
+#endif /* !CONFIG_KERNEL_ISOLATION */
+
.p2align 4
.type all_syscalls,@function
all_syscalls:
diff --git a/src/kern/ia32/64/syscall_entry.cpp b/src/kern/ia32/64/syscall_entry.cpp
index b03d1ad..3dd7db3 100644
--- a/src/kern/ia32/64/syscall_entry.cpp
+++ b/src/kern/ia32/64/syscall_entry.cpp
@@ -2,58 +2,22 @@ INTERFACE [amd64]:
#include "types.h"
-class Syscall_entry
+class Syscall_entry_data
{
-private:
- template<int INSN_LEN>
- struct Mem_insn
- {
- Unsigned32 _insn:INSN_LEN * 8;
- Unsigned32 _offset;
- Mem_insn(Unsigned32 insn, void *mem)
- : _insn(insn),
- _offset((Address)mem - (Address)(&_offset + 1))
- {}
- } __attribute__((packed));
-
- Mem_insn<3> _mov_rsp_user_sp;
- Mem_insn<3> _mov_kern_sp_rsp;
- Unsigned32 _mov_rsp_rsp;
- Unsigned8 _push_ss, _ss_value;
- Mem_insn<2> _push_user_rsp;
- Unsigned8 _jmp;
- Signed32 _entry_offset;
- Unsigned8 _pading[33]; // pad to the next 64 byte boundary
- Unsigned64 _kern_sp;
- Unsigned64 _user_sp;
-} __attribute__((packed, aligned(64)));
+ Unsigned64 _kern_sp = 0;
+ Unsigned64 _user_sp = 0;
+} __attribute__((packed, aligned(64))); // Enforce cacheline alignment
+struct Syscall_entry_text
+{
+ char _res[32]; // Keep this in sync with code in syscall_entry_text!
+} __attribute__((packed, aligned(32)));
IMPLEMENTATION [amd64]:
-#include "config_gdt.h"
-
-PUBLIC inline NEEDS["config_gdt.h"]
-Syscall_entry::Syscall_entry()
-: /* mov %rsp, _user_sp(%rip) */ _mov_rsp_user_sp(0x258948, &_user_sp),
- /* mov _kern_sp(%rip), %rsp */ _mov_kern_sp_rsp(0x258b48, &_kern_sp),
- /* mov (%rsp), %rsp */ _mov_rsp_rsp(0x24248b48),
- /* pushq GDT_DATA_USER | 3 */ _push_ss(0x6a), _ss_value(GDT_DATA_USER | 3),
- /* pushq _user_sp(%rip) */ _push_user_rsp(0x35ff, &_user_sp),
- /* jmp *_entry_offset */ _jmp(0xe9)
-{}
-
-PUBLIC inline
-void
-Syscall_entry::set_entry(void (*func)(void))
-{
- _entry_offset = (Address)func
- - ((Address)&_entry_offset + sizeof(_entry_offset));
-}
-
PUBLIC inline
void
-Syscall_entry::set_rsp(Address rsp)
+Syscall_entry_data::set_rsp(Address rsp)
{
_kern_sp = rsp;
}

View File

@@ -0,0 +1,94 @@
ARM: link bootstrap as ET_REL not ET_EXEC
From: Frank Mehnert <frank.mehnert@kernkonzept.com>
Support for linking of ET_EXEC section was deprecated in binutils 2.35
and dropped in binutils 2.36.
Instead, extract the raw section of the fully linked bootstrap object
and create a relocatable object which can be linked to the kernel. The
required symbols for the linker are extracted separately.
Fixes ticket #CD-301.
Change-Id: I0cdc2aacb5dbd01677d93e2bb1103940ac60e848
Edit: fixed merge error for Genode
---
src/Makeconf.arm | 6 ++++++
src/kern/arm/Makerules.KERNEL | 20 ++++++++++++++++----
src/kernel.arm.ld | 4 ++--
3 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/src/Makeconf.arm b/src/Makeconf.arm
index 7c66a8d..89b9e7d 100644
--- a/src/Makeconf.arm
+++ b/src/Makeconf.arm
@@ -31,3 +31,9 @@ LDFLAGS += $(LDFLAGS-y)
LD_EMULATION_CHOICE-$(CONFIG_BIT32) := armelf armelf_linux_eabi armelf_fbsd
LD_EMULATION_CHOICE-$(CONFIG_BIT64) := aarch64linux aarch64elf
LD_EMULATION_CHOICE := $(LD_EMULATION_CHOICE-y)
+OBJCOPY_BFDNAME-$(CONFIG_BIT32) := elf32-littlearm
+OBJCOPY_BFDNAME-$(CONFIG_BIT64) := elf64-littleaarch64
+OBJCOPY_BFDNAME := $(OBJCOPY_BFDNAME-y)
+OBJCOPY_BFDARCH-$(CONFIG_BIT32) := arm
+OBJCOPY_BFDARCH-$(CONFIG_BIT64) := aarch64
+OBJCOPY_BFDARCH := $(OBJCOPY_BFDARCH-y)
diff --git a/src/kern/arm/Makerules.KERNEL b/src/kern/arm/Makerules.KERNEL
index d706444..fae3013 100644
--- a/src/kern/arm/Makerules.KERNEL
+++ b/src/kern/arm/Makerules.KERNEL
@@ -21,16 +21,28 @@ bootstrap_ldflags += -T$(bootstrap_lds)
bootstrap_export = _start start_of_loader end_of_bootstrap_info
bootstrap_strip = --strip-all $(addprefix --keep-symbol=,$(bootstrap_export))
+bootstrap_syms = end_of_bootstrap_info|_start|start_of_loader
+bootstrap_sed = 's/^0*([0-9a-f]*) [a-zA-Z] ($(bootstrap_syms))/\2 = 0x\1;/p'
bootstrap.$(KERNEL).pre.o: $(OBJ_BOOTSTRAP) $(LIBGCC) $(bootstrap_lds)
$(LINK_MESSAGE)
$(VERBOSE)$(LD) $(bootstrap_ldflags) $(OBJ_BOOTSTRAP) $(LIBGCC) -o $@
-bootstrap.$(KERNEL).o: bootstrap.$(KERNEL).pre.o
- $(LINK_MESSAGE)
- $(VERBOSE)$(OBJCOPY) $(bootstrap_strip) $< $@
+bootstrap.$(KERNEL).bin: bootstrap.$(KERNEL).pre.o
+ $(COMP_MESSAGE)
+ $(VERBOSE)$(OBJCOPY) -O binary --only-section=.bootstrap.text $< $@
+
+bootstrap.$(KERNEL).rel: bootstrap.$(KERNEL).bin
+ $(COMP_MESSAGE)
+ $(VERBOSE)$(OBJCOPY) -I binary -O $(OBJCOPY_BFDNAME) -B $(OBJCOPY_BFDARCH) \
+ --rename-section .data=.bootstrap.text $< $@
+
+# The linker will treat this file as linker script.
+bootstrap.$(KERNEL).sym: bootstrap.$(KERNEL).pre.o
+ $(COMP_MESSAGE)
+ $(VERBOSE)$(NM) $< | sed -n -E $(bootstrap_sed) > $@
-$(KERNEL).image: kernel.arm.lds $(CRT0) bootstrap.$(KERNEL).o $(OBJ_KERNEL_noboot) $(JDB) $(LIBK) $(KERNEL_EXTRA_LIBS) $(LIBDISASM) $(ABI) libdrivers.a $(LIBUART) $(CXXLIB) $(MINILIBC) $(LIBGCC) $(MINILIBC) libgluedriverslibc.a
+$(KERNEL).image: kernel.arm.lds $(CRT0) bootstrap.$(KERNEL).rel bootstrap.$(KERNEL).sym $(OBJ_KERNEL_noboot) $(JDB) $(LIBK) $(KERNEL_EXTRA_LIBS) $(LIBDISASM) $(ABI) libdrivers.a $(LIBUART) $(CXXLIB) $(MINILIBC) $(LIBGCC) $(MINILIBC) libgluedriverslibc.a
$(LINK_MESSAGE)
$(VERBOSE)$(LD) $(LDFLAGS) -m $(LD_EMULATION) $(KERNEL_LDFLAGS) -N -defsym kernel_load_addr=$(CONFIG_KERNEL_LOAD_ADDR) \
-T $< -o $@ $(filter-out $<,$+)
diff --git a/src/kernel.arm.ld b/src/kernel.arm.ld
index 1e3ec75..86c16b3 100644
--- a/src/kernel.arm.ld
+++ b/src/kernel.arm.ld
@@ -61,14 +61,14 @@ SECTIONS {
. = kernel_load_addr + 0x1000;
- .text : {
+ .text kernel_load_addr + 0x1000 : {
MWORD(_start_kernel)
MWORD(my_kernel_info_page)
KEEP(*(.bootstrap.info))
ASSERT (ABSOLUTE(.) == end_of_bootstrap_info, "invalid size of bootstrap.info");
. = ABSOLUTE(start_of_loader);
- *(.bootstrap.text)
+ KEEP(*(.bootstrap.text))
} :bstrap
. = ALIGN(4K);

View File

@@ -1 +1 @@
2e8cbb44d4c009238d96b66a9fc085e038f22e61
abe2de76835f33297ca4e4ac687e69bc04f83dc5

View File

@@ -37,5 +37,11 @@ PATCH_OPT(patches/0014-Always-enable-user-mode-access-for-performance-monit.patc
PATCH_OPT(patches/0015-VMX-disable-event-injection-if-requested-by-VMM.patch) := -p3 -d${DIR(foc)}
PATCH_OPT(patches/0016-svm-provide-cr0-to-guest-if-np-enabled.patch) := -p3 -d${DIR(foc)}
PATCH_OPT(patches/0017-svm-avoid-forceful-exit-on-task-switch.patch) := -p3 -d${DIR(foc)}
PATCH_OPT(patches/0018-L4-enable-gcc_10.patch) := -p2 -d${DIR(mk)}
PATCH_OPT(patches/0019-Bootstrap-do-not-depend-on-any-libstdcxx-feature.patch) := -p1 -d${DIR(bootstrap)}
PATCH_OPT(patches/0020-Bootstrap-fix-amd64-build-with-binutils-2_32.patch) := -p1 -d${DIR(bootstrap)}
PATCH_OPT(patches/0021-FOC-enable-gcc_10.patch) := -p1 -d${DIR(foc)}
PATCH_OPT(patches/0022-FOC-amd64-split-_syscall_entry-into-code-and-data.patch) := -p1 -d${DIR(foc)}
PATCH_OPT(patches/0023-FOC-arm-link-bootstrap-as-et_rel.patch) := -p1 -d${DIR(foc)}
$(call check_tool,gawk)

View File

@@ -1 +1 @@
2021-03-11 c1f7d1de07d3a55d5e43f6ab5fb67b502ab1d0bb
2022-10-11 d258920f8664460c78eeea25fafb89eaa5e7adf5

View File

@@ -1 +1 @@
2021-03-11 9383498670ce6668c8b99da3e62008b21a5932aa
2022-10-11 1c94d29566bccccced246eeaf90702348e2b1a7f

View File

@@ -1 +1 @@
2021-03-11 50104241d20d23e928d3b27d0931d14112c68e82
2022-10-11 2668fd23d5cbd45b8f632073fc7c155f96ecb848

View File

@@ -1 +1 @@
2021-03-11 43cc39f70c8bfe4df3427c94d096d7e218b7b24c
2022-10-11 8da054ff9e4c37895816fd30857b3c42d9e75eb0

View File

@@ -1 +1 @@
2021-03-11 742459157b61720e96c17bb6cfbf7ac085a4df2f
2022-10-11 f41df6b57d2c4b090a84427e02950df84fb385ad

View File

@@ -39,5 +39,4 @@ content:
for spec in x86_32 x86_64 arm arm_64; do \
mv lib/mk/spec/$$spec/ld-foc.mk lib/mk/spec/$$spec/ld.mk; \
done;
sed -i "s/ld-foc/ld/" src/lib/ld/foc/target.mk
sed -i "s/foc_timer_drv/timer/" src/timer/foc/target.mk

View File

@@ -25,6 +25,12 @@ namespace Genode { class Cap_id_allocator; }
class Genode::Cap_id_allocator
{
public:
using id_t = uint16_t;
enum { ID_MASK = 0xffff };
private:
enum {
@@ -44,8 +50,8 @@ class Genode::Cap_id_allocator
Cap_id_allocator(Allocator &);
unsigned long alloc();
void free(unsigned long id);
id_t alloc();
void free(id_t id);
};
#endif /* _CORE__INCLUDE__CAP_ID_ALLOC_H_ */

View File

@@ -16,7 +16,6 @@
#define _CORE__INCLUDE__IPC_PAGER_H_
/* Genode includes */
#include <base/cache.h>
#include <base/ipc.h>
#include <base/stdint.h>
#include <base/native_capability.h>
@@ -28,67 +27,15 @@
/* base-internal includes */
#include <base/internal/native_thread.h>
/* core-local includes */
#include <mapping.h>
/* Fiasco.OC includes */
#include <foc/syscall.h>
namespace Genode {
class Mapping;
class Ipc_pager;
}
namespace Genode { class Ipc_pager; }
class Genode::Mapping
{
private:
addr_t _dst_addr;
Foc::l4_fpage_t _fpage { };
Cache_attribute _cacheability;
bool _iomem;
public:
/**
* Constructor
*/
Mapping(addr_t dst_addr, addr_t src_addr,
Cache_attribute c, bool io_mem,
unsigned log2size, bool write, bool executable)
:
_dst_addr(dst_addr), _cacheability(c), _iomem(io_mem)
{
typedef Foc::L4_fpage_rights Rights;
Rights rights = ( write && executable) ? Foc::L4_FPAGE_RWX :
( write && !executable) ? Foc::L4_FPAGE_RW :
(!write && !executable) ? Foc::L4_FPAGE_RO :
Foc::L4_FPAGE_RX;
_fpage = Foc::l4_fpage(src_addr, log2size, rights);
}
/**
* Construct invalid flexpage
*/
Mapping() : _dst_addr(0), _fpage(Foc::l4_fpage_invalid()),
_cacheability(UNCACHED), _iomem(false) { }
Foc::l4_umword_t dst_addr() const { return _dst_addr; }
bool grant() const { return false; }
Foc::l4_fpage_t fpage() const { return _fpage; }
Cache_attribute cacheability() const { return _cacheability; }
bool iomem() const { return _iomem; }
/**
* Prepare map operation is not needed on Fiasco.OC, since we clear the
* dataspace before this function is called.
*/
void prepare_map_operation() { }
};
/**
* Special paging server class
*/
class Genode::Ipc_pager : public Native_capability
{
public:
@@ -97,14 +44,14 @@ class Genode::Ipc_pager : public Native_capability
private:
Native_thread _last { }; /* origin of last fault */
addr_t _pf_addr { 0 }; /* page-fault address */
addr_t _pf_ip { 0 }; /* ip of faulter */
Mapping _reply_mapping { }; /* page-fault answer */
unsigned long _badge; /* badge of faulting thread */
Native_thread _last { }; /* origin of last fault */
addr_t _pf_addr { 0 }; /* page-fault address */
addr_t _pf_ip { 0 }; /* ip of faulter */
Mapping _reply_mapping { }; /* page-fault answer */
unsigned long _badge; /* badge of faulting thread */
Foc::l4_msgtag_t _tag { }; /* receive message tag */
Foc::l4_exc_regs_t _regs { }; /* exception registers */
Msg_type _type { PAGEFAULT };
Msg_type _type { PAGEFAULT };
void _parse_msg_type(void);
void _parse_exception(void);

View File

@@ -38,7 +38,7 @@ class Genode::Irq_object
Irq_session::Polarity _polarity; /* interrupt polarity */
unsigned _irq;
addr_t _msi_addr;
uint64_t _msi_addr;
addr_t _msi_data;
Signal_context_capability _sig_cap { };
@@ -53,8 +53,8 @@ class Genode::Irq_object
Irq_session::Trigger trigger() const { return _trigger; }
Irq_session::Polarity polarity() const { return _polarity; }
Genode::addr_t msi_address() const { return _msi_addr; }
Genode::addr_t msi_value() const { return _msi_data; }
uint64_t msi_address() const { return _msi_addr; }
addr_t msi_value() const { return _msi_data; }
void sigh(Genode::Signal_context_capability cap) { _sig_cap = cap; }
void notify() { Genode::Signal_transmitter(_sig_cap).submit(1); }

View File

@@ -45,7 +45,7 @@ namespace Genode {
using namespace Foc;
l4_fpage_t snd_fpage = l4_fpage(from_addr + offset,
page_size_log2, L4_FPAGE_RW);
(unsigned)page_size_log2, L4_FPAGE_RW);
if (l4_msgtag_has_error(l4_task_map(L4_BASE_TASK_CAP,
L4_BASE_TASK_CAP,
@@ -95,13 +95,13 @@ namespace Genode {
if (can_use_super_page(from_addr + offset, size))
page_size_log2 = get_super_page_size_log2();
l4_utcb_mr()->mr[1] = l4_fpage(from_addr + offset,
page_size_log2, L4_FPAGE_RWX).raw;
(unsigned)page_size_log2, L4_FPAGE_RWX).raw;
/* open receive window for mapping */
l4_utcb_br()->bdr = 0;
l4_utcb_br()->br[0] = L4_ITEM_MAP;
l4_utcb_br()->br[1] = l4_fpage((addr_t)to_addr + offset,
page_size_log2, L4_FPAGE_RWX).raw;
(unsigned)page_size_log2, L4_FPAGE_RWX).raw;
l4_msgtag_t tag = l4_msgtag(L4_PROTO_SIGMA0, 2, 0, 0);
tag = l4_ipc_call(L4_BASE_PAGER_CAP, l4_utcb(), tag, L4_IPC_NEVER);

View File

@@ -34,14 +34,18 @@ addr_t Io_mem_session_component::_map_local(addr_t base, size_t size)
: get_page_size_log2();
/* find appropriate region for mapping */
void *local_base = 0;
if (platform().region_alloc().alloc_aligned(size, &local_base, alignment).error())
return 0;
return platform().region_alloc().alloc_aligned(size, (unsigned)alignment).convert<addr_t>(
if (!map_local_io(base, (addr_t)local_base, size >> get_page_size_log2())) {
error("map_local_io failed");
return 0;
}
[&] (void *local_base) {
if (!map_local_io(base, (addr_t)local_base, size >> get_page_size_log2())) {
error("map_local_io failed");
platform().region_alloc().free(local_base, base);
return 0UL;
}
return (addr_t)local_base;
},
return (addr_t)local_base;
[&] (Range_allocator::Alloc_error) {
error("allocation of virtual memory for local I/O mapping failed");
return 0UL; });
}

View File

@@ -29,6 +29,13 @@ using namespace Genode;
using namespace Foc;
/*
* There is no preparation needed because the entire physical memory is known
* to be mapped within core.
*/
void Mapping::prepare_map_operation() const { }
void Ipc_pager::_parse(unsigned long label)
{
_badge = label & ~0x3;
@@ -79,7 +86,7 @@ void Ipc_pager::wait_for_fault()
do {
_tag = l4_ipc_wait(l4_utcb(), &label, L4_IPC_NEVER);
int err = l4_ipc_error(_tag, l4_utcb());
l4_umword_t err = l4_ipc_error(_tag, l4_utcb());
if (!err) {
_parse(label);
return;
@@ -94,31 +101,35 @@ void Ipc_pager::reply_and_wait_for_fault()
l4_umword_t label;
l4_msgtag_t snd_tag = l4_msgtag(0, 0, 1, 0);
l4_umword_t grant = _reply_mapping.grant() ? L4_MAP_ITEM_GRANT : 0;
l4_utcb_mr()->mr[0] = _reply_mapping.dst_addr() | L4_ITEM_MAP | grant;
l4_utcb_mr()->mr[0] = _reply_mapping.dst_addr | L4_ITEM_MAP;
switch (_reply_mapping.cacheability()) {
bool const bufferable = !_reply_mapping.io_mem || _reply_mapping.write_combined;
case WRITE_COMBINED:
l4_utcb_mr()->mr[0] |= L4_FPAGE_BUFFERABLE << 4;
break;
l4_fpage_cacheability_opt_t const
cacheability = _reply_mapping.cached ? L4_FPAGE_CACHEABLE
: bufferable ? L4_FPAGE_BUFFERABLE
: L4_FPAGE_UNCACHEABLE;
case CACHED:
l4_utcb_mr()->mr[0] |= L4_FPAGE_CACHEABLE << 4;
break;
l4_utcb_mr()->mr[0] |= cacheability << 4;
case UNCACHED:
if (!_reply_mapping.iomem())
l4_utcb_mr()->mr[0] |= L4_FPAGE_BUFFERABLE << 4;
else
l4_utcb_mr()->mr[0] |= L4_FPAGE_UNCACHEABLE << 4;
break;
}
l4_utcb_mr()->mr[1] = _reply_mapping.fpage().raw;
auto rights = [] (bool writeable, bool executable)
{
if ( writeable && executable) return L4_FPAGE_RWX;
if ( writeable && !executable) return L4_FPAGE_RW;
if (!writeable && !executable) return L4_FPAGE_RO;
return L4_FPAGE_RX;
};
l4_fpage_t const fpage = l4_fpage(_reply_mapping.src_addr,
(unsigned)_reply_mapping.size_log2,
rights(_reply_mapping.writeable,
_reply_mapping.executable));
l4_utcb_mr()->mr[1] = fpage.raw;
_tag = l4_ipc_send_and_wait(_last.kcap, l4_utcb(), snd_tag,
&label, L4_IPC_SEND_TIMEOUT_0);
int err = l4_ipc_error(_tag, l4_utcb());
l4_umword_t const err = l4_ipc_error(_tag, l4_utcb());
if (err) {
error("Ipc error ", err, " in pagefault from ", Hex(label & ~0x3));
wait_for_fault();
@@ -139,7 +150,7 @@ void Ipc_pager::acknowledge_wakeup()
void Ipc_pager::acknowledge_exception()
{
_regs = *l4_utcb_exc();
*l4_utcb_exc() = _regs;
l4_cap_idx_t dst = Foc::Capability::valid(_last.kcap)
? _last.kcap : (l4_cap_idx_t)L4_SYSF_REPLY;
Foc::l4_msgtag_t const msg_tag =

View File

@@ -139,7 +139,7 @@ void Irq_object::ack_irq()
{
using namespace Foc;
int err;
l4_umword_t err;
l4_msgtag_t tag = l4_irq_unmask(_capability());
if ((err = l4_ipc_error(tag, l4_utcb())))
error("IRQ unmask: ", err);
@@ -148,7 +148,7 @@ void Irq_object::ack_irq()
Irq_object::Irq_object()
:
_cap(cap_map().insert(platform_specific().cap_id_alloc().alloc())),
_cap(cap_map().insert((Cap_index::id_t)platform_specific().cap_id_alloc().alloc())),
_trigger(Irq_session::TRIGGER_UNCHANGED),
_polarity(Irq_session::POLARITY_UNCHANGED),
_irq(~0U), _msi_addr(0), _msi_data(0)
@@ -170,7 +170,7 @@ Irq_object::~Irq_object()
if (l4_error(l4_irq_detach(_capability())))
error("cannot detach IRQ");
if (l4_error(l4_icu_unbind(L4_BASE_ICU_CAP, irq, _capability())))
if (l4_error(l4_icu_unbind(L4_BASE_ICU_CAP, (unsigned)irq, _capability())))
error("cannot unbind IRQ");
cap_map().remove(_cap);
@@ -184,7 +184,7 @@ Irq_object::~Irq_object()
Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
const char *args)
:
_irq_number(Arg_string::find_arg(args, "irq_number").long_value(-1)),
_irq_number((unsigned)Arg_string::find_arg(args, "irq_number").long_value(-1)),
_irq_alloc(irq_alloc), _irq_object()
{
long const msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
@@ -196,7 +196,7 @@ Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
}
msi_alloc.set(_irq_number, 1);
} else {
if (irq_alloc.alloc_addr(1, _irq_number).error()) {
if (irq_alloc.alloc_addr(1, _irq_number).failed()) {
error("unavailable IRQ ", _irq_number, " requested");
throw Service_denied();
}
@@ -252,7 +252,7 @@ Irq_session::Info Irq_session_component::info()
return {
.type = Genode::Irq_session::Info::Type::MSI,
.address = _irq_object.msi_address(),
.address = (addr_t)_irq_object.msi_address(),
.value = _irq_object.msi_value()
};
}
@@ -269,7 +269,7 @@ void Interrupt_handler::entry()
{
using namespace Foc;
int err;
l4_umword_t err;
l4_msgtag_t tag;
l4_umword_t label;

View File

@@ -293,14 +293,14 @@ void Platform::_setup_mem_alloc()
for ( ; beg < end; beg += L4_PAGESIZE) (void)(*beg);
/* request pages of known page size starting with largest */
size_t const log2_sizes[] = { L4_LOG2_SUPERPAGESIZE, L4_LOG2_PAGESIZE };
unsigned const log2_sizes[] = { L4_LOG2_SUPERPAGESIZE, L4_LOG2_PAGESIZE };
for (unsigned i = 0; i < sizeof(log2_sizes)/sizeof(*log2_sizes); ++i) {
size_t const log2_size = log2_sizes[i];
size_t const size = 1UL << log2_size;
unsigned const log2_size = log2_sizes[i];
size_t const size = 1UL << log2_size;
int err = 0;
addr_t addr = 0;
Foc::l4_umword_t err = 0;
addr_t addr = 0;
Region region;
/* request any page of current size from sigma0 */
@@ -467,71 +467,68 @@ Platform::Platform()
core_thread.pager(_sigma0);
_core_pd->bind_thread(core_thread);
/* export x86 platform specific infos */
auto export_page_as_rom_module = [&] (auto rom_name, auto content_fn)
{
void * core_local_ptr = nullptr;
void * phys_ptr = nullptr;
unsigned const pages = 1;
size_t const align = get_page_size_log2();
size_t const size = pages << get_page_size_log2();
size_t const pages = 1;
size_t const align = get_page_size_log2();
size_t const bytes = pages << get_page_size_log2();
ram_alloc().alloc_aligned(bytes, align).with_result(
if (ram_alloc().alloc_aligned(size, &phys_ptr, align).error())
return;
[&] (void *phys_ptr) {
if (region_alloc().alloc_aligned(size, &core_local_ptr, align).error())
return;
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
addr_t const core_local_addr = reinterpret_cast<addr_t>(core_local_ptr);
region_alloc().alloc_aligned(bytes, align).with_result(
[&] (void *core_local_ptr) {
if (!map_local(phys_addr, core_local_addr, pages))
return;
if (!map_local(phys_addr, (addr_t)core_local_ptr, pages)) {
warning("map_local failed while exporting ",
rom_name, " as ROM module");
ram_alloc().free(phys_ptr, bytes);
region_alloc().free(core_local_ptr, bytes);
return;
}
memset(core_local_ptr, 0, size);
memset(core_local_ptr, 0, bytes);
content_fn((char *)core_local_ptr, bytes);
Xml_generator xml(reinterpret_cast<char *>(core_local_addr),
pages << get_page_size_log2(),
"platform_info", [&] ()
{
xml.node("kernel", [&] () { xml.attribute("name", "foc"); });
xml.node("hardware", [&] () {
_setup_platform_info(xml, sigma0_map_kip()); });
_rom_fs.insert(new (core_mem_alloc())
Rom_module(phys_addr, bytes, rom_name));
},
[&] (Range_allocator::Alloc_error) {
warning("failed allocate virtual memory to export ",
rom_name, " as ROM module");
ram_alloc().free(phys_ptr, bytes);
}
);
},
[&] (Range_allocator::Alloc_error) {
warning("failed to export ", rom_name, " as ROM module"); }
);
};
xml.node("affinity-space", [&] () {
xml.attribute("width", affinity_space().width());
xml.attribute("height", affinity_space().height()); });
});
export_page_as_rom_module("platform_info",
[&] (char *core_local_ptr, size_t size) {
Xml_generator xml(core_local_ptr, size, "platform_info", [&] ()
{
xml.node("kernel", [&] () {
xml.attribute("name", "foc");
xml.attribute("acpi", true);
xml.attribute("msi" , true);
});
xml.node("hardware", [&] () {
_setup_platform_info(xml, sigma0_map_kip()); });
_rom_fs.insert(new (core_mem_alloc()) Rom_module(phys_addr, size,
"platform_info"));
}
xml.node("affinity-space", [&] () {
xml.attribute("width", affinity_space().width());
xml.attribute("height", affinity_space().height()); });
});
}
);
/* core log as ROM module */
{
void * core_local_ptr = nullptr;
void * phys_ptr = nullptr;
unsigned const pages = 1;
size_t const align = get_page_size_log2();
size_t const size = pages << get_page_size_log2();
if (ram_alloc().alloc_aligned(size, &phys_ptr, align).error())
return;
if (region_alloc().alloc_aligned(size, &core_local_ptr, align).error())
return;
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
addr_t const core_local_addr = reinterpret_cast<addr_t>(core_local_ptr);
if (!map_local(phys_addr, core_local_addr, pages))
return;
memset(core_local_ptr, 0, size);
_rom_fs.insert(new (core_mem_alloc()) Rom_module(phys_addr, size,
"core_log"));
init_core_log(Core_log_range { core_local_addr, size } );
}
export_page_as_rom_module("core_log",
[&] (char *core_local_ptr, size_t size) {
init_core_log(Core_log_range { (addr_t)core_local_ptr, size } ); });
Affinity::Space const cpus = affinity_space();

View File

@@ -122,12 +122,13 @@ void Platform_pd::flush(addr_t, size_t size, Core_local_addr core_local)
static Native_capability debug_cap()
{
unsigned long const id = platform_specific().cap_id_alloc().alloc();
Cap_index::id_t const id = platform_specific().cap_id_alloc().alloc();
static Cap_index * idx = cap_map().insert(id, DEBUG_CAP);
static Native_capability debug_cap(reinterpret_cast<Core_cap_index*>(idx));
return debug_cap;
}
Platform_pd::Platform_pd(Core_cap_index &ci)
:
_task(Native_capability(&ci), TASK_CAP)

View File

@@ -32,7 +32,10 @@ using namespace Foc;
Trace::Execution_time Platform_thread::execution_time() const
{
Foc::l4_kernel_clock_t us = 0;
/* syscall does not return ever, if thread is on remote cpu,
see issue #4357
l4_thread_stats_time(_thread.local.data()->kcap(), &us);
*/
return { us, 0, 10000 /* quantum readable ?*/, _prio };
}
@@ -211,7 +214,7 @@ Foc_thread_state Platform_thread::state()
s = _pager_obj->state.state;
s.kcap = _gate.remote;
s.id = _gate.local.local_name();
s.id = (uint16_t)_gate.local.local_name();
s.utcb = _utcb;
return s;

View File

@@ -49,7 +49,7 @@ Cap_index_allocator &Genode::cap_idx_alloc()
Core_cap_index *Cap_mapping::_get_cap()
{
int const id = platform_specific().cap_id_alloc().alloc();
Cap_index::id_t const id = platform_specific().cap_id_alloc().alloc();
return static_cast<Core_cap_index*>(cap_map().insert(id));
}
@@ -104,7 +104,7 @@ Native_capability Rpc_cap_factory::alloc(Native_capability ep)
/*
* Allocate new id, and ipc-gate and set id as gate-label
*/
unsigned long const id = platform_specific().cap_id_alloc().alloc();
Cap_index::id_t const id = platform_specific().cap_id_alloc().alloc();
Core_cap_index *idx = static_cast<Core_cap_index*>(cap_map().insert(id));
if (!idx) {
@@ -194,19 +194,21 @@ Cap_id_allocator::Cap_id_allocator(Allocator &alloc)
}
unsigned long Cap_id_allocator::alloc()
Cap_id_allocator::id_t Cap_id_allocator::alloc()
{
Mutex::Guard lock_guard(_mutex);
void *id = nullptr;
if (_id_alloc.alloc(CAP_ID_OFFSET, &id))
return (unsigned long) id;
return _id_alloc.try_alloc(CAP_ID_OFFSET).convert<id_t>(
throw Out_of_ids();
[&] (void *id) -> id_t {
return (addr_t)id & ID_MASK; },
[&] (Range_allocator::Alloc_error) -> id_t {
throw Out_of_ids(); });
}
void Cap_id_allocator::free(unsigned long id)
void Cap_id_allocator::free(id_t id)
{
Mutex::Guard lock_guard(_mutex);

View File

@@ -41,7 +41,7 @@ void Signal_source_component::submit(Signal_context_component &context,
unsigned long cnt)
{
/* enqueue signal to context */
context.increment_signal_cnt(cnt);
context.increment_signal_cnt((int)cnt);
if (!context.enqueued()) {
_signal_queue.enqueue(context);

View File

@@ -78,14 +78,22 @@ void Thread::start()
Info trace_source_info() const override
{
uint64_t const sc_time = 0;
addr_t const kcap = (addr_t) platform_thread.pager_object_badge();
using namespace Foc;
l4_kernel_clock_t ec_time = 0;
l4_msgtag_t res = l4_thread_stats_time(kcap, &ec_time);
if (l4_error(res))
Genode::error("cpu time for ", thread.name(),
" is not available ", l4_error(res));
/*
* The 'l4_thread_stats_time' syscall does not always return if
* the thread is on remote CPU. Disable the feature to keep core
* safe (see issue #4357).
*/
if (0) {
addr_t const kcap = (addr_t) platform_thread.pager_object_badge();
l4_msgtag_t res = l4_thread_stats_time(kcap, &ec_time);
if (l4_error(res))
Genode::error("cpu time for ", thread.name(),
" is not available ", l4_error(res));
}
return { Session_label("core"), thread.name(),
Trace::Execution_time(ec_time, sc_time, 10000,

View File

@@ -49,7 +49,7 @@ Vcpu::Vcpu(Rpc_entrypoint &ep,
}
try {
unsigned const vcpu_id = _vcpu_ids.alloc();
unsigned const vcpu_id = (unsigned)_vcpu_ids.alloc();
_task_index_client = thread.setup_vcpu(vcpu_id, task_cap, recall_cap(),
_foc_vcpu_state);
if (_task_index_client == Foc::L4_INVALID_CAP) {
@@ -76,7 +76,7 @@ Vcpu::~Vcpu()
}
if (_foc_vcpu_state) {
unsigned const vcpu_id = ((addr_t)_foc_vcpu_state -
addr_t const vcpu_id = ((addr_t)_foc_vcpu_state -
Platform::VCPU_VIRT_EXT_START) / L4_PAGESIZE;
_vcpu_ids.free(vcpu_id);
}
@@ -176,7 +176,7 @@ void Vm_session_component::_attach_vm_memory(Dataspace_component &dsc,
using namespace Foc;
uint8_t flags = L4_FPAGE_RO;
if (dsc.writable() && attribute.writeable)
if (dsc.writeable() && attribute.writeable)
if (attribute.executable)
flags = L4_FPAGE_RWX;
else
@@ -187,7 +187,7 @@ void Vm_session_component::_attach_vm_memory(Dataspace_component &dsc,
Flexpage page = flex.page();
while (page.valid()) {
l4_fpage_t fp = l4_fpage(page.addr, page.log2_order, flags);
l4_fpage_t fp = l4_fpage(page.addr, (unsigned)page.log2_order, flags);
l4_msgtag_t msg = l4_task_map(_task_vcpu.local.data()->kcap(),
L4_BASE_TASK_CAP, fp,
l4_map_obj_control(page.hotspot,
@@ -210,7 +210,7 @@ void Vm_session_component::_detach_vm_memory(addr_t guest_phys, size_t size)
using namespace Foc;
l4_task_unmap(_task_vcpu.local.data()->kcap(),
l4_fpage(page.addr, page.log2_order, L4_FPAGE_RWX),
l4_fpage(page.addr, (unsigned)page.log2_order, L4_FPAGE_RWX),
L4_FP_ALL_SPACES);
page = flex.page();

View File

@@ -190,7 +190,7 @@ class Genode::Capability_map : private Noncopyable
* \param id the global capability id
* \return pointer of Cap_index when found, otherwise zero
*/
Cap_index* find(int id);
Cap_index* find(Cap_index::id_t id);
/**
* Create and insert a new Cap_index with a specific capability id
@@ -203,7 +203,7 @@ class Genode::Capability_map : private Noncopyable
* \return pointer to the new Cap_index object, or zero
* when allocation failed
*/
Cap_index* insert(int id);
Cap_index* insert(Cap_index::id_t id);
/**
@@ -217,7 +217,7 @@ class Genode::Capability_map : private Noncopyable
* \return pointer to the new Cap_index object, or zero
* when allocation failed
*/
Cap_index* insert(int id, addr_t kcap);
Cap_index* insert(Cap_index::id_t id, addr_t kcap);
/**
* Create and insert a new Cap_index with a specific capability id
@@ -236,7 +236,7 @@ class Genode::Capability_map : private Noncopyable
* with the same id exists and it's kernel-object
* differs to the one given by kcap
*/
Cap_index *insert_map(int id, addr_t kcap);
Cap_index *insert_map(Cap_index::id_t id, addr_t kcap);
/**
* Remove (resp. invalidate) a Cap_index object

View File

@@ -28,13 +28,17 @@
*/
class Genode::Native_capability::Data : public Avl_node<Data>
{
public:
using id_t = uint16_t;
private:
constexpr static uint16_t INVALID_ID = ~0;
constexpr static uint16_t UNUSED = 0;
uint8_t _ref_cnt; /* reference counter */
uint16_t _id; /* global capability id */
uint8_t _ref_cnt; /* reference counter */
id_t _id; /* global capability id */
public:
@@ -56,7 +60,7 @@ class Genode::Native_capability::Data : public Avl_node<Data>
************************/
bool higher(Data *n);
Data *find_by_id(uint16_t id);
Data *find_by_id(id_t id);
};
#endif /* _INCLUDE__BASE__INTERNAL__CAPABILITY_DATA_H_ */

View File

@@ -30,7 +30,7 @@ namespace Genode {
static inline Parent_capability parent_cap()
{
unsigned long const local_name = _parent_cap;
Cap_index::id_t const local_name = (Cap_index::id_t)_parent_cap;
static Cap_index *i = cap_map().insert(local_name, Foc::PARENT_CAP);
/*

View File

@@ -21,3 +21,15 @@ void Genode::cache_coherent(addr_t addr, size_t size)
{
Foc::l4_cache_coherent(addr, addr + size);
}
void Genode::cache_clean_invalidate_data(Genode::addr_t addr, Genode::size_t size)
{
Foc::l4_cache_flush_data(addr, addr + size);
}
void Genode::cache_invalidate_data(Genode::addr_t addr, Genode::size_t size)
{
Foc::l4_cache_inv_data(addr, addr + size);
}

View File

@@ -104,7 +104,7 @@ uint8_t Cap_index::dec()
** Capability_map class **
****************************/
Cap_index* Capability_map::find(int id)
Cap_index* Capability_map::find(Cap_index::id_t id)
{
Lock_guard<Spin_lock> guard(_lock);
@@ -112,7 +112,7 @@ Cap_index* Capability_map::find(int id)
}
Cap_index* Capability_map::insert(int id)
Cap_index* Capability_map::insert(Cap_index::id_t id)
{
Lock_guard<Spin_lock> guard(_lock);
@@ -128,7 +128,7 @@ Cap_index* Capability_map::insert(int id)
}
Cap_index* Capability_map::insert(int id, addr_t kcap)
Cap_index* Capability_map::insert(Cap_index::id_t id, addr_t kcap)
{
Lock_guard<Spin_lock> guard(_lock);
@@ -146,7 +146,7 @@ Cap_index* Capability_map::insert(int id, addr_t kcap)
}
Cap_index* Capability_map::insert_map(int id, addr_t kcap)
Cap_index* Capability_map::insert_map(Cap_index::id_t id, addr_t kcap)
{
using namespace Foc;

View File

@@ -49,13 +49,13 @@ enum Debug { DEBUG_MSG = 1 };
static inline bool ipc_error(l4_msgtag_t tag, bool print)
{
int const ipc_error = l4_ipc_error(tag, l4_utcb());
Foc::l4_umword_t const ipc_error = l4_ipc_error(tag, l4_utcb());
if (ipc_error && print) raw("Ipc error: ", ipc_error, " occurred!");
return ipc_error;
}
static constexpr unsigned long INVALID_BADGE = ~0UL;
static constexpr Cap_index::id_t INVALID_BADGE = 0xffff;
/**
@@ -63,9 +63,9 @@ static constexpr unsigned long INVALID_BADGE = ~0UL;
*/
struct Cap_info
{
bool valid = false;
unsigned long sel = 0;
unsigned long badge = 0;
bool valid = false;
unsigned long sel = 0;
Cap_index::id_t badge = 0;
};
@@ -74,9 +74,9 @@ struct Cap_info
*
* \return protocol word (local name or exception code)
*/
static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
Receive_window &rcv_window,
Msgbuf_base &rcv_msg)
static int extract_msg_from_utcb(l4_msgtag_t tag,
Receive_window &rcv_window,
Msgbuf_base &rcv_msg)
{
unsigned num_msg_words = l4_msgtag_words(tag);
@@ -90,7 +90,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
unsigned long const protocol_word = *msg_words++;
/* read number of capability arguments from second message word */
size_t const num_caps = min(*msg_words, Msgbuf_base::MAX_CAPS_PER_MSG);
unsigned const num_caps = (unsigned)min(*msg_words, Msgbuf_base::MAX_CAPS_PER_MSG);
msg_words++;
num_msg_words -= 2;
@@ -114,7 +114,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
for (unsigned i = 0, sel_idx = 0; i < num_caps; i++) {
unsigned long const badge = *msg_words++;
Cap_index::id_t const badge = (Cap_index::id_t)(*msg_words++);
if (badge == INVALID_BADGE)
continue;
@@ -135,7 +135,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
if ((num_msg_words)*sizeof(l4_mword_t) > rcv_msg.capacity()) {
if (DEBUG_MSG)
raw("receive message buffer too small");
num_msg_words = rcv_msg.capacity()/sizeof(l4_mword_t);
num_msg_words = (unsigned)(rcv_msg.capacity()/sizeof(l4_mword_t));
}
/* read message payload beginning from the second UTCB message register */
@@ -160,7 +160,7 @@ static unsigned long extract_msg_from_utcb(l4_msgtag_t tag,
}
}
return protocol_word;
return (int)protocol_word;
}
@@ -175,8 +175,8 @@ static l4_msgtag_t copy_msgbuf_to_utcb(Msgbuf_base &snd_msg,
unsigned long protocol_word)
{
unsigned const num_data_words = snd_msg.data_size() / sizeof(l4_mword_t);
unsigned const num_caps = snd_msg.used_caps();
unsigned const num_data_words = (unsigned)(snd_msg.data_size() / sizeof(l4_mword_t));
unsigned const num_caps = (unsigned)snd_msg.used_caps();
/* validate capabilities present in the message buffer */
for (unsigned i = 0; i < num_caps; i++) {
@@ -201,7 +201,7 @@ static l4_msgtag_t copy_msgbuf_to_utcb(Msgbuf_base &snd_msg,
Native_capability const &cap = snd_msg.cap(i);
if (cap.valid()) {
caps[i].valid = true;
caps[i].badge = cap.local_name();
caps[i].badge = (Cap_index::id_t)cap.local_name();
caps[i].sel = cap.data()->kcap();
}
}

View File

@@ -38,14 +38,6 @@ void prepare_init_main_thread()
}
void prepare_reinit_main_thread()
{
construct_at<Capability_map>(&cap_map());
cap_idx_alloc().reinit();
prepare_init_main_thread();
}
/************
** Thread **
************/

View File

@@ -29,9 +29,12 @@
#include <foc/native_capability.h>
namespace Foc {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#include <l4/sys/vcpu.h>
#include <l4/sys/__vm-svm.h>
#include <l4/sys/__vm-vmx.h>
#pragma GCC diagnostic pop /* restore -Wconversion warnings */
}
using namespace Genode;
@@ -218,9 +221,9 @@ struct Foc_vcpu : Thread, Noncopyable
CR0_PG = 0 /* 1U << 31 - not needed in case of UG */
};
addr_t const _cr0_mask { CR0_NM | CR0_CD };
addr_t const vmcb_ctrl0 { CTRL0_IO | CTRL0_MSR };
addr_t const vmcb_ctrl1 { 0 };
addr_t const _cr0_mask { CR0_NM | CR0_CD };
uint32_t const vmcb_ctrl0 { CTRL0_IO | CTRL0_MSR };
uint32_t const vmcb_ctrl1 { 0 };
addr_t vmcb_cr0_shadow { 0 };
addr_t vmcb_cr4_shadow { 0 };
@@ -481,7 +484,7 @@ struct Foc_vcpu : Thread, Noncopyable
* Convert to AMD (and Genode) format comprising 16 bits.
*/
uint16_t _convert_ar_16(addr_t value) {
return ((value & 0x1f000) >> 4) | (value & 0xff); }
return (uint16_t)(((value & 0x1f000) >> 4) | (value & 0xff)); }
void _read_intel_state(Vcpu_state &state, void *vmcs,
Foc::l4_vcpu_state_t *vcpu)
@@ -495,18 +498,15 @@ struct Foc_vcpu : Thread, Noncopyable
state.di.charge(vcpu->r.di);
state.si.charge(vcpu->r.si);
state.flags.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::FLAGS));
state.sp.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::SP));
state.ip.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::IP));
state.ip_len.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::INST_LEN));
state.dr7.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::DR7));
state.flags .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::FLAGS));
state.sp .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::SP));
state.ip .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::IP));
state.ip_len.charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::INST_LEN));
state.dr7 .charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::DR7));
#ifdef __x86_64__
state.r8.charge(vcpu->r.r8);
state.r9.charge(vcpu->r.r9);
state.r8 .charge(vcpu->r.r8);
state.r9 .charge(vcpu->r.r9);
state.r10.charge(vcpu->r.r10);
state.r11.charge(vcpu->r.r11);
state.r12.charge(vcpu->r.r12);
@@ -516,21 +516,25 @@ struct Foc_vcpu : Thread, Noncopyable
#endif
{
addr_t const cr0 = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0);
addr_t const cr0_shadow = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0_SHADOW);
addr_t const cr0 = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0);
addr_t const cr0_shadow = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR0_SHADOW);
state.cr0.charge((cr0 & ~vmcs_cr0_mask) | (cr0_shadow & vmcs_cr0_mask));
if (state.cr0.value() != cr0_shadow)
Foc::l4_vm_vmx_write(vmcs, Vmcs::CR0_SHADOW, state.cr0.value());
}
unsigned const cr2 = Foc::l4_vm_vmx_get_cr2_index(vmcs);
state.cr2.charge(Foc::l4_vm_vmx_read(vmcs, cr2));
state.cr3.charge(Foc::l4_vm_vmx_read(vmcs, Vmcs::CR3));
state.cr2.charge((addr_t)Foc::l4_vm_vmx_read(vmcs, cr2));
state.cr3.charge((addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR3));
{
addr_t const cr4 = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4);
addr_t const cr4_shadow = Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4_SHADOW);
addr_t const cr4 = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4);
addr_t const cr4_shadow = (addr_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CR4_SHADOW);
state.cr4.charge((cr4 & ~vmcs_cr4_mask) | (cr4_shadow & vmcs_cr4_mask));
if (state.cr4.value() != cr4_shadow)
Foc::l4_vm_vmx_write(vmcs, Vmcs::CR4_SHADOW,
state.cr4.value());
@@ -545,7 +549,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment cs { l4_vm_vmx_read_16(vmcs, Vmcs::CS_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::CS_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::CS_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::CS_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::CS_BASE) };
@@ -554,7 +558,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment ss { l4_vm_vmx_read_16(vmcs, Vmcs::SS_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::SS_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SS_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::SS_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::SS_BASE) };
@@ -563,7 +567,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment es { l4_vm_vmx_read_16(vmcs, Vmcs::ES_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::ES_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::ES_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::ES_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::ES_BASE) };
@@ -572,7 +576,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment ds { l4_vm_vmx_read_16(vmcs, Vmcs::DS_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::DS_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::DS_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::DS_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::DS_BASE) };
@@ -581,7 +585,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment fs { l4_vm_vmx_read_16(vmcs, Vmcs::FS_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::FS_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::FS_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::FS_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::FS_BASE) };
@@ -590,7 +594,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment gs { l4_vm_vmx_read_16(vmcs, Vmcs::GS_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::GS_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::GS_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::GS_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::GS_BASE) };
@@ -599,7 +603,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment tr { l4_vm_vmx_read_16(vmcs, Vmcs::TR_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::TR_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::TR_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::TR_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::TR_BASE) };
@@ -608,7 +612,7 @@ struct Foc_vcpu : Thread, Noncopyable
{
Segment ldtr { l4_vm_vmx_read_16(vmcs, Vmcs::LDTR_SEL),
_convert_ar_16(l4_vm_vmx_read(vmcs, Vmcs::LDTR_AR)),
_convert_ar_16((addr_t)l4_vm_vmx_read(vmcs, Vmcs::LDTR_AR)),
l4_vm_vmx_read_32(vmcs, Vmcs::LDTR_LIMIT),
l4_vm_vmx_read_nat(vmcs, Vmcs::LDTR_BASE) };
@@ -621,35 +625,35 @@ struct Foc_vcpu : Thread, Noncopyable
state.idtr.charge(Range{.limit = l4_vm_vmx_read_32(vmcs, Vmcs::IDTR_LIMIT),
.base = l4_vm_vmx_read_nat(vmcs, Vmcs::IDTR_BASE)});
state.sysenter_cs.charge(l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_CS));
state.sysenter_sp.charge(l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_SP));
state.sysenter_ip.charge(l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_IP));
state.sysenter_cs.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_CS));
state.sysenter_sp.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_SP));
state.sysenter_ip.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::SYSENTER_IP));
state.qual_primary.charge(l4_vm_vmx_read(vmcs, Vmcs::EXIT_QUAL));
state.qual_primary .charge(l4_vm_vmx_read(vmcs, Vmcs::EXIT_QUAL));
state.qual_secondary.charge(l4_vm_vmx_read(vmcs, Vmcs::GUEST_PHYS));
state.ctrl_primary.charge(l4_vm_vmx_read(vmcs, Vmcs::CTRL_0));
state.ctrl_secondary.charge(l4_vm_vmx_read(vmcs, Vmcs::CTRL_1));
state.ctrl_primary .charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::CTRL_0));
state.ctrl_secondary.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::CTRL_1));
if (state.exit_reason == INTEL_EXIT_INVALID ||
state.exit_reason == VMEXIT_PAUSED)
{
state.inj_info.charge(l4_vm_vmx_read(vmcs, Vmcs::INTR_INFO));
state.inj_error.charge(l4_vm_vmx_read(vmcs, Vmcs::INTR_ERROR));
state.inj_info .charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::INTR_INFO));
state.inj_error.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::INTR_ERROR));
} else {
state.inj_info.charge(l4_vm_vmx_read(vmcs, Vmcs::IDT_INFO));
state.inj_error.charge(l4_vm_vmx_read(vmcs, Vmcs::IDT_ERROR));
state.inj_info .charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::IDT_INFO));
state.inj_error.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::IDT_ERROR));
}
state.intr_state.charge(l4_vm_vmx_read(vmcs, Vmcs::STATE_INTR));
state.actv_state.charge(l4_vm_vmx_read(vmcs, Vmcs::STATE_ACTV));
state.intr_state.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::STATE_INTR));
state.actv_state.charge((uint32_t)l4_vm_vmx_read(vmcs, Vmcs::STATE_ACTV));
state.tsc.charge(Trace::timestamp());
state.tsc_offset.charge(_tsc_offset);
state.efer.charge(l4_vm_vmx_read(vmcs, Vmcs::EFER));
state.efer.charge((addr_t)l4_vm_vmx_read(vmcs, Vmcs::EFER));
state.star.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_STAR));
state.star .charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_STAR));
state.lstar.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_LSTAR));
state.cstar.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_CSTAR));
state.fmask.charge(l4_vm_vmx_read(vmcs, Vmcs::MSR_FMASK));
@@ -665,7 +669,7 @@ struct Foc_vcpu : Thread, Noncopyable
void _read_amd_state(Vcpu_state &state, Foc::l4_vm_svm_vmcb_t *vmcb,
Foc::l4_vcpu_state_t * const vcpu)
{
state.ax.charge(vmcb->state_save_area.rax);
state.ax.charge((addr_t)vmcb->state_save_area.rax);
state.cx.charge(vcpu->r.cx);
state.dx.charge(vcpu->r.dx);
state.bx.charge(vcpu->r.bx);
@@ -674,18 +678,18 @@ struct Foc_vcpu : Thread, Noncopyable
state.si.charge(vcpu->r.si);
state.bp.charge(vcpu->r.bp);
state.flags.charge(vmcb->state_save_area.rflags);
state.flags.charge((addr_t)vmcb->state_save_area.rflags);
state.sp.charge(vmcb->state_save_area.rsp);
state.sp.charge((addr_t)vmcb->state_save_area.rsp);
state.ip.charge(vmcb->state_save_area.rip);
state.ip.charge((addr_t)vmcb->state_save_area.rip);
state.ip_len.charge(0); /* unsupported on AMD */
state.dr7.charge(vmcb->state_save_area.dr7);
state.dr7.charge((addr_t)vmcb->state_save_area.dr7);
#ifdef __x86_64__
state.r8.charge(vcpu->r.r8);
state.r9.charge(vcpu->r.r9);
state.r8 .charge(vcpu->r.r8);
state.r9 .charge(vcpu->r.r9);
state.r10.charge(vcpu->r.r10);
state.r11.charge(vcpu->r.r11);
state.r12.charge(vcpu->r.r12);
@@ -695,15 +699,15 @@ struct Foc_vcpu : Thread, Noncopyable
#endif
{
addr_t const cr0 = vmcb->state_save_area.cr0;
addr_t const cr0 = (addr_t)vmcb->state_save_area.cr0;
state.cr0.charge((cr0 & ~vmcb_cr0_mask) | (vmcb_cr0_shadow & vmcb_cr0_mask));
if (state.cr0.value() != vmcb_cr0_shadow)
vmcb_cr0_shadow = state.cr0.value();
}
state.cr2.charge(vmcb->state_save_area.cr2);
state.cr3.charge(vmcb->state_save_area.cr3);
state.cr2.charge((addr_t)vmcb->state_save_area.cr2);
state.cr3.charge((addr_t)vmcb->state_save_area.cr3);
{
addr_t const cr4 = vmcb->state_save_area.cr4;
addr_t const cr4 = (addr_t)vmcb->state_save_area.cr4;
state.cr4.charge((cr4 & ~vmcb_cr4_mask) | (vmcb_cr4_shadow & vmcb_cr4_mask));
if (state.cr4.value() != vmcb_cr4_shadow)
vmcb_cr4_shadow = state.cr4.value();
@@ -712,44 +716,44 @@ struct Foc_vcpu : Thread, Noncopyable
typedef Vcpu_state::Segment Segment;
state.cs.charge(Segment{vmcb->state_save_area.cs.selector,
vmcb->state_save_area.cs.attrib,
vmcb->state_save_area.cs.limit,
(addr_t)vmcb->state_save_area.cs.base});
vmcb->state_save_area.cs.attrib,
vmcb->state_save_area.cs.limit,
(addr_t)vmcb->state_save_area.cs.base});
state.ss.charge(Segment{vmcb->state_save_area.ss.selector,
vmcb->state_save_area.ss.attrib,
vmcb->state_save_area.ss.limit,
(addr_t)vmcb->state_save_area.ss.base});
vmcb->state_save_area.ss.attrib,
vmcb->state_save_area.ss.limit,
(addr_t)vmcb->state_save_area.ss.base});
state.es.charge(Segment{vmcb->state_save_area.es.selector,
vmcb->state_save_area.es.attrib,
vmcb->state_save_area.es.limit,
(addr_t)vmcb->state_save_area.es.base});
vmcb->state_save_area.es.attrib,
vmcb->state_save_area.es.limit,
(addr_t)vmcb->state_save_area.es.base});
state.ds.charge(Segment{vmcb->state_save_area.ds.selector,
vmcb->state_save_area.ds.attrib,
vmcb->state_save_area.ds.limit,
(addr_t)vmcb->state_save_area.ds.base});
vmcb->state_save_area.ds.attrib,
vmcb->state_save_area.ds.limit,
(addr_t)vmcb->state_save_area.ds.base});
state.fs.charge(Segment{vmcb->state_save_area.fs.selector,
vmcb->state_save_area.fs.attrib,
vmcb->state_save_area.fs.limit,
(addr_t)vmcb->state_save_area.fs.base});
vmcb->state_save_area.fs.attrib,
vmcb->state_save_area.fs.limit,
(addr_t)vmcb->state_save_area.fs.base});
state.gs.charge(Segment{vmcb->state_save_area.gs.selector,
vmcb->state_save_area.gs.attrib,
vmcb->state_save_area.gs.limit,
(addr_t)vmcb->state_save_area.gs.base});
vmcb->state_save_area.gs.attrib,
vmcb->state_save_area.gs.limit,
(addr_t)vmcb->state_save_area.gs.base});
state.tr.charge(Segment{vmcb->state_save_area.tr.selector,
vmcb->state_save_area.tr.attrib,
vmcb->state_save_area.tr.limit,
(addr_t)vmcb->state_save_area.tr.base});
vmcb->state_save_area.tr.attrib,
vmcb->state_save_area.tr.limit,
(addr_t)vmcb->state_save_area.tr.base});
state.ldtr.charge(Segment{vmcb->state_save_area.ldtr.selector,
vmcb->state_save_area.ldtr.attrib,
vmcb->state_save_area.ldtr.limit,
(addr_t)vmcb->state_save_area.ldtr.base});
vmcb->state_save_area.ldtr.attrib,
vmcb->state_save_area.ldtr.limit,
(addr_t)vmcb->state_save_area.ldtr.base});
typedef Vcpu_state::Range Range;
@@ -759,11 +763,11 @@ struct Foc_vcpu : Thread, Noncopyable
state.idtr.charge(Range{.limit = vmcb->state_save_area.idtr.limit,
.base = (addr_t)vmcb->state_save_area.idtr.base });
state.sysenter_cs.charge(vmcb->state_save_area.sysenter_cs);
state.sysenter_sp.charge(vmcb->state_save_area.sysenter_esp);
state.sysenter_ip.charge(vmcb->state_save_area.sysenter_eip);
state.sysenter_cs.charge((addr_t)vmcb->state_save_area.sysenter_cs);
state.sysenter_sp.charge((addr_t)vmcb->state_save_area.sysenter_esp);
state.sysenter_ip.charge((addr_t)vmcb->state_save_area.sysenter_eip);
state.qual_primary.charge(vmcb->control_area.exitinfo1);
state.qual_primary .charge(vmcb->control_area.exitinfo1);
state.qual_secondary.charge(vmcb->control_area.exitinfo2);
uint32_t inj_info = 0;
@@ -771,22 +775,22 @@ struct Foc_vcpu : Thread, Noncopyable
if (state.exit_reason == AMD_EXIT_INVALID ||
state.exit_reason == VMEXIT_PAUSED)
{
inj_info = vmcb->control_area.eventinj;
inj_error = vmcb->control_area.eventinj >> 32;
inj_info = (uint32_t)vmcb->control_area.eventinj;
inj_error = (uint32_t)(vmcb->control_area.eventinj >> 32);
} else {
inj_info = vmcb->control_area.exitintinfo;
inj_error = vmcb->control_area.exitintinfo >> 32;
inj_info = (uint32_t)vmcb->control_area.exitintinfo;
inj_error = (uint32_t)(vmcb->control_area.exitintinfo >> 32);
}
state.inj_info.charge(inj_info);
state.inj_info .charge(inj_info);
state.inj_error.charge(inj_error);
state.intr_state.charge(vmcb->control_area.interrupt_shadow);
state.intr_state.charge((uint32_t)vmcb->control_area.interrupt_shadow);
state.actv_state.charge(0);
state.tsc.charge(Trace::timestamp());
state.tsc_offset.charge(_tsc_offset);
state.efer.charge(vmcb->state_save_area.efer);
state.efer.charge((addr_t)vmcb->state_save_area.efer);
if (state.pdpte_0.charged() || state.pdpte_1.charged() ||
state.pdpte_2.charged() || state.pdpte_3.charged()) {
@@ -894,9 +898,9 @@ struct Foc_vcpu : Thread, Noncopyable
}
if (state.inj_info.charged() || state.inj_error.charged()) {
addr_t ctrl_0 = state.ctrl_primary.charged() ?
state.ctrl_primary.value() :
Foc::l4_vm_vmx_read(vmcs, Vmcs::CTRL_0);
uint32_t ctrl_0 = state.ctrl_primary.charged()
? (uint32_t)state.ctrl_primary.value()
: (uint32_t)Foc::l4_vm_vmx_read(vmcs, Vmcs::CTRL_0);
if (state.inj_info.value() & 0x2000)
warning("unimplemented ", state.inj_info.value() & 0x1000, " ",

View File

@@ -1,2 +0,0 @@
TARGET = ld-foc
LIBS = ld-foc

View File

@@ -38,7 +38,8 @@ Main::Main(Env &env)
Foc::l4_cap_idx_t tid = Capability_space::kcap(env.pd_session_cap());
/* try the first 1000 local name IDs */
for (int local_name = 0; local_name < COUNT; local_name++, idx++) {
using id_t = Native_capability::Data::id_t;
for (id_t local_name = 0; local_name < COUNT; local_name++, idx++) {
idx->id(local_name);
l4_task_map(L4_BASE_TASK_CAP, L4_BASE_TASK_CAP,
l4_obj_fpage(tid, 0, L4_FPAGE_RWX),

View File

@@ -1 +0,0 @@
0x40010000

View File

@@ -1 +0,0 @@
riscv

View File

@@ -1 +0,0 @@
0x80200000

View File

@@ -1 +0,0 @@
arm_v6

View File

@@ -1 +0,0 @@
0x00800000

View File

@@ -1 +0,0 @@
arm_v8a

View File

@@ -1 +0,0 @@
0x00800000

View File

@@ -1,2 +0,0 @@
arm_v7a
arm_v8a

View File

@@ -0,0 +1 @@
0x40000000

View File

@@ -1 +0,0 @@
0x00100000

View File

@@ -16,7 +16,6 @@
/* base-hw includes */
#include <kernel/types.h>
#include <kernel/interface_support.h>
namespace Kernel {
@@ -37,13 +36,15 @@ namespace Kernel {
constexpr Call_arg call_id_ack_signal() { return 11; }
constexpr Call_arg call_id_print_char() { return 12; }
constexpr Call_arg call_id_cache_coherent_region() { return 13; }
constexpr Call_arg call_id_ack_cap() { return 14; }
constexpr Call_arg call_id_delete_cap() { return 15; }
constexpr Call_arg call_id_timeout() { return 16; }
constexpr Call_arg call_id_timeout_max_us() { return 17; }
constexpr Call_arg call_id_time() { return 18; }
constexpr Call_arg call_id_run_vm() { return 19; }
constexpr Call_arg call_id_pause_vm() { return 20; }
constexpr Call_arg call_id_cache_clean_inv_region() { return 14; }
constexpr Call_arg call_id_cache_inv_region() { return 15; }
constexpr Call_arg call_id_ack_cap() { return 16; }
constexpr Call_arg call_id_delete_cap() { return 17; }
constexpr Call_arg call_id_timeout() { return 18; }
constexpr Call_arg call_id_timeout_max_us() { return 19; }
constexpr Call_arg call_id_time() { return 20; }
constexpr Call_arg call_id_run_vm() { return 21; }
constexpr Call_arg call_id_pause_vm() { return 22; }
/*****************************************************************
@@ -90,12 +91,11 @@ namespace Kernel {
* \param duration_us timeout duration in microseconds
* \param sigid local name of signal context to trigger
*
* This call always overwrites the last timeout installed by the thread
* if any.
* This call overwrites the last timeout installed by the thread.
*/
inline int timeout(timeout_t const duration_us, capid_t const sigid)
{
return call(call_id_timeout(), duration_us, sigid);
return (int)call(call_id_timeout(), duration_us, sigid);
}
@@ -128,7 +128,7 @@ namespace Kernel {
*
* The stop syscall always targets the calling thread that, therefore must
* be in the 'active' thread state. The thread then switches to the
* 'stopped' thread state in wich it waits for a restart. The restart
* 'stopped' thread state, in which it waits for a restart. The restart
* syscall can only be used on a thread in the 'stopped' or the 'active'
* thread state. The thread then switches back to the 'active' thread
* state and the syscall returns whether the thread was stopped. Both
@@ -149,7 +149,7 @@ namespace Kernel {
/**
* End blocking of a stopped thread
*
* \param thread_id capability id of the targeted thread
* \param thread_id capability ID of the targeted thread
*
* \return wether the thread was stopped beforehand
*
@@ -162,9 +162,9 @@ namespace Kernel {
/**
* Yield the callers remaining CPU time for this super period
* Yield the caller's remaining CPU time for this super period
*
* Does its best that the caller is scheduled as few as possible in the
* Tell the kernel to schedule the caller as little as possible in the
* current scheduling super-period without touching the thread or pause
* state of the thread. In the next superperiod, however, the thread is
* scheduled 'normal' again. The syscall is not core-restricted and always
@@ -189,25 +189,51 @@ namespace Kernel {
/**
* Send request message and await receipt of corresponding reply message
* Clean and invalidate D-Cache lines of the given memory region
*
* \param thread_id capability id of targeted thread
* \param base base of the region within the current domain
* \param size size of the region
*/
inline void cache_clean_invalidate_data_region(addr_t const base,
size_t const size)
{
call(call_id_cache_clean_inv_region(), (Call_arg)base, (Call_arg)size);
}
/**
* Invalidate D-Cache lines of the given memory region
*
* \param base base of the region within the current domain
* \param size size of the region
*/
inline void cache_invalidate_data_region(addr_t const base,
size_t const size)
{
call(call_id_cache_inv_region(), (Call_arg)base, (Call_arg)size);
}
/**
* Send request message and await reception of corresponding reply message
*
* \param thread_id capability ID of targeted thread
*
* \retval 0 succeeded
* \retval -1 failed
* \retval -2 failed due to out-of-memory for capability reception
*
* If the call returns successful, the received message is located at the
* base of the callers userland thread-context.
* base of the caller's userland thread-context.
*/
inline int send_request_msg(capid_t const thread_id, unsigned rcv_caps)
{
return call(call_id_send_request_msg(), thread_id, rcv_caps);
return (int)call(call_id_send_request_msg(), thread_id, rcv_caps);
}
/**
* Await receipt of request message
* Await reception of request message
*
* \param rcv_caps number of capabilities willing to accept
*
@@ -215,37 +241,37 @@ namespace Kernel {
* \retval -1 canceled
* \retval -2 failed due to out-of-memory for capability reception
*
* If the call returns successful, the received message is located at the
* base of the callers userland thread-context.
* If the call returns successfully, the received message is located at the
* base of the caller's userland thread-context.
*/
inline int await_request_msg(unsigned rcv_caps)
{
return call(call_id_await_request_msg(), rcv_caps);
return (int)call(call_id_await_request_msg(), rcv_caps);
}
/**
* Reply to lastly received request message
* Reply to previously received request message
*
* \param rcv_caps number of capabilities to accept when awaiting again
* \param await_request_msg wether the call shall await a request message
* \param await_request_msg whether the call shall await a request message
*
* \retval 0 await_request_msg == 0 or request-message receipt succeeded
* \retval -1 await_request_msg == 1 and request-message receipt failed
* \retval 0 await_request_msg == 0 or request-message received
* \retval -1 await_request_msg == 1 and request-message failed
*
* If the call returns successful and await_request_msg == 1, the received
* message is located at the base of the callers userland thread-context.
* message is located at the base of the caller's userland thread context.
*/
inline int send_reply_msg(unsigned rcv_caps, bool const await_request_msg)
{
return call(call_id_send_reply_msg(), rcv_caps, await_request_msg);
return (int)call(call_id_send_reply_msg(), rcv_caps, await_request_msg);
}
/**
* Print a char c to the kernels serial ouput
* Print a char c to the kernel's serial ouput
*
* If c is set to 0 the kernel prints a table of all threads and their
* If 'c' is set to 0 the kernel prints a table of all threads and their
* current activities to the serial output.
*/
inline void print_char(char const c)
@@ -257,13 +283,13 @@ namespace Kernel {
/**
* Await any context of a receiver and optionally ack a context before
*
* \param receiver_id capability id of the targeted signal receiver
* \param receiver_id capability ID of the targeted signal receiver
*
* \retval 0 suceeded
* \retval -1 failed
*
* If this call returns 0, an instance of 'Signal::Data' is located at the
* base of the callers UTCB. Every occurence of a signal is provided
* base of the caller's UTCB. Every occurence of a signal is provided
* through this function until it gets delivered through this function or
* context respectively receiver get destructed. If multiple threads
* listen at the same receiver, and/or multiple contexts of the receiver
@@ -274,7 +300,7 @@ namespace Kernel {
*/
inline int await_signal(capid_t const receiver_id)
{
return call(call_id_await_signal(), receiver_id);
return (int)call(call_id_await_signal(), receiver_id);
}
@@ -282,7 +308,7 @@ namespace Kernel {
* Check for any pending signal of a context of a receiver the calling
* thread relates to
*
* \param receiver_id capability id of the targeted signal receiver
* \param receiver_id capability ID of the targeted signal receiver
*
* \retval 0 suceeded
* \retval -1 failed
@@ -292,14 +318,14 @@ namespace Kernel {
*/
inline int pending_signal(capid_t const receiver_id)
{
return call(call_id_pending_signal(), receiver_id);
return (int)call(call_id_pending_signal(), receiver_id);
}
/**
* Request to cancel the next signal blocking of a local thread
*
* \param thread_id capability id of the targeted thread
* \param thread_id capability ID of the targeted thread
*
* Does not block. Targeted thread must be in the same PD as the caller.
* If the targeted thread is in a signal blocking, cancels the blocking
@@ -316,7 +342,7 @@ namespace Kernel {
/**
* Trigger a specific signal context
*
* \param context capability id of the targeted signal context
* \param context capability ID of the targeted signal context
* \param num how often the context shall be triggered by this call
*
* \retval 0 suceeded
@@ -324,14 +350,14 @@ namespace Kernel {
*/
inline int submit_signal(capid_t const context, unsigned const num)
{
return call(call_id_submit_signal(), context, num);
return (int)call(call_id_submit_signal(), context, num);
}
/**
* Acknowledge the processing of the last delivery of a signal context
*
* \param context capability id of the targeted signal context
* \param context capability ID of the targeted signal context
*/
inline void ack_signal(capid_t const context)
{
@@ -342,20 +368,20 @@ namespace Kernel {
/**
* Halt processing of a signal context synchronously
*
* \param context capability id of the targeted signal context
* \param context capability ID of the targeted signal context
*
* \retval 0 suceeded
* \retval -1 failed
*/
inline int kill_signal_context(capid_t const context)
{
return call(call_id_kill_signal_context(), context);
return (int)call(call_id_kill_signal_context(), context);
}
/**
* Acknowledge reception of a capability
*
* \param cap capability id to acknowledge
* \param cap capability ID to acknowledge
*/
inline void ack_cap(capid_t const cap)
{
@@ -363,9 +389,9 @@ namespace Kernel {
}
/**
* Delete a capability id
* Delete a capability ID
*
* \param cap capability id to delete
* \param cap capability ID to delete
*/
inline void delete_cap(capid_t const cap)
{
@@ -376,7 +402,7 @@ namespace Kernel {
/**
* Execute a virtual-machine (again)
*
* \param vm pointer to vm kernel object
* \param vm pointer to VM kernel object
*/
inline void run_vm(capid_t const cap)
{
@@ -387,7 +413,7 @@ namespace Kernel {
/**
* Stop execution of a virtual-machine
*
* \param vm pointer to vm kernel object
* \param vm pointer to VM kernel object
*/
inline void pause_vm(capid_t const cap)
{

View File

@@ -14,9 +14,8 @@
#ifndef _KERNEL__TYPES_H_
#define _KERNEL__TYPES_H_
/* base-hw includes */
#include <kernel/types.h>
#include <kernel/interface_support.h>
/* Genode includes */
#include <base/stdint.h>
namespace Kernel {
@@ -26,6 +25,11 @@ namespace Kernel {
using time_t = Genode::uint64_t;
using timeout_t = Genode::uint32_t;
using Call_arg = Genode::umword_t;
using Call_ret = Genode::umword_t;
using Call_ret_64 = Genode::uint64_t;
constexpr capid_t cap_id_invalid() { return 0; }
}

View File

@@ -1,26 +0,0 @@
/*
* \brief Interface between kernel and userland
* \author Martin Stein
* \date 2011-11-30
*/
/*
* Copyright (C) 2011-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__SPEC__ARM__KERNEL__INTERFACE_SUPPORT_H_
#define _INCLUDE__SPEC__ARM__KERNEL__INTERFACE_SUPPORT_H_
/* Genode includes */
#include <base/stdint.h>
namespace Kernel {
typedef Genode::uint32_t Call_arg;
typedef Genode::uint32_t Call_ret;
typedef Genode::uint64_t Call_ret_64;
}
#endif /* _INCLUDE__SPEC__ARM__KERNEL__INTERFACE_SUPPORT_H_ */

View File

@@ -1,26 +0,0 @@
/*
* \brief Interface between kernel and userland
* \author Stefan Kalkowski
* \date 2019-05-09
*/
/*
* Copyright (C) 2019 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__SPEC__ARM_64__KERNEL__INTERFACE_SUPPORT_H_
#define _INCLUDE__SPEC__ARM_64__KERNEL__INTERFACE_SUPPORT_H_
/* Genode includes */
#include <base/stdint.h>
namespace Kernel {
typedef Genode::uint64_t Call_arg;
typedef Genode::uint64_t Call_ret;
typedef Genode::uint64_t Call_ret_64;
}
#endif /* _INCLUDE__SPEC__ARM_64__KERNEL__INTERFACE_SUPPORT_H_ */

View File

@@ -1,26 +0,0 @@
/*
* \brief Interface between kernel and userland
* \author Sebastian Sumpf
* \date 2015-06-02
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _KERNEL__INTERFACE_SUPPORT_H_
#define _KERNEL__INTERFACE_SUPPORT_H_
/* Genode includes */
#include <base/stdint.h>
namespace Kernel {
typedef Genode::uint64_t Call_arg;
typedef Genode::uint64_t Call_ret;
typedef Genode::uint64_t Call_ret_64;
}
#endif /* _KERNEL__INTERFACE_SUPPORT_H_ */

View File

@@ -1,26 +0,0 @@
/*
* \brief Interface between kernel and userland
* \author Reto Buerki
* \date 2015-02-06
*/
/*
* Copyright (C) 2015-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__SPEC__X86_64__KERNEL__INTERFACE_SUPPORT_H_
#define _INCLUDE__SPEC__X86_64__KERNEL__INTERFACE_SUPPORT_H_
/* Genode includes */
#include <base/stdint.h>
namespace Kernel {
typedef Genode::uint64_t Call_arg;
typedef Genode::uint64_t Call_ret;
typedef Genode::uint64_t Call_ret_64;
}
#endif /* _INCLUDE__SPEC__X86_64__KERNEL__INTERFACE_SUPPORT_H_ */

Some files were not shown because too many files have changed in this diff Show More