Compare commits

...

741 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
2126 changed files with 58370 additions and 46927 deletions

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 @@
22.02
22.08

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,11 +151,11 @@ 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.
@@ -205,17 +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.
:_os/src/drivers/ahci/_:
Driver for SATA disks and CD-ROMs on x86 PCs.
@@ -237,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.
@@ -245,8 +242,8 @@ 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_net/_:
@@ -256,16 +253,6 @@ defined at _os/include/nic_session/_.
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
#####################
@@ -431,6 +418,9 @@ Separate components
:_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
===========
@@ -473,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.

View File

@@ -4,13 +4,202 @@
===========
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.
| 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
@@ -27,7 +216,7 @@ 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
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
@@ -36,7 +225,7 @@ 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
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
@@ -52,12 +241,12 @@ Road Map for 2022 | 2022-01-18
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
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
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.
@@ -76,7 +265,7 @@ 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
| scenarios come to the PinePhone, hardware-accelerated graphics becomes
| available on Intel Gen9+ and Vivante GPUs, and Xilnx Zynq receives
| new love.
@@ -84,7 +273,7 @@ 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
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.
@@ -165,7 +354,7 @@ 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
| 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.
@@ -178,7 +367,7 @@ 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
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.
@@ -310,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
@@ -334,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
@@ -342,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

@@ -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

View File

@@ -147,7 +147,7 @@ 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
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

View File

@@ -30,7 +30,7 @@ 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
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
@@ -187,7 +187,7 @@ 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
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
@@ -203,7 +203,7 @@ 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
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.
@@ -568,7 +568,7 @@ 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
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

View File

@@ -11,9 +11,9 @@
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
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
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
@@ -91,7 +91,7 @@ Kalkowski took the i.MX-related code to his
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
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.
@@ -173,11 +173,11 @@ corresponding line in your etc/build.conf. Step-by-step instructions for
individual boards can be found at _repos/zynq/doc/_.
Allwinner A64 (Pinephone)
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
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.
@@ -186,7 +186,7 @@ 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
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
@@ -199,10 +199,10 @@ now handled by a new A64-specific version of the platform driver.
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
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:
:Booting Genode on the PinePhone:
[https://genodians.org/nfeske/2021-09-20-pine-fun-pinephone-boot]
@@ -291,7 +291,7 @@ 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
PinePhone-related development, in particular during the work described in the
following two articles.
:Device access from the user level:
@@ -325,7 +325,7 @@ 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
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
@@ -367,7 +367,7 @@ 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.
As of now, it is used by the Goodix touchscreen driver for the PinePhone.
Event filter for converting touch to pointer input
@@ -399,7 +399,7 @@ 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
sits in-between the Goodix touchscreen driver for the PinePhone and the
nitpicker GUI server looks as follows.
! <config>

View File

@@ -27,7 +27,7 @@ driver work for several platforms (Section [Device drivers]). In particular,
we started to apply our new method of porting Linux driver code to PC drivers
such as our new USB host controller driver. The Intel GPU driver received
welcome performance optimizations and became usable for guest operating
systems running in VirtualBox 6. On the Pinephone, Genode has started
systems running in VirtualBox 6. On the PinePhone, Genode has started
interacting with the modem.
From a functional perspective, the highlight of the release is the
@@ -35,7 +35,7 @@ extension of Sculpt OS towards a highly customizable toolkit for building
special-purpose operating systems defined at integration time
(Section [Framework for special-purpose Sculpt-based operating systems]).
This new level of flexibility cleared the path to running a bare-bones
version of Sculpt OS on the Pinephone, or directly on a Linux kernel.
version of Sculpt OS on the PinePhone, or directly on a Linux kernel.
Framework for special-purpose Sculpt-based operating systems
@@ -212,11 +212,11 @@ redirected to core using the optional 'LOG=core' argument on the command line.
! build/x86_64$ make run/sculpt KERNEL=nova BOARD=pc SCULPT=default LOG=core
Sculpt OS meets the Pinephone
Sculpt OS meets the PinePhone
=============================
Thanks to the greatly modularized new version of Sculpt OS, we have become
able to run a minimalistic version of Sculpt on the Pinephone, as demonstrated
able to run a minimalistic version of Sculpt on the PinePhone, as demonstrated
in our recent presentation at FOSDEM.
: <video preload="none" controls="controls">
@@ -224,14 +224,14 @@ in our recent presentation at FOSDEM.
: type='video/webm; codecs="vp9, opus"' />
: </video>
:Genode meets the Pinephone:
:Genode meets the PinePhone:
[https://fosdem.org/2022/schedule/event/nfeske/]
_Microkernel developer room at FOSDEM, 2022-02-05_
Despite lacking drivers for storage and network connectivity, we are already
able to put together interesting interactive system images for the Pinephone.
able to put together interesting interactive system images for the PinePhone.
To make this possible, a few additional steps had to be taken though.
First, we had to make Sculpt's administrative GUI able to respond to touch
@@ -878,11 +878,11 @@ configuration (example):
! </config>
Pinephone modem access
PinePhone modem access
======================
On our way towards a Genode-based phone, we enabled the low-level access of
the Quectel-EG25 modem as found in the Pinephone. This line of work is hosted
the Quectel-EG25 modem as found in the PinePhone. This line of work is hosted
in the [https://github.com/genodelabs/genode-allwinner - genode-allwinner]
repository and consists of two parts. First, the modem driver at
_src/drivers/modem/pinephone/_ takes care of the powering and initialization
@@ -897,9 +897,9 @@ A first example scenario is provided by the
[https://github.com/genodelabs/genode-allwinner/blob/22.02/run/modem_pinephone.run - modem_pinephone.run]
script. It comprises the modem driver and two instances of the UART driver.
One UART driver is connected to the modem's control channel whereas the other
is connected to the default serial interface of the Pinephone. By bridging
is connected to the default serial interface of the PinePhone. By bridging
both drivers via a terminal-crosslink component, the scenario allows for
the direct interaction with the modem over the Pinephone's serial channel,
the direct interaction with the modem over the PinePhone's serial channel,
e.g., unlocking a SIM card or sending SMS messages via the 'AT+CMGS' command.

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

@@ -35,7 +35,7 @@ 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.
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
@@ -66,22 +66,22 @@ outcome, which will hopefully propel Genode to new heights in 2022.
2022 - Mobile Usability
#######################
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
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
will not only address the PinePhone specifically. The efficiency gains will
benefit all Genode use cases large and small.
Our theme of the Genode-based video chat on the Pinephone fuels several
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.
Besides the Pinephone, we will steadily nurture the quality and scope of
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
@@ -102,7 +102,7 @@ February - Release 22.02
* OpenGL in VirtualBox 6
* Sculpt OS as tool kit for special-purpose OS images
* Pinephone
* PinePhone
* Modem access
* Touch-screen compatibility of Sculpt OS
@@ -115,13 +115,13 @@ May - Release 22.05
* WireGuard VPN
* Updated drivers for PC hardware (Wifi, Intel framebuffer, USB)
* New tracing tool with support for CTF and PCAP
* Pinephone telephony
* PinePhone telephony
August - Release 22.08
======================
* Pinephone
* PinePhone
* Morph browser
* Media record and playback capabilities
* FPGA-powered DMA protection for the Zynq-7000 SoC
@@ -132,7 +132,7 @@ August - Release 22.08
November - Release 22.11
========================
* Pinephone
* PinePhone
* WebRTC-based video chat
* Power management
* Base mechanism for suspend-resume on PC hardware

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':

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 @@
2022-04-12 515112b4fff8f569ab6194cabbde0dc8e8446c82
2022-10-11 1f0607de6493bad0e47b24e66d84474652e8b6be

View File

@@ -1,2 +0,0 @@
TARGET = ld-fiasco
LIBS = ld-fiasco

View File

@@ -1 +1 @@
2022-04-12 b1e43bda46dcc2e180649bed9990230bbc6f5eb3
2022-10-11 d258920f8664460c78eeea25fafb89eaa5e7adf5

View File

@@ -1 +1 @@
2022-04-12 587953d4a135f958b156bf9ec31adfbc2c84881a
2022-10-11 1c94d29566bccccced246eeaf90702348e2b1a7f

View File

@@ -1 +1 @@
2022-04-12 99c54bf391d7e438022b70b39ba175ee13a831f8
2022-10-11 2668fd23d5cbd45b8f632073fc7c155f96ecb848

View File

@@ -1 +1 @@
2022-04-12 4fe361144ecfe216246e5ba199f578c69ebbec57
2022-10-11 8da054ff9e4c37895816fd30857b3c42d9e75eb0

View File

@@ -1 +1 @@
2022-04-12 b920fe281256f366f1565444ba07bc136897ba06
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

@@ -1,2 +0,0 @@
TARGET = ld-foc
LIBS = ld-foc

View File

@@ -0,0 +1 @@
arm_v8a

View File

@@ -0,0 +1 @@
0x40000000

View File

@@ -12,6 +12,7 @@ SRC_CC += lib/base/avl_tree.cc
SRC_CC += lib/base/console.cc
SRC_CC += lib/base/elf_binary.cc
SRC_CC += lib/base/heap.cc
SRC_CC += lib/base/regional_heap.cc
SRC_CC += lib/base/registry.cc
SRC_CC += lib/base/log.cc
SRC_CC += lib/base/output.cc

View File

@@ -1,6 +1,6 @@
REP_INC_DIR += src/bootstrap/board/virt_qemu
REP_INC_DIR += src/bootstrap/board/virt_qemu_arm_v7a
SRC_CC += bootstrap/board/virt_qemu/platform.cc
SRC_CC += bootstrap/board/virt_qemu_arm_v7a/platform.cc
SRC_CC += bootstrap/spec/arm/arm_v7_cpu.cc
SRC_CC += bootstrap/spec/arm/cortex_a15_cpu.cc
SRC_CC += bootstrap/spec/arm/gicv2.cc

View File

@@ -1,4 +1,4 @@
REP_INC_DIR += src/core/board/virt_qemu
REP_INC_DIR += src/core/board/virt_qemu_arm_v7a
REP_INC_DIR += src/core/spec/arm/virtualization
# add C++ sources

View File

@@ -1,8 +1,8 @@
REP_INC_DIR += src/bootstrap/board/virt_qemu_64
REP_INC_DIR += src/bootstrap/board/virt_qemu_arm_v8a
SRC_CC += bootstrap/spec/arm/gicv3.cc
SRC_CC += bootstrap/spec/arm_64/cortex_a53_mmu.cc
SRC_CC += bootstrap/board/virt_qemu_64/platform.cc
SRC_CC += bootstrap/board/virt_qemu_arm_v8a/platform.cc
SRC_CC += lib/base/arm_64/kernel/interface.cc
SRC_CC += spec/64bit/memory_map.cc
SRC_S += bootstrap/spec/arm_64/crt0.s

View File

@@ -1,4 +1,4 @@
REP_INC_DIR += src/core/board/virt_qemu_64
REP_INC_DIR += src/core/board/virt_qemu_arm_v8a
REP_INC_DIR += src/core/spec/arm/virtualization
# add C++ sources

View File

@@ -4,6 +4,6 @@ SRC_CC += timer_connection_time.cc
SRC_CC += hw/timer_connection_timestamp.cc
SRC_CC += duration.cc
INC_DIR += $(BASE_DIR)/src/include
REP_INC_DIR += src/include
vpath % $(BASE_DIR)/src/lib/timeout
vpath % $(call select_from_repositories,src/lib/timeout)

View File

@@ -1 +1 @@
2022-04-12 97ecc02ab7544f8b8bad04a2d23178ce0f14f566
2022-10-11 50db06fe21eca6c46c9b4bf7fcbc81538ac74f32

View File

@@ -1,4 +1,6 @@
CONTENT += src/core/board/imx53_qsb \
src/bootstrap/board/imx53_qsb
src/bootstrap/board/imx53_qsb \
lib/mk/spec/arm_v7/core-hw-imx53_qsb.inc \
lib/mk/spec/arm_v7/bootstrap-hw-imx53_qsb.inc
include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc

View File

@@ -1 +1 @@
2022-04-12 46afb000e6e14e6580e66f489891b14ea7765ddc
2022-10-11 1377d3a2b7afaa265cc5ae6bbd515679be527c40

View File

@@ -1 +1 @@
2022-04-12 2dcfe4b1dc0cf006c4c2acbcfb6b72fcf8e50890
2022-10-11 c32cf899ce00bd69aff5bbd4f7b6b611d2bfa47d

View File

@@ -1 +1 @@
2022-04-12 90a97e63f9870468b957b2493a6c433dd5b0a64c
2022-10-11 39ff297bc573b8e8bf4f2e6e233bf0b1b21f13af

View File

@@ -1 +1 @@
2022-04-12 1eb2a74c06a2130d39d57edcb31e19365e1ee2d9
2022-10-11 f5456c3ed55b53ccaefee603fdb8d9b1e3ca84ab

View File

@@ -1 +1 @@
2022-04-12 d562748afbe8ef29883d33de8c2c63740a3adc30
2022-10-11 de2f50d9164952dbbf6ce76d29abad5d96da8512

View File

@@ -1 +1 @@
2022-04-12 0af1ada2933e4af5b0d07c8586f39f60d31d68f9
2022-10-11 5d72eb4e34f582c06c086345b225cee91ce539cc

View File

@@ -1,4 +0,0 @@
CONTENT += src/core/board/virt_qemu_64 \
src/bootstrap/board/virt_qemu_64
include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc

View File

@@ -1 +0,0 @@
2022-04-12 8ed294db10dc8aad6f6c379d3f8ec6359e1bbd5d

View File

@@ -0,0 +1,4 @@
CONTENT += src/core/board/virt_qemu_arm_v7a \
src/bootstrap/board/virt_qemu_arm_v7a
include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc

View File

@@ -0,0 +1 @@
2022-10-11 70e53c98ef4b3215440efb2ea09e07ff7cd97c4f

View File

@@ -0,0 +1,4 @@
CONTENT += src/core/board/virt_qemu_arm_v8a \
src/bootstrap/board/virt_qemu_arm_v8a
include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc

View File

@@ -0,0 +1 @@
2022-10-11 c146d70c9bde3f928110c868a54b8c800beffd79

View File

@@ -0,0 +1,2 @@
base-hw
base

View File

@@ -115,6 +115,12 @@ SRC_LIB_BASE += $(notdir $(wildcard $(BASE_HW_DIR)/src/lib/base/*.cc)) \
$(notdir $(wildcard $(BASE_DIR)/src/lib/base/*.cc)) \
${call selected_content,SRC_LIB_BASE_SPECS}
SRC_LIB_TIMEOUT += duration.cc \
hw/timer_connection_timestamp.cc \
timeout.cc \
timer_connection.cc \
timer_connection_time.cc
SRC_LIB_STARTUP += init_main_thread.cc _main.cc \
$(addprefix spec/,${call selected_content,SRC_LIB_STARTUP_SPECS})
@@ -125,15 +131,24 @@ SRC_CORE += $(notdir $(wildcard $(BASE_HW_DIR)/src/core/*.cc)) \
$(addprefix board/,$(BOARD)) \
version.inc target.inc include hw kernel
LIB_MK := base-hw-common.mk base-hw.mk bootstrap-hw.inc core-hw.inc \
timeout-hw.mk cxx.mk base.inc base-common.inc startup.inc \
$(addprefix spec/,${call selected_content,LIB_MK_SPECS})
# names of the lib/mk/ files to consider for inclusion in the src archive
LIB_MK_FILES := base-common.inc base-hw-common.mk \
base.inc base-hw.mk \
bootstrap-hw.inc bootstrap-hw-$(BOARD).inc bootstrap-hw-$(BOARD).mk \
core-hw.inc core-hw-$(BOARD).inc core-hw-$(BOARD).mk \
startup.inc startup-hw.mk \
timeout-hw.mk cxx.mk ld-hw.mk syscall-hw.mk
LIB_MK_DIRS := lib/mk $(addprefix lib/mk/spec/,${call selected_content,LIB_MK_SPECS})
CONTENT += $(foreach D,$(LIB_MK_DIRS),$(addprefix $D/,$(LIB_MK_FILES)))
CONTENT += $(addprefix src/timer/,$(SRC_TIMER)) \
$(addprefix src/include/hw/,$(SRC_INCLUDE_HW)) \
$(addprefix src/bootstrap/,$(SRC_BOOTSTRAP)) \
$(addprefix lib/mk/,$(LIB_MK)) \
$(addprefix src/lib/base/,$(SRC_LIB_BASE)) \
$(addprefix src/lib/timeout/,$(SRC_LIB_TIMEOUT)) \
$(addprefix src/lib/startup/,$(SRC_LIB_STARTUP)) \
$(addprefix src/core/,$(SRC_CORE)) \
src/lib/hw src/lib/ld src/lib/cxx \
@@ -180,7 +195,6 @@ generalize_target_names: $(CONTENT)
# apply kernel-agnostic convention of naming the timer and ld.lib.so
for subdir in ${call selected_content,LD_MK_DIRS}; do \
mv $$subdir/ld-hw.mk $$subdir/ld.mk; done
sed -i "s/ld-hw/ld/" src/lib/ld/hw/target.mk
sed -i "s/hw_timer_drv/timer/" src/timer/hw/target.mk
# supplement BOARD definition that normally comes form the build dir
sed -i "s/\?= unknown/:= $(BOARD)/" src/core/hw/target.mk
@@ -189,5 +203,4 @@ generalize_target_names: $(CONTENT)
sed -i "1aREQUIRES := $(ARCH)" src/core/hw/target.mk
sed -i "1aREQUIRES := $(ARCH)" src/bootstrap/hw/target.mk
sed -i "/REQUIRES/s/hw/hw $(ARCH)/" src/timer/hw/target.mk
sed -i "1aREQUIRES := $(ARCH)" src/lib/ld/hw/target.mk

View File

@@ -109,7 +109,8 @@ Cpu::Idle_thread::Idle_thread(Board::Address_space_id_allocator &addr_space_id_a
Cpu &cpu,
Pd &core_pd)
:
Thread { addr_space_id_alloc, user_irq_pool, cpu_pool, core_pd, "idle" }
Thread { addr_space_id_alloc, user_irq_pool, cpu_pool, core_pd,
Cpu_priority::min(), 0, "idle", Thread::IDLE }
{
regs->ip = (addr_t)&idle_thread_main;
@@ -120,14 +121,9 @@ Cpu::Idle_thread::Idle_thread(Board::Address_space_id_allocator &addr_space_id_a
void Cpu::schedule(Job * const job)
{
if (_id == executing_id())
_scheduler.ready(job->share());
else {
_scheduler.ready_check(job->share());
if (_scheduler.need_to_schedule())
trigger_ip_interrupt();
}
_scheduler.ready(job->share());
if (_id != executing_id() && _scheduler.need_to_schedule())
trigger_ip_interrupt();
}

View File

@@ -191,45 +191,17 @@ void Cpu_scheduler::update(time_t time)
}
void Cpu_scheduler::ready_check(Share &s1)
{
assert(_head);
ready(s1);
if (_need_to_schedule)
return;
Share * s2 = _head;
if (!s1._claim) {
_need_to_schedule = s2 == &_idle;
} else if (!_head_claims) {
_need_to_schedule = true;
} else if (s1._prio != s2->_prio) {
_need_to_schedule = s1._prio > s2->_prio;
} else {
for (
; s2 && s2 != &s1;
s2 =
Double_list<Cpu_share>::next(&s2->_claim_item) != nullptr ?
&Double_list<Cpu_share>::next(&s2->_claim_item)->payload() :
nullptr) ;
_need_to_schedule = !s2;
}
}
void Cpu_scheduler::ready(Share &s)
{
assert(!s._ready && &s != &_idle);
_need_to_schedule = true;
s._ready = 1;
s._fill = _fill;
_fills.insert_tail(&s._fill_item);
if (_head == &_idle)
_need_to_schedule = true;
if (!s._quota)
return;
@@ -239,6 +211,28 @@ void Cpu_scheduler::ready(Share &s)
_rcl[s._prio].insert_head(&s._claim_item);
else
_rcl[s._prio].insert_tail(&s._claim_item);
/*
* Check whether we need to re-schedule
*/
if (_need_to_schedule)
return;
/* current head has no quota left */
if (!_head_claims) {
_need_to_schedule = true;
return;
}
/* if current head has different priority */
if (s._prio != _head->_prio) {
_need_to_schedule = s._prio > _head->_prio;
return;
}
/* if current head has same priority, the ready share gets active */
if (s._claim)
_need_to_schedule = true;
}
@@ -246,7 +240,8 @@ void Cpu_scheduler::unready(Share &s)
{
assert(s._ready && &s != &_idle);
_need_to_schedule = true;
if (&s == _head)
_need_to_schedule = true;
s._ready = 0;
_fills.remove(&s._fill_item);
@@ -270,21 +265,15 @@ void Cpu_scheduler::remove(Share &s)
{
assert(&s != &_idle);
_need_to_schedule = true;
if (s._ready) unready(s);
if (&s == _head)
_head = nullptr;
if (s._ready)
_fills.remove(&s._fill_item);
if (!s._quota)
return;
if (s._ready)
_rcl[s._prio].remove(&s._claim_item);
else
_ucl[s._prio].remove(&s._claim_item);
_ucl[s._prio].remove(&s._claim_item);
}
@@ -292,8 +281,6 @@ void Cpu_scheduler::insert(Share &s)
{
assert(!s._ready);
_need_to_schedule = true;
if (!s._quota)
return;

View File

@@ -180,15 +180,10 @@ class Kernel::Cpu_scheduler
void timeout() { _need_to_schedule = true; }
/**
* Update head according to the consumed time
* Update head according to the current (absolute) time
*/
void update(time_t time);
/**
* Set 's1' ready and return wether this outdates current head
*/
void ready_check(Share &s1);
/**
* Set share 's' ready
*/

View File

@@ -329,6 +329,23 @@ void Thread::_call_start_thread()
/* join protection domain */
thread._pd = (Pd *) user_arg_3();
thread._ipc_init(*(Native_utcb *)user_arg_4(), *this);
/*
* Sanity check core threads!
*
* Currently, the model assumes that there is only one core
* entrypoint, which serves requests, and which can destroy
* threads and pds. If this changes, we have to inform all
* cpus about pd destructions to remove their page-tables
* from the hardware in case that a core-thread running with
* that same pd is currently active. Therefore, warn if the
* semantic changes, and additional core threads are started
* across cpu cores.
*/
if (thread._pd == &_core_pd && cpu.id() != _cpu_pool.primary_cpu().id())
Genode::raw("Error: do not start core threads"
" on CPU cores different than boot cpu");
thread._become_active();
}
@@ -369,7 +386,7 @@ void Thread::_call_restart_thread()
Thread &thread = *thread_ptr;
if (!_core && (&pd() != &thread.pd())) {
if (_type == USER && (&pd() != &thread.pd())) {
raw(*this, ": failed to lookup thread ", (unsigned)user_arg_1(),
" to restart it");
_die();
@@ -447,6 +464,18 @@ void Thread::_call_delete_thread()
}
void Thread::_call_delete_pd()
{
Genode::Kernel_object<Pd> & pd =
*(Genode::Kernel_object<Pd>*)user_arg_1();
if (_cpu->active(pd->mmu_regs))
_cpu->switch_to(_core_pd.mmu_regs);
_call_delete<Pd>();
}
void Thread::_call_await_request_msg()
{
if (_ipc_node.can_await_request()) {
@@ -793,7 +822,7 @@ void Thread::_call()
case call_id_pause_vm(): _call_pause_vm(); return;
default:
/* check wether this is a core thread */
if (!_core) {
if (_type != CORE) {
Genode::raw(*this, ": not entitled to do kernel call");
_die();
return;
@@ -805,7 +834,7 @@ void Thread::_call()
_call_new<Thread>(_addr_space_id_alloc, _user_irq_pool, _cpu_pool,
_core_pd, (unsigned) user_arg_2(),
(unsigned) _core_to_kernel_quota(user_arg_3()),
(char const *) user_arg_4());
(char const *) user_arg_4(), USER);
return;
case call_id_new_core_thread():
_call_new<Thread>(_addr_space_id_alloc, _user_irq_pool, _cpu_pool,
@@ -822,7 +851,7 @@ void Thread::_call()
*(Genode::Platform_pd *) user_arg_3(),
_addr_space_id_alloc);
return;
case call_id_delete_pd(): _call_delete<Pd>(); return;
case call_id_delete_pd(): _call_delete_pd(); return;
case call_id_new_signal_receiver(): _call_new<Signal_receiver>(); return;
case call_id_new_signal_context():
_call_new<Signal_context>(*(Signal_receiver*) user_arg_2(), user_arg_3());
@@ -857,7 +886,7 @@ void Thread::_mmu_exception()
return;
}
if (_core)
if (_type != USER)
Genode::raw(*this, " raised a fault, which should never happen ",
_fault);
@@ -874,7 +903,7 @@ Thread::Thread(Board::Address_space_id_allocator &addr_space_id_alloc,
unsigned const priority,
unsigned const quota,
char const *const label,
bool core)
Type type)
:
Kernel::Object { *this },
Cpu_job { priority, quota },
@@ -885,8 +914,8 @@ Thread::Thread(Board::Address_space_id_allocator &addr_space_id_alloc,
_ipc_node { *this },
_state { AWAITS_START },
_label { label },
_core { core },
regs { core }
_type { type },
regs { type != USER }
{ }

View File

@@ -57,6 +57,10 @@ struct Kernel::Thread_fault
*/
class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout
{
public:
enum Type { USER, CORE, IDLE };
private:
/*
@@ -149,7 +153,7 @@ class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout
capid_t _timeout_sigid { 0 };
bool _paused { false };
bool _cancel_next_await_signal { false };
bool const _core { false };
Type const _type;
Genode::Constructible<Tlb_invalidation> _tlb_invalidation {};
Genode::Constructible<Destroy> _destroy {};
@@ -230,6 +234,7 @@ class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout
void _call_restart_thread();
void _call_yield_thread();
void _call_delete_thread();
void _call_delete_pd();
void _call_await_request_msg();
void _call_send_request_msg();
void _call_send_reply_msg();
@@ -301,7 +306,7 @@ class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout
unsigned const priority,
unsigned const quota,
char const *const label,
bool core = false);
Type const type);
/**
* Constructor for core/kernel thread
@@ -315,7 +320,7 @@ class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout
char const *const label)
:
Thread(addr_space_id_alloc, user_irq_pool, cpu_pool, core_pd,
Cpu_priority::min(), 0, label, true)
Cpu_priority::min(), 0, label, CORE)
{ }
~Thread();
@@ -432,6 +437,7 @@ class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout
char const * label() const { return _label; }
Thread_fault fault() const { return _fault; }
Genode::Native_utcb *utcb() { return _utcb; }
Type type() const { return _type; }
Pd &pd() const
{

View File

@@ -77,6 +77,8 @@ class Kernel::Vm : private Kernel::Object, public Cpu_job
Kernel::Signal_context & context,
Identity & id);
~Vm();
/**
* Inject an interrupt to this VM
*

View File

@@ -22,13 +22,17 @@
using namespace Genode;
using namespace Kernel;
using Device = Board::Timer;
using Device = Board::Timer;
using counter_t = Board::Timer::Counter::access_t;
enum {
TICS_PER_MS =
Board::CORTEX_A9_PRIVATE_TIMER_CLK /
Board::CORTEX_A9_PRIVATE_TIMER_DIV / 1000
Board::CORTEX_A9_PRIVATE_TIMER_DIV / 1000,
MAX_COUNTER_VAL = ~(counter_t)0
};
@@ -79,12 +83,33 @@ time_t Timer::us_to_ticks(time_t const us) const {
time_t Timer::_duration() const
{
Device::Counter::access_t last = _last_timeout_duration;
Device::Counter::access_t cnt = _device.read<Device::Counter>();
Device::Counter::access_t ret = (_device.read<Device::Interrupt_status::Event>())
? _max_value() - cnt + last : last - cnt;
return ret;
counter_t const start_counter_val { (counter_t)_last_timeout_duration };
counter_t const curr_counter_val { _device.read<Device::Counter>() };
/*
* Calculate result depending on whether the counter already wrapped or
* not. See the comment in the implementation of '_max_value' for an
* explanation why this comparison is done instead of checking the IRQ
* status and why it is sufficient.
*/
if (curr_counter_val > start_counter_val)
return start_counter_val + (MAX_COUNTER_VAL - curr_counter_val);
return start_counter_val - curr_counter_val;
}
time_t Timer::_max_value() const { return 0xfffffffe; }
time_t Timer::_max_value() const
{
/*
* We propagate a max timeout value far lower than the one required
* by the hardware. This is because on some 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. Therefore, we
* have to make sure that we 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.
*/
return MAX_COUNTER_VAL >> 1;
}

View File

@@ -87,24 +87,25 @@ void Arm_cpu::mmu_fault_status(Fsr::access_t fsr, Thread_fault & fault)
}
void Arm_cpu::switch_to(Arm_cpu::Context&, Arm_cpu::Mmu_context & o)
bool Arm_cpu::active(Arm_cpu::Mmu_context & ctx)
{
if (o.cidr == 0) return;
return (Cidr::read() == ctx.cidr);
}
Cidr::access_t cidr = Cidr::read();
if (cidr != o.cidr) {
/**
* First switch to global mappings only to prevent
* that wrong branch predicts result due to ASID
* and Page-Table not being in sync (see ARM RM B 3.10.4)
*/
Cidr::write(0);
Cpu::synchronization_barrier();
Ttbr0::write(o.ttbr0);
Cpu::synchronization_barrier();
Cidr::write(o.cidr);
Cpu::synchronization_barrier();
}
void Arm_cpu::switch_to(Arm_cpu::Mmu_context & ctx)
{
/**
* First switch to global mappings only to prevent
* that wrong branch predicts result due to ASID
* and Page-Table not being in sync (see ARM RM B 3.10.4)
*/
Cidr::write(0);
Cpu::synchronization_barrier();
Ttbr0::write(ctx.ttbr0);
Cpu::synchronization_barrier();
Cidr::write(ctx.cidr);
Cpu::synchronization_barrier();
}

View File

@@ -104,7 +104,8 @@ struct Genode::Arm_cpu : public Hw::Arm_cpu
else Tlbiall::write(0);
}
void switch_to(Context&, Mmu_context & o);
bool active(Mmu_context &);
void switch_to(Mmu_context &);
static void mmu_fault(Context & c, Kernel::Thread_fault & fault);
static void mmu_fault_status(Fsr::access_t fsr,

View File

@@ -67,7 +67,8 @@ void Kernel::Thread::Tlb_invalidation::execute() { };
void Thread::proceed(Cpu & cpu)
{
cpu.switch_to(*regs, pd().mmu_regs);
if (!cpu.active(pd().mmu_regs) && type() != CORE)
cpu.switch_to(pd().mmu_regs);
regs->cpu_exception = cpu.stack_start();
kernel_to_user_context_switch((static_cast<Cpu::Context*>(&*regs)),

View File

@@ -38,6 +38,9 @@ Vm::Vm(Irq::Pool & user_irq_pool,
}
Vm::~Vm() {}
void Vm::exception(Cpu & cpu)
{
switch(_state.cpu_exception) {

View File

@@ -15,7 +15,7 @@
push { r0 }
mrc p15, 4, r0, c1, c1, 0 /* read HCR register */
tst r0, #1 /* check VM bit */
beq _host_to_vm
beq _from_host
mov r0, #\exception_type
b _vm_to_host
.endm /* _vm_exit */
@@ -47,10 +47,27 @@ _vt_dab_entry: _vm_exit 5
_vt_irq_entry: _vm_exit 6
_vt_trp_entry: _vm_exit 8
_host_to_vm:
_from_host:
pop { r0 }
cmp r0, #0
beq _to_vm
cmp r0, #1
beq _invalidate_tlb
eret
_invalidate_tlb:
push { r3, r4 }
mrrc p15, 6, r3, r4, c2 /* save VTTBR */
mcrr p15, 6, r1, r2, c2 /* write VTTBR */
mcr p15, 0, r0, c8, c3, 0 /* TLBIALLIS */
mcrr p15, 6, r3, r4, c2 /* restore VTTBR */
eret
_to_vm:
push { r1 }
ldr r0, [sp, #1*4]
add r0, r0, #13*4
push { r2 }
add r0, r1, #13*4
ldmia r0!, { r1-r5 }
msr sp_usr, r1
mov lr, r2
@@ -115,6 +132,7 @@ _host_to_vm:
ldmia r0, {r0-r12} /* load vm's r0-r12 */
eret
_vm_to_host:
push { r0 } /* push cpu excep. */
ldr r0, [sp, #3*4] /* load vm state ptr */
@@ -218,6 +236,7 @@ _vm_to_host:
/* host kernel must jump to this point to switch to a vm */
.global hypervisor_enter_vm
hypervisor_enter_vm:
.global hypervisor_call
hypervisor_call:
hvc #0
bx lr

View File

@@ -0,0 +1,55 @@
/*
* \brief Interface between kernel and hypervisor
* \author Stefan Kalkowski
* \date 2022-06-13
*/
/*
* Copyright (C) 2022 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 _SPEC__ARM_V7__VIRTUALIZATION_HYPERVISOR_H_
#define _SPEC__ARM_V7__VIRTUALIZATION_HYPERVISOR_H_
#include <base/stdint.h>
#include <cpu/vm_state_virtualization.h>
namespace Hypervisor {
struct Host_context;
enum Call_number {
WORLD_SWITCH = 0,
TLB_INVALIDATE = 1,
};
using Call_arg = Genode::umword_t;
using Call_ret = Genode::umword_t;
extern "C"
Call_ret hypervisor_call(Call_arg call_id,
Call_arg arg0,
Call_arg arg1);
inline void invalidate_tlb(Genode::uint64_t vttbr)
{
hypervisor_call(TLB_INVALIDATE,
(vttbr & 0xffffffff),
((vttbr >> 32U) & 0xffffffff));
}
inline void switch_world(Genode::Vm_state & vm_state,
Host_context & host_state)
{
hypervisor_call(WORLD_SWITCH,
(Call_arg)&vm_state,
(Call_arg)&host_state);
}
}
#endif /* _SPEC__ARM_V7__VIRTUALIZATION_HYPERVISOR_H_ */

View File

@@ -19,6 +19,7 @@
#include <kernel/cpu.h>
#include <kernel/vm.h>
#include <kernel/main.h>
#include <spec/arm_v7/virtualization/hypervisor.h>
namespace Kernel {
@@ -41,7 +42,7 @@ namespace Kernel {
using namespace Kernel;
struct Host_context
struct Hypervisor::Host_context
{
Cpu::Ttbr_64bit::access_t vttbr;
Cpu::Hcr::access_t hcr;
@@ -61,15 +62,13 @@ struct Host_context
} vt_host_context;
extern "C" void hypervisor_enter_vm(Genode::Vm_state&, Host_context&);
static Host_context & host_context(Cpu & cpu)
static Hypervisor::Host_context & host_context(Cpu & cpu)
{
static Genode::Constructible<Host_context> host_context[NR_OF_CPUS];
static Genode::Constructible<Hypervisor::Host_context>
host_context[NR_OF_CPUS];
if (!host_context[cpu.id()].constructed()) {
host_context[cpu.id()].construct();
Host_context & c = *host_context[cpu.id()];
Hypervisor::Host_context & c = *host_context[cpu.id()];
c.sp = cpu.stack_start();
c.ttbr0 = Cpu::Ttbr0_64bit::read();
c.ttbr1 = Cpu::Ttbr1_64bit::read();
@@ -152,6 +151,15 @@ Kernel::Vm::Vm(Irq::Pool & user_irq_pool,
}
Kernel::Vm::~Vm()
{
Cpu::Ttbr_64bit::access_t vttbr =
Cpu::Ttbr_64bit::Ba::masked((Cpu::Ttbr_64bit::access_t)_id.table);
Cpu::Ttbr_64bit::Asid::set(vttbr, _id.id);
Hypervisor::invalidate_tlb(vttbr);
}
void Kernel::Vm::exception(Cpu & cpu)
{
switch(_state.cpu_exception) {
@@ -190,7 +198,7 @@ void Kernel::Vm::proceed(Cpu & cpu)
_state.esr_el2 = Cpu::Hstr::init();
_state.hpfar_el2 = Cpu::Hcr::init();
hypervisor_enter_vm(_state, host_context(cpu));
Hypervisor::switch_world(_state, host_context(cpu));
}

View File

@@ -26,12 +26,15 @@ Genode::Cpu::Context::Context(bool privileged)
}
void Genode::Cpu::switch_to(Context&, Mmu_context & mmu_context)
bool Genode::Cpu::active(Mmu_context & mmu_context)
{
if (mmu_context.id() == 0) return;
return (mmu_context.id() == Ttbr::Asid::get(Ttbr0_el1::read()));
}
if (mmu_context.id() != Ttbr::Asid::get(Ttbr0_el1::read()))
Ttbr0_el1::write(mmu_context.ttbr);
void Genode::Cpu::switch_to(Mmu_context & mmu_context)
{
Ttbr0_el1::write(mmu_context.ttbr);
}

View File

@@ -99,7 +99,8 @@ struct Genode::Cpu : Hw::Arm_64_cpu
return Ttbr::Asid::get(ttbr) & 0xffff; }
};
void switch_to(Context&, Mmu_context &);
bool active(Mmu_context &);
void switch_to(Mmu_context &);
static void mmu_fault(Context &, Kernel::Thread_fault &);

View File

@@ -55,6 +55,16 @@ void Thread::exception(Cpu & cpu)
" ISS=", Cpu::Esr::Iss::get(esr),
" ip=", (void*)regs->ip);
};
/*
* If the machine exception is caused by a non-privileged
* component, mark it dead, and continue execution.
*/
if (regs->exception_type == Cpu::SYNC_LEVEL_EL0) {
Genode::raw("Will freeze thread ", *this);
_become_inactive(DEAD);
return;
}
break;
}
default:
@@ -75,10 +85,14 @@ void Thread::exception(Cpu & cpu)
void Kernel::Thread::Tlb_invalidation::execute() { };
bool Kernel::Pd::invalidate_tlb(Cpu &, addr_t addr, size_t size)
bool Kernel::Pd::invalidate_tlb(Cpu & cpu, addr_t addr, size_t size)
{
using namespace Genode;
/* only apply to the active cpu */
if (cpu.id() != Cpu::executing_id())
return false;
/**
* The kernel part of the address space is mapped as global
* therefore we have to invalidate it differently
@@ -108,7 +122,9 @@ bool Kernel::Pd::invalidate_tlb(Cpu &, addr_t addr, size_t size)
void Thread::proceed(Cpu & cpu)
{
cpu.switch_to(*regs, pd().mmu_regs);
if (!cpu.active(pd().mmu_regs) && type() != CORE)
cpu.switch_to(pd().mmu_regs);
kernel_to_user_context_switch((static_cast<Cpu::Context*>(&*regs)),
(void*)cpu.stack_start());
}

View File

@@ -22,24 +22,34 @@
.global hypervisor_exception_vector
hypervisor_exception_vector:
.rept 16
add sp, sp, #-16 /* push x0, x1 to stack */
stp x0, x1, [sp]
mrs x1, hcr_el2 /* read HCR register */
tst x1, #1 /* check VM bit */
beq _host_to_vm /* if VM bit is not set, switch to VM */
ldr x0, [sp, #32] /* otherwise, load vm_state pointer */
adr x1, . /* hold exception vector offset in x1 */
and x1, x1, #0xf80
b _vm_to_host
add sp, sp, #-16 /* push x29, x30 to stack */
stp x29, x30, [sp]
mrs x30, hcr_el2 /* read HCR register */
tst x30, #1 /* check VM bit */
beq _from_host /* if VM bit is not set, its a host call */
ldr x29, [sp, #32] /* otherwise, load vm_state pointer */
adr x30, . /* hold exception vector offset in x30 */
and x30, x30, #0xf80
b _from_vm
.balign 128
.endr
_host_to_vm:
_from_host:
ldp x29, x30, [sp], #2*8 /* pop x29, x30 from stack */
cmp x0, #0
beq _to_vm
cmp x0, #1
beq _invalidate_tlb
eret
add sp, sp, #-16 /* push arg2 (vm pic state) to stack */
str x2, [sp]
_to_vm:
add sp, sp, #-16 /* push arg1/2 (vm/host state to stack */
stp x1, x2, [sp]
add sp, sp, #-16 /* push arg3 (vm pic state) to stack */
str x3, [sp]
msr vttbr_el2, x3 /* stage2 table pointer was arg3 */
msr vttbr_el2, x4 /* stage2 table pointer was arg4 */
mov x0, x1
add x0, x0, #31*8 /* skip x0...x30, loaded later */
@@ -179,27 +189,38 @@ _host_to_vm:
eret
_vm_to_host:
_invalidate_tlb:
msr vttbr_el2, x1
tlbi vmalle1is
msr vttbr_el2, xzr
eret
_from_vm:
/*********************
** Save vm context **
*********************/
/** general-purpose register **/
add x0, x0, #2*8 /* skip x0 and x1 for now */
stp x2, x3, [x0], #2*8
stp x4, x5, [x0], #2*8
stp x6, x7, [x0], #2*8
stp x8, x9, [x0], #2*8
stp x10, x11, [x0], #2*8
stp x12, x13, [x0], #2*8
stp x14, x15, [x0], #2*8
stp x16, x17, [x0], #2*8
stp x18, x19, [x0], #2*8
stp x20, x21, [x0], #2*8
stp x22, x23, [x0], #2*8
stp x24, x25, [x0], #2*8
stp x26, x27, [x0], #2*8
stp x0, x1, [x29], #2*8
stp x2, x3, [x29], #2*8
stp x4, x5, [x29], #2*8
stp x6, x7, [x29], #2*8
stp x8, x9, [x29], #2*8
stp x10, x11, [x29], #2*8
stp x12, x13, [x29], #2*8
stp x14, x15, [x29], #2*8
stp x16, x17, [x29], #2*8
stp x18, x19, [x29], #2*8
stp x20, x21, [x29], #2*8
stp x22, x23, [x29], #2*8
stp x24, x25, [x29], #2*8
stp x26, x27, [x29], #2*8
mov x0, x29
mov x1, x30
ldp x29, x30, [sp], #2*8 /* pop x29, x30 from stack */
stp x28, x29, [x0], #2*8
str x30, [x0], #1*8
@@ -284,11 +305,8 @@ _vm_to_host:
mov x0, #0b111
msr cnthctl_el2, x0
ldp x0, x1, [sp], #2*8 /* pop x0, x1 from stack */
ldr x29, [sp], #2*8 /* pop vm pic state from stack */
ldp x2, x30, [sp], #2*8 /* pop vm, and host state from stack */
stp x0, x1, [x2] /* save x0, x1 to vm state */
ldr x29, [sp], #2*8 /* pop vm pic state from stack */
ldp x2, x30, [sp], #2*8 /* pop vm, and host state from stack */
/**********************
@@ -364,6 +382,7 @@ _vm_to_host:
eret
/* host kernel must jump to this point to switch to a vm */
.global hypervisor_enter_vm
hypervisor_enter_vm:
.global hypervisor_call
hypervisor_call:
hvc #0
ret

View File

@@ -0,0 +1,52 @@
/*
* \brief Interface between kernel and hypervisor
* \author Stefan Kalkowski
* \date 2022-06-13
*/
/*
* Copyright (C) 2022 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 _SPEC__ARM_V8__VIRTUALIZATION_HYPERVISOR_H_
#define _SPEC__ARM_V8__VIRTUALIZATION_HYPERVISOR_H_
#include <base/stdint.h>
namespace Hypervisor {
enum Call_number {
WORLD_SWITCH = 0,
TLB_INVALIDATE = 1,
};
using Call_arg = Genode::umword_t;
using Call_ret = Genode::umword_t;
extern "C"
Call_ret hypervisor_call(Call_arg call_id,
Call_arg arg0,
Call_arg arg1,
Call_arg arg2,
Call_arg arg3);
inline void invalidate_tlb(Call_arg ttbr)
{
hypervisor_call(TLB_INVALIDATE, ttbr, 0, 0, 0);
}
inline void switch_world(Call_arg guest_state,
Call_arg host_state,
Call_arg pic_state,
Call_arg ttbr)
{
hypervisor_call(WORLD_SWITCH, guest_state, host_state, pic_state, ttbr);
}
}
#endif /* _SPEC__ARM_V8__VIRTUALIZATION_HYPERVISOR_H_ */

View File

@@ -23,14 +23,12 @@
#include <kernel/vm.h>
#include <kernel/main.h>
#include <spec/arm_v8/virtualization/hypervisor.h>
using Genode::addr_t;
using Kernel::Cpu;
using Kernel::Vm;
extern void * kernel_stack;
extern "C" void hypervisor_enter_vm(addr_t vm, addr_t host,
addr_t pic, addr_t guest_table);
static Genode::Vm_state & host_context(Cpu & cpu)
{
@@ -154,6 +152,15 @@ Vm::Vm(Irq::Pool & user_irq_pool,
}
Vm::~Vm()
{
Cpu::Vttbr_el2::access_t vttbr_el2 =
Cpu::Vttbr_el2::Ba::masked((Cpu::Vttbr_el2::access_t)_id.table);
Cpu::Vttbr_el2::Asid::set(vttbr_el2, _id.id);
Hypervisor::invalidate_tlb(vttbr_el2);
}
void Vm::exception(Cpu & cpu)
{
switch (_state.exception_type) {
@@ -197,7 +204,7 @@ void Vm::proceed(Cpu & cpu)
addr_t pic = Hw::Mm::el2_addr(&_vcpu_context.pic);
addr_t host = Hw::Mm::el2_addr(&host_context(cpu));
hypervisor_enter_vm(guest, host, pic, vttbr_el2);
Hypervisor::switch_world(guest, host, pic, vttbr_el2);
}

View File

@@ -115,11 +115,14 @@ class Genode::Cpu : public Arm_v7_cpu
*/
static unsigned executing_id() { return Mpidr::Aff_0::get(Mpidr::read()); }
void switch_to(Context &, Mmu_context & mmu_context)
bool active(Mmu_context & mmu_context)
{
if (mmu_context.id() && (Ttbr0_64bit::read() != mmu_context.ttbr0))
Ttbr0_64bit::write(mmu_context.ttbr0);
return (Ttbr0_64bit::read() == mmu_context.ttbr0);
}
void switch_to(Mmu_context & mmu_context)
{
Ttbr0_64bit::write(mmu_context.ttbr0);
}
};

View File

@@ -53,22 +53,16 @@ Mmu_context::~Mmu_context()
}
bool Genode::Cpu::active(Mmu_context & context)
{
return Satp::read() == context.satp;
}
void Genode::Cpu::switch_to(Mmu_context & context)
{
/*
* The sstatus register defines to which privilege level
* the machin returns when doing an exception return
*/
bool user = Satp::Asid::get(context.satp);
Sstatus::access_t v = Sstatus::read();
Sstatus::Spp::set(v, user ? 0 : 1);
Sstatus::write(v);
/* change the translation table when necessary */
if (user) {
Satp::write(context.satp);
sfence();
}
Satp::write(context.satp);
sfence();
}

View File

@@ -97,6 +97,7 @@ class Genode::Cpu : public Hw::Riscv_cpu
static void invalidate_tlb_by_pid(unsigned const /* pid */) { sfence(); }
bool active(Mmu_context & context);
void switch_to(Mmu_context & context);
static void mmu_fault(Context & c, Kernel::Thread_fault & f);

View File

@@ -100,7 +100,16 @@ void Kernel::Thread::_call_cache_invalidate_data_region() { }
void Kernel::Thread::proceed(Cpu & cpu)
{
cpu.switch_to(_pd->mmu_regs);
/*
* The sstatus register defines to which privilege level
* the machine returns when doing an exception return
*/
Cpu::Sstatus::access_t v = Cpu::Sstatus::read();
Cpu::Sstatus::Spp::set(v, (type() == USER) ? 0 : 1);
Cpu::Sstatus::write(v);
if (!cpu.active(pd().mmu_regs) && type() != CORE)
cpu.switch_to(_pd->mmu_regs);
asm volatile("csrw sscratch, %1 \n"
"mv x31, %0 \n"

View File

@@ -111,11 +111,20 @@ extern void const * const kernel_stack;
extern Genode::size_t const kernel_stack_size;
void Genode::Cpu::switch_to(Context & context, Mmu_context &mmu_context)
bool Genode::Cpu::active(Mmu_context &mmu_context)
{
if ((context.cs != 0x8) && (mmu_context.cr3 != Cr3::read()))
Cr3::write(mmu_context.cr3);
return (mmu_context.cr3 == Cr3::read());
}
void Genode::Cpu::switch_to(Mmu_context &mmu_context)
{
Cr3::write(mmu_context.cr3);
}
void Genode::Cpu::switch_to(Context & context)
{
tss.ist[0] = (addr_t)&context + sizeof(Genode::Cpu_state);
addr_t const stack_base = reinterpret_cast<addr_t>(&kernel_stack);

View File

@@ -126,7 +126,10 @@ class Genode::Cpu : public Hw::X86_64_cpu
*
* \param context next CPU context
*/
void switch_to(Context & context, Mmu_context &mmu_context);
void switch_to(Context & context);
bool active(Mmu_context &mmu_context);
void switch_to(Mmu_context &mmu_context);
static void mmu_fault(Context & regs, Kernel::Thread_fault & fault);

View File

@@ -43,7 +43,10 @@ void Kernel::Thread::_call_cache_invalidate_data_region() { }
void Kernel::Thread::proceed(Cpu & cpu)
{
cpu.switch_to(*regs, pd().mmu_regs);
if (!cpu.active(pd().mmu_regs) && type() != CORE)
cpu.switch_to(pd().mmu_regs);
cpu.switch_to(*regs);
asm volatile("fxrstor (%1) \n"
"mov %0, %%rsp \n"

View File

@@ -1,2 +0,0 @@
TARGET = ld-hw
LIBS = ld-hw

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2014-2017 Genode Labs GmbH
* Copyright (C) 2014-2022 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.
@@ -18,125 +18,110 @@
/* core includes */
#include <kernel/cpu_scheduler.h>
/*
* Utilities
*/
using namespace Genode;
using namespace Kernel;
using Genode::size_t;
using Genode::addr_t;
using Genode::construct_at;
using Kernel::Cpu_share;
using Kernel::Cpu_scheduler;
struct Data
struct Main
{
Cpu_share idle;
Cpu_scheduler scheduler;
char shares[9][sizeof(Cpu_share)];
enum { MAX_SHARES = 10 };
Data() : idle(0, 0), scheduler(idle, 1000, 100) { }
Constructible<Cpu_share> shares[MAX_SHARES] {};
Cpu_scheduler scheduler;
time_t current_time { 0 };
Cpu_share & _idle()
{
if (!shares[0].constructed()) shares[0].construct(0, 0);
return *shares[0];
}
Main() : scheduler(_idle(), 1000, 100) { }
void done()
{
Genode::log("done");
while (1) ;
}
unsigned share_id(Cpu_share & share)
{
for (unsigned i = 0; i < MAX_SHARES; i++)
if (shares[i].constructed() && (&*shares[i] == &share))
return i;
return ~0U;
}
Cpu_share & share(unsigned const id)
{
return *shares[id];
}
void create(unsigned const id)
{
switch (id) {
case 1: shares[id].construct(2, 230); break;
case 2: shares[id].construct(0, 170); break;
case 3: shares[id].construct(3, 110); break;
case 4: shares[id].construct(1, 90); break;
case 5: shares[id].construct(3, 120); break;
case 6: shares[id].construct(3, 0); break;
case 7: shares[id].construct(2, 180); break;
case 8: shares[id].construct(2, 100); break;
case 9: shares[id].construct(2, 0); break;
default: return;
}
scheduler.insert(*shares[id]);
}
void destroy(unsigned const id)
{
if (!id || id >= MAX_SHARES)
return;
scheduler.remove(share(id));
shares[id].destruct();
}
unsigned time()
{
return scheduler.quota() - scheduler.residual();
}
void update_check(unsigned const l, unsigned const c, unsigned const t,
unsigned const s, unsigned const q)
{
current_time += c;
scheduler.update(current_time);
unsigned const st = time();
if (t != st) {
log("wrong time ", st, " in line ", l);
done();
}
Cpu_share & hs = scheduler.head();
unsigned const hq = scheduler.head_quota();
if (&hs != &share(s)) {
log("wrong share ", share_id(hs), " in line ", l);
done();
}
if (hq != q) {
log("wrong quota ", hq, " in line ", l);
done();
}
}
void ready_check(unsigned const l, unsigned const s, bool const x)
{
scheduler.ready(share(s));
if (scheduler.need_to_schedule() != x) {
log("wrong check result ", scheduler.need_to_schedule(), " in line ", l);
done();
}
}
void test();
};
Data * data()
{
static Data d;
return &d;
}
void done()
{
Genode::log("done");
while (1) ;
}
unsigned share_id(void * const pointer)
{
addr_t const address = (addr_t)pointer;
addr_t const base = (addr_t)data()->shares;
if (address < base || address >= base + sizeof(data()->shares)) {
return 0; }
return (unsigned)((address - base) / sizeof(Cpu_share) + 1);
}
Cpu_share * share(unsigned const id)
{
if (!id) { return &data()->idle; }
return reinterpret_cast<Cpu_share *>(&data()->shares[id - 1]);
}
void create(unsigned const id)
{
Cpu_share * const s = share(id);
void * const p = (void *)s;
switch (id) {
case 1: construct_at<Cpu_share>(p, 2, 230); break;
case 2: construct_at<Cpu_share>(p, 0, 170); break;
case 3: construct_at<Cpu_share>(p, 3, 110); break;
case 4: construct_at<Cpu_share>(p, 1, 90); break;
case 5: construct_at<Cpu_share>(p, 3, 120); break;
case 6: construct_at<Cpu_share>(p, 3, 0); break;
case 7: construct_at<Cpu_share>(p, 2, 180); break;
case 8: construct_at<Cpu_share>(p, 2, 100); break;
case 9: construct_at<Cpu_share>(p, 2, 0); break;
default: return;
}
data()->scheduler.insert(*s);
}
void destroy(unsigned const id)
{
Cpu_share * const s = share(id);
data()->scheduler.remove(*s);
s->~Cpu_share();
}
unsigned time()
{
return data()->scheduler.quota() -
data()->scheduler.residual();
}
void update_check(unsigned const l, unsigned const c, unsigned const t,
unsigned const s, unsigned const q)
{
data()->scheduler.update(c);
unsigned const st = time();
if (t != st) {
Genode::log("wrong time ", st, " in line ", l);
done();
}
Cpu_share &hs = data()->scheduler.head();
unsigned const hq = data()->scheduler.head_quota();
if (&hs != share(s)) {
unsigned const hi = share_id(&hs);
Genode::log("wrong share ", hi, " in line ", l);
done();
}
if (hq != q) {
Genode::log("wrong quota ", hq, " in line ", l);
done();
}
}
void ready_check(unsigned const l, unsigned const s, bool const x)
{
data()->scheduler.ready_check(*share(s));
if (data()->scheduler.need_to_schedule() != x) {
Genode::log("wrong check result ", data()->scheduler.need_to_schedule(), " in line ", l);
done();
}
}
/*
* Shortcuts for all basic operations that the test consists of
@@ -144,10 +129,10 @@ void ready_check(unsigned const l, unsigned const s, bool const x)
#define C(s) create(s);
#define D(s) destroy(s);
#define A(s) data()->scheduler.ready(*share(s));
#define I(s) data()->scheduler.unready(*share(s));
#define Y data()->scheduler.yield();
#define Q(s, q) data()->scheduler.quota(*share(s), q);
#define A(s) scheduler.ready(share(s));
#define I(s) scheduler.unready(share(s));
#define Y scheduler.yield();
#define Q(s, q) scheduler.quota(share(s), q);
#define U(c, t, s, q) update_check(__LINE__, c, t, s, q);
#define O(s) ready_check(__LINE__, s, true);
#define N(s) ready_check(__LINE__, s, false);
@@ -157,6 +142,13 @@ void ready_check(unsigned const l, unsigned const s, bool const x)
* Main routine
*/
void Component::construct(Genode::Env &)
{
static Main main;
main.test();
}
void Main::test()
{
/*
* Step-by-step testing

View File

@@ -1,8 +1,7 @@
FROM_BASE_LINUX := etc src/lib/syscall src/lib/lx_hybrid lib/import include
FROM_BASE_LINUX_AND_BASE := lib/mk src/lib/base src/include
FROM_BASE := src/lib/timeout
FROM_BASE_LINUX_AND_BASE := src/lib/base src/include
content: $(FROM_BASE_LINUX) $(FROM_BASE_LINUX_AND_BASE) $(FROM_BASE) LICENSE
content: $(FROM_BASE_LINUX) $(FROM_BASE_LINUX_AND_BASE) LICENSE
$(FROM_BASE_LINUX):
mkdir -p $@
@@ -13,9 +12,30 @@ $(FROM_BASE_LINUX_AND_BASE):
cp -r $(GENODE_DIR)/repos/base/$@/* $@
cp -r $(REP_DIR)/$@/* $@
$(FROM_BASE):
BASE_LIB_MK_CONTENT := \
$(addprefix lib/mk/,base-common.inc timeout.mk)
content: $(BASE_LIB_MK_CONTENT)
$(BASE_LIB_MK_CONTENT):
mkdir -p $(dir $@)
cp $(GENODE_DIR)/repos/base/$@ $@
content: src/lib/timeout
src/lib/timeout:
mkdir -p $@
cp -r $(GENODE_DIR)/repos/base/$@/* $@
BASE_LINUX_LIB_MK_CONTENT := \
$(addprefix lib/mk/,lx_hybrid.mk base-linux.inc base-linux-common.mk) \
$(foreach S,arm arm_64 x86_32 x86_64,lib/mk/spec/$S/syscall-linux.mk)
content: $(BASE_LINUX_LIB_MK_CONTENT)
$(BASE_LINUX_LIB_MK_CONTENT):
mkdir -p $(dir $@)
cp $(REP_DIR)/$@ $@
LICENSE:
cp $(GENODE_DIR)/LICENSE $@

View File

@@ -1 +1 @@
2022-04-12 dcb2c9200b333adb17f9a8737620cbd84f641408
2022-10-11 4544924c73b2ee1d8d2717672320f14732807267

View File

@@ -10,7 +10,6 @@ content:
mv lib/mk/spec/$$spec/ld-linux.mk lib/mk/spec/$$spec/ld.mk; done;
sed -i "/TARGET/s/core-linux/core/" src/core/linux/target.mk
sed -i "s/BOARD.*unknown/BOARD := linux/" lib/mk/core-linux.inc
sed -i "s/ld-linux/ld/" src/lib/ld/linux/target.mk
sed -i "s/linux_timer_drv/timer/" src/timer/linux/target.mk
rm -rf src/lib/initramfs
rm -rf src/initramfs

View File

@@ -1 +1 @@
2022-04-12 082a29a3ed60ac0208796eb53be9daab7713de28
2022-10-11 d7e12d81f12f081bb7c00233c18f3c8ac2f00d67

View File

@@ -5,14 +5,14 @@ REQUIRES = x86_64
INITRAMFS = initramfs
INITRAMFS_SRC_C = init.c
EXT_OBJECTS += $(BUILD_BASE_DIR)/lib/initramfs/$(INITRAMFS)
EXT_OBJECTS += $(BUILD_BASE_DIR)/initramfs/$(INITRAMFS)
$(TARGET): $(INITRAMFS)
$(INITRAMFS): $(INITRAMFS_SRC_C)
$(MSG_BUILD)$(INITRAMFS)
$(VERBOSE)gcc $^ -O0 $(CC_MARCH) -Wall -W -Wextra -Werror -std=gnu99 -o $@ -Wl,-O3 -Wl,--as-needed -static
$(VERBOSE)ln -sf $(BUILD_BASE_DIR)/lib/initramfs/$(INITRAMFS) $(BUILD_BASE_DIR)/bin/
$(VERBOSE)ln -sf $(BUILD_BASE_DIR)/initramfs/$(INITRAMFS) $(BUILD_BASE_DIR)/bin/
clean_initramfs:
$(VERBOSE)rm -rf $(INITRAMFS)

View File

@@ -172,6 +172,24 @@ void Region_map_mmap::_add_to_rmap(Region const &region)
}
/*
* Tracing must be inhibited in attach/detach as RPC trace points may trigger
* attachment of trace dataspaces, which would result in nested mutex
* acquisition.
*/
namespace Genode { extern bool inhibit_tracing; }
struct Inhibit_tracing_guard
{
bool old_value = inhibit_tracing;
Inhibit_tracing_guard() { inhibit_tracing = true; }
~Inhibit_tracing_guard() { inhibit_tracing = old_value; }
};
Region_map::Local_addr Region_map_mmap::attach(Dataspace_capability ds,
size_t size, off_t offset,
bool use_local_addr,
@@ -180,6 +198,8 @@ Region_map::Local_addr Region_map_mmap::attach(Dataspace_capability ds,
{
Mutex::Guard mutex_guard(mutex());
Inhibit_tracing_guard it_guard { };
/* only support attach_at for sub RM sessions */
if (_sub_rm && !use_local_addr) {
error("Region_map_mmap::attach: attaching w/o local addr not supported");
@@ -325,6 +345,8 @@ void Region_map_mmap::detach(Region_map::Local_addr local_addr)
{
Mutex::Guard mutex_guard(mutex());
Inhibit_tracing_guard it_guard { };
/*
* Cases
*

View File

@@ -1,4 +0,0 @@
TARGET = ld-linux.lib
LIBS = ld-linux
BUILD_ARTIFACTS := ld-linux.lib.so

View File

@@ -23,6 +23,8 @@
#include <base/mutex.h>
#include <base/log.h>
#include <util/avl_tree.h>
#include <util/noncopyable.h>
@@ -36,9 +38,10 @@ namespace Genode {
addr_t _base = 0;
addr_t _last = 0;
enum {
enum
{
HEADER = sizeof(_base) + sizeof(_mutex) + sizeof(_last),
CAP_RANGE_SIZE = 4096,
CAP_RANGE_SIZE = 131072,
WORDS = (CAP_RANGE_SIZE - HEADER - sizeof(Avl_node<Cap_range>)) / sizeof(addr_t),
};
@@ -51,8 +54,8 @@ namespace Genode {
Cap_range(addr_t base) : _base(base)
{
static_assert(sizeof(*this) == CAP_RANGE_SIZE,
"Cap_range misconfigured");
//static_assert(sizeof(*this) == CAP_RANGE_SIZE,
//"Cap_range misconfigured");
for (unsigned i = 0; i < elements(); i++)
_cap_array[i] = 0;

View File

@@ -3,7 +3,8 @@
* \author Norman Feske
* \author Sebastian Sumpf
* \author Alexander Boettcher
* \date 2009-12-27
* \author Michael Müller
* \date 2022-12-13
*/
/*
@@ -35,6 +36,7 @@
#define _INCLUDE__NOVA__SYSCALL_GENERIC_H_
#include <nova/stdint.h>
#include <base/log.h>
namespace Nova {
@@ -64,6 +66,16 @@ namespace Nova {
NOVA_ASSIGN_PCI = 0xd,
NOVA_ASSIGN_GSI = 0xe,
NOVA_PD_CTRL = 0xf,
NOVA_YIELD = 0x10,
NOVA_MXINIT = 0x11,
NOVA_ALLOC_CORES= 0x12,
NOVA_CORE_ALLOC = 0x13,
NOVA_CREATE_CELL= 0x14,
NOVA_CELL_CTRL = 0x15,
NOVA_CONS_CTRL = 0x16,
NOVA_CPUID = 0x17,
NOVA_RESERVE_CPU= 0x18,
NOVA_CREATE_HAB = 0x19,
};
/**
@@ -108,6 +120,7 @@ namespace Nova {
uint64_t const size;
Type const type;
uint32_t const aux;
uint32_t const domain;
};
uint32_t const signature; /* magic value 0x41564f4e */
@@ -132,17 +145,26 @@ namespace Nova {
bool has_feature_svm() const { return feature_flags & (1 << 2); }
struct Cpu_desc {
enum Vendor
{
UNKNOWN,
INTEL,
AMD
};
uint8_t flags;
uint8_t thread;
uint8_t core;
uint8_t package;
uint8_t acpi_id;
uint8_t vendor;
uint8_t family;
uint8_t model;
uint8_t stepping:4;
uint8_t platform:3;
uint8_t reserved:1;
uint32_t patch;
uint8_t numa_id;
} __attribute__((packed));
unsigned cpu_max() const {
@@ -172,12 +194,28 @@ namespace Nova {
return desc ? desc->flags & 0x1 : false;
}
unsigned numa_nodes() const {
unsigned node_num = 1;
unsigned long nodes = 0x0;
unsigned long last_node = 0;
for (unsigned cpu = 0; cpu < cpu_max(); cpu++) {
Cpu_desc const *c = cpu_desc_of_cpu(cpu);
if (c->numa_id != last_node && !(nodes & (1<<c->numa_id))) {
node_num++;
nodes |= (1 << c->numa_id);
}
}
return node_num;
}
/**
* Map kernel cpu ids to virtual cpu ids.
*/
bool remap_cpu_ids(uint8_t *map_cpus, unsigned const boot_cpu) const {
bool remap_cpu_ids(uint8_t *map_cpus, uint8_t *cpu_numa_map, unsigned const boot_cpu) const {
unsigned const num_cpus = cpus();
unsigned cpu_i = 0;
unsigned const num_nodes = numa_nodes();
/* assign boot cpu ever the virtual cpu id 0 */
Cpu_desc const * const boot = cpu_desc_of_cpu(boot_cpu);
@@ -188,29 +226,23 @@ namespace Nova {
if (cpu_i >= num_cpus)
return true;
/* assign remaining cores and afterwards all threads to the ids */
for (uint8_t package = 0; package < 255; package++) {
for (uint8_t core = 0; core < 255; core++) {
for (uint8_t thread = 0; thread < 255; thread++) {
for (unsigned i = 0; i < cpu_max(); i++) {
if (i == boot_cpu || !is_cpu_enabled(i))
continue;
for (uint8_t node = 0; node < num_nodes; node++) {
for (unsigned i = 0; i < num_cpus; i++) {
if (i == boot_cpu || !is_cpu_enabled(i))
continue;
Cpu_desc const * const c = cpu_desc_of_cpu(i);
if (!c)
continue;
Cpu_desc const *c = cpu_desc_of_cpu(i);
if (!(c->numa_id == node))
continue;
if (!(c->package == package && c->core == core &&
c->thread == thread))
continue;
cpu_numa_map[i] = c->numa_id;
map_cpus[cpu_i++] = (uint8_t)i;
map_cpus[cpu_i++] = (uint8_t)i;
if (cpu_i >= num_cpus)
return true;
}
}
if (cpu_i >= num_cpus)
return true;
}
}
return false;
}
@@ -242,6 +274,36 @@ namespace Nova {
EC_DONATE_SC = 2U,
EC_RESCHEDULE = 3U,
EC_MIGRATE = 4U,
EC_TIME = 5U,
};
enum Sc_op {
SC_TIME_IDLE = 0,
SC_TIME_CROSS = 1,
SC_TIME_KILLED = 2,
SC_EC_TIME = 3,
};
/**
* Hpc operations
*
*/
enum Hpc_op
{
HPC_SETUP = 6U,
HPC_START = 7U,
HPC_STOP = 8U,
HPC_RESET = 9U,
HPC_READ = 10U,
};
/**
* Cell operations
*/
enum Cell_op
{
SHRINK = 0,
GROW = 1,
};
/**
@@ -249,6 +311,30 @@ namespace Nova {
*/
enum Pd_op { TRANSFER_QUOTA = 0U, PD_DEBUG = 2U };
class Gsi_flags
{
private:
uint8_t _value { 0 };
public:
enum Mode { HIGH, LOW, EDGE };
Gsi_flags() { }
Gsi_flags(Mode m)
{
switch (m) {
case HIGH: _value = 0b110; break; /* level-high */
case LOW: _value = 0b111; break; /* level-low */
case EDGE: _value = 0b100; break; /* edge-triggered */
}
}
uint8_t value() const { return _value; }
};
class Descriptor
{
@@ -508,7 +594,7 @@ namespace Nova {
public:
enum { DEFAULT_QUANTUM = 10000, DEFAULT_PRIORITY = 64 };
enum { DEFAULT_QUANTUM = 1500, DEFAULT_PRIORITY = 64 };
Qpd(mword_t quantum = DEFAULT_QUANTUM,
mword_t priority = DEFAULT_PRIORITY)
@@ -785,5 +871,13 @@ namespace Nova {
SM_SEL_EC = 0x1d, /* convention on Genode */
};
/**
* Console operations
*/
enum Cons_op
{
LOCK = 0,
UNLOCK = 1,
};
}
#endif /* _INCLUDE__NOVA__SYSCALL_GENERIC_H_ */

View File

@@ -182,6 +182,40 @@ namespace Nova {
return (uint8_t)status;
}
ALWAYS_INLINE
inline uint8_t syscall_6(Syscall s, uint8_t flags, unsigned sel,
mword_t &p1, mword_t &p2, mword_t &p3,
mword_t &p4)
{
mword_t status = eax(s, flags, sel);
asm volatile (" push %%ebp;"
" push %%ebx;"
" mov %%ecx, %%ebx;"
" mov %%esp, %%ecx;"
" mov %%edx, %%ebp;"
" call 0f;"
"0:"
" addl $(1f-0b), (%%esp);"
" mov (%%esp), %%edx;"
"sysenter;"
"1:"
" mov %%ebp, %%edx;"
" mov %%ebx, %%ecx;"
" pop %%ebx;"
" pop %%ebp;"
: "+a" (status), "+D" (p1), "+S" (p2), "+c" (p3),
"+d" (p4)
:
: "memory");
return (uint8_t)status;
}
ALWAYS_INLINE
inline uint8_t call(unsigned pt)
{
@@ -239,14 +273,51 @@ namespace Nova {
}
ALWAYS_INLINE
inline uint8_t util_time(Syscall const syscall, mword_t const cap,
uint8_t const op, unsigned long long &time)
{
mword_t time_h = 0, time_l = 0;
uint8_t res = syscall_5(syscall, op, cap, time_h, time_l);
time = (uint64_t(time_h) << 32ULL) | uint64_t(time_l);
return res;
}
ALWAYS_INLINE
inline uint8_t sc_ec_time(mword_t const cap_sc, mword_t const cap_ec,
unsigned long long &time_sc,
unsigned long long &time_ec)
{
mword_t time_h_sc = cap_ec, time_l_sc = 0;
mword_t time_h_ec = 0, time_l_ec = 0;
uint8_t res = syscall_6(NOVA_SC_CTRL, Sc_op::SC_EC_TIME, cap_sc,
time_h_sc, time_l_sc, time_h_ec,
time_l_ec);
time_sc = (uint64_t(time_h_sc) << 32ULL) | uint64_t(time_l_sc);
time_ec = (uint64_t(time_h_ec) << 32ULL) | uint64_t(time_l_ec);
return res;
}
ALWAYS_INLINE
inline uint8_t ec_ctrl(Ec_op op, mword_t ec = ~0UL, mword_t para = ~0UL,
Crd crd = 0)
{
if (op == EC_TIME)
return NOVA_INV_HYPERCALL;
return syscall_2(NOVA_EC_CTRL, op, ec, para, crd.value());
}
ALWAYS_INLINE
inline uint8_t ec_time(mword_t const ec, unsigned long long &time)
{
return util_time(NOVA_EC_CTRL, ec, Ec_op::EC_TIME, time);
}
ALWAYS_INLINE
inline uint8_t create_sc(unsigned sc, unsigned pd, unsigned ec, Qpd qpd)
{
@@ -386,23 +457,19 @@ namespace Nova {
ALWAYS_INLINE
inline uint8_t assign_gsi(mword_t sm, mword_t dev, mword_t cpu,
mword_t &msi_addr, mword_t &msi_data,
mword_t si = ~0UL)
mword_t si = ~0UL, Gsi_flags flags = Gsi_flags())
{
msi_addr = dev;
msi_data = cpu;
return syscall_5(NOVA_ASSIGN_GSI, 0, sm, msi_addr, msi_data, si);
return syscall_5(NOVA_ASSIGN_GSI, flags.value(), sm, msi_addr, msi_data, si);
}
ALWAYS_INLINE
inline uint8_t sc_ctrl(unsigned sc, unsigned long long &time, uint8_t op = 0)
inline uint8_t sc_ctrl(unsigned const sc, unsigned long long &time, uint8_t op = 0)
{
mword_t time_h = 0, time_l = 0;
uint8_t res = syscall_5(NOVA_SC_CTRL, op, sc, time_h, time_l);
time = time_h;
time = (time << 32ULL) | time_l;
return res;
return util_time(NOVA_SC_CTRL, sc, op, time);
}
}
#endif /* _INCLUDE__SPEC__32BIT__NOVA__SYSCALLS_H_ */

View File

@@ -36,6 +36,7 @@
#include <nova/stdint.h>
#include <nova/syscall-generic.h>
#include <base/trace/types.h>
#define ALWAYS_INLINE __attribute__((always_inline))
@@ -44,7 +45,7 @@ namespace Nova {
ALWAYS_INLINE
inline mword_t rdi(Syscall s, uint8_t flags, mword_t sel)
{
return sel << 8 | (flags & 0xf) << 4 | s;
return sel << 9 | (flags & 0xf) << 5 | s;
}
@@ -132,11 +133,29 @@ namespace Nova {
return (uint8_t)status;
}
ALWAYS_INLINE
inline uint8_t syscall_6(Syscall s, uint8_t flags, mword_t sel,
mword_t &p1, mword_t &p2, mword_t &p3,
mword_t &p4)
{
mword_t status = rdi(s, flags, sel);
register mword_t r8 asm ("r8") = p4;
asm volatile ("syscall"
: "+D" (status), "+S"(p1), "+d"(p2), "+a"(p3), "+r"(r8)
:
: "rcx", "r11", "memory");
p4 = r8;
return (uint8_t)status;
}
ALWAYS_INLINE
inline uint8_t call(mword_t pt)
{
return syscall_1(NOVA_CALL, 0, pt, 0);
return syscall_1(NOVA_CALL, 0, 0, pt);
}
@@ -191,14 +210,81 @@ namespace Nova {
}
ALWAYS_INLINE
inline uint8_t util_time(Syscall const syscall, mword_t const cap,
uint8_t const op, unsigned long long &time)
{
mword_t time_h = 0, time_l = 0;
uint8_t res = syscall_5(syscall, op, cap, time_h, time_l);
time = (time_h << 32ULL) | (time_l & 0xFFFFFFFFULL);
return res;
}
ALWAYS_INLINE
inline uint8_t sc_ec_time(mword_t const cap_sc, mword_t const cap_ec,
unsigned long long &time_sc,
unsigned long long &time_ec)
{
mword_t time_h_sc = cap_ec, time_l_sc = 0;
mword_t time_h_ec = 0, time_l_ec = 0;
uint8_t res = syscall_6(NOVA_SC_CTRL, Sc_op::SC_EC_TIME, cap_sc,
time_h_sc, time_l_sc, time_h_ec,
time_l_ec);
time_sc = (time_h_sc << 32ULL) | (time_l_sc & 0xFFFFFFFFULL);
time_ec = (time_h_ec << 32ULL) | (time_l_ec & 0xFFFFFFFFULL);
return res;
}
ALWAYS_INLINE
inline uint8_t ec_ctrl(Ec_op op, mword_t ec = ~0UL, mword_t para = ~0UL,
Crd crd = 0)
{
if (op == EC_TIME)
return NOVA_INV_HYPERCALL;
return syscall_2(NOVA_EC_CTRL, op, ec, para, crd.value());
}
ALWAYS_INLINE
inline uint8_t ec_time(mword_t const ec, unsigned long long &time)
{
return util_time(NOVA_EC_CTRL, ec, Ec_op::EC_TIME, time);
}
ALWAYS_INLINE
inline uint8_t hpc_ctrl(Hpc_op op, mword_t sel, mword_t type, mword_t &p1, mword_t &p2, mword_t &p3)
{
uint8_t res = syscall_6(NOVA_EC_CTRL, op, sel, type, p1, p2, p3);
return res;
}
ALWAYS_INLINE
inline uint8_t hpc_read(mword_t sel, mword_t type, mword_t &value)
{
return syscall_5(NOVA_EC_CTRL, HPC_READ, sel, type, value);
}
ALWAYS_INLINE
inline uint8_t hpc_start(mword_t sel, mword_t type)
{
return syscall_1(NOVA_EC_CTRL, HPC_START, sel, type);
}
ALWAYS_INLINE
inline uint8_t hpc_stop(mword_t sel, mword_t type)
{
return syscall_1(NOVA_EC_CTRL, HPC_STOP, sel, type);
}
ALWAYS_INLINE
inline uint8_t hpc_reset(mword_t sel, mword_t type, mword_t val)
{
return syscall_2(NOVA_EC_CTRL, HPC_RESET, sel, type, val);
}
ALWAYS_INLINE
inline uint8_t create_sc(mword_t sc, mword_t pd, mword_t ec, Qpd qpd)
{
@@ -316,13 +402,10 @@ namespace Nova {
ALWAYS_INLINE
inline uint8_t sc_ctrl(mword_t sm, unsigned long long &time, uint8_t op = 0)
inline uint8_t sc_ctrl(mword_t const sc, unsigned long long &time,
Sc_op const op)
{
mword_t time_h = 0, time_l = 0;
uint8_t res = syscall_5(NOVA_SC_CTRL, op, sm, time_h, time_l);
time = time_h;
time = (time << 32ULL) | (time_l & 0xFFFFFFFFULL);
return res;
return util_time(NOVA_SC_CTRL, sc, op, time);
}
@@ -350,11 +433,82 @@ namespace Nova {
ALWAYS_INLINE
inline uint8_t assign_gsi(mword_t sm, mword_t dev, mword_t cpu,
mword_t &msi_addr, mword_t &msi_data,
mword_t si = ~0UL)
mword_t si = ~0UL, Gsi_flags flags = Gsi_flags())
{
msi_addr = dev;
msi_data = cpu;
return syscall_5(NOVA_ASSIGN_GSI, 0, sm, msi_addr, msi_data, si);
return syscall_5(NOVA_ASSIGN_GSI, flags.value(), sm, msi_addr, msi_data, si);
}
ALWAYS_INLINE
inline uint8_t yield(bool release_core = true, bool block = true)
{
Nova::uint8_t flags = block ? release_core : 3;
return syscall_0(NOVA_YIELD, flags, 0);
}
ALWAYS_INLINE
inline uint8_t mxinit(mword_t rip, mword_t id, mword_t channel)
{
return syscall_2(NOVA_MXINIT, 0, id, rip, channel);
}
ALWAYS_INLINE
inline uint8_t alloc_cores(mword_t count, mword_t &allocated, mword_t &remainder)
{
Nova::mword_t rest = 0;
Nova::mword_t null = 0;
Nova::uint8_t res = syscall_6(NOVA_ALLOC_CORES, 0, 0, count, allocated, rest, null);
remainder = rest;
return res;
}
ALWAYS_INLINE
inline uint8_t wake_core(mword_t core)
{
return syscall_1(NOVA_RESERVE_CPU, 0, 0, core);
}
ALWAYS_INLINE
inline uint8_t core_allocation(mword_t &allocation, bool mask = false)
{
return syscall_5(NOVA_CORE_ALLOC, static_cast<Nova::uint8_t>(mask), 0, allocation, allocation);
}
ALWAYS_INLINE
inline uint8_t cpu_id(mword_t &cpuid)
{
return syscall_5(NOVA_CPUID, 0, 0, cpuid, cpuid);
}
ALWAYS_INLINE
inline uint8_t create_cell(mword_t pd, mword_t prio, mword_t mask, mword_t start, mword_t count)
{
return syscall_5(NOVA_CREATE_CELL, static_cast<Nova::uint8_t>(prio), pd, mask, start, count);
}
ALWAYS_INLINE
inline uint8_t update_cell(mword_t pd, mword_t mask, mword_t index)
{
return syscall_2(NOVA_CELL_CTRL, Cell_op::GROW, pd, mask, index);
}
ALWAYS_INLINE
inline uint8_t create_habitat(mword_t start_cpu, mword_t size)
{
return syscall_2(NOVA_CREATE_HAB, 0, 0, start_cpu, size);
}
ALWAYS_INLINE
inline uint8_t acquire_console()
{
return syscall_0(NOVA_CONS_CTRL, Nova::Cons_op::LOCK);
}
ALWAYS_INLINE
inline uint8_t release_console()
{
return syscall_0(NOVA_CONS_CTRL, Nova::Cons_op::UNLOCK);
}
}
#endif /* _INCLUDE__SPEC__64BIT__NOVA__SYSCALLS_H_ */

Some files were not shown because too many files have changed in this diff Show More