Compare commits

..

2930 Commits

Author SHA1 Message Date
Alexander Boettcher
00bad9bee5 sel4: increase resources for fb_bench
Issue #5423
2025-01-24 16:46:05 +01:00
Alexander Boettcher
ca7bcc2d80 fixup "sel4: add MSI support for x86"
Issue #5423
2025-01-24 16:46:00 +01:00
Christian Helmuth
8e0fe39248 libdrm: explicitly convert values to __u64
Prevent errors like follows.

  error: invalid cast from type ‘size_t’ {aka ‘long unsigned int’} to type ‘__u64’ {aka ‘long long unsigned int’}

Issue #5431
2025-01-24 15:39:37 +01:00
Alexander Boettcher
a376ebafa7 libc: add missing header for qemu port 2025-01-24 12:49:16 +01:00
Norman Feske
f9f874d7e4 fixup "libc: unify base types for arm_64 and riscv" (revert unintended __int64_t modification)
Fixes #5431
2025-01-24 11:50:45 +01:00
Josef Söntgen
9b61f00187 libnl: use fixed_stint.h for typedefs
Issue #5431.
2025-01-23 19:28:11 +01:00
Stefan Kalkowski
8730657e08 libusb: don't freeze when device vanishs
Instead of freezing, return corresponding libusb error code if the
USB device got disconnected. Therefore, components using the library
can continue to work otherwise.

Fix genodelabs/genode#5434
2025-01-23 16:04:09 +01:00
Stefan Kalkowski
35e0a2b144 base: add missing wakeup signal in child framework
In Child::deliver_session_cap a signal to wakeup a service after
altering its session ROM was missing when the requesting client
that does not longer exist.

Fix genodelabs/genode#5435
2025-01-23 15:48:55 +01:00
Alexander Boettcher
d12b491a5c sel4: add MSI support for x86
Fixes #5423
2025-01-23 15:45:50 +01:00
Alexander Boettcher
130efed0cb base: support specifying PCI bdf on irq creation
Required by the seL4 kernel interface for MSI creation and by another upstream
kernel.

Issue #5423
2025-01-23 15:45:34 +01:00
Benjamin Lamowski
004aaf0235 fixup; hw: always serialize rdtsc reads
Since rdtsc() provides ordered timestamps now, we should reordering of
statements by the compiler too.

Issues #5215, #5430
2025-01-23 08:37:57 +01:00
Alexander Boettcher
27c2064a3c foc: support more caps
by increasing the base-foc internal cap indices implementation from 16bit
size to 28 bit.

Issue #5406
2025-01-22 15:31:36 +01:00
Christian Helmuth
be7df4fa82 fixup "hw: always serialize rdtsc reads" (final cosmetic touches) 2025-01-22 14:41:48 +01:00
Benjamin Lamowski
6793143d31 hw: always serialize rdtsc reads
While implementing TSC calibration in #5215, the issue of properly serializing
TSC reads came up. Some learnings of the discussion were noted in #5430.

Using `cpuid` for serialization as in Trace::timestamp() is portable,
but will cause VM exits on VMX and SVM and is therefore unsuitable to
retain a roughly working calibration loop while running virtualized.
On the other hand on most AMD systems, dispatch serializing `lfence`
needs to be explicitly enabled via a non-architectural MSR.

Enable setting up dispatch serializing lfence on AMD systems and always
serialize rdtsc accesses in Hw::Tsc::rdtsc() for maximum reliability.

Issues #5215, #5430
2025-01-22 14:41:48 +01:00
Christian Helmuth
28ecbbbb71 fixup "hw: calibrate Local APIC via ACPI timer" (final cosmetic touches)
and one bug fix
2025-01-22 14:41:48 +01:00
Benjamin Lamowski
8bdddbd46a hw: calibrate Local APIC via ACPI timer
Upto now, bootstrap used the Programmable Interval Timer to set a
suitable divider and determine the frequency of the Local APIC.
The PIT is not available on recent x86_64 hardware anymore.

Move Local APIC calibration to bootstrap and use the ACPI timer as a
reference. Clean up hw's timer implementation a little and disable the
PIT in bootstrap.

Fixes #5215
2025-01-22 14:41:48 +01:00
Christian Helmuth
103d03b590 fixup "hw: calibrate TSC via ACPI timer" (final cosmetic touches) 2025-01-22 14:41:48 +01:00
Benjamin Lamowski
5def882001 hw: calibrate TSC via ACPI timer
To get the Time Stamp Counter's frequency, hw relied on a complex and
incomplete algorithm.

Since this is a one-time initialization issue, move TSC calibration to
bootstrap and implement it using the ACPI timer.

Issue #5215
2025-01-22 14:41:48 +01:00
Norman Feske
da65626cdd libc: unify base types for arm_64 and riscv
Fixes #5431
2025-01-22 10:12:55 +01:00
Norman Feske
cdbc31add8 fixup "Enable -ffreestanding by default" (libgcov, x86emu) 2025-01-22 10:12:47 +01:00
Norman Feske
b455139e8c Enable -ffreestanding by default
Fixes #5429
2025-01-21 12:30:57 +01:00
Christian Prochaska
b4f4a6db09 qt6: install the SVG image format plugin
Fixes #5427
2025-01-20 17:34:01 +01:00
Christian Prochaska
d3d901886f qt6: fix dangling pointer in QGenodeWindowSurface
Fixes #5426
2025-01-20 17:33:57 +01:00
Stefan Kalkowski
0d4d23a161 fixup "hw: implement helping of pager threads" (fix bomb) 2025-01-20 16:33:56 +01:00
Stefan Kalkowski
827401ee2d fixup "hw: implement helping of pager threads" (managed ds pf faults) 2025-01-17 14:38:09 +01:00
Christian Prochaska
fa9373cbd3 qt6: use window title as label for GUI session
Fixes #5424
2025-01-17 08:56:22 +01:00
Alexander Boettcher
bfaacb1ada fixup "base: use Dataspace_attr in io_mem _map_local(...)" - fiasco nightly failure
Issue #5406
2025-01-16 13:28:56 +01:00
Alexander Boettcher
8eae6501b7 tool: use bender hwp options also for foc and seL4
Issue #5406
2025-01-16 11:37:04 +01:00
Alexander Boettcher
e840a3f8f9 sculpt: use rom_fs for fiasco and foc
Issue #5406
2025-01-16 11:36:27 +01:00
Alexander Boettcher
7c5f879b91 squash "base: use Dataspace_attr in io_mem _map_local(...)" - rename to "base: use Map_local_result in io_mem _map_local(...)"
Issue #5406
2025-01-16 11:34:47 +01:00
Norman Feske
2b566042ad fixup "gems: ABI and depot recipe for dialog API" 2025-01-15 17:54:33 +01:00
Norman Feske
6e82520165 fixup "vm_session: use Callable for with_state" 2025-01-15 17:52:30 +01:00
Norman Feske
1677a36225 fixup "monitor/sandbox: use Callable" (more callables) 2025-01-15 17:44:29 +01:00
Norman Feske
c564013a5d vm_session: use Callable for with_state
Issue #5420
2025-01-15 16:59:19 +01:00
Norman Feske
d033e4c153 sandbox: don't use Xml_node as return value
Issue #5411
2025-01-15 16:07:59 +01:00
Norman Feske
c5e6d071e5 monitor/sandbox: use Callable
Issue #5420
2025-01-15 15:54:42 +01:00
Norman Feske
68613c8265 cpu_sampler: propagate Create_thread_error
The accounting of caps for the UTCB allocation on base-hw puts pressure
on the out-of-ram/caps handling of Create_thread_result in the CPU
sampler. This patch implements the formerly missing error handling.

Issue #5408
2025-01-15 15:13:03 +01:00
Stefan Kalkowski
67985e2ba9 hw: remove unused object pool of pager ojects
Fix genodelabs/genode#5417
2025-01-15 14:54:43 +01:00
Stefan Kalkowski
673c97b3e6 hw: sanitize kernel's signal datastructures
* Move all Kernel::Signal_* structures to kernel/signal.*
* Remove return value of kill_signal_context, which wasn't evaluated
* Remove Kernel::Signal_context::can_kill
* Remove Kernel::Signal_context::can_submit
* Remove Kernel::Signal_receiver::can_add_handler
* Turn nullptr into cxx nullptr instead of just zero
* Turn boolean values into true/false instead of one/zero
* Always add to signal FIFO also if submit counter
  cannot get increased enough

Fix genodelabs/genode#5416
2025-01-15 14:54:39 +01:00
Stefan Kalkowski
3bdfb078bf hw: implement helping of pager threads
Instead of blocking in case of exceptions and MMU faults, delegate
the faulter's scheduling context to the assigned pager thread.

Fix genodelabs/genode#5318
2025-01-15 14:54:28 +01:00
Stefan Kalkowski
84cabaf9b7 hw: move remaining pager code to pager.cc
Consolidate core's ha-specific pager code in one and the same compilation unit.

Ref genodelabs/genode#5318
2025-01-15 14:54:12 +01:00
Stefan Kalkowski
f2d91fd56a hw: pager thread per cpu
Instatiate a separate pager thread for each cpu core. Every time a pager
object gets managed by the Pager_entrypoint, assign it to the pager thread
on the same cpu core.

Ref genodelabs/genode#5318
2025-01-15 14:53:54 +01:00
Stefan Kalkowski
a5664ba5c0 hw: use enums in stack base definition
Ref genodelabs/genode#5319
2025-01-15 14:53:35 +01:00
Stefan Kalkowski
7e4decfacc hw: sanitze cpu context
* Rename Kernel::Cpu_job to Kernel::Cpu_context (alias Kernel::Cpu::Context)
* State first Cpu affinity of Cpu::Context at construction time
* Move cpu affinity argument from kernel syscall create_thread to start_thread
* Ensure that Cpu pointer is always valid

Fix genodelabs/genode#5319
2025-01-15 14:52:40 +01:00
Stefan Kalkowski
d9ca56e1ed hw: add missing six-arguments syscall for riscv
Ref genodelabs/genode#5319
2025-01-15 14:52:34 +01:00
Stefan Kalkowski
7010dbbbbb hw: generalize IPC-helping to a common mechanism
* Removes helping from Ipc_node and Thread class
* Implement helping as mechanism of Scheduler::Context

Ref genodelabs/genode#5318
2025-01-15 14:52:25 +01:00
Stefan Kalkowski
b7d3d8237b hw: ensure board_name is set as depot build
When no BOARD variable is set via the build environment,
the board_name in the platform_info ROM needs to be set either.

Ref genodelabs/genode#5360
Fix genodelabs/genode#5414
2025-01-15 14:47:07 +01:00
Norman Feske
f4c255955f fixup "base: remove base/internal/unmanaged_singleton.h" (armv6) 2025-01-15 14:32:40 +01:00
Alexander Boettcher
13abc33ec9 platform: be robust on IRQ creation failure
In case invalid IRQ numbers are used (255 on x86), the IRQ session creation
request may be denied and the platform driver is killed because of the
uncatched exception, which must be avoided.

Issue #5406
2025-01-15 12:24:45 +01:00
Alexander Boettcher
2e3e57f50a foc: increase max count for RPC caps in core
to boot Sculpt

Issue #5406
2025-01-15 08:58:10 +01:00
Alexander Boettcher
b451f4c45c foc: add support to add ACPI rsdp in platform info
which is required for UEFI boots.

Issue #5406
2025-01-15 08:58:10 +01:00
Alexander Boettcher
5e2ba4d859 acpi: be robuster on IO_MEM session denied
Issue #5406
2025-01-15 08:58:10 +01:00
Alexander Boettcher
896e652b4c platform/pc: be robust on IOMMU claiming
Issue #5406
2025-01-15 08:58:10 +01:00
Alexander Boettcher
0d641600a4 base: use Dataspace_attr in io_mem _map_local(...)
Issue #5406
2025-01-15 08:58:10 +01:00
Alexander Boettcher
42c78b946b nova: add x2apic support
Fixes #5413
2025-01-15 08:46:51 +01:00
Johannes Schlatow
2743e625f6 base-nova: allow access to IOAPIC
This allows the platform driver to control remapping of legacy
interrupts.

genodelabs/genode#5066
2025-01-15 08:41:05 +01:00
Johannes Schlatow
0ebf11f143 platform/pc: re-use init code during resume
genodelabs/genode#5066
2025-01-15 08:37:17 +01:00
Johannes Schlatow
d25a9a0e21 platform/pc: remove Env from generate() methods
This was a relic from a time where we dumped the page tables from NOVA
and therefore needed to attach the corresponding dataspaces.

genodelabs/genode#5066
2025-01-15 08:37:08 +01:00
Johannes Schlatow
e3cc8274ba platform/pc: implement IRQ remapping for Intel
genodelabs/genode#5066
2025-01-15 08:36:48 +01:00
Johannes Schlatow
c1eafc39ab platform/pc: use queued invalidation interface
genodelabs/genode#5066
2025-01-15 08:36:42 +01:00
Johannes Schlatow
a392b93187 platform/pc: move register-based invalidation
This is in preparation of implementing the queued-invalidation
interface.

genodelabs/genode#5066
2025-01-15 08:36:33 +01:00
Johannes Schlatow
de7e11c122 platform/pc: implement IOAPIC
genodelabs/genode#5066
2025-01-15 08:36:12 +01:00
Johannes Schlatow
54b036d61c platform: add IRQ remapping support
genodelabs/genode#5066
2025-01-15 08:36:03 +01:00
Johannes Schlatow
a392e258cd pci_decode: report IOAPIC devices
genodelabs/genode#5066
2025-01-15 08:35:47 +01:00
Johannes Schlatow
54153be983 acpi_drv: report IOAPIC devices
genodelabs/genode#5066
2025-01-15 08:35:15 +01:00
Johannes Schlatow
811e51a24e acpi_drv: reflect DMAR properties in report
genodelabs/genode#5066
2025-01-15 08:35:13 +01:00
Christian Prochaska
64e0c5413f qt6: add 'i18n' example
Fixes #5421
2025-01-15 08:29:48 +01:00
Norman Feske
1d315bc355 sculpt_manager: use Callable
Issue #5420
2025-01-14 17:59:44 +01:00
Norman Feske
cc7501cee7 base: add util/callable.h
Fixes #5420
2025-01-14 17:39:26 +01:00
Christian Prochaska
311c7a8cd0 qt6: add 'SvgWidgets' files
Fixes #5419
2025-01-14 16:54:12 +01:00
Norman Feske
891cc5bf5f base: remove base/internal/unmanaged_singleton.h
Fixes #5418
2025-01-14 15:21:34 +01:00
Norman Feske
19163e44b4 test-libc_fifo_pipe: adjust cap_quota
The proper accounting of caps consumed for allocation of UTCBs on
base-hw slightly increases the costs per thread.

Issue #5408
2025-01-14 14:46:39 +01:00
Norman Feske
94ece697e1 fixup "core: don't rely on Core_env in platform.cc" (base-hw: account caps for utcb) 2025-01-14 14:39:48 +01:00
Benjamin Lamowski
40b00e2bcd fixup: hw: x86_64: refactor Vm_session_component
Remove unused vCPU priority support.

Issue #5221
2025-01-14 13:37:04 +01:00
Norman Feske
bd79ee0805 fixup "hw: factor out Vmid_allocator" (fixes build for imx53_qsb_tz) 2025-01-14 11:47:40 +01:00
Benjamin Lamowski
cea5a16abb fixup: hw: x86_64: refactor Vm_session_component
Use Constrained_ram_allocator for physical memory.

Issue #5221
2025-01-14 11:39:26 +01:00
Norman Feske
142ddd4d3b libc: remove use of unmanaged_singleton
Issue #5418
2025-01-13 20:58:05 +01:00
Norman Feske
5a2b6ee101 libc: host fd alloc as part of Libc::Kernel
This avoids the need to construct the fd_alloc out of thin air using
unmanaged_singleton.

Issue #5418
2025-01-13 19:56:14 +01:00
Benjamin Lamowski
9950fecf49 hw: x86_64: refactor Vm_session_component
On x86, the `Vm_session_component` obscured the differences between SVM
and VMX.

Separate the implementations, factor out common functionality and
address a number of long-standing issues in the process:

- Allocate nested page tables from Core_ram_allocator as a more suitable
  abstraction and account for the required memory, subtract the
  necessary amount of RAM from the session's `Ram_quota` *before*
  constructing the session object, to make sure that the memory
  allocated from the `Core_ram_allocator` is available from the VMM's
  RAM quota.
- Move the allocation of Vcpu_state and Vcpu_data into the Core::Vcpu
  class and use the Core RAM Allocator to allocate memory with a known
  physical address.
- Remove the fixed number of virtual CPUs and the associated reservation
  of memory by using a Registry for a flexible amount of vCPUs.

Issue #5221
2025-01-07 17:44:30 +01:00
Benjamin Lamowski
65e78497cb hw: factor out Vmid_allocator
Move the static `Vmid_allocator` in each `Vm_session_component` into a
common header file.

Issue #5221
2025-01-07 17:04:09 +01:00
Norman Feske
9f6a6b33db os/session_policy.h: avoid use of Xml_node assign
Issue #5411
2025-01-07 11:29:45 +01:00
Norman Feske
d3f5015c3a xml_node.h: construct from Const_byte_range_ptr
This patch allows for the construction of 'Xml_node' objects from a
'Const_byte_range_ptr' argument as a safer alternative to the pair
of addr, max_len arguments.

Issue #5411
2025-01-07 11:27:24 +01:00
Norman Feske
3f8d9e5953 ldso: avoid use of Xml_node assign operator
Issue #5411
2025-01-07 11:10:45 +01:00
Christian Helmuth
2d8efcec1e tool/port/metadata: fix usage output
Variable ECHO is not set as common.inc is not included.
2025-01-07 08:23:04 +01:00
Josef Söntgen
4a2aa95099 symbols/libc: add open_memstream function 2025-01-06 16:33:02 +01:00
Norman Feske
a3c05bd793 base/thread.h: guard deref of '_logger()'
The pointer returned by '_logger()' can be a nullptr, in particular
while tracing is (temporarily) inhibited. This patch ensures that
the 'Thread::trace' accessors never operate on a nullptr.

Fixes #5410
2025-01-06 15:16:44 +01:00
Norman Feske
7fce3b0767 util/construct_at.h: ensure legit sizeof(Placeable)
If the memory for the designated object is allocated as char[sizeof(T)],
the size of 'Placeable' is expected to equal the size of T. However, in
principle, the compiler has the freedom to inflate the 'Placeable'
object. The static assertion gives us the assurance that the compiler
does not violate our assumption.
2025-01-06 14:22:43 +01:00
Norman Feske
03f18e1dfe fixup "core: don't rely on Core_env in platform.cc" (okl4) 2025-01-06 14:03:47 +01:00
Norman Feske
68f3e54738 fixup "gems: ABI and depot recipe for dialog API" (file_vault_gui, test/dialog) 2025-01-06 11:44:05 +01:00
Norman Feske
b84d6b95ae gems: ABI and depot recipe for dialog API
This exposes makes the dialog API usable for users of Goa. It turns the
former static dialog library to a shared object and accompanied symbols
file, and adds depot recipes for the library and API.

Issue #5409
2025-01-03 15:14:00 +01:00
Norman Feske
3531bfc4c7 fixup "base: split Pd_account from Pd_session" (test/rm_fault, test/resource_yield, cpu_balancer build, sequence, test/fault_detection, launchpad) 2024-12-19 11:40:00 +01:00
Norman Feske
e72915c13e nitpicker: send pointer pos to global key handler
To enable a global key handler to implement motion gestures while a
global key is held, it needs to know the current pointer position at the
time when the global key sequence starts. This is prerequisite for
the window layouter's ability to drag windows by clicking anywhere
within the window while holding a global key.

Issue #5403
2024-12-18 18:32:09 +01:00
Norman Feske
5eba0d68e0 wm: revoke curr focus if new focus is undefined
This allows the window layouter to ensure that input entered after
switching to an empty screen won't be routed to the old focused but
no longer visible window.

Issue #5390
2024-12-18 18:30:04 +01:00
Norman Feske
38d99c6dd1 nitpicker: no absolute motion without hover
This patch enforces the invariant that absolute motion events are
delivered to the hovered client only. If no client is hovered, the event
is discarded.

Otherwise, in a situation where no client is hovered (i.e., due to a
background that does not cover the entire screen) but a focus is
defined, absolute motion events would be delivered to the focused
session. From a client's perspective, when moving the pointer from the
client to emptiness, the client would observe a leave event followed by
absolute motion. This, in turn, confuses the window manager, which
expects that the receiver of an absolute motion event is hovered.

Fixes #5375
2024-12-18 18:28:19 +01:00
Norman Feske
5d2b57118d fixup "base: split Pd_account from Pd_session" (revert quota donation to core) 2024-12-18 15:29:35 +01:00
Norman Feske
6578639bb9 fixup "base: split Pd_account from Pd_session" (monitor) 2024-12-18 13:52:14 +01:00
Norman Feske
44860e89be core: remove Core_env
This patch adjusts the last remaining callers of 'core_env' and removes
the 'Core_env' interface.

- Core's RAM/cap accounts are now represented by 'Core_account'
  implementing the 'Pd_account' interface.

- The former parts of 'Core_env' are now initialized in sequence
  in 'bootstrap_component'.

- 'Core_child' has been moved to a header to reduce the code in
  'main.cc' to a bare minimum. This as a preparation for the
  plan of making 'main.cc' specific for each kernel.

Fixes #5408
2024-12-18 12:41:06 +01:00
Norman Feske
4aabe39e36 base: split Pd_account from Pd_session
Core uses an instance of 'Pd_session_component' as a representative
for RAM/cap quota accounts used whenever session resources are
donated to core's services. All other facets of 'Pd_sesson_component'
remain unused. Core's instance of 'Pd_session_component' is hosted
at 'Core_env'. Upon its construction, all unused facets of
'Pd_session_component' are initialized by dummy arguments in 'Core_env'.

To overcome the need for dummy arguments, this patch splits the
accounting part of the PD-session interface into a separate
'Pd_account' interface. This gives us the prospect of narrowing
core's current use of 'Pd_session_component' by 'Pd_account',
alleviating dead code and the need for any dummy arguments.

Issue #5408
2024-12-18 12:41:06 +01:00
Norman Feske
404e21017a core: pass ram, rm, io-ports to local services
This patch replaces the use of 'core_env()' in 'platform_services.cc' by
the function arguments 'core_ram', 'core_rm', and 'io_port_ranges'.

It also removes the 'Pd_session' argument from 'Io_port_root' and
'Irq_root' to avoid the reliance on the 'Pd_session' interface within
core,

Issue #5408
2024-12-18 12:41:06 +01:00
Norman Feske
f9e6c3aa0e core: don't rely on Core_env in platform.cc
Replace the use of the global 'core_env()' accessor by the explicit
delegation of interfaces.

- For allocating UTCBs in base-hw, 'Platform_thread' requires
  a way to allocate dataspaces ('Ram_allocator') accounted to the
  corresponding CPU session, a way to locally map the allocated
  dataspaces (core's 'Region_map'), and a way to determine the
  physical address (via 'Rpc_entrypoint') used for the initial
  UTCB mapping of main threads. Hence those interfaces must be
  passed to 'Platform_thread'.

- NOVA's pager code needs to look up 'Cpu_thread_component'
  objects using a map item as key. The lookup requires the
  'Rpc_entrypoint' that hold the 'Cpu_thread_component' objects.
  To make this 'Rpc_entrypoint' available, this patch adds
  the 'init_page_fault_handing' function.

- The 'Region_map_mmap' for Linux requires a way to look up
  'Linux_dataspace' objects for given dataspace capabilities.
  This lookup requires the 'Rpc_entrypoint' holding the dataspaces,
  which is now passed to 'platform.cc' via the new Linux-specific
  'Core_region_map::init' function.

Issue #5408
2024-12-18 12:41:06 +01:00
Sebastian Sumpf
c156c6012c dde_bsd: support microphone selection
Make preferred microphone configurable when a headset is plugged in by
introducing the 'mic_priority' attribute for the <config> node. Values
can be "internal" and "external".
2024-12-16 15:35:57 +01:00
Alexander Boettcher
3f2a867a49 intel/display: report no inuse mode on disabled connector
Fixes #5404
2024-12-12 16:30:36 +01:00
Benjamin Lamowski
7fcfa4ede5 squash "base: make Ram_allocator noncopyable" (new commit message)
Prevent erratic runtime behavior stemming from accidentally passing a
copy to a `Ram_allocator` by making the interface noncopyable.

In consequence, we had to provide an explicit copy constructor for
`Session_env` in server/nic_router, which will be reconsidered in
issue #5405.

Issue #5221
2024-12-12 13:59:26 +01:00
Benjamin Lamowski
294ba9d30a base: add create_vcpu to Vm_session interface
`Vm_session_component::create_vcpu()` is present across all supported
kernels, yet until now it was not part of the `Vm_session` interface.

Add the method to the `Vm_session` interface. This unifies calls in the
base library and is the basis to remove the need for a common base class
for separate `Vm_session` implementations for SVM and VMX on x86_64.

Issue #5221
2024-12-11 15:13:01 +01:00
Benjamin Lamowski
ccdbefd158 base: make Ram_allocator noncopyable
Prevent erratic runtime behavior stemming from accidentally passing a
copy to a `Ram_allocator` by making the interface noncopyable.

Issue #5221
2024-12-11 15:04:16 +01:00
Christian Prochaska
dd64164ed6 qt6: split port into modules
Fixes #5402
2024-12-11 12:22:00 +01:00
Stefan Kalkowski
d3002b26ac libusb: warn once and freeze when device vanishs
Instead of repeatedly printing error messages when a device is not
available anymore, print an error once and then sleep forever.
There is no dynamic behaviour with respect to device availability
implemented in the libusb yet. Instead, you can manage libusb
components externally.

Ref genodelabs/genode#5401
2024-12-11 12:20:37 +01:00
Stefan Kalkowski
ebb159d32d usb webcam: turn run-scripts into sculpt tests
Ref genodelabs/genode#5401
2024-12-11 12:20:31 +01:00
Christian Helmuth
cd6701c483 depot: update recipe hashes 2024-12-11 08:35:22 +01:00
Norman Feske
60d009e6c6 nitpicker: notify clients on any panorama change
Nitpicker used to notify GUI clients about an updated GUI info only when
the total panorama size changed. However, in situations where two
capture clients are swapped, the total size may stay the same whereas
the relation of displays to different parts of the panorama is no longer the
same. Such changes are interesting to some clients like the window layouter,
which needs to update the assignement of screens to displays.

This patch changes nitpicker so that each panorama change is reflected
to GUI clients as a mode-info update.

Issue #5390
2024-12-10 14:12:24 +01:00
Alexander Boettcher
d0522706ba nova: avoid false pager assertion
Fixes #5399
2024-12-10 14:12:24 +01:00
Christian Helmuth
7f8db06284 Complete removal of tool/sdk approach
The SDK approach introduced in #2948 was superseded by Goa.

Issue #4446
2024-12-10 14:12:24 +01:00
Norman Feske
0749f8cbdf wm: free content view IDs if decorator disappears
This patch fixes the following error message printed by the wm upon the
restart of a decorator.

  Error: freeing non-empty slab block"
  Error: ID space not empty at destruction time

Fortunately, the error is not critical as the backing store is released
along with the session.
2024-12-10 14:12:24 +01:00
Norman Feske
1ddbb3444c sculpt/nitpicker: use label for matching decorator
The 'label_suffix=" -> decorator"' rule is weaker than the
more generic 'label_prefix="runtime -> wm"' rule, to the effect that the
decorator is assigned to the "desktop" domain instead of the "decorator"
domain. Replace the 'label_prefix' by the decorator's concrete label
to resolve this ambiguity.
2024-12-10 14:12:24 +01:00
Alexander Boettcher
4da68e11b6 tool: support to set menuentry of GRUB
manually to self chosen value, by overwritting the tcl procedure
grub_menuentry, e.g.:

proc grub_menuentry { } { return "'My OS' --option_of_your_choice " }

Fix #5398
2024-12-10 14:12:24 +01:00
Christian Helmuth
5665e8059a Optional session label in audio_in/out connection 2024-12-10 14:12:24 +01:00
Norman Feske
3067a2c51d nitpicker: prevent the pointer from going nowhere
The 'size_changed' handling remained without effect when the (last)
display re-appears (e.g., back from screen blank) because
'Capture_root::bounding_box()' delivered the '_fallback_bounding_box'
in the intermediate phase where no display was present. Unfortunately,
'Capture_root::visible()' failed to apply the same logic. This patch
makes 'visible()' consistent with 'bounding_box()'. It has the
welcome effect that nitpicker remembers the pointer position during
the dark phase.

Fixes #5397
2024-12-10 14:12:24 +01:00
Christian Helmuth
1d73cf2003 Prevent false warnings in memcpy (GCC 12)
GCC 12 tree-loop-distribute-patterns generates false warnings of
-Warray-bounds, -Wstringop-overflow, or -Wstringop-overread in memcpy()
and memcpy_cpu() in static/inline cases for code that obviously prevents
its execution by invariant checking. On -O3, even more warnings are
produced.
2024-12-10 14:12:24 +01:00
Norman Feske
010847b69c decorator: fix sync-handling corner case
This patch fixes the corner case where a call of 'trigger_gui_sync'
unexpectedly did not result in the execution of '_handle_gui_sync'.
When sporadically called (w/o having installed a period sync handler)
in a time window shortly after a previous '_handle_gui_sync' that just
switched back to sporadic mode, the situation was considered as !idle.
So the 'local_submit' was skipped.

The patch fixes the issue by always issuing a 'local_submit' except when
operating in period mode. The '_gui_sync_enabled' state is now driven
only by '_handle_gui_sync' to make the intent more clear.

Fixes #5396
2024-12-10 14:12:24 +01:00
Josef Söntgen
96d9f5d317 usb: consider alternate setting in endpoint select
When constructing an Usb::Interface and implicitly corresponding
Usb::Endpoint instances only select endpoints relevant for the
given alternate setting.

The libusb has to be changed to delegate the correct alternate
setting to the constructor too.

Fix genodelabs/genode#5394
2024-12-10 14:12:24 +01:00
Alexander Boettcher
97e638a2ac intel/display: avoid mode detection in irq task
On hotplug, the C++ side of the driver now gets just notified,
without any further detection.

On the C++ side, now specific actions are scheduled explicitly, which will be
executed step by step. New appearing actions will be queued and are
not eligible to run before the former actions of the list are processed.

Fixe #5392
2024-12-10 14:12:24 +01:00
Alexander Boettcher
ba013af1a3 sculpt_manager: handle manual fb config w/o mirror
config node gracefully. If no mirror is set, ever claim one entry
as the mirrored one. Without this change, the current effect is that
the UI does not allow to merge one of the discrete modes.

Issue #5392
2024-12-10 14:11:57 +01:00
Alexander Boettcher
e520dbbb7e nova: avoid assertion during SC cleanup
Regression introduced in Issue #5314

Fixes #5391
2024-12-10 14:11:57 +01:00
Norman Feske
7928597249 doc: remove docs covered by the Genode books
Foster the Genode books as a single point of reference for Genode's
documentation. E.g., the Getting-Started section of the "Genode
Foundations" book has long obsoleted doc/getting_started.txt. This
patch also remove long orphaned texts like gsoc_2012.txt. The approach
described in the porting guide has now been replaced by the Goa SDK.

The Genode books can be downloaded at the genode.org website. Like
Genode, they are open source. All text is licensed as CC-BY-SA and
can be found at https://github.com/nfeske/genode-manual

Fixes #5393
2024-12-10 14:11:57 +01:00
Norman Feske
979aaed52b doc: merge coding_style.txt into conventions.txt
Issue #5393
2024-12-10 14:11:57 +01:00
Christian Helmuth
f2c25383af acpi_event: prevent misleading warning about PRESS_RELEASE 2024-12-10 14:11:57 +01:00
Alice Domage
e384381942 tool/run/image/uboot: provide dtb for FIT images
Our new U-BOOT for the imx8mp_iot_gate complains about the size
of the device tree being zero bytes. This is because it no longer
provides the kernel boot arguments via ATAGS, but passes them via
by injecting them in the flattened device tree..

This commit adds a minimal dtb file to the FIT image to satisfy U-BOOT.

Issue  #5354
2024-12-10 14:11:57 +01:00
Stefan Kalkowski
b529b1eac6 qemu-usb: prevent assertion by eager URB processing
Instead of directly process URBs whenever a USBPacket arrives from
the Qemu ported XHCI layer, send a local signal to the I/O handler,
which will process the requests after leaving certain sensible
code pathes like usb_packet_complete. Otherwise, it might happen
that a packet, which was still marked as being queued gets already
completed, which leads to an assertion and hang of the library.

Fix genodelabs/genode#5389
2024-12-10 14:11:57 +01:00
Benjamin Lamowski
b21c8729ea base: provide core_ram_allocator via platform_add_local_services()
This is a prerequisite to rework the allocation of core data structures
for VM sessions in hw.

Issue #5221
2024-12-10 14:11:57 +01:00
Norman Feske
d5f3cc6ec2 terminal: ignore input without valid GUI mode
This prevents the potential corner case where the terminal receives input
at a time when the window has no valid size and _text_screen_surface is
not constructed.
2024-11-27 13:37:34 +01:00
Stefan Kalkowski
4730312c1e hw: register state and backtrace when core faults
If one of core's threads is causing an MMU fault, dump the
register state and stack backtrace of the faulting stack to
aid debugging.

Fix genodelabs/genode#5387
2024-11-27 13:33:24 +01:00
Stefan Kalkowski
cc2bcee417 tool/run: create debug files for backtrace of core
When building ELF binaries of core and bootstrap for a run scenario,
also create the *.core.debug file to be able to use the tool/backtrace
utility.

Ref genodelabs/genode#5387
2024-11-27 13:33:24 +01:00
Johannes Schlatow
2c2fb6b70e tool/run: add intel_hwp config to boot_dir/hw
Fixes #5388
2024-11-27 13:33:24 +01:00
Alexander Boettcher
b50bbef303 tool: support meshcmd as AMT alternative tool
which may be used as alternative for

- AMT log grabbing, default: amtterm
- AMT power cycling, default: wsman, alternative: amttool

https://www.meshcommander.com
https://github.com/Ylianst/MeshCommander
https://www.intel.com/content/www/us/en/developer/articles/news/meshcmd-new-intel-amt-command-line-tool.html
2024-11-26 18:17:41 +01:00
Christian Prochaska
35a679d861 libc: pthread cond/rwlock improvements
- add a check to detect if a different thread has
  initialized the internal object in the meantime
- remove ENOMEM error since the 'Libc::Allocator'
  is not supposed to throw exceptions
- remove init mutex from 'pthread_condattr_init()'
  since there is no implicit initialization which
  could happen in parallel like with mutex/cond/rwlock

Issue #5386
2024-11-26 01:08:19 +01:00
Christian Prochaska
37842757ac libc: synchronize implicit pthread mutex initialization
Fixes #5386
2024-11-26 01:08:15 +01:00
Norman Feske
fa9473ce58 doc/release_notes/24-11.txt: minor style fixes 2024-11-22 18:17:24 +01:00
Christian Helmuth
873386f8a1 version: 24.11 2024-11-22 13:37:12 +01:00
Norman Feske
2b18913782 News item for version 24.11 2024-11-22 13:34:49 +01:00
Norman Feske
fb7fa915c6 Release notes for version 24.11 2024-11-22 13:34:49 +01:00
Christian Helmuth
011b44c282 depot: update recipe hashes 2024-11-20 08:58:39 +01:00
Norman Feske
a3193b919c terminal: survive malformed dynamic re-config 2024-11-20 08:58:39 +01:00
Norman Feske
798b49fcc3 vfs server: survive malformed dynamic re-config
The VFS server used to respond to any invalid config by exiting.
By disregarding such configurations instead, this patch makes the VFS
server robust against temporary malconfiguration.
2024-11-20 08:58:39 +01:00
Roman Iten
d095945d6c fs_rom: clear dataspace if lookup failed
Issue #3897
2024-11-20 08:58:39 +01:00
Norman Feske
9e4b27a829 fs_rom: use dataspace bounds for clearing
Avoid potential risk of exceeding the dataspace bounds should the stored
file size be larger than the current ds size.

Issue #3897
2024-11-20 08:58:39 +01:00
Norman Feske
4d7a5b6829 base: add Attached_dataspace::clear()
This alleviates the need (and risk) of manually parametrizing 'memset'
whenever the entire dataspace shall be cleared.

Issue #3897
2024-11-20 08:58:39 +01:00
Norman Feske
7019b795a6 tool/run: tolerate absence of load_spawn_id
Avoid backtrace in error message if load/fastboot fails at the
boot-loader stage.
2024-11-20 08:58:39 +01:00
Norman Feske
3bb894370a tool/run/load/fastboot: detect fastboot driver
Replace the unconditional sleep "until the board comes up" by the
detection of the fastboot-driver message. This shortens the total boot
time and reveals U-boots initial output, e.g., messages reporting
trouble with bringing up the fastboot driver.
2024-11-20 08:58:39 +01:00
Norman Feske
9e5e648073 tool/run/load/fastboot: case-insensitive match
The success messages of different versions of the fastboot tool
are printed in different upper/lower case. Tolerate both.

The patch also removes a few superfluous semicolons.
2024-11-20 08:58:39 +01:00
Norman Feske
14e3339ce6 base-hw: remove outdated comment 2024-11-20 08:58:39 +01:00
Benjamin Lamowski
b05b7f17f3 sculpt_manager: bump editor default quota for large fonts and 4k
When trying to open a file in the Files view with font size set to
Large on 4k screens, the editor's / `text_area`'s `view` child fails to
bump its RAM quota when the editor's default quota is too small.

To mitigate the issue, bump the editor's default quota to 80MiB.
The long-term fix would be for the editor to request more RAM from the
runtime to satisfy the `view` RAM request.

Issue #5356
Issue #5383
2024-11-20 08:58:39 +01:00
Benjamin Lamowski
f6a1956a30 sculpt_manager: bump quota boost limit for runtime_view
When using the Files view with font size set to Large, the boosted
runtime_view limit of 64MiB is still not enough for 4k screens.

Double the RAM boost limit to 128MiB.

Issue #5356
2024-11-20 08:58:39 +01:00
Josef Söntgen
59d951ed6a sculpt_manager: start fb on second CPU on Pocket
With this commit the fb driver is started on the second CPU on the
MNT Pocket Reform to decouple it from the other components started
on the first CPU during the system's boot-up and mitigates bring-up
issues with this driver that result in an often non-working display.

Issue #5378.
2024-11-20 08:58:39 +01:00
Josef Söntgen
fe008e0884 sculpt_manager: allow decoupling fb from first cpu
This commit allows for expressing the intent to start the fb driver
on a different CPU.

Issue #5378.
2024-11-20 08:58:39 +01:00
Josef Söntgen
f72fdf77ed sculpt_manager: set affinity for child
With this commit it is possible to specify the affinity for components
directly managed by Sculpt, like drivers.
2024-11-20 08:58:39 +01:00
Josef Söntgen
0f70cbd704 sculpt_manager: query affinity-space immediately 2024-11-20 08:58:39 +01:00
Norman Feske
6e2a7e979e tool/run/log/serial: be quiet by default
As the initial output of picocom is hardly ever needed, disable it by
default to reduce the log noise. Whenever needed, the output can still
be enabled by specifying the run tool's --log-serial-cmd.
2024-11-20 08:58:39 +01:00
Norman Feske
0eefe2d872 gems/vfs_font: improve glyph bb sanity check
Issue #5374
2024-11-20 08:58:39 +01:00
Norman Feske
052dd903a4 base-hw: rm C++ exception from syscall dispatcher
This patch removes the only residual C++ exception from the kernel part
of core, eliminating the risk of the kernel thread trying to enter the
kernel itself via the C++ exception-handling path. When throwing an
exception, __cxa_allocate_exception invokes the cxx_heap, which
synchronizes accesses via a Genode::Mutex. In the contention case,
the blocking of the mutex issues a syscall to pause the caller.
The patch fixes the problem by replacing the exception with a return
value.

Fixes #5382
Issue #5245
2024-11-20 08:58:39 +01:00
Stefan Kalkowski
591aadea54 lx_emul: take usb device lock before resetting it
Fix genodelabs/genode#5381
2024-11-20 08:58:39 +01:00
Alexander Boettcher
28542e66ab nova: support resume on AVX CPUs
Issue #5314
2024-11-20 08:58:39 +01:00
Stefan Kalkowski
ed2d9fef47 hw: do not flush core/kernel's page-tables
Fix genodelabs/genode#5380
2024-11-20 08:58:39 +01:00
Stefan Kalkowski
7dbc9129db hw: detach UTCB from core PD in thread destruction
Ref genodelabs/genode#5380
2024-11-20 08:58:39 +01:00
Stefan Kalkowski
9a7fe5e775 hw: implement Core_region_map::detach
Ref genodelabs/genode#5380
2024-11-20 08:56:48 +01:00
Josef Söntgen
79ab0cf98e ports: remove sub-init from vbox6 pkgs
Using a sub-init is no longer necessary and simplifies the runtime
configuration.
2024-11-20 08:56:48 +01:00
Norman Feske
dfd373fa0c depot/build: check bin against src if REBUILD=
When using the depot/build tool with the 'REBUILD=' argument as done by
the run tool's --depot-auto-update feature, the depot/build tool now
checks that an existing bin archive was indeed created via the src and
api archives present in the depot for the given version. This addresses
consistency issues when switching between different git branches that
refer to the same depot versions but with different content.

Fixes #5379
2024-11-20 08:55:49 +01:00
Norman Feske
b510394a6d depot/build_bin_archive: keep hash of ingredients
This patch records the content hashes of the src and api ingredients
used for creating a bin archive. This information allows for the
detection of possible inconsistencies between a bin archive and its
corresponding src archive within the depot.

Issue #5379
2024-11-20 08:55:49 +01:00
Norman Feske
4a5f80ddbf tool/depot/extract: annotate version with src hash
When extracting depot archives from the source tree, retain the content
hash of the extracted information along the archive in <version>.hash
file. The .hash files of src and api archives become thereby usable for
checking the consistency of bin archives with their ingredients.

Issue #5379
2024-11-20 08:55:49 +01:00
Norman Feske
7fb702a0d9 tool/run: exit gracefully if depot/create failed
With --depot-auto-update enabled, the run tool calls the depot/create
tool, which in principle may fail. In this case, print a diagnostic info
instead of a backtrace.

Issue #5379
2024-11-20 08:55:49 +01:00
Josef Söntgen
1f225b4b6f gpu/intel: use fixed aperture size for GPU service
This commit adapts the aperture splitting between the GPU multiplexer
and the display driver where the former now always tries to reserve
32 MiB of aperture space for itself instead of limiting the space
for the display driver. In case the aperture is not large enough
the display driver takes precedence and the GPU service has to make
do with remaining space. In the worst case that renders the GPU
service unusable.

Issue #5377.
2024-11-20 08:55:49 +01:00
Christian Helmuth
d104ca0561 intel/display: adapt README to current implementation 2024-11-20 08:55:49 +01:00
Alexander Boettcher
728ea95857 intel/display: improve mirror/discrete reporting
Don't try to decide based on the hardware state, in which mode a
connector is used. If a previous configuration failed, e.g. -ENOSPC,
the detection whether the mirrored framebuffer is in use may fail
and the connectors are reported wrongly as discrete.

During modeset traversal take the appropriate lock to synchronize irq and
user task, which may be de-scheduled by Linux code when invoking contrib
code.

Issue #5377
2024-11-20 08:55:49 +01:00
Alexander Boettcher
188080e15f intel/display: add i915_gem_evict_for_node
When the aperture is close to full or such fragmented, this unimplemented
function may be invoked.

Fixes #5377
2024-11-08 16:45:51 +01:00
Alexander Boettcher
6f5bcd4446 intel/display: check for mappable framebuffer
The driver code may allocate framebuffers which do not fit in the aperture.
Trying to use such framebuffer may lead to only partial visible content
on the screen and the rest either black or garbage.

Instead check for this circumstance and deny to use such framebuffers and
release them, since the user would get an unusable/hard to interpret state.
Additionally, release the vma mappings earlier in order to reduce the likelihood
of such un-mappable framebuffers.

Issue #5377
2024-11-08 16:45:48 +01:00
Josef Söntgen
7fe7ca1968 driver/wifi: provide best practices in README 2024-11-08 16:11:03 +01:00
Norman Feske
dffa32a72c menu_view: don't skip frames after idle
When updating a dialog after a prolonged idle time with no active
animatons, the next _handle_gui_sync would wrongly fast-forward
animations for all the frames passed since the last _handle_gui_sync. On
the PinePhone, this effect is clearly visible when switching between the
main section. The GUI jumps from one state to another instead of
transitioning. This patch solves the issue be resetting '_previous_sync'
when waking up from idle.

Related to issue #5347
2024-11-07 16:11:10 +01:00
Stefan Kalkowski
f886acdcc6 qemu-usb: limit control transfer to 1 sec timeout
Fix genodelabs/genode#5376
2024-11-05 14:39:10 +01:00
Christian Helmuth
0794d99eff depot: update recipe hashes 2024-11-05 13:41:07 +01:00
Norman Feske
fdd2b4edb0 sculpt: restart depot_rom on use/unuse
Large deployments (e.g., using the Falkon browser) can significantly
inflate the RAM quota of depot_rom. When switching the Sculpt storage
target (using the "Use" buttons), depot_rom is restarted. Right now,
however, it retains its (inflated) quota. It is better to reset the
quota to its initial value to free up RAM that thereby becomes usable
for a different deployment. Otherwise, the depot_rom's resources can be
deflated only by rebooting.
2024-11-05 12:03:17 +01:00
Norman Feske
8d50d320e2 nitpicker: drop superfluous abs motion events
This patch fixes focus-follows-mouse problem reported for Sculpt 24.10
when using no (operational) backdrop.

In the absence of a background, nitpicker wrongly delivered absolute
motion events to the most recently hovered client even after leaving the
client's area to a area occupied by no client. These motion events, in
turn, confused the internal consistency of the window managers
enter/leave tracking.

Fixes #5375
2024-11-05 12:03:17 +01:00
Norman Feske
ec1316e1cb gems/vfs_font: sanity-check glyph against font bb
When using the fonts_fs, the geometry of individual glyphs can change
potentially at any time, after having obtained font-global constraints
once. In particular, a glyph can exceed the bounding box of the font
cell. The VFS font utility must take safety precautions against such
violations.

Fixes #5374
2024-11-05 12:03:17 +01:00
Norman Feske
cb5eb740c0 tool/create_builddir: prepend board-specific repos
Board-specific repositories must appear before generic repositories
(i.e., gems) in 'REPOSITORIES' to select board-specific sculpt/
configuration snippets over the defaults provided by gems. When listing
the board-specific repositories last, Sculpt images for the PinePhone or
MNT Reform may wrongly include launchers and presets of the PC version.
2024-10-30 15:07:55 +01:00
Norman Feske
05fd121975 News item for Sculpt 24.10
Issue #5356
2024-10-30 14:35:00 +01:00
Christian Helmuth
30f3ef25ad depot: update recipe hashes 2024-10-30 14:02:44 +01:00
Alexander Boettcher
e9fb2d89fb sculpt: use 96M for display aperture to support 4k
Swapping a 4k monitor between discrete and mirror mode will consume
temporarily at least 32M * 2 (3840 * 2160 * 4 Bytes), so that the
default value of 64M for the aperture is insufficient in addition to
interal display on a notebook. The commit mitigates that the
i915_gem_evict_for_node unimplemented error does not trigger immediately.

Issue #5356
2024-10-30 13:43:19 +01:00
Norman Feske
7f1a6e55f3 sculpt: update README for version 24.10
Issue #5356
2024-10-30 13:43:19 +01:00
Stefan Kalkowski
cf84787c09 sculpt_image: add MNT Pocket as target board
Issue genodelabs/genode#5360.
2024-10-30 08:14:56 +01:00
Norman Feske
324245d029 sculpt: restrict un-merging of fb connectors
In setups with 3 or more displays, allow the un-merging of connectors
only for the last mirrored connector. Otherwise, the operation would
implicitely change the order of connectors because the new discrete
connector needs appear after all merged connectors.

Issue #5286
2024-10-30 08:14:56 +01:00
Josef Söntgen
2d3170124d phone_manager: ignore AP list hovered temporarily
The access-point-list hovered state prevents preseting the available
scan results, which currently can happen unintentionally. This commit
hot-wires the hover handling and thus will always show and update the
list.  New scan results are received every few seconds and it could
happen that the list changes while the user selects a network (that's
what the original implementation guards against).

Issue #5369.
2024-10-30 08:14:56 +01:00
Norman Feske
aafd03ee74 nitpicker: validate pointer pos after reconfig
Since the panorama depends on the config, nitpicker needs to re-evaluate
the validity of the pointer position after each reconfiguration. If the
pointer position is no longer visible, pick a new visible one.

Issue #5352
2024-10-30 08:14:56 +01:00
Norman Feske
baedd79f62 sculpt_manager: fb unplug, sanitize conn. model
This patch explicitly handles the unplugging of displays, avoiding the
use of stale connectors for defining the panorama. It also makes the
import of the connectors model robust against intermediate states
reported by the driver (a connector reported as connector but without
any mode), and discards the use of any information of non-present
connectors as merge info.

Issue #5286
2024-10-30 08:14:56 +01:00
Christian Prochaska
e1909da501 qt: apply a label to the QGenodeScreen Gui session
Fixes #5372
2024-10-30 08:14:56 +01:00
Norman Feske
1660dc0635 sculpt: use icons for fb swap and merge/unmerge
Issue #5286
2024-10-30 08:14:56 +01:00
Norman Feske
c9015d6076 sculpt: prevent disabling the hovered display
Issue #5370
2024-10-30 08:14:56 +01:00
Norman Feske
da6124c087 nitpicker: allow pointer move along screen edges
Issue #5352
2024-10-30 08:14:56 +01:00
Norman Feske
732f310b26 menu_view: update dialog when min w/h changes
The minimum width/height of a dialog is not specified in the dialog ROM
but in the menu_view configuration. So the regular dialog-ROM update
handling fails to captures dynamic changes of the minimum w/h. In
Sculpt, the panel would not always adjust immediately to a new screen
size.

This patch triggers a dialog update when detecting such configuration
changes (min w/h, opaqueness, background color).

Issue #5370
2024-10-30 08:14:56 +01:00
Norman Feske
9ad7111634 sculpt: let leitzentrale follow the pointer
This patch places the leitzentrale GUI always at the pointer-at display
instead of filling the entire panorama. This ensures that the complete
leitzentrale GUI is always visible.

Fixes #5370
2024-10-30 08:14:56 +01:00
Norman Feske
71a3e228ae nitpicker: report pointer pos in hover report
Issue #5370
2024-10-30 08:14:55 +01:00
Norman Feske
01c96cf537 sculpt: generate panorama config
If the fb driver is configured to use discrete displays, sculpt now
automatically generates a panorama configuration for nitpicker that
shows all displays side by side. The effective nitpicker config is
now located at config/managed/nitpicker.

The automatism takes effect only when nitpicker's <capture> node
in config/nitpicker is empty. Hence, the managed panorama can be
overridden by a manually managed panorama.

Issue #5286
2024-10-30 08:14:55 +01:00
Norman Feske
8ed87dae71 gui_fb: deliver initial mode signal if pending
This patch handles the case where a mode change happens in-between
session creation and the registration of the mode-signal handler,
which can result in a sporadic loss of response to mode changes.

Noticed while working on issue #5286.
2024-10-30 08:14:55 +01:00
Christian Helmuth
f94e0a3464 vbox6: restore initial window size of 1024x768 2024-10-30 08:14:55 +01:00
Norman Feske
45fc49b4f1 sculpt/fb/default: remove examples
With "sculpt_manager: interactive framebuffer settings", examples can be
taken from config/managed/fb instead.

Fixes #5286
2024-10-30 08:14:55 +01:00
Norman Feske
8c43f8aa33 sculpt_manager: interactive framebuffer settings
This patch add a configuration dialog in the intel_fb node of the
component graph. The dialog displays a list of present displays labeled
after their respecive connectors. A mode can be selected for each
connector when clicking on the connector entry.

In-between the entries there are two buttons. The connect button is
toggle that defines whether the two adjacent entries are mirrored.
It is enabled by default so that all new connectors participate in
the mirroring. By untoggling the last enabled connect button, the
entry below the button becomes a discrete (non-mirrored) display.

A swap button allows for changing the order of the list, which has
to effects. First, the resolution of the very first entry defines
the size for mirrored display. So be changing the order of mirrored
displays, one can pick the preferred screen size. Second, the order
of discrete displays defines the layout of the panorama from left to
right. (the panorama config is not part of this commit though)

Note that there is currently no safety net against locking oneself
out of all displays. E.g., one can make Sculpt unusable by manually
disabling each display, or by selecting modes not properly handled by
the connected monitor. In the future, we may add a confirm button with
a timeout to roll back such unfortunate settings.

Fixes #5286
2024-10-30 08:14:55 +01:00
Josef Söntgen
8d76eebf93 sculpt: add MNT Pocket Reform
Fix genodelabs/genode#5360.
2024-10-30 08:14:55 +01:00
Christian Helmuth
fa267ecbb3 vbox6: robust tracking of mouse events in VMMDev
In VirtualBox 7 and recent 6.1 versions, the VMMDev is used to report
all mouse events if guest additions are used. Therefore, the
implementation aggregates these events, notifies the guest. and passes
the state on guest request. Unfortunately, the protocol does not support
to report consecutive button press and release events that may happen
between two guest requests, which results in events getting lost.

This commit patches the contrib sources to track pending mouse-button
events and notifies the guest if further state changes are pending after
updates are delivered.

Also, mouse-wheel events (dw, dz) are now accumulated between two guest
updates.

Fixes #5333
2024-10-30 08:14:55 +01:00
Norman Feske
3ab9173b20 gui_session: window-closed state as attribute
With the change of "gui_session: provide mode info as XML", the
client-side window-close handling became dysfunct because the
window-close state got wrongly interpreted as initial window state, to
the effect that a client's initial-window size policy got applied
instead of closing the window.

This patch makes the inital state of running a windowed application
(when no window size is defined yet) clearly distiguishable from the
state after which the user closed the window. Prior this patch, both
conditions were reflected by an empty <capture/> node in the panorama.
Now, the latter condition is reported as <capture closed="yes"/>, which
alleviates the need to track the life cycle of a window at the client
size.

Issue #5353
2024-10-30 08:14:55 +01:00
Benjamin Lamowski
515bd3263f sculpt/depot: add depot user atopia
Issue #5356
2024-10-30 08:14:55 +01:00
Christian Helmuth
c609e76cec sculpt: update touchpad for 24.10
Issue #5356
2024-10-30 08:14:55 +01:00
Norman Feske
845dc80df9 sculpt/depot/falkon_web_browser: version for 24.10
Issue #5356
2024-10-30 08:14:55 +01:00
Sebastian Sumpf
b48ae5550a test/framebuffer: add 15px marker at 0x0 2024-10-30 08:14:55 +01:00
Sebastian Sumpf
db02e04d0c libdrm: move Gpu::Vram into separate namespace
Because the implemantations for Lima and Vivante are linked into a
single library we cannot have two Gpu::Vram classes in the same
namespace. In case this happens any methods using the same signature are
weak symbols and the first one found by ld will be used = undefined
behavior.

issue #5356
issue #5369
2024-10-30 08:14:55 +01:00
Norman Feske
08bf219b28 nitpicker: apply domain constraints to GUI info
If a <domain> is constrained by 'width' or 'height' attributes, clip
the capture rects of the panorama info reported to the client. So the
client observes the constraint as window size.

Issue #5356
2024-10-30 08:14:55 +01:00
Norman Feske
5e3b6ee08f terminal: fix tiling artifacts in shrinked window
When shriking the terminal window, the view must be shrinked before
shriking the pixel buffer. Otherwise, when the buffer becomes smaller
than the view, nitpicker fills the excess view area with tiled content
of the buffer, which looks funny.

Related to issue #5350
2024-10-30 08:14:54 +01:00
Christian Prochaska
8985d8200e mesa: add 'u_format_unpack_neon.c'
Issue #5356
2024-10-30 08:14:54 +01:00
Benjamin Lamowski
6715f074ff sculpt_manager: fix quota boost limit for runtime_view
Commit 75e1f1797d increased runtime_view's initial RAM quota from 4MiB
to 52MiB, but failed to adjust the boost limit. Therefore, when
addtional RAM was requested, the limit would actually be degreased to
32MiB.

Adjust the RAM boost limit to 64MiB to make the runtime_view work on 4k
screens.

Issue #5356
2024-10-30 08:14:54 +01:00
Norman Feske
f30bbb1472 nitpicker: restore Capture::Session::screen_size
Since #5352, the 'screen_size' RPC function returns a rectangle clipped
against the client's bounding box, which unfortunately prevents
screen-capturing applications from determining the actual screen size.
This patch restores the original behavior by clipping the panorama
against client-specific constraints w/o clipping against the client's
buffer size.

Fixes #5365
2024-10-30 08:14:54 +01:00
Benjamin Lamowski
7e9c1ca3ca sticks_blue_backdrop: adjust RAM quota to work in 4k
Thie sticks_blue_backdrop needs more RAM to work on a 4k display.

Adjust the RAM quota to make it work on 4k.

Issue #5356
2024-10-30 08:14:54 +01:00
Benjamin Lamowski
a25d19169b system_shell: adjust terminal RAM quota to work in 4k
A system shell that works in a small window stops working when maximized
on a 4k screen, because the terminal component runs out of RAM.

With the adjusted RAM quotas the system shell works on 4k displays.

Issue #5356
2024-10-30 08:14:54 +01:00
Benjamin Lamowski
5c75f1efa7 sculpt: adjust decorator capability quota in Leitzentrale
Following the rework of the graphics stack, the decorator inside
Leitzentrale needs more capabilities. This manifests in a log message:
```
[leitzentrale] child "decorator" requests resources: cap_quota=18
```
and the Leitzentrale contents execpt for the log window disappearing
from the display. The Leitzentrale layer can still be toggled using F12.

Increasing the decorator's capability quota appears to solve the issue.

Issue #5356
2024-10-30 08:14:54 +01:00
Norman Feske
73991e62ec nitpicker: clear capture buffer on policy change
This patch resets the pixel buffer shared with the capture client
whenever the capture policy is modified and reports the whole buffer as
affected rectangle on the next client call of 'capture_at'. It also
clips the dirty rectangles tracked via 'mark_as_dirty' against the
bounding box of the capture session to avoid the interference of
out-of-view parts of the panorama with a capture client.

Fixes #5368
2024-10-30 08:14:54 +01:00
Norman Feske
13e8013334 sculpt.run: increase nitpicker quota for resize
Increase the RAM quota of the top-level nitpicker instance to support
the flicker-free resizing of large buffers, e.g., when changing screen
resolutions. Otherwise, nitpicker warns as follows:

[init -> nitpicker] Warning: Gui (runtime -> wm -> wm -> decorator)
                    not enough RAM to preserve buffer content during resize

Issue #5356
2024-10-30 08:14:54 +01:00
Christian Helmuth
679d68d470 nitpicker: rename 'displays' report to 'panorama'
... and enable report in Sculpt's report_fs.

Issue #5352
2024-10-30 08:14:54 +01:00
Norman Feske
2d7cd1c736 nitpicker: fix stale pixels on view removal
Sometimes when removing the popup window in Sculpt's Leitzentrale, a few
residual pixels remained. This is caused by the too strict coupling of
drawing and sync handling, effectively executing the fb-sync handler
repeatedly via 'Main::mark_as_damaged' during 'refresh_view' calls.
This tight coupling has two unwelcome effects. First, the sync handling
is executed more often than needed. Second, the sync handling (and fb
flushing) happens at intermediate states when view-stack changes are
applied (like changing a view geometry).

This patch uses a local signal handler to defer the execution of the
sync code until all drawing has finished.

Issue #5347
Issue #5356
2024-10-30 08:14:54 +01:00
Norman Feske
5f4e1db576 nitpicker: fix stale pixels in request-fb mode
When nitpicker is used as nitpicker client as is the case for Sculpt's
Leitzentrale, the time to sleep was tracked wrongly. The fb sync stays
alive only if a refresh operation is actually issued.

Issue #5347
Issue #5356
2024-10-30 08:14:54 +01:00
Norman Feske
135a866ec0 sculpt_manager: avoid runtime_view cap request
This commit removes the initial dignostic message from the log. The
message is harmless because the sculpt manager upgrades the quota on
demand but its best to avoid the noise.

  child "runtime_view" requests resources: cap_quota=4

Issue #5356
2024-10-30 08:14:54 +01:00
Norman Feske
e1be17b56d init: prevent double session-upgrade forwarding
Fixes #5367
2024-10-30 08:14:54 +01:00
Christian Helmuth
986bec20a9 usb_webcam: adapt to changes in capture/GUI
Issue #5356
2024-10-30 08:14:54 +01:00
Christian Helmuth
6d78712454 tiled_wm: build test/tiled_wm in run script 2024-10-30 08:14:54 +01:00
Christian Helmuth
7961ff50a2 tiled_wm: fix dependency to util.h 2024-10-30 08:14:53 +01:00
Alexander Boettcher
5497829608 nitpicker: return OUT_OF_CAPS instead throwing
it as exception.

Issue #5242
Fix #5366
2024-10-30 08:14:53 +01:00
Josef Söntgen
b908999def sculpt/wifi/default: comment invalid network node
Provide the default wifi config in an annotated fashion. Specifying
an invalid '<network>' node leads to diagnostic messages.

Issue #5356.
2024-10-30 08:14:53 +01:00
Josef Söntgen
fe93df27d1 driver/wifi: fix invalid network check
This commit alignes the implementation to the intention of dismissing
invalid '<network>' entries. We only accept entries when they contain
a valid SSID and additionally a valid PSK if the network is protected.

Issue #5356.
2024-10-30 08:14:53 +01:00
Stefan Kalkowski
8094b1ee01 sculpt/index: refer to recent audio mixer
Instead of publishing the old audio mixer, refer to the recent
record_play_mixer providing the audio API that is used by almost
all components now.

Ref genodelabs/genode#5356
2024-10-30 08:14:53 +01:00
Christian Helmuth
8ec2d6a36b intel/display: don't report unknown state as connected
The changes "intel/display: report connectors w/o modes as off" still
need improvements to detect mode-less connectors in intermediate states.
Until then, don't report connector_status_unknown as connected with
modes.
2024-10-30 08:14:53 +01:00
Alexander Boettcher
77471cc10e intel/display: report connectors w/o modes as off
in the XML report
2024-10-30 08:14:53 +01:00
Alexander Boettcher
f3b94a3b21 intel/display: reconstruct merge capture session
also when the name in the config changes.

Issue #5356
Issue #5345
2024-10-30 08:14:53 +01:00
Alexander Boettcher
44c23ca472 intel/display: adjust width_mm/height_mm usage
On capture creation for discrete usage, use the connector values
if display mode does not provide values. For mirror capture ever
report no width_mm/height_mm.
2024-10-30 08:14:53 +01:00
Alexander Boettcher
f7689a473c intel/display: adjust reported/set xml nodes
'<connector mode_id=3 ...' becomes '<connector mode="3" ...'

'<mode mode_id="2" ... ' becomes '<mode id="2" ...'

'<mode unavailable="true" ...' becomes '<mode usable="false" ...'
2024-10-30 08:14:53 +01:00
Alexander Boettcher
71f3e5f82a intel/display: improve disrete/mirror swap support
Issue #5345
2024-10-30 08:14:53 +01:00
Alexander Boettcher
1a5f3a2210 intel/display: mirror unconfigured connectors
by default.

Issue #5356
2024-10-30 08:14:53 +01:00
Alexander Boettcher
6c2c830f66 intel/display: improve sleep/wakeup handling
Check for capture updates ever in the linux update task when it got
woken, otherwise we may miss screen updates.

Issue #5356
2024-10-30 08:14:53 +01:00
Alexander Boettcher
6a5473b478 intel/gpu: sanitize report for intel/display
Instead of forwarding the whole devices ROM of the platform driver to the
display driver, report only Intel devices and additionally adjust the
reported IOMEM size to the reduced aperture size.

Related #5207
Issue #5345
Issue #5356
2024-10-30 08:14:52 +01:00
Christian Helmuth
a0ef5b5a36 sculpt: keep runtime capture session labels
Nitpicker may use session labels for panorama configuration in capture
policies.

Issue #5352
Issue #5356
2024-10-30 08:05:33 +01:00
Johannes Schlatow
d87a235abb nic_router: fix DHCP deallocation on domain update
Commit ac42ade introduced a regression that triggered an assertion in
`Dhcp_server::free_ip()` because the DHCP allocation was not properly
removed during a domain update. The underlying issue was that
`with_dhcp_server()` silently landed in the `no_dhcp_server_fn`.

Fixes #5364
2024-10-30 08:05:33 +01:00
Stefan Kalkowski
4f084d1f9e lx_emul: unify NIC uplink binding
Fix genodelabs/genode#5361
2024-10-30 08:05:33 +01:00
Sebastian Sumpf
77d53f13ca lx_emul: handle pin controller irqs
Register Global_irq_controller as Device so interrupts get forwarded to
irqchip.c code. Otherwise, pin-controller interrupts will get lost.

Fixed #5363
Related #5356
2024-10-30 08:05:33 +01:00
Stefan Kalkowski
a148dc5cb4 genode_c_api/usb: no policy check in session create
Fix genodelabs/genode#5357
2024-10-15 14:20:22 +02:00
Alexander Boettcher
700b248749 libc: silent warning for sigaltstack
Issue #5305
2024-10-15 14:00:25 +02:00
Christian Helmuth
225adf3681 nitpicker: document 'displays' report in README
Issue #5352
2024-10-15 13:54:30 +02:00
Josef Söntgen
4084df6360 vbox6: enable RDRAND hardware instruction support
Issue #5314
2024-10-15 09:20:43 +02:00
Josef Söntgen
be70fddbb8 nic/pc: disable IRQ coalescing in R8169 driver
This commit patches the DDE Linux contrib code to remove IRQ coalescing
from the R8169 driver that for reason not yet known leads to interrupts
occurring irregularly.

Issue #5356.
2024-10-15 08:42:03 +02:00
Christian Prochaska
7cf39188ef libports: update qt6-host download URL
Issue #5325
2024-10-14 15:15:34 +02:00
Johannes Schlatow
3142554343 mesa_gears: adjust RAM quota (required for x260)
genodelabs/genode#5356
2024-10-14 15:04:19 +02:00
Christian Prochaska
56199240ec qt: destroy view to hide window
Fixes #5359
2024-10-14 14:39:44 +02:00
Christian Prochaska
7b23227e7f qt: generate expose event on resize
Fixes #5358
2024-10-14 14:39:44 +02:00
Johannes Schlatow
d68977fa12 sculpt: update goa_testbed preset
genodelabs/genode#5356
2024-10-14 14:39:44 +02:00
Josef Söntgen
bc8932e46a terminal: use initial mode for undefined size 2024-10-14 14:39:44 +02:00
Sebastian Sumpf
12fb925555 terminal: adjust cap quota to GUI stack changes 2024-10-14 14:39:44 +02:00
Josef Söntgen
686c5ac007 raw/window_layouter: add 'release_grab' action
This commit adds the 'release_grab' action to the KEY_SCREEN handling
as it is required to ungrab clients using the exclusive input mode.
2024-10-14 14:39:44 +02:00
Josef Söntgen
7760116478 linux-firmware: add QCA9377 FW (MNT Pocket Reform)
Issue #5360.
2024-10-11 14:48:01 +02:00
Josef Söntgen
95c439e758 driver/wifi: fix firmware pointer check
Issue #5360.
2024-10-11 14:47:48 +02:00
Stefan Kalkowski
5d33ea7242 driver/platform: allow access to platform info
Within the i.MX 8MP specific platform driver access to the
board name within the platform info XML is needed.

Ref issue#5360
2024-10-11 14:46:23 +02:00
Stefan Kalkowski
e344fa8c23 base-hw: export board name in platform info
We need to differentiate the board within the SoC generic
platform driver. Therefore, export its name within the
platform info ROM.

Ref issue#5360
2024-10-11 14:46:23 +02:00
Josef Söntgen
e0874baa8f driver/wifi: remove auto_connect attribute
This commit does away with controlling the join-intent via an attribute
but couples it to the existence of a '<network>' node. With this change
all '<network>' nodes within the configuration are always
unconditionally considered for joining.

Issue #5356.
2024-10-08 14:21:20 +02:00
Josef Söntgen
e4d2a4df42 driver/wifi: split hidden network scanning
This commit splits the intent to scan for a hidden network and the
actual configuration of a network itself by introducing
'<explicit_scan>' nodes. Like the '<network>' node these also feature
a 'ssid' attribute and each node is incorporated into the SCAN request
if its SSID is valid.

For more information please consult 'repos/src/driver/wifi/README'.

Issue #5356.
2024-10-08 14:20:56 +02:00
Josef Söntgen
40f2b58098 pc_wifi: use wifi_config.inc helper
Introduce helper that does away with the redundant config generation
snippets.

Issue #5356.
2024-10-08 14:20:22 +02:00
Josef Söntgen
31f9d414a3 sculpt_manager: remove invalid network node
With the recent Wifi::Manager changes setting an invalid SSID will
lead to a diagnostic warning. Since disconnecting is handled by
removing the existent '<network>' there is no reason to generate
an invalid node in the first place.

Issue #5356.
2024-10-08 14:20:21 +02:00
Josef Söntgen
0b9d3c3dcc sculpt_manager: increase wifi driver caps
This remedies the initial session upgrade on certain systems (Alder
Lake).

Issue #5356.
2024-10-08 14:20:20 +02:00
Christian Helmuth
61c9706353 depot: update recipe hashes 2024-10-08 11:30:26 +02:00
Norman Feske
c296795089 nitpicker: trigger info ds change on config update
Inform all GUI clients of a new version of the mode information whenever
the nitpicker configuration is modified. This is needed because changed
capture policies influence the panorama observable by the GUI clients.

Issue #5352
2024-10-08 09:09:25 +02:00
Christian Prochaska
57b10b9611 qt: adapt to 'Gui::Connection' interface changes
Issue #5353
2024-10-08 09:09:24 +02:00
Christian Helmuth
4a6c506f37 nitpicker: deliver press events to global key receiver
Fixes the following misbehavior: If a global key is pressed (e.g., Caps
Lock in Sculpt) and the mouse is clicked before release, the global-keys
handler receives the global-key press but no further events of the
sequence, especially *no Caps-Lock release*.

A more reasonable fix may address the "else branch" that deletes the
_input_receiver in case of mouse events without a hovered client too,
which is beyond the narrow scope of this fix.
2024-10-08 09:09:24 +02:00
Norman Feske
ca47280ce9 wm/layouter: pointer grabbing/ungrabbing
This patch implements the following policy for applications requesting
exclusive input (relative motion): The pointer is grabbed as soon as the
user clicks inside the application window. It is forcibly ungrabbed on
any window-focus change or when tapping the KEY_SCREEN. An application
can always enable (transient) exclusive input during a key sequence,
e.g., when dragging the mouse while holding the mouse button. Transient
exclusive input is revoked when releasing the last button/key.

Fixes #5355
2024-10-08 09:09:24 +02:00
Norman Feske
92227df624 nitpicker: handle Input::Session::exclusive
While the focused client has enabled exclusive input, nitpicker does
not translate relative motion to absolute motion but routes relative
motion directly to the client. Additionally, the pointer origin is
forcibly moved to a position outside the screen boundaries, making the
pointer invisible.

Issue #5355
2024-10-08 09:09:24 +02:00
Norman Feske
996d9b300c menu_view: restore horizontal cursor positioning
This is a follow-up fix for "Make util/geometry.h C++20 friendly".

Fixes #5239
Issue #5356
2024-10-08 09:09:24 +02:00
Norman Feske
75b04b38f6 Adjust RAM and cap quotas
The recent changes of the GUI stack (proper accounting of cap and RAM
resources by the window manager and nitpicker, output buffered at the
server side) require quota adjustments at various GUI-related places.

Issue #5356
2024-10-08 09:09:24 +02:00
Norman Feske
03a23ad987 gui_fb: reset input sigh when closing the session
This patch mirrors the logic already in place for the framebuffer
session.
2024-10-08 09:09:24 +02:00
Norman Feske
4dd5c6ff8a test/fb_bench: make fb mode consistent with ds
Otherwise, the fb mode may refer to a new mode when the framebuffer is
resized between the call of 'dataspace' and 'mode'.
2024-10-08 09:09:24 +02:00
Norman Feske
b1d5a5f7b8 sculpt: version 24.10 2024-10-08 09:09:24 +02:00
Norman Feske
d7830a0ce6 Add Input::Session::exclusive() interface
This interface allows a GUI client to express the intent to exclusively
observe relative motion events while locking the absolute pointer
position. This patch merely extends the interface without implementing
it.

As this change touches os/include/input/component.h, it moves the
manage/dissolve operations into the class, ensuring the call of
dissolve at destruction time.

Issue #5355
2024-10-08 09:09:24 +02:00
Norman Feske
318d641266 gui_session: provide mode info as XML
In multi-monitor scenarios, the mode is no longer a single rectangular
area but a panorama with potentially many captured rectangles. This
patch replaces the former 'mode' and 'mode_sigh' RPC by a new 'info'
ROM accessor.

Issue #5353
2024-10-08 09:09:24 +02:00
Norman Feske
d29cb0a15d Gui::Connection::buffer: fix upgrade loop
Once set to true, the 'retry' flag would never be reset to false.

Issue #5242
2024-10-08 09:09:24 +02:00
Christian Helmuth
bfce470690 app/usb_webcam: initialize libc environment
Restores debugging with LIBUSB_DEBUG=<level>.
2024-10-08 09:09:24 +02:00
Norman Feske
f324aa902b nitpicker: configurable capture policies
Capture clients used to always capture the view stack at the origin of
the coordinate system. So each capture client obtained a mirror of the
same picture. This patch allows for the placement of capture clients on
larger panorama using Genode's usual label-based policy-selection
approach. Thereby, each monitor in multi-monitor scenario can display a
different portion of the panorama.

The patch takes special care to always keep the pointer in a visible
position. The pointer cannot be moved to any area that is not captured.
Should the only capture client displaying the pointer disappear, the
pointer is warped to the center of (any) remaining capture client.

Fixes #5352
2024-10-08 09:09:24 +02:00
Norman Feske
88dc4c878f util/geometry.h: test (in)equality of rectangles
The operators == and != make the 'Rect' consistent with 'Point' and
'Area'. The patch also adds the 'Rect::clamp' method, which is generally
useful for sanitizing input.

Issue #5352
2024-10-08 09:09:24 +02:00
Christian Prochaska
7579fe5749 qt: adapt to 'Gui::Connection' interface changes
Issue #5351
2024-10-08 09:09:24 +02:00
Christian Prochaska
e528ebc374 qt: increase caps in run scripts
Issue #5340
2024-10-08 09:09:24 +02:00
Alexander Boettcher
458458b65f intel/display: support stop/wakeup protocol
Issue #5344
2024-10-08 09:09:24 +02:00
Alexander Boettcher
50cc52a091 intel/display: use one capture session per display
Fixes #5345
2024-10-08 09:09:24 +02:00
Norman Feske
e69c01aad3 framebuffer_session: add sync_source selection
The new Framebuffer::Session::sync_source RPC function allows for the
selection of a specific source of sync signals in the presence of
multiple capture clients at the GUI server.

This patch contains only the extension of the interface. The information
is not evaluated by the GUI server yet.

Issue #5347
2024-10-08 09:09:24 +02:00
Norman Feske
5b4e1915d8 framebuffer_session: accessors for buffer surfaces
This patch adds central and safe utilities for accessing the distinct
parts of the virtual framebuffer to relieve clients from pointer
calculations.

Issue #5351
2024-10-08 09:09:24 +02:00
Norman Feske
388218a3f9 os/surface.h: support windowed surface access
This patch eases the vertical organization of multiple surfaces within
one larger surface, which is the case when keeping front/back buffers
within one compounding GUI buffer.

Issue #5351
2024-10-08 09:09:23 +02:00
Norman Feske
bf064874db util/string.h: Byte_range_ptr::with_skipped_bytes
The new method provides a safe way to narrow the byte range to a
given offset.

Issue #5351
2024-10-08 09:09:23 +02:00
Norman Feske
5c20de212a base: Attached_dataspace::bytes accessor
The new bytes() accessor returns a Byte_range_pointer as an alternative
to the 'local_addr' for accessing the content of the dataspace. This
facilitates the safe practice of passing (and validating) the buffer
bounds along with the pointer.

Issue #5351
2024-10-08 09:09:23 +02:00
Norman Feske
e738162bde framebuffer_session: alpha as Mode attribute
Propagate the want of an alpha channel as attribute of Framebuffer::Mode
instead of passing this property as a separate bool argument.

This clears the way for adding useful accessors for pixel/alpha/input
surfaces to the Mode type as a subsequent step.

Issue #5351
2024-10-08 09:09:23 +02:00
Norman Feske
336d481726 os: Pixel_input8 type for input-mask access
Issue #5351
2024-10-08 09:09:23 +02:00
Norman Feske
b303fe1098 demo.run: increase nitlog RAM quota 2024-10-08 09:09:23 +02:00
Norman Feske
6522158caa gems/gui_buffer.h: atomic back-to-front blitting
This patch updates menu_view, themed_decorator, and rom_osci to use the
new frame-buffer blit operation, mitigating tearing artifacts

Issue #5350
2024-10-08 09:09:23 +02:00
Norman Feske
4565cd0143 demo/scout: use atomic panning and blitting
Issue #5350
2024-10-08 09:09:23 +02:00
Norman Feske
db2f1e542c decorator: double-buffered output
This patch ensures that the displayed pixel buffer is always consistent
by applying intermediate drawing steps on an invisible back buffer,
which is blitted to the front buffer by the GUI server.

Note that the addition of the back buffer increases the decorator's RAM
demand by 4*w*h (4 bytes per pixel) whereas w and h are the screen size.

Issue #5350
2024-10-08 09:09:23 +02:00
Norman Feske
8082aa980e framebuffer_session: atomic blitting and panning
By enhancing the Framebuffer::Session interface by the new RPC functions
'blit' and 'panning', GUI clients become able to attain tearing-free
output. Two modes of operations are supported.

1. Atomic back-to-front blitting

   GUI clients that partially update their user interface like regular
   application dialogs, can now implement double buffering by placing
   both the back buffer and front buffer within the GUI session's
   framebuffer and configuring a view that shows only the front buffer.
   The 'blit' operation allows the client to atomically flush pixels
   from the back buffer to the front buffer.

2. Atomic buffer flipping

   GUI clients that always update all pixels like a media player or
   a game can now use the 'panning' feature to atomically redirect the
   displayed pixels to a different portion of the GUI session's virtual
   frame buffer. The virtual framebuffer always contains two frames,
   the displayed one and the next one. Once the next frame is complete,
   the client changes the panning position to the portion containing
   the next frame.

Issue #5350
2024-10-08 09:09:23 +02:00
Norman Feske
0e33830d1f framebuffer_session: use Rect as refresh argument
This patch replaces basic-type arguments x, y, w, h by the 'Rect' type,
and imports the Genode namespace into the Framebuffer namespace.

Issue #5350
2024-10-08 09:09:23 +02:00
Norman Feske
e1b24d1ebd nano3d.run: increase caps for backdrop
Issue #5340
2024-10-08 09:09:23 +02:00
Norman Feske
b3ac8c5bd8 dialog: increase caps for sandboxed_runtime
With the reworked accounting of GUI-session resources, the default
of 100 caps for menu_view does not suffice.

Issue #5340
2024-10-08 09:09:23 +02:00
Sebastian Sumpf
4d559c2907 sculpt: name change imx8mq_usb_host -> imx8m_usb_host
issue #5264
2024-10-08 09:09:23 +02:00
Sebastian Sumpf
c27e25b5ca lx_emul: shmem_file.h adapt to folio changes
Everything related to compound pages is gradually removed and replaced
with folios.

issue #5264
2024-10-08 09:09:23 +02:00
Sebastian Sumpf
8530aa7540 lx_emul/start: move lx_emul_setup_arch behind kmem_cache_init
Call lx_emul_setup arch after kmem_cache_init, because
unflatten_device_tree requires 'memblock_alloc' which  does not work
when using native slub.c/memblock.c on ARM platforms.

issue #5264
2024-10-08 09:09:23 +02:00
Stefan Kalkowski
c0a0c0ae71 genode_c_api/usb: prevent invalid pointer deref
Limit the use of Reg_list::for_each that caches a next pointer
of its items to allow destruction of items in its lambda body.
Instead provide an Reg_list::apply function in addition, which
takes a condition lambda to find the matching item, and a lambda
processed on it. In most use-cases where for_each was used, only
one item was searched for. Here we can use apply now., without
the need for a cached pointer, nor too many iterations.

Fixes genodelabs/genode#5349
2024-10-08 09:09:23 +02:00
Josef Söntgen
a16ca36eb6 bsd_audio: remove unnecessary RM requirement
The explicit usage of the Rm session became obsolete with the
removal of the internal slab (see memory consumption commit).

Fixes #5348.
2024-10-08 09:09:23 +02:00
Benjamin Lamowski
66689fa799 usb_webcam: remove unneeded requirement on RM
The usb_webcam's runtime requires a Region Manager session even though
it is not needed by the application, remove it.

Fixes #5346
2024-10-08 09:09:23 +02:00
Norman Feske
fc4b026b62 nitpicker: remove periodic mode of operation
Unless nitpicker is used in 'request_framebuffer' mode, it no longer
depends on a periodic timer but merely acts as a broker between capture
clients and GUI clients. Sync signals as delivered to GUI clients are
now wired to Capture::Session::capture_at calls. So the display driver
defines the occurrence of those signals.

Note that sync signals are only delivered while a driver actively calls
'capture_at'. If a driver stops capturing, GUI clients no longer receive
any sync signal. This is a change from the previous situation where GUI
clients could depend on the periodicity of sync signals.

Issue #5347
2024-10-08 09:09:23 +02:00
Norman Feske
e69ade5299 decorator: use timer for animation timing
This patch changes the precision of the configuration's motion attribute
to a multiple of 10 ms (centi-seconds). The previous version used steps
of 20 ms. Hence, one needs to adjust existing configurations by doubling
the motion attribute values of the themed decorator.

Issue #5347
2024-10-08 09:09:23 +02:00
Norman Feske
58d20c7751 menu_view: use timer for animation timing
This patch removes the use of sync signals as time source. The animation
phase is now timed using a timer connection as tick source while sync
signals are used for scheduling the redraws.

Issue #5347
2024-10-08 09:09:23 +02:00
Norman Feske
ffcd08b5c7 backdrop,pdf_view: remove sync handling
The sync handling makes the code more complicated without a benefit.

Issue #5347
2024-10-08 09:09:22 +02:00
Norman Feske
0e55119b36 liquid_framebuffer: reset signal handlers
Apply the same rationale as commit "gui_fb: reset signal handlers when
closing fb" to the liquid framebuffer.
2024-10-08 09:09:22 +02:00
Alexander Boettcher
4554ec42da nova: make write-combined unit test more robust
- touch all memory before time measurements, to reduce lazy paging jitter
- diff of 100us between 2 memset runs are now considered a failure (before 10us)
- add refrence measurements of same region size which is not write-combined
- make the output easier parse able of write-combined test

Fixes #5342
2024-10-08 09:09:22 +02:00
Norman Feske
09461c51bd capture_session: capture stop/wakeup protocol
With this change, a client (i.e., display driver) can register
a wakeup signal handler to be notified on the arrival of new data to
capture. The signal is delivered only when the client has stopped
capturing. The client propagates this condition to the server using
the new 'capture_stopped' RPC call.

This change in principle enables a display driver to suspend its
periodic mode of operation after a few frames without capturing any
new data. As the first driver, the fb_sdl driver has been adapted to
the new protocol. This change not only eliminates the driver's CPU
load when idle, it also reduces the latency of sporadic output
because the response to such GUI updates is no longer bound by a
fixed periodic interval.

Issue #5344
2024-10-08 09:09:22 +02:00
Norman Feske
c527a4e0e4 util/dirty_rect.h: accessor for empty state
Provide an easy way to check for the absence of any dirty pixels.

Issue #5344
2024-10-08 09:09:22 +02:00
Norman Feske
2d3c2fc258 fb_sdl: move SDL event loop to dedicated thread
This patch is a preparatory step for relaxing the strictly periodic
operation of fb_sdl. With the new design, the SDL event loop can block
for events while Genode's main entrypoint stays receptive for I/O.
The main entrypoint can interact with the SDL thread by injecting
SDL user events.

The patch also replaces the full-screen clearing and update of the
SDL window by an update of the captured bounding box only. This reduces
the CPU load of fb_sdl when idle. When updating a small part of the
screen (e.g., when moving the mouse only), the load is still rather
heavy though.

Issue #5344
2024-10-08 09:09:22 +02:00
Norman Feske
3f1759a4d1 capture_session: detection of idle capture server
This patch enhances the Capture::Connection::Screen such that the
bounding box of the affected pixels can be tracked by the caller,
which can use this information to adjust its behavior to the
activity/inactivity of the capture server.

Issue #5344
2024-10-08 09:09:22 +02:00
Norman Feske
6d68d3297d capture_session: propagate physical size in mm
This patch adds the physical screen size as argument to the
Capture::Session::buffer RPC function, which allows drivers to
propagate DPI information to the GUI server. While changing the
the interface, the patch replaces the former use of C++ exceptions
by a result type. The 'Buffer_result' is handled transparently by the
Capture::Connection. The client.h code is now integrated in
connection.h.

Issue #5344
2024-10-08 09:09:22 +02:00
Josef Söntgen
6d79a44c46 sculpt_manager: adapt to Wifi::Manager changes
Issue #5341.
2024-10-08 09:09:22 +02:00
Josef Söntgen
d4e4b8bf60 driver/wifi: rework CTRL interface manager
This commit streamlines the interaction between the Wifi::Manager
and the wpa_supplicant's CTRL interface.

As user-facing changes it alters some default settings and introduces
new features:

* Every configured network now needs to explicitly have its
  'auto_connect' (to be considered an option for joining) attribute
  set to 'true' whereas this was previously the default value if the
  attribute was not set at all.

* The 'log_level' attribute is added and configures the supplicant's
  verbosity. Valid values correspond to levels used by the supplicant
  and are as follows 'excessive', 'msgdump', 'debug', 'info', 'warning'
  and 'error'. The default value is 'error' and configures the least
  amount of verbosity.

* The 'bgscan' attribute may be used to configure the way the
  supplicant performs background-scanning to steer or rather optimize
  roaming decision within the same network. The default value is set
  to 'simple:30:-70:600'. It can be disabled by specifying an empty
  value, e.g. 'bgscan=""'.

* The 'verbose_state' attribute was removed alltogether and similar
  functionality is now coverted by 'verbose' attribute.

Implementation-wise the internals changed significantly and are
outlined in the following paragraphs.

Formerly the interaction between the manager and the supplicant
was handled in an apparent way where the internal state of each
interaction was in plain sight. This made the flow cumbersome to
follow and therefor each interaction is now confined to its own
'Action' object that encapsulates the ping-pong of commands and
responses between the manager and the supplicant. All actions are
processed in an sequential way and thus there is no longer any
need to defer pending actions depending on the interal state of
the current interaction. Configuration changes as well as events
issued by the supplicant where new actions can be created are
handled in this fashion. Of note are both signal-handlers,
'_handle_cmds' and '_handle_events' respectively.

The state report, which provides the information about the current
state of connectivity to a given wireless network, was dealt with
in the same vein and its handling was spread across the manager
implementation. Again, to make it easier to follow, the generation
of the state report is now purely driven by the 'Join_state' object.
This object encapsulates the state of connectivity and is normally
updated by events issued from the supplicant (see '_handle_events').
It is also incorporated when handling command responses (see
'_handle_cmds').

Handling of timed-actions, like scan and signal quality
update requests, was done by setting a timeout at the Timer session
directly and thus only one timed-action could be pending at any time.
This excluded dealing with timed-actions like connected-scanning
and signal quality polling concurrently. This was changed and now
a One_shot_timeout is used to programm each concurrent timed-action.

For implementing the communication channel for the CTRL interface the
manager and supplicant use a shared memory buffer, the Msg_buffer.
Since the CTRL interface for Genode was implemented using C, some
shenanigans were performed to access the memory buffer. Now the
CTRL interface implementation uses C++ and only exports the functions
required by the supplicant as C. This simplifies the usage of the
Msg_buffer and allows for removing the global functions needed for
synchronizing the Msg_buffer access as those are now part of the
object itself via the 'Notify_interface'.

Fixes #5341.
2024-10-08 09:09:22 +02:00
Josef Söntgen
6b474e059c wpa_supplicant: update to version 2.11
Issue #5341.
2024-10-07 15:54:59 +02:00
Josef Söntgen
42dae6e570 lib/wifi: make errno conversion function public
The 'convert_errno_from_linux' function was already used internally to
convert the Linux errno values to the matching FreeBSD libc ones when
calling socket functions.

It will now also be used to convert the error values included in
netlink messages as those, naturally, also correspond to the Linux
ones.

Issue #5341.
2024-10-07 15:54:59 +02:00
Alexander Boettcher
e5df8da1bd vbox6: enable AES hardware instruction support
Issue #5314
2024-10-07 15:54:59 +02:00
Norman Feske
d565598489 wm: avoid initial flickering of child views
When starting testnit with the wm, the child views briefly appear at a
position relative to the top-left corner of the screen until the
top-level view has been positioned by the layouter. This patch keeps
child views invisible until their respective parent views are
positioned.
2024-10-07 15:54:59 +02:00
Alexander Boettcher
75266e467d vbox6: enable AVX support
Issue #5314
2024-10-07 15:54:59 +02:00
Alexander Boettcher
a07b5937d9 nova: handle invalid FPU guest state
Makes the kernel robust against invalid guest FPU state provided by a VMM,
e.g. our port of Vbox6.

Issue #5314
2024-10-07 15:54:59 +02:00
Alexander Boettcher
ff506b0375 vm/x86: support extended fpu state transfer
Extend Genode's vCPU FPU state and adjust all users to copy
at most FPU data they actually support.

Issue #5314
2024-10-07 15:54:59 +02:00
Norman Feske
5993fa9c7f wm: keep child views in front of their parent
When restacking a top-level view, execute the top-level restacking
before updating the child views. Otherwise, child views may wrongly
refer to the old stacking position of the top-level view.

Issue #5242
2024-10-07 15:54:59 +02:00
Norman Feske
e5437563e2 test/nitpicker: add missing refresh call
Issue #5242
2024-10-07 15:54:59 +02:00
Alexander Boettcher
b4ff720ea4 tool/run: support ipxe via UEFI boot on foc & sel4 2024-10-07 15:54:59 +02:00
Norman Feske
9cd87a8495 wm: update coding style
Use Genode namespace, indicate 'Main' members as being private,
use Session_object, remove unused '_focus_request_reporter',
use Id_space for Window_registry, replace lookup by with pattern.
2024-10-07 15:54:59 +02:00
Norman Feske
e83ace4242 decorator: fix window-stacking glitch
This is a follow-up commit to "gui_session: manage view ID at the client
side", which missed to invalidate the neighbor view of a window but
instead wrongly assigned the (now always valid) view ID 0 as neighbor.
In situations where a window disappears and re-appears (e.g., repeatedly
launching testnit in the wm.run scenario), the new window could not
always be topped.

Issue #5242
2024-10-07 15:54:59 +02:00
Alexander Boettcher
f147a1220e intel/display: make effective use of PSR
- only mark framebuffer dirty if necessary
  -> gives the hardware chance to save longer power
- remove extra timer connection on Genode component side
  -> use Linux time primitives

Issue #5339
2024-10-07 15:54:59 +02:00
Alexander Boettcher
0414e4929f intel/display: enable panel self refresh support
Fixes #5339
2024-10-07 15:54:59 +02:00
Norman Feske
3ba8ddc85c gui_session: mark RPC client methods as nodiscard
Issue #5340
2024-10-07 15:54:59 +02:00
Norman Feske
ec50c008bb wm: account session resources
With this patch, the wm accounts RAM and caps consumed on behalf of its
clients to the respective client's session quota instead of paying out
of its own pocket. This should make the wm resilient against resource
exhaustion and lowers the quota requirements.

Issue #5340
2024-10-07 15:54:59 +02:00
Norman Feske
cf507a0b86 wm: replace Rpc_object by Session_object
This will ease the tracking of session resources.

Issue #5340
2024-10-07 14:44:31 +02:00
Norman Feske
a9b2d9bdc6 gui_session: adjust session quota for wm scenarios
The current default session RAM quota of 36 KiB reflects the needs of
the nitpicker GUI server. However, in most commonly used scenarios, a
GUI client connects to nitpicker indirectly via the wm. The low value
worked so far because the wm did not account RAM and cap usage per
client so far but paid out of its own pocket and faithfully forwarded
all resource upgrades to nitpicker.

When adding resource accounting to the wm, the old default value has the
effect that a new client has to repeatedly attempt the session creation -
each time offering sligthly more session quota - until both nitpicker and
the wm are satisfied.

By roughly doubling the default to 80 KiB, a wm client immediately
succeeds with opening a GUI session without repeated attempts.
By specifying a custom 'cap_quota' amount to the 'Genode::Connection',
the Gui::Connection now donates enough caps for both the wm and
nitpicker.

Issue #5340
2024-10-07 14:44:31 +02:00
Norman Feske
034de3b1b1 base/connection.h: allow customized cap-quota arg
By default, a 'Connection' donates an amount of caps as declared in
SESSION_TYPE::CAP_QUOTA to the server at session-creation time.

In some situations, however, a client may deliberately want to donate a
larger amount. For example, when opening a GUI session at the wm, the
total amount of needed caps is the sum of those consumed by the wm plus
those consumed by nitpicker. Using this knowledge, the Gui::Connection
may specify a sufficient amount to avoid iterative session-creation
retries. The new 'Connection' constructor accommodates this use case by
accepting an explicit 'cap_quota' argument.

Issue #5340
2024-10-07 14:44:31 +02:00
Norman Feske
240b631512 nitpicker: alloc initial slab block in session
This patch saves two sliced-heap allocations per session.

Issue #5340
2024-10-07 14:44:30 +02:00
Norman Feske
e8e499ae9e nitpicker: account input and framebuffer caps
This patch deduces the caps needed for the framebuffer and input RPC
objects from the resources accounted locally within the session. It also
takes precautions for the situation where a client offers too little
resources, prompting the mid-way cancelling of the 'Session_component'
creation. With the patch, the 'ep.manage' operations are rolled back
by the corresponding 'ep.dissolve' operations.

Issue #5340
2024-10-07 14:44:30 +02:00
Norman Feske
e4af726056 nitpicker: alloc view caps only when needed
This patch moves the eager allocation of view capabilities from the
'view' and 'child_view' RPC functions to the 'view_capability' RPC
function, reducing the consumption of capabilities in all scenarios
where views don't need to be shared between GUI sessions.

Issue #5340
2024-10-07 14:44:30 +02:00
Norman Feske
61c0be82f9 mupdf.run: add missing libm 2024-10-07 14:44:30 +02:00
Alexander Boettcher
eb7aea82b8 hw/x86: prefer acpi rsdp v2 of multiboot2
over rsdp v1. The multiboot2 provided rsdp_v1 version may not contain the
xsdt pointer, but may have the very same acpi revision as the acpi rsdp v2
version of multiboot2.

Fixes #5332
2024-10-07 14:44:30 +02:00
Benjamin Lamowski
cdc45e15f1 libc: implement kqueue(2)
Fixes #5301
2024-10-07 14:44:30 +02:00
Christian Helmuth
45cee6e951 libc: support asynchronous monitor jobs
Issue #5302
2024-10-07 14:44:30 +02:00
Christian Helmuth
899893cd17 libc: remove dynamic alloc from pthread_once
Fixes #5336
2024-10-07 14:44:30 +02:00
Christian Helmuth
131f8015f1 test-pthread: pthread_once stress test
Issue #5336
2024-09-06 10:38:45 +02:00
Christian Helmuth
505cd5e338 test-pthread: prevent compiler warnings
.../repos/libports/src/test/pthread/main.cc:539:76: warning: ‘++’ expression of ‘volatile’-qualified type is deprecated [-Wvolatile]
.../repos/libports/src/test/pthread/main.cc:1104:32: warning: ‘test’ may be used uninitialized [-Wmaybe-uninitialized]
2024-09-06 10:38:45 +02:00
Norman Feske
ce4f0cdd18 gui_fb: update coding style
Avoid Genode:: prefix, indicate 'Main' members as being private.
2024-09-06 10:38:45 +02:00
Norman Feske
f650f2e91b gui_fb: reset signal handlers when closing fb
The gui_fb client may have installed a custom sync_sigh and mode_sigh.
Reset those signal handlers at the GUI server should the client
disappear. Otherwise, the GUI server (nitpicker) continues to attempt
transmitting sync signals to the no-longer existing component, spamming
the log with "Warning: invalid signal-context capability" messages.
2024-09-06 10:38:45 +02:00
Norman Feske
dd13a976af wm: alloc real view IDs locally
Don't use client-provided view IDs as IDs for the wrapped nitpicker
views. There is no 1:1 relation of IDs and physical views. So if a wm
client re-uses an ID, the physical view is expected to stay in tact.
If the corresponding view object within the wm is not destroyed, however,
its ID remains allocated, which may then conflict the ID of a new view
if the ID is reused by the client. This scenario resulted in the
following error:

  Error: Uncaught exception of type 'Genode::Id_space<Gui::View_ref>::Conflicting_id'

This patch handles the situation by keeping the allocator of physical
views (_real_view) decoupled from the client's ID allocator.

Issue #5242
2024-09-06 10:38:45 +02:00
Josef Söntgen
cc2b628d1c pc_wifi: use '___ratelimit' dummy
The generated dummy triggers sometimes on base-foc.
2024-09-06 10:38:45 +02:00
Alexander Boettcher
e2dd009256 netperf: retire signal patches and setitimer
emulation. Issue #5337 adds the required support to the libc.
2024-09-06 10:38:45 +02:00
Norman Feske
fc3bd14da0 libc: rudimentary support for SIGALRM
This patch enables basic use cases of the POSIX 'alarm' function, which
schedules the delivery of a SIGALRM signal after a specified amount of
seconds.

Issue #5337
2024-09-06 10:38:45 +02:00
Johannes Schlatow
0a178dc625 fs_query: replace Avl_tree by Dictonary
This allows checking for duplicate directory entries. This occurs when
there are overlayed file systems.

Fixes #5334
2024-09-06 10:37:41 +02:00
Christian Helmuth
30e57b9f24 depot_autopilot: let sel4 chew on 22 tests per boot 2024-09-06 10:37:40 +02:00
Josef Söntgen
9cf24c9f78 pci_decode: remove HDAUDIO quirk
With the updated driver the quirk for certain devices is no longer
necessary.

Issue #5331.
2024-09-06 10:37:40 +02:00
Josef Söntgen
3e82422d17 dde_bsd: update audio driver to OpenBSD -current (2024-08-16)
This update uses a -current (that will become 7.6 later this year)
snapshot from 2024-08-16 that includes fixes for MSI support on
AMD systems.

Fixes #5331.
2024-09-06 10:37:40 +02:00
Josef Söntgen
8b06d7ff42 dde_bsd: update audio driver to OpenBSD 7.5
The update is mostly cosmetic in nature and amongst others adds PCIIDs
for Alder Lake-N devices.

Issue #5331.
2024-09-06 10:37:40 +02:00
Josef Söntgen
b8292124b9 audio_out.run: adapt for newer systems
Increase the RAM quota of the 'acpi' driver, add priorities and
configure the 'record_play_mixer' as is necessary on some newer
systems.

Issue #5331.
2024-09-06 10:37:40 +02:00
Josef Söntgen
d7724e9d6a ports: remove vbox5_genode_usb_hid_raw run-script
Issue #5330.
2024-08-30 07:56:29 +02:00
Josef Söntgen
975b550432 ports: add vbox6 USB HID raw test
This commit replaces the current vbox5 based USB HID raw test, which
runs a Genode guest to test USB passthrough with a USB human interface
device, with one using vbox6.

Fixes #5330.
2024-08-30 07:56:19 +02:00
Josef Söntgen
e199d937e2 libc/termios: satisfy vbox6 serial-port
This commit adds support for TIOCSETA and TIOCFLUSH in a dummy fashion
that is enough to allow vbox6's serial-port implementation to print
lines to the log.

Issue #5330.
2024-08-30 07:55:46 +02:00
Johannes Schlatow
2e584f2f86 depot: add vfs tools to pkg/goa
Fixed #5335
2024-08-30 07:48:15 +02:00
Christian Prochaska
996ebbcbe8 qt5: filter out base-$(KERNEL) include path
Issue #5325
2024-08-29 15:26:07 +02:00
Christian Prochaska
d00117e7aa qt6: filter out base-$(KERNEL) include path
Issue #5325
2024-08-29 15:26:03 +02:00
Christian Helmuth
0b55d9fa88 version: 24.08 2024-08-29 14:47:42 +02:00
Norman Feske
90a4922592 News item for version 24.08 2024-08-29 14:46:52 +02:00
Norman Feske
02c8d6ab48 Release notes for version 24.08 2024-08-29 14:22:24 +02:00
Christian Helmuth
26002a5482 depot: update recipe hashes 2024-08-29 12:32:25 +02:00
Norman Feske
395c3d901c README: link to genode.discourse.group 2024-08-29 11:28:12 +02:00
Norman Feske
dd1da81898 doc: update components.txt 2024-08-28 16:14:44 +02:00
Alexander Boettcher
6dfe05b5bf intel_fb.run: start usb driver for USB-C support
Makes the driver unit testing more reliable on USB-C supported notebooks.
It may be disabled easily, if it is not required.

Issue #5313
2024-08-28 15:07:52 +02:00
Christian Prochaska
f7a4d92c2f fixup "qt5: avoid build of qt libs as target dep" (lib/mk -> src/qt5)
Issue #5325
2024-08-28 13:47:27 +02:00
Christian Prochaska
c426929979 fixup "libports: add Qt6" (lib/mk -> src/qt6)
Issue #5325
2024-08-28 13:47:04 +02:00
Christian Prochaska
7f52089eae qt5: avoid build of qt libs as target dep
Issue #5325
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
1446da8aec lx_emul: add 'wake_q_add_safe' implementation
Enable 'wake_q_add_safe' for 6.6 based Linux versions and remove it from
generated_dummies.c of affected drivers.

issue #5264
2024-08-27 15:33:32 +02:00
Alexander Boettcher
61e2c630b1 intel/display: report more connector/display info
- Physical width/height of connected display in mm
- Current mode per connector

Issue #5264
2024-08-27 15:33:32 +02:00
Josef Söntgen
0ca2fdb2de extract: replace exceptions
This commit removes the usage of exceptions and replaces them with the
Attempt utility.

Issue #5326.
2024-08-27 15:33:32 +02:00
Josef Söntgen
1e933cc490 extract: add options to operate batch-processing
This commit allows for suppressing failed extract operations by
setting the 'ignore_failures' attribute in the 'config' node.
It is intended for operating the component in batch-mode where
multiple archives need to be extracted but failing to extract
some of them can by ignored. The default value of this option
is 'false'.

It also adds the 'stop_on_failure' attribute that instructs
the component to stop processing any following archives after
it already has failed to do so. The default value of this
option is 'true' to preserve the current behavior.

Issue #5326.
2024-08-27 15:33:32 +02:00
Josef Söntgen
9b01ca3086 extract: add README
Issue #5326.
2024-08-27 15:33:32 +02:00
Alexander Boettcher
d1f1a16e89 intel/display: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Josef Söntgen
e363af476b pc_wifi: update to Linux 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
19bb265539 pc_usb_host: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Christian Helmuth
44ec8ec7db pc_nic: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
dd0140f82e pc: use linux 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
653dfed0c5 wireguard: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
189fb008b3 test/driver_time: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
056c755708 usb_net: update to 6.6.47
Issue #5264
2024-08-27 15:33:32 +02:00
Sebastian Sumpf
dbb51786fc usb_hid: update to 6.6.47
Issue #5264
2024-08-27 15:33:31 +02:00
Sebastian Sumpf
2014046f77 lxip: update to 6.6.47
Now, we schedule before unblocking the rx_task. This is done in order to
execute a potentially ready ksoftirqd before unblocking the rx_task,
which in turn may execute soft-interrupt handlers through bottom half
code leading to double lock attempts of the socket spinlock.

Issue #5264
2024-08-27 15:33:31 +02:00
Sebastian Sumpf
92b34837cb lx_emul: adjust to Linux 6.6.47
Issue #5264
2024-08-27 15:33:31 +02:00
Sebastian Sumpf
bb214af3eb virt_linux: update to 6.6.47
Issue #5264
2024-08-27 15:33:31 +02:00
Sebastian Sumpf
40009986ee dde_linux: Linux 6.6.47 port
Issue #5264
2024-08-27 15:33:31 +02:00
Sebastian Sumpf
4a7a4cfac5 dde_linux: move linux.port to legacy_linux.port
This is prerequisite for the Linux update. All dependencies relying on
the 'linux' have been adjusted to use 'legacy_linux'.

Issue #5264
2024-08-27 15:33:31 +02:00
Johannes Schlatow
3211a10573 depot: rename src/rump -> src/vfs_rump
For consistency, let's all archives of VFS plugins are prefixed with
"vfs_".

Fixed #5327
2024-08-27 15:33:31 +02:00
Johannes Schlatow
995208585b sculpt: move goa_testbed preset into pc repo
Since the preset contains mesa_gpu-intel, it is specific to the pc
platform. Other platform-specific repos (such as allwinner) may contain
their own preset with the same name. To prevent that Sculpt images use
the wrong preset due to the particular order in the build.conf, we move
the preset into the pc repo.

Fixes #5322
2024-08-27 15:33:31 +02:00
Christian Prochaska
18869199ca libports: add Qt6
Fixes #5325
2024-08-27 15:33:31 +02:00
Christian Prochaska
451ea47dd8 stdcxx: add symbols needed by Qt6 to symbol file
Fixes #5324
2024-08-27 15:29:38 +02:00
Christian Prochaska
b3bf9fc9ab libc: add _sigaction to symbol file
Fixes #5323
2024-08-27 15:29:38 +02:00
Christian Prochaska
d86d8b542f mesa: add 'lib/mk/mesa.mk' in depot recipe
Fixes #5321
2024-08-27 15:29:38 +02:00
Christian Prochaska
95d7e57d62 qt5: adapt to 'Gui::Session' interface changes
Issue #5242
2024-08-27 15:29:38 +02:00
Alexander Boettcher
b443375cde timer_accuracy: disable nova on qemu 2024-08-27 15:29:38 +02:00
Alexander Boettcher
15a69113fa run/gdb: increase RAM quota to 42M
Investigated in #5305
2024-08-27 15:29:38 +02:00
Alexander Boettcher
5537a26c25 gdb: patch sigaltstack
Avoid double allocation of alternative stack. Genode's sigaltstack variant
allocates the stack with alloc_secondary_stack. Disable the warning of
sigaltstack by using explicitly the nullptr in ss_sp.

Issue #5305
2024-08-27 15:29:38 +02:00
Christian Prochaska
730f9ea437 gdb: remove gdbserver_genode.patch
Issue #5305
2024-08-27 15:29:38 +02:00
Norman Feske
7e95d5701f os: remove os/handle_registry.h
This utility is superseded by the Id_space.

Issue #5242
Fixes #5317
2024-08-27 15:29:38 +02:00
Norman Feske
d762da8659 gui_session: allow return of View_capbility_error
This interface change gives GUI servers the freedom to allocate view
capabilities at the time of request instead of the creation time of the
view. This is useful because view capabilities are rarely needed.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
faf90f259c gui_session: rename 'view_id' to 'associate'
The view ID is specified as first argument to be consistent with 'view'
and 'child_view'.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
f98c356efd gui_session: manage view ID at the client side
This patch moves the management of view IDs from the server to the
client side. The former 'create_view' and 'create_child_view'
operations do no longer return a view ID but take a view ID as
argument. While changing those operations, this patch takes the
opportunity to allow for initial view attributes. Combined, those
changes simplify the window manager while accommodating typical
client use cases with less code.

To ease the client-side ID management, the Gui::Connection hosts
a 'view_ids' ID space for optional use. E.g., the new 'Top_level_view'
class uses this ID space for ID allocation. This class accommodates the
most typical use case of opening a single window.

The 'alloc_view_id' RPC function is no longer needed.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
805e3552fd gui_session: definition of Gui::Title
This commit allows all GUI clients and servers to talk about the same
type.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
24378ac873 gui_session: rename View_handle to View_id
The former Gui::Session::View_handle is not called Gui::View_id.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
d02a3d25d0 gui_session: replace Handle_registry by Id_space
This patch reworks the view-ID handling within the nitpicker GUI server
and the window manager. The namespace of view handles are now represented
as an Id_space. In constrast to the former "handles", which could be
invalid, IDs cannot be semantically overloaded with anything other than
an actual view reference. There is no notion of an invalid handle.
IDs are like C++ references (which cannot be a nullptr).

This change requires the code to be more explicit. E.g., the stacking of
a few at the front-most position can no longer be expressed by passing
an invalid handle as neighbor.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
4e711d4738 gui_session: split alloc_view_handle, view_handle
Express the allocation of a new view handle by a dedicated RPC function
instead of passing an invalid view handle to the existing 'view_handle'
function.

This eliminates the notion of invalid view handles at the GUI session
interface, clearing the way for managing view handles via an Id_space.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
f274ed549e gui_session: distinguish view-stacking operations
This patch eliminates the use of invalid view handles as special
Session::Command arguments. The TO_FRONT and TO_BACK operations
interpreted as invalid neighbor as top-most or back-most position.
Those corner cases are now expressed via dedicated commands. The
new stacking commands are FRONT, BACK, FRONT_OF, and BEHIND_OF.

While changing the command interface, the patch removes the OP_
prefix from the opcode values.

Issue #5242
2024-08-27 15:29:38 +02:00
Norman Feske
b0803eabdb gui_session: simplify input/framebuffer aggregate
- Rename framebuffer_session to framebuffer and
  input_session to input as those RPC interfaces are no longer
  meant to be used as stand-alone sessions.

- Host Connection::input and Connection::framebuffer as public
  members, thereby removing the use of pointers. This simplifies
  the client-sized code. E.g., '_gui.input()->pending()' becomes
  '_gui.input.pending()'.

Issue #5242
2024-08-27 15:29:37 +02:00
Norman Feske
9823b7dbd0 gui_session: remove C++ exceptions
To maintain ease of use at the client side, the OUT_OF_RAM and
OUT_OF_CAPS results are handled at the 'Gui::Connection' now.

Gui::Connection does not inherit the Gui::Session interface any longer,
which allows for the use of different result types.

Issue #5242
Issue #5245
2024-08-27 15:29:37 +02:00
Norman Feske
1c148c7984 gui_session.h: distinguish child-view creation
This patch replaces the optional parent argument of the create_view
RPC function by a dedicated create_child_view RPC function. This
is a preparatory step of removing the notion of an invalid handle
as a special case.

Issue #5242
2024-08-27 15:29:37 +02:00
Josef Söntgen
83ddc41d63 lighttpd: prevent invalid fdarray access
The fd event handling uses the fd to directly access the array slot and
expects the fds to be contiguous and capped.

Since the returned fds from our libc were much larger than expected,
because the libc itself consumes multiple fds when managing sockets,
using the fd in this manner leads to memory corruption.

This commit limits the maxfds to 63 and always allocates 1024 slots
in the fd-array.

Fixes #5320.
2024-08-27 15:29:37 +02:00
Norman Feske
3b5ea97e8f News item about new Discourse forum 2024-08-27 15:29:37 +02:00
Christian Helmuth
f3217f6ab3 qemu-usb: improve isochronous error message 2024-08-27 15:29:37 +02:00
Johannes Schlatow
32b7a91c19 vfs_tap: prevent unnoticed link state changes
Swap order of link_state() and link_state_sigh() calls in order to not
miss any link state changes.

Fixes #5316
2024-08-27 15:29:37 +02:00
Alexander Boettcher
2e92b7ae32 nova: enable FPU AVX support
Add extended FPU state detection and handling (via xsave and friends) to the
kernel, which has to store/load more FPU state (~512 -> 2k++) during context
switching of threads. Additional the referenced nova branch contains various
optimization during VM destruction and cross core IPC resource caching.

This FPU work is based upon upstream NOVA kernel and Hedron commits.

Issue #5314
Fixes #3914
2024-08-27 15:29:37 +02:00
Alexander Boettcher
79506e4494 vbox5: disable xsave
some more adjustments are needed for xsave support, but this port is scheduled
to be removed. Just disable xsave for the time being to make nightly test
happy.

Issue #5314
2024-08-27 15:29:37 +02:00
Christian Helmuth
666a66e327 pc_wifi.run: spend 2M RAM for platform driver
Issue #5264
2024-08-27 15:29:37 +02:00
Josef Söntgen
2b3a2b875b wifi: fix double free during FW loading
The commit that added firmware loading via the VFS (see #4861)
introduces a double-free bug where the memory that contains the
image is freed twice, once from the callback and once from the
work function.

As alle examined drivers call 'release_firmware' from the callback
function themselves, remove the erroneous 'kfree' call from the
work function.

Issue #5264.
2024-08-27 15:29:37 +02:00
Josef Söntgen
572d406d66 sculpt_manager: remove inactive use_11n attribute
This is a follow-up commit to #4506 where the inactive 'use_11n'
attribute was already removed.

Issue #5262.
2024-08-27 15:29:37 +02:00
Josef Söntgen
978e82e893 sculpt_manager: enable updating of wifi quality
The 'update_quality_interval' instructs the wifi driver to update
the approximated link quality to the currently connected AP every
30 seconds.

Issue #5262.
2024-08-27 15:29:37 +02:00
Josef Söntgen
bc64d53a77 driver/wifi: update the connected signal quality
This commit introduces support for querying and updating the signal
quality of the established connection to the current accesspoint.

By setting the 'update_quality_interval' to a non-zero value specified
in seconds the 'state' report will be updated to incorporate the
current signal quality. It uses the same approximation as is already
in use by the scan results.

Fixes #5262.
2024-08-27 15:29:37 +02:00
Stefan Kalkowski
672179c3b8 usb: correct order of index, value in Alt_setting
Fix genodelabs/genode#5315
2024-08-27 15:29:37 +02:00
Norman Feske
89446084f3 test/nitpicker: fix interaction in non-alpha mode
Commit "gui_session,nitpicker,testnit: update coding style" broke the
user-input handling of the test when configured w/o alpha.
2024-08-27 15:29:37 +02:00
Christian Helmuth
d40f9b712e genode_c_api: do not match HID in AUDIO devices
Now, USB audio class devices become available in Sculpt, e.g., for vbox
passthrough, and are not automatically grabbed by the usb_hid class=3
policy. In the future, interface/endpoint level policies will enable
driving the HID interface only from usb_hid while a usb_audio driver
controls the rest of the device.
2024-08-27 15:29:37 +02:00
Spencer
91e81591fe Update documentation for hello_tutorial
Bring the docs up to date with the current run definition at
https://github.com/genodelabs/genode/blob/master/repos/hello_tutorial/run/hello.run
as well as changes to the imports of
https://github.com/genodelabs/genode/blob/master/repos/hello_tutorial/src/hello/server/main.cc

Fix #5291
Fix #5292
2024-08-27 15:29:37 +02:00
Christian Helmuth
e64b07d7a4 internet_checksum.run: don't use bad trafgen seeds 2024-08-27 15:29:37 +02:00
Stefan Kalkowski
e5c0d5247e simplify interactive USB HID test metric
To circumvent recurring false-positives whenever things
in the USB drivers or its environment changes, limit
the checks to the event listener itself.
2024-08-27 15:29:36 +02:00
Norman Feske
f283c2e7b2 news.txt: Genode at FrOScon 2024 2024-08-27 15:29:36 +02:00
Martin Stein
af78376627 tresor: add readme file
Fix #5311
2024-08-27 15:29:36 +02:00
Stefan Kalkowski
a7b4add27c hw: move cpu kernel object into cpu local area
Fix genodelabs/genode#5310
2024-08-27 15:29:36 +02:00
Stefan Kalkowski
9258004cc7 hw: move stack into cpu local mem area
Ref genodelabs/genode#5310
2024-08-27 15:29:36 +02:00
Stefan Kalkowski
6afe4f79a2 base: tie quota_lim_downscale template to size_t
* Always use size_t instead of template type
* Thereby we can remove 128-bit type from all architectures in base-hw

Ref genodelabs/genode#5310
2024-08-27 15:26:51 +02:00
Stefan Kalkowski
7770285aed hw: remove duplicated definition of x86 local APIC
Ref genodelabs/genode#5310
2024-08-27 15:26:51 +02:00
Josef Söntgen
6889959f59 linux-firmware: add AX200, 9560 and T430/T530
This commit adds the firmware image for the AX200 device as found
in the Tuxedo Pulse 15 Gen1, the 9560 as found in the Starlite and
the for devices found in the T430/T530.

Fixes #5282.
2024-08-27 15:26:51 +02:00
Alexander Boettcher
99667de35b nova: limit assertions during early boot
Turn some of the current assertions into warnings/error messages and
continue boot. Print the messages as soon as core_log is initialized,
so that on live/release systems (Sculpt OS) it may be inspected later on.

Related to issue #5307
2024-08-27 15:26:51 +02:00
Alexander Boettcher
eaadc6aad6 nova: support to run on e-core only SOCs
The code to group together SMT threads of one CPU and to move P-Core to
the beginning of Genode's affinity-space, did not consider to run on
SOCs with only E-Core CPUs.

Re-structure the code to support e-Core only SOCs.

Additionally, provide a fallback mapping in case of CPU id reordering problems.
Track faulty re-mapping and delay the reporting until core_log is initialized,
so that the warnings is visible to consumers, e.g. on Sculpt OS.

Related to discussion of #5304

Fixes #5307
2024-08-27 15:26:51 +02:00
Christian Helmuth
044d8bca44 dde_linux: improve handling of IRQ masking and ack
Unmasking of a pending interrupt did not lead to immediate IRQ handler
execution in all cases.

This commit also addresses some style concerns risen during the issue
discussion.

- Replace multi-boolean IRQ state by state enum
- EOI and ACK should be same in DDE context
- Unify x86 and ARM irqchip.c
- Remove Pending_irq type
- Remove dde_irq_set_wake()

Fixes #5164
2024-08-27 15:26:51 +02:00
Alexander Boettcher
56ee01bc8c vbox6: clear screen on guest triggered blanking
An invalid bitmap is exactly once set during blanking, use this as hint
to clear the GUI content. Same as done in vbox5.

Fixes #5263
2024-08-27 15:26:51 +02:00
Sebastian Sumpf
f552b26fb9 vfs_lwip: check _pcb for null in write_ready
_pcb may be zero due to shutdown or error in Tcp_socket_dir
2024-08-27 15:26:51 +02:00
Christian Helmuth
a441bdf59a lx_emul: enable SLUB allocator (pc, virt)
The use of the Linux-internal SLUB allocator is supported by lx_emul and
drivers may now decide between the Linux implementation or our emulation
of kmem_cache. Drivers for pc and virt already use SLUB, while other
drivers still use the emulation and may be adapted step-by-step incl.
the testing on the devices.

Fixes #5236
2024-08-27 15:26:51 +02:00
Alexander Boettcher
a798f70284 libc: add limited sigaltstack support
Allocate a Genode known stack via alloc_secondary_stack and register it
as alternative stack via Signal:use_alternative_stack().

The original semantic of Posix, where the caller may choose arbitary stack
pointers is currently not possible. Warn about the fact.

Issue #5305
2024-08-27 15:26:51 +02:00
Alexander Boettcher
0c5df0036c libc: support to execute signal on separate stack
With the commit LibC signals will be executed on a separate stack and
not anymore on the kernel or user stack.

Fixes #5305
2024-08-27 15:24:20 +02:00
Christian Helmuth
992b412be2 lx_emul: silently drop KEY_FN in evdev
The Fn key on keyboards should never be reported as real scancode event,
as it is just a hardware switch that changes the reported scancodes of
other keys. The behavior of Linux hid-apple.c is wrong as it on one hand
reports different scancodes for the same hard key depending on the Fn
state but sends the Fn press and release events too. Thus from now on,
we just drop KEY_FN events for all drivers as otherwise, scancodes
generated generated by Fn+key combinations would never be single-key
events on upper layers, for example KEY_FN + KEY_F12 on the Matias Apple
keyboard clone in the fixed issue.

Fixes #5288
2024-08-27 15:24:20 +02:00
Roman Iten
110a24f650 run/sntp_client: adjust run_genode_until condition
By calling run_genode_until twice, we take into account that the boot
time on some boards might long than on others, while still verifying
that the second "set_rtc" is reported within about 1min (+10s).

Fixes #5306
2024-08-27 15:24:20 +02:00
Johannes Schlatow
86848d2868 sculpt: add debug monitor to goa testbed
This also adds policies and domains to the nic router config for gdb and
vnc.

Fixes #5293
2024-08-27 15:24:20 +02:00
Christian Helmuth
62061c5596 wg_fetchurl.run: create data file early (fix linux) 2024-08-27 15:24:20 +02:00
Christian Helmuth
c0f6d9ba7e lx_emul: cache_line_size and cpufeature on arm64
Issue #5236
2024-08-27 15:24:20 +02:00
Christian Prochaska
ae8eb37ca2 qt5: QPA plugin improvements
Fixes #5285
2024-08-27 15:24:20 +02:00
Christian Prochaska
6acfe8a41e wm: forward mode change signal to viewless clients
Fixes #5284
2024-08-27 15:24:20 +02:00
Johannes Schlatow
8ef88ae084 monitor: skip wait for terminal connection
Waiting for the terminal connection (e.g. if routed to a tcp_terminal)
can cause the monitor to get stuck in the '_handle_config' method.

Fixes #5275
2024-08-27 15:24:20 +02:00
Johannes Schlatow
5bc6c9f2d0 tcp_terminal: fix destruction of Open_socket
The socket API close() must be called within a libc context. Moreover,
the socket for listening needs to be closed as well.

Fixes #5270
2024-08-27 15:24:20 +02:00
Johannes Schlatow
7b8a2e77e4 socket_fs: invalidate fd on context destruction
This prevents accesses to `Socket_fs::Context::_fd_ready_ready()` that
caused a "__cxa_pure_virtual called" error.

Fixes #5265
2024-08-27 15:24:20 +02:00
Pirmin Duss
96ef527436 Gpio::Connection accept a session label
This allows a component to access GPIOs from different banks of
an SOC.

Issue genodelabs#5273
2024-08-27 15:24:20 +02:00
Johannes Schlatow
09c40688e1 platform/pc: remove translations after Out_of_ram
Since page tables might need to be allocated during
insert_translation(), Out_of_ram or Out_of_caps exceptions might occur.
Entries that have already been added by insert_translation() must thus be
removed once one of those exceptions occurred.

Fixes #5254
2024-08-27 15:24:20 +02:00
Norman Feske
a83d7d515d doc/challenges.txt: an overdue update 2024-08-27 15:24:20 +02:00
Norman Feske
33bcd7c02e doc/tool_chain.txt: change download URL to GitHub
Also make the description more concise, and present the download
information before the extraction step.
2024-07-02 12:00:11 +02:00
Sebastian Sumpf
190d49527c rump: add reproducible option to newvers.sh
issue #5255
2024-07-02 12:00:11 +02:00
Sebastian Sumpf
eb656bf40c libcrypto: add support for SOURCE_DATE_EPOCH
Use SOURCE_DATE_EPOCH for build date if present.

issue #5255
2024-07-02 12:00:11 +02:00
Sebastian Sumpf
cfe27e07de themed_decorator: use TAR_OPT for archive
This commit produces a consistent tar archive.

issue #5255
2024-07-02 12:00:11 +02:00
Sebastian Sumpf
458cb25d6c qt5: use TAR_OPT for archives
This commit produces consistent tar archives.

issue #5255
2024-07-02 12:00:11 +02:00
Sebastian Sumpf
ddcfe51ef5 base/global.mk: TAR_OPT
Add TAR_OPT to global.mk that defaults to user and group 1, while
setting mtime to 0 for tar archives. This can be used in components to
produce consistent (reproducible) tar archives.

issue #5255
2024-07-02 12:00:11 +02:00
Norman Feske
943dfa10e7 base/child.h: remove exceptions from process init
This patch replaces the former Child::Process and
Child::Process::Loaded_executable classes by static functions that
return failure conditions as return values.

Issue #5245
2024-07-02 12:00:11 +02:00
Norman Feske
0288cffaee Remove exceptions from 'Parent' interface
Issue #5245
2024-07-02 12:00:11 +02:00
Norman Feske
19c13877ca Replace use of 'typedef' by 'using'
Issue #5227
2024-07-02 12:00:11 +02:00
Norman Feske
361557e1f0 base-*: omit () for lambas w/o argument
Issue #5227
2024-07-02 12:00:11 +02:00
Norman Feske
a2b0553c51 base-*: use C++20 function template syntax
Issue #5227
2024-07-02 12:00:11 +02:00
Johannes Schlatow
b5c9107465 use /depot as depot directory in debug info
By using GCC's --debug-prefix-map argument, we can make sure that debug
archives always refer to source files at /depot. With this change, GDB
can be pointed to the correct source-file location by using the `set
substitute-path /depot /path/to/local/depot`.

Fixes #5260
2024-07-02 12:00:10 +02:00
Norman Feske
d44ec53cd3 core: tie Platform_thread to Platform_pd
This patch tightens the coupling of the 'Platform_thread' objects
with their corresponding 'Platform_pd' objects by specifying the
'Platform_pd' as constructor argument, keeping the relationship
as a reference (instead of a pointer), and constraining the
lifetime of 'Platform_pd' objects to the lifetime of the PD.

It thereby clears the way to simplify the thread creation since all
PD-related information (like quota budgets) are now known at the
construction time of the 'Platform_thread'.

The return value of 'Platform_thread::start' has been removed because it
is not evaluated by 'Cpu_thread_component'.

Related to #5256
2024-07-02 11:59:16 +02:00
Alexander Boettcher
c18f7c7594 timer: remove old timer infrastructure
Fixes #5138
2024-07-02 11:59:16 +02:00
Alexander Boettcher
462718bcf0 epit: move timer to imx repository
Issue #5138
2024-07-02 11:59:16 +02:00
Stefan Kalkowski
969a0583ee qemu-usb: handle smaller isochronous packets
Fix the wrong assumption about isochronous packets being always send
with maximum EP's packet size. Instead the isochronous cache now contains
a sizes array to deal with arbitrary packet sizes.

Fix genodelabs/genode#5257
2024-07-02 11:59:16 +02:00
Stefan Kalkowski
f1f2d759af libusb: re-enable timeout setting for control urbs
Fix genodelabs/genode#5259
2024-07-02 11:59:16 +02:00
Stefan Kalkowski
73b65084e2 pin_session: add missing header
Fix genodelabs/genode#5258
2024-07-02 11:59:16 +02:00
Christian Prochaska
37e0d20bf2 qt5: adaptation to 'Genode::Region_map' changes
Issue #5245
2024-07-02 11:59:16 +02:00
Norman Feske
5a6c4d6ff2 base-hw: handle cap-slab exhaust in Thread::start
This interim solution for issue #5256 solves the problem for the
thread.run script.

Issue #5256
2024-07-02 11:59:16 +02:00
Stefan Kalkowski
d9d2a7584e base-hw: remove cortex spec directories
For consistency reasons, remove the cortex_a8, cortex_a9, and cortex_a15
spec directories. Such SPEC variables do not exist since a while.
Also rename remaining translation_table.h header to page_table.h to
stay consistent with the class names inside.

Fix genodelabs/genode#5253
2024-07-02 11:59:16 +02:00
Norman Feske
0105494223 Rework Region_map interface
- Remove exceptions
- Use 'Attr' struct for attach arguments
- Let 'attach' return 'Range' instead of 'Local_addr'
- Renamed 'Region_map::State' to 'Region_map::Fault'

Issue #5245
Fixes #5070
2024-07-02 11:59:16 +02:00
Norman Feske
d866b6b053 Remove exceptions from Cpu_session interface
The 'Thread_creation_failed' error is now reflected as
'Thread::Start_result' return value. This change also removes the
use of 'Invalid_thread' within core as this exception is an alias
of Cpu_session::Thread_creation_failed.

Issue #5245
2024-07-02 11:59:16 +02:00
Martin Stein
e7f564cd3b nic_router: use C++20 function template syntax
Fix #4534
2024-06-20 13:51:26 +02:00
Martin Stein
7d576b4f15 nic_router: re-use ARP waiters for same IP address
For each packet that got stuck with an ARP-cache miss, the router used to send
one ARP request and create one ARP waiter. However, in situations where many
packets target the same IP at one destination domain and during a short period
of time, this causes unnecessary session-quota consumption and network traffic.
This issue becomes especially pressing when taking malicious source peers,
absent destination peers, and packet batching into account.

Therefore, with this commit, the router can accumulate multiple source packets
with the same destination IP at one ARP waiter. This means, that only the first
packet with an ARP-cache for a certain IP sends an ARP request and creates an
ARP waiter. For situations where the ARP request is not answered, this
essentially rate-limits ARP requests for one IP at one destination domain
according to the lifetime of ARP waiters (default: 10s)

Ref #4534
2024-06-20 13:50:55 +02:00
Martin Stein
31a438edf6 nic_router: prevent ARP request without ARP waiter
The router used to send an ARP request for a packet before allocating the
corresponding ARP waiter. If the ARP waiter could not be allocated due to
resource exhaustion plus emergency free failed, the packet got dropped and the
router had produced unnecessary network traffic. The commit fixes this by
sending only after successful allocation.

Ref #4534
2024-06-20 13:49:53 +02:00
Martin Stein
682dedb2e1 nic_router: lower packet-batch count to 50
The previous default packet-batch count of 150 (<config
max_packets_per_signal>) was choosen with the only goal of preventing
starvation by huge amounts of packets from one session.

However, there is something else to keep in mind. A packet that is found to
require ARP sends an ARP request and becomes blocked after having consumed
resources. This means, that, in the worst case, the router used to send 150 ARP
requests and consume resources 150 times before making it even possible for the
outer world to react and cause resources to be freed.

With this additional scenario in mind, the default batch size should be
significantly lower.

Ref #4534
2024-06-20 13:49:24 +02:00
Stefan Kalkowski
e93f5fe8e0 base-hw: move imx53-specifics to imx repository
Ref genodelabs/genode#5252
2024-06-20 13:25:06 +02:00
Stefan Kalkowski
0c8abf9b50 os: move imx sd_card driver to imx repository
Ref genodelabs/genode#5252
2024-06-20 13:24:44 +02:00
Stefan Kalkowski
d1123ebe4c os: move imx8q_evk's i2c driver to imx repo
Ref genodelabs/genode#5252
2024-06-20 13:24:44 +02:00
Stefan Kalkowski
86386548c0 os: move synaptics_dsx touch driver to imx repo
Ref genodelabs/genode#5252
2024-06-20 13:24:44 +02:00
Stefan Kalkowski
6162eae9e0 os: move tz_vmm example to imx repository
Ref genodelabs/genode#5252
2024-06-20 13:24:44 +02:00
Stefan Kalkowski
5a8d149fe3 hw: move all imx7d specifics to imx repository
Ref genodelabs/genode#5252
2024-06-20 13:24:41 +02:00
Alexander Boettcher
ed522d51c8 linux: use new timer scheme
Issue #5138
2024-06-20 13:19:43 +02:00
Alexander Boettcher
32c5ef32e9 foc: use new timer scheme
Issue #5138
2024-06-20 13:19:43 +02:00
Norman Feske
299951ced5 depot: update recipe hashes 2024-06-20 12:59:00 +02:00
Christian Helmuth
65957e024d Transfer 2x16 MiB in wg_fetchurl test 2024-06-20 12:56:20 +02:00
Stefan Kalkowski
f0e9ce7422 stdcxx: add missing symbol for std::basic_fstream 2024-06-20 12:56:20 +02:00
Benjamin Lamowski
e153f44ce8 libc: handle invalid file descriptors in poll()
poll(2) needs to handle invalid file descriptors in the pollfd struct,
specifically -1 as it may be used to disable entries in the fds[] array.

Fix a possible nullptr dereference by checking the File_descriptor
pointer returned by find_by_libc_fd() for validity and skip processing
of any unresolved FDs, effectively implementing standard POSIX
semantics.

Fixes #5249
2024-06-20 12:56:20 +02:00
Christian Helmuth
9d42890fbf fetchurl: remove Genode:: prefixing 2024-06-20 12:56:20 +02:00
Christian Helmuth
258c06df03 virt/lx_emul: init boot_cpu_data on x86
Values are used by arch/x86/lib/delay.c and slub allocator.

Issue #5236
2024-06-20 12:56:20 +02:00
Norman Feske
14d3c4cb5e Remove Cpu_session::State_access_failed exception
This patch removes the exception formerly thrown by 'Cpu_thread::state'
and turns the 'Thread_state' structure into a plain compound type w/o a
constructor.

Issue #5245
Fixes #5250
2024-06-20 12:56:20 +02:00
Johannes Schlatow
16b863fc6e tool/run: use xmlcatalog for xsd file paths
With libxml2 >= 2.13, the `-path` argument can no longer be used for
setting search paths for xsd files. Instead, we use an XML catalog to
replace genode:// URIs with absolute paths.

Fixes #5248
2024-06-20 12:56:20 +02:00
Norman Feske
5181d08d05 Remove exceptions from Rm_session interface
Issue #5245
2024-06-20 12:56:20 +02:00
Norman Feske
0d7d60a1f4 Remove exceptions from Pd_session interface
This patch replaces exceptions of the PD session RPC interface with
result types.
The change of the quota-transfer RPC functions required the adaptation
of base/quota_transfer.h and base/child.h.
The 'alloc_signal_source' method has been renamed to 'signal_source'
to avoid an exceedingly long name of the corresponding result type.
The Pd_session::map function takes a 'Virt_range' instead of basic-type
arguments.
The 'Signal_source_capability' alias for 'Capability<Signal_source>' has
been removed.

Issue #5245
2024-06-20 12:56:19 +02:00
Alexander Boettcher
08066269ba fiasco: update to new timer scheme
Issue #5138
2024-06-20 12:56:19 +02:00
Martin Stein
a450110b97 run/nic_router_uplinks: use test component
So far, this test used dynamic_rom for the re-configuration of the nic router
and tested for the expected ping results by inspecting the log with the run
tool. However, this approach had two issues:

* Timing differs significantly on different targets and so the dynamic_rom had
  the difficult task of compensating with heuristics without bloating the test
  duration too much.

* In case of a failing test, it was difficult to determine the cause as the
  test kept running and produced output for quite some time and there was also
  no specific error message but only a generic timeout.

These two issues are now fixed by introducing a test component that listens to
the ping-result report and manages the nic router configuration. The new
component exits early on failure and provides information on the error
circumstances. Furthermore, the component advances to the next test step only
after having seen the expected result of the active test step and thereby
removes the need for heuristics about target timing.

Fixes #5192
2024-06-20 12:56:19 +02:00
Martin Stein
a935a733ab ping: support reporting results
This feature simplifies automated testing. It was added to enable the creation
of the test/nic_router_uplink component.

Ref #5192
2024-06-20 12:56:19 +02:00
Norman Feske
24342db476 base/signal.h: remove pointers from API
This patch updates the signal API to avoid raw pointers, and
replaces the Context_already_in_use and Context_not_associated
exceptions by diagnostic messages.

Fixes #5247
2024-06-20 12:56:19 +02:00
Norman Feske
dcddeccccc app/acpi_event: update coding style
Remove exceptions, replace pointer lookup by with_ pattern,
use Xml_node::attribute_value, constness, naming of signal handlers

Issue #5245
2024-06-20 12:56:19 +02:00
Norman Feske
8a0689d832 Remove Pd_session::Invalid_signal_source exception
While changing 'Pd_session::alloc_context', this patch also tightens the
type of the imprint argument.

Issue #5245
2024-06-20 12:56:19 +02:00
Norman Feske
a52c2ce141 Remove exceptions from TRACE session interface
- Use attempt pattern for error handling
- Replace lookup of pointers by with_ pattern
- Remove virtual Trace::Session methods
- Merge client.h into connection.h
- Update coding style of test/trace

Issue #5245
2024-06-20 12:56:19 +02:00
Norman Feske
7de2f57ef2 Remove Xml_node::attribute accessors
This patch removes the two 'Xml_node::attribute' accessors along with
the 'Nonexistent_attribute' exception.

Issue #5245
Fixes #5246
2024-06-20 12:56:19 +02:00
Martin Stein
84bbde2879 nic_router: fix interface-local quota reporting
The router used to ignore the value of the <report quota=".."/> attribute when
it came to determining whether an interface's report is empty or not.
Therefore, merely configuring <report quota="yes"/> didn't cause interfaces
(and their quota) to show up in the report. Instead, interface quota was
reported as side effect of <report stats="yes"/>. The commit fixes this
inconsistency with the README.
2024-06-20 12:56:19 +02:00
Martin Stein
09b3fa389d nic_router: destroy timed out ARP waiters
The only object that is dynamically allocated by a network interface and that
was not equipped with a self-destruct timeout was the ARP waiter. This commit
closes this gap by adding a timeout to each ARP waiter that is set to 10
seconds by default but can be configured via the new <config> attribute
'arp_request_timeout_sec'.

Ref #4729
2024-06-20 12:56:19 +02:00
Martin Stein
20371d0445 nic_router: drop closed tcp links immediately
RFCs recommend to keep TCP connections for a certain time even after they
finished a close handshake, AFAIK, in order to be able to recognize astray
packets when they arrive later. This seems overambitious especially when in
the context of the router where session quota is pretty limited. Therefore,
this commit drops this final timeout and drops closed connections immediately.

Ref #4729
2024-06-20 12:56:19 +02:00
Martin Stein
58726a6707 nic_router: lower non-open tcp timeout to 30 sec
The previous value of 60 seconds was never observed in real-time scenarios and
UDP, for instance always used a timeout of 30 seconds without causing issues.
Note that this applies only to TCP connections in a state other than
ESTABLISHED, i.e., while it is still safe to early-drop the connection.

Ref #4729
2024-06-20 12:56:19 +02:00
Martin Stein
0a33168733 nic_router: mark tcp open only with full handshake
The TCP connection state "ESTABLISHED" (in the router "OPEN") is a privileged
one for peers because it lasts very long without any peer interaction (in the
NIC router it's only 10 minutes, but RFCs recommend not less than 2 hours and
4 minutes). Furthermore, TCP connections in this state are normally not
available for early-drop on resource exhaustion. This means that this state
binds resources to a connection potentially for a long time without the option
of regaining them under stress. Therefore, this state should be entered with
care.

Up to now, the router marked a TCP connection with this state as soon as it had
seen one matching packet in both directions, which is rather quick. However,
implementing a very precise tracking of the exact TCP states of both peers and
only marking the connection "ESTABLISHED" when both peers are "ESTABLISHED" is
a difficult task with lots of corner cases.

That said, this commit implements a compromise. The router now has two flags
for each peer of a TCP connection - FIN sent and FIN acked - and sets them
according to the observed TCP flags. The "ESTABLISHED" state is entered only
when FIN acked is set for both peers (without having observed an RST or FIN
flag meanwhile).

Ref #4729
2024-06-20 12:56:19 +02:00
Martin Stein
93c3f6371b nic_router: remove reference utilities
The Reference and Const_reference utility were introduced in order to express
that something is a reference (no null value) but can be changed dynamically
(not possible with built-in C++ references). However, the idea of preventing
every possibility for null pointer faults, with which the router was built
initially, has not prevailed and using pointers instead of the utility saves
logic and makes the code more readable to other C++ developers.

Ref #4729
2024-06-20 12:55:47 +02:00
Martin Stein
f7f171e457 nic_router: fix leak on domain deinit
The deinitialization method of Domain used to rely on Domain::with_dhcp_server
in order to dissolve and destroy a present DHCP server. However, this method
skipped calling its functor argument also when there was a DHCP server but an
invalid one. This commt replaces the with_dhcp_server with a pointer null-check
in order to fix the leak.

Ref #4729
2024-06-20 12:54:31 +02:00
Martin Stein
c96150bc70 nic_router: smarter emergency free on exhaustion
Re-implements an emergency freeing of resources on exhaustion of session quota.
In contrast to the past one, the new algorithm is executed directly where the
exhaustion occurs. Instead of interupting the packet handling and restart it
from the beginning after the freeing action, packet handling is now continued
at the point of exhaustion (if enough resources could be freed). Furthermore,
the new algorithm frees only 100 objects (instead of 1024) at a max as we found
this to better match real-life observations. And finally, the router now drops
ICMP first, then UDP, then TCP - as this better reflects priorities - and
refrains from dropping TCP connections in the ESTABLISHED state. If the router
cannot free a sufficient amount of resources, the packet that caused the
exhaustion is dropped with a warning (verbose_packet_drop="yes").

Ref #4729
2024-06-20 12:54:31 +02:00
Martin Stein
ac42ade48c nic_router: remove use of exception handling
Remove the use of C++ exception as much as possible from the router as C++
exception handling can be resource intensive and can make code hard to
understand.

This also removes the garbage collection that the router used to do when a
session ran out of quota. This is motivated by the fact that the garbage
collection was rather simple and removed connection states regardless of their
current state, thereby causing broken connections. The change is part of this
commit as the approach to integrating garbage collection relied strongly on
exception handling.

The user story behind removing garbage collection: The router emergency-dropped
an established TCP connection (with NAPT) and on the next matching packet
re-created it with a different NAPT port, thereby breaking the connection. With
this commit, existing connections are prioritized over new ones during resource
exhaustion and the packets that attempt to create a new connection in such a
state are dropped with a warning in the log (verbose_packet_drop="yes").

Note that the state resolves itself with time as existing connections time out
or are closed by peers.

Ref #4729
2024-06-20 12:54:31 +02:00
Martin Stein
0faec6afaa net/port.h: default constructor
Adds default constructor to Net::Port that initializes the value to 0. This
allows for using Net::Port with the Genode::Attempt utility.

Ref #4729
2024-06-20 12:54:30 +02:00
Alexander Boettcher
25717df15f lib/format: support asterisk with format specifier
used by some libraries, e.g:

printf("%*.s", 5, "Sun");     -> '  Sun'
printf("%.*s", 2, "Sun");     -> 'Su'
printf("%*.*s", 5, 2, "Sun"); -> '   Su'
printf("%.*d", 3, 10);        -> ' 10'

Issue #5234
2024-06-20 12:54:30 +02:00
Johannes Schlatow
0aafec038d platform: pass reserved memory update to IOMMU
Only add default mappings on IOMMU construction and on reserved-memory
updates.

Issue #5232
2024-06-20 12:54:30 +02:00
Johannes Schlatow
6912dd62fa platform: handle reserved memory on devices update
Reserved memory regions must be excluded from the corresponding DMA
allocators irrespective of whether the device is in use. Otherwise, an
early allocation of DMA buffers may use the reserved memory regions of a
late acquired device.

Fixes #5232
2024-06-20 12:54:30 +02:00
Alexander Boettcher
ba473134da acpica: avoid special mmio address request
Add special handling for root bridge access for

12th Gen Framework laptop and Thinkpad X1 Nano Gen2

to avoid bogus MMIO memory accesses as seen in #5234 and #4643.

Fixes #5234
2024-06-20 12:54:30 +02:00
Alexander Boettcher
a12ff58674 base-nova: remove special acpica/iomem region
Based on not emulated and therby wrong values, acpica calculates a
physical address which points to somewhere. Remove this hack from core and
try to emulate accesses inside acpica where necessary.

Issue #4643
Issue #5234
2024-06-20 12:54:30 +02:00
Norman Feske
0062a3e784 sculpt: version 24.06 2024-06-20 12:54:30 +02:00
Norman Feske
ef385696f6 base/child.h: remove Nonexistent_id_space exception
This exception got introduced as a mere convenience for implementers of
'Child_policy' but required a special case in the base library.
Following the goal of eliminating exceptions from the base system,
this patch removes it by making a server_id_space mandatory.

Issue #5245
2024-06-20 12:54:30 +02:00
Alexander Boettcher
8b0a16d750 driver/platform: re-configure bridges on resume
Fixes #5241
2024-06-20 12:54:30 +02:00
Alexander Boettcher
3216733a05 driver/platform: remember bridge configuration
by evaluating the pci decode's 'devices' ROM and storing the information in
the pci config list model representation.

Issue #5241
2024-06-20 12:54:30 +02:00
Alexander Boettcher
0c97c13562 pci_decode: report pci bridge configuration
as setup by firmware after boot. The information will/can be used by the
platform driver to re-program bridges after a system suspend/resume cycle.

Issue #5241
2024-06-20 12:54:30 +02:00
Alexander Boettcher
7f152ea9ba acpi_suspend: add wifi support
Serves as resume testcase for device behind a pci bridge.

Issue #5241
2024-06-20 12:54:30 +02:00
Norman Feske
dd4b19cda7 base: Remove use of Id_space::Unknown_id exception
Issue #5244
2024-06-20 12:54:30 +02:00
Norman Feske
7c91596922 Exception-less overload of 'Id_space::apply'
This patch allows the use of the 'Id_space' utility without catching
'Unknown_id' exceptions. Instead, the new 'apply' overload takes a
second functor 'missing_fn' as argument, which is called whenever the
lookup fails.

Issue #5244
2024-06-20 12:54:30 +02:00
Christian Helmuth
73d18261dc Fix calculation in timer_ticks_to_us()
Added missing factoring of the upper-half division remainder into the
lower-half calculation.

Fixes #5243
2024-06-20 12:54:30 +02:00
Norman Feske
a70354cb18 Remove gems/wrapped_gui_session.h
This utility is no longer used.
2024-06-20 12:54:30 +02:00
Norman Feske
b9594c2ae8 gui_session,nitpicker,testnit: update coding style
- Replace 'typedef' by 'using'
- Avoid plain pointers
- Import Genode namespace into Gui::
- Use enum class
- Use Attr struct for passing multiple attributes
- Turn testnit into proper Genode::Component
  - Use distinct types for top-level and child views
  - Remove dependency from timer
  - Use util/geometry.h
2024-06-20 12:54:30 +02:00
Christian Prochaska
06d098052f qt5: adapt to C++20 API changes
Issue #5227
Issue #5239
2024-06-20 12:54:30 +02:00
Norman Feske
4969c7cdb0 Reduce code duplication by using Point::from_xml 2024-06-20 12:54:30 +02:00
Norman Feske
b11116088a cpu_load_display: enable strict conversions
Besides raising the warning level, the patch updates the coding style
('with_' pattern, using, type safety, constness).
2024-06-20 12:54:30 +02:00
Norman Feske
c629c54153 Make util/geometry.h C++20 friendly
- Move header to base/include to make it applicable for base types
  like 'Affinity' down the road.
- Represent 'Rect' as typle of point and area, which is the most
  common form of initialization, creates in valid 'Rect' by default.
- Turn Point, Area, and Rect into compound types, making x, y, w, h, at,
  area accessible without a method call
- 'Rect::Compound' function for constructing a 'Rect' from two points,
  replacing a former constructor
- Use result type 'Rect::Cut_remainder' instead of out parameters.

Fixes #5239
2024-06-20 12:54:30 +02:00
Norman Feske
bb06d879aa os: make 'Genode::Color' C++20 friendly
This patch turns 'Color' from a class to a POD type by replacing
the constructors by the named create functions 'rgb', 'clamped_rgb',
and 'clamped_rgba'. It thereby enables the initialization of Color
values using { .r = ... } syntax and makes the type usable in const
expressions.

It also narrows the type for color components and alpha values to
uint8_t. So possible integer overflows of computed values are detected
by -Wconversion.

As 'Color::rgb(0, 0, 0)' is repeatedly used as a default value, the
patch adds the 'Color::black()' function.

Fixes #5238
2024-06-20 12:54:30 +02:00
Christian Helmuth
791dd38160 wireguard: clean up build order/structure
- Move C++ sources from lib/wireguard to app/wireguard, which require
  Genode include paths (that conflict with linux)
- Rename lib/wireguard_lx_inc_dirs to lib/wireguard, which builds linux
  sources with linux include paths
2024-06-20 12:54:30 +02:00
Christian Helmuth
2580045a83 musl_tm: prevent compilter warning
warning: dangling pointer ‘is_leap’ to an unnamed temporary may be used [-Wdangling-pointer=]
2024-06-20 12:54:30 +02:00
Sebastian Sumpf
ac4aaa208f libdrm/iris: check for more than 1 sync object
In '_generic_syncobj_wait' check if sync-objetcs exist, return error
otherwise. Do not wait because the execution model is synchroneous,
meaning no batch buffers are in execution when this function is called
(_drm_mutex).

issue #5224
2024-06-20 12:54:30 +02:00
Sebastian Sumpf
c85e53cb2a mesa/libdrm: move fd's out of libc's range
Move hard coded fd's out of the libc range in order to avoid possible
hard to find conflicts.

issue #5224
2024-06-20 12:54:30 +02:00
Sebastian Sumpf
7c32af9d99 libdrm: use pthread_mutex instead of Genode's mutex
Use pthread_mutex because the EP can block while the thread executing a
batch buffer and waiting for a completion signal in the VFS-GPU plugin
can still make progress.

Also return to coarser locking until we support Sync-Object Wait
semantics.

issue #5224
2024-06-20 12:54:30 +02:00
Sebastian Sumpf
af8b13e88c mesa: zero buffer objects upon release
Freshly allocated BOs from libdrm have to be zeroed. Since the libdrm/iris
caches VRAM allocations, we don't want to attach/detach parts of dataspaces at
every allocation. Some objects are used long (through caching in the iris
Gallium driver). Therefore, zero object on release where the region might
already be mapped.

issue #5224
2024-06-20 12:54:30 +02:00
Sebastian Sumpf
138f5fe61a mesa: update to version 24.0.8
issue #5224
2024-06-20 12:54:30 +02:00
Johannes Schlatow
102baab7d7 sculpt: adapt Gpu-route in goa_testbed preset
Fixes #5237
2024-06-20 12:54:30 +02:00
Christian Helmuth
09ef478838 wireguard: cleanup jiffies symbol (alias to jiffies_64)
Issue #5236
2024-06-20 12:54:30 +02:00
Christian Helmuth
193b19fb78 lx_emul: support compound pages
Issue #5236
2024-06-20 12:54:30 +02:00
Christian Helmuth
3bd04d1253 Check nping permissions in nic_router_ipv4_fragm.run 2024-06-20 12:54:30 +02:00
Norman Feske
fe613fa9a3 Rename src/drivers to src/driver
Issue genodelabs/genode#4420
2024-06-20 12:54:30 +02:00
Josef Söntgen
7c19e2bc38 lx_emul: initialize auxiliary bus
This commit adds a weak dummy implementation to a compilation unit
that is referenced by all DDE Linux based driver components to
prevent adding a dummy to every driver.
2024-06-20 12:54:30 +02:00
Josef Söntgen
9eeeb4e36c lx_emul: align __alloc_pages_bulk implementation
The upstream implementation is used to allocate order-0 pages in
a batch and users, e.g. page-pool allocator, may rely on that
behaviour and thus it is implemented with this commit.
2024-06-20 12:54:30 +02:00
Josef Söntgen
191306531c dde_linux: generate proper KBUILD_MODNAME
This commit remedies the somewhat lazy attempt to address unique names
for drivers where the name is directly derived from KBUILD_MODNAME,
e.g. rtlwifi, and also modifies the name accordingly to the rules
of Linux' build-system. The last part becomes necessary as driver
matching tables may rely on that as has already happend with the
ti-sn65dsi86 driver.
2024-06-20 12:54:30 +02:00
Norman Feske
8943a3e949 Remove '_drv' suffix
Issue #4420
2024-06-20 12:54:30 +02:00
Norman Feske
cb88c2c3e2 Fixup "nova: rename test/platform to test/nova" (platform.run -> nova.run) 2024-06-20 12:54:29 +02:00
Norman Feske
0a181240c8 nova: rename test/platform to test/nova
This is a preparation for renaming platform_drv.run to platform.run.

Issue #4420
2024-06-20 12:54:29 +02:00
Norman Feske
940a1912fa os: replace pkg/pc_nic by pkg/nic_uplink
This enables the combination of the nic_uplink component with any driver
pkg featuring a runtime file. This is already the case of the pc_nic
driver.

This is a preparatory step for issue #4420.
2024-06-20 12:54:29 +02:00
Christian Helmuth
6ba0574950 fiasco: move source code to genode.org
Complete migration from Sourceforge to GitHub.
2024-06-20 12:54:29 +02:00
Norman Feske
00844efd2f test/terminal_expect_send: warn on excess chars
This patch adds a warning on the occurrence of overly long lines and
drops characters in this case.

Fixes #5108
2024-06-20 12:54:29 +02:00
Christian Helmuth
996b2fe79f base: log invalid address value in heap 2024-06-20 12:54:29 +02:00
Johannes Schlatow
a5c7b20196 sculpt: support incomplete pkg-archive paths
This adds support for supplying launcher and preset files with pkg-attributes
of the form '<user>/pkg/<name>'.

Fixes genodelabs/genode#5223
2024-06-20 12:54:29 +02:00
Norman Feske
eca864175c Remove Gui::Session::session_control
This functionality has long been superseded by the window
manager/layouter.

Fixes #5160
2024-06-20 12:54:29 +02:00
Alexander Boettcher
a3a84b25e8 image: support shim usage for uefi and disk
Fixes #5230
2024-06-20 12:54:29 +02:00
Johannes Schlatow
78a6d2bd0c os: fix multiplication wrap-around in Area::count
When having a maximized terminal window, a suspend was causing an
invalid mode change at nitpicker. This triggered a huge resource request
in nitpicker because the RAM-quota check was rendered ineffective by a
wrap-around during unsigned multiplication.

Issue genodelabs/genode#5180
Fixes genodelabs/genode#5201
2024-06-20 12:54:29 +02:00
Timo Nicolai
dc5990ce4a black_hole: add missing report to config.xsd
Should have been added by 14d0b72f52.

Issue #5233
2024-06-20 12:54:29 +02:00
Ivan Loskutov
649653eb1c Fix getting pubkey_id from depot user pubkey
On systems with the option `use-keyboxd` enabled in config, option
`--no-keyring` in gpg command line doesn't work. The result of the
pubkey_id function will be the first key in the keybox keyring instead
of the id of pubkey from the depot user.

Fixes genodelabs/genode#5235
genodelabs/goa#92
2024-05-30 14:07:16 +02:00
Norman Feske
86895d6a5c doc/release_notes/24-05.txt: minor style tweaks 2024-05-30 12:38:05 +02:00
Christian Helmuth
c1297e15d1 version: 24.05 2024-05-30 12:03:45 +02:00
Norman Feske
d5f7c3ab49 News item for version 24.05 2024-05-30 12:02:06 +02:00
Norman Feske
5c91504b49 Release notes for version 24.05 2024-05-30 12:01:58 +02:00
Christian Helmuth
4b9f4d8c38 depot: update recipe hashes 2024-05-30 08:20:21 +02:00
Johannes Schlatow
7c0d8acd8f bsd_audio_drv: increase cap quota for base-hw
Fixes genodelabs/genode#5231
2024-05-29 09:18:49 +02:00
Christian Helmuth
b6aa021d76 internet_checksum.run: restrict tshark protocols
Restrict checksum checking in output.pcap to ip,tcp,udp,icmp.

Issue #4636
2024-05-29 09:18:49 +02:00
Christian Helmuth
95a7e7a840 internet_checksum.run: log values on error
Issue #4636
2024-05-29 09:18:49 +02:00
Johannes Schlatow
20a7918b41 libdrm/iris: implement dummy for caching uapi
For Intel HD Graphics 500, mesa calls the DRM_I915_GEM_SET_CACHING
ioctl.

genodelabs/genode#5224
2024-05-29 09:18:49 +02:00
Christian Prochaska
8610eecb2b qt5: adapt to C++20 function template syntax
Issue #5227
2024-05-29 09:18:49 +02:00
Norman Feske
98ecde5b7b test/platform_drv: stabilize final state
The test reverts the platform drivers' config at the end of the test
to an empty state. However, this state should still contain a default
policy (analogyously to the initial state). Otherwise, the platform
session of the test program will (sometimes) become invalid just before
successfully finishing the test.
2024-05-29 09:18:49 +02:00
Martin Stein
99c9909508 file_vault: update README 2024-05-29 09:18:49 +02:00
Martin Stein
4ac5fde7c2 file_vault_gui: add a README 2024-05-29 09:18:49 +02:00
Norman Feske
4801cbf47c drivers_interactive-pc: ram for event_filter
Slightly balance the ram quota of the drivers subsystem in favor of the
event_filter for letting demo.run test succeeed on sel4.
2024-05-29 09:18:48 +02:00
Norman Feske
f171bc5050 Remove loader and qpluginwidget
The original use cases of the loader have long been covered by the
dynamic init. The only substantial client of the loader remained to be
the qpluginwidget. However, the qpluginwidget was supported only by the
Arora web browser. But the blending of plugins with websites ultimately
remained a tech demo, and Arora has been replaced by Falkon.

Fixes #5229
2024-05-29 09:18:12 +02:00
Sebastian Sumpf
179b3eb7e4 libdrm/iris: make locking more fine grained
When more than one thread are accessing the DRM interface it is not wise
to use global locking, especially when a pthread is executing a batch
buffer and waits for a completion signal in the VFS-plugin. In case the
EP gets stuck in the global lock, no progress is made. Therefore:

* use _drm_mutex only where strictly necessary
* use special _exec_mutex to protect buffer execution (per context)
* print warning when two threads try to execute a buffer in the same
  context

isse #5224
2024-05-29 09:18:12 +02:00
Norman Feske
f79ff59619 sel4: reduce cache_invalidate_data warnings
Warn only once about the missing 'cache_invalidate_data'
implementation to prevent the fec nic driver from spamming the
log.
2024-05-29 09:18:12 +02:00
Christian Helmuth
16e088a34e vbox6: adapt to C++20 function template syntax
GCC's -std=gnu++17 is required for VirtualBox 6 but, fortunately,
support the "auto template" syntax with -fconcepts.

Issue #5227
2024-05-29 09:18:12 +02:00
Alexander Boettcher
65ca9ee906 platform/pc: don't support poweroff
Fixes #5216
2024-05-29 09:18:12 +02:00
Norman Feske
889f1f5488 demo: update tutorial text
Remove references to the demo CD. Update links to https.
2024-05-29 09:18:12 +02:00
Christian Helmuth
e90f6988d8 pci_decode: disable MSI/MSI-X capabilities
Default disabled initialization prevents follow-up errors if one
capability is already enabled on boot, but platform_drv decides to
enable the other one. The PCI spec explicitly states that "Behavior is
undefined if both MSI and MSI-X are enabled simultaneously".

Fixes #5228
2024-05-29 09:18:12 +02:00
Johannes Schlatow
b793802333 sculpt: fix presence of unconfigured children
A launched child only becomes present in the runtime when it has been
configured. This must be considered when checking for missing servers.

Fixes genodelabs/genode#5226
2024-05-29 09:18:12 +02:00
Norman Feske
cfd013a01a os/include: use C++20 function template syntax
Issue #5227
2024-05-29 09:18:12 +02:00
Norman Feske
5e862b2cd3 base/include: use C++20 function template syntax
Issue #5227
2024-05-29 09:18:12 +02:00
Alexander Boettcher
48d6f0220c nova: avoid static smp code reservation
Using a segment to reserve the AP (application processor) code page does not
work if the region overlaps with other non-memory types, e.g. bender checks
for the overlapping and denies to boot on such machines.

Without bender, the system boots up fine. So, partially remove the nova commit
"Add segment to reserve AP startup page" and instead apply the idea of
Cyberus's version. Place the AP boot code later during boot and save and
restore the memory before/after SMP bootstrap.
2024-05-29 09:18:11 +02:00
Christian Helmuth
3c24715d16 Add pc_linux.run for driver tests on pc
Inspired by the excellent imx_linux.run script.
2024-05-29 09:18:11 +02:00
Sebastian Sumpf
d71b6ca305 mesa: update to version 24.0.1
Supported Gallium drivers are iris (Intel), lima (PinePhone), etnaviv
(i.MX8).

issue #5224
2024-05-29 09:18:11 +02:00
Sebastian Sumpf
dca3b12109 libdrm: update to version 2.4.120
Prerequisites for Mesa 24.0.1

* generic:
  * add patch to retrieve PCI/Platform information from Genode side of the DRM
    interface (in drmGetDevice2)
  * add generated 'fourcc' file

* iris:
  * report back-end (currently 'i915', 'xe' is unsupported)
  * add various I915_CONTEXT_PARAM* and I915_PARAM*
  * allocate 'Buffer's starting with ID 1 (0 is invalid)
  * enforce 48-bit-address limit on unmap also
  * disable I915_EXEC_FENCE_ARRAY array check, because we do not support
    sync objects right now and rendering in synchronous

* etnaviv:
  * create 'Fenceobj' only *once* for each GPU context

issue #5224
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
b83b53d3b2 hw: abstract nested paging on x86
The initial SVM implementation (correctly) just used another standard
x86_64 page table for nested paging. The EPT implementation is for Intel
VMX only. Since we don't know the underlying virtualization technology
at compile time, we need to pick the correct page table implementation
at runtime.

Add add a AMD-compatible HPT page table implementation using the same
base implementation and (more importantly) allocator as the EPT
implementation. Add a Vm_page_table implementation that determines the
used virtualization technology at runtime and internally defers insert
and remove operations to the correct page table implementation.

Issue #5218
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
221d0c6c48 hw: implement EPT page table
Implement a nested page table to use with x86 virtualization.

Fixes #5218
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
4fc94deccb base: x86: page table base: make parameters compatible
To make the x86 page table base implementation compatible with the
function signatures used in hw, make the Intel IOMMU specific arguments
optional:

- Make the `flush` parameter default to false.
- Make the `supported_sizes` parameter default to 1GB + 2MB + 4k.

Issue #5217
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
30b39d5fa3 base: generalize the page table allocator and move it to base
The Intel IOMMU page table implementation in the pc platform driver uses
a page table allocator that is adapted from the implementation in the hw
kernel.

Move the allocator to base as a first step to consolidate
implementations, fix an Array constructor and re-add the Allocator
constructor working on addresses instead of tables.

Issue #5217
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
58e9856eb8 base: move page flags interface to base
On hw, `Page_flags` is used throughout architectures. At the same time,
it is used by the Intel IOMMU page table implementation in the pc
platform driver.

Consolidate the definition in base so it is available for all users.

Issue #5217
2024-05-29 09:18:11 +02:00
Johannes Schlatow
c31adb77e7 base: add shared page-table code for x86_64
Issue #5217
2024-05-29 09:18:11 +02:00
Alexander Boettcher
97544ed7a9 nova: support iommu enabling per intel/amd
separately.  The "iommu" option is now split up into "iommu_intel" and
"iommu_amd" and thereby can be disabled easily if required for one of the CPU
vendors.

Fixes #5206
2024-05-29 09:18:11 +02:00
Alexander Boettcher
b33afb24d7 nova: adjust to cmdline changes of kernel
- no need to explicitly switch off vga anymore
- use vPID for VMs which improves TLB usage if multiple vCPUs on same
  pCPU is used, which happens to happen on Sculpt.
- support for mwait by nova kernel, which is off by default

Issue #5206
2024-05-29 09:18:11 +02:00
Alexander Boettcher
d9086833ed netperf: run timer most preferred in tests 2024-05-29 08:37:08 +02:00
Alexander Boettcher
801fe272ca pit: new timer implementation
Issue #5138
2024-05-29 08:37:08 +02:00
Stefan Kalkowski
32bc1b14d4 dde_linux: add busybox port
Fix genodelabs/genode#5214
2024-05-29 08:37:08 +02:00
Benjamin Lamowski
aad80e81da hw: add support for VMX
Add support for Intel's Virtual Machine Extensions with nested paging.

Fixes #5128
2024-05-29 08:37:08 +02:00
Stefan Kalkowski
f0ec1adcd3 base: add check_tool utility to build system
Fix genodelabs/genode#5213
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
dbd070b815 hw: add kernel panic function to x86_64
Add a kernel panic function to x86_64 that mirrors the functionality
available for ARM.

Issue #5128
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
5049f03f5b hw: generic interface for x86 virtualization
Create a generic interface for x86 virtualization.
Split the VMCB data structure in `Vmcb_buf` to represent the physical
VMCB page and `VMCB` as a control interface.

Issue #5113
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
b4fe9154b9 hw: access VMCB State Save Area via Mmio framework
So far, the VMCB data structure was generated from it's parts (most
prominently VMCB Control Area and VMCB State Save Area) with the VMCB Control
Area accessed via the Mmio framework, while the VMCB State Save Area
struct used directly defined members.

Unify the VMCB structure and uniformly use the Mmio framework to access
the VMCB. Separate the controlling structure from the VMCB page.

Issue #5113
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
0d1716b07d hw: prepare SVM implementation for generic virtualization support
The SVM implementation did not lend itself to a runtime selection of the
x86 virtualization technology.

Encapsulate functionality in the VMCB class to facilitate adding support
for Intel's VMX.

Issue #5113
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
3a88d133ed hw: generalize virtualization memory
The initial vCPU memory was written for AMD's SVM.

Make the vCPU memory provider virtualization technology agnostic.

Issue #5113
2024-05-29 08:37:07 +02:00
Benjamin Lamowski
e82859444e hw: clean up Intel TSC frequency deduction
The initial algorithm ported to hw seems to be correct in principle,
however it does not work with nested virtualization.

Clean up the code to make the different methods of obtaining the TSC
frequencies more clear, and add warnings if a particular
method has failed although it should be available.

Fixes #5210
2024-05-13 15:52:22 +02:00
Alexander Boettcher
59c42ffb46 lib-qemu: support to use qemu-usb w/o webcam
for other VMMs beside Virtualbox, e.g. Seoul or potentially arm/vmm. The
webcam model depends on libyuv, which uses stdcxx + full libc, which is not
desired or required for all VMM implementations.

Fixes #5208
2024-05-13 14:06:54 +02:00
Sebastian Sumpf
6c9d3326ec ldso: add support for R_<arch>_NONE relocations
We discovered this relocation, which does nothing, in pre-compiled
libraries. It is easy to implement because it has the same
relocation-type number (0) for all supported ABIs.

Also adjust error message from "Unsupported PLT relocation" to
"Unsupported translation table address format" to not confuse the
relocation type with the translation table type.

Fixes #5209
2024-05-08 08:23:39 +02:00
Christian Prochaska
a59f73f7d3 libc: remove 'Symlink_resolve_error' exception
Issue #5198
2024-05-08 00:38:45 +02:00
Alexander Boettcher
bfddf08f75 ahci: make robuster during resume
During resume the waiting for Cmd::St takes ~2s on a T460p with Intel
AHCI SSD attached. According to the Serial ATA AHCI Spec. wakeup can take
seconds, e.g. chapter 8.2 Power State Mappings of the Serial ATA AHCI spec
(1.3.1).

Issue #5203
2024-05-07 16:46:34 +02:00
Alexander Boettcher
dc4dad4608 sculpt_manager: add ahci to monitored used devices
for suspend/resume

Issue #5203
2024-05-07 16:46:21 +02:00
Christian Helmuth
79e391ba8d vbox6: diagnostic message on Region_conflict
Catch and log Vm_session::Region_conflict, but continue operation.
2024-05-07 15:21:48 +02:00
Alexander Boettcher
f0f66f8ccc nova: avoid ipi timeouts
Fixes #5204
2024-05-07 15:09:32 +02:00
Alice Domage
4bda9d9136 pc_intel_fb_drv: enforce operation on Intel's devices
This commit enforces the driver to only wait for devices with Intel's
vendors ID to be ready.

genodelabs/genode#5207
2024-05-07 14:20:44 +02:00
Christian Helmuth
8a019c9bb9 nitpicker: always update "displays" report
Restore the reporting in situations where all capture sessions are gone.
This fixes the webcam package that disables the USB webcam driver when
nitpicker report no active displays.

Issue #5187
2024-05-03 09:12:49 +02:00
Christian Prochaska
25b918052b qt5: improve tooltip visibility
Fixes #5205
2024-05-03 08:31:23 +02:00
Christian Helmuth
4b9d02fe31 depot: update recipe hashes 2024-05-02 11:19:50 +02:00
Norman Feske
101e9f5733 vfs/oss/README: oss_next -> oss
Issue #5167
2024-05-02 11:19:50 +02:00
Norman Feske
50b87957db sculpt: improve GUI smoothness on PinePhone
- Avoid geometry animation at boot time
- Assign CPU quantum to higher prioritized GUI components
- Defer touch_keyboard start to reduce boot time

Issue #5174
2024-05-02 11:19:50 +02:00
Norman Feske
b1df5d890e sculpt: update graph abbreviations to 24.04
Issue #5174
2024-05-02 11:19:49 +02:00
Stefan Kalkowski
18511770bc sculpt: add support for more than one mmc card
Instead of using one default policy when creating an mmc driver's
configuration, produce some more static policy items to support
boards with more than one card per driver (mnt_reform2).
2024-05-02 11:19:49 +02:00
Christian Helmuth
6710092bb4 sculpt_distribution: add vfs_oss 2024-05-02 11:19:49 +02:00
Christian Helmuth
c25841691f ports: build vim/vim-minial with --enable-multibyte
A first step to complete UTF-8 support in the terminal (e.g.,
system_shell).
2024-05-02 11:19:49 +02:00
Florian Delizy
1146f27c59 sculpt: add menu name for Bepo keyboard layout
issue #5202
2024-05-02 11:19:49 +02:00
Florian Delizy
593a9aefca sculpt: add fr_bepo reference into default build
issue #5202
2024-05-02 11:19:49 +02:00
Florian Delizy
b2eca7cea2 event_filter: reduce bepo chargen to 486ln
issue #5202
2024-05-02 11:19:49 +02:00
Florian Delizy
1534ba21ce event_filter: add fr_bepo chargen file
issue #5202
2024-05-02 11:19:49 +02:00
Alexander Boettcher
72bb960c2a dde_linux: update jiffies in cpu_relax on x86/pc 2024-05-02 11:19:49 +02:00
Martin Stein
e350dc27e9 internet_checksum.run: test net checksum alorithms
See repos/os/src/test/internet_checksum/README for more detail.

Ref #4636
2024-05-02 11:19:49 +02:00
Christian Helmuth
3a0ded3bdd window_layouter: calculate weighted dimension in double
The change prevents integer overflows with reasonable large values.

Thanks Peter for reporting.
2024-04-29 16:08:56 +02:00
Christian Helmuth
fc27469b97 sculpt: remap KEY_SYSRQ to KEY_PRINT
Both keys are physically the same on available keyboards (with varying
labeling). Unfortunately, PS/2 scancode sets and USB HID spec seem to
differ slightly in their interpretation. Therefore, we keep the
driver-level reporting as is but report both as KEY_PRINT in Sculpt,
which allows to use the key(s) for screenshoter rules most prominently.

Also, unify sculpt/event_filter/pc with sculpt_manager.
2024-04-29 15:31:20 +02:00
Christian Helmuth
00c776c3dd sculpt_distribution: add rom_osci and record_rom 2024-04-29 09:54:02 +02:00
Renato Carvalho
8c7e90f7f2 tool/run: fix corner case in exit override
The run tool overrides the 'exit'-procedure to make sure that a loaded
run_power_off procedure is always executed. However, a failing
run_power_off lead to false-positives: 'make run/...' exited with 0 even
tough the run script was not even executed because of a failed
power-on/off cycle. In this case, if the run_power_off is the exit code
producer, the new exit definition does not finish as intended. As a
result, the first exit code is re-written, and errors are not propagated
accordingly.

The solution is to catch possible errors from power-off within the exit
procedure.

Fixes genodelabs#5102
2024-04-29 08:00:30 +02:00
Christian Helmuth
e31273a410 depot: add libiconv pkg/goa 2024-04-26 15:22:37 +02:00
Christian Helmuth
59b85cc672 depot: update recipe hashes 2024-04-26 09:59:36 +02:00
Norman Feske
f6aa053737 News item for Sculpt 24.04
Issue #5174
2024-04-26 09:59:19 +02:00
Benjamin Lamowski
820a144f6d sculpt: adjust RAM for inspect window
With the current RAM setting, opening the inspect window fails on a
display with 4K resolution.
Adjust the inspect window's RAM quota to make it work.

Issue #5174
2024-04-26 07:39:25 +02:00
Norman Feske
88f050963e sculpt: update README for version 24.04
Issue #5174
2024-04-26 07:39:25 +02:00
Johannes Schlatow
c5acfd027b depot: add goa_testbed requirements to pkg/goa
genodelabs/genode#5174
2024-04-25 15:43:03 +02:00
Stefan Kalkowski
d9420c618c hw: take over ACPI hardware from SMI
Fix #5196
2024-04-25 15:43:03 +02:00
Stefan Kalkowski
68de550090 hw: ignore stale data in fresh signal
When a new signal arrives, which means a formerly non-pending one,
we should ignore old signal numbers of that context, but only
evaluate newly received data by the last kernel-call.

Fix #5193
2024-04-25 15:43:03 +02:00
Christian Helmuth
6dd87a6ce0 sculpt: integrate preliminary touchpad support
Issue #5195
Issue #5174
2024-04-25 15:43:03 +02:00
Christian Helmuth
54cf1334e1 Permit shared access to Intel PCH GPIO device
The ported i2c_hid driver contains driver code for the "Intel
Tigerlake/Alderlake PCH pinctrl/GPIO" device. Unfortunately, acpica
driver also accesses the same device on Lid open/close via ACPI AML code
of the DSDT table to read out the state of a GPIO pin connected to the
notebook lid. This would fail as I/O memory is handed out only once and
cannot be shared. The workaround disables the region check for the
specified GPIO I/O memory regions and provides both drivers shared
access to the regions.

This is a preliminary workaround. A general solution should separate the
GPIO driver into a component (e.g., platform driver) that regulates
accesses by i2c_hid and acpica.

Issue #5195
2024-04-25 15:43:02 +02:00
Christian Helmuth
c4b5f11a38 pci_decode: report Intel PCH GPIO device
Discovered on Tigerlake (Fujitsu U7411) and Alderlake (Framework Gen12)
notebook devices.

Issue #5195
2024-04-25 15:43:02 +02:00
Christian Helmuth
10f8da4a13 pci_decode: fixup Intel LPSS (I2C) PCI BARs
Discovered on Tigerlake (Fujitsu U7411) and Alderlake (Framework Gen12)
notebook devices.

Issue #5195
2024-04-25 15:43:02 +02:00
Christian Helmuth
b085550a0c sculpt: fix menu-level check in popup dialog
Issue #5174
2024-04-25 15:43:02 +02:00
Alexander Boettcher
f9e9835449 sculpt: move nitpicker to leitzentrale affinity
During audio and video playback at a high rate by a VMM, nitpicker on the
boot CPU may interfere with the mixer clients, letting them not finish the
schedule RPC at the mixer in time. Moving nitpicker to the same CPU as
leitzentral mitigates the effect at moment.

Issue genodelabs/genode#5174
2024-04-25 15:43:02 +02:00
Martin Stein
48a5c12526 nic_router_uplinks.run: raise timeouts
At least on x86_64/x86_64/pc/hw|nova, the test used to fail because the net
setup sometimes required more than the 3 seconds that the test was giving each
step. This commit raises the step timeout to 5 seconds and the test timeout
from 70 to 90 seconds in order to be on the safe side.

Ref #5192
2024-04-25 15:43:02 +02:00
Josef Söntgen
ac3202e554 sculpt: raise volume in audio launcher
The default mixer launcher limits the volume to 50%, so raise the
driver's volume to the max to be audible on certain systems where
otherwise audio is barely recognizable.

While there, fix the wrong reporting attribute as well.

Issue #5174.
2024-04-25 15:43:02 +02:00
Norman Feske
1379661a85 sculpt/event_filter: rename touch -> touchpad
This eases the integration of a custom touchpad driver component
provided as launcher.

Issue #5174
2024-04-25 15:43:02 +02:00
Martin Stein
50fc5c6d42 file_vault: further reduce typical quota needs
Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
d5e3f73884 file_vault: do not consider ui_config version
The version in ui_report and ui_config were merely used for making test output
more readable. However, there are other ways to achieve this goal.

Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
2bcc85b5f5 file_vault: fix locking issue
The File Vault used to sporadically fail to complete Extend or Rekey operations
when it was locked during the operation. The cause was an insufficient state
model that has been fixed with this commit.

Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
969469edef file_vault: clean up
Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
a7ef2319f6 file_vault: remove need for state file
The state file is a legacy from the early days of the file vault and not really
needed anymore.

Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
483fe18c4d file_vault_gui: dialog-based file_vault front end
* adds rekeying and resizing controls to config+report api of file vault
* moves common types of file vault to file_vault/include/file_vault/types.h
  to be included by other components
* fixes wrong type of nr_of_clients fields in file_vault
* introduces the file_vault_gui component that is a minimal graphical front end
  for the file vault based on the dialog lib and that uses the
  config+report api of the file vault as back end

Ref #5190
2024-04-25 15:43:02 +02:00
Martin Stein
9d78356885 text_area: remove unused min_width, min_height 2024-04-25 15:43:02 +02:00
Norman Feske
b75b40049d sculpt: rename suspend -> standby
Issue #5174
2024-04-25 15:43:01 +02:00
Norman Feske
d3d1e701a4 sculpt: refine scrolling boundaries
This patch addresses corner cases not considered so far. In particular,
it avoids placing the Add/Options tabs of an unscrollable popup under
the panel. This could happen in the presence of many options. The patch
includes the panel height into the calculation to rule out such
situations. It also tightens the scrolling boundaries to the visible
content.

Issue #5183
2024-04-25 15:43:01 +02:00
Josef Söntgen
a029b85d62 pc_wifi: provide generic LED related dummies
The generated dummies triggered when using a Atheros AR9462 device.

Fixes #5191.
2024-04-25 15:43:01 +02:00
Johannes Schlatow
60d97fab7e sculpt: update goa_testbed preset
genodelabs/genode#5174
2024-04-25 15:43:01 +02:00
Norman Feske
b939358c36 window_layouter: protect against mode 1 x 1
This patch handles intermediate situations where the screen mode may
become 1 x 1 (absence of any capture clients). In this case, the
decoration of a maximized window would legitimately exceed the screen
boundary.

Thanks Johannes for the investigation.

Issue #5187
Issue #5180
2024-04-25 15:43:01 +02:00
Johannes Schlatow
0f0fa5b2a2 sculpt: correct ROM names in event_filter/pc
The chargen files have been moved/renamed a while ago in the scope
of #4055.

genodelabs/genode#5174
2024-04-25 15:43:01 +02:00
Alexander Boettcher
f925680035 sculpt_manager: avoid restarting intel_gpu
during resume, which otherwise will restart all GPU clients.

Issue #5180
2024-04-25 15:43:01 +02:00
Alexander Boettcher
274a733e1a sculpt: support blanking system state
The blanking state is evaluated by the intel_fb driver, which will switch
off all connectors. When done, the intel_fb driver will exit and the
sculpt_manager will continue with the next step, stopping all drivers.

Issue #5180
2024-04-25 15:43:01 +02:00
Alexander Boettcher
9337c178c1 intel/gpu: support blanking system ROM state
Keep device resources alive, for "" and "blanking" state, so that
intel/display driver can try to switch off the connectors.

Issue #5180
2024-04-25 15:43:01 +02:00
Alexander Boettcher
2a4502b0de intel/display: support system state evaluation
When the system state "blanking" is determined, all connectors are switched
off and a parent exit is invoked.

Issue #5180
2024-04-25 15:43:01 +02:00
Stefan Kalkowski
5f67073aad sculpt: add missing pieces to support MNT reform
This commit adds missing routes to I2c for the framebuffer driver of the
MNT Reform. If build for this concrete board the Board_info::Soc variable
within the sculpt_manager is initialized according to the properties of
this device. The `update_soc` routine is called in the initialization of
the sculpt_manager, otherwise it won't be called at all, if no PCI devices
changes are detected. Missing driver binaries and device-tree-binaries are
add to the run-script.

Issue #5174
2024-04-25 15:43:01 +02:00
Stefan Kalkowski
3b83292205 sculpt: refine condition of nic support
A network card can be provided by PCI, and the SoC as well. Therefore,
add an additional state variable in the Board_info::Soc, and check it
appropriatedly.

Issue #5174
2024-04-25 15:43:01 +02:00
Christian Prochaska
47c1e45f28 ports: increase GDB resource quota limits on Sculpt
Fixes #5188
2024-04-25 15:43:01 +02:00
Norman Feske
39ccd5ab79 sculpt: refine condition of acpi features
Commit "sculpt: safeguard the offering of suspend/resume" was too lax
about the detection of acpi support. In situations where acpi support
is selected but not yet installed, the menu would offer the features
already. This patch restricts the condition such that acpi support must
be running, not merely selected.

Issue #5174
2024-04-25 15:43:01 +02:00
Norman Feske
ad722f1450 nitpicker: avoid mode switches on driver restarts
This patch retains the buffer size of the last capture client as mode as
long as no capture client exists. This avoids intermediate mode changes
in situations like suspend/resume where the display driver is restarted.

Issue #5187
2024-04-25 15:43:00 +02:00
Alexander Boettcher
02efe59cdd sculpt_manager: adjust system model state
s3_prepare should be ACPI_SUSPENDING instead of ACPI_RESUMING

Issue #5180
2024-04-25 15:43:00 +02:00
Alexander Boettcher
766060ece6 acpi_suspend: adjust to changes of #5180
Issue #5180
2024-04-25 15:43:00 +02:00
Alexander Boettcher
53230d39f4 intel/display: delay until graphic device is ready
Issue #5180
2024-04-19 13:54:16 +02:00
Alexander Boettcher
0b3cc37258 intel/gpu: provide platform device if hw resumed
If the gpu driver is resumed, delay new Device acquisition of the platform
client (intel_fb), until the gpu driver is in a working state.

Issue #5180
2024-04-19 13:54:16 +02:00
Josef Söntgen
10d7427490 sculpt: consider SoC board info for fb selection
In contrast to platforms, like the PC, where the fb driver selection
is a dynamic decision depending on the available hardware, on current
ARM-based SoC machines this configuration is part of the static board
information.

Issue #5174.
2024-04-19 13:44:36 +02:00
Norman Feske
084a14b114 record_play_mixer: make warning rate configurable
This patch disables latency warnings by default. The warnings can be
enabled by setting the 'warning_rate_ms` value to the desired
maximum rate.

Fixes #5186
Issue #5174
2024-04-19 13:42:05 +02:00
Christian Helmuth
85c99c238d depot: update recipe hashes 2024-04-19 08:54:22 +02:00
Norman Feske
e3d4f202c4 sculpt/nitpicker: assign KEY_PRINT -> screenshot
Issue #5174
2024-04-19 08:54:22 +02:00
Christian Helmuth
d90ec3775b pkg/terminal: limit initial dimension to 900x600 2024-04-19 08:54:22 +02:00
Norman Feske
9e69c7301a sculpt: safeguard the offering of suspend/resume
The USB host controller gets restarted during the suspend-resume cycle.
Hence, don't offer suspend while any USB storage device is in use, in
particular when deploying Sculpt from a USB stick.

Suspend/resume is not supposed to work with any framebuffer driver other
than intel_fb. Therefore, offer the suspend feature only when using intel_fb.

Issue #5174
2024-04-19 08:54:22 +02:00
Josef Söntgen
f2b921f380 pc_wifi: add iommu_device_unuse_default_domain dummy
Issue #5185.
2024-04-19 08:54:22 +02:00
Christian Helmuth
87ea807136 test-signal: print signals per activation in stress test 2024-04-19 08:54:22 +02:00
Alexander Boettcher
7e23b704f0 sculpt: disable serial output when LOG!=core
Issue #5180
2024-04-19 08:54:22 +02:00
Norman Feske
0a5e174d78 sculpt/usb/default: add device-assignment example
Issue #5174
2024-04-19 08:54:21 +02:00
Norman Feske
c6aa50ec56 dialog: don't scroll beyond text bounds
Issue #5174
2024-04-19 08:54:21 +02:00
Christian Helmuth
f8c420a78b file_vault_client.run: epit timer requires IO_MEM 2024-04-19 08:54:21 +02:00
Norman Feske
4a6ab846e5 sculpt: restore heartbeat watchdog for intel_fb
The automatic restart of intel_fb got lost during the transition from
the driver manager. This commit restores the heartbeat monitoring of
this driver.

Issue #5174
2024-04-19 08:54:21 +02:00
Norman Feske
f34bf0d19e sculpt: power options (suspend, reset, power off)
This patch enhances the sculpt manager to drive the system state
and manage the lifecycle of driver components during suspend-
resume cycles.

The new Power options can be found in the System menu. The suspend
and power-off controls are presented only when the acpi-support
option is activated.

Note that the USB controller is hard restarted when resuming from
suspend. Hence, all components that depend on USB are restarted
implicitely.

Issue #5180
Issue #5174
2024-04-19 08:54:21 +02:00
Johannes Schlatow
29e21bff7f platform/pc: implement IOMMU suspend/resume
genodelabs/genode#5180
2024-04-19 08:54:21 +02:00
Johannes Schlatow
7441aba6d5 platform: add suspend/resume interface to Io_mmu
genodelabs/genode#5180
2024-04-19 08:54:21 +02:00
Christian Helmuth
8cd206a050 sculpt: don't pre-populate /report/runtime/wifi_drv
Issue #5174
2024-04-19 08:54:21 +02:00
Christian Helmuth
def630c3db sculpt_manager: remove obsolete "storage" node
Issue #5174
2024-04-19 08:54:21 +02:00
Alexander Boettcher
b97e549dc4 intel/gpu: reset framebuffer part of ggtt
on display client close (intel_fb). The former code constructed a
temporary object on the stack, which sets up the scratch pages for the
closed client. However, the scratch page backing store (dma_buffer) gets
freed on destruction of the temporary stack object, which leads to DMA faults
with visual noise on the screen. Instead, use the already in use ggtt object
and add the scratch pages explicitly.

Issue #5180
2024-04-19 08:54:21 +02:00
Alexander Boettcher
d52af2ac94 os: avoid state names in system ROM
for ahci/gpu/nvme. Instead conclude from empty and non empty system state
to resume or stop driver.

Issue #5180
2024-04-19 08:54:21 +02:00
Norman Feske
7c7c4e80e1 sculpt: attach nic and wifi to hardware node
This makes the grouping of these two drivers consistent with the
other drivers.

Issue #5174
2024-04-19 08:54:21 +02:00
Norman Feske
dcd4578585 run: rename hw boot/image.elf -> boot/image-hw.elf
This disambiguates the boot images installed for base-hw from those
installed for base-nova.

Note that the image.elf file for other kernels (i.e., NOVA) is not
named image-<kernel>.elf at this point because this would prevent the
update from a pre-24.04 Sculpt system to a later one as the grub.cfg
is not touched by the old update mechanism. So after a system update,
grub would keep loading the last installed image.elf.

Issue #5182
2024-04-19 08:54:21 +02:00
Josef Söntgen
e1ebcd8019 record_play_mixer: report Play and Record sessions
The state-report now contains all active Play and Record sessions
and will get updated whenever a session is created or destroyed.

Issue #5174.
2024-04-19 08:54:21 +02:00
Josef Söntgen
e0f5a2ddc5 record_play_mixer: report set version in state
Give the version in the state-report only if it is set.

Issue #5174.
2024-04-19 08:54:21 +02:00
Josef Söntgen
c822dc0f18 sculpt: default rules in audio and mixer launchers
Issue #5174.
2024-04-19 08:54:21 +02:00
Christian Prochaska
08ecddf5ca libc: limit repeating 'fcntl' error messages
Issue #5174
2024-04-19 08:54:21 +02:00
Christian Helmuth
f86bba3059 ps2: probe for working i8042
If no working controller is detected the driver just enters sleep
forever.

Issue #5174
2024-04-19 08:54:21 +02:00
Josef Söntgen
2be57e4156 fetchurl: add 'verbose' config option
This commit introduces a config option to enable verbose operations.
This can be used to ease debugging.

Issue #5184.
2024-04-19 08:54:21 +02:00
Josef Söntgen
344831ec06 curl: update to version 8.7.1
This commits updates the contrib sources to version 8.7.1.

This version requires more random entropy as it queries OpenSSL
about the current random state and will bail if it is not sufficient.
Doubling the content of the '<inline>' VFS plugin as used in static
configurations seems satisfactory.

Furthermore DNS resolving needs a configured '<pipe>' plugin to work
properly.

Fixes #5184.
2024-04-19 08:54:21 +02:00
Stefan Kalkowski
1bdff41544 genode_c_api usb: always return valid capability
Instead of returning an invalid capability whenever an interface is
requested that does not exist, create a disconnected interface component.
It is also possible that a client requests an interface that got removed
at the same time. When an invalid capability gets returned, a client
can stumble about invoking it.
Moreover, this commit marks either invalid interface or device components
as disconnected objects to optimize their handling.

Ref genodelabs/genode#5021
2024-04-19 08:54:21 +02:00
Norman Feske
fe144a6c5f sculpt: increase text-edit quota
This is an intermediate solution for accommodating overly long
text lines that can appear in report/runtime/usb/devices in the
presence of long product strings.

Issue #5174
2024-04-19 08:54:21 +02:00
Stefan Kalkowski
aefbc47c56 hw: preserve slack time, favor activated jobs
In the scheduler's implementation preserve the consumed slack-time
over periods of activation/deactivation, but instead of appending
activated jobs to the end of the slack queue, insert it as new head.
Thereby, the extreme discrimination of threads with short execution
times and frequent blocking behaviour against long running computations
gets avoided.

Fix genodelabs/genode#4796
2024-04-19 08:54:21 +02:00
Norman Feske
4e78e91bc2 sculpt: sanitize keyboard-layout choice
The check handles the case when the user clicks right of the
radio-button text, yielding an invalid "matching" id. This should not
result in any action.

Issue #5174
2024-04-19 08:54:20 +02:00
Norman Feske
e1ab69491c sculpt: fix focus between inspect and file edit
Issue #5174
2024-04-19 08:54:20 +02:00
Norman Feske
8319f047d2 sculpt: launcher for recall_fs
Issue #5174
2024-04-19 08:54:20 +02:00
Norman Feske
49f3eca476 os: recipe and launcher for pkg/waveform_player 2024-04-19 08:54:20 +02:00
Alexander Boettcher
14b3a0c794 platform/pc: support poweroff
If the support for S5 is announced via the sleep_state report, the
pc_platform_drv now issues the S5 (poweroff) via Pd::system_control.

Issue #5180
2024-04-19 08:54:20 +02:00
Alexander Boettcher
4c79f948ab platform/pc: support to suspend via system_control
When the "system" ROM state turns to "suspend",
the S3 state information of the sleep_states ROM are determined and
are used to invoke the privileged Pd::system_control call.

Issue #5180
2024-04-19 08:54:20 +02:00
Alexander Boettcher
94b3e30f90 acpica: report last completed action
triggered by the "system" ROM change. With this information the consumers
of the sleep_states report can determine, when the operation is finished.

Issue #5180
2024-04-19 08:54:20 +02:00
Alexander Boettcher
3471fce672 sculpt: add acpi_support launcher
Issue #5180
2024-04-19 08:54:20 +02:00
Josef Söntgen
75e1f1797d sculpt_manager: raise runtime_view RAM quota
Issue #5174.
2024-04-19 08:54:20 +02:00
Josef Söntgen
d858a600f7 sculpt: raise max supported display resolution
This commit raise various quota to accommodate using a display
resolution of up to '3840x2160' in the static parts, e.g. the
leitzentrale, of Sculpt.

Issue #5174.
2024-04-19 08:54:20 +02:00
Josef Söntgen
5dce61563e pc_intel_fb: configure max framebuffer memory
This commit introduces the means to configure the framebuffer memory
used by the driver for sizing its buffers.

Originally the avail memory was derived from the avail ram in the PD
session, which roughly corresponds to configured RAM quota.
However, since it is only used in a virtual capacity, we can decouple
it from the actual memory and set to a value that accommodates larger
framebuffer resolutions like 3840x2160. If the configured RAM quota
is not enough to satisfy an allocation request the client will issue
a resource request.

Issue #5174.
2024-04-19 08:54:20 +02:00
Norman Feske
b086996438 sculpt: update falkon_web_browser pkg
Issue #5174
2024-04-19 08:54:20 +02:00
Norman Feske
694eb3f40d sculpt: launcher for system clock
Issue #5174
2024-04-19 08:52:41 +02:00
Norman Feske
4c4adec5ad sculpt: reset routing dialog after add-component
Issue #5174
2024-04-19 08:52:41 +02:00
Norman Feske
22f0ab926b sculpt: adjust leitzentrale priorities 2024-04-19 08:52:05 +02:00
Norman Feske
29960db32c sculpt: provide empty usb default policy
This avoids service-denied errors of USB clients like VBox at
integration time when client-specific policy exists yet.

Issue #5174
2024-04-15 16:39:16 +02:00
Norman Feske
22a731b671 sculpt: make popup dialog scrollable
This patch complements "sculpt: make component graph scrollable" with
the ability to scroll the popup dialog, which is sometimes needed in the
presence of many services as routing options.

Fixes #5183
2024-04-12 17:44:19 +02:00
Norman Feske
7df19173af sculpt: make component graph scrollable
This patch allows the user to vertically scroll the component graph
either via the scroll wheel or via the page up/down keys.

Issue #5183
2024-04-12 17:10:55 +02:00
Christian Helmuth
c4f75f49e5 depot_autopilot: skip test-read_only_rom on linux
Fixes #3414
2024-04-12 16:48:37 +02:00
Norman Feske
a5dcb8494e sculpt: include grub.cfg in system update
Issue #5182
2024-04-12 16:26:32 +02:00
Alexander Boettcher
3af3773c60 record_play_mixer: avoid warning on halted session
Issue #5175
2024-04-12 16:14:52 +02:00
Christian Prochaska
c551b4dfb3 qt5: build qmake projects with debug infos
Fixes #5181
2024-04-12 15:51:31 +02:00
Christian Prochaska
dcf5b5052a qt5: add '.qmake.conf' to example recipes
Fixes #5179
2024-04-12 15:51:30 +02:00
Josef Söntgen
0ad6faeeaa wifi: fix using out-dated scan timer
Commit 'wifi_drv: re-arm scan timer when enabled again' allowed for
re-arming the scan timer but still uses the old timer value the first
time around. If the timer was disabled, by setting the interval to 0,
it was not enabled again.

We now check if the interval has changed beforehand and potentially
arm the scan timer afterwards.

Fixes #5178.
2024-04-12 15:48:52 +02:00
Christian Helmuth
dc0e78cdf8 depot: update recipe hashes 2024-04-12 15:08:01 +02:00
Christian Prochaska
7fca026b48 sculpt_manager: check devices ROM before fb driver start
Issue #5174
2024-04-12 15:08:01 +02:00
Josef Söntgen
24d0c18193 libc: print unknown fcntl command in hex
This skimps the manual conversion step and eases diagnostic
operations.

Issue #5167.
2024-04-12 15:08:01 +02:00
Josef Söntgen
49548fea07 libc: allow sample rate change via SNDCTL
Allow the current VFS OSS plugin to requested different sample rates.

Issue #5167.
2024-04-12 15:08:01 +02:00
Josef Söntgen
d0aa8362db vfs/oss: support different sample rates
This commit introduces support for different samples rates. For now
the range is capped to 8kHz up to 48kHz.

Issue #5167.
2024-04-12 15:08:01 +02:00
Josef Söntgen
33735d0af8 Add plugin version to VFS OSS plugins
To differentiate between the legacy and the current VFS OSS plugin both
plugins will feature a 'plugin_version' field in its info file. This
is used for enabling features provide by the current version that are
not supported in the legacy one.

Issue #5167.
2024-04-12 15:08:01 +02:00
Josef Söntgen
4a9e6a001f sculpt: add audio and mixer launcher
The audio launcher configures the 'bsd_audio_drv' component for normal
use where the micrphone selection should work on most Thinkpads.

The mixer launcher configures the 'record_play_mixer' component for
use with the 'audio' launcher and provides also examplary rules for
vbox6 launchers.
2024-04-12 15:08:01 +02:00
Josef Söntgen
798087c5ad dde_bsd: use 'mic_' prefix for Play sessions
This commit prefixes the Play sessions of the audio driver so that
these can be matched differently in the 'record_play_mixer' config.

The same could be archived with re-labling but naming the sessions
differently at the source prevents accidental mis-configuration.

Issue #5167.
2024-04-12 15:08:01 +02:00
Josef Söntgen
e27fad7c9a sculpt_distribution: replace mixer pkg
The pkg is superseded by the 'record_play_mixer'.

Issue #5167.
2024-04-12 15:08:01 +02:00
Johannes Schlatow
76176a196d Enable Intel HD Graphics 500 (found in ZimaBlade)
The IHD500 is almost a gen9 (skylake) GPU with subtle differences. Linux
maintains a separate feature set `GEN9_LP_FEATURES` for this GPU.
However, foisting the GPU as skylake on the GPU drivers seems to work
quite fine.

genodelabs/genode#5177
2024-04-12 15:08:01 +02:00
Johannes Schlatow
8b43554a27 gpu/intel: do not clflush on MMIO but on ppgtt
Executing a clflush operation on MMIO memory freezes embedded
platforms such as the Celeron N3450 used on the ZimaBlade. Looking into
the current linux code confirms that clflush is only used for ppgtt
entries and not on MMIO memory.

Fixes #5176
2024-04-12 15:08:01 +02:00
Johannes Schlatow
7a042925fc platform: catch denied IO_MEM-session
In case core denies an IO_MEM session, the platform driver should
survive and hand out an invalid capability instead.

genodelabs/genode#5174
2024-04-12 15:08:01 +02:00
Norman Feske
edaff9fb96 sculpt: adjust leitzentrale priority
Since "sculpt: adjust nitpicker priority", the nitpicker GUI server no
longer runs at the highest priority, yet the runtime_view of the
leitzentrale UI continued to operate at the highest priority.
On slower machines, this results in a visible interference of the CPU-
heavy rendering of the runtime_view with the (now) lower-prioritized
nitpicker, in particular laggy pointer movements.

This commit subordinates the leitzentrale components below the priority
of nitpicker to prevent this interference.

It also simplifies the priority scheme at the static system init: The
timer has the highest priority whereas all other components use the
priority band -1.

Issue #5174
2024-04-12 15:08:01 +02:00
Norman Feske
a1e3f9a73e sculpt: allow RAM fs to grow up to 2 GiB
The hard resource limit introduced by "sculpt: upper limit for automatic
quota upgrading" is too conservative for typical use cases of the RAM
fs. This commit makes the limit adjustable per managed component and
relaxes the limit for the RAM fs and depot_rom from 256 MiB to 2 GiB.

Issue #5174
2024-04-12 15:08:01 +02:00
Sebastian Sumpf
5d56340568 vfs_lxip: return WRITE_ERR_WOULD_BLOCK on EAGAIN
Because all operations in lxip are non-blocking, return
WRITE_ERR_WOULD_BLOCK for data writes as done by read.

Note: This was not the case in the old plugin because 'write' was blocking
operation there.

issue #5165
2024-04-12 15:08:01 +02:00
Sebastian Sumpf
309a281b14 depot_autopilot.run: adjust TEST_MODULES to build_artifacts 2024-04-12 15:08:01 +02:00
Johannes Schlatow
536048592b hw: propagate write combining to page flags
Fixes #4799
2024-04-12 15:08:01 +02:00
Christian Prochaska
039a851003 gdb: prevent use of host libgmp in configure test
Fixes #5173
2024-04-12 15:08:01 +02:00
Josef Söntgen
fd60e5a8b2 pc_wifi: provide iwlwifi LED related dummies
These generated dummies slipped in when the commit
'pc_linux: enable gpio, audio' got merged and mainly concern old devices
from the 6xxx series.

The functions are normally guarded via 'CONFIG_IWLWIFI_LEDS' but due to
the olddefconfig step when generating our pc_linux config using
LX_DISABLE has no effect.

Issue #5066.
2024-04-12 15:08:01 +02:00
Christian Helmuth
f83487869d tool/xkb2ifcfg: adapt to current Genode version
Thanks Florian for the nudge.
2024-04-12 15:08:01 +02:00
Alexander Boettcher
f59883427f sculpt_manager: provide platform_info for boot_fb
Issue #5174
2024-04-12 15:08:00 +02:00
Norman Feske
8875e3b879 dialog: allow out-of-view cursor when scrolling
This patch relaxes the counter-intuitive enforcement of keeping the
text cursor always in view when using the scroll wheel.

Issue #5174
2024-04-12 15:08:00 +02:00
Norman Feske
e04336d087 sculpt: driver-policy tweaks
Allow tweaking the driver selection using the manager config:

- The new attribute 'ps2="no"' suppresses the selection of the PS/2 driver.
- The new attribute 'intel_gpu="no"'suppresses the selection of the
  Intel GPU and fb drivers, letting Sculpt fall back to VESA or boot-fb.

Note that the dynamic change of those attributes is handled in principle
but not advisable. E.g., disabling the intel driver after startup leaves
the hardware in a state that the VESA driver cannot cope with. However,
when statically defining the attributes in sculpt/manager/default, it is
now possible to build an image that uses VESA on an intel machine.

Issue #5174
2024-04-12 15:08:00 +02:00
Christian Helmuth
fd5f8c0ee1 fb_sdl: filter key-repeat events (fixes #5172) 2024-04-12 15:08:00 +02:00
Norman Feske
3f66bf25aa sculpt: restore wifi and nic restart option
Issue #5174
2024-04-12 15:08:00 +02:00
Norman Feske
594da536c7 sculpt/default-pc: add trace_logger launcher
Issue #5174
2024-04-12 15:08:00 +02:00
Martin Stein
e5fce868fb file_vault_client.run: raise lock timeout and caps
The nightly Qemu tests that don't use KVM require more time for completing the
unlock-and-access phase of the test. If the lock phase starts to early, the
file access is interrupted and the output isn't as expected.

Furthermore, on FOC, the cap quota was insufficient.

Ref #5148
2024-04-12 15:08:00 +02:00
Norman Feske
cc41a06c89 sculpt: version 24.04
Issue #5174
2024-04-12 15:08:00 +02:00
Norman Feske
1f24eb2401 wm: avoid eager reuse of window IDs
The existing allocation scheme of window IDs has the unwelcome effect
that a re-appearing window would not always result in a visible change
of the window list. In such cases, the layouter and decorator would not
be prompted to do their job. This effect could be observered with the
multi-dialog version of menu view in Sculpt OS when manually enforcing
the restart of the runtime_view. Sometimes the panel would not re-appear
after the restart.

This patch changes the allocation of window ID such that new windows get
fresh IDs instead of reusing an ID of a recently disappeared window.

Issue #5170
2024-04-12 15:08:00 +02:00
Stefan Kalkowski
4775dad26c usb_hid_raw.run: eliminate race in test metric
Rarely. it might happen that events got received shortly before the complete
set of relevant USB devices got recognized. Filter more output in test metric
to stay robust.
2024-04-12 15:08:00 +02:00
Martin Stein
047f130005 tresor_tester.run: clean up
Ref #5148
2024-04-12 15:08:00 +02:00
Martin Stein
b7049b5321 tresor_tester.run: slim down tests
This substantially slims down the test in order to reduce the number nightly
tests that fail due to timeouts. Now, the extended test steps (maximum trees
and benchmarks) are only run on Linux. The synchronous access, snapshot
management, rekeying, and resizing tests were removed.

Ref #5148
2024-04-12 15:08:00 +02:00
Martin Stein
0404cc6907 file_vault/file_vault_client: recalibrate quota
Recalibrates RAM and CAP quota in app and test in order for the
file_vault_client test to succeed on qemu/x86_64/sel4 and qemu/pbxa9/foc.

Ref #5148
2024-04-12 15:08:00 +02:00
Norman Feske
ac2d708205 sculpt: use one menu_view for all dialogs
This patch replaces the former use of one menu-view component per dialog
by a single menu view presenting all dialogs. This change reduces the
runtime config by about 20%, improves the boot time, and lowers RAM and
CPU usage at runtime.

Issue #5170
2024-04-12 15:08:00 +02:00
Norman Feske
9ce7c72c7c dialog: use one menu_view for multiple dialogs
Issue #5170
2024-04-12 15:08:00 +02:00
Norman Feske
d6cb9cf854 menu_view: make font-style updates more robust
The font pointers cached in labels can become dangling when the style
database is updated, as happens when changing the font size dynamically.
This patch orderly updates the cached pointers before removing
out-of-date font entries from the style database.

Related to issue #5170
2024-04-12 15:08:00 +02:00
Norman Feske
550dea7279 menu_view: support multiple dialogs
This patch equips the menu-view component with the ability to present
more than one dialog at a time. The dialogs must be declared in the
<config> node as follows.

  <config>
    ...
    <dialog name="settings"/>
  </config

For each dialog, menu view requests a dedicated ROM session labeled after
the dialog name. The corresponding GUI session is also labeled as such.
Note that only one hover report is generated responding to all dialogs.
The hover report can be correlated with the hovered dialog by inspecting
the the 'name' attribute of the hover report's <dialog> sub node.

The former global config attributes 'xpos', 'ypos', 'width', 'height',
'opaque', and 'background' have become attributes of the <dialog> node.

Fixes #5170
2024-04-12 15:08:00 +02:00
Johannes Schlatow
881f443bbe sculpt: only add log_kernel if used with nova
Fixes genodelabs/genode#5171
2024-04-12 15:08:00 +02:00
Norman Feske
96acb3412f gems: add missing import to dialog.run 2024-04-12 15:08:00 +02:00
Norman Feske
a3f04d2b4d sculpt: remove GPU routes to outside the runtime
GPU drivers always reside in the runtime subsystem now.
This patch eliminates the risk of requesting a GPU session at the
drivers subsystem, which never gets established.

Issue #5150
2024-04-12 15:08:00 +02:00
Josef Söntgen
b2a68211a4 black_hole: add Play and Record session
This commit introduces support for the Play and Record session to
the black hole component in the most minimal way possible.

Fixes #5157.
2024-04-12 15:08:00 +02:00
Josef Söntgen
bda86b8f15 vbox6: switch pkgs to new VFS OSS plugin
Issue genodelabs/genode#5167.
2024-04-12 15:08:00 +02:00
Josef Söntgen
5f88562263 gems: VFS OSS plugin for Record/Play session
The new VFS OSS plugin utilizes the Record and Play session. For the
time being it is a drop-in replacement for the old plugin and shares
its limitations.

In contrast to the old plugin it is possible to force a client to
use a configured fragment size. Some clients work best with larger
fragments, e.g. VBox, where raising the minimal fragment size is
beneficial.

Please look at the README file for more information.

Issue genodelabs/genode#5167.
2024-04-12 15:08:00 +02:00
Josef Söntgen
e61b804252 libports: add test/oss recipes
Add recipes that allow for using the OSS-based test component
on Sculpt.

Issue genodelabs/genode#5167.
2024-04-12 15:07:19 +02:00
Josef Söntgen
c9d70552a4 Rename vfs_oss to vfs_legacy_oss
Rename the old VFS OSS plugin using Audio_out and Audio_in sessions
and adapt users accordingly.

Issue genodelabs/genode#5167.
2024-04-12 15:05:47 +02:00
Josef Söntgen
600e5424a5 os: add pkg for record_player_mixer
Issue genodelabs/genode#5167.
2024-04-12 15:05:47 +02:00
Josef Söntgen
489d87c4b0 sculpt: add Play and Record session
Issue genodelabs/genode#5167.
2024-04-12 15:05:46 +02:00
Josef Söntgen
b9c8c8c2a5 sculpt: adjust nitpicker priority
Move nitpicker to the driver priority in the runtime to lessen
interference with high-priority runtime components.

Issue genodelabs/genode#5167.
2024-04-12 15:05:46 +02:00
Josef Söntgen
a6b8d382a9 dde_bsd: remove diagnostic depletion message
Issue genodelabs/genode#5167.
2024-04-12 15:05:46 +02:00
Josef Söntgen
22281c18ec gems: add rom_osci pkg recipe
Issue genodelabs/genode#5167.
2024-04-12 15:05:46 +02:00
Josef Söntgen
2da94bb702 os: add record_rom pkg recipe
Issue genodelabs/genode#5167.
2024-04-12 15:05:46 +02:00
Norman Feske
268a77add1 sculpt: redesigned popup dialog
The new popup dialog mirrors the concept of the software add and option
dialogs of the phone version.

Fixes #5168
2024-04-12 15:05:46 +02:00
Norman Feske
9ea99a896a sculpt: add launcher/black_hole 2024-04-12 15:05:46 +02:00
Martin Stein
fbec6ae030 file_vault_client.run: raise access timeout
On some platforms like qemu/x86_64/sel4, accessing the file system is so
slow that it used to hit the timeout of this phase in the run script.

Ref #5148
2024-04-12 15:05:46 +02:00
Martin Stein
a7ff30d5a4 file_vault_client.run: disable for riscv
Ref #5148
2024-04-12 15:05:46 +02:00
Martin Stein
0ef92baf9d tresor_tester.run: raise block_io_fs caps
On platform imx6q_sabrelite/arm_v7a/imx6q_sabrelite/sel4, the test used to
fail because of a resource request.

Ref #5148
2024-04-12 15:05:46 +02:00
Martin Stein
5cb5610906 tresor_tester.run: raise test timeout
Some platforms (especially the qemu-based ones) used to time out on
nightly tests although they would have succeeded with more time.

Ref #5148
2024-04-12 15:05:46 +02:00
Norman Feske
4a1a29b3d0 sculpt: make storage target configurable
This patch lays the selection of the used storage target into the hands
of the config/manager file. By default, Sculpt selects the target by its
built-in heuristics, probing for a Sculpt partition. However, by
specifying a <target> node, one can explicitly select a storage target.

E.g., for using the 2nd partition of the SATA disk connected to port 1
of the AHCI controller, one can now specify:

  <target driver="ahci" port="1" partition="2"/>

For selecting the ram_fs as target:

  <target driver="ram_fs"/>

The latter case is particularly useful for custom Sculpt scenarios
deployed entirely from RAM. For such scenarios, add two lines to
your .sculpt file:

  ram_fs:  depot
  manager: use_ram_fs

The first line configures the ram_fs such that the depot is mounted
as a tar archive. The second line configures the sculpt manager to
select the ram_fs as storage target. You can find this feature
exemplified in default-linux.sculpt scenario.

  build/x86_64$ make run/sculpt_test KERNEL=linux BOARD=linux

It is worth noting that the configuration can be changed at runtime.
This allows for switching between different storage targets on the fly.

Issue #5166
2024-04-12 15:05:46 +02:00
Norman Feske
508e0bdfbf sculpt: introduce config/manager
The new 'manager' config allows for the passing of configuration data the
sculpt manager without the need to modify the config/leitzentrale subsystem.

Issue #5166
2024-04-12 15:05:14 +02:00
Stefan Kalkowski
2f0fe562ec os: packet_allocator needs size for free
Unlike the previous return value of
`Genode::Packet_allocator::need_size_for_free()` indicated, it does need
the size of the object it has to free to work properly.
2024-04-12 15:05:14 +02:00
Martin Stein
84285881f3 vfs_rump: fix missing create arg in open
The plugin used to call open with the create flag set at rump without file
permissions for create leading to undefined behavior regarding the file
permissions.

Ref #5148
2024-04-12 15:05:14 +02:00
Sebastian Sumpf
65dfd2f9a8 lxip: add ECONNRESET errno
The ECONNRESET/GENODE_ECONNRESET errno was not handled in lxip.

issue #5165
related #5161
2024-04-12 15:02:45 +02:00
Sebastian Sumpf
1056c759fd vfs_lxip: propagate data file write error
All errors (as in the legacy version) are now propagated as WRITE_ERR_IO
(see Lxip_vfs_file_handle::write), which ultimately will lead to EPIPE
in libc's socket_fs. This also counts for EAGAIN leading to the fact
that partial writes are not supported for blocking sockets in libc, also
libc will not try a second time in case not all data has been written.

issue #5165
2024-04-12 15:02:45 +02:00
Sebastian Sumpf
b30bacf86e lxip: shadow asm-generic/access_ok.h
The IP stack checks "user" pointer access, for example, for iov's using
'access_ok' which in turn calls '__access_ok'. The function checks if the
pointer is below TASK_SIZE_MAX, which is usually a big value on 64 bit
systems, but 3GB on 32 bit systems. Because the IP stack is mostly used with
Genode's libc, where pointers on some kernels (base-linux) can be >3GB and we
don't want to make an additional copy of each buffer/iov interacting with the
IP stack, we short circuit the function

issue #5165
2024-04-12 15:02:45 +02:00
Norman Feske
b78b2c7ac9 sculpt_manager: use Rom_handler
This patch replaces the dynamic use of Attached_rom_dataspace by a
new Rom_handler utility, which implicitly covers the initial import of
content (safely using 'local_submit'), the registration of the signal
handler, passes the Xml_node to the handler function (no need to
manually call 'update'), and provides scoped access to the content via a
'with_xml' method. The latter reinforces a programming style that does
not need to copy Xml_node objects.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
f96cea8151 sculpt: remove notion of system 'block_devices'
This patch removes the remains of the original block-device discovery as
done by the former driver manager. Block sessions are now always
provided by components hosted in the runtime subsytem. The storage node
of the graph is no more.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
0cf12c6778 gems: use C++20 function template syntax 2024-04-12 15:02:45 +02:00
Norman Feske
4dc1014bfb gems: coding style (avoid superfluous '()' pairs) 2024-04-12 15:02:45 +02:00
Norman Feske
6cabc85ac8 sculpt: group driver management in 'Drivers' class
This patch harmonizes the driver management between the sculpt manager
and the phone manager by hosting the individual drivers in a new
'Drivers' class with a narrow interface towards 'Sculpt::Main'. The
patch also introduces a clean separation of the 'Board_info' between
features detected at runtime (on PC hardware), statically
known/managed features (phone hardware), and options that can be
toggled at runtime.

With common patterns for managing drivers in place now, this commit
also moves the former runtime/wifi_drv.cc and runtime/nic_drv.cc
code to driver/wifi.h and driver/nic.h. The _drv suffix of the wifi
and nic driver components have been dropped.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
b7bbf8f7e4 sculpt.run: remove outdated session routes
The move of block, USB, and input drivers from the drivers subsystem to
the runtime alleviates the need for routing those sessions between the
subsystems.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
d8acc3a9f4 sculpt: host MMC driver in runtime
Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
d13b8e1937 sculpt: host soc touch and fb drivers in runtime
This patch moves SoC-specific framebuffer and touchscreen drivers
(PinePhone) to the runtime subsystem. They are enabled for the
phone_manager.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
85e020b8e1 gems: remove driver_manager
The former pkg/drivers_managed-pc has been replaced by the
pkg/sculpt_drivers-pc, which is merely a collection of archives.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
99da68183f sculpt: abbreviate .part_block suffix to .part
This slightly reduces the horizontal space of the component graph.
2024-04-12 15:02:45 +02:00
Norman Feske
fe596f2219 sculpt: host NVMe driver in runtime
As the NVMe driver was the last remaining driver controlled by the
driver manager, this patch removes the 'drivers -> dynamic' subsystem
along with the driver manager from sculpt/drivers/pc.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
206bf856bb sculpt: host AHCI driver in runtime
This patch moves the AHCI driver from the 'drivers -> dynamic'
subsystem to the runtime, managed by the sculpt_manager. One
implication of this change is the new need to supplement a device
port number to the 'Storage_target', in addition to the existing
label and partition. Previously, each block device was addressed by
merely a label specified for a parent session. The meanings of the
'Storage_target' elements are now as follows.

- The label corresponds to the driver component providing the storage.
- The port is used as block-session label when opening the session
  at the driver.
- The partition(s) denote the partition information contained in
  the block session.

Components operating as clients of the AHCI driver (e.g., a file system)
refer to their storage target as <label>-<port>.<partition> when a port
is defined (for AHCI). For drivers w/o ports, like USB storage where
each USB-block driver correponds to only one device, the storage target
is denoted as <label>.<partition>. When no partition table is present,
the '.<partition>' part is omitted.

Issue #5150
2024-04-12 15:02:45 +02:00
Norman Feske
e3803fb861 sculpt: host PS/2 driver in runtime
Issue #5150
2024-04-12 15:02:44 +02:00
Norman Feske
556a7b8b17 sculpt: host PC USB driver in runtime
This commit moves the USB and USB HID driver from the drivers subsystem
into the runtime. The former special USB node of the graph corresponds
now to the USB host-controller driver (named "usb"). The management
options for USB storage devices are available inside this component
node now.

Issue #5150
2024-04-12 15:02:44 +02:00
Norman Feske
3580bb6e17 sculpt: move event_filter to static system
By moving the event_filter and the numlock_remap_rom from the drivers
subsystem to the static system, the filtering can be applied to drivers
hosted in the runtime and drivers hosted in the drivers subsystem.

This is a preparatory step for moving the USB host and HID drivers to
the runtime.

Issue #5150
2024-04-12 15:02:44 +02:00
Norman Feske
06c4b0248b sculpt: upper limit for automatic quota upgrading 2024-04-12 15:02:44 +02:00
Martin Stein
e53b00aafb run/file_vault_client: remove troublesome § char
Ref #5148
2024-04-12 15:02:44 +02:00
Martin Stein
5907307af6 file_vault: re-enable support for 32-bit platforms
Ref #5148
2024-04-12 15:00:46 +02:00
Christian Helmuth
f3610dc3a8 sel4: prevent stdout/stderr truncation in cmake
Remove the "excellent" idea to re-open /dev/stdout etc. for redirection as
cmake uses open(O_TRUNC) and, thus, truncates log output of outer
redirections.
2024-04-12 15:00:46 +02:00
Johannes Schlatow
9971f41f8c platform/pc: fix IOMMU fault reporting
When the kernel does interrupt remapping, we cannot get a non-remapped MSI
for fault event interrupts. We therefore let the kernel do the fault
reporting in this case.

genodelabs/genode#5066
2024-04-12 15:00:46 +02:00
Christian Helmuth
c54e8ec3e2 lx_emul: init pci_dev::error_state
pci_channel_offline() checks if this member is set to
pci_channel_io_normal (which is 1). The former value of 0 is invalid.

This change fixes pc_nic_drv link down-up in cases that require an e1000
reset.
2024-04-12 15:00:46 +02:00
Christian Helmuth
e691af4e97 pc_nic_drv: basic rtnetlink for lock/unlock and netdev_run_todo() 2024-04-12 15:00:46 +02:00
Christian Helmuth
38d2b8d46a lx_emul: function to generate trace messages
lx_emul_trace_msg() uses Genode::trace() as message function for
lightweight trace points, but also supports Linux format-string
attributes by using vsnprintf().
2024-04-12 15:00:46 +02:00
Christian Helmuth
66286d6f17 dde_linux: remove custom *printf implementation
The DDE uses Linux-internal formatted printk for a while now, thus
remove the unused code.
2024-04-12 15:00:46 +02:00
Christian Helmuth
5ff1ef82d1 lx_kit: preserve priority order in scheduler 2024-04-12 15:00:46 +02:00
Christian Helmuth
68925a6d33 pc/lx_emul: enable HIGH_RES_TIMERS
Only with high-resolution timers enabled timouts can fire between two
jiffies. The option is enabled on all relevant platforms but
unfortunately disabled by tinyconfig.

This option also permits the use of CONFIG_SND_HRTIMER.
2024-04-12 15:00:46 +02:00
Martin Stein
b903ddeea7 tresor: fix and test handling of minimal trees
* add testing of trees with minimal and maximal dimensions to tresor_tester.run
* replace tresor_init-local configuration type with simpler and more conformant
  configuration type in tresor/types.h that does also XML-parsing and
  XML-generation of configurations
* raise min degree to 2 because a degree of 1 is not practical und would
  require additional logic
* fix overflow with num_blocks=0 in Superblock_control::Read|Write_vbas
* fix off-by-one bug regarding the number of levels in Vbd_initializer
* improve sanity checks in Tree_configuration constructors
* document level indices in tresor_init/README
* fix size of some arrays in order to be able to handle the maximum number of
  tree levels

Ref #5077
2024-04-12 15:00:46 +02:00
Martin Stein
067a8a35cd tresor: fix faults on failed free-tree requests
* fixes two places, where the free tree module used to continue to process a
  request after actually having determined that the request fails
* moves the functionality of checking the hash of a read block and decoding it
  to a dedicated method in order to improve readability

Ref #5077
2024-04-12 15:00:46 +02:00
Martin Stein
81b17ba1e4 tresor_tester: check uninitialized vba data
Adds a new command attribute "uninitialized_data" to the Tresor Tester
configuration. If a <request op="read"> command has this attribute set to "yes"
it assumes the read blocks to be uninitialized and therefore contain only 0's.
Note, that a command that has "uninitialized_data" set to "yes" cannot have the
attribute "salt".

Ref #5077
2024-04-12 15:00:46 +02:00
Martin Stein
4a68f6bf75 tresor: discard snapshots only when writing the sb
Snapshots must only be removed when securing the superblock. Otherwise, the
last secured superblock might get corrupted. The Free Tree allocation algorithm
would not consider the deleted snapshots anymore although they are still active
in the secured superblock and re-use their blocks. This would render the tresor
container unusable if the superblock with the deleted snapshots is not secured
in the end (driver crash, power down, ...).

Ref #5077
2024-04-12 15:00:46 +02:00
Martin Stein
518c32e1af tresor: don't decode superblock before hash check
Superblock_control::Initialize used to decode a read superblock before checking
its hash. This is not necessary but may cause the operation to end up in a
decoding error on a superblock that is not the desired one anyway.

Ref #5077
2024-04-12 15:00:45 +02:00
Martin Stein
016a769605 tresor: check only the last secured superblock
Instead of iterating over all superblocks and checking each valid one,
check only the one whose hash matches the hash stored in the trust anchor.
I.e., the last one that was secured to the trust anchor. We must assume that
the other superblocks were corrupted in the meantime by operating the Tresor
container and, anyway, these Superblocks are not used anymore.

Ref #5077
2024-04-12 15:00:45 +02:00
Martin Stein
d2af024349 tresor: don't halt on extension beyond limits
The request of extending a tree used to halt when it found that
it could not add more levels to the tree because the maximum level index was
reached. Now, the library simply marks the request as failed, leaving it to
the user to handle the error condition.

Ref #5077
2024-04-12 15:00:45 +02:00
Martin Stein
b4c4681733 tresor: streamline design further
* differentiates request types that where merged formerly per module;
  e.g. instead of type Superblock_control::Request, there are now types
  * Superblock_control::Read_vbas
  * Superblock_control::Write_vbas
  * Superblock_control::Rekey
  * Superblock_control::Initialize
  * ...
  each holding only the state and functionality that is required for exactly
  that request

* removes all classes of the Tresor module framework and adapts all
  Tresor- and File-Vault- related libs, apps, and tests accordingly
  * the former "channel" state is merged into the new request types, meaning, a
    request manages no longer only the "call" to a functionality but
    also the execution of that functionality; every request has a lifetime
    equal to the "call" and an execute method to be driven forward
  * state that is used by a request but has a longer lifetime (e.g. VFS file
    handles in Tresor::Crypto) is managed by the top level
    of the user and handed over via the execute arguments; however, the
    synchronization of multiple requests on this state is done by the module
    (e.g. Tresor::Crypto)
  * requests are now driven explicitly as first argument of the (overloaded)
    execute method of their module; the module can, however, stall a request
    by returning false without doing anything (used for synchronization on
    resources)

* introduces Request_helper, Generated_request and Generatable_request in the
  Tresor namespace in order to avoid the redundancy of sub-request generation
  and execution

* moves access to Client-Data pointers up to Tresor::Virtual_block_device in
  order to simplify Tresor::Block_io and Tresor::Crypto

* removes Tresor::Client_data and introduces pure interface
  Client_data_interface in order to remove  Tresor::Client_data and
  move management of Client Data to the top level of a Tresor user

* introduces pure interface Crypto_files_interface in order to move management
  of Crypto files to the top level of a Tresor user

* moves management of Block-IO and Trust-Anchor files to the top level of a
  Tresor user

* adapts all execute methods, so, that they return the progress state
  instead of modifying a reference argument

* removes Tresor::Request_and Tresor:Request and instead implements
  scheduling at the top level of the Tresor user
  * the Tresor Tester uses a list as schedule that holds Command objects; this
    list ensures, that commands are started in the order of configuration
    the Command type is a merge of the state of all possible commands that can
    be configured at the Tresor Tester; the actual Tresor requests (if any) are
    then allocated on-demand only
  * the Tresor VFS plugin does not use a dynamic data structure for scheduling;
    the plugin has 5 members that each reflect a distinct type of operation:
    * initialize operation
    * deinitialize operation
    * data operation
    * extend operation
    * rekey operation
    consequently, of each type, there can be only one operation in-flight at a
    time; at the user front-end each operation (except "initialize") can be
    controlled through a dedicated VFS file; for each of these files, the VFS
    expects only one handle to be open at a time and only one file operation
    (read, write, sync) active at a time; once an operation gets started it is
    finished without preemtion (except of the interleaving at rekey and
    extend); when multiple operations are waiting to be started the plugin
    follows a static priority scheme:

      init op > deinit op > data op > extend op > rekey op

    there are some operation-specific details
    * the initialize operation is started only by the plugin itself on startup
      and will be driven as side effect by subsequent user calls to file
      operations
    * the data file is the only contiguous file in the front end and the file
      operations work as on usual data files
    * the other 3 files are transactional files and the user is expected to
      follow this scheme when operating on them
      1) stat (to determine file size)
      2) seek to offset 0
      3) read entire file once (this will be queued until there is no operation
         of this type pending anymore and return the last result:
         "none" | "failed" | "succeeded"; used primarily for synchronization)
      4) write operation parameters (this returns immediately and marks the
         operation as "requested")
      5) read entire file once (the same as above but this time in order to
         determine the operation result)
    * the rekey op and deinitialize op are requested by writing "true"
    * the extend op is requested by writing "tree=[TREE], blocks=[BLOCKS]"
      where TREE is either "vbd" or "ft" and BLOCKS is the number of physical
      4K blocks by which the physical range of the tresor container expands
      (the physical range always starts at block address 0 and is always
      expanded upwards)

* replaces the former <trust-anchor op="initialize"> command at the Tresor
  Tester with <initialize-trust-achor> as there are no other trust anchor
  operations that can be requested through the Tester config anyway

* removes the "sync" attribute from all commands at the Tresor Tester except
  from <request op="rekey">, <request "extend_ft">, <request op="extend_vbd">;
  as the Tester controls scheduling now, requests are generally synchronous;
  at the rekeying and extension commands, the "sync" attribute determines
  wether subsequent commands are interleaved with the execution of these
  commands (if possible)

* removes "debug" config attribute from Tresor VFS plugin and reworks "verbose"
  attribute to generate more sensible output

* removes NONCOPYABLE macro and instead uses Genode::Noncopyable and in-place
  Constructors deletion

* introduces types Attr and Execute_attr where a constructor or execute method
  have many arguments in order to raise readability

* renames the "hashsum" file that is provided by the Tresor Trust-Anchor VFS
  plugin to "hash" in order to become conformant with the wording in the Tresor
  lib

* makes the VFS Tresor test an automated test by merging in the functionality
  of vfs_tresor_init.run and removing the interactive front end; removes
  vfs_tresor_init.run as it is not needed anymore; adds consideration for
  autopilot file structure in the Test and adds it to autopilot.list

* removes all snapshot controls and the progress files for rekeying and
  extending from the Tresor VFS plugin; both functionalities were tested
  only rudimentary by the VFS Tresor test and are not supported with the only
  real user, the File Vault

* use /* .. */ instead of // ..
* use (..) instead of { .. } in init lists

Ref #5148
2024-04-12 15:00:45 +02:00
Martin Stein
14f4aa6e05 tresor_utils.run: use [build_artifacts]
Ref #5148
2024-04-12 15:00:45 +02:00
Martin Stein
ef0c3f9d2c tresor_tester.run: fix asynchronous rekeying test
The virtual block device module used to hand over the wrong VBA as
parameter "rekeying VBA" to the Free Tree when allocating PBAs for data
access during rekeying. In certain constellations, this caused the Free
Tree to alloc PBAs that were still in use. The Free Tree PBA selection
algorithm, however, is just fine. When fixing the call parameter, it works
as desired. This re-enables the async rekeying test.

Ref #5075
2024-04-12 15:00:45 +02:00
Martin Stein
02ef158748 gems: add autopilot test 'file_vault_client'
The script tests the use of an encrypted file system that is created and
provided via the File Vault.

Furthermore the script can be used for test-driving existing File-Vault
containers (created with potentially older File-Vault versions) under the
current File-Vault version. This is done via the "LX_FS_DIR_TEMPLATE"
env variable.

Ref #5062
2024-04-12 15:00:45 +02:00
Martin Stein
fb2d153c92 tresor: check hash of all read vba data
During one of the many re-factorization steps that were applied to the Tresor
library and its predecessor, the CBE library, one of the main features of the
project, the integrity check, accidentally received a grave regression. The
most recent version of the Tresor still used to check all hashes of meta-data
blocks but ignored the hashes of the actual data blocks.

With this commit, the hashes of all but yet uninitialized data blocks get
checked. The reason for ignoring uninitialized blocks is that they are not
actually read from disc but simply generated as an all-zeros block in the
driver in order to prevent having to initialize them all to zero in
Tresor-Init. That said, the integrity of these blocks cannot be compomised.
The according hashes in the meta data remain unset until the data block gets
written for the first time.

Ref #5062
2024-04-12 15:00:45 +02:00
Martin Stein
cf72499919 tresor: unused args at "R/W client data" at blk IO
The request classes Block_io::Read_client_data and Block_io::Write_client_data
used to receive a block reference for no reason. This commit removes these
args.

Ref #5062
2024-04-12 15:00:45 +02:00
Martin Stein
bcd82b7e75 tresor: revive and test app/tresor_check
The tresor_check tool became outdated back when the Tresor project was created
by re-writing its predecessor, the CBE, in C++. At this time, the check tool
was merely renamed but not updated. As there was also no autopilot test for the
tool, the tool remained outdated.

This commit rewrites the tool for the most recent Tresor version and adds an
autopilot test.

Ref #5062
2024-04-12 15:00:45 +02:00
Martin Stein
d8a71e5978 tresor: improved module framework and clean-up
* Make command pool a proper module
  * The command pool used to be kind of a module but it was driven via custom
    tresor-tester specific code. Now, it becomes a proper module that
    is driven by the module framework instead.
  * Move the code for creating and handling the module-execution progress flag
    into Module_composition::execute_modules as the function is always used with
    this code surrounding it.

* Reorganize files, remove deprecated files

* A new class Module_channel is introduced in the module framework and all
  channel classes inherit from it. With that class in place, the formerly
  module-specific implementations of the following methods are replaced by
  new generic implementations in the Module framework:

  * ready_to_submit_request
  * submit_request
  * _peek_completed_request
  * _drop_completed_request
  * _peek_generated_request
  * _drop_generated_request
  * generated_request_complete

* Module requests are now held for the duration of their lifetime at the
  module they originate from and not, like before, at their target module. As
  a result, modules can generate new requests inline (without having to wait
  for the target module), making code much simpler to read, reducing the amount
  of channel state, and allowing for non-copyable request types.

* Introduce a sub-state-machine for securing a superblock in the
  superblock_control module in order to reduce redundancy.

* Some modules, like free_tree, were completely re-designed in order to make
  them more readable.

* Replace all conditional exceptions by using the macros in
  tresor/assertion.h .

* Move methods that are used in multiple modules but that were implemented
  redundantly in each module to tresor/types.h.

* Remove verbosity node and all that was related to it from tresor tester
  config as the targeted verbosity can be achieved with the
  VERBOSE_MODULE_COMMUNICATION flag in tresor/verbosity.h .

* Extract the aspect of translating the byte-granular I/O-requests to
  tresor-block requests from the tresor VFS-plugin and move it to a new module
  called splitter.

* Rename the files and interface of the hashing back-end to not reflect the used
  hashing algorithm/config anymore, while at the same time making the hashing
  interface strict regarding the used types.

* Introduce the NONCOPYABLE macro that makes marking a class noncopyable short
  and clear.

* Replace the former tresor/vfs_utilities.h/.cc with a new tresor/file.h
  that contains the classes Read_write_file and Write_only_file. These classes
  significantly simplify the modules crypto, block_io, and trust_anchor by
  moving the details of file access to a sub-state machine.

* The former, rather trivial block allocator module is replaced by a normal
  object of type Pba_allocator that must be provided by the client of the
  Sb_initializer (reference in the Sb_initializer_request).

Ref #5062

tresor: read uninitialized vbas as all zeroes

Virtual addresses in a Tresor container that were not yet written by the user
should always return a data block that is all-zeroes. This was the concept
right from the beginning of the project. However, somehow this aspect either
never got implement or got lost along the way.

Some context for understanding the commit: The Tresor doesn't initialize the
payload data blocks of a container when creating a new container as this would
be rather expensive. Instead, it marks the leaf metadata nodes of the
virtual-block-device tree (those that reference the payload data blocks in
physical address space) with generation 0.

Now, this commit ensures that, whenever the virtual-block-device module reads
such a generation-0 leaf, instead of asking the block_io and crypto to deliver
data from disc, it directly provides the user with 4K of zeroes.

Ref #5062
2024-04-12 15:00:45 +02:00
Martin Stein
82388f4389 tresor_tester.run: fix free tree exhaustion
The order of execution inside the Tresor lib slightly changed compared to the
previous CBE lib. AFAICT, this is nothing to worry about and related to the
now cleaner structuring. However, it can produce higher peak requirements
regarding the allocation pool in the Free Tree. Therefor, this commit extends
the dimensions of the Free Tree used in the test.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
801a779a88 tresor: support and test snapshot management
* Implement requests "create snapshot" and "discard snapshot" in tresor lib.
* Adapt tresor tester in order to test the new feature.
  * Remove temporary code from tresor tester that skipped such requests with
    the hint that they were not supported yet.
  * Add mandatory "id" attribute to <request op="create_snapshot"/> and
    <request op="discard_snapshot"/> tag. A "discard snapshot" command always
    refers to the snapshot created by the "create snapshot" command with the
    same "id" value.
  * Clean-up command pool a bit.

Fix #4971
2024-04-12 15:00:45 +02:00
Martin Stein
417fb4e108 tresor: fix bad hash update during rekeying in vbd
The re-keying state machine in the VBD module would use block data of the wrong
block for the hash update of an inner node in a certain circumstance.

On re-keying, the VBD iterates for a given VBA over all snapshots, beginning
with the newest and re-keys the VBA in each of the snapshots. At each snapshot
it therefore loads the branch of the VBA top-down, and then updates the branch
bottom-up. However, if loading a certain level of the branch of a certain
snapshot runs into the same physical block as with the last snapshot on this
level, the algorithm turns around and updates the branch from this point
upwards instead of going further down the whole way to the leaf. This is
because everything below this point has already been re-keyed in the course of
a newer snapshot.

The case where this turning around is not right above the leaf (i.e., the first
shared physical block is a metadata block) that's were the bug was located. In
this situation, we have to re-encode the highest shared metadata block into a
buffer again before starting to update. The update code acts as if the
mentioned block was just written back (which is true when going down all the
way to the leaf before updating) and consequently is present in the encoded
buffer.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
f8332ce587 tresor: fix <initialize> config constraints
Until now, it was possible to use bad Free-Tree/VBD configurations with the
<initialize/> command. The tresor tester didn't complaining about it but the
tresor lib crashed or, worse, corrupted the tresor container. Now, the tresor
tester checks things, like for instance, that "nr_of_children" must be a power
of 2.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
b44ffc9361 tresor: snap garbage collection on each request
The Superblock Control module now issues a snapshot garbage collection on each
incoming request. In return for that, the commit removes all calls to the
garbage collection from other modules.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
3eb5302ab0 tresor: no local impl. of snap garbage collection
Move the implementation of the snapshots garbage collection to the Snapshots
class and remove module-local duplicates.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
9605a60eac tresor: no local copy of snapshots in vbd module
The Virtual Block Device module used to create a local copy of the Snapshots
array respectively Snapshot root it received with an incoming request. After
finishing the VBD operation on the copy, the source module of the request
used to back-copy the resulting Snapshot array resp. Snapshot root. This is
not only less efficient than referencing but also allowed a bug to sneak into
the new C++ implementation.

In contrast to the old Ada/SPARK implementation (CBE), the new design doesn't
allow for global objects that can be accessed by any module without receiving a
reference in a module request. Therefore, the Free Tree module has to receive a
reference to a Snapshots array with each request in order to be able to use it.
In our case, these requests are allocations for a "Write" operation from the
VBD. However, the VBD itself receives only the one Snapshot required for
writing and therefore causes the Free Tree to make bad decisions on whether or
not a block can be re-allocated or not.

With this commit, the VBD always receive a reference to the whole Snapshots
array and also propagates it this way to the Free Tree.

Ref #4971
2024-04-12 15:00:45 +02:00
Martin Stein
b49f052051 tresor: improve verbosity modes
* make array classes printable
* pba filter for block io verbosity
* streamline read/write/rekey verbosity

Ref #4971
2024-04-12 15:00:45 +02:00
Christian Prochaska
a187f15d8c sculpt: add gdb_x86 to distribution and index
Issue #5076
2024-04-12 15:00:45 +02:00
Christian Prochaska
7248c5cc23 sculpt: add terminal to index
Issue #5076
2024-04-12 15:00:45 +02:00
Christian Prochaska
90239c0787 ports: add 'gdb_support'
Fixes #5163
2024-04-12 15:00:44 +02:00
Christian Prochaska
2eae70d3cd os/vfs.h: add support for symlink creation
Fixes #5162
2024-04-12 15:00:44 +02:00
Pirmin Duss
7f1adbea46 lxip: provide dummy for send_sig
This is function gets called by some libssh applications using vms_lxip.

For the dummy implementation I looked at the old port.

Issue genodelabs#5161
Issue gapfruit#1976
2024-04-12 15:00:44 +02:00
Christian Helmuth
e0fe046ad3 Update tiled_wm test for tiled-console scenario
- always assign apps/overlay to targets (visible=true/false) to
  prevent 0x0 geometry, which is interpreted as close
- add QMenu as exampel to panel button
- use usb-tablet on Qemu
2024-04-12 15:00:44 +02:00
Christian Helmuth
c27d04e338 window_layouter: "visible" assign-node attribute
Per default, windows assigned to targets are visible, which can be
changed with the new boolean "visible" attribute. Thus, window can be
hidden without changing their geometry.
2024-04-12 15:00:44 +02:00
Christian Helmuth
960670b16c decorator: fix handling of back-most window
Before, the current back-most window was not restacked if it was part of
the already, which lead to partially inconsistent view of the window
stack between decorator and nitpicker.
2024-04-12 15:00:44 +02:00
Christian Prochaska
219eecf8d7 qt5: stop signal proxy thread on exit
Fixes #5158
2024-04-12 15:00:44 +02:00
Christian Helmuth
6b50f993bc qt5_common: increase RAM of pointer to 2M 2024-04-12 15:00:44 +02:00
Norman Feske
1866520d6c dde_linux: build initcall_table.c after objects
The added hook 'OBJ_POSTPROC_SRC' gives us a way to post-process object
files for generating supplemental code. By using this hook, the
initcall_table.c generated by import-lx_emul_common.inc gets reliably
executed after all object files are built.

Fixes #5159
2024-04-12 15:00:44 +02:00
Christian Prochaska
bc44104522 qt5: fix use-after-free on exit
Fixes #5156
2024-04-12 15:00:44 +02:00
Norman Feske
891f933863 import-lx_emul_common.inc: don't use 'nm -U'
The option is used during the generation of initcall_table.c.
However, it happens to strip the first argument following the option.
The long option --defined-only works as expected.

Issue #5155
2024-04-12 15:00:44 +02:00
Christian Prochaska
d813a12f20 tool chain: GDB fixes
Fixes #5154
2024-04-12 15:00:44 +02:00
Christian Prochaska
b439924bf9 tool chain: fix GCC internal compiler error
Fixes #5153
2024-04-12 15:00:44 +02:00
Josef Söntgen
ff728eb6ce usb_block: fix 'Request_sense_repsonse' MMIO size
Due to a bug in the original implementation, the size of the MMIO
range covering the 'Request_sense_response' data was set too large
during the MMIO boundary change. This rendered devices that were not
yet ready and required an 'Request_sense' command unusable.

The commit also adapts all other commands where the MMIO size does
not match the expected one.

Fixes #5133.
2024-04-12 15:00:44 +02:00
Christian Helmuth
229f01b153 vbox6-capture: enable Windows BSOD logging
Issue #5099
2024-04-12 15:00:44 +02:00
Alexander Boettcher
5e5fe7291a nic/ipxe: add throttle RX interrupt support
The commit adds support to throttle the rate of the RX IRQs to a specified
value. The effect is, that no RX IRQs below the time threshold will fire and
therefore the CPU load gets reduced on the host. Trade-off gaming between
cpu load, throughput, overload.

Modular Sculpt 23.10 on S938 as testcase. In brackets the CPU affinity is
denoted.

ipxe (0,0) -> nic_router (1,0) -> Debian VM vbox6 (3,0) and (3,1)

VM: iperf -C X.X.X.X -t 60 -R

iperf server X.X.X.X is outside Sculpt and sends data due to '-R' to VM

Non representative measure points:

cpu load   - ipxe  - nic_router - iperf throughput
--------------------------------------------------
w/o  patch -  ~80% -       ~50% - ~706 MBit/s - 0    -> throttling off by default on S938
patch 651  -  ~20% -       ~35% - ~763 MBit/s - 651  -> 0.166ms throttle RX IRQ
patch 5580 -  ~15% -       ~25% - ~650 MBit/s - 5580 -> 1.4ms   throttle RX IRQ

Issue #5149
2024-04-12 15:00:44 +02:00
Alexander Boettcher
31e8b50b7c nic/ipxe: batch TX requests
A bunch of transmit requests received by the Uplink server (nic_router)
are currently added one by one to the ring buffer and every time the hardware
is notified to process each single request.

Instead, add as many as possible transmit requests in the ring buffer of
the hardware and when done trigger the hardware to process the ring.

Additionally, don't receive an "processed" TX IRQ for each element in the
ring, which causes high CPU load.

With this commit the TX IRQs in the ipxe driver for a

iperf -c X.X.X.X -t 60

from within a VM to the outside iperf server is reduced from about
~2'600'000 IRQs to about ~200'000. The overall CPU load for the driver
(when executed alone on CPU 0) is reduced from ~85 percent load to ~45 percent
load.

Issue #5149
2024-04-12 15:00:43 +02:00
Alexander Boettcher
feba5a138e nic/ipxe: batch packets on receive path
Use batching feature of Uplink client base header.

Issue #5149
2024-04-12 15:00:43 +02:00
Alexander Boettcher
d0d9cb6a73 uplink: support batching in client base header
Add support for Uplink drivers to batch requests.

Fixes #5149
2024-04-12 15:00:43 +02:00
Alexander Boettcher
23078154cd vbox: avoid blocking nic_ep thread
during receive the nic_ep may block as long as the guest does not provide
another receive network descriptor. In the meantime, all Genode signals
regarding the network interface, e.g. tx, will be postponed, which may
effect the throughput.

Instead use the nic_ep for rx packets unblocking. Add an notification mechanism
to the e1000 vbox network model, to notify us as soon as the guest added new
receive descriptors in the model.

Issue #5146
2024-04-12 12:57:30 +02:00
Alexander Boettcher
e1e87657c7 vbox: batch network packets
Fixes #5146
2024-04-12 12:57:30 +02:00
Norman Feske
b36a49dfc2 sculpt: host PC framebuffer drivers in runtime
Issue #5150
2024-04-12 12:57:30 +02:00
Norman Feske
27e0500452 sculpt_manager: Pci_info -> Board_info
This is a preparatory commit for issue #5150. Board_info is designated
for the selection of device drivers. It is not specific to PCI devices.
2024-04-12 12:57:30 +02:00
Johannes Schlatow
b67df08c9d intel_fb: add dummy for ZimaBlade support
When booting Sculpt OS on the ZimaBlade, `i915_vm_free_pt_stash` is
called. Providing an empty dummy implementation fixes the issue.

Fixes #5145
2024-04-12 12:57:30 +02:00
Christian Helmuth
609a065503 Static IP config in lighttpd.run on base-linux 2024-04-12 12:57:30 +02:00
Norman Feske
a452390f0b pkg/test-tcp_bulk_lwip: adjust quota for foc/pbxa9
For pbxa9, Qemu is started with only 256 MiB for foc but with 768 MiB
for base-hw. By reducing the RAM quota for all start nodes within the
remote scenario, each component gets enough RAM quota to breathe.
2024-04-12 12:57:30 +02:00
Norman Feske
72a575a5f9 depot_autopilot.run: error message on empty tar
When wrongly invoking the run script by specifying a skipped test
as its only TEST_PKGS argument, the run script fails due to a wrong
tar argument order. Let's better reflect this condition to the user
ahead of invoking tar.
2024-04-12 12:57:30 +02:00
Benjamin Lamowski
1b313df419 linux: force stack area mapping at requested address
With `MAP_FIXED` absent from the mmap(3p) flags, "the implementation uses
addr in an implementation-defined manner to arrive at pa", which may
lead to a mapping at an address diffent to the requested `addr`.

Add `MAP_FIXED` to the mmmap flags to force mapping to the specified
address.

Fixes #5147
2024-04-12 12:57:30 +02:00
Norman Feske
6315a09369 pkg/test-libc_fifo_pipe: ignore Ipc_error messages
Such messages can occur by chance when killing 'echo' while the program
blocks in an IPC call. It gets killed nevertheless. So the message does
not hint at a failure of the test.
2024-04-12 12:57:30 +02:00
Norman Feske
598dfff601 pkg/test-tcp_bulk_lxip: adjust quota for sel4 2024-04-12 12:57:30 +02:00
Norman Feske
5b4e1d22d9 test/timer: adjust min timer period to 250 us
In the context of #5138, the timer drivers for NOVA and base-hw had been
changed to support timeouts at a precision of 250 us (from formerly 1 ms).
Adjust the test to the new expected lower bound.
2024-04-12 12:57:30 +02:00
Norman Feske
956ec2f84c pkg/test-read_only_rom: adjust quota for sel4 2024-04-12 12:57:30 +02:00
Norman Feske
3052260249 Adjust terminal_crosslink RAM quota for seL4
The dynamic buffer allocation increases the RAM demand slightly beyond
1M on seL4. Use 2M, as is already the default in pkg/terminal_crosslink.

Issue #5135
2024-04-12 12:57:30 +02:00
Christian Helmuth
2f1520b4c1 base-hw: fix EPIT duration calculation on roll-over
If Ocif was not reset between two calls to _duration(), the returned
value exceeded _max_value().
2024-04-12 12:57:30 +02:00
Christian Helmuth
abb2045e17 Remove exec_static_constructors from dde_linux drivers
This is a follow-up commit to "lx_emul: generate initcalls during build".

Issue #5096
2024-04-12 12:57:30 +02:00
Stefan Kalkowski
7ec08af6d9 usb: session renewal & new client API
Replace the USB session API by one that provides a devices ROM only,
which contains information about all USB devices available for this client,
as well as methods to acquire and release a single device.

The acquisition of an USB device returns the capability to a device session
that includes a packet stream buffer to communicate control transfers
in between the client and the USB host controller driver. Moreover,
additional methods to acquire and release an USB interface can be used.

The acquisition of an USB interface returns the capability to an interface
session that includes a packet stream buffer to communicate either
bulk, interrupt, or isochronous transfers in between the client and the
USB host controller driver.

This commit implements the API changes in behalf of the Genode C API's
USB server and client side. Addtionally, it provides Usb::Device,
Usb::Interface, and Usb::Endpoint utilities that can be used by native
C++ clients to use the new API and hide the sophisticated packet stream API.

The adaptations necessary target the following areas:

* lx_emul layer for USB host and client side
* Linux USB host controller driver port for PC
* Linux USB client ports: usb_hid_drv and usb_net_drv, additionally
  reduce the Linux tasks used inside these drivers
* Native usb_block_drv
* black_hole component
* Port of libusb, including smartcard and usb_webcam driver depending on it
* Port of Qemu XHCI model library, including vbox5 & vbox6 depending on it
* Adapt all run-scripts and drivers_interactive recipes to work
  with the new policy rules of the USB host controller driver

Fix genodelabs/genode#5021
2024-04-12 12:57:30 +02:00
Christian Prochaska
6e437674f7 gems: add dbg_download
Fixes #5143
2024-04-12 12:57:28 +02:00
Norman Feske
f3313b6603 base-hw: new timer implementation
Issue #5138
2024-04-12 12:57:28 +02:00
Norman Feske
5a79cb9150 waveform_player.run: define CPU resources
This is needed for the priority-based scheduling on base-hw.
2024-04-12 12:57:28 +02:00
Josef Söntgen
dea6609612 import-openssl.mk: provide file named after api
For now this import file is solely there to satisfy the mechansim
in Goa that collects and incorporates import files for used APIs.

Issue genodelabs/goa#81.
2024-04-12 12:57:28 +02:00
Christian Prochaska
33d4134f49 qt5: detect contrib code changes
Fixes #5141
2024-04-12 12:57:28 +02:00
Norman Feske
a0290f8c51 base-hw: preserve usec accuracy in us_to_ticks
The kernel timer used to truncated timeouts to the next lower
millisecond, which not only limits the wakeup accuracy but also results
in situations where a user-level timeout is triggered earlier than
expected. The latter effect results in the observation of a spurious
timeouts and the subsequent programming of another timeout.

The patch solves the problem by preserving the sub-milliseconds bits
in the 'us_to_ticks' implementation(s).

Issue #5142
2024-04-12 12:57:28 +02:00
Christian Prochaska
7ae7b8481a monitor: send a notification when an inferior vanished
Fixes #5139
2024-04-12 12:57:28 +02:00
Norman Feske
913196e2dc record_play_mixer: smoothen time-window allocation
This patch modifies the mixer's time window allocation by modelling the
drift of the period length over time. This yields a much better
stability of the detected sample rates in the presence of jitter.

Issue #5132
2024-04-12 12:57:28 +02:00
Norman Feske
6407f8667f rump: prevent sleep times of less than 1 sec
This patch caps the busyness of the rump kernel, which normally calls
sleep with timeouts between 0 and 10 ms even when idle. On Sculpt
running on a x250 laptop, this patch saves 0.4% CPU load, which is
almost the half of the idle load.

Issue #5140
2024-04-12 12:57:28 +02:00
Norman Feske
bc0b6be6a9 nova: new timer implementation
Issue #5138
2024-04-12 12:57:28 +02:00
Norman Feske
44e0d7003a base: Alarm_registry data structure
This data structure uses an AVL tree to maintain a time-sorted set of
alarm objects. It supports the use of circular clocks of an bit width.

Issue #5138
2024-04-12 12:57:28 +02:00
Norman Feske
3e46cf5664 base: add Xoroshiro PRNG utility to base/internal 2024-04-12 12:57:28 +02:00
Christian Prochaska
3dbe398252 test-monitor: increase buffer size
Issue #5137
2024-04-12 12:57:28 +02:00
Christian Prochaska
d1a750c528 monitor: make maximum GDB response size configurable
Fixes #5137
2024-04-12 12:57:28 +02:00
Christian Prochaska
011a521968 os: make 'terminal_crosslink' buffer size configurable
Fixes #5135
2024-04-12 12:57:27 +02:00
Alexander Boettcher
32cb245cb8 ahci: enable conversion error checking
Fixes #5134
2024-04-12 12:55:39 +02:00
Alexander Boettcher
34674ac49f register_set: avoid conversion warnings
for Bitset_2 and Bitset_3 as used by ahci driver

Issue #5134
2024-04-12 12:55:39 +02:00
Christian Prochaska
62b3f24d1c libc: select() based on poll()
Fixes #5131
2024-04-12 12:55:39 +02:00
Pirmin Duss
40fd3d8c62 acpica: add format library to used_api
The format library is required, otherwise the binary isn't build. This
regression was introduced in

  acpica: provide verbose config (issue #5083)

Fixes genodelabs#5136
2024-04-12 12:55:39 +02:00
Christian Helmuth
b99d91b96e lighttpd: pkg recipe for easy runtime instantiation
The package depends on two resources.

- A Nic session should be routed to the nic_router "http" domain make
  the HTTP server available from the outside on forwarded port 80.

- A File_system session labeled "webroot" can be routed to any server
  by relabeling the session, e.g., to "report" or "config" in parent.

Sculpt deploy exmaple exporting report_fs via HTTP.

  <start name="lighttpd" pkg="lighttpd">
    <route>
      <service name="Nic">
        <child name="nic_router" label="http"/>
      </service>
      <service name="File_system" label="webroot">
        <parent label="report"/>
      </service>
    </route>
  </start>
2024-04-12 12:55:38 +02:00
Christian Helmuth
83afc6e438 lighttpd: restore omission of O_NONBLOCK
Remove O_NONBLOCK from flags for regular files as libc cannot tell apart
regular files from others behind file-system sessions. Otherwise, reads
always "fail" with EAGAIN.

genodelabs/genode#5093
2024-03-05 11:56:19 +01:00
Christian Helmuth
706e341d3a trace_logger: read 'buffer' as Number_of_bytes 2024-03-04 15:50:03 +01:00
Josef Söntgen
449a72d8a2 trace_recorder: get session arguments from config
This commit adds support for setting the TRACE session parameters via
the configuration.

Fixes #5123.
2024-03-04 11:49:26 +01:00
Norman Feske
4025ca8ae1 doc/release_notes/24-02.txt: fix reference
Paragraphs cannot be used as references. So refer to the compounding
section instead.
2024-02-29 14:40:59 +01:00
Christian Helmuth
36a52c6886 version: 24.02 2024-02-29 11:35:41 +01:00
Norman Feske
95affade5d News item for version 24.02 2024-02-29 11:35:23 +01:00
Norman Feske
54a07dd3d6 Release notes for version 24.02 2024-02-29 11:35:23 +01:00
Norman Feske
1e8c36f682 doc/components.txt: record/play infrastructure 2024-02-29 11:35:22 +01:00
Christian Helmuth
9c7a303caf depot: update recipe hashes 2024-02-29 11:08:28 +01:00
Stefan Kalkowski
0d1e4bf8d5 Remove orphaned usb_terminal (fix #5130) 2024-02-28 16:32:23 +01:00
Stefan Kalkowski
88c347ee00 usb_hid_reconnect.run: use distinct device-ids
Newer Qemu variants quit with an error about already existing devices
if the same device-id is add and removed in a loop fast. To circumvent
this strange behaviour, simply use consecutive device id numbers.

Ref genodelabs/genode#5021
2024-02-28 16:32:23 +01:00
Christian Prochaska
32e7ec7b9b core: implement 'Vm_session_component::reserve_and_flush()'
Issue #5069
2024-02-28 16:32:23 +01:00
Sebastian Sumpf
9a65e4f607 mesa: generalize binder memory management
This patch was back ported from upstream Mesa and generalizes the memory
management of buffer objects used by the binder. Before this patch the
binder was treated as a special case where buffer objects were allocated
with a simple "next block or wrap" allocator. With this commit the
binder now uses the vm_heap allocators as done by all other buffer
allocations which leads to issues with reference counting and object
destruction being resolved.

Original commit message:

We're moving towards a path where all contexts share the same virtual
memory - because this will make implementing vm_bind much easier - ,
and to achieve that we need to rework the binder memzone. As it is,
different contexts will choose overlapping addresses. So in this patch
we adjust the Binder to be 1GB - per Ken's suggestion - and use a real
vma_heap for it. As a bonus the code gets simpler since it just reuses
the same pattern we already have for the other memzones.
2024-02-28 16:32:23 +01:00
Norman Feske
b370591e64 Mobile version of Sculpt OS
This patch contains the mobile variant of Sculpt OS, which evolved
at the genode-allwinner repository until now. In consists of the
following parts:

- gems/src/app/phone_manager  plays the role of the sculpt manager
- sculpt/phone-linux          allows for test driving the mobile
                              variant on base-linux
- gems/src/app/dummy_modem    mockup of a modem's behavior, used for
                              GUI development and testing

The parts targeting a specific device (PinePhone) remain local to
the genode-allwinner repository.

To give it a try:

  make run/sculpt_test KERNEL=linux BOARD=linux \
                       SCULPT=phone LOG=core DEPOT=tar

Fixes #5125
2024-02-28 16:31:46 +01:00
Christian Prochaska
ea51f1ffda monitor: limit the 'm' command response size
Fixes #5119
2024-02-28 16:31:46 +01:00
Christian Prochaska
aa6f99b0a4 monitor: report all stopped threads on '?' command
Fixes #5120
2024-02-28 16:31:46 +01:00
Alexander Boettcher
12df9bf450 gpu/intel: make aperture configurable
Fixes #5124
2024-02-28 16:31:46 +01:00
Alexander Boettcher
77f5ef3bcd nvme: release device before suspend
- monitor system ROM changes
- stop processing of new Jobs before suspend
- destruct platform device before suspend, but keep platform DMA buffers
- re-construct platform device and reinit resources (mmio, irq) on resume
- re-start block job scheduling on resume

Fixes #5101
2024-02-28 16:31:46 +01:00
Alexander Boettcher
9d15735bc6 ahci: release device before suspend
- monitor system ROM changes
- stop processing of new Jobs before suspend
- destruct platform device before suspend, but keep platform DMA buffers
- re-construct platform device and reinit resources (mmio, irq) on resume
- re-start block job scheduling on resume

Issue #5101
2024-02-28 16:31:46 +01:00
Alexander Boettcher
cde4d4aee0 ahci: refactor code for suspend/resume
This commit is a preparation commit for suspend/resume. The commit
refactors the code in order to consolidate all Platform resources into one
instance. All users within the driver should access the resources with
with_* functions, which checks whether the device resource is usable. The
callers are not allowed to store any references to the provided resources.

Issue #5101
2024-02-28 16:31:46 +01:00
Alexander Boettcher
8b3a339817 acpi_suspend: add nvme & ahci tests
- update documentation
- add nvme und ahci + test case
- fix minor configuration issues of GPU test case

Issue #5101 #5081
2024-02-28 16:31:45 +01:00
Alexander Boettcher
bf6c484c13 gpu/intel: use with(fn, fn_error) pattern
Issue #5081
2024-02-28 16:31:45 +01:00
Alexander Boettcher
0684101ff0 gpu/intel: release device before suspend
- monitor system ROM changes
- stop processing of new Jobs before suspend
- destruct platform device before suspend, but keep platform DMA buffers
- re-construct platform device and reinit resources (mmio, irq) on resume
- re-start GPU job scheduling on resume

Fixes #5081
2024-02-28 16:31:45 +01:00
Christian Prochaska
4ce4d4120a qt5: define BUILD_ARTIFACTS
Fixes #5122
2024-02-28 16:31:45 +01:00
Josef Söntgen
35638568c5 qemu-usb: access I/O buffers directly
This commit replaces the mapping of DMA buffers and gets rid of the
bounce-buffer handling, which was introduced to prevent data
corruption noticed when utilizing USB storage with Windows 10 guests,
with accessing the buffers directly.

Due to the way Windows 10 at times manages its DMA memory (many small
pieces instead of few larger ones) the unbounded registry becomes a
problem when containing stale entries.

Changing the 'qemu-usb' implementation allows for using 'read_dma'
and 'write_dma' directly.

Fixes #5121.
2024-02-28 16:31:45 +01:00
Christian Prochaska
cda48b4a49 sculpt: add base binary archive path to build_info ROM
Fixes #5118
2024-02-28 16:31:45 +01:00
Norman Feske
5073cba536 dde_bsd: support record and play session interface
This patch enhances the audio driver with the option to operate as a
client of the record and play services instead of providing the audio-in
and audio-out services. The record/play mode can be enabled by setting
the 'record_play="yes"' config attribute.

The audio_in.run and audio_out.run scripts support the selection of the
mode via the 'use_record_play_sessions' hook function.

Issue #5097
2024-02-28 16:31:45 +01:00
Norman Feske
18c4393106 dde_bsd: coding style
Remove superflouous Genode:: prefixes, name Main members as private,
change signal "dispatcher" to "handler".
2024-02-28 16:31:45 +01:00
Sebastian Sumpf
ff1e4b1bfb vfs_lxip: return error in case peek read returns EAGAIN
A read with MSG_PEEK returns -1 and EGAIN/EWOULDBLOCK in case the socket
is connected. Zero is only returned if the socket is disconnected.

isuee #5104
2024-02-28 16:31:45 +01:00
Sebastian Sumpf
7cbce1f47c libc: socket_fs_plugin handle MSG_PEEK reads
In case the socket is non-blocking, a read with the MSG_PEEK flag set
has to return -1 and EWOULDBLOCK/EAGAIN in case no data is availble and
the socket is connected. Returning zero implies the socket is in
non-connected state. Therefore, check the connection state in this
situation and return accordingly.

issue #5104
2024-02-28 16:31:45 +01:00
Christian Helmuth
0b63bb91b6 run/nova: cleanup hypervisor binary handling
With the following changes, the hypervisor binary from bin/ as well as
from depot archives is taken as is and not unnecessarily turned inside
out.

- Remove objcopy -O elf32-i386 as our grub boots 64-bit binaries
  very well
- Remove strip as bin/hypervisor is already stripped
2024-02-28 16:31:45 +01:00
Norman Feske
07669ac991 os: record-and-play session interfaces and mixer
- New session interfaces:
  - os/include/play_session   (for audio playing   / mic-input driver)
  - os/include/record_session (for audio recording / audio-output driver)
- Mixer at os/src/record_play_mixer providing both play and record services
- Simple waveform player at os/src/app/waveform_player
- Simple audio-signal capturing component at os/src/app/record_rom
- Simple oscilloscpe at gems/src/app/rom_osci (using record_rom)
- Simple test-audio_play for playing raw stereo f32 data

The _gems/run/waveform_player.run_ script illustrates the use of the new
components and interfaces.

Issue #5097
2024-02-28 16:31:45 +01:00
Josef Söntgen
914508bf7a lighttpd: streamline Genode specific patches
Issue #5093.
2024-02-26 08:59:10 +01:00
Christian Prochaska
080d3b6b63 vfs: support watch handlers on application signal level
Fixes #4092
2024-02-26 08:59:10 +01:00
Christian Helmuth
a529fffb7b Update jitterentropy to version 3.4.1
Fixes #5112
2024-02-26 08:59:10 +01:00
Christian Prochaska
fb2e0b50c8 os: 'Path_base::strip_double_dot_dirs()' improvements
Issue #5106
2024-02-26 08:59:10 +01:00
Christian Prochaska
7651c94bf5 os: add test for 'Genode::Path'
Issue #5106
2024-02-26 08:59:10 +01:00
Christian Prochaska
edba179497 qt5: fix debug link creation
Fixes #5116
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
394801c998 hw: re-name scheduler files according to class
Fix genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
79167d8f5c hw: re-organize scheduler internals & API
* Move Kernel::Cpu_scheduler to Kernel::Scheduler
  (we only have that one scheduler)
* Move Kernel::Cpu_share to Kernel::Scheduler::Context
* Move Kernel::Cpu_priority to Kernel::Scheduler::Priority
* Rename all functions and variables refereing to `claims` to
  `prioritzed`, because claims is not that common
* Rename occurrences of `fill(s)` to `slack` to name the time portions
  outside of the prioritized quantum
* Get rid of some two-liner sub-functions with only one occurrence
  (like `_quota_introduction`, `_quota_revokation`,...)

Ref genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
c8380c1447 hw: remove Cpu_scheduler::_trim_consumption
This private, internal function is used only in one scope,
and therefore not neccessary. But it has nasty side-effects as
it takes the parameter `duration` as reference and changes its
value. Just remove it completely.

Ref genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
1c4078f23a hw: merge booleans in scheduler into one state
Instead of having `_yield` and `_need_to_schedule` booleans, use one
consistent state variable.

Ref genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
9d72c21894 hw: rename head in scheduler to current
The name head is already extensively used in the context of the lists
managed by the scheduler. This terminology duplications does not simplify
reading the code. Instead we keep head for the first item in the list,
but use `current` in the variable name and API of the `Cpu_scheduler`
class to refer to the current scheduled share.

Moreover, the `_head_quota` is now `_current_time_left`, because it does
not denote quota but time left for the current schedule. The boolean
variable `_head_claims` gets removed at all. It duplicated the state of
whether a current share ist set, and whether it has so-called claim time
left.

Ref genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
2f727fb5c6 hw: rename Cpu_scheduler variables
Give certain scheduler class wide variables and functions clear names:

* quota => super_period_length
* residual => super_period_left

Ref genodelabs/genode#5115
2024-02-26 08:59:10 +01:00
Stefan Kalkowski
8e2c95e5e4 hw: replace double_list implementation
Replace double linked list by normal Genode::List with an additional
pointer to last list member to efficiently handle the scheduler share lists.
Moreover, move it into the private part of the Cpu_scheduler class,
the only scope where it is used anymore.

Ref genodelabs/genode#5115
2024-02-26 08:59:09 +01:00
Stefan Kalkowski
0055438257 hw: improve readability of scheduler
Minor changes that should not change any semantics:

* Remove `_next_fill()` its short and only used in one context,
  in which it is good to know what that code actually does
* Turn boolean values into actual boolean values
* Remove some brackets around one-liner pathes

Ref genodelabs/genode#5115
2024-02-26 08:59:09 +01:00
Stefan Kalkowski
776c2a6046 hw: avoid state & code duplication in scheduler
The `_head_was_removed` variable got introduced in solving #4710, but it
reflects only whether `_head` is a valid pointer or not, thereby it
duplicates state.

Ref genodelabs/genode#5115
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
ecd7b0568b lx_emul: adjust import to lx_kit remove
'src/include/spec/x86' does no longer exist

issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
c12224ffd3 api/pc_linux: adjust to legacy lx_kit removal
With the removal of legacy lx_kit 'src/include/spec/x86' does not longer
exist in dde_linux.

issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
97f8179f90 dde_linux: remove legacy lx_kit and lx_emul
All good things must come to an end.

issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
8aa3967201 dde_linux: remove legacy_lxip
Because legacy_lxlip is the last entry in dde_linux.port, remove the
port as well.

issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
8755993123 dde_linux: remove vfs_legacy_lxip
issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
b6baf3fe1e dde_linux: remove 'import-usb_arch_include.mk'
This seems to be an artifact left over from the legacy USB drivers.

issue #5104
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
f86cd6899c ahci: add port count vs. ports implemented check
Check if controllers port count matches number of ports found in the
port implemented register. In case counts don't match print a diagnostic
message for debugging purposes.

issue #4081
2024-02-26 08:59:09 +01:00
Christian Helmuth
4a1a162c09 usb_hid: enable magic trackpad support
Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
1dcc6fda6b lx_emul: improve motion-device handling in evdev
The key element of the improvement is differentiated processing of
events of the following device types.

  Mouse:       relative motion
  Pointer:     absolute motion (Qemu usb-tablet and IP-KVM devices)
  Touchpad:    relative motion via absolute touchpad coordinates
  Touchtool:   absolute motion (e.g., stylus)
  Touchscreen: absolute motion and finger (multi-) touch

Processing is done in two stages for one "input packet". First, all
events of the packet are recorded into the current evdev state with
device-type specific operations. Then, appropriate Genode input events
are generated from the accumulated evdev state in the submission stage
(again by device-type specific functions).

A simple version of tap-to-click was added to the touchpad support.

Fixes #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
a0e0000108 genode_c_api/event: absolute-motion events
Absolute motion events are generated by "tablet" devices, e.g., Qemu
usb-tablet and IP-KVM appliances like PiKVM.

Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
5f2691a65b event_filter: transformation of motion coordinates
The <transform> filter configurably transforms touch and absolute-motion event
coordinates by a sequence of translation (move), scaling, rotation, and flipping
primitives in sub-nodes.

Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
7304a019e7 event_filter: <log motion="true"> attribute
Per default, only key presses and releases are logged. The optional
'motion' attribute (boolean) enables logging of motion and touch events.

Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
17724c5f1c virt_linux: enable magic mouse/trackpad HID
Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
ca9b5e3f56 virt_lx_emul: update initcalls
- SMSC95xx usb net
- HID multitouch / magicmouse
- no SMP / timer broadcast on arm_v7
- no IPv6

Issue #5105
2024-02-26 08:59:09 +01:00
Sebastian Sumpf
fccf025d2f usb_hid: enable driver level multi-touch support
This commit enables generic Linux multi-touch support as well as support
for the Wacom Intuos/Graphire tablets as found in the previous version
of the USB HID driver. Events are not properly propagated through
Genode's Event C-API, yet, which will be a follow up.

Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
c57b841556 Fix link of jitterentropy port
The current port of jitterentropy is version 1.2.0 from pre-2017, whose
sources were recently moved to

  http://www.chronox.de/jent/releases/historic/jitterentropy-1.2.0.tar.xz

Note the *historic* label.

Issue #5112
2024-02-26 08:59:09 +01:00
Christian Prochaska
a1b5ebeb09 depot_query: add support for bin and dbg archives
Fixes #5110
2024-02-26 08:59:09 +01:00
Christian Prochaska
0bc2e240bf monitor: always respond to qXfer:memory-map:read
Fixes #5109
2024-02-26 08:59:08 +01:00
Johannes Schlatow
d23e1a87dd vfs_import: truncate files before writing
genodelabs/genode#5107
2024-02-26 08:59:08 +01:00
Christian Helmuth
6a94b8d153 Remove obsolete lx_kit_setjmp library
Issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
37736016fb usb_hid: adjust to arm_v7 UP and RCU tiny
Adjust source.list and dummies

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
5f1b0a5945 usb_net: adjust to arm_v7 UP and RCU tiny
Adjust source.list and dummies

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
a5f72ec095 lxip: adjust to arm_v7 UP and RCU tiny
Adjust source.list and dummies

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
7e8661f8bf virt_linux: disable SMP for arm_v7 and change to tiny rcu
When SMP is enabled multicore specific instructions (e.g., pldw) are
generated. These are not supported and lead to invalid instruction
faults on uni-processor systems (like Cortex-A8). Therefore, we disable
SMP for arm_v7 in Linux code. This requires also a switch from the RCU
tree implementation to RCU tiny, which we shadow and dummy implemented.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
651eb9d4f2 lx_emul/random: do not use jitterentropy in case initialization failed
Until now, in case 'jent_entropy_init' failed an error has been produced
and the following jitterentropy functions (i.e.,
'jent_entropy_collector_alloc') where called nevertheless. In case we
received a bad time source error, for example because the performance
counters are not working on the platform, the entropy collector did not return (endless
loop).

Therefore, this commit treats the failed jitterentropy initialization
not as an error but prints a warning about poor randomness quality and
stops using the jitterentropy library from this point on. The
'Jitterentropy::gen_random_u64' will in this case return the address of
a stack variable * some counter.

This is only a interim solution to make platforms work where performance
counters or TSC values do not exist/work.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
8c9b23ef56 test-libc_connect: use black hole as Uplink for lxip
For connection timeout test, create uplink domain via the 'black_hole'
that is only reachable through the nic_router.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
05283ac247 test/libc_connect: use IP outside of domain for timeout
The IP for the connect timeout test should be in another nic_router
domain, so ARP request are only processed be the nic_router and no other
IP stacks.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
240819b708 black_hole: add support for Uplink client
The uplink client simply drops and acknowledges packets it receives.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
61115c3776 depot_autopilot: adjust RAM quotas for lxip
Adjust the autopilot tests that use lxip to the lower RAM requiremnts of
lxip (old and new).

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
fb4ac714b2 recipes: adjust runtime quotas to lxip
lxip (old and new) requires less RAM now.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
561a9e7a72 vfs_lxip: adapt to 'genode_socket' C-API
Adjust the plugin to use the socket C-API found under
dde_linux/src/lib/lxip/include/genode_c_api/socket.h'.

This is the first minor step in generalizing the plugin.

isse #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
93b3e7d12f libc: socket_fs_plugin add monitor call
Add monitor call for '_fd_read_ready' because this maps to 'poll' in
'vfs_lxip' which should be executed by the EP.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
701856b06a dde_linux: copy vfs_lxip -> vfs_legacy_lxip
Make a copy of vfs_lxip so it can be revived easily. The plugin can now
be used like

! <legacy_lxip dhcp="yes"/>

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
27b1017fe9 test/lxip_raw: test using Genode socket C-API directly
The lxip_raw.run script will spawn a client/server scenario that tests
Genode C-API calls. The scenario can be used standalone, meaning no
actual network card is required.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
42d9640443 lxip: update to Linux 6.1.20
This commit updates lxip from version 4.4.3 to 6.1.20. It uses the
current lx_kit approach and is a shared library again. The stack has
been tested for x86_32/x86_64/arm_v6/arm_v7/arm_8.

The C-interface of the IP stack can be found under
lxip/include/genode_c_api/socket.h.

issue #5104
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
c2080ecc03 linux.port: lxip_ip_config.patch
The patch makes it possible to re-configure the IP settings via DHCP or
static.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
bcb4b231af linux.port: lxip_checksum_32.patch
CONFIG_X86_USE_PPRO_CHECKSUM is a 'def_bool y' and gets re-enabled by
'make olddefconfig'. The PPRO version contains text relocations which we cannot
have in binaries (e.g., 'lea 45f(%ebx ...).').

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
364e58097d lx_emul: prevent division by zero
Check if ceil is <= 1 to prevent division by zero in
'__get_random_u32_below'.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
a0840d7a06 lx_emul/shadow: uaccess_32/64
Expand shadow header with '__copy_from_user_inatomic_nocache' and/or
'__copy_from_user_flushcache'.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
1006e9d987 lx_emul/x86_32: atomic64 set and cmpxchg
64-Bit versions for 32-Bit architecture.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
8c26a142c6 lx_emul: spinlock add bh_enable/disable
add bottom half enable/disable to functions with suffix "_bh" were
missing, because some functions release the bottom half separately
(__neigh_event_send).

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
c2a2ed67bb lx_kit/lx_emul: support explicit init call
Add the possibility to execute a module-init call by name using
'lx_emul_init_call', this is used, for example, by lxip to configure and
re-configure the IP address through 'ip_auto_config'.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
7abe07e2cf lx_emul/virt: remove stop from 'rcu_barrier' dummy
issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
df459c46ef usb_net: adjust to virt_linux config changes
* remove dummies for '__alloc_pages' and friends

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
5dc4ee6524 wireguard: adjust to virt_linux config changes
* remove dummies for '__alloc_pages'
* adjust arm_64 -> arm_v8
* remove IPv6 dummies (disabled in virt_linux)

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
7395f24423 virt_lx_emul: add shadow 'page_alloc.c'
Add suspport for '__alloc_pages' in virt_linux

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
7d62b891f8 virt_linux api: adjust to lx_kit split of arm_v(6|7|8)
Adjust API path.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
e21e32a793 virt_linux: disable IPv6
Will be re-enabled with IPv6 support of lxip.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
c2650cd1e7 virt_linux_generated: sort dep.list
sort 'dep.list' using LC_ALL=C.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
360d38c36d dde_linux: move lxip -> legacy_lxip
move lxip stack to 'legacy_lxip' so it can be revived easily.

issue #5104
2024-02-26 08:59:07 +01:00
Sebastian Sumpf
f19cd8416e lx_kit: split includes and setjmp into arm_v(6|7|8)
Move 'arch_execute.h' headers and 'setjmp/longjmp' implementation from
arm/arm_64 to arm_v(6|7|8).

issue #5104
2024-02-26 08:59:07 +01:00
Martin Stein
1336b0a751 mmio: upper-bounds checks
The classes Genode::Mmio, Genode::Register_set, Genode::Attached_mmio, and
Platform::Device::Mmio now receive a template parameter 'size_t SIZE'. In each
type that derives from one of these classes, it is now statically checked that
the range of each Genode::Register::Register- and
Genode::Register_set::Register_array-deriving sub-type is within [0..SIZE).

That said, SIZE is the minimum size of the memory region provided to the above
mentioned Mmio classes in order to avoid page faults or memory corruption when
accessing the registers and register arrays declared inside.

Note, that the range end of a register array is not the end of the last item
but the end of integer access that is used for accessing the last bit in the
last item.

The constructors of Genode::Mmio, Genode::Attached_mmio, and
Platform::Device::Mmio now receive an argument 'Byte_range_ptr range' that is
expected to be the range of the backing memory region. In each type that derives
from on of these classes, it is now dynamically checked that 'range.num_bytes
>= SIZE', thereby implementing the above mention protection against page faults
and memory corruption.

The rest of the commit adapts the code throughout the Genode Labs repositories
regarding the changes. Note that for that code inside Core, the commits mostly
uses a simplified approach by constructing MMIO objects with range
[base..base+SIZE) and not with a mapping- or specification-related range size.
This should be fixed in the future.

Furthermore, there are types that derive from an MMIO class but don't declare
any registers or register arrays (especially with Platform::Device::Mmio). In
this case SIZE is set to 0. This way, the parameters must be actively corrected
by someone who later wants to add registers or register arrays, plus the places
can be easily found by grep'ing for Mmio<0>.

Fix #4081
2024-02-26 08:59:07 +01:00
Martin Stein
ee6f5f3b1b base: remove deprecated driver files
As far as I can tell, these file are not used anymore.

Ref #4081
2024-02-26 08:31:06 +01:00
Sebastian Sumpf
7ea020d471 usb_hid: add 'usb_clear_halt'
This function is called by 'hid_reset' when the HID_CLEAR_HALT bit set,
as it happens to be on the Rasbarry Pi 1.

issue #4958
2024-02-26 08:31:06 +01:00
Sebastian Sumpf
d191c376f7 dde_linux: add libnl for arm_v6
This was covered before by SPEC 'arm'.
2024-02-26 08:31:06 +01:00
Christian Prochaska
7bfc8f2fde tool: add backtrace
Fixes #5103
2024-02-26 08:31:05 +01:00
Pirmin Duss
55007f5bd9 i2c: bus speed configuration node
I2C EEPROMs of the type at24xxx are really slow (ca. 10 kHZ).

This adds the `bus_speed_khz` attribute to the config of the driver and
adapts the i.MX8 driver to support the feature.

Issue gapfruit#1996
Fixes genodelabs#5090
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
40c8e76f49 dde_linux: adjust test/driver_time to virt_linux
Adjust test to current virt_linux configuration.

issue #5095
2024-02-26 08:31:05 +01:00
Benjamin Lamowski
8540b4c9d1 hw: rename Vm_data to Vcpu_data
Rename Vm_data to Vcpu_data to make it clear that the allocated data is
per vCPU, not per VM.

Issue #5100
2024-02-26 08:31:05 +01:00
Benjamin Lamowski
69b76ba9ed hw: move physical VMCB address out of the VMCB
The physical address of the memory used for the guest VMCB is already
present in Vcpu_data. Use the information there instead of storing the
physical address in the host data area, thereby freeing up 8 bytes for
a bigger Mmio class.

Issue #4081
2024-02-26 08:31:05 +01:00
Benjamin Lamowski
cec7847502 vbox6: add support for Windows BSOD logging
Hitting a BOSD in a Windows guest in Virtualbox 6 leads to calling
 `DBGFR3ReportBugCheck`, which leads to the following error since it is
 unimplemented in our port:

```
 Error: DBGFR3ReportBugCheck: DBGFR3ReportBugCheck called, not implemented, eip=0x1a5c4e4
```

Including the actual method from Virtualbox 6 enables logging
diagnostics for the Windows Blue Screen of Death (BSOD).
To see Blue Screen logging output, enable "dbgf" and "gim" logging
via the `VBOX_LOG` following environment variable in the vbox6 runtime
config.
When manually triggering a BSOD in the Windows guest, this should
produce the following logging diagnostics:

```
GIM: HyperV: Guest indicates a fatal condition! P0=0xe2 P1=0x0 P2=0x0 P3=0x0 P4=0x0
GIMHv: BugCheck e2 {0, 0, 0, 0}
MANUALLY_INITIATED_CRASH
```

Fixes #5099
2024-02-26 08:31:05 +01:00
Norman Feske
de6048f517 libc: consistency of tv_sec when tv_nsec wraps
The libc's internal calculation of the tv_sec and tv_nsec fields must be
based on the same ms value. Otherwise, tv_sec is not always immediately
incremented whenever tv_nsec wraps. For applications, this inconsistency
can result in observed jumps in time.

Fixes #5098
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
684de7a57b lib/wifi: remove static constructors
Remove static constructors from 'socket_call.cc'

issue #5096
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
491ab232bf wifi: remove 'Component::construct'
Init calls are not static constructors anymore, so 'Lx_kit::Env' is not
required to be initialzed before static constructors are called.

issue #5096
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
1b4f7ae0d3 lx_emul: generate initcalls during build
Functions registered with 'module_init' (i.e., '__define_initcalls'),
'OF_DECLARE', and 'DECLARE_PCI_FIXUP_CLASS_FINAL' used to be static
constructors and had be explicitly registered using
'exec_static_constructors' before executing any Linux code.

With this commit we remove the constructor attributes from these
functions and create a global function pointer in the form of

__initptr_<name>_<id>_<counter>_<line number of macro>

'import-lx_emul_common.inc' will collect these '__initptr' symbols after
the compile step and generate a 'lx_emul_register_initcalls' function
that executes the functions pointed to. This step is now automatically
performed in 'lx_emul_start_kernel'. This way a call to
'exec_static_constructors' can be omitted in case there are no other
constructors in place.

issue #5096
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
f9bff3bc7c dde_linux: remove library mk for usb_host_include
This library does not exist anymore.

issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
dea712ab72 usb_hid: add support for arm_v6
Also split into spec 'arm_v(6|7|8)'

issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
8851b64825 usb_net: add SMSC95xx driver for arm_v6
issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
b73765cf9b usb_net: add support for arm_v6
Also split into spec 'arm_v(6|7|8)'

issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
01369546d2 dde_linux: adjust wireguard and test to arm_v8
spec 'arm_64' has been moved to 'arm_v8'

issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
a67bc59686 virt_linux: add arm_v6
also split into arm_v(6|7|8)

issue #5095
2024-02-26 08:31:05 +01:00
Sebastian Sumpf
bb06e8451a dde_linux: split lib/mk into arm_v6/7/8
Split 'arm' and 'arm_64' into 'arm_v(6|7|8)'

issue #5095
2024-02-26 08:31:05 +01:00
Christian Prochaska
6aba9b1b9a tool/run/depot.inc: allow depot user in used_apis
Issue #5092
2024-02-26 08:31:05 +01:00
Christian Helmuth
94ebdc9269 qt5: add missing header to qpa_init.h
Thanks to Andreas for the hint.
2024-02-26 08:31:05 +01:00
Norman Feske
0d34988929 test.run: remove obsolete boot-module heuristic
The ROMs of built executables and shared objects are now covered by the
[build_artifacts].

Issue #4860
2024-02-26 08:31:04 +01:00
Alexander Boettcher
443008777b vbox_share: provide .vbox file
The vbox file is missing to run the test scenario

Related to issue #4860
2024-02-26 08:31:04 +01:00
Christian Helmuth
6855b27553 openssl: update to version 1.1.1w 2024-02-26 08:31:04 +01:00
Christian Helmuth
e440ab40ef virt/lx_emul: check for NULL urb in usb_submit_urb()
The Linux implementation also includes this check. NULL urb submission
happened with Wacom touch devices.
2024-02-26 08:31:04 +01:00
Christian Helmuth
2584c104e0 usb_hid: use lib/kfifo.c
Required by Wacom touch drivers.
2024-02-26 08:31:04 +01:00
Christian Helmuth
092e4a001f usb_hid: mode led handling to shadow input-leds.c
The former implementation relied on input drvdata always pointing to
struct hid_device, which is not true for Wacom touch devices (at least).
Now, we implement the input handler for devices providing LEDs
(evbit[EV_LED] set) only and use input_inject_event() to set the LED
states.
2024-02-26 08:31:04 +01:00
Norman Feske
d6d1b8e025 Road map for 2024 2024-02-26 08:31:04 +01:00
Pirmin Duss
4535a27dfc libc.run: add missing library libm
Issue genodelabs/genode#5094
2024-02-26 08:31:04 +01:00
Josef Söntgen
00d3f61961 libdrm/etnaviv: align implementation with lima
This commit brings the etnaviv back end implementation in line
with the one from lima. Since the etnaviv driver itself handles
different contexts implicitly rather explicitly like lima and
iris for the moment only a main-context is used for all operations.

Issue genodelabs/genode-imx#8.
2024-02-26 08:31:04 +01:00
Johannes Schlatow
43274fbf5f depot: add tcp_terminal recipe
required for goa_testbed

genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Johannes Schlatow
fb58e46672 lighttpd: omit O_NONBLOCK
Uploading large files via HTTP PUT failed when the file system was
accessed via a file system session because lighttpd opened the
destination file with O_NONBLOCK and the write operation stalled
at some point.

genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Josef Söntgen
840bb5f90d lighttpd: enable mod_webdav module
genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Josef Söntgen
8a94dd2cb1 lighttpd.run: add mod_webdav
- using <inline> for random is not gonna fly when getentropy is called
  multiple times (and eventually fails due to EOF)

genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Josef Söntgen
ac790cd6fb ports: update lighttpd to 1.4.73
genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Josef Söntgen
b19d8a50d5 lighttpd.run: fix libc rtc setting
genodelabs/genode#5093
2024-02-26 08:31:04 +01:00
Johannes Schlatow
83e3178e9b Add FindXxx.cmake files to api archives
The FindXxx.cmake files are used by Goa's cmake support.

genodelabs/genode#5087
2024-02-26 08:31:04 +01:00
Christian Prochaska
f3cf4a7d7b qt5: adapt QtWebEngine for host GCC 13
Fixes #5091
2024-02-26 08:31:03 +01:00
Norman Feske
96ea73c3fe sculpt: preset for goa_testbed
Issue #5092
2024-02-26 08:31:03 +01:00
Norman Feske
7c76ec897c sculpt: add "http" and "telnet" nic_router domains
These domains allow for the hosting of plain http and telnet servers
reachable from the outside. The change is designated for the goa
testbed.

Issue #5092
2024-02-26 08:31:03 +01:00
Alexander Boettcher
c2cd4102d8 gpu/intel: prepare GPU structures for resume
The commit is a preparation commit for suspend/resume. It prepares the GPU
structures relying on gmadr.cap() (MMIO) to be re-constructible by applying
the with* pattern to context, ring_buffer and ggtt mmio map. It removes
the managed dataspace handling of gmadr subsets to make the with_* pattern
possible.

Issue #5081
2024-02-26 08:31:03 +01:00
Alexander Boettcher
d02f4866ea gpu/intel: make platform resources reconstructible
This commit is a preparation commit for suspend/resume. The commit
refactors the code in order to consolidate all Platform resources into one
instance. All users within the GPU driver should access the resources with
with_* functions, which checks whether the device resource is usable. The
callers are not allowed to store any references to the provided resources.

With this change, it will be possible in follow up commits, to release
the platform device and to re-acquire it and its resources, e.g. mmio, irq,
gmadr.

Issue #5081
2024-02-26 08:31:03 +01:00
Alexander Boettcher
c5a1e3daa3 acpi_suspend: extend test scenario
- add PS/2 input drivers
- add GPU client test case - glmark2
- remove display driver before suspend
- route log output via terminal on display to gather information, since in
  most cases serial/AMT is not available after ACPI resume

Issue #5081
2024-02-26 08:31:03 +01:00
Christian Prochaska
3062b7d780 lx_emul: add kvfree_call_rcu
Fixes #5089
2024-02-26 08:31:03 +01:00
Alexander Boettcher
27c9825bf0 intel/display: support larger resolutions
- fix detection to re-allocate framebuffer
- free up resources on framebuffer switching

Thanks Peter for reporting and fixing.
2024-02-26 08:31:03 +01:00
Benjamin Lamowski
25c7204b2a hw: clear RAM dataspaces in chunks
Clearing very large RAM dataspaces could fill up core's page table,
because the dataspaces are locally mapped to clear them.
This would manifest in a loop where exhausting the local page table
leads to its flushing (which does not work for core) and a retry that
again fills up the page table and so on.

To prevent this, flush RAM dataspaces in chunks of at most 128MiB.

Fixes #5086
2024-02-26 08:31:03 +01:00
Norman Feske
41731a2439 Make Session_object::warning const
This allows the use of the label-prefixed log utilities from a const
method of a derived class.
2024-02-26 08:31:03 +01:00
Benjamin Lamowski
8b5aa538e7 virtualbox6: fix runscript broken by refactoring
Add the `test.iso` and `virtualbox6.vbox` to `boot_modules`
that were omitted during the refactoring in #4860.

Fixes #5085
2024-02-26 08:31:03 +01:00
Stefan Kalkowski
fc15a164ce tool/dde_linux/create_dummies: preserve env
Instead of resetting the whole environment only remove the TARGET
variable to make GNU Make 4.4 happy.

Fix genodelabs/genode#5084
2024-02-26 08:31:03 +01:00
Christian Helmuth
c2e1013ad4 acpica: improve faked RSDP
More sane table values fix broken output on verbose.

Issue #5083
2024-02-26 08:31:03 +01:00
Christian Helmuth
980793970d acpica: detach MMIO region before re-attaching
This is a follow-up commit for the changes in #5069.

Fixes #5083
2024-02-26 08:31:03 +01:00
Christian Helmuth
30e37d90dd acpica: provide verbose config
If "verbose" is set to true in the config, AcpiOsPrintf etc. are enabled
to log to a dedicated LOG session using the Format:Console utility.

Issue #5083
2024-02-26 08:31:03 +01:00
Christian Helmuth
a6b30d58df lib/format: parse precision and lalign
Prevent errors if precision and left alignment are part of the string.
String precision is applied to limit access to the configured number of
characters but ignored for other types.

Issue #5083
2024-02-26 08:31:03 +01:00
Christian Helmuth
a5b8090e14 acpica: remove static constructor from lib
Issue #5083
2024-02-26 08:31:03 +01:00
Norman Feske
87993a864c input/event.h: axis ids LX, LY, LT, RX, RY, and RT
The axis IDs correspond to 2x analog sticks with 2 axes and 2x triggers.
While being at it, the commit changes the Axis_id type to Axis::Id.

Fixes #3669
2024-02-26 08:31:03 +01:00
Josef Söntgen
d9e4d32374 libdrm/lima: propagate allocation failure
Failed allocations were still denoted with a successful return value
to the caller. This situation was triggered by artificial testing and
has not been observed yet in practice. In case the 'LIMA_GEM_CREATE'
I/O control fails Mesa will dereference invalid pointers anyway.

Issue genodelabs/genode-allwinner#27.
2024-02-26 08:31:03 +01:00
Christian Prochaska
602f9b5670 monitor: remove 'flush_thread()' error message
Fixes #5082
2024-02-26 08:31:03 +01:00
Alexander Boettcher
c167e86d87 display/intel: translate ENOSPC into text message 2024-02-26 08:31:02 +01:00
Christian Helmuth
4a2319a4d6 os: limit backtrace to stack of current thread
The frame-pointer-based backtrace does not work without enabling
-fno-omit-frame-pointer explicitly and in most cases leads to page
faults because non-pointer stack values are dereferenced during the
walk. The best we can do is to limit the backtrace walk to the stack of
the current thread to prevent page faults unrelated to the system state
without the use of the backtrace utility.

This commit introduces a printable Backtrace class usable in
Genode::log(), Genode::trace(), etc. The class is based on the new
function for_each_return_address(auto const &fn) that walks the stack in
its limits and calls fn() for each discovered return address on the
stack in the new os/include/os/backtrace.h. Archtecture-specific
stack-pointer retrieval and walk loops are implemented in dedicated
os/include/spec/<arch>/os/for_each_return_address.h files. Also, the
well-known Genode::backtrace() function (which logs the return-address
values) is provided for backwards compatibility.

Fixes #5078
2024-02-26 08:31:02 +01:00
Christian Helmuth
d5188161f5 util/string.h: add Const_byte_range_ptr::contains()
Issue #5078
2023-12-15 14:11:56 +01:00
Sebastian Sumpf
36ea3cc5a4 netperf: decrease RAM quota from 32 to 14MB
issue #2181
2023-12-13 20:01:47 +01:00
Sebastian Sumpf
68ac1347b9 lxip: configure thash/uhash entries to 2048
The number of hash entries for TCP/UDP corresponds to the number of
sockets managed by the stack. In case there are more sockets than
entries available, buckets will be created to compensate for the lack of
space. The default values for TCP (524288) and UDP (65536) are meant for
the in kernel that manages all sockets of the user land and leads
to very large hash table allocations (>20MB) during initialization.

Since on Genode a component has its own instance of the IP stack or uses
the VFS server, we do not need these kind of large default settings.

issue #2181
2023-12-13 19:54:50 +01:00
Norman Feske
c4679e7af6 depot: update recipe hashes 2023-12-13 12:33:05 +01:00
Josef Söntgen
89270f69e0 sculpt_image: copy uboot.env file for PinePhone
Issue genodelabs/genode-allwinner#26.
2023-12-13 12:33:05 +01:00
Martin Stein
32d1e5b4a7 gems: remove unused import-sha256_4k.mk
Ref #5062
2023-12-13 12:33:05 +01:00
Norman Feske
77b0e10e88 vfs/ram_file_system: deferred unlink
This patch changes the unlink operation of the ram fs to defer the
destruction of a file until it is no longer referenced by any VFS handle.
When unlinked, the file no longer appears in the directory. But it can
still be opened and accessed.

With this change, a parent process of a Unix-like subsystem becomes able
to pass the content of an unlinked file to a forked child process. This
mechanism is required when using the 'exec' command in Tcl scripts.

Another use case is the 'tmpfile()' function.

Fixes #3577
2023-12-13 12:33:05 +01:00
Norman Feske
cb74956d06 os/run/test.run: build libs listed in <content> 2023-12-13 12:33:05 +01:00
Christian Helmuth
54c5b7d712 depot_autopilot: disable test-rm_nested on pistachio 2023-12-13 12:33:05 +01:00
Norman Feske
713659cea5 test-trace: adjust rate of top passing tracepoints
The traced top instance was configured to be active every two seconds
whereas the trace test uses a grace time of only 1.5 seconds before
raising the FOREIGN state of a trace subject as an error.

The state of a trace subject can change only whenever the traced thread
passes a trace point. Hence, with the original configuration, the
release of top as trace subject can take up to two seconds. The patch
reduces the rate to 0.5 seconds to satisfy the expectation of
test-trace.
2023-12-13 12:33:05 +01:00
Norman Feske
3aa2119290 core: use 'release' in Trace::Subject destructor
This avoids having two different code paths for destruction and release.
2023-12-13 12:33:05 +01:00
Johannes Schlatow
63dd5efa72 libc: fix post-2100 infinite-loop on 32-bit
The call of `mktime`/`timegm` with a broken down time after year 2100
led to an infinite-loop on 32bit.

genodelabs/genode#3707
2023-12-13 12:33:05 +01:00
Alice Domage
74abf8132e tool/port: add .sparse-git install rule
Following Github support removal for svn [1], dde_rump port fails to
prepare. This commit introduces a new install rule for ports,
'.sparse-git'. It performs a sparse-checkout on the port repository, only
fetching required files.

[1] https://github.blog/2023-01-20-sunsetting-subversion-support/

Co-authored-by: Benjamin Lamowski <benjamin.lamowski@genode-labs.com>

Issue genodelabs#5072
Issue genodelabs/goa#28
2023-12-13 12:33:05 +01:00
Christian Helmuth
636f5dda29 nic_router: specify ICMP Destination (host) unreachable
According to RFC 1812 ICMP Destination unreachable (Network unreachable)
does not quite our case of clients directly behind the router.

  If a packet is to be forwarded to a host on a network that is directly
  connected to the router (i.e., the router is the last-hop router) and
  the router has ascertained that there is no path to the destination
  host then the router MUST generate a Destination Unreachable, Code 1
  (Host Unreachable) ICMP message.

Issue #4729
2023-12-13 12:33:05 +01:00
Christian Helmuth
ad92d799cd netperf_lxip_wifi: run on foc_x86_32 too 2023-12-13 12:33:05 +01:00
Christian Helmuth
8f9056d738 netperf_lwip_wifi: run on foc_x86_32 too 2023-12-13 12:33:05 +01:00
Johannes Schlatow
c1bc9f8557 libc: use timegm instead of mktime
By using `mktime()`, which assumes local time, we render the `TZ`
environment variable ineffective. Instead, `timegm()` should be used to
set the real-time clock to UTC.

genodelabs/genode#5074
2023-12-13 12:33:05 +01:00
Christian Helmuth
b80fd10a70 wireguard: don't shadow lx_emul memory backend
Issue #4809
2023-12-13 12:33:05 +01:00
Christian Helmuth
1e7116fcc1 lx_emul: manage page structs per buffer range
The management of Linux page structs is now tied to the life time of DMA
buffers. Thus, page structs are created when a buffer is allocated and
deallocated only when a buffer is freed - not on lx_emul_mem_free()
because DMA buffers are cached. Page struct refcounting was entirely
reworked in lx_emul/shadow/mm/page_alloc.c.

Fixes #4809
2023-12-13 12:33:05 +01:00
Christian Helmuth
73bf682b62 lx_emul: add lx_emul_heap_alloc/free
Allocator for not-DMA-capable meta data buffers.

Issue #4809
2023-12-13 12:32:52 +01:00
Christian Helmuth
dec1869e2c pc_wifi.run: improve debugability 2023-12-13 12:32:19 +01:00
Alexander Boettcher
ce66e12699 vbox: improve network tx throughput
When multiple threads (EMT-0..X + nic_ep) enter the very same
critical section, the use of RTCritSectTryEnter may reflect the contention
case to the Network Model (E1000). Since no one notifies the model, when the
critical section is free again, solely the next packet/event triggered by the
guest will resume the former operation. This may lead to long delays until
packets are sent actually.

Instead of using the RTCritSectTryEnter use RTCritSecEnter to avoid the
situation. All of our network code is non blocking, so the network backend
will only be contented a short time.

Follow up commit to

Issue #5045
2023-12-13 12:32:19 +01:00
Stefan Kalkowski
342e48115e lx_emul: replace USB devio API usage
The devio API in the Linux kernel promised to be a stable layer for our
USB host controller drivers, but the additional bookkeeping and dynamic
allocations increase CPU overhead in a way that we do not accept further.
Therefore, we go a step back and process DMA transactions directly in and
out of the packet stream from the clients.

Fix genodelabs/genode#5071
2023-12-13 12:32:19 +01:00
Christian Helmuth
58dba227ce base: number of CPU components per slab block
On some platforms, only two CPU-thread component objects fit into on
page-sized slab block.

Issue #3834
2023-12-13 12:32:19 +01:00
Christian Helmuth
0046edf761 base: statically check for reasonable Tslab block size
Per default Tslab checks that 8 slabs incl. overhead fit into one block.
If this is not desired the template parameter 'MIN_SLABS_PER_BLOCK' can
be used to control the minimum number of blocks.

Fixes #3834
2023-12-13 12:32:19 +01:00
Christian Prochaska
ff5a474e74 ports: remove old GDB monitor
Fixes #5067
2023-12-13 12:32:19 +01:00
Christian Prochaska
9a049789de core: mark implicitly detached regions as reserved
Fixes #5069
2023-12-13 12:32:19 +01:00
Norman Feske
f57da7e645 trace: remove parent_levels session argument
The argument was originally designated to restrict the reach of the
trace monitor but the idea remained unimplemented. It is now superseded
by the use of the trace-session label as trace-subject filter.

Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
12b89852e0 sculpt: add "runtime" and "global" TRACE options
Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
f66ce025d3 Adapt run scripts to trace-subject filtering
Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
bfe88307de core: filter trace subjects by TRACE session label
This patch changes core's TRACE service to expose trace subjects only if
their PD label matches the label of the TRACE monitor. Hence, by default,
a trace monitor can only observe itself and its child components. Only
if the trace monitor's parent rewrites the trace-session's label, the
view of trace monitor can become broader. For example, when rewriting
the trace label to an empty string "", the trace monitor becomes able to
observe the sibling components hosted in the same init instance as the
trace monitor.

To grant a trace session the special privilege of obtaining a global
system view (including the kernel's trace subjects), the top-level init
has to rewrite the session's label to an empty string. At core, this
specific label "init -> " is handled as a special case that discharges
the filtering/namespacing of trace subjects.

Note that the trace-subject label as reported as subject info is now
given relative to the label of the trace session. As a nice side effect
of this change, the pkg/test-trace_logger works now when executed by the
depot_autopilot as well as via the test.run script.

Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
610ba6e3b6 touch_keyboard: add dialog API to src recipe
This is a follow-up commit to issue #5059. Without it, the binary
archive for the touch_keyboard remains empty.
2023-12-13 12:28:05 +01:00
Norman Feske
66160e6bd3 os/run/test.run: adapt to changed runtime format
Issue #4922
2023-12-13 12:28:05 +01:00
Norman Feske
e2d1888f52 trace_logger: priority config attr in config.xsd 2023-12-13 12:28:05 +01:00
Christian Prochaska
2aeea45c30 os: build 'lib/ld' in 'monitor_gdb.inc'
Fixes #5068
2023-12-13 12:28:05 +01:00
Norman Feske
82a9582dd7 qemu-usb: minor documentation fixes 2023-12-01 11:17:22 +01:00
Norman Feske
4e4b95bfe3 core: remove support for "unlabeled" LOG sessions
Fixes #5054
2023-12-01 11:01:29 +01:00
Josef Söntgen
9d989b1557 fetchurl: add 'ignore_failures' option
This option is useful in cases where batching is configured and
failing to fetch a resource should not influence the over-all
result.

Issue genodelabs/genodians.org#32.
2023-12-01 10:43:45 +01:00
Norman Feske
4685ba394e mk: .lib.so and .abi.so depend on linker scripts
Fixes #3978
2023-12-01 09:49:31 +01:00
Norman Feske
5734ea736c mk: remove unused LIB_SO_DEPS variable
Spotted during our work on issue #5061.
2023-12-01 09:45:47 +01:00
Christian Helmuth
5fdea3a595 version: 23.11 2023-11-30 15:15:51 +01:00
Norman Feske
efccd9c961 News item for version 23.11 2023-11-30 15:11:36 +01:00
Norman Feske
87c5fa1279 Release notes for version 23.11 2023-11-30 15:11:36 +01:00
Christian Helmuth
8baf19022c depot: update recipe hashes 2023-11-30 15:11:36 +01:00
Johannes Schlatow
518a57d8e5 base-nova: allow access to Intel IOMMU
This allows the platform driver to take over control of DMA remapping
and keeps NOVA-driven interrupt remapping active.

genodelabs/genode#5002
2023-11-30 14:22:54 +01:00
Johannes Schlatow
039ade7ad0 pc/platform: allow booting with enabled IOMMU
genodelabs/genode#5002
2023-11-30 14:22:54 +01:00
Johannes Schlatow
1f1437747c platform_drv: don't copy Bdf
genodelabs/genode#5002
2023-11-30 14:22:54 +01:00
Johannes Schlatow
3f1e1323f0 pc/platform: enable IOMMU with default mappings
genodelabs/genode#5002
2023-11-30 14:22:54 +01:00
Johannes Schlatow
bc09ff7498 platform_drv: add default DMA mappings interface
genodelabs/genode#5002
2023-11-30 14:21:51 +01:00
Johannes Schlatow
4163367b53 pc/platform: detect invalid IOMMU devices
genodelabs/genode#5002
genodelabs/genode#2700
2023-11-30 14:20:53 +01:00
Johannes Schlatow
c06b53e52e acpi_drv: add config for ignoring DMAR table
By not evaluating the DMAR table, we disable the IOMMU.

genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
196133c582 platform_drv: use guard pages for DMA buffers
genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
d018cb62f3 platform_drv: guard against Out_of_* exceptions
In the scope of alloc_dma_buffer(), Out_of_* exceptions might be thrown
at different stages. By adding a Guard object, we make sure to rollback
already created objects accordingly.

genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
350a3d9ae4 platform_session: increase RAM and CAP quota
As a consequence of the adding IOMMU support to the platform driver,
additional RAM and CAPs are needed for setting up IO page-table
structures.

genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
3a62676da8 sculpt: increase RAM quota for platform driver
The platform driver needs additional 2MB of RAM for managing IO page
tables (root table and context tables) that are shared among sessions.

genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
44617b8c9d sculpt: route iommu report from platform driver
genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
855147a021 pc/platform: add intel IOMMU support
Add DMA remapping support for Intel devices to the platform driver.

genodelabs/genode#5002
2023-11-30 14:20:49 +01:00
Johannes Schlatow
70b1ae3d1b platform: move enable/disable_pci_device
genodelabs/genode#5002
2023-11-30 14:19:45 +01:00
Johannes Schlatow
f55d06fd5c base-nova: allow MSI for non-PCI devices
DMA remapping hardware units use MSI for fault events. However, MSI
were bound to the presence of a PCI configuration space.

genodelabs/genode#5002
2023-11-28 19:35:16 +01:00
Johannes Schlatow
eefaa07024 base: add irq_type session argument
By adding the `irq_type` argument, one can explicitly specify whether to
use LEGACY, MSI or MSI-X interrupts. We formerly used the
`device_phys_config` to implicitly select MSI, however, with the
addition of IOMMU support to the platform driver there is at least one
instance where we need an MSI for a non-PCI device.

Yet, by adding another session argument to the Irq session, we exceed
the character limit for session args. Since not all arguments are
relevant for LEGACY interrupts resp. MSI, we can split the Irq_connection
constructor to handle the two cases separately and omit unneeded
arguments.

genodelabs/genode#5002
2023-11-28 19:35:16 +01:00
Johannes Schlatow
a80464299a platform_drv: add phys_addr to add_range()
We need the physical address of a DMA range in order to insert it into
the translation table.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
0182e81b51 platform_drv: map actual DMA dataspace size
DMA buffer allocations are always performed as full pages. However, they
got mapped into the IOMMU domain using the requested size, which may not
be a multiple of the page size. This behaviour was introduced as a regression
by #4761 and is corrected by this commit.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
ae7e461452 platform_drv: move IOMMU domain destruction
Destruction of IOMMU domain should happen after the PCI device was
disabled in order to prevent faulty DMA transactions.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
d7b9cd0654 platform_drv: move add_range calls from base class
The virtual add_range()-method must not be called from the base-class
constructor since the derived class is not be fully initialized at
this point.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
022762605b pci_decode: add <irq/> to drhd devices
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
7c5b59556a pci_decode: add <iommu> node to devices
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
e816020346 pci_decode: add intel_iommu devices to devices ROM
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
7b99a43c9e acpi_drv: add size attribute to drhd
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Christian Helmuth
a90e0e249e pc_nic_drv: implement gpiod_get_optional() as dummy 2023-11-28 14:46:28 +01:00
Martin Stein
3b7124bb37 wireguard: README and config.xsd
Ref #4957
2023-11-28 14:46:28 +01:00
Martin Stein
49dd55313a sculpt_manager: select correct launcher in + menu
The sculpt manager views only launchers in the + menu that are not present in
the runtime already. However, this check was missing when finding the right
launcher on a click event inside that menu. This could cause the manager to
try deploying an already deployed launcher a again (without any effect)
instead of deploying the launcher that was actually clicked.

Ref #5064
2023-11-28 14:46:28 +01:00
Christian Prochaska
801c4aa72f depot: add support for debug info files
Fixes #5015
2023-11-28 14:45:29 +01:00
Norman Feske
ee8c76b42e dde_linux: use [build_artifacts] in run scripts
Issue #4860
2023-11-28 14:45:29 +01:00
Norman Feske
67741655d1 dde_rump: use [build_artifacts] in run scripts
Issue #4860
2023-11-28 14:44:29 +01:00
Norman Feske
1e166c7236 Supplement the build of shared libs where needed
This is a follow-up commit to the adaptation of the run scripts to the
consistent use of [build_artifacts] (issue #4860).

The missing build of libm remained undetected until the recent removal
of implicit shared-library builds (issue #5061).
2023-11-28 14:44:29 +01:00
Alexander Boettcher
ff740e300a wm: free window id on destroy_view
Issue #5048
2023-11-28 14:44:29 +01:00
Norman Feske
cb10fe1d77 decorator: add missing initial call _handle_mode
This call is needed whenever the mode has settled before the decorator
has started up.
2023-11-28 14:44:29 +01:00
Norman Feske
5ae0dab6c5 mk: remove implicit build of shared libraries
This patch removes the implicit build of all shared libraries a target
depends on. Targets only depend on the respective ABIs instead. This
alleviates the need to locally build complex shared libraries (think of
Qt) when developing applications. Instead, application developers can
use binary depot archives.

The implementation splits the mk/lib.mk file into three files:
- mk/a.mk   for building one static library (.lib.a)
- mk/so.mk  for building one shared object  (.lib.so)
- mk/abi.mk for building one ABI stub       (.abi.so)

Furthermore, the commit moves messages and the collection of build
artifacts to var/libdeps, triggers the build of kernel-specific
ld-<kernel>.lib.so, and prunes the lib-dependency tree at ABIs.

Fixes #5061
2023-11-28 14:44:29 +01:00
Alexander Boettcher
c02aa759e6 vbox: avoid stuck network during high tx load
- finished tx ack queue should be checked before new allocations
- packets which got not sent must be released in packet stream,
  otherwise the network packet stream gets filled up and starves after a while
- rRegister for ack avail packets and process them concurrently to EMT-* threads
  by nic_ep thread (thanks @Peter for the findings) + add synchronization.
- add sigh_ready_to_submit to network adapter to improve latency by notifying
  the network model explicitly in case we had a full packet stream error case
  (_retry resp. VERR_TRY_LATER)

Fixes #5045
2023-11-28 14:44:29 +01:00
Norman Feske
5410ecf9ad run: check consistency of build_boot_image args 2023-11-28 14:44:29 +01:00
Norman Feske
2d48e209f4 fb_sdl: fix build on 64-bit ARM Linux 2023-11-28 14:44:29 +01:00
Norman Feske
5a75a2f930 gems: use [build_artifacts] in run scripts
Issue #4860
2023-11-28 14:44:29 +01:00
Norman Feske
b843dbf045 pc: use [build_artifacts] in run scripts 2023-11-28 14:44:29 +01:00
Norman Feske
5af3ffd6a8 hello_tutorial: use [build_artifacts] in hello.run
Issue #4860
2023-11-28 14:44:29 +01:00
Norman Feske
727d307089 ports: use [build_artifacts] in run scripts
Issue #4860
2023-11-28 14:44:29 +01:00
Norman Feske
ab0058a454 ports: remove debug_nitpicker.run 2023-11-28 14:44:29 +01:00
Norman Feske
b27bd256dd libports: use [build_artifacts] in qt5 run scripts
Issue #4860
2023-11-28 14:44:29 +01:00
Norman Feske
db72301eb0 nic_router.run: use [build_artifacts]
Issue #4860
2023-11-28 14:44:28 +01:00
Johannes Schlatow
aa7058a3b4 test-read_only_rom: fix false positive
The test is rendered ineffective by a failed resource request.
2023-11-28 14:44:28 +01:00
Norman Feske
769a6ce987 touch_keyboard: use dialog API
Fixes #5059
2023-11-28 14:44:28 +01:00
Norman Feske
9144d47fe2 sculpt/nitpicker/default: focus of touch_keyboard
Without setting the focus to "transient", the touch keyboard is
not able to respond to mouse clicks.
2023-11-28 14:44:28 +01:00
Norman Feske
4a5632ab6d dialog: support view attribs in sandboxed_runtime
This patch mirrors the interface of Sculpt's distant_runtime to the
sandboxed_runtime variant, allowing the configuration of xpos, ypos,
min_width, min_height, opaque, and background color.

Issue #5008
2023-11-28 14:44:28 +01:00
Christian Prochaska
789ae1ea8d hw: distinguish 'Alloc_error' conditions in 'Cap_space'
Issue #5057
2023-11-28 14:44:28 +01:00
Norman Feske
0f54ad8e26 dialog: add text-area widget
This patch moves the text-editing facility of app/text_area to a
text-area widget as part of the dialog library. This has two benefits.
First, it simplifies app/text_area by using the dialog API. Second, the
editor can now easily be reused by other dialog-API-based applications.

Fixes #5058
2023-11-28 14:44:28 +01:00
Norman Feske
e326371762 gems: make gems/dynamic_array.h publicly available
The 'Dynamic_array' utility is used by the text_area as internal
representation of text. As a prerequisite step of making the text
editing features generally available as a text-area widget, the
utility must become public.

Issue #5008
2023-11-28 14:24:26 +01:00
Norman Feske
40c0db2e8d dialog: add Sandboxed_runtime::View::if_hovered
Issue #5008
2023-11-28 14:24:26 +01:00
Norman Feske
9fae8a7532 dialog: support Sandboxed_runtime::Event_handler
This allows applications to get hold of the raw input events,
in particular keyboard input.

Issue #5008
2023-11-28 14:24:26 +01:00
Johannes Schlatow
767ea7f5b1 tool: add sd_card_zynq to autopilot.list
genodelabs/genode#5056
2023-11-28 14:24:26 +01:00
Johannes Schlatow
00ede822c6 disable demo and fb_bench for zynq_usrp_e31x
genodelabs/genode#5056
2023-11-28 14:24:26 +01:00
Johannes Schlatow
cd34effd64 run/cpu_bench.run: add timeout for zynq_usrp_e31x
genodelabs/genode#5056
2023-11-28 14:24:26 +01:00
Christian Prochaska
e9f3101105 base: restore the session phase in `Parent_service'
Issue #5055
2023-11-28 14:24:26 +01:00
Christian Helmuth
2bacd2bf62 run/netperf.inc: unique value for zynq_usrp_e31x
Also renumbered other platforms for sparse use of port space.
2023-11-28 14:24:26 +01:00
Norman Feske
0a71c8f3e1 sculpt_manager: use dialog API
Issue #5053
2023-11-28 14:24:26 +01:00
Norman Feske
1490c58f8b dialog: Hosted::if_hovered method
This method allows for the inquiry of the current hovering state,
e.g., to suppress an update of the Wifi accesspoint list while
the list is hovered.

Issue #5008
Issue #5053
2023-11-28 14:24:26 +01:00
Norman Feske
fa6c7204cd dialog: allow custom 'Select_button' attributes
This is useful to conditionally set the style to "unimportant", or to
use text other than the widget Id::Value.

Issue #5008
Issue #5053
2023-11-28 14:24:26 +01:00
Norman Feske
133cbd272e dialog: make 'click()' const wherever possible
This eases the use of, e.g., 'Select_button' as temporary variable.

Issue #5008
Issue #5053
2023-11-28 14:24:26 +01:00
Norman Feske
ec60011852 dialog: let 'Scope::widget' take 'hosted' as const
This eases the use of temporary 'Hosted' objects. The 'view' code path
is not expected to modify any state.

Issue #5008
Issue #5053
2023-11-28 14:24:26 +01:00
Norman Feske
1aba8182a4 dialog: pass value to Select_button::click
This eliminates the need to distinguish enum values in the body of the
handler, easing the forwarding of the selected value.

Issue #5008
Issue #5053
2023-11-28 14:24:26 +01:00
Stefan Kalkowski
e3881163c4 libc-net: eliminate annoying warning in sendmsg
Fix genodelabs/genode#5052
2023-11-28 14:24:26 +01:00
Stefan Kalkowski
040cf2eb2a tool/run/image/uefi: make silent sgdisk
Fix genodelabs/genode#5051
2023-11-28 14:24:26 +01:00
Christian Prochaska
5d9d3bff11 acpi_drv: detach dataspaces in 'Acpi::Memory'
Issue #5046
2023-11-28 14:24:26 +01:00
Christian Helmuth
536277ec55 lx_emul: prevent compiler warnings in usb.c 2023-11-28 14:24:25 +01:00
Christian Helmuth
7cefeac8ed lx_emul: make memory allocation more clear 2023-11-28 14:24:25 +01:00
Christian Helmuth
963b8b0607 lx_emul: comply boundary constraints of dma pool
Several DMA pools of the EHCI/UHCI USB host controller driver declare
that buffers should not cross 4K boundaries. If this property is not met
fatal errors like NMIs may happen during USB operation.

Discussed in issue #5000
2023-11-28 14:24:25 +01:00
Christian Helmuth
e337f2cb0f lx_emul: natural alignment of power-of-two kmalloc 2023-11-28 14:24:25 +01:00
Stefan Kalkowski
62492f3cd2 lx_emul: do not reset ep in usb flush transfers
Certain USB devices do not react anymore after an endpoint reset
in the use case of USB devices passed through to a virtual machine.
When investigating the only USB session client that needs the
flush transfers request - namely the Qemu xhci model used in
VirtualBox - there seems to be no need to reset the endpoint in fact.

Fix genodelabs/genode#5050
2023-11-28 14:24:25 +01:00
Christian Prochaska
4ecae91fc3 monitor: use a registry for the memory map
Issue #5046
2023-11-28 14:24:25 +01:00
Christian Prochaska
ad28da66b0 usb_hid_raw.run: filter out KVM switch messages
Fixes #5049
2023-11-28 14:24:25 +01:00
Sebastian Sumpf
3264a22c1e socket fs: simplify AF_UNSPEC
Remove separate context state for AF_UNSPEC.

issue #5031
2023-11-28 14:24:25 +01:00
Sebastian Sumpf
c7956aa41b socket_fs/vfs_lxip: errno 65 is EHOSTUNREACH
Return "no route to host" on errno 65 which is EHOSTUNREACH in legacy
dde_linux, return EHOSTUNREACH accordingly in libc's socket fs.

issue #5031
2023-11-28 14:24:25 +01:00
Christian Helmuth
7fb0c9ba30 pc: implement kobject_uevent_env() in shadow/
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
f663168ffd sculpt: version 23.11 2023-11-28 14:24:25 +01:00
Christian Prochaska
98f7227ed0 gdb: fix failed assertion triggered by pagination
Fixes #5047
2023-11-28 14:24:25 +01:00
Christian Prochaska
e309c38263 monitor: prevent overlapping region list entries
Issue #5046
2023-11-28 14:24:25 +01:00
Christian Helmuth
4962340985 pc_linux: enable pinctrl, evdev, i2c_hid
Issue #5036
2023-11-28 14:24:25 +01:00
Sebastian Sumpf
48865337b1 pc_linux: enable gpio, audio
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
c05d4e5b49 dde_linux: prevent scatter-gather in USB devio
USB devio splits large transaction into 16 KiB buffers in scatter-gather
lists. Unfortunately, this mechanism seems unreliable most certainly because
of issue #4809 "DDE Linux struct page object aliasing".

Issue #5036
2023-11-28 14:24:25 +01:00
Alexander Boettcher
65b619e7b4 dde_linux: implement kmem_cache_destroy
Note, this enables more information on wifi-driver error recovery.

Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
4d1e75ce3b dde_linux: enhance clock infrastructure
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
394a495b55 pc: unify string_helpers and get_option()
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
fec1765cc4 pc: run script for pc_nic_drv
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
a942efd92b pc: remove software_node_notify from common dummies
Issue #5036
2023-11-28 14:24:25 +01:00
Sebastian Sumpf
e56437ff0a pc: add "is_acpi_data_node" to lx_emul
Issue #5036
2023-11-28 14:24:25 +01:00
Christian Helmuth
0f8dd3a7a0 pc: remove __register_chrdev from common dummies
Issue #5036
2023-11-28 14:24:24 +01:00
Christian Prochaska
445ecba9b5 monitor_gdb.run: disable pagination earlier
Issue #5047
2023-11-28 14:24:24 +01:00
Christian Prochaska
f13463325a mk: fix clean rule dependencies in build.mk
Issue #5015
2023-11-28 14:24:24 +01:00
Benjamin Lamowski
a482bb8a89 libc: silence sysconf(_SC_GETPW_R_SIZE_MAX) warning
Currently, running ripgrep on Genode emits
"Warning: sysconf(71) not implemented".

Return -1 without setting errno, which is a valid return value according
to getpwnam(3) and silence the warning.

Fixes #5043
2023-11-28 14:24:24 +01:00
Christian Prochaska
6eaf333f10 ports: adapt GDB test to separate debug info files
Fixes #5044
2023-11-28 14:24:24 +01:00
Norman Feske
d7ee460704 list_model.h: rename 'apply_first' to 'with_first'
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
0f686a774d list_model.h: retire 'update_list_model_from_xml'
This transition vehicle to the modern interface has now been replaced by
the new 'List_model::update_from_xml' method.

Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
b9b2a7de34 Simplify 'List_model'
This patch replaces the original policy-based 'update_from_xml' by a new
method that takes three functors for creating, destroying, and updating
elements as arguments. XML nodes are associated with their corresponding
internal data models by annotating the element type with the
'type_matches' class function and the 'matches' method.

The patch also improves safety by enforcing that list-model elements can
never be copied.

Fixes #4317
2023-11-28 14:24:24 +01:00
Norman Feske
b7b74e62a0 platform driver: don't copy list-model elements
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
6e0d44397f depot_autopilot: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
58f7ed268d window_layouter: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
47ac55e9c5 decorator: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
c9938e424b menu_view: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
3e24a86b87 depot_download: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
b249d9f66d depot_deploy: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Christian Prochaska
b41df1fb7a mk: create separate debug info files
Commit also adapts Qt5 libraries.

Issue #5015
2023-11-28 14:24:24 +01:00
Norman Feske
d8b87b2593 wireguard: simplify 'Config_model'
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
784d4e39d5 wireguard: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
50d0a1b8f9 vmm: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
672b03f553 pci_decode: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
df71cecc66 drivers/platform: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Stefan Thöni
1895931918 pci_decode: parsing TPM2 table
issue gapfruit#1938

Fixes genodelabs/genode#5042
2023-11-28 14:24:24 +01:00
Roman Iten
0d344de496 base: extend constness of Genode::Token
Fixes #5039
2023-11-28 14:24:24 +01:00
Pirmin Duss
b53a630592 Re-connect test for wireguard
Issue genodelabs/genode#4957
2023-11-28 14:24:23 +01:00
Pirmin Duss
37a7119eb3 wireguard: initialize timekeeping with RTC
This commit fixes the "Invalid handshake initiation" error when the
client restarts.

Fixes genodelabs/genode#4957
2023-11-28 14:24:23 +01:00
Pirmin Duss
f66a7db87f lx_emul: allow setup of the persistent clock
This commit adds support to initialize the timekeeping for
the Linux subsystem with the value from the RTC.

Only the seconds part of timespec64 is supported.

Issue genodelabs/genode#4957
2023-11-28 14:24:23 +01:00
Christian Prochaska
9aa0de24af libc: implement '_spinlock()' and '_spinunlock()'
FreeBSD libc code uses only a single spinlock instance and, thus there
is no obvious reason why it would need to be implemented as an actual
spinlock. _spinlock() and _spinunlock() functions are implemented with a
static pthread mutex.

Issue #725
2023-11-28 14:24:23 +01:00
Christian Prochaska
94bbdbb71d libc: add ___pthread_cleanup_push/pop_imp aliases
Issue #725
2023-11-28 14:24:23 +01:00
Christian Prochaska
ebea6fb23f libc: use threaded mode
Issue #725
2023-11-28 14:24:23 +01:00
Tomasz Gajewski
002eb6f649 lib/timout: fix interpolation optimization
Issue #4960
2023-11-28 14:24:23 +01:00
Tomasz Gajewski
02753b3c2c tool/run: fixed tftp support in boot_dir/hw
Changes needed after merging `uboot` and `uboot_fit` modules into a
single module.

Additionally `image.elf` file is removed when either `image.itb` or
`uImage` is created, so it cannot be processed when `image/uboot` module
is loaded. Therefore `image.elf` processing is done conditionally now.

Fixes #5037
2023-11-28 14:24:23 +01:00
Alice Domage
6402182815 sntp_client: add DNS lookup option
This commit adds a new configuration option, `dst_addr` to the
'sntp_client' that accepts either an IP address or a DNS hostname. If a
DNS hostname is provided, the 'sntp_client' will resolve the IP address
before each SNTP request. The 'dst_ip' configuration option is
deprecated but kept for compatibility until 'dst_addr' is fully adopted.

xsd/net_types.xsd: add Net_address type
sntp_dummy_rtc: adjust configuration to use pool.ntp.org

Fixes genodelabs/genode#5003
2023-11-28 14:24:23 +01:00
Alice Domage
132e027c69 os/include/net: add support for the DNS protocol
Issue genodelabs/genode#5003
2023-11-28 14:24:23 +01:00
Alexander Boettcher
58a420511c nic_router: show offered IPs
If verbose_domain_state is enabled, the server logs detailed information
about the DHCP offer.
2023-11-28 14:24:23 +01:00
Johannes Schlatow
392ed76344 nvme_drv: arch-specific Dma_buffer allocation
Different cacheability properties should be applied dependent on the
target architecture.

genodelabs/genode#5000
2023-11-28 14:24:23 +01:00
Johannes Schlatow
25ad0ad530 nvme_drv: remove unused Dma_allocator
genodelabs/genode#5000
2023-11-28 14:24:23 +01:00
Johannes Schlatow
b7855cc517 base: remove overriden try_alloc default argument
`Expandind_pd_session_client::try_alloc` is an overriden virtual method
of `Ram_allocator::try_alloc`. The latter specifies the default Cache
argument as CACHED. The overriden method should either do the same or
not even specify a default argument at all.

genodelabs/genode#5000
2023-11-28 14:24:23 +01:00
Johannes Schlatow
c738f4b029 dde_linux: use CACHED dma buffers
On x86, DMA buffers are actually always mapped as cached. We should
therefore actually ask for a cached buffer in order to avoid confusion.

genodelabs/genode#5000
2023-11-28 14:24:23 +01:00
Johannes Schlatow
686b9d44f4 dde_bsd: use CACHED dma buffers
On x86, DMA buffers are actually always mapped as cached. We should
therefore actually ask for a cached buffer in order to avoid confusion.

genodelabs/genode#5000
2023-10-26 15:29:43 +02:00
Johannes Schlatow
0cf2b1be89 gpu/intel: use CACHED dma buffers
On x86, DMA buffers are actually always mapped as cached. We should
therefore actually ask for a cached buffer in order to avoid confusion.

genodelabs/genode#5000
2023-10-26 15:29:39 +02:00
Norman Feske
579a5e7845 News item for Sculpt 23.10 2023-10-26 12:17:56 +02:00
Christian Helmuth
b634549722 depot: update recipe hashes 2023-10-25 14:01:40 +02:00
Norman Feske
49aecc20b7 sculpt: update README for version 23.10 2023-10-25 12:58:30 +02:00
Martin Stein
c188f792b2 gems/sculpt: update mstein pubkey 2023-10-25 08:59:15 +02:00
Alexander Boettcher
70737c034b core: hand out RAM region as IOMEM to ACIPCA
The special region seems not to be declared as reserved nor ACPI
related. However, ACPICA depends on this physical range.

Issue #4643
2023-10-25 08:59:15 +02:00
Norman Feske
b50a88a95d depot_download_manager: optimize report processing
Feed the high-frequent fetchurl reports into a list model to speed up
the subsequent evaluation of the data.

Also limit the rate of state reporting during updates to visible changes
in percent such that most fetchurl reports do not cause any UI activity
(status updating) any longer.

This patch noticeably speeds up the installation of complex packages
(i.e., the morph browser) on the PinePhone.

Issue #5038
2023-10-25 08:58:54 +02:00
Christian Helmuth
20239dc27f sculpt/pc: increase usb_hid_drv cap quota
This is required to support more than 3 USB input devices.
2023-10-25 08:58:54 +02:00
Norman Feske
ca85cb936b sculpt: debug-dialog tweaks
Shorten the visible text. Make "wait" option depend on "wx" option.
Indent checkboxes similar to the resource dialog.

Issue #5012
2023-10-25 08:58:54 +02:00
Stefan Kalkowski
5471ef7e1e hw: increase default page-table array
Fix #5035
2023-10-25 08:58:53 +02:00
Alexander Boettcher
26be862e08 acpica: suppress pci related output during startup
Issue #4643
2023-10-25 08:58:53 +02:00
Christian Helmuth
e88e3680aa genode_c_api: remove global-static constructors
The execution of global-static constructors in Genode is optional for
native components or determined in the libc for libc components. By
convention, we avoid static constructors wherever possible but in rare
cases the component can tweak the point when constructors are executed
and initialize an environment beforehand. The wifi_drv applies this
pattern for the uplink initialization, but is a libc component on the
other hand, and, thus, statics in the Genode C API for uplink are
constructed later by the libc. So, the prior initialization is reverted,
i.e. the signal-handler capability becomes invalid.

This addresses a regression exposed by the following commit.

  drivers/wifi: perform multi-staged construction

Related to #3509
Fixes #5024
2023-10-25 08:58:53 +02:00
Norman Feske
0a001443e9 sculpt: don't use component names as widget IDs
Component names can be larger than widget IDs, which are capped at 20
characters. To uniquely correlate the component depicted in the graph
with clicks, this patch uses a dedicated graph ID for each runtime
component instead.

Fixes #5034
2023-10-25 08:58:53 +02:00
Norman Feske
94d04b724a sculpt: add system-control in resource dialog
This patch allows for the interactive assignment of the system-control role
to a new component via the resource dialog. This is useful for integrating
low-level components like the Intel frequency/power monitoring tool.

Fixes #5033
2023-10-25 08:58:53 +02:00
Norman Feske
b3a9a2eb4e touch_keyboard: minor UI tweaks
Remove diagnostic message, remove vertical spacers between buttons.
2023-10-25 08:58:53 +02:00
Johannes Schlatow
7b15cce099 depot: add src/qt5_svg to pkg/goa
Fixes genodelabs/genode#5032
2023-10-25 08:58:53 +02:00
Johannes Schlatow
19ec0b2dd4 depot: add compat-libc to pkg/goa
Fixes genodelabs/genode#5030
2023-10-25 08:58:53 +02:00
Sebastian Sumpf
83d4fcdf27 vfs/lxip: support connect(...AF_UNSPEC..) on UDP sockets
Note, Linux supports connection reset via this mechanism for UDP as well
as TCP sockets and vfs_lxip retains this feature.

Issue #5031
2023-10-25 08:58:53 +02:00
Sebastian Sumpf
5261fe626d libc: support connect(..AF_UNSPEC..) on UDP sockets
A 'connect' with AF_UNSPEC dissolves address association in order to
re-connect to another address.

Issue #5031
2023-10-25 08:58:53 +02:00
Josef Söntgen
cf43e0c3da libdrm/lima: always map BO with ID 1 2023-10-25 08:58:53 +02:00
Sebastian Sumpf
d49700f562 stdcxx: add another 'std::basic_ios' flavor 2023-10-25 08:58:53 +02:00
Norman Feske
1224162072 menu_view: refine zero-size condition
Commit "menu_view: ignore zero-sized widgets in box layout" introduces
zero-sized child widgets as a special case but defined zero-sized as
zero covered pixels (w*h == 0). However, for layouting, a widget with a
non-zero height and zero width is not zero-sized.

This patch refines the zero-size condition such that only widgets with
both zero width and zero height are considered as zero-sized.

It thereby solves the missing display of empty lines in the text_area
component.
2023-10-25 08:58:53 +02:00
Norman Feske
87b7dfed5d xml_node: skip whitespace in differs_from
The 'Xml_node::differs_from' method takes the constructor arguments
(addr, size) for a byte-wise comparison whereas 'with_raw_node'
restricts the byte range to the actual XML tags. In cases where
the XML start tag is preceeded by whitespace, both ranges can differ.

Since the 'differs_from' method is meant for comparing actual XML
nodes - not any whitespace around them - whitespace should be ignored
on both operands.

Issue #5029
2023-10-25 08:58:53 +02:00
Norman Feske
1b23d3b8cb sculpt: reset popup menu on close
This avoids an unexpected geometry animation when opening the popup right
after closing it from a sub menu.
2023-10-25 08:58:53 +02:00
Christian Prochaska
82705cfc0f tool_chain_auto.run: remove posix.lib.so preload config
Fixes #5028
2023-10-25 08:58:53 +02:00
Christian Prochaska
c4677042e1 ldso: load posix.lib.so first
Fixes #5027
2023-10-25 08:58:53 +02:00
Norman Feske
d3e5e5c286 sculpt: fix interplay of popup with old dialogs
This is a follow-up fix for commit "sculpt: apply Dialog API to diag,
panel, and graph", which happened to render the legacy dialogs (network
and settings) inaccessible.

The patch avoids the use of clack seq numbers for the 'popup_opened'
condition (which happens on click, not clack). It also overrides old
click information on the arrival of a new click, avoiding the evaluation
of stale click sequence numbers in distant_runtime.cc. Furthermore, it
reduces the rate of 'Distant_runtime::_try_handle_click_and_clack'.

Issue #5008
2023-10-25 08:58:53 +02:00
Christian Helmuth
eb2843de33 pc_nic_drv: implement pcie utility dummies 2023-10-25 08:58:52 +02:00
Benjamin Lamowski
3f80249204 sculpt: offer passphrase dialog for WPA3 networks
On WPA3 encrypted networks the AP picker does not indicate encryption
and does not prompt for a passphrase.

Also indicate an encrypted network when "protection=WPA3", remedying
both issues.

Fixes #5022
2023-10-25 08:58:52 +02:00
Alexander Boettcher
9b312054f5 intel/display: support force_* and configured mode
Up to now, when using force_*, all other configured modes of a connector
got overwritten and the force_* got enforced. With the commit,
the connector mode is considered (if below max_*) and the resulting
framebuffer may be larger then the dimension of force_*.
2023-10-25 08:58:52 +02:00
Alexander Boettcher
ab91750869 acpica: add option to select GPE usage
Mitigates the ACPI IRQ storm of T490s.

Issue #4643
2023-10-25 08:58:52 +02:00
Christian Prochaska
64b3ab59b0 gdb_interactive.run: pass Ctrl-C to GDB on hardware
Issue #5019
2023-10-25 08:58:52 +02:00
Christian Helmuth
66c2c74147 depot/publish: let gpg overwrite .sig files
Without this change gpg aborted with

  gpg: Sorry, no terminal at all requested - can't get input

and after adding --batch onlye with

  gpg: signing failed: File exists
2023-10-25 08:58:52 +02:00
Christian Prochaska
794b178032 sculpt: update falkon preset
Fixes #5018
2023-10-25 08:58:52 +02:00
Christian Helmuth
0db4116ba6 sculpt: version 23.10 2023-10-25 08:58:52 +02:00
Christian Helmuth
accfc4145a Stable TAR archive metadata content in recipes
Differences in TAR archive member metadata results in unstable depot
hashes. The following properties have to be fixed: modification time
(incl. time zone), numeric owner and group, permission modes.

Releated to #2842
2023-10-25 08:58:52 +02:00
Alexander Boettcher
e36170c997 nova: add guarded access to MSRs
via Genode Pd::system_control interface

Issue #5009
2023-10-25 08:58:52 +02:00
Christian Prochaska
fe3a958dbf os: add a terminal_crosslink pkg recipe
Fixes #5017
2023-10-04 14:00:46 +02:00
Christian Prochaska
16ba978025 ports: add a gdb_x86 pkg recipe
Fixes #5016
2023-10-04 14:00:42 +02:00
Christian Helmuth
07c4b92335 depot: update recipe hashes 2023-10-04 13:22:08 +02:00
Christian Prochaska
aea90dc7da hw: fix vmm_arm test on arm_v8a
Fixes #4975 regression
2023-10-04 13:22:08 +02:00
Christian Prochaska
ae899b9bc7 ports: add a test for GDB
Fixes #5014
2023-10-04 13:22:08 +02:00
Christian Prochaska
471e61f0e4 monitor: move monitor_gdb test commands to separate file
Fixes #5013
2023-10-04 13:22:08 +02:00
Christian Prochaska
51875b89fd ports: add socat_tcp pkg
Issue #5007
2023-10-04 13:22:08 +02:00
Christian Prochaska
1bb1ebe2ae sculpt: use debug monitor as runtime init
Fixes #5012
2023-10-04 13:22:08 +02:00
Christian Prochaska
7731e02a20 monitor: remove terminal write busy loop
Fixes #5011
2023-10-04 13:22:07 +02:00
Norman Feske
529cdc949b doc/getting_started.txt: fb_sdl changed to SDL2
Issue #4993
2023-10-04 13:22:07 +02:00
Norman Feske
aff17cb177 sculpt: propagate managing_system role
This change allows for the hosting of system-management components
in Sculpt's runtime. The special role must be declared either as
<launcher managing_system="yes"> attribute or in the deploy
configuration's <start managing_system="yes"> attribute.

Issue #5009
2023-10-04 13:22:07 +02:00
Benjamin Lamowski
558a00138c vmm: rename State to Vcpu_state for clarity
Rename locally extended VCPU state from State to Vcpu_state for clarity.
The local namespace only adds two accessor methods, which does not
justify a local generic name.

Ref #4968
2023-10-04 13:22:07 +02:00
Benjamin Lamowski
0e49149a46 base-hw: rename Vm_state to Vcpu_state
Make naming across architectures coherent by renaming Vm_state to
Vcpu_state, to reflect that it contains the state of a Vcpu and not that
of an entire VM.

Ref #4968
2023-10-04 13:22:07 +02:00
Christian Prochaska
149a0183ec monitor: fix 'vCont?' command response
Fixes #5010
2023-10-04 13:22:07 +02:00
Alexander Boettcher
72a3c2fe97 vbox6: disable RDTSC exit (SVM)
Issue #4726
2023-10-04 13:22:07 +02:00
Alexander Boettcher
9ab593e1b5 nova: provide system_control cap per cpu
Issue #5009
2023-10-04 13:22:07 +02:00
Alexander Boettcher
916bd88e5e base: extend PD session by system_control_cap
Per Affinity::Location a system control cap can be requested. The capability
provides an RPC interface to request and set Cpu_state, as provided by the
former Pd::managing_system(Cpu_state) method. Invocation of those system
control capabilities then *can* (see below) be executed on the desired CPU
as described by Affinity::Location.

The system control cap will be invalid for kernels that don't support
system_control/managing_system functionality at all.

The system control cap will be ever by the same, e.g. ignoring the
Affinity::Location parameter, if the used kernel doesn't support or doesn't
require the feature to execute the system control per CPU.

The commit is a preparation step to add guarded and selective x86 MSR
access per CPU.

Fixes #5009
2023-10-04 13:22:07 +02:00
Norman Feske
ffc25fde53 sculpt: apply Dialog API to diag, panel, and graph
This patch partially converts the Sculpt manager to the dialog API.
At this stage, both the old utilities and the new dialog API are still
used simultaneously.

Issue #5008
2023-10-04 13:22:07 +02:00
Norman Feske
0c40d52010 sculpt: add Dialog::Distant_runtime
The so-called 'Distant_runtime' implements GUI dialogs via menu_view
components hosted at a distant init instance as opposed to child
components (as implemented by the 'Sandboxed_runtime'). This is
particular the case in Sculpt OS where the sculpt manager is not the
parent of the menu_view instances.

Issue #5008
2023-10-04 13:22:07 +02:00
Norman Feske
9d5af71c3d sculpt: seq events for touch_release 2023-10-04 13:22:07 +02:00
Norman Feske
37d5bdbae5 sculpt: deprecate original 'Dialog' interface
By renaming 'Dialog' to 'Deprecated_dialog', we become able to use the
name 'Dialog' for the new API while temporarily keeping the original
interface in tact.

Issue #5008
2023-10-04 13:22:07 +02:00
Norman Feske
f90058488f sculpt: screensaver refinements
- Increase default timeout to one minute
- Ignore power-button events during display-driver startup to avoid
  entering another forced blank when pressing the power button twice.
- Prevent wakeup from user activity except for the power button.
  So the volume can be adjusted without leaving the screensaver.

Issue #4950
2023-10-04 13:22:07 +02:00
Norman Feske
4fdc999087 Dialog API
The new API at gems/include/dialog/ aids the creation of simple GUI
applications based on the menu-view widget renderer. Its use is
illustrated by the simple test application at src/test/dialog/
that is accompanied with the dialog.run script.

Issue #5008
2023-10-04 13:22:06 +02:00
Norman Feske
6895175764 menu_view: omit label hover details by default
Each hover change of the character position within a label results in a
new hover report, which needs to be evaluated by the application. For
the common cases where labels are used as button texts or for presenting
passive information, the level of detail is not needed while the
recurring hover reports induce overhead at the application side.
This patch mitigates this overhead by excluding labels from the hover
reporting by default.

For use cases that actually depend of precise hover reporting of labels,
for example an editable text area, the hover reporting can be enabled by
setting the 'hover="yes"' attribute of the label.
2023-10-04 13:22:06 +02:00
Norman Feske
391c261199 menu_view: propagate widget version attr
The 'Widget::_version' attribute was meant to allow the deliberate
replacement of a widget by a same-named widget by changing the version
while keeping the name, thereby suppressing any geomety animation.

However, the implementation missed to populate the attribute with the
value provided by the dialog ROM, prompting the unconditional
re-creation of the widget whenever a 'version' attribute was specified.
Even though this had the (desired) effect of preventing geometry
animations, it could cause feedback loops between hover reports and
dialog ROMs because the 'hover_changed' condition in 'Menu_view::Main'
would always stay true while a versioned widget is hovered.
2023-10-04 13:22:06 +02:00
Norman Feske
76adfff091 menu_view: add styles/button/invisible/hovered.png
This avoids the need to handle a special case at the menu_view user side.
2023-10-04 13:22:06 +02:00
Christian Prochaska
4bef85d7bc ports: add socat
Fixes #5007
2023-10-04 13:22:06 +02:00
Christian Prochaska
abc3c5f0df libc: stat: classify transactional files as character devices
Fixes #4981
2023-10-04 13:22:06 +02:00
Josef Söntgen
ef0c859b7a virtualbox6: cache USB DMA bounce buffers
To prevent exessive allocations the bounce buffers are allocated
once and afterwards re-used. The DMA buffers are provided by an
range allocator whose backing store increases in 4 MiB chunks.

The range allocator might not merge the ranges as those chunks
are not necessarily allocated continously. Allocations larger
than the static chunk size are therefor treated as error.
2023-10-04 13:22:06 +02:00
Alexander Boettcher
264160797d qemu-usb/webcam: cache large allocation of libyuv 2023-10-04 13:22:06 +02:00
Alexander Boettcher
0d868515a5 libyuv: add support to overwrite default allocator
Internally libyuv uses malloc & free for short time dynamic memory
allocation during image transformation. The converted images are
such large, that the Libc allocator will create and destroy new Genode
dataspace per image.  In time sensitive code paths, the overhead can be
noticeable by the caller of the image transformation.
The patch adds the option to register callbacks in the libyuv library to
implement the image allocation by users of the library. They may implement
caching strategies to avoid the overhead, e.g. as seen with qemu-usb and
the webcam model.
2023-10-04 13:22:06 +02:00
Alexander Boettcher
63c5ec7390 qemu-usb: reduce overhead of capturing one picture
from 3 USB packet to 1 packet per picture. Set the maximal supported
payload to the size of one picture + the size of the required protocol
header.
2023-10-04 13:22:06 +02:00
Alexander Boettcher
385b37dca7 qemu-usb/webcam: close session after timeout
and not before. On Windows guest with more than 1 vCPU, the packets
seem to arrive and/or seem to be handled too late in the Webcam model.
An intermediate state, to due the late packet, has been used to decide to
close the Capture session too early.
2023-10-04 13:22:06 +02:00
Christian Prochaska
9c32d53914 os: add a src recipe for test-terminal_echo
Fixes #5006
2023-10-04 13:22:06 +02:00
Christian Prochaska
3cb567d0b1 GDB: support an empty initial thread list on Genode
Fixes #5005
2023-10-04 13:22:06 +02:00
Christian Prochaska
f0b734886e GDB: don't cache the memory map
Issue #5004
2023-10-04 13:22:06 +02:00
Christian Prochaska
d77cb2b1fc monitor: add 'qXfer:memory-map:read' command`
Fixes #5004
2023-10-04 13:22:06 +02:00
Christian Helmuth
c6881a8126 vbox6: silence stack-size limit warning
Our stack slots are 1M per thread including room for metadata.
Therefore, this patch reduces the stack demand of EMT threads to
1M - 16K.
2023-10-04 13:22:06 +02:00
Christian Helmuth
a7a7c56ad6 libc: silence "Warning: missing sysctl for [0][3]
The warning results from sysctlnametomib() that uses an undocumented
FreeBSD kernel interface we do not support.

Fixes #4673
2023-10-04 13:22:05 +02:00
Christian Helmuth
9db4293d7a vbox6: implement ioctl(SUPPAGEFREE &request)
Fixes #4674
2023-10-04 13:22:05 +02:00
Christian Helmuth
15d1beca1b Fix use-after-free warnings in test-libc 2023-10-04 13:22:05 +02:00
Christian Helmuth
cc1a6041a7 fb_sdl: adapt RAM quota for large screen sizes
Issue #4993
2023-10-04 13:22:05 +02:00
Robin Eklind
d3d822cd9d fb_sdl: refactor to only construct window once
In SDL2, support has been added for multiple windows.

As such, prior to this commit, invoking _sdl_screen.construct
would create a new window each time the original window was
resized.

To avoid this, refactor to only construct the window once, and
upon resize events, reconstruct the SDL_Surface and SDL_Texture
of Sdl_screen to the new window dimensions.

Issue identified by @chelmuth in https://github.com/genodelabs/genode/pull/4993#issuecomment-1729530634

Fixes #4993
2023-10-04 13:22:05 +02:00
Robin Eklind
3e68b07db0 fb_sdl: fix handling SDL_WINDOWEVENT_RESIZED
Issue #4993
2023-10-04 13:22:05 +02:00
Robin Eklind
9799adda79 fb_sdl: update to use sdl2
Following the official migration guide of SDL [1], the
fb_sdl framebuffer driver was update from SDL1 to SDL2.

The sdl2 port in world/src/lib/sdl2 is used.

Since SDL1 is in maintenance mode [2], support for other
display servers than X11 will never be implemented. In
particular, support for Wayland is missing from SDL1.

Fortunately, a port of sdl2 is maintained in genode-world.

As SDL2 is actively developed, it will provide support for
modern hardware architectures, and has mature support for
Wayland [3].

[1]: https://wiki.libsdl.org/SDL2/MigrationGuide
[2]: https://wiki.debian.org/Wayland#SDL1_.28unsupported.29
[3]: https://wiki.debian.org/Wayland#SDL2_.28supported_since_2.0.2.2B-.29

Issue #4993
2023-10-04 13:22:05 +02:00
Benjamin Lamowski
5abd2dddb8 tz_vmm: port to new VMM library API
Ref #4968
2023-10-04 13:22:05 +02:00
Christian Helmuth
3a566262fe lx_emul: multi-touch trackpad support in evdev.c
Also addresses remarks in issue #3019.
2023-10-04 13:22:05 +02:00
Christian Helmuth
12fc9a0fbb trace_logger: log priority of trace subject
Optionally log thread priority with

  <config priority="yes" ...> ... </config>

The commit also applies a cleanup of format calculations.
2023-10-04 13:22:04 +02:00
Alexander Boettcher
484bde4b4b vbox5: remove VM generic version
Issue #4968
2023-10-04 13:22:04 +02:00
Stefan Kalkowski
17a140db3d dde_linux: delete orphaned files
Fix genodelabs/genode#4998
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
cfab4e74a9 vmm: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
7e79128c03 vmm_x86: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
9f054635bd virtualbox6: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
1515a0a51e base-sel4: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
5136883ded base-foc: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
85012d5edd base-nova: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
9489bf41a5 base-hw: port to new VMM library API
Ref #4968
2023-10-04 13:22:03 +02:00
Benjamin Lamowski
daafe3f4e2 base: rework vmm library API
The new API emphasizes control over the vCPU data by granting access
through the Vcpu::with_state() method, which makes sure that the vCPU is
stopped, invokes the supplied function with a reference to the VM state
and resumes the vCPU if the function returns true.

The old Vcpu::run(), Vcpu::pause() and Vcpu::state() methods are removed
in favor of the new API. Execution of the vCPU is now interrupted by
sending a native Genode Signal to its Vcpu_handler, which will run the
VMM's exit handling method. When this method retrieves the vCPU state by
calling Vcpu::with_state(), the outside interruption is detected and on
x86 a recall exit is injected into the state to signal the vCPU
interruption / pause request to the VMM's vCPU handler.

Ref #4968
2023-10-04 13:22:03 +02:00
Alexander Boettcher
5c27993884 nova: transfer guest fpu state via utcb
instead via the hardware registers of the FPU. On Genode all components and
so VMMs are built such, that the compiler may generate optimized code by
using the FPU at any time. We had to make sure to save the
FPU state as early as possible before the VMM component touches the FPU,
to avoid corrupting & losing guest FPU state. This caused headache again
and again. To avoid the uncertainty, we remove this feature and explicitly
transfer the FPU state via the UTCB.
2023-09-29 12:21:04 +02:00
Benjamin Lamowski
37a6669e71 libc: add support for FreeBSDs KERN_ARND sysctl
Provide FreeBSDs KERN_ARND systemctl by calling getentropy().

To use it, configure an RNG via the `rng` libc runtime parameter.

Ref #4997
2023-09-29 12:21:04 +02:00
Benjamin Lamowski
aa5751b7fc libc: add more dummies for the Rust libc crate
Add dummies for pthread_set_name_np(),
posix_spawn_file_actions_addchdir_np() and
cpuset_getaffinity().

Ref #4997
2023-09-29 12:21:04 +02:00
Benjamin Lamowski
159c3d0606 compat_libc: add versioned symbols for lstat and readdir_r
Ref #4997
2023-09-29 12:21:04 +02:00
Josef Söntgen
02c8d73426 timer-session: decrease min timeout to 1 ms
Depending on the client and use-case the current minimal timeout
value of 5 ms could be too high, lowering it to 1 ms stays within
the limit imposed by most timer drivers.

Issue #4990.
2023-09-29 12:17:45 +02:00
Josef Söntgen
ab4c36c834 virtualbox6: wait at least 1 ms during halt
When the wait value is too small the HALT attempt turnes into
busy-polling in the VMM. To prevent that always wait a minimal
amount of time.

Issue #4990.
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
2bb901e1e3 rpi: disable run scripts that use 'drivers_nic_rpi'
The 'drivers_nic_rpi' packet uses the 'usb_net_drv' which is currently not
supported by the virt_linux version.
2023-09-29 12:17:45 +02:00
Norman Feske
3ebb715c5c libports: use [build_artifacts] in run scripts
...except for the run scripts related to Qt and the NIC router.

Issue #4860
2023-09-29 12:17:45 +02:00
Norman Feske
e8059ccba5 vfs/pipe: fix dangling read_ready_waiters element
This patch removes the obsolete 'io_progress_elem', which was wrongly
enqueued to the 'read_ready_waiters' fifo and not dequeued at
destruction time.

Fixes #4987
2023-09-29 12:17:45 +02:00
Norman Feske
458206b11a monitor: apply affinity to monitored children
Fixes #4996
2023-09-29 12:17:45 +02:00
Robin Eklind
d7bbb27671 doc/gdb: fix phrase "to a certain extent" 2023-09-29 12:17:45 +02:00
Robin Eklind
8009e9ca59 doc/depot: fix typo, use 64-bit (instead of 32-bit) when referring to x86_64 2023-09-29 12:17:45 +02:00
Robin Eklind
0489f3673c doc/depot: fix minor typo in 'Depot structure' section 2023-09-29 12:17:45 +02:00
Christian Helmuth
b15fb2bbaf Adapt autopilot output checks in usb_hid_raw test
Issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
b025ddcc8f tool/dde_linux: fix create_dummies for GNU Make 4.4
GNU Make 4.4 will pass TARGET to the sub-make of UNDEF_REFS where it can
be later used as link TARGET by Genode's build system. Before 4.4 TARGET
was undefined in the sub-make leading to the correct result.
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
bb51c113ca dde_linux.port remove USB client driver sources
Remove 'usb_hid', 'usb_net', 'usb_modem' from dde_linux port. These
versions have been updated to Linux 6.1.20 which uses the 'linux.port'
file.

issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
798fb709a2 dde_linux: remove usb_modem driver
The driver is superseded by the USB network driver (usb_net) which also
contains MBIM support for LTE modems previously provided by this
driver.

issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
7e823f7c19 dde_linux: remove legacy_usb_net
issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
cd2910eb2c dde_linux: remove usb_hid_legacy
issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
d5cf77539a dde_linux: update usb_net driver to Linux 6.1.20
Driver for network-interface cards and LTE modems with MBIM support
connected via USB.

issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
f668aea42a dde_linux: update usb_hid driver to Linux 6.1.20
The drivers uses the 'virt_linux' api and the current lx_kit
implementation. It is a drop-in replacement for the Linux 4.16.3 based
version.

issue #4958
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
e1b463082a usb_net.run: enable Qemu device pass-through
issue #4958
2023-09-29 12:15:07 +02:00
Sebastian Sumpf
f4d7455a9f recipe: wireguard use virt_linux api
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
5bce4dac81 recipe: virt_linux api
for x86_32, x86_64, arm, arm_64

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
c835993ac3 lx_emul: add wheel events to shadow evdev.c
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
6ac68494db lx_emul/arm: add 'pteval_t'
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
c4ec847680 lx_emul/shadow/uaccess_64: add 'clear_user'
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
3925c7ec60 virt/lx_emul: add usb_client.c
This registers C-API USB-client device handle (i.e., USB::Connection) as
Linux 'usb_device' and probes all the initialized drivers.

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
5eff895f9d virt/lx_emul: shadow urb handling for USB clients
allocate, free, and submit urbs to an USB service using Genode's USB
client C-API.

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
d27e0a8fe6 virt_lx_emul: add shadow 'vmalloc.c'
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
22231c0604 virt_lx_emul: adjust dummies for usb_hid/net
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
71c32f2923 virt_linux: add init calls for USB HID/NET
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
57d2b7235d virt_linux: add USB HID/NET/MBIM to kernel configuration
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
f9e70b0300 genode_c_api/event: add wheel events
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
c5a55e5af4 genode_c_api/usb_client: API USB clients
Through this API C-code can connect to an USB service.

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
f896fcfadb genode_c_api/usb: add ALT_SETTING and CONFIG
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
9f8ccc030b linux.port: add usb_net_cdc_ncm.patch
NCM tries to batch TX packets using timeouts (500us) and does not send packets
before 3 packets are in the submit queue. Timeouts take milliseconds on
dde_linux which leads to delayed ACKs and poor performance for the RX case.
Therefore, we send small packets (<100 Bytes) immediately without batching (it
might be an ACK or last packet of a larger transfer).

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
5c1b9399b0 linux.port: add usb_net_pinephone.patch
The PinePhone Modems' CDC Ethernet Interface does not respond if RX/TX queue size
is greater 12 (experimentally determined), the default would be 60, meaning 60
RX Bulk URBs are sent at once to the device.

issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
9a6423b4ef dde_linux: move usb_net -> legacy_usb_net
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
8f34c27ca5 dde_linux: move usb_hid -> usb_hid_legacy
issue #4958
2023-09-29 12:15:05 +02:00
Christian Helmuth
41adf8d196 jitterentropy: clear memory in jent_zalloc() 2023-09-29 12:15:05 +02:00
Johannes Schlatow
119f679278 fs_report: handle WRITE_ERR_WOULD_BLOCK
A WRITE_ERR_WOULD_BLOCK may occur when large reports are written to a file
system because this fills up the submit queue of the packet-stream interface.

Fixes genodelabs/genode#4988
2023-09-29 12:15:05 +02:00
Alice Domage
6881a71a87 depot_remove.run: improve <remove_all/> tests
This commits introduces changes to test number 4, so it must keep
more than one PKG. Also, it introduces a 5th test to verify that the
<remove_all/> functionality does delete everything in the depot.

Issue genodelabs#4866
2023-09-29 12:15:05 +02:00
Alice Domage
3f661a75e4 depot_remove.run: make test functions more intuitive
This commits introduces improvements to the test functions to avoid
code duplication, and renames these functions to reflect better what they
are used for.

Issue genodelabs#4866
2023-09-29 12:15:05 +02:00
Johannes Schlatow
0622446f09 base: print last character of unterminated strings
The last character should only be skipped if a `\0` or `\n` is found. If
the string ends without such a character or the maximum line length is
hit, we do not skip the last character.

Fixes genodelabs/genode#4985
2023-08-24 14:12:21 +02:00
Christian Helmuth
e78a84196d version: 23.08 2023-08-24 11:54:57 +02:00
Christian Helmuth
4f8d8b760c News item for version 23.08 2023-08-24 11:54:13 +02:00
Norman Feske
7541c357ca Release notes for version 23.08 2023-08-24 11:33:24 +02:00
Norman Feske
8cba87420b doc/components.txt: update to Genode 23.08 2023-08-24 11:33:24 +02:00
Christian Helmuth
134a785fe0 depot: update recipe hashes 2023-08-24 11:01:40 +02:00
Benjamin Lamowski
9f7e47368f libports: transform compat-libc into a static library
Dynamically loading the `compat-libc` breaks `fork(2)` on Genode.

Switch `compat-libc` to a special api package that provides a source
file for statically linking the library, analogous to the `blit`
package. This also requires a quirk in Goa but should prevent breaking
`fork()` and removes the runtime and archive dependencies for Rust
packages using `compat-libc`.

Ref genodelabs/goa#61
2023-08-23 13:46:37 +02:00
Sebastian Sumpf
0a85964f91 libports: add 'compat-libc'
Implement FBSD_1.0 versions of libc functions ('stat', 'fstat'). The
functions are versioned with @FBSD_1.0, and therefore, will not clash
with libc during linking. However, to be called by our dynamic linker,
the library must be before libc in the NEEDED section of the binary
using it. This requires the lib to be in front of libc in the LIBS
variable. The library currently will call libc 'stat' and 'fstat' by
looking up the symbols via 'dlsym'.

Ref genodelabs/goa#61
2023-08-23 13:46:37 +02:00
Christian Helmuth
da53a11508 pc_nic_drv: drop incoming packets on missing uplink
Fixes sporadic null-pointer dereferences like

  [init -> nic_drv] Error: illegal READ at address 0x204 by pager_object: pd='init -> nic_drv' thread='ep' ip=0x86467
2023-08-23 13:46:37 +02:00
Christian Helmuth
bd0c680ec8 pc_nic_drv: implement dst_release 2023-08-23 13:46:37 +02:00
Christian Prochaska
8a279855ff cleanup file permissions
Fixes #4983
2023-08-23 13:46:37 +02:00
Christian Prochaska
efae71dac7 acpica: fix download link
Fixes #4982
2023-08-23 13:46:37 +02:00
Christian Prochaska
7000fb8642 monitor: add more debugging features
Fixes #4977
2023-08-23 13:46:37 +02:00
Christian Prochaska
8b7f959451 hw: send exception signals and support single-stepping
Fixes #4975
2023-08-23 13:46:37 +02:00
Christian Prochaska
f3b03fa01b ports: add gdb_arm_64 variant
Fixes #4980
2023-08-21 08:12:02 +02:00
Christian Prochaska
7a6d9f8530 ports: install GDB with install-strip
Fixes #4979
2023-08-21 08:12:02 +02:00
Christian Helmuth
65d9607ece vbox6: force C/H/S disk geometry from calculation
Some Ubuntu installations (e.g., 20.04) create installation disks with
strange C/H/S MBR partitions like 3988/255/2. Normally, VirtualBox reads
the MBR to guess disk geometry information for the virtual BIOS.
Unfortuantely, the strange values from Ubuntu lead to a heavy
virtual-disk activity on boot. Therefore, this commit forces the use of
calculated values based on the assumption that large disks use LBA
addressing anyway.

Fixes #4978
2023-08-21 08:12:02 +02:00
Christian Prochaska
9e41848927 ports: GDB fixes
Fixes #4976
2023-08-21 08:12:02 +02:00
Christian Prochaska
48e6468df1 os: support UART drivers in board-specific repositories
Fixes #4973
2023-08-21 08:12:01 +02:00
Christian Prochaska
419e5e46f6 base: add more x86_64 exception type enums
Fixes #4972
2023-08-21 08:12:01 +02:00
Alexander Boettcher
c88e6bb81d gpu/intel: fix disable invocation in fw_disable
Erroneous enable was used
2023-08-21 08:12:01 +02:00
Martin Stein
c3c7a01df5 nic_router_uplinks.run: raise report-rom caps
Caused the test to fail on x86_64+pc+sel4.

Ref #4923
2023-08-21 08:12:01 +02:00
Martin Stein
280ca8982b os net tests: unify & document target restrictions
Ref #4966
2023-08-21 08:12:01 +02:00
Martin Stein
53018515a9 net_test-pc.sculpt: minimal setup for net tests
A small sculpt setup with routed and raw access to the PC NIC-driver as well
as a launcher for the ping app.

Ref #4966
2023-08-21 08:12:01 +02:00
Martin Stein
8bad3d08d7 util/formatted_output.h: hex-dump utility
Adds Genode::Hex_dump class to the formatted_output.h header. This class can be
used to print a hexadecimal dump of a byte range. The data is printed in a
format similar to that used by Linux's 'xxd'. In addition to the 'xxd' format,
consecutive duplicate lines are replaced with a single "*\n" as done also by
Linux's 'hexdump'.

Ref #4966
2023-08-21 08:12:01 +02:00
Martin Stein
9a94fbb1ec ping: align dhcp client more with nic_router again
The DHCP client implementations of Ping originally is a copy of the NIC router
implementation adapted for Ping. The two versions diverged further over the
years. This issue should be solved by should merging them into a centralized
implementation. However, this commit treats only a recent issue with the
nic_uplink.run test on pbxa9 qemu but does this by re-aligning the two
implementations partially. The final merge should be done in a separate commit.

Ref #4966
2023-08-21 08:12:01 +02:00
Martin Stein
d8c51656d7 depot_autopilot: forward tabs and color sequences
The Depot Autopilot used to filter out tabs and color sequences before
forwarding the test log to the own log. This commit prevents this and further
cleans up the string-filters code.

Ref #4922
2023-08-21 08:12:01 +02:00
Martin Stein
987dea5f7f depot_autiopilot: consider log_prefix attribute
The new 'log_prefix' attribute is effective when used in a tests runtime in
<succeed> or <fail> tags that have a non-empty content string. When matching
the log against the pattern given in the affected <succeed> or <fail> tag, the
Depot Autopilot will consider only those test-log lines that start with the
given prefix.

Ref #4922
2023-08-21 08:12:01 +02:00
Martin Stein
c47a6b0830 depot_autopilot: simplify success-criterion syntax
* Removes the <event> tag from all test package runtime files and replaces the
  contained <timeout> and <log> sub-tags with the new tags <succeed> and
  <fail>. If a <succeed> or <fail> tag has a content, it defines a log pattern
  that should be recognized and render the test failed or successful. If a
  <succeed> or <fail> tag has an attribute after_seconds that is not set to 0,
  it defines a timeout after which the test should be rendered failed or
  successful.

* Adapts the Depot Autopilot to support the new syntax in the test-package
  runtime files. However, for now, the Depot Autopilot is kept compatible to
  the old syntax as well. If the <events> tag is present, it is prioritized
  over the new syntax.

Fixes #4922
2023-08-21 08:12:01 +02:00
Martin Stein
b587134a8d net tests: raise nic_drv/drivers cap quota
Several nightly network-related tests fail currently on sel4/pc because the
new e1000 NIC driver requires more capabilities. The "drivers nic" package
was already adapted to the new requirement but some tests fail to provide
enough caps to the corresponding sub system. This commit tries to fix all
remaining tests.

Ref #4923
2023-08-21 08:12:01 +02:00
Stefan Kalkowski
4277bdd3cd lx_emul usb: solve session close races
* During a session-close, the device-specific usb task and driver data
  gets freed. Part of it was the RPC data. To prevent use-after-free
  turn it into a pointer and leave it on the stack of the caller thread
* During a device release, URBs discards, and reset operation the Linux task
  might get blocked, and then a RPC caller task might return if the RPC
  operation was marked as finished already, although it hasn't succeeded yet
* USB devio RESET has to be done before a device release to be effective

Fix genodelabs/genode#4969
2023-08-21 08:12:01 +02:00
Stefan Kalkowski
8f4903ca86 lx_emul usb: make reset ep effective
* Within flush_transfer of the USB session a given entrypoint gets
  resetted, to be effective al related URBs need to be discarded first
* Discarding URBs shall be done in reverse order, like libusb is doing it,
  where it warns about potential races otherwise

Ref genodelabs/genode#4969
2023-08-21 08:12:00 +02:00
Martin Stein
68fd016746 ping: src and pkg recipes
Ref #4966
2023-08-21 08:12:00 +02:00
Martin Stein
c23491ef3c nic_uplink: connect a Nic to an Uplink session
* Adds a new component server/nic_uplink that forwards packets unmodified
  between one Uplink session at one side and potentially multiple Nic sessions
  at the other side.
* Adds a new run script nic_uplink.run that does a basic test with multiple
  Nic clients on this component and adds it to the autopilot list.
* Adds a new depot recipe src/nic_uplink for this component.
* Adds a new depot recipe pkg/pc_nic for deploying the pc_nic_driver together
  with a nic_uplink server. This allows for raw access to the network connected
  to the Nic of the system in contrast to the commonly used routed and NAT'd
  access via NIC router. That said, it enables the use of network protocols
  not yet supported by the NIC router at the cost of less protection.

Ref #4966
2023-08-21 08:12:00 +02:00
Martin Stein
4c4962b306 nic_router: clean-up session creation with class
Introduces a new class that does the clean-up if some exception is
thrown while creating the session. This reduces redundancy and overall
lines of code.

Ref #4966
2023-08-21 08:11:37 +02:00
Norman Feske
7aa301361d depot: update recipe hashes 2023-07-14 12:06:32 +02:00
Alexander Boettcher
7c77a98118 cpu_balancer: make test reliable
by just test the migration feature, without relying on load measured on the
CPUs. On Qemu (and depending on other load in the Linux system), the migration
feature gets not triggered in time reliable.
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
ec60ad3a80 dde_linux: remove legacy_rpi_usb_host_drv
* Cleanup the dde_linux port

Fix genodelabs/genode#4965
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
175ec07c06 lx_emul: allow non-SMP kernel configurations
Fix genodelabs/genode#4963
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
2f6864a487 lx_emul: make ARM irqchip handler extendable
* Allow support for kernel configurations without CONFIG_IRQ_DOMAIN_HIERARCHY
* Export `irq_domain` instantiated for driver-specific extensions of the irqchip

Fix genodelabs/genode#4964
2023-07-14 12:06:32 +02:00
Martin Stein
f30c49c0c3 ping.run: raise drivers cap quota
Otherwise, at least on sel4+x86_64+qemu, the nic driver ends up in a resource
request.

Ref #4931
2023-07-14 12:06:32 +02:00
Martin Stein
ca1a94d74c base-hw imx epit-timer: improve code readability
Improves the readability of the implementation of the Timer::_duration method.

Ref #4959
2023-07-14 12:06:32 +02:00
Norman Feske
5ca6dd10f8 monitor: forward priority session argument
This change allows a monitored VBox instance to specify a distinct
(lower) priority to the VM session to ensure that the VMM is always
prioritized higher than the VCPUs. This is important because host
I/O at the VMM should always be able to preempt a busy guest.

Issue #4917
2023-07-14 12:06:32 +02:00
Norman Feske
4918035258 sandbox.h: supply Request::args to Local_service
This change allows a local service to interpret session arguments other
than the label.
2023-07-14 12:06:32 +02:00
Norman Feske
7ce734d886 tool/dts: accept 'label: &ref { };' syntax
The combination of a label with a node supplement was not yet covered by
the dts/parse tool so far.

Fixes #4962
2023-07-14 12:06:32 +02:00
Josef Söntgen
93d6d71a1d dde_bsd: add patch to limit internal buffer size
Decreasing the internal buffer size will implicitly limit the number
of blocks provisioned for recording and brings them in line with
the number of blocks used for playback (2).

Note that this patch also sets an upper-bound on the number of
samples in 'Audio_*::PERIOD'.
2023-07-14 12:06:32 +02:00
Alexander Boettcher
0f70cafb91 intel/display: handle all connectors disabled case
If all connectors are set to disabled by configuration, the connectors
stayed enabled since the new configuration reveals no preferred or minimal
resolution/mode. Instead, use the last set resolution in order to get to the
disabling code.
2023-07-14 12:06:32 +02:00
Josef Söntgen
d6da06913e tool/run/boot_dir/hw: fix iPXE boot 2023-07-14 12:06:32 +02:00
Martin Stein
647631af09 test/timeout: revert use of memory barriers
The memory barriers where introduced with commit "test-timeout: fix build
errors with -std=gnu++20" presumably in order to prevent GCC optimization from
removing the empty for loops the test is using because using a volatile index
variable was no longer an option.

However, the memory barriers seem to have a negative effect on the measurements
performed with the affected loops. The commit caused the timeout test to fail
at least on imx53_qsb.

This commit fixes the issue by using a simple empty for loop without volatiles
or memory barriers but protected inside a function that is compiled with
optimization disabled.

Ref #4959
2023-07-14 12:06:32 +02:00
Josef Söntgen
e18c02991e lx_kit: use central signal handler for scheduling
This commit extends the Lx_kit initialization function by passing in
a signal handler that is used to perform the normally occurring
scheduler execution and is a follow-up change for the decoupling
scheduler execution commit.

Instead of burying the signal handler in the 'Lx_kit::Scheduler'
object it is provided by the main object where the driver is free
to perform any additional step before or after executing the scheduler.

Issue #4927
Fixes #4952
2023-07-14 12:06:32 +02:00
Josef Söntgen
dd1b8a106f drivers/wifi: perform multi-staged construction
Since the wireless LAN driver is actually a 'Libc::Component' due to
its incorporation of the 'wpa_spplicant' application, we have to
intercept its construction because we have to initialize the Lx_kit
environment before any static ctors are executed. Most Linux initcalls
are implemented as ctors that will be otherwise implicitly executed
before the controll is given to us in 'Libc::Component::construct'.

Issue #4927.
2023-07-14 12:06:32 +02:00
Josef Söntgen
fc24ffcdb8 wifi: use mac address reporter
Remove the handcrafted MAC address reporter in favour the Genode
C API utility (cf. #4918).

Issue #4927
Issue #4918
2023-07-14 12:06:32 +02:00
Martin Stein
90ba794e8e base-hw imx epit-timer: fix duration calculation
The timer used to read the counter first and then the IRQ status. This
could cause a non-wrapped counter value to be considered a wrapped
counter value, leading to bogus timeout durations.

This commit fixes the bug and documents the used timer mode in the
driver in order to make future debugging of the driver easier.

Ref #4959
2023-07-14 12:06:32 +02:00
Martin Stein
9d98e8ac01 nic_dump.run: raise drivers cap quota
Fixes failing nightly test with x86_64 sel4.

Ref #4923
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
cccb763737 lx_emul usb: handle RPC calls after async-URBS
Prevent missing new RPC calls handed over to a Linux task
of a corresponding usb-device, while that task blocked
during enqueuing of asynchronous URBs.

Fixed genodelabs/genode#4955
2023-07-14 12:06:32 +02:00
Christian Helmuth
62a0605cf0 depot_autopilot: skip RAM-hungry tests on foc/pbxa9
foc (or maybe bootstrap) seems to cap RAM at 256 MiB while hw uses the
entire RAM configured at the Qemu command line.
2023-07-14 12:06:32 +02:00
Christian Helmuth
7ba00f3692 drivers_interactive: increase CAP quota of usb_drv 2023-07-14 12:06:32 +02:00
Martin Stein
f33ff21ab2 nic_router_flood.run: prios, init stage, clean-up
* add a sensible priority setup into the test script in order to protect
  drivers and stack components from the demanding net clients
* delay the starting of the net clients by 5 seconds in order to give the
  drivers and stack components some time to startup in peace
* use only explicit service routing and caps values

Ref #4923
2023-07-14 12:06:32 +02:00
Norman Feske
3af5a0ca4e monitor: intercept VM session
This is needed to translate the thread capability argument of
'Vm_session::create_vcpu'.

Issue #4917
2023-07-14 12:06:32 +02:00
Alexander Boettcher
38152d6c72 intel_display: use Expanding_reporter 2023-07-14 12:06:32 +02:00
Alexander Boettcher
5ffdda783b nova: remove timestamp from kernel binary
Fixes #4956
2023-07-14 12:06:32 +02:00
Christian Helmuth
fb1d66b254 Remove timestamp from image.elf.gz
Issue #4956
2023-07-14 12:06:32 +02:00
Martin Stein
2fb0bfdf85 drivers_nic-pc: raise nic drv cap quota
The reason for this was that run/nic_router_disable_arp was failing on
sel4+qemu+x86_64.

Ref #4923
2023-07-14 12:06:32 +02:00
Martin Stein
c05a0eca86 xml_unquoted: fix bug with string of length 0
Ref #4922
2023-07-14 12:06:32 +02:00
Norman Feske
852bc3fc62 base-linux: remove exceptions from region_map_mmap
This patch replaces the exception-based error propagation by the use of
'Attempt' return values, which eliminates side effects of the exception
handling - cxx_heap allocations - from code paths that are used by the
the cxx_heap itself (when growing the cxx_heap).

It thereby fixes the failure of the sub_rm test at the "attach RAM ds to
any position at sub rm - this should fail" step.

Fixes #4953
2023-07-14 12:06:32 +02:00
Norman Feske
75bfc37b18 sculpt: screensaver infrastructure
This patch enhances Sculpt with the ability to detect user inactivity
for driving a screensaver by combining nitpicker's hover and focus
reports with a timer.

Issue #4950
2023-07-14 12:06:32 +02:00
Norman Feske
8463f4910a nitpicker: improve activity reporting
Nitpicker's hover and focus reports contain an 'active' attribute, which
can be inspected for the detection of user activity, e.g., as trigger
for a screensaver or for dynamic clipboard policies.

When using the 'Event' session, the reporting code updated the reports
only on incoming events. This patch adds the periodic reporting as used
when using the old 'Input' session.

Issue #4950
2023-07-14 12:06:32 +02:00
Norman Feske
ba67b535f8 gems: remove leitzentrale.run
This run script is superseded by modular Sculpt, which is able to run on
base-linux.
2023-07-14 12:06:32 +02:00
Josef Söntgen
1cac134030 lx_kit: support multiple pending IRQs
Decoupling the scheduler execution can lead to missed interrupts
because the current implementation only handles one pending
interrupt and requires immediate processing.

This commit introduces a helper object that is used to capture
any occuring interrupts that are then handled consecutively.

Issue #4927.
2023-07-14 12:06:32 +02:00
Josef Söntgen
caac994da8 lx_kit: decouple schedule execution
Prior to this commit, whenever an external event occurred, for example
timer or interrupt, the corresponding I/O signal handler was triggered.
This handler unblocked the task waiting for the event and initiated the
immediate execution of all unblocked tasks. Since these tasks may hit
serialization points, e.g. synchronously waiting for packet stream
operations, that require handling of other I/O signals this leads to
nested execution. This, however, is not supported and mixes application
and I/O level signal handling.

The flagging of the scheduling intent is now decoupled from its
execution by using an application level signal handler that is run in
the context of the components main entrypoint. The I/O signal handler
now triggers the scheduling execution by sending a local signal to
the EP.

Since it might be necessary to execute a pending schedule from the EP
directly the scheduler is extended with the 'execute' member function
that performs the check that the scheduler is called from within the
EP and triggers the execution afterwards.

Issue #4927.
2023-07-14 12:06:32 +02:00
Alexander Boettcher
1f1fafb0cf intel_fb: disable encoders of disconnected ports
On disconnect of displays, e.g. seen with Type-C connectors, the encoder was
not properly disabled due to a missing drm_client_modeset_commit. In order that
the commit succeed, however a fb must be assigned to the modeset. Missing to
do so leads to an -EINVAL by the drm_client_modeset_commit.

Fixes #4948
2023-07-14 12:06:32 +02:00
Josef Söntgen
70c57a3be3 pci_decode: calculate 64bit BAR size
Issue #4949.
2023-07-14 12:06:32 +02:00
Christian Prochaska
02209e5455 monitor: add memory write support
Fixes #4947
2023-07-14 12:06:32 +02:00
Martin Stein
7b7851abfb vfs/tresor_trust_anchor: fix alignment faults
Fixes alignment faults that occured in the AES256 implementations while
wrapping or unwrapping keys on imx53_qsb, imx6q_sabrelite, and imx7d_sabre.
The problem was that the unwrap_key/wrap_key functions did reinterpret casts
from unsigned char pointers to uint64_t pointers and then directly used the 64
bit values of referenced by the latter. Most probably this caused the compiler
to optimize operations in the assumption that the pointer is 8-byte aligned
which then created alignment faults.

As a solution, this commit changes the interface of the wrap_key/unwrap_key
functions to take uint64 pointers as arguments instead of unsigned char
pointers and then adapts the function users to ensure that they refer to
appropriately aligned memory regions.

Fixed #4932
2023-07-14 12:06:32 +02:00
Christian Helmuth
6e7b66cb8a Finally move __dso_handle into genode.ld
Issue #4784
2023-07-14 12:06:32 +02:00
Christian Helmuth
18c00e58cc tool: remove sel4 x86_32/pc and imx7-sabre artifacts
Issue #4918
2023-07-14 12:06:32 +02:00
Christian Helmuth
c84bbea1ca base-foc: avoid global ctor in Irq_session_component
Issue #4784
Issue #3509
2023-07-14 12:06:32 +02:00
Christian Helmuth
f6dcc3ca74 genode.ld: preserve ctors/dtors sections for analysis
Issue #3509
2023-07-14 12:06:32 +02:00
Josef Söntgen
317c5429d2 dde_bsd: decrease overall memory consumption
The initial memory backend implementation was brought over from DDE
Linux and was geared towards use-cases where a high-performing
allocator is useful. In case of the audio driver this is overkill
and since no other driver that could benefit from such an
implementation was ported in the meantime rather use a simpler
implementation that keeps the overhead down.

Fixes #4946.
2023-07-14 12:06:31 +02:00
Josef Söntgen
ff0ba89e91 dde_bsd: update mixer state report on HP sense
Issue #4946.
2023-07-14 12:06:31 +02:00
Norman Feske
fa3f5edcc2 base: remove deinit_heartbeat_monitoring function
Issue #4940
2023-07-14 12:06:31 +02:00
Norman Feske
f9bb7246ef base: remove destroy_signal_thread function
With the removal of the 'Entrypoint::schedule_suspend' mechanism, this
function is no longer called.

Issue #4940
2023-07-14 12:06:31 +02:00
Norman Feske
4193279560 base: remove entrypoint.cc from core
Since component.cc is no longer linked to core, we can also remove
entrypoint.cc, which was merely a dependency of component.cc.

Related to issue #4784
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
13e0710d20 os: remove i.MX GPIO drivers
Ref genodelabs/genode#4945
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
3d5ec9ea3f dde_linux: remove legacy imx6 usb host driver
Ref genodelabs/genode#4942
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
5e7e6514be Remove i.MX6 platforms from base repositories
Fix genodelabs/genode#4941
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
edcd44d9a7 lx_emul: shadow ARM-specific asm/uaccess.h file
Fix genodelabs/genode#4939
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
b15fd68b60 lx_emul: shadow the ARM-specific asm/domain.h file
Fix genodelabs/genode#4938
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
720d2847b6 lx_emul: correct the return value of clk_get
Fix genodelabs/genode#4937
2023-07-14 12:06:31 +02:00
Christian Helmuth
7563cf5c55 Remove blank lines between template<> and struct
The blank line disconnects the struct from its template definition,
which makes the whole definition harder to comprehend.
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
15b30f3547 sculpt_image: add MNT Reform2 as target board
Fix genodelabs/genode#4936
2023-07-14 12:06:31 +02:00
Christian Prochaska
2dd1365af3 monitor: separate 'monitor_gdb' run scripts
Fixes #4944
2023-07-14 12:06:31 +02:00
Christian Prochaska
5a2d4c3437 monitor: apply 'wx' policy
Fixes #4943
2023-07-14 12:06:31 +02:00
Norman Feske
6e03d731a2 base-linux: avoid global ctor in wait_for_exit
This patch replaces the global '_wait_for_exit_sem' object by a local
static variable, which does not rely on the global ctors. It thereby
fixes the fault_detection test after the removal of the global ctors
execution from core ("base: remove component.cc from core").

Issue #4784
2023-07-14 12:06:31 +02:00
Christian Helmuth
1a7ff195d9 pc_linux: enable EFI and EFI_STUB
With these options enabled comparative testing between pc_linux drivers
and bzImages becomes much easier on EFI-only machines. The impact on the
actual Genode drivers is minimal.
2023-07-14 12:06:31 +02:00
Christian Helmuth
e2ddcee440 lx_emul: prevent warning about unsused static func 2023-07-14 12:06:31 +02:00
Norman Feske
1139492c4f base: remove Entrypoint::schedule_suspend
Fixes #4940
2023-07-14 12:06:31 +02:00
Norman Feske
1fd1786122 test/lx_hybrid: don't call glibc exit
This patch removes the use of the Entrypoint::schedule_suspend mechanism
and the call of glibc's exit from the lx_hybrid tests, for two reasons.

First, the interplay of atexit handlers executed by the glibc and
Genode's lx_hybrid library is complicated while bringing no benefits in
practice as lx_hybrid applications are usually servers that don't exit
anyway.

Second, the Entrypoint::schedule_suspend mechanism in not used by any
other component. By removing its use from the lx_hybrid tests, we can
remove this mechanism from the base library.

Issue #4940
2023-07-14 12:06:31 +02:00
Norman Feske
e2836bf68a ldso: remove deprecated support for legacy 'main'
Besides the removal of the legacy 'main' support, this patch simplifies
the lib/startup/_main.cc.

Issue #2199
2023-07-14 12:06:31 +02:00
Josef Söntgen
1d82a049bf nvme: address conversion warnings
This commit removes the CC_CXX_WARN_STRICT_CONVERSION suppressor
and address the resulting warnings.

Fixes #4935.
2023-07-14 12:06:31 +02:00
Norman Feske
7e1a2ac684 base: remove internal use of 'env_deprecated'
Fixes #4784
2023-07-14 12:06:31 +02:00
Norman Feske
de99945af0 base: pass 'Platform &' to 'bootstrap_component'
This eliminates the need of component.cc to pull the platform resources
out of thin air (calling 'env_deprecated()').

Issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
415d4ab23d startup: merge init_main_thread.cc into _main.cc
This makes the interplay of 'init_main_thread', 'init_platform',
'_main', and 'bootstrap_component' easier to follow.

Issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
7093258649 base: move 'prepare_init_main_thread' to Genode::
Issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
3f9698a292 base: remove component.cc from core
Issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
3a8c3dcc2d base: unify platform.cc between base, base-linux
This is a preparatory step for merging 'init_platform()' with
'bootstrap_component()'.

Issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
54cc70f9b1 base: remove Env arg from init_exception_handling
By supplying only the parts of the Env that are actually relevant for
initializing the cxx heap, we avoid the need for the 'Env' interface.
The patch also moves the call of 'init_ldso_phdr' to the outside
of the cxx library because it does not belong there.

Issue #4784
2023-07-14 12:06:31 +02:00
Christian Prochaska
59ce64b638 monitor: handle Monitored_thread case in kill_thread()
Fixes #4934
2023-07-14 12:06:31 +02:00
Christian Prochaska
8264b63e0b core: replenish UTCB quota in exception case
Fixes #4933
2023-07-14 12:06:31 +02:00
Christian Helmuth
ea294fff0c lx_emul: fix unplug of unclaimed USB devices
USB devices that are never associated to client sessions lack
usb_per_dev_data (and a kernel thread). Therefore, the devices should be
discontinued directly on unplug as no URBs can be pending.

Issue genodelabs/genode#4795
2023-07-14 12:06:31 +02:00
Josef Söntgen
afaabb3121 pc_nic_drv: add R8169 driver
This commits enables the R8169 driver and was tested with two
RTL8168h/8111h (10ec:8168 rev 0x15 sub 1462:7a38 / 1d05:109f) and
two equal RTL8125B (10ec:8125 rev 0x5 sub 1458:e000) devices
running Sculpt.

Firmware loading is for now not implemented but specific Linux
commits suggest it could be necessary. However, doing so will be
post-poned until we have gathered more experience with the driver.

Restarting the driver might lead to the following IOMMU error
messages but the device seems to work anyway:

[ 0] IOMMU:0xffffffff817ec040 FR:0x8a00000000002500 FI:0xfffffffdf8d30000 type:0x8 BDF:25:00.0
[ 0] IOMMU:0xffffffff817ec040 FR:0x2000004200002500 FI:0x000c21b0 type:0x2 BDF:25:00.0
[ 0] IOMMU:0xffffffff817ec040 FR:0x2020004200002500 FI:0x000c21a0 type:0x2 BDF:25:00.0
[ 0] IOMMU:0xffffffff817ec040 FR:0x2020004200002500 FI:0x00138000 type:0x2 BDF:25:00.0
[…]
[ 0] IOMMU:0xffffffff817ec040 FR:0x8a00000000002500 FI:0xfffffffdf8d30000 type:0x8 BDF:25:00.0
[ 0] IOMMU:0xffffffff817ec040 FR:0x2020004300002500 FI:0x00124000 type:0x2 BDF:25:00.0

Issue #4921.
2023-07-14 12:06:31 +02:00
Josef Söntgen
1996041dcc pc_linux: update initcall order for pc_nic_drv
Issue #4921.
2023-07-14 12:06:31 +02:00
Josef Söntgen
18c23ddb0c pc_linux: enable R8169
Issue #4921.
2023-07-14 12:06:31 +02:00
Christian Helmuth
2232b33b8e pci_decode: limit bus parsing to subordinate buses
While this approach still scans "holes" in the bus range, it stops
scanning at the maximum subordinate bus number reachable from the base
PCI bus at the host bridge. Startup under Qemu no longer takes about 12
seconds for scanning 256 buses.
2023-07-14 12:06:31 +02:00
Norman Feske
0ab69a2bb8 base: de-duplicate src/lib/base/platform.cc
By splitting the 'init_capability_slab()' implementation to a separate
compilation unit 'capability_slab.cc', base-hw no longer needs a
customized version of 'lib/base/platform.cc'.

Related to issue #4784
2023-07-14 12:06:31 +02:00
Norman Feske
6e30d00eef base: remove env_deprecated from signalling code
Issue #4784
2023-07-14 12:06:31 +02:00
Christian Helmuth
ee564125df Replace ipxe_nic_drv by pc_nic_drv in run scripts
Issue #4921
2023-07-14 12:06:31 +02:00
Christian Helmuth
8ecbc48211 sculpt: replace ipxe_nic_drv by pc_nic_drv
Issue #4921
2023-07-14 12:06:31 +02:00
Christian Helmuth
48cc8fb657 drivers_nic-pc: replace ipxe_nic_drv by pc_nic_drv
Also, the configuration enables MAC-address reporting and includes a
verbose mac_report_rom.

Issue #4921
2023-07-14 12:06:27 +02:00
Christian Helmuth
d258422c34 pc_nic_drv: ethernet NIC driver based on Linux 6.1
Fixes #4921
2023-07-14 12:05:54 +02:00
Christian Helmuth
8de0d8d4e0 pc_linux: update initcall order for pc_nic_drv
Issue #4921
2023-07-14 12:01:19 +02:00
Christian Helmuth
36c1dc16d4 pc_linux: enable e1000, e1000e, pcnet32
Issue #4921
2023-07-14 12:01:19 +02:00
Norman Feske
3489672bc0 base: remove env_deprecated from thread-start code
This patch replaces the internal use 'env_deprecated()' from the
implementation of the thread API in the base library. It also
replaces the global accessor 'main_thread_cap' by the explicit
propagation of the main-thread's capability to the single point of
use via a new 'init_thread_bootstap' function.

Issue #4784
2023-07-14 12:01:19 +02:00
Josef Söntgen
adf0b893e8 lx_kit: add random dummy back end
This back end can be used in place of the existing jitterentropy based
on in case random is not strictly needed by the component but one
wants to use the available 'shadow/drivers/char/random.c'
implementation.

Issue genodelabs/genode-allwinner#21.
2023-07-14 12:01:19 +02:00
Alice Domage
943c9809ed depot_remove.run: replace x86_64 by [depot_spec]
This change makes the run script compatible with all CPU architectures.

Issue genodelabs#4866
2023-07-14 12:01:19 +02:00
Josef Söntgen
c888fcbdd9 lx_emul: implement __get_random_u32_below
The implementation was already part of the Zynq's sd_card driver and
since other ARM drivers need it as well, promote it to the common
shadow library.

Issue genodelabs/genode-allwinner#21.
2023-07-14 12:01:19 +02:00
Josef Söntgen
7109b80bbd dde_linux: enable -gnu11
The option is default since 5.18 and several compilation units
require it.

Issue genodelabs/genode-allwinner#21.
2023-07-14 12:01:19 +02:00
Stefan Kalkowski
098bc66fc9 usb genode_c_api: reduce config report updates
Prevent unnecessarty config report updates, if a new USB device gets reported.

Fix genodelabs/genode#4929
2023-07-14 12:01:19 +02:00
Christian Helmuth
0a28df8805 lx_emul: skb_init() in lx_emul_init_task_function()
Issue #4921
2023-07-14 12:01:19 +02:00
Martin Stein
abe163c335 tresor: do not use on-disc-layouted structs
* Removes all previous structs that represented an on-disc block layout
  and were therfore subject to a number of layout restrictions (packed,
  padding members, enum representations, etc.).
* Adds a replacement struct without any layout restrictions for each of the
  removed structs. The new structs are named similar to the old structs.
* Adds block encoding and decoding utilities for easily converting from the
  new structs to on-disc blocks and vice-versa (Block_scanner, Block_generator,
  T::decode_to_blk, T::encode_from_blk)
* Adapts all affected places in the library to encode and decode proberly
  instead of simply casting pointers.
* Thereby cleans up the hashing utilities to use typed-reference args instead
  of void pointers.
* Re-enables run/tresor_tester and test-file_vault_vonfig_report for platforms
  rpi, imx53_qsb, imx53_qsb_tz, imx6q_sabrelite, imx7d_sabre.

Ref #4819
2023-07-14 12:01:19 +02:00
Martin Stein
434a4db637 lib/net: no color coding in packet print methods 2023-07-14 12:01:18 +02:00
Martin Stein
bf18ffbbdd lib/net: enable strict warnings
Enables strict warnings in the net lib and fixes all related compile errors.

Fixes #4924
2023-07-14 12:01:18 +02:00
Martin Stein
c907e44a02 register framework: read bitfields to fitting uint
* Replaces bool access types with uint8_t access types
* Ensures, that the framework always uses the smalles possible uint type
  for the return value wherever a bitfield is read and returned to the user.

Ref #4924
2023-07-14 12:01:18 +02:00
Norman Feske
79e262921e depot: update recipe hashes 2023-06-16 11:24:26 +02:00
Timo Nicolai
0a81bd5d5a depot_download_manager: fix verifying failed download
In some instances, the fetchurl progress determined by
depot_download_manager will be empty when the download fails (e.g. due
to a 404), this commit fixes a bug where this would be interpreted as
the download having completed which would subsequently start hash
verification of a package that has never actually been downloaded.

Fixes #4919
2023-06-16 11:24:26 +02:00
Christian Helmuth
c09b4ba46b depot: recipe for acpi_event 2023-06-16 11:24:26 +02:00
Johannes Schlatow
6e607349e1 depot: add black_hole and fonts_fs to pkg/goa
Goa now makes use of the black-hole component and has been enabled to provide
a fonts_fs.

genodelabs/genode#4928
genodelabs/goa#42
2023-06-16 11:24:26 +02:00
Alice Domage
fb0e8fffa2 New depot_remove component
The depot_remove component can delete PKG archives with
automatically resolving dependencies and deleting archives that are not
required on the system anymore.

Issue genodelabs#4866
2023-06-16 11:24:26 +02:00
Martin Stein
40338f9acb ping*.run: raise test timeout
On some platforms (x86_32/pistachio, x86_64/sel4) system startup is slow
and the previously configured 30 seconds not sufficient. With this commit, the
timeout is raised to 60 seconds only when running on such a platform.

Ref #4923
2023-06-16 11:24:26 +02:00
Martin Stein
21d4b8aba0 nic_router_disable_arp.run: raise test timeout
The previous, rather small timeout of 30 seconds caused problems on
x86_64/sel4.

Ref #4923
2023-06-16 11:24:26 +02:00
Martin Stein
62db70e2ea nic_router_dhcp: raise test timeout
It seems that the previous rather small timeout of 35 seconds caused problems
with our nightly tests on fiasco/x86_32.

Fixes #4923
2023-06-16 11:24:26 +02:00
Martin Stein
563f55e57b nic_dump.run: relax test procedure
This test was originally a copy of ping.run and therefore unnecessarily
inherited all its complexity for testing ping component behavior. Additionally,
ping.run was more actively maintained and evolved over time whereas
nic_dump.run didn't receive the same care. Now, the test fails on certain
platforms although NIC dump works just fine. Therefore, this commit reduces the
test behavior to what is really necessary for testing nic_dump and by doing so,
also fixes the failing targets.

Fixes #4926
2023-06-16 11:24:26 +02:00
Martin Stein
45e5a33b26 sd_card.run: fix broken config and automate
Fixes #4925
2023-06-16 11:24:26 +02:00
Martin Stein
cc99646b23 nic_router_flood.run: adjust success condition
On x86_32 okl4, the test timed out although the test timeout was already at
240 seconds for this platform. Instaed of raising it further, this commit
reduces the number of ping rounds for all platforms that are considered as
slower by the test.

Ref #4923
2023-06-16 11:24:26 +02:00
Norman Feske
e8ee2cc227 tool_chain_auto.run: incr. stack size for x86_32 2023-06-16 11:24:26 +02:00
Norman Feske
f789c8152c stdcxx: add missing symbol
Needed for building noux_pkg/gcc_x86 for x86_32 when using the
compiler's default optimization level (not Genode's default CC_OLEVEL).
2023-06-16 11:24:26 +02:00
Norman Feske
70cf9fe3dd doc/news.txt: grammar fix 2023-06-16 11:24:26 +02:00
Christian Helmuth
98cbfa3561 genode_c_api: MAC address reporter utility
Issue #4918
2023-06-16 11:24:26 +02:00
Christian Helmuth
29b441c6fa net: const Network_address source buffer
Issue #4918
2023-06-16 11:24:26 +02:00
Norman Feske
a27e46989f tool_chain_auto.run: use [build_artifacts]
The run script used to miss a few build targets for boot modules
specified at the 'build_boot_image' step.
2023-06-16 11:24:26 +02:00
Norman Feske
57b66987dd mk/gnu_build.mk: declare .tar as BUILD_ARTIFACTS
This way, run scripts using GNU build targets can use the result of
[build_artifact] for the 'build_boot_image' step.
2023-06-16 11:24:26 +02:00
Sebastian Sumpf
d7440a8b1c tool/ports/current: use silent option for GNU Make 4.4
If this file is called from a Makefile via

! $(shell <path>/tool/ports/current qt5-host)

'shell' will return

"Entering directory '' <path-to-libc> Leaving directory '' Stop.",

and thus, producing multiple targets in the 'tool_chain_qt5' case.

issue #4725
2023-06-16 11:24:26 +02:00
Norman Feske
3c5d27506f base: stricter distinction between rx and rwx
This patch restricts 'Region_map::attach_executable' to create read-only
mappings, while offering the option to map the full rights using a new
'attach_rwx' method.

The 'attach_rwx' method is now used by the dynamic linker to explicitly
attach the linker area with full rwx rights. With the old page-fault
handling code, the execute flag was evaluated only for leaf dataspaces,
not for managed dataspaces while traversing region-map hierarchies.
With the new page-fault handling code, the execute bit is downgraded
to no-execute when passing a managed dataspace that is not attached
as executable.

Issue #4920
2023-06-16 11:24:26 +02:00
Norman Feske
a4c59c03e3 core: rework page-fault resolution
The change "core: allow offset-attached managed dataspaces" addressed a
corner case of the use of nested region maps. Apparently, this change
negatively affects other scenarios (tool_chain_auto).

In order to confidently cover all the differnt situations, this patch
reworks the page-fault resolution code for improved clarity and safety,
by introducing dedicated result types, reducing the use of basic types,
choosing expressive names, and fostering constness.

It also introduces a number of 'print' hooks that greatly ease manual
instrumentation and streamlines the error messages printed by core.
Those messages no longer appear when a user-level page-fault handler
is reistered for the faulted-at region map. So the monitor component
produces less noise on the attempt to dump non-existing memory.

Issue #4917
Fixes #4920
2023-06-16 11:24:26 +02:00
Norman Feske
65d3b3a32f base-linux: build fix for BOARD=pc
This is a follow-up commit to "base: remove internal use of format
strings".

Issue #2064
2023-06-16 11:24:26 +02:00
Norman Feske
47fa54992f run/libc_vfs_filesystem_test: adjust caps for sel4
Fixes libc_vfs_fs_ext2 and libc_vfs_fs_fat on x86_64/qemu/sel4.
2023-06-16 11:24:26 +02:00
Norman Feske
6af42c9fb5 test-sanitizer: simplify, increase caps for sel4 2023-06-16 11:24:26 +02:00
Christian Helmuth
54a549d808 lx_emul: move arch_atomic64_add_return to dde_linux 2023-06-16 11:24:26 +02:00
Norman Feske
6a57683e52 New debug monitor
The new monitor component at os/src/monitor is the designated successor
of the gdb_monitor. This initial version, however, implements only the
subset needed to inspect the memory of the monitored component(s).

In contrast to the gdb_monitor, the new component supports the monitoring
of multiple components, leveraging the sandbox API. It can therefore be
used as a drop-in replacement for the init component. Like the gdb_monitor,
the new monitor speaks the GDB protocol over Genode's terminal session.
But the protocol implementation does not re-use any gdbserver code,
sidestepping the complexities of POSIX.

There exist two run scripts illustrating the new component. The
os/run/monitor.run script exercises memory inspection via the 'm' command
by letting a test program monitor itself. The os/run/monitor_gdb.run
script allows for the interactive use of GDB to interact with monitored
components.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
65f65073e6 sandbox: allow supplemental config nodes
Let the sandbox library disregard all unknown config sub nodes so that
supplemental information - like the monitor policy configuration - is
not interpreted as a misconfiguration ("unknown config element type ...").

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
add6dbac4e sandbox: add Pd_intrinsics::start_initial_thread
This hook allows for intercepting the creation of initial threads
whenever a new child is started.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
0d5571a820 base: close PD session last when destructing child
This patch moves the destruction of the child's PD session after the
closing of all other sessions because the PD session's role as resource
container might still be needed for orderly reverting the session quotas
when closing the other remaining sessions.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
734fc252e8 base: add Child_policy::start_initial_thread
The added interface allows for the local interception of
'Cpu_thread::start' RPC calls.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
f2153f9b2f sandbox: allow for customized PD access
By default, the sandbox uses the Env::pd() as reference PD session of
the sandbox children.

However, to accomodate use cases where the interplay of the reference
PD session and the child's address space needs to be intercepted, this
patch adds a constructor that takes an interface for the controlled
access of PD intrinsics as argument.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
30b70da6c1 base/child.h: Child_policy::with_address_space
This patch replaces the former 'address_space' accessor by a new
'with_address_space' interface that grants access to the region map of
the child's address space, but limits the interface lifetime to the
scope of the caller.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
f47c64e246 core: allow offset-attached managed dataspaces
This patch adds the missing application of the region offset to the
resolution of page faults inside managed dataspaces, which resulted in
an unexpected "invalid mapping" message after attaching a managed
dataspace with an offset.

This limitation could be observed during the implementation of the debug
monitor that locally maps a portion of the debugging target's address
space, e.g., a view port of 16 MiB. All traditional uses of managed
dataspaces (e.g., stack area, linker area) happened to attach the
managed dataspaces from their beginning.

Issue #4917
2023-06-16 11:24:26 +02:00
Sebastian Sumpf
3e0e86f720 mesa: remove 'printf' from 'iris_bufmgr_tmp.patch'
also rename it to 'iris_bufmgr_fd.patch'

issue #4916
2023-06-16 11:24:26 +02:00
Sebastian Sumpf
e3c2fdf414 gpu/intel: enable GPU reset for GEN(8)/9/12
* add semaphore command to ring in order to be able to stop ring
  execution before reset (Wa KabyLake)
* implement reset sequence as done by the Linux driver
* reset ring and cancel job of vgpu causing hang
* lower watchdog timeout 1000ms -> 200ms
* improve scheduling of vgpus so progress after reset is made
* improve the generation chaos a little
* tested on Skylake, Kaby Lake, Tiger Lake

issue #4916
2023-06-16 11:24:26 +02:00
Alexander Boettcher
b599f4e106 sel4: stop thread on alignment fault
by not replying to the IPC. Otherwise, endless alignment faults are triggered,
seen on imx6q Sabrelite and usb_hid_raw.
2023-06-16 11:24:26 +02:00
Alexander Boettcher
530ec3115f sel4/x86: remove Nehalem kernel config adjustment
since the used Genode Qemu model now supports it.
2023-06-16 11:24:26 +02:00
Martin Stein
dea53f635f Refine tresor tests
* Use jitterentropy only if supported.
  On certain targets like pbxa9 or zynq_qemu, the performance counter always
  yields 0, which renders jitterentropy unusable. On these platforms, the
  Tresor tests now use a static value as entropy source instead.

* Adds a new package test-file_vault_config_report_no_entropy that is used by
  the Depot Autopilot on targets without jitterentropy support instead of
  test-file_vault_config_report. The only difference between the two packages
  is the value of the above described new config attribute of the File Vault.

* Circumvent alignment fault.
  The Tresor lib for now has the deficiency of using on-disc data structures
  directly in code instead of decoding them first to unpacked, naturally
  aligned structures. This causes problems with memory-access alignment on
  several platforms (rpi, imx6q_sabrelite, imx53_qsb, imx7d_sabre). As fixing
  this properly is a bit of work, the commit disables the tresor_tester and
  file_vault_config_report test on the affected platforms in autopilot mode for
  now.

* Further adjustments
  * Make benchmarks optional
  * Use a smaller tresor for rekeying
  * Clean up image parameters
  * No use implicit routes/resources
  * Reduce ram consumption
  * Reduce test timeout
  * Raise cap quota, required for sel4 x86_64.

Ref #4819
2023-06-16 11:24:26 +02:00
Martin Stein
5800ab4961 vfs/tresor_trust_anchor: remove debug mode
The debug mode turned out to be unnecessry because the plugin can be simply
replaced with an <inline> file VFS plugin that has a content size of 32 bytes.

Ref #4819
2023-06-16 11:24:26 +02:00
Martin Stein
03d7258d33 tresor: better handling of hash mismatches
Instead of throwing an uncaught exception, the corresponding request is marked
failed.

Ref #4819
2023-06-16 11:24:26 +02:00
Martin Stein
7c5c92351e file_vault: compatibility with 21.05 containers
* Fix minimum passphrase size to be the same as with File Vault 21.05.
* Adapt to different image name of File Vault 21.05.

Ref #4819
2023-06-16 11:24:25 +02:00
Martin Stein
80b729703b file_vault_config_report tests: fix for pistachio
* relaxes the timing and reduces the test steps because pistachio is quite
  slow and would otherwise trigger problems with our easy approach of using a
  dynamic rom instead of a proper manager

* provide IO_PORT and IRQ session to timer driver

Ref #4819
2023-06-16 11:24:25 +02:00
Josef Söntgen
194af03fe9 autopilot.list: replace cbe with tresor tester
Issue #4819.
2023-06-16 11:24:25 +02:00
Martin Stein
c40205e93f pkg/test-file_vault_config_report: minor style fix
Ref #4819
2023-06-16 11:24:25 +02:00
Martin Stein
d9dd518a20 pkg/file_vault: fix missing fs route
The File System route for the Tresor Init sub-component was somehow missing.

Ref #4819
2023-06-16 11:24:25 +02:00
Alexander Boettcher
ceaa02230e qemu: set default cpu model for x86_64 explicitly
With the update to sel4 and the gcc 12, assembly instructions are generated
and used, like POPCNT. The instruction is available on our native hardware,
but not emulated by the default cpu model necessarily, which leads to
undefined opcode exceptions (Qemu 4.2.1 && seL4). Additionally, the features
of the default Qemu cpu model may vary between Qemu releases and makes it
harder to correlate effects.
2023-06-16 11:24:25 +02:00
Martin Stein
e0dc544aa5 tool: add qemu run opts for zynq_qemu
Ref #4819
2023-06-16 11:24:25 +02:00
Christian Helmuth
6cb697e6d8 base: remove ancient artifact of config library
The config library was removed in issue #2431 in 2017.
2023-06-16 11:24:25 +02:00
Norman Feske
250c16ddcf os/path.h: fix misleading comments
Issue #4708
2023-06-16 11:24:25 +02:00
Christian Helmuth
4a15621dc8 libc: warn about unsupported RTLD_GLOBAL in dlopen()
Fixes #3779
2023-06-16 11:24:25 +02:00
Christian Helmuth
7441548458 Configure ld soname also for lib.so files
Fixes #4914
2023-06-16 11:24:25 +02:00
Alexander Boettcher
11764ed755 core: remove io_mem attachments before destruction
The attachment removal is triggered actually on _ds member destruction time,
but after the io_mem representation for the specific base-<platform> possibly
vanished already during _unmap_local in the ~Io_mem_dataspace. This creates
on base-sel4 several kernel warnings about invalid capabilities.

Issue #4913
2023-06-16 11:24:25 +02:00
Alexander Boettcher
b349dd9c0a sel4: convert io memory on demand
instead all during boot. On x86 and qemu this takes quite a while until
the system is booted.

Fixes #4913
2023-06-16 11:24:25 +02:00
Stefan Kalkowski
97bf616b5b lx_emul: fix rcu_needs_cpu() for older kernels
Resolves observed regression for the older usb host drivers (< linux
version 5.18).

Ref genodelabs/genode#4798
2023-06-16 11:24:25 +02:00
Norman Feske
6f4242f03b sculpt: version 23.06
Increase version due to upcoming binary incompatibility with 23.04.
2023-06-16 11:23:57 +02:00
Christian Helmuth
716579b12f version: 23.05 2023-05-31 12:09:19 +02:00
Norman Feske
df25d23eb9 News item for version 23.05 2023-05-31 12:09:19 +02:00
Norman Feske
66c3463749 Release notes for version 23.05 2023-05-31 11:10:25 +02:00
Christian Helmuth
dfc1b97fa2 depot: update recipe hashes 2023-05-31 09:42:19 +02:00
Christian Helmuth
d6f65901f9 Add trace policy binary to BUILD_ARTIFACTS 2023-05-30 17:00:01 +02:00
Stefan Kalkowski
5253d4ddd7 platform_drv: dissolve shared irq session
Fix genodelabs/genode#4912
2023-05-30 16:32:22 +02:00
Sebastian Sumpf
2dbf3322d8 dde_rump: fix rump recipe for RISC-V
issue #4800
2023-05-30 16:01:03 +02:00
Martin Stein
798e3ee306 file_vault: fix deinit fs in tresor vfs
Ref #4819
2023-05-30 12:26:01 +02:00
Christian Helmuth
583f2d6a36 depot: update recipe hashes 2023-05-30 12:13:34 +02:00
Christian Helmuth
c1104ccbc7 depot_autopilot: skip file_vault on riscv and rpi
Issue #4819
2023-05-30 12:13:34 +02:00
Benjamin Lamowski
e882ca748d base-hw: virt: implement support for SVM
Ref #4826
2023-05-30 12:13:34 +02:00
Benjamin Lamowski
b277b84e19 base: extend Vcpu_state for base-hw x86 virtualization
Changes are preliminary and will most certainly be removed when fully
enabling the virtualization feature on base-hw.

Ref #4826
2023-05-30 12:13:34 +02:00
Benjamin Lamowski
1e3836f8b5 base-hw: pass generic Vm_data structure to the kernel object
This enables passing additional data structures to the kernel on x86.

Ref #4826
2023-05-30 12:13:34 +02:00
Benjamin Lamowski
312b638220 base-hw: export Intel TSC platform information
Export TSC invariant and the frequency reported on Intel processors.
Currently lacks TSC calibration and reports a fixed frequency on AMD.

Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
c75b07e0fd base-hw: SVM: allow execute on NPT mappings
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
cb69c59fa3 base-hw: implement VMCB data structure for AMD SVM
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
fa6e819f9a base-hw: x86: use Vcpu_state as Vm_state
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
0a819d5e19 base-hw: add MSR and CPUID registers for AMD SVM
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
e11ed069bf base-hw: fix x86 CPUID register width
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
7477f99d05 base-hw: x86: detect CPU Vendor and SVM support
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
6ca7119267 base-hw: copy virtualization structure for x86_64
Ref #4826
2023-05-30 12:13:33 +02:00
Norman Feske
256a989550 base-nova: update include guard 2023-05-30 12:13:33 +02:00
Norman Feske
34c7085ada sculpt.run: whitespace 2023-05-30 12:13:33 +02:00
Stefan Kalkowski
30e0452faf sculpt: increase sculpt_manager's cap quota
Fix genodelabs/genode#4911
2023-05-30 12:13:33 +02:00
Stefan Kalkowski
435c9719a7 sculpt: support for wifi on MNT Reform 2
Fix genodelabs/genode#4908
2023-05-30 12:13:33 +02:00
Alexander Boettcher
d92bd3afee sel4: update to 12.1.0 release
Fixes #4910
2023-05-30 12:13:33 +02:00
Alexander Boettcher
7351aa1670 sel4: remove x86_32/pc and imx7-sabre
The imx7 is not supported officially [0] anymore and the 32bit pc version is
not used nor intended to be used.

https://github.com/seL4/seL4/issues/254

Issue #4910
2023-05-30 12:03:34 +02:00
Christian Helmuth
22bee79534 port/metadata: improve info for multi-source ports
Now, ./tool/ports/metadata dde_linux produces the following output.

  PORT:     dde_linux
  LICENSE:  GPLv2
  VERSION:  individual (see sources)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.3.tar.xz VERSION 4.4.3 (lxip)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (fec)
  SOURCE:   https://github.com/cproc/dwc_otg.git git r5 (dwc_otg_host)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_host)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_hid)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_modem)
  SOURCE:   https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz VERSION 4.16.3 (usb_net)

Issue #4685
2023-05-30 12:03:34 +02:00
Christian Helmuth
5a97297282 fiasco: gather patch files with sort + wildcard
Using $(shell find $(REP_DIR)/patches -name *.patch) fails if the
current working directory contains *.patch files due to shell wildcard
expansion before execution. Additionally, the patch list was unstable
because it was not sorted resulting in divergent hashes.
2023-05-30 12:03:33 +02:00
Benjamin Lamowski
80c8775d77 base: make Entrypoint available in Vcpu_handler_base
Fixes #4906
2023-05-30 12:03:33 +02:00
Stefan Kalkowski
1c790b2776 lx_emul: use alternative initcall for pci on ARM
On platforms different than x86 the subsys initcall `pci_subsys_init`
is not available. Therefore, we choose an alternative one here.

Fix genodelabs/genode#4907
2023-05-30 12:03:33 +02:00
Stefan Kalkowski
0aef0959d5 hw: catch all cache lines for mis-aligned addresses
Fix genodelabs/genode#4905
2023-05-30 12:03:33 +02:00
Christian Helmuth
6b2338257d Let linker assume stacks are non-executable
In our binaries, the .note.GNU-stack section is missing, which is okay
as we do not interpret these sections anyway and map stack pages
non-executable per default.

Issue #4827
2023-05-30 12:03:33 +02:00
Norman Feske
823349fffb libc: make libc-plugin headers private to libc
Fixes #4904
2023-05-30 12:03:33 +02:00
Norman Feske
e1e26c4439 libports: update doc/libc.txt 2023-05-30 12:03:33 +02:00
Christian Prochaska
b1be660c7b libusb: remove use of obsolete libc-plugin interface
Fixes #4854
2023-05-30 12:03:33 +02:00
Martin Stein
8992dadb15 libports: remove unused libsparkcrypto
The main user of libsparkcrypto in the past was the CBE block encryption
ecosystem. However, the CBE was replaced with the Tresor block encryption that
uses libcrypto instead.

Ref #4819
2023-05-30 12:03:33 +02:00
Josef Söntgen
497c8b0922 wifi: provide WPA3-personal support
This commit introduces preliminary support for joining networks secured
via WPA3-personal. So far it was only tested with the one OpenWRT AP
configured for WPA3 (see excerpt below) where it WPA3-only as well as
WPA2/WPA3 mixed worked fine.

Scan results excerpt:

00:11:22:33:44:55    5180    -45     [WPA2-SAE-CCMP][SAE-H2E][ESS][UTF-8]    PewPew
00:11:22:33:44:55    2412    -67     [WPA2-PSK+SAE+PSK-SHA256-CCMP][SAE-H2E][ESS][UTF-8]     PewPew2

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
cfd3be675f pc_wifi: enable RTL8192CE support in rtlwifi
Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
dc178e0ab2 dde_linux: enhance KBUILD_MODNAME generation
It turns out solely relying on the name of the compilation-unit
is not enough. In at least one multi-device driver, e.g. rtlwifi,
an equally called compilation-unit is found in several different
directories. There KBUILD_MODNAME is used to name the driver,
which fails later on as the driver framework refuses to register
an equally named driver twice.

Instead of only considering the name of the compilation-unit also
include the last element of the path to generate differentiating
KBUILD_MODNAME value.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
0e82322605 pci_decode: force GSI for ath9k device
As noted in 'wifi/pc: add ath9k driver' it appears the tested device
only works with GSIs.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
22c9157231 wifi: add RFKILL notification interface
Add somewhat cosmetic changes to the RFKILL interface used between
the management layer and the driver library to make the intent clear.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
6b406469f6 dde_linux: remove unused var from libnl_include
Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
080b0fb9b3 dde_linux: update wpa_supplicant to version 2.10
The supplicant is updated to the current release and is now downloaded
as archive rather than pulled from git. For the time being 'libnl' is
still kept at 3.2.25 as the current 3.7.0 release relies on more Linux
infrastructure that our integration does not provide.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
ea0a692879 wifi: get firmware from tar archive
This commit changes the firmware handling from requesting each
firmware file as a ROM module that is checked against a list of
known images (including their size) to requesting each file via
the local VFS of the 'wifi_drv'. This allows for using the original
probing mechanism that tries to select a matching firmware version.

The 'repos/dde_linux/src/drivers/wifi/README' file contains more
detailed information on how to configure the driver.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
3ba070e5e4 pc_wifi: implement __crypto_xor generated dummy
This function is called when decrypting RX frames on the CPU on 32 bit
platforms. Since the frames are normally decrypted by the wireless LAN
device and this code path is triggered rather infrequently the byte-wise
implementation should not pose a performance risk.

So far it was only encounter with a 7260 device when running netperf.

Issue #4861.
2023-05-30 12:03:33 +02:00
Josef Söntgen
d5710d9de3 Move 'wifi' driver to dde_linux repository
The bulk of the driver code now lives in the 'dde_linux' repository,
which is available on all platforms, from where it can be referenced by
other repositories.

The 'wifi_drv' binary was delegated to a generic harness that includes
all configuration and management functionality shared by all wireless
device driver components, e.g., the wpa_supplicant. The code of the
device driver emulation environment is located in 'src/lib/wifi'. It
is referenced by the platform-specific driver library that resides in
the corresponding platform repository. The runtime configuration needs
to point the driver to proper driver library.

The platform-specific library is in charge of orchestrating the contrib
source utilized by the driver as well as providing the 'source.list'
and 'dep.list' files. It must include the generic library snippet
'repos/dde_linux/lib/wifi.inc' that deals with managing the emulation
environment code.

The 'repos/dde_linux/src/drivers/wifi/README' file contains more
detailed information on how to deploy the driver.

Issue #4861.
2023-05-30 12:03:32 +02:00
Josef Söntgen
6727b5ea49 dde_linux: promote PC specific additions
Issue #4861.
2023-05-30 12:03:32 +02:00
Martin Stein
aeb65d6b1b file_vault: version 23.05
* ARM support and detaching from Ada/SPARK

  * Remove all CBE-related code - especially the Ada/SPARK-based CBE library.

    * We have no means or motivation of further maintaining big projects in
      Ada/SPARK (the core Genode team is native to C++).

    * The Genode Ada/SPARK toolchain and runtime don't support ARM so far - an
      important architecture for Genode. This would mean extra commitment in
      Ada/SPARK.

    * We realize that block encryption more and more becomes a fundamental
      feature of Genode systems.

  * Implement a new block encryption library named Tresor that is inspired by
    the design and feature set of the former CBE library and that is entirely
    C++ and part of the Genode gems repository.

    * The Tresor block encryption is backwards-compatible with the on-disk
      data layout of the former CBE block encryption.

    * Except from the snapshot management and the "dump" tool, the Tresor
      block encryption provides the same feature set as the former CBE block
      encryption and accepts the same user requests at the level of the
      Tresor library API.

    * So far, the Tresor block encryption does not support the creation of
      user-defined snapshots.

    * In contrast to the former CBE, the Tresor ecosystem has
      no "dump" tool beause with the CBE library it turned out to be rarely of
      use.

    * In contrast to the Block back-end of the CBE "init" tool, the Tresor
      "init" tool uses a File System back-end.

    * The former CBE VFS-plugin is replaced with a new Tresor VFS-Plugin.

      * The Tresor-VFS plugin in general is similar to the former CBE VFS but
        has a slightly different API when it comes to re-keying and re-sizing.
        Each of these operations now is controlled via two files. The first
        file is named <operation> and the user writes the start command to it.
        The user must then read this file once in order to drive the operation.
        The read returns the result of the operation, once it is finished.
        The second file is named <operation>_progress and can be watched and
        read for obtaining the progress of the operation as percentage.

    * The file vault is adapted to use the new Tresor ecosystem
      instead of the former CBE ecosystem and thereby also gains ARM support.

    * The former CBE tester and CBE VFS-tests are replaced by equivalent
      Tresor variants and are now run on ARM as well (testing with a persistent
      storage back-end is supported only when running on Linux).

    * So far, the new Tresor block encryption has no internal cache for meta
      data blocks like the former CBE.

* Add config/report user interface

  * Add a second option for the administration front end to the file vault
    named "config and report". With this front end the File Vault communicates
    with the user via XML strings. A ROM session is requested for user input
    and a Report session for user output. The front end type must be set at
    startup via the component config and is a static setting. The graphical
    front end that was used up to now is named "menu view" and remains the
    default.

  * The File Vault can now reflect its internal state and user input ("config
    and report" mode only) at the LOG session via two new static config
    attributes "verbose_state" and "verbose_ui_config" (both defaulting to
    "no").

  * The Shutdown button in "menu view" mode is replaced with a Lock button. The
    new button doesn't terminate the File Vault but merely lock the encrypted
    container and return to a cleared passphrase input. The same transition is
    also provided in "config and report" mode.

  * The file_vault.run script is replaced with file_vault_menu_view.run and
    file_vault_cfg_report.run that address the two front end modes. In contrast
    to the former script, which is interactive, the latter script is suitable
    for automatic testing.

  * There is a new recipe/pkg/test-file_vault_cfg_report that essentially does
    the same as file_vault_cfg_report.run but uses the File Vault package and
    can be executed with the Depot Autopilot. The new test package is added to
    the default test list of depot_autopilot.run

  * The File Vault README is updated to the new version of the component and
    has gained a chapter "functional description".

  * Fixes a regression with the cbe_init_trust_anchor component that prevented
    reacting to a failed unlock attempt in the File Vault.

* The new Tresor software Trust Anchor has an optional deterministic mode in
  which it replaces the normally randomized symmetric keys with 0. This mode
  comes in handy for debugging. However, it should never be activated in
  productive systems. When activated, the user is warned extensively on the
  LOG that this system mode is insecure.

Ref #4819
2023-05-30 12:03:32 +02:00
Johannes Schlatow
d3d3351b99 base-nova: fix map for small sizes
Changes to the platform driver triggered a map() error while mapping an
address block at 0x3000 of size 0x800. Since the mapped size was larger, the
loop continued and tried mapping address 0x4000 where no dataspace was
found.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
cb0546aa9b os: increase platform_session quota 2023-05-30 12:03:32 +02:00
Johannes Schlatow
b558cd18d4 platform_drv: make Device_pd a Io_mmu::Domain
By transforming the Device_pd into an Io_mmu::Domain, we implement an
IOMMU device that uses the kernel API for controlling the IOMMU. This
device gets special treatment and is used by default for every device
that has no <io_mmu/> child.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
9b5944b90c platform_drv: use IOMMU devices
Every session component manages a registry of Io_mmu::Domain objects
that it creates on demand depending on the acquired devices (i.e. the
IOMMU devices referenced by the acquired devices). Via the domain
objects, a session component adds/removes the address ranges of the
allocated DMA buffers. Additionally, domain objects provide an interface
for enabling/disabling pci devices.

Domain objects get destroyed with the corresponding control device.
Moreover, on devices/policy ROM updates, domain objects of control
devices that are not referenced by any acquired device anymore get destroyed.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
d3357b4c53 platform_drv: propagate IOMMU devices to session
genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
b2e4f95f27 platform_drv: add <io_mmu> to devices ROM
This allows referencing an arbitrary number of IOMMU devices within a
<devices> node, e.g.:

<device>
  <io_mmu name="foobar"/>
</device>

The specified name is supposed to refer to an existing device in the
devices ROM. The platform driver automatically acquires known IOMMU
devices whenever they become available so that the device object can be
looked up from the platform-driver-owned devices.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
f2e63bdd64 platform_drv: add IOMMU devices to common
With this change, platform-specific code is able to define factories that
acquire IOMMU devices to be used by the platform driver.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
f98466430f platform_drv: don't restrict ownership to session
This is a prerequisite for letting the platform driver acquire control devices.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
3520492f09 platform_drv: fix update_policy()
The method did not handle device changes properly. When a new policy
does not contain an owned device any more, we must consider this device
as changed and release it.  Moreover, the warning messages were interchanged.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Alexander Boettcher
475bcfc2b9 qemu: use EPYC as model for AMD SVM virtualization
"-cpu phenom" does not support all CPU instructions necessary with
gcc 12 toolchain update issuing more SSSE3, e.g. pshufb.

Additionally, remove good/bad Qemu version check of outdated versions.

Issue genodelabs/genode-world#329
2023-05-30 12:03:32 +02:00
Christian Prochaska
11f3df6e72 ports: remove obsolete noux-pkg dummy libs
Issue #4827
2023-05-30 12:03:32 +02:00
Christian Prochaska
a4fd743973 grep: disable use of unsupported pcre JIT compilation
Issue #4827
2023-05-30 12:03:32 +02:00
Christian Prochaska
9b4cd59d09 ports: preload posix.lib.so in tool_chain_auto.run
Issue #4827
2023-05-30 12:03:32 +02:00
Christian Prochaska
44046a82d4 binutils: support Genode lib name patterns with '-l' option
Issue #4827
2023-05-30 12:03:32 +02:00
Stefan Kalkowski
8cb9d19079 lx_emul: add vmalloc defines to ARM64
Ref genodelabs/genode#4813
2023-05-30 12:03:32 +02:00
Stefan Kalkowski
46c8267fa9 Fix "wifi: support building for ARM64"
Issue #4813
2023-05-30 12:03:32 +02:00
Sebastian Sumpf
4903487f21 vbox6: fix "Error: slab block [xxx] is corrupt"
In 'SUPR3InitEx' (SUPLib.cpp) a 'SUPQUERYFUNCS' structure is allocated
with

!  (PSUPQUERYFUNCS)RTMemAllocZ(SUP_IOCTL_QUERY_FUNCS_SIZE(CookieReq.u.Out.cFunctions));

where 'CookieReq.u.Out.cFunctions' is 0. To determine the size of the
allocation

! #define SUP_IOCTL_QUERY_FUNCS_SIZE(cFuncs) \
!   RT_UOFFSETOF_DYN(SUPQUERYFUNCS, u.Out.aFunctions[(cFuncs)])

is used with cFuncs = 0 (SUPDrvIOC.h) leading to an allocation up to the
arrow below

! typedef struct SUPQUERYFUNCS
! {
!     /** The header. */
!     SUPREQHDR               Hdr;
!     union
!     {
!         struct
!         {
!             /** Number of functions returned. */
!             uint32_t        cFunctions;
!             /** Array of functions. */
==> end of allocation
!             SUPFUNC         aFunctions[1];
!         } Out;
!     } u;
==> sizeof(SUPQUERYFUNCS)
! } SUPQUERYFUNCS, *PSUPQUERYFUNCS;

In sup.cc (Genode) 'ioctl(SUPQUERYFUNCS &request)' will lead to
'with_out_ioctl'

! auto &out = request.u.Out;

where auto is 'SUPQUERYFUNCS' and finally

! out = { };

will zero out 'SUPQUERYFUNCS' up to the second arrow above. Because
'RTMemAllocZ' will call 'calloc' to allocate the memory 'out = { };'
will corrupt the slab block after the allocation. Therefore, it is
reasonable to allocate at least 'sizeof(SUPQUERYFUNCS)'.

Note there might be other 'ioctl' cases like this. A better way might be
to use 'SUPQUERYFUNCS.Hdr.cbOut' to determine the 'out' size.

fixes #4675
2023-05-30 12:03:32 +02:00
Sebastian Sumpf
40f31a9050 libc: add message for corrupted allocation on 'free'
In case the meta data (or more) got zeroed upon 'free', print error
message. The offset in the meta data can never be zero. This does not
help on other memory corruptions, but at least gives a hint in the too
much zeroed out case.

issue #4675
2023-05-30 12:03:32 +02:00
Christian Prochaska
4c98be54eb libports: remove pcre16
Fixes #4903
2023-05-30 12:03:32 +02:00
Christian Helmuth
86ebbc2191 libc_integration: fix build errors with '-std=gnu++20 -Og'
Issue #4827
2023-05-30 12:03:31 +02:00
Alexander Boettcher
60b44f071b nova: avoid assertion during cross core IPC 2023-05-30 12:03:31 +02:00
Alexander Boettcher
75d43555c8 nova: limit rate of too long helper chain message
to 1 per every 10s.
2023-05-30 12:03:31 +02:00
Sebastian Sumpf
61d1226805 mesa: remove Mesa run scripts
GPU device access is hard to achieve in run scripts and even harder to
implement generic.

Use the "Modularize Sculpt OS image creation"
(commit b723b11b30)
approach instead.

issue #4900
2023-05-30 12:03:31 +02:00
Sebastian Sumpf
d69113643f mesa: disable some warnings form C++20
Remove on Mesa update
2023-05-30 12:03:31 +02:00
Sebastian Sumpf
ccc04a7082 qemu-usb: support read/write of unused IO ranges
The XHCI model reserves 0x4000 of IO memory but uses only 0x530.
Implement read (0) and write (nop) for these regions as real hardware
does.

fixes #4902
2023-05-30 12:03:31 +02:00
Christian Helmuth
f8bcb1999e lan9118: fix build errors with -std=gnu++20
Issue #4827
2023-05-30 12:03:31 +02:00
Christian Helmuth
c35714dc81 genode_c_api: fix build errors with -std=gnu++20
Issue #4827
2023-05-30 12:03:31 +02:00
Christian Helmuth
97b015b8c7 virtio: fix MMIO build errors with -std=gnu++20
Issue #4827
2023-05-30 12:03:31 +02:00
Christian Helmuth
b60190a73c gdb_monitor: force build with -std=gnu++17
Issue #4827
Fixes #4873
2023-05-30 12:03:31 +02:00
Christian Helmuth
f5477dc53b part_block: fix build errors with -std=gnu++20
Fixes #4876
2023-05-30 12:03:31 +02:00
Christian Helmuth
4961ee293d Enable -std=gnu++20 by default
Issue #4827
2023-05-30 12:03:31 +02:00
Christian Prochaska
c3b53bc2ec test-timeout: fix build errors with -std=gnu++20
Fixes #4899
2023-05-30 12:03:31 +02:00
Christian Prochaska
9e3233f13f test-timer_rate: fix build error with -std=gnu++20
Fixes #4898
2023-05-30 12:03:31 +02:00
Christian Prochaska
44bed3495d test-timer: fix build errors with -std=gnu++20
Fixes #4897
2023-05-30 12:03:31 +02:00
Christian Prochaska
d2b12b5c79 test-thread: fix build errors with -std=gnu++20
Fixes #4896
2023-05-30 12:03:31 +02:00
Stefan Kalkowski
90690d96d4 hw: fix build errors with -std=gnu++20
Fix genodelabs/genode#4894
2023-05-30 12:03:31 +02:00
Christian Prochaska
87bed28ef8 test-smp: fix build errors with -std=gnu++20
Fixes #4895
2023-05-30 12:03:31 +02:00
Christian Prochaska
0285e5f217 test-rm_fault: fix build error with -std=gnu++20
Fixes #4891
2023-05-30 12:03:31 +02:00
Christian Prochaska
49f835db86 test-slab: fix build error with -std=gnu++20
Fixes #4893
2023-05-30 12:03:31 +02:00
Christian Prochaska
7eb0b6928a test-rm_nested: fix build error with -std=gnu++20
Fixes #4892
2023-05-30 12:03:31 +02:00
Christian Prochaska
da6b384e3a test-mmio: fix build error with -std=gnu++20
Fixes #4890
2023-05-30 12:03:30 +02:00
Christian Prochaska
7f170e492e mixer: fix build errors with -std=gnu++20
Fixes #4889
2023-05-30 12:03:30 +02:00
Christian Prochaska
c4810c5db4 virtio_pci_nic: fix build errors with -std=gnu++20
Fixes #4888
2023-05-30 12:03:30 +02:00
Christian Prochaska
e88a84e2ab wireguard: fix build error with -std=gnu++20
Fixes #4887
2023-05-30 12:03:30 +02:00
Alexander Boettcher
de986c5f0b nova: make compatible with C++20
Fixes #4886
2023-05-30 12:03:30 +02:00
Josef Söntgen
cb531e4cf9 libports: update ada-runtime .ali files for GCC 12
Fixes #4880
2023-05-30 12:03:30 +02:00
Josef Söntgen
6355b48eee ada: ignore unknown pragmas
Triggered by the toolchain update to GCC 12 certain pragmas lead to
a build error as those are now unknown. As quick-fix add '-gnatwG',
which suppresses warnings on unrecognized pragmas.

Issue #4880.
2023-05-30 12:03:30 +02:00
Alexander Boettcher
37735d84d9 virtualbox5: make it compatible to C++20
Fixes #4871
2023-05-30 12:03:30 +02:00
Christian Helmuth
bfecea9001 vcpu_state: fix build errors with -std=gnu++20
Issue #4872
Issue #4871
Fixes #4878
2023-05-30 12:03:30 +02:00
Christian Helmuth
058990de48 pc/uart: fix build errors with -std=gnu++20
Fixes #4885
2023-05-30 12:03:30 +02:00
Christian Helmuth
cfca9899b2 virtualbox6: fix build errors with -std=gnu++20
Fixes #4872
2023-05-30 12:03:30 +02:00
Sebastian Sumpf
e1b6855352 libport: remove icu library
This was required by QtWebKit in the past, the QtWebEngine ships its own
version. No other code depends on this. Revive if needed.

fixes #4870
2023-05-30 12:03:30 +02:00
Sebastian Sumpf
9713fa505f vbox6: bump version from 6.1.26 to 6.1.44
Fixes most of the GCC 12 problems.

issue #4666
2023-05-30 12:03:30 +02:00
Christian Prochaska
ee9281b458 qt5: install host tools in /usr/local/genode/tool/23.05
Issue #4868
2023-05-30 12:03:30 +02:00
Christian Prochaska
c4b8fae563 launchpad: fix build errors with -std=gnu++20
Fixes #4884
2023-05-30 12:03:30 +02:00
Christian Prochaska
b696439a67 intel_gpu_drv: fix build errors with -std=gnu++20
Fixes #4883
2023-05-30 12:03:30 +02:00
Christian Prochaska
74734b7dd9 vfs_tap: fix build errors with -std=gnu++20
Fixes #4882
2023-05-30 12:03:30 +02:00
Alexander Boettcher
1f2dc78feb intel/display: replace intel_fbdev with drm/kms
Fixes #4806
2023-05-30 12:03:30 +02:00
Sebastian Sumpf
ae19ab0cff gpu/intel: remove vgpus from schedule before destruction
When a GPU session is destroyed, remove vgpu of session from scheduling
and as possible active vgpu. Otherwise, page faults might occur in case
already destroyed vgpu object is referenced during interrupt handling.

fixes #4881
2023-05-30 12:03:29 +02:00
Sebastian Sumpf
e64f2eaff9 ldso: save floating point arguments on arm_v8a (GCC 12)
Apparently we need to save the floating point arguments when entering
the linker in case "-fno-tree-vectorize" is at work. Otherwise this
registers get corrupted during jump slot relocation.

Fixes #4879
2023-05-30 12:03:29 +02:00
Norman Feske
a12fcfea0d libc: replace enum by static constexpr (C++20)
Related to issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
8e32e7a14e os: replace enum by static constexpr (C++20)
Fixes the build of the nic_router.

Issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
29079b2ac8 os: define CAP_QUOTA as constexpr (C++20)
Issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
604d6bf567 os: make nitpicker compatible to C++20
Avoid arithmetics on enum values, disambiguate '==' operator of
handle_registry.

Fixes #4875
2023-05-30 12:03:29 +02:00
Norman Feske
f679864c23 trace: C++20 compatibility
With the new standard, volatile variables cannot be incremented,
decremented, or modified by compound assignments (e.g., +=).

Issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
1dac048413 base: make RPC framework compatible to C++20
Avoid the use of arithmetics on enum values.

Issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
81e85bf1b5 sculpt_manager: fix build errors with '-std=gnu++20'
Fixes #4874
2023-05-30 12:03:29 +02:00
Christian Prochaska
2383d802ba test-stdcxx: fix build errors with '-std=gnu++20'
Fixes #4877
2023-05-30 12:03:29 +02:00
Christian Helmuth
11de03fedc vbox5_genode_usb_hid_raw: adapt to usb_host changes
Issue #4795
2023-05-30 12:03:29 +02:00
Christian Prochaska
1e1df21a94 Remove stale Xen support
Fixes #4859
2023-05-30 12:03:29 +02:00
Christian Helmuth
502f5b8a59 vbox6: fix build errors with GCC 12
The fixes were manually backported from virtualbox-trunk.

Issue genodelabs/genode#4827
Fixes genodelabs/genode#4846
2023-05-30 12:03:29 +02:00
Christian Prochaska
03c23d299a qt5: reduce external dependencies of host tools
Fixes #4868
2023-05-30 12:03:28 +02:00
Christian Helmuth
590cf78c0f lx_emul: clarify Linux does not support -O0/-Og 2023-05-30 12:03:28 +02:00
Norman Feske
978f86ba60 recipes/pkg/sculpt/README: spelling fix 2023-05-30 12:03:28 +02:00
Stefan Kalkowski
5e0a9052d2 hw: prevent alignment faults in bootstrap
Either enable strict-alignment or disable FPU code generation by gcc
regarding bootstrap code, which cannot handle alignment faults during
initialization properly.

Ref genodelabs/genode#4827
2023-05-30 12:03:28 +02:00
Christian Helmuth
37d1855907 lx_fs: fix build errors with GCC 12
/data/genode/repos/os/src/server/lx_fs/directory.h: In member function ‘virtual Genode::size_t Lx_fs::Directory::read(char*, Genode::size_t, File_system::seek_off_t)’:
/data/genode/repos/os/src/server/lx_fs/directory.h:224:53: error: ‘dent’ may be used uninitialized [-Werror=maybe-uninitialized]
  224 |                                 .type  = type(dent->d_type),
      |                                               ~~~~~~^~~~~~
/data/genode/repos/os/src/server/lx_fs/directory.h:197:40: note: ‘dent’ was declared here
  197 |                         struct dirent *dent;
      |                                        ^~~~

Issue genodelabs/genode#4827
2023-05-30 12:03:28 +02:00
Sebastian Sumpf
d59a2b4b38 ldso: fix page fault at IP 0 with GCC 12 on RISC-V
Eliminate the creation of 'Genode::String's before the linker has been
self relocated, because 'Genode::String's will call 'Genode::strlen' on
construction from C-Strings, which has now become a GOT relative call,
while the GOT contains only zeros before relocation -> page fault at
IP 0.

fixes #4867
related to #4827
2023-05-30 12:03:28 +02:00
Christian Helmuth
d35e6f1aa2 Remove extra ‘;’ 2023-05-30 12:03:28 +02:00
Alexander Boettcher
8f5fe6dfe1 tool/run/load/ipxe: use installed_command
to find lighttpd if it is installed in /usr/sbin
2023-05-30 12:03:28 +02:00
Sebastian Sumpf
cc5d476fb1 libc/riscv: fix link errors with GCC 12
Dynamically linked functions can not be called directly with jump ("j",
"jal") and friends. Calls must go through the PLT.

issue #4827
2023-05-30 12:03:28 +02:00
Sebastian Sumpf
ff497bc710 stdcxx/riscv: update to version 12.3.0
issue #4827
2023-05-30 12:03:28 +02:00
Sebastian Sumpf
69d3d83930 lx_emul: set minimum alignment of allocations to 16 byte
FPU allocations on x86/ARM require a minimum alignment or may raise
faults (#GP or general protection in the x86 case).
2023-05-30 12:03:28 +02:00
Christian Helmuth
9cb9060794 base-nova: prevent linker warning
ld: warning: hypervisor has a LOAD segment with RWX permissions

Issue #4827
2023-05-30 12:03:28 +02:00
Christian Prochaska
369af8d8c3 sanitizer: update to version 12.3.0
Issue #4827
2023-05-30 12:03:28 +02:00
Christian Prochaska
02a8c279dc gcov: update to version 12.3.0
Issue #4827
2023-05-30 12:03:28 +02:00
Christian Prochaska
2e754da822 stdcxx: update to version 12.3.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
78b8b2785c gcc: update to version 12.3.0
Issue #4827
2023-05-30 12:03:27 +02:00
Sebastian Sumpf
07c089e860 stdcxx: add 'std::basic_filebuf' for char
needed by glmark2 2023.1

related to genodelabs/genode-world#326
2023-05-30 12:03:27 +02:00
Josef Söntgen
bab90d4837 depot/download: let curl fail on 404 response
Downloading non-existent archives from 'depot.genode.org' leads to
files in the 'public' directory containing the 404 error website
delivered by the HTTP server. Specifying the '--fail' option results
in curl generating an exit-code that leads to the appropriate action
by the tool, e.g.:

 Error: failed to download 'https://depot.genode.org/user/pkg/x/version.tar.xz'

Issue #4865.
2023-05-30 12:03:27 +02:00
Christian Helmuth
3fa275354d test-smp: fix build errors with GCC 12
error: 'void operator delete(void*, Genode::Deallocator&)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]

Issue #4827
Fixes #4850
2023-05-30 12:03:27 +02:00
Christian Helmuth
d0578700bc test-cache: fix build errors with GCC 12
error: ‘void operator delete(void*, Genode::Deallocator&)’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]

Issue #4827
Fixes #4848
2023-05-30 12:03:27 +02:00
Christian Prochaska
e4ac393de4 sel4: fix build errors with gcc 12
Fixes #4864
2023-05-30 12:03:27 +02:00
Christian Prochaska
417547c7d9 qt5: fix build errors with gcc 12
Fixes #4863
2023-05-30 12:03:27 +02:00
Christian Prochaska
9e021422c7 sanitizer: update to version 12.2.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
106e322f82 gcov: update to version 12.2.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
b8c80c9570 stdcxx: update to version 12.2.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
8920e5fbea tool_chain: update gprbuild to version 23.0.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
de70f17ee4 gdb: update to version 13.1
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
b12ebae6cd gcc: update to version 12.2.0
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
8602837fd4 binutils: update to version 2.40
Issue #4827
2023-05-30 12:03:27 +02:00
Christian Prochaska
f18a12a592 tool chain: update version to 23.05
Issue #4827
2023-05-30 12:03:27 +02:00
Norman Feske
8c9ca0e7a9 nitpicker: fix gcc build error
An early version of nitpicker used a pointer as 'owner' with the null
pointer representing nitpicker's built-in views, which are nowadays
represented by 'Main::_global_view_ower'. The null-pointer check is a
left-over from the earlier days.

Fixes #4847
2023-05-30 12:03:27 +02:00
Benjamin Lamowski
29238498b6 libc: implement signal(3)
Fixes #4824
2023-05-30 12:03:27 +02:00
Benjamin Lamowski
70644186c1 libc: add dummy symbols for the Rust std library
Add dummies for sigaltstack(3) and FreeBSD's _umtx_op(2).

Ref #4824
2023-05-30 12:03:27 +02:00
Christian Prochaska
0c70e9e8df gdb_monitor: fix build error with gcc 12
Fixes #4841
2023-05-30 12:03:26 +02:00
Norman Feske
b2bc5912c8 os: use [build_artifacts] in run scripts
Issue #4860
2023-05-30 12:03:26 +02:00
Norman Feske
a2832995d0 Remove long unused kdb_uart_drv for fiasco and foc
Removed in the context of issue #4860.
2023-05-30 12:03:26 +02:00
Norman Feske
dab7c64762 os: remove obsolete input.run script
Since repos/base/board/pc/devices is empty, the run script no longer
works on PC. Nobody noticed because the use case of this run script -
as development test loop for the ps2 and fb_sdl - are better served by
other scenarios nowadays, e.g., using declaring 'build: ps2' for a
custom Sculpt OS build.

Removed in the context of issue #4860.
2023-05-30 12:03:26 +02:00
Norman Feske
1cb4b4e2d8 os: remove gpio_led.run and gpio_signal.run
The gpio session interface is deprecated and the run scripts are not
regularly executed.

Removed in the context of issue #4860.
2023-05-30 12:03:26 +02:00
Norman Feske
71bda7db24 Move cpu_quota.run from os to base-hw repository
This test works only on the base-hw kernel after all.
2023-05-30 12:03:26 +02:00
Norman Feske
f119d9ee8b base: use [build_artifacts] in run scripts
The patch also removes a few legacies along the way, unifies the coding
style, and cuts back superfluous comments.

Issue #4860
2023-05-30 12:03:26 +02:00
Christian Helmuth
fc71f1848f tool/tool_chain: log PLATFORM on installation 2023-05-30 12:03:26 +02:00
Josef Söntgen
03ed5fc3f4 dde_bsd: update audio driver to OpenBSD 7.3
Fixes #4857.
2023-05-30 12:03:26 +02:00
Norman Feske
05e5ecca86 vfs: fix dangling allocation in dir_file_system
Issue #4855
2023-05-30 12:03:26 +02:00
Alexander Boettcher
2a0e45d0f7 log_core: limit buffer to max log string
Fixes #4853
2023-05-30 12:03:26 +02:00
Christian Helmuth
d9643b61af acpi_drv: count only memory allocated by new()
Fixes #4844
2023-05-30 12:03:26 +02:00
Norman Feske
2a49eee50f libc: improve diagnistics on initialization errors
This change helps to draw the connection between warnings during the
initialization of file descriptors and the libc configuration.
2023-05-30 12:03:26 +02:00
Christian Prochaska
901cbf0af3 sd_card_drv: fix build errors with gcc 12
Fixes #4851
2023-05-30 12:03:26 +02:00
Christian Prochaska
1742eb16b2 test-segfault: fix build error with gcc 12
Fixes #4849
2023-05-30 12:03:26 +02:00
Christian Helmuth
5c501997ca tool/depot/publish: prevent empty .sig files
If GPG signing is aborted, e.g., by pressing CTRL-C, an empty .sig file
remained in PUBLIC_DIR because the file was created by the Bash
redirection. By using '--output $@', gpg maintains the .sig file.
2023-05-30 12:03:26 +02:00
Christian Prochaska
b96004fd71 nvme_drv: fix build errors with gcc 12
Fixes #4845
2023-05-30 12:03:26 +02:00
Christian Prochaska
4dc5426a45 trace_recorder: fix build error with gcc 12
Fixes #4843
2023-05-30 12:03:26 +02:00
Christian Prochaska
db69104f1a text_area: fix build error with gcc 12
Fixes #4842
2023-05-30 12:03:25 +02:00
Christian Prochaska
1edde7c1bc fetchurl: fix build errors with gcc 12
Fixes #4840
2023-05-30 12:03:25 +02:00
Christian Prochaska
c2aacfa9c4 vfs: fix build error with gcc 12
Fixes #4839
2023-05-30 12:03:25 +02:00
Christian Prochaska
aa44ada2d4 okl4: fix hanging tests when built with gcc 12
Fixes #4838
2023-05-30 12:03:25 +02:00
Christian Prochaska
0eda98b03e pistachio: fix build errors with gcc 12
Fixes #4837
2023-05-30 12:03:25 +02:00
Christian Prochaska
ed5cbbfa1b fiasco: fix build errors with gcc 12
Fixes #4836
2023-05-30 12:03:25 +02:00
Christian Prochaska
36a1428c55 base-sel4: fix build errors with gcc 12
Fixes #4835
2023-05-30 12:03:25 +02:00
Christian Prochaska
c74c8d12cf base-nova: fix page fault in init when built with gcc 12
Fixes #4834
2023-05-30 12:03:25 +02:00
Christian Prochaska
920e240f67 foc: fix build errors with gcc 12
Fixes #4833
2023-05-30 12:03:25 +02:00
Christian Prochaska
b29db99f1c hw: fix build error with gcc 12
Fixes #4831
2023-05-08 15:55:35 +02:00
Christian Prochaska
acfeda15a7 base-linux: fix build error with gcc 12
Fixes #4830
2023-05-08 15:55:35 +02:00
Christian Prochaska
eab8db228b base: fix build errors with gcc 12
Fixes #4829
2023-05-08 15:55:35 +02:00
Christian Prochaska
98bf2dadb8 core: fix build errors with gcc 12
Fixes #4828
2023-05-08 15:55:34 +02:00
Stefan Kalkowski
97e3572844 lx_emul: use devio API for USB driver operations
Fix genodelabs/genode#4795
2023-05-08 15:55:34 +02:00
Stefan Kalkowski
f079d1f7c3 usb_hid_drv: ensure freeing packets in destructor
Ref genodelabs/genode#4795
2023-05-08 15:55:34 +02:00
Stefan Kalkowski
19e2b5b8b2 usb_net_drv: ensure freeing packets in destructor
Ref genodelabs/genode#4795
2023-05-08 15:55:34 +02:00
Stefan Kalkowski
3c3e45746a usb_modem: ensure freeing packets in destructor
Ref genodelabs/genode#4795
2023-05-08 15:55:34 +02:00
Stefan Kalkowski
cad11093f1 lx_emul: align of page-size allocations properly
Use page-alignment for multiple of page-size allocations within
all kmalloc allocations.

Ref genodelabs/genode#4795
2023-05-08 15:55:34 +02:00
Christian Prochaska
5080e88a7a qt5: split api recipes with Qt module granularity
Fixes #4823
2023-05-08 15:55:34 +02:00
Christian Prochaska
b7d1d8d091 qt5: create 'bin' directory in test run scripts
Fixes #4822
2023-05-08 15:55:34 +02:00
Josef Söntgen
bcc454aa89 drivers/usb_block: treat SYNC as barrier
The commit implements the SYNC and TRIM as successful NOP, while
the former is handled as an barrier to all other out-standing
requests.

Fixes #4825.
2023-05-08 15:55:34 +02:00
Josef Söntgen
280724e6b5 nvme_drv: read proper FLBAS value
Bit 0:3 indicate which of the (up to) 16 supported LBA formats is
used for this namespace. Instead of only looking at those bits the
driver looked at the complete 0:7 bits. Those, however, also include
information on how metadata may be transferred. That leads to using
the wrong index for reading the LBA format.

Fixes #4832.
2023-05-08 15:53:13 +02:00
Christian Helmuth
4a5d31e248 depot: update recipe hashes 2023-05-08 15:53:05 +02:00
Josef Söntgen
eb93b5f863 sculpt_manager: check passphrase before ENTER
Prevent setting an invalid configuration by guarding against are
premature generation.

Issue #4858.
2023-05-04 11:59:14 +02:00
Norman Feske
f712d97763 sculpt: always update keyboard focus after input
This patch solves keyboard-focus issues with the wifi dialog that were
caused by making the focus update conditional. However, since the update
is not expensive, we can unconditionally re-evaluate the focus atfer
each user interaction.

Issue #4820
Fixes #4856
2023-05-04 11:59:14 +02:00
Norman Feske
0e3a9bfe1f libc: fix cached ioctl info file access
This patch solves the false-negative error message "failed to open file"
referring to an ioctl info file during an ioctl call. The message is
now avoided by checking for the existence of the file before reading it.

However, the observed symptom uncovered an actual bug that was
introduced in commit "libc vfs: open OSS 'info' file only once" with
the attempt to cache the content of ioctl info files. When called
multiple time for different paths, 'Vfs_plugin::_with_info' would
wrongly return the info from the first call as cached in a local
static variable.

The patch fixes the problem by a new added 'Cached_ioctl_info'
implementation in the scope of the 'Vfs_plugin'.

Issue #4372
Fixes #4852
2023-05-04 11:59:14 +02:00
Christian Helmuth
2e76374a35 depot: update recipe hashes 2023-04-28 15:10:43 +02:00
Christian Helmuth
db8fb0e168 News item for Sculpt 23.04 2023-04-28 15:01:17 +02:00
Norman Feske
ab0fe21ac7 sculpt: update README for version 23.04 2023-04-28 15:01:17 +02:00
Christian Helmuth
22d8c4059e sculpt: hide system_view in graph 2023-04-28 14:46:11 +02:00
Christian Helmuth
97070620af depot: update recipe hashes 2023-04-28 14:46:11 +02:00
Norman Feske
de106608a0 sculpt: reduces space between depot users
Otherwise, the default list of depot users won't fit with the touch
keyboard on the PinePhone's screen.
2023-04-28 14:46:11 +02:00
Norman Feske
01b198657d sculpt: reset update dialog on changed sculpt fs
When changing the used sculpt partiton, the dialog state should be
cleared from the information of the original selection.

Issue #4820
2023-04-28 14:46:11 +02:00
Norman Feske
43d51c4499 sculpt: refine keyboard entry of new depot URL
This patch includes the system dialog in the global keyboard focus
handling, supports hovering of the "Edit" and "Add" buttons,
allows the use of the enter key to finish URL editing, and
triggers a re-scan of depot users after adding a new one.

Issue #4820
2023-04-28 14:46:11 +02:00
Norman Feske
937ddd012b sculpt: refresh update window when network is up
This way, the update-index button becomes immediately visible once we
have connectivity.

Issue #4820
2023-04-27 15:07:45 +02:00
Norman Feske
280fc45c5f sculpt: sanitize depot-user selection
Should the selected depot user not be present in the depot - for example
after switching the sculpt partition to another - unfold the selection
of all present depot users so that the one can pick an existing one.

Issue #4820
2023-04-27 14:58:04 +02:00
Christian Helmuth
091db48843 vfs_block: warn only once if sync is not supported
Issue #4825
Issue #4820
2023-04-27 14:24:29 +02:00
Norman Feske
6717494c5b sculpt: avoid installation-complete feedback loop
Issue #4820
2023-04-27 14:07:58 +02:00
Norman Feske
6d91b5d51b sculpt: show system dialog only after prepare step 2023-04-27 12:36:43 +02:00
Sebastian Sumpf
8f0a191c2a gpu/intel: comment for read execlist status
Adds a comment to the exec list status loop.

issue #4820
2023-04-26 16:23:13 +02:00
Alexander Boettcher
bdbfa532cd platform/x86: improve DMA memory alignment
If the DMA memory allocation alignment is unfortunate (not natural size
aligned), the IOMMU (AMD/INTEL) may not use larger(super) pages with effects
on the page table walk frequency and TLB caching.

Issue #4820
2023-04-26 16:22:16 +02:00
Alexander Boettcher
98a31bbfdb platform/x86: exclude special range from device_pd
Issue #4820
2023-04-26 16:12:52 +02:00
Christian Helmuth
7deee978c5 driver_manager: disable USB driver BIOS handoff
We repeatedly experience issues with XHCI handoff in the USB host driver
at runtime on modern systems. Mostly, these issues manifest as
initialization delays with very high CPU load. Investigations show that
during this time the handoff MMIO write does not return, which hints the
firmware driver enters some spinning loop. I suspect the enabled IOMMU
does not play well with the firmware due to insufficient RMRR
information.

Therefore, we disable USB handoff in Sculpt via the driver manager (as
we do for dedicated devices already in other contexts). Note, UHCI and
EHCI handoff is still done in the platform driver and succeeds on all
our test hardware.

Issue #4820
2023-04-26 15:57:20 +02:00
Alexander Boettcher
d68f5446b1 acpica: remove irq dependency in package
Issue #4679
Issue #4820
2023-04-26 15:55:20 +02:00
Christian Helmuth
d8ff3f655a depot: update recipe hashes 2023-04-26 15:19:57 +02:00
Norman Feske
4edd45dd8f depot: split pkg/goa-linux from pkg/goa
This split allows us to cross-compile all arm_v8a packages needed for
'goa build' by creating pkg/arm_v8a/goa.

The components featured on pkg/goa-linux are solely needed for 'goa
run'. As they contain a number of lx/hybrid components, pkg/goa-linux
must be complied on Linux running on the target architecture.
2023-04-26 15:19:57 +02:00
Christian Helmuth
ddc3b88cd2 depot: update pkg/goa recipe hash
This package depends on genode/world/recipes/src/sdl, which had an
outdated hash file.
2023-04-26 13:56:23 +02:00
Christian Helmuth
e9a497abe4 depot: update recipe hashes 2023-04-26 11:58:16 +02:00
Norman Feske
83d0214099 sculpt: make hovering build-time configurable
This way, we can disable the visual hovering at one place for the phone
version.
2023-04-26 11:58:16 +02:00
Norman Feske
105b3cd21d sculpt: system update and presets
The new dialog accessible via the "System" panel button hosts the
system-update dialog and the preset selection.

Fixes #4744
2023-04-26 11:58:16 +02:00
Norman Feske
5687dc06fd sculpt/default-pc: example presets 2023-04-26 11:58:16 +02:00
Martin Stein
1dbad87139 cbe: fix propagation of results of unlock attempts
Fixes a regression with the cbe_init_trust_anchor component that prevented
reacting to a failed unlock attempt in the File Vault. The regression was
caused by new semantics in the vfs that did not allow for using the file
operation result as indicator for whether the unlock attempt failed or
succeeded. The correct and hereby applied approach is to check for the data
read from the file after having written the unlock command. The data reads
either "ok" or "failed".
2023-04-26 11:58:15 +02:00
Sebastian Sumpf
bd58bd8279 gpu/intel: read execlist status multiple times (GEN < 12)
Before scheduling we check if the execlist is empty. When many clients
are present, the bits might not be cleared by hardware yet. Before the
watchdog timer would trigger, because we scheduled nothing. Now we try
serval times, even if this fails, we still schedule because in the worst
case only a preemption would happen.

issue #4820
2023-04-26 11:58:15 +02:00
Josef Söntgen
75917f6595 file_vault: use VFS to sync data file
Issue #4820.
2023-04-26 11:58:15 +02:00
Norman Feske
67c1ca1e61 sculpt: increase max fb height to 1504 pixels
This is needed to boot Sculpt OS on the Framework laptop.

Issue #4820
2023-04-26 11:58:15 +02:00
Norman Feske
114a199321 Meta package gems/recipes/pkg/goa 2023-04-26 11:58:15 +02:00
Alexander Boettcher
38f4b15df1 intel_fb: set default brightness of connector
which is unconfigured to 70%

Issue #4820
2023-04-26 11:58:15 +02:00
Timo Nicolai
83f78e7fe6 base: add Xml_node::for_each_attribute
Adds a function that allows iterating over an XML node's attributes
without relying on `Xml_node::Nonexistent_attribute`.

Issue #4817
2023-04-26 11:58:15 +02:00
Christian Helmuth
7e06aa13c1 vbox6: disable GSO in e1000 model
Commit "vbox: avoid uncaught nic Empty_ack_queue exception" introduced a
performance regression due to packet retransmission because of faulty
GSO segment handling. As fixing the GSO handling is fairly complex, we
disable GSO until a fix was developed.

Issue #4820
Issue #4821
2023-04-26 11:58:15 +02:00
Christian Helmuth
8752d8d677 vbox6: critsect in nic via pfnBeginXmit/pfnEndXmit
Issue #4820
Issue #4821
2023-04-26 11:58:15 +02:00
Sebastian Sumpf
5f469589eb recipe: mesa gears increare ram quota
Becaues the Iris DRM allocator now allocates 16MB chunks, more RAM is
needed for smaller 3D applications.

issue #4820
2023-04-26 11:58:15 +02:00
Sebastian Sumpf
c7c9542262 libc: add 'wakeup_remote_peers' to 'with_libc'
Libc components using 'with_libc' should wakeup peers in case a libc function
makes I/O progress.

issue #4820
2023-04-26 11:58:15 +02:00
Norman Feske
8893b800e0 depot_deploy: report only on state changes
This patch mitigates potential busy feedback effects when evaluating the
reports produced by 'depot_deploy' in a closed control loop. Reports
are now generated only if the deployment state has changed.

Issue #4818
2023-04-26 11:58:15 +02:00
Norman Feske
a289eff741 depot_download_manager: remove debug message 2023-04-26 11:58:15 +02:00
Norman Feske
cec8a401ae depot_deploy: check ROMs as deploy precondition
This patch marks a child as incomplete if one of the ROM modules listed
in its blueprint is missing. This, in turn, triggers the update system
in Sculpt, which then tries to download the missing pieces.

Issue #4818
2023-04-26 11:58:15 +02:00
Norman Feske
1c160d2366 sculpt: "Reattempt Install" option in popup dialog
Issue #4818
2023-04-26 11:58:14 +02:00
Norman Feske
bb6a189589 sculpt: show failed downloads in diagnostics
This patch complements the diagnostics view with the failure state
tracked by the download queue.

Issue #4818
2023-04-26 11:58:14 +02:00
Norman Feske
9e42c94e30 sculpt: handle deploy downloads by download queue
By managing downloads issued by the deploy subsystem via the
'Download_queue', failed downloads (e.g., due to HTTP error 404) are
properly tracked and don't cause infinite re-attempts.

Issue #4818
2023-04-26 11:58:14 +02:00
Christian Helmuth
5cb06b5f1c platform_drv: document PCI device naming after BDF
Issue #4812
2023-04-26 11:58:14 +02:00
Norman Feske
c705bdd6a9 depot_download: avoid spurious respawn of fetchurl
Thanks to Timo Nicolai for bringing up this issue along with an initial
patch.

Fixes #4815
2023-04-26 11:58:14 +02:00
Norman Feske
a5eb198549 sandbox/init: report exit state immediately
This patch promotes the event of an exiting child to become immediately
reported, reducing delays for management components that watch the exit
status of children.

Fixes #4814
2023-04-26 11:58:14 +02:00
Norman Feske
aab9227365 pkg/mesa_gpu-cpu: RAM quota adjustments
When deployed on the PinePhone, the cached_fs_rom requests additional
4 MiB of RAM.
2023-04-26 11:58:14 +02:00
Norman Feske
014066f15b sculpt: avoid stretched radio icon in wifi ap list 2023-04-26 11:58:14 +02:00
Norman Feske
54d7a48c9b sculpt: support for pinephone wifi driver
This patch replaces the former 'nic_drv' and 'nic_drv_dtb' functions
by a more general 'nic_driver_routes' function that can return one or
multiple platform-specific ROM routes for NIC-driver binaries and dtb
files. This allows for supplying customizations for the wifi driver
as well. E.g., on the PinePhone, this hook can be used to handle the
renaming of the 'wifi_drv' to 'a64_wifi_drv'.

Related to issue #4813 and issue genodelabs/genode-allwinner#17.
2023-04-26 11:58:14 +02:00
Josef Söntgen
1d376717c1 net/netaddress: make copy member function const
As the function does not alter the internal state of the
object allow for using it in r/o contexts.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
8f91f119b8 wifi: remove firmware library
The library is merely an historical artifact and the raw archive is
better used in its place.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
2b4246c59b lib/symbols/wifi: add symbols file for ABI so
Add symbols file for the wifi shared-object.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
6c36a58bb7 lib/wifi: remove unused symbols from symbol.map
Remove symboles that are no longer required.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
0b28c9ae6f lib/vfs/wifi: remove dependency on wifi library
The wifi VFS plugin is solely there to provide a hook for calling
'Lx_kit::initialize()' prior to the static ctors. As the corresponding
symbol can be resolved at run-time there is no need to add the
library as a build-time dependency.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
e6ee7d3d4a wifi: provide platform specific DTB access
The device-tree binary is normally required on ARM-based platforms
where as on x86 it is omitted. The platform-specific DTB helper
provides a generic interface for accssing the DTB and needs to be
implemented on each platform.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
eaaedb6ae8 wifi: defer supplicant start-up
The SDIO connected wireless device on the PinePhone is not available
on start-up, which leads to the supplicant failing to initalize
'wlan0'. Normally the supplicant would be used in a way that handling
devices that appear at run-time happens gracefully.

Rather than supporting this behavior we defer the start-up of the
supplicant until the device could be openend successfully for now.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
0b08ae09c4 wifi: check 'lx_get_mac_addr' before reporting
The MAC address device report should be published once the device is
available. Since this may happen at a later time we have to check the
call.

Issue #4813
2023-04-26 11:58:14 +02:00
Stefan Kalkowski
8ae5ae76fb wifi: support building for ARM64
This commit introduces support for building the WLAN driver for ARM
platforms. It makes the WPA supplicant and its support libraries
available for all platforms. It also seperates the PCI parts to
accommodate platforms where other bus protocols are used.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
56d366995c wifi/pc: add ath9k driver
The driver was only tested with an "Atheros AR9462 Rev:2" [168c:0034]
device using the 'wifi.run' run script.

Note: for it to work MSI may not be used as otherwise interrupts do not
work. Using an IOMMU leads to the following fault:

[ 0] IOMMU:0xffffffff817eb0b0 FRR:0 FR:0x22 BDF:4:0:0 FI:0xb0000000000000 (0)

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
e0d6e2e5a7 wifi: guard 6.1.x code
Needed for drivers still implemented using Linux 5.x.x.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
7b146e0563 lx_emul: use 'dma_address' in 'dma_unmap_sg_attrs'
The way the 'struct page' management is currently implemented it is
not safe to rely on it in case allocations share the same page. This
is in particular true where the virtual address is obtained by
querying the page object for maintaining the CPU caches.

Issue #4813
2023-04-26 11:58:14 +02:00
Josef Söntgen
997e60d52a lx_emul: guard 6.1.x signature changes
Needed for drivers still implemented using Linux 5.x.x.

Issue #4813
2023-04-18 11:09:55 +02:00
Christian Helmuth
bba9254172 sculpt: version 23.04 2023-04-17 14:56:40 +02:00
Christian Helmuth
b5f79756b3 depot: update recipe hashes 2023-04-17 14:48:30 +02:00
Sebastian Sumpf
f91aba873e test/qt5/qpluginwidget: add dummy 'main'
issue #4794
2023-04-17 14:48:30 +02:00
Alexander Boettcher
364ff0e65c nova: avoid initial wrong idle tracing times
Issue alex-ab/nova#9
2023-04-17 14:48:30 +02:00
Pirmin Duss
2b194d47cc openssl: update to 1.1.1t
Issue #4808
2023-04-17 14:48:30 +02:00
Sebastian Sumpf
effe17c852 qt5_component: add 'main' as undefined to ABI
This causes the 'main' function to not be garbage collected when linking against
the ABI.

issue #4794
2023-04-17 14:48:30 +02:00
Christian Helmuth
4b54520579 trace_buffer: fix check for empty buffer
Issue #4805
2023-04-17 14:48:30 +02:00
Christian Helmuth
684388e737 trace_logger: log scheduling-context execution time
Optionally log scheduling-context execution time in addition to the
thread-context. This may be relevant on kernel platforms that do not
schedule threads on their own CPU share only but implement some kind of
donation scheme, for example, NOVA.

Usage

  <config sc_time="yes" ...> ... </config>

Fixes #4805
2023-04-17 14:48:30 +02:00
Josef Söntgen
1041ed8773 wifi: use latest available firmware
This commit updates the used firmware images for the iwlwifi device
to latest available ones (supported by the current 6.1.x driver).
It also removes old firmware images that by now are not used anymore.

Fixes #4807.
2023-04-17 14:48:30 +02:00
Norman Feske
595660fb84 tool/depot: sanity check for presence of port hash
If a content.mk file wrongly refers to a non-existing directory in a
call of the 'port_dir' function, the 'content_env_missing_ports.mk' gets
stuck while invoking 'cat' without argument, which makes such mistakes
difficult to diagnose. This patch adds a sanity check for the existence
of the port hash file at the specified location before attempting to
'cat' the hash-file content.
2023-04-17 14:48:30 +02:00
Norman Feske
22836e3e0f gems: add pkg/unconfigured_nano3d
Unfortunately, the change of "depot: remove empty config from
pkg/nano3d" broke the manual deployment of the nano3d demo because no
<config> is provided in this case.

This patch splits pkg/nano3d into two variants. The regular nano3d pkg
comes with an empty <config/> node as before. The unconfigured_nano3d
pkg does not feature any <config/> node and can thereby be configured
via a ROM route to a dynamic-rom service.
2023-04-17 14:48:30 +02:00
Norman Feske
f8fd202a1c depot_download: option for unverified downloads
This patch equips the depot_download subsystem with the option to
explicitly skip the signature verification for downloads by specifying
the attribute 'verify="no"' for an <installation> item. This is useful
in scenarios where the lack of integrity of downloaded content does not
pose a risk, e.g., for untrusted applications that are rigidly
sandboxed, or during development.

Note that this option does not entirely discarge the signature checking.
Whenever an download has dependencies that are verifyable - for
which the public key exists in the depot - the dependencies are still
verified. This allows untrusted content to depend of verifyable content
while protecting the integrity the verifyable content.

Issue #4804
2023-04-17 14:48:30 +02:00
Norman Feske
b6bb338011 sculpt: make download verification controllable
This patch adds the 'Verify' argument to all download-related interfaces
in order to control the checking of signatures for downloads. Note that
it does not change the sculpt_manager's existing built-in policy of
always checking signatures.

Issue #4804
2023-04-17 14:48:30 +02:00
Norman Feske
a351b0c164 sculpt: expose unique name as 'Component' constant 2023-04-17 14:48:30 +02:00
Norman Feske
3a99deef5a sculpt: reusable component-construction interfaces
This patch moves the interfaces needed for the interactive addition of runtime
components from the 'Popup_dialog' to the 'model/component.h'. So those
interfaces are no longer tied to one specific view implementation.
2023-04-17 14:48:30 +02:00
Norman Feske
daf53df670 sculpt: 'Sculpt::match_sub_dialog' function
This free-standing function is meant to gradually replace
'Dialog::match_sub_dialog' interface, which relies on the caching of
the hover state. The new function is more flexible because dialogs do no
longer need to inherit 'Dialog'.
2023-04-17 14:48:30 +02:00
Norman Feske
b91e5353ba sculpt: make Popup_view::Menu reusable 2023-04-17 14:48:30 +02:00
Norman Feske
9be7ce54c2 sculpt: avoid superfluous <installation> entries
The missing else statements resulted in the addition of a
superfluous <archive> node when installing an <index>, causing
warning messages by the depot-download subsytem.
2023-04-17 14:48:29 +02:00
Norman Feske
fb1865eb91 sculpt: support for creating small files 2023-04-17 14:48:29 +02:00
Norman Feske
9834849e95 sculpt: allow new depot users in ram_fs/depot 2023-04-17 14:48:29 +02:00
Norman Feske
0bec935ccb sculpt: hide manager_keyboard in graph 2023-04-17 14:48:29 +02:00
Norman Feske
9ef6ed52c4 sculpt: report_dump, system_clock-dummy launchers 2023-04-17 14:48:25 +02:00
Norman Feske
ed8e8b9473 fs_tool: add missing whitespace in warning message 2023-04-17 14:48:25 +02:00
Norman Feske
123df93741 depot_query/deploy: allow pkg <rom> relabeling
This patch adds the ability to specify an optional 'as' attribute in a
<rom> module declarion of a runtime file.

  <runtime ...>
    ...
    <content>
      <rom label="camera-pinephone.dtb" as="dtb"/>
      ...
    </content>
  </runtime>

If specified, The depot-deploy tool uses the provided attribute value to
hand out the ROM 'camera-pinephone.dtb' under the label 'dtb' to the
subsystem.
2023-04-17 14:48:25 +02:00
Norman Feske
7927c0b540 depot: recipe for pkg/nitpicker
This pkg is useful for using an instance of nitpicker as a video bridge.
2023-04-17 14:48:25 +02:00
Josef Söntgen
118fff0472 iwlwifi: limit rx bufs to 2048
Recent devices are configured with 4096 RX pages that lead to an
increased memory usage. For the moment lower the amount to 2048
and treat in potientially lower throughput for more conservative
memory consumption.

Fixes #4801.
2023-04-17 14:48:25 +02:00
Sebastian Sumpf
e27737a0a5 dde_rump: add RISC-V support
This commit adds RISC-V file-system support through the backport
originally provided by ARMv8.

fixes #4800
2023-04-17 14:48:25 +02:00
Christian Helmuth
7be915a185 vbox6: disable RDTSC exit
For Windows guests, it's crucial to configure the paravirtualization
provider in .vbox6 like follows. Otherwise, the TSC calibration fails
(issue #4726) and the CPU frequency (in task manager) is bogus.

  <Paravirt provider="HyperV"/>

Fixes #4726
2023-04-17 14:48:24 +02:00
Stefan Kalkowski
0bc5bcce4a test/driver_time: fix page-fault of ARMv8a variant
The get_cycles() call within the test doesn't apply to RDTSC
access when running on ARM but to arch_timer_read_counter, which
is an empty function pointer. By setting it to a function that
returns Genode::Trace::timestamp() we can enable the test for ARM.

Issue #4775
2023-04-17 14:48:24 +02:00
Stefan Kalkowski
2269f42e17 lx_emul: update Linux port to 6.1.20
Fix genodelabs/genode#4798
2023-04-17 14:48:24 +02:00
Sebastian Sumpf
80038ad936 qt5: split qt5 api
Split api into 'qt5', 'qt5_qml', and 'qt5_webkit'. This makes it
possible to link Qt5 apps more fine grained. Needed by Goa.

fixes #4793
2023-04-17 14:48:24 +02:00
Christian Helmuth
7c84d73d67 Spend min. 4K on platform session upgrade for DMA buffer
Issue #4792
2023-04-17 14:48:24 +02:00
Christian Helmuth
6a80b4bd17 dde_linux: move test/driver_time to virt_linux
Fixes #4775
2023-04-17 14:48:23 +02:00
Alexander Boettcher
807e2a1eb4 test/driver_time: adjust output to headline
Issue #4775
2023-04-17 14:48:23 +02:00
Alexander Boettcher
f4f292d22f test/driver_time: add wifi testcase
Issue #4775
2023-04-17 14:48:23 +02:00
Christian Helmuth
3a9ef48721 dde_linux: separate virt_linux from wireguard
Preparation to support further hardware-agnostic dde_linux components
(incl. lxip and tests).

Fixes #4774
2023-04-17 14:48:23 +02:00
Christian Helmuth
4016c799f2 lx_emul: move shadowed random.c from pc to generic
Issue #4774
2023-04-17 14:48:23 +02:00
Christian Helmuth
ef5e211fa0 lx_emul: check usb actconfig after potential preemption
Issue #4795
2023-04-17 14:48:23 +02:00
Christian Helmuth
3c45f5c7ab usb: support 32 in-flight packets
- move metadata specific to isochronous transfers from the descriptor
  into the content of USB-session packets
- restore support for 32 in-flight packets in the USB C API

Fixes #4749
2023-04-17 14:48:23 +02:00
Christian Helmuth
217d59ce68 usb: use buffer type in C API
Also, some reasonable sanity checks of client-passed parameters were
added and for-int loops replaced by for-range loops where applicable.

Issue #4749
2023-04-17 14:48:23 +02:00
Christian Helmuth
21d9854a81 sculpt_manager: refresh storage if part_block got stuck
Fixes #4791
2023-04-17 14:48:23 +02:00
Christian Helmuth
a2e29c0226 driver_manager: defer block_devices report
Now, block_devices are reported earliest right after the devices ROM was
parsed and neither AHCI nor NVMe were found. If one or both devices were
found, the report is deferred after all expected reports arrived.

Issue #4791
2023-04-17 14:48:22 +02:00
Christian Helmuth
6884e6b1ec fatfs: cleanup synchronous use of block connection 2023-04-17 14:48:22 +02:00
Christian Helmuth
6ab06f417d base-nova: log IOMMU feature in verbose boot info 2023-04-17 14:48:22 +02:00
Josef Söntgen
25c8c0f9e9 nvme_drv: fix wrong identify length 2023-04-17 14:48:22 +02:00
Christian Helmuth
34db8f5360 Fix single-client handling in some block providers 2023-04-17 14:48:22 +02:00
Christian Helmuth
927d71ad59 part_block: modernize implementation
Fixes #4790
2023-04-17 14:48:22 +02:00
Christian Helmuth
082d1780cf nvme_drv: reduce state-change intervals
- probe changes of CSTS.RDY every 20 ms
- check admin-queue completion every 50 ms
2023-04-17 14:48:22 +02:00
Josef Söntgen
f7b910b298 part_block: split reporting from parsing
Previously the 'partitions' report was implicitly generated after
parsing the partition-table by accessing the referenced reporter
object.

Now the report is explicitly created by calling the 'generate_report'
member function. At this point we no longer have access to all
required information so the 'Partition' class was extended to
accommodate for the data needed by MBR as well as GPT reports.

Fixes #4786.
2023-04-17 14:48:22 +02:00
Norman Feske
bd3936c7ed Test for combining select with a pipe
The test exercises the VFS's read-ready mechanism when using the
vfs_pipe plugin.

Issue #4785
2023-04-17 14:48:22 +02:00
Norman Feske
2c1b51be65 fs_query: increase file-content limit to 64 KiB
The former limit to 4 KiB is too small for complex Sculpt presets like
the video-chat scenario.

Fixes #4788
2023-03-15 17:05:35 +01:00
Norman Feske
fd7001d020 os/vfs.h: don't truncate File_content
The 'File_content' utility throws an exception whenever a file happens
to get truncated during the reading process. But it silently truncates
the data against the specified limit. In practice, exceeding the limit
is usually an error case. This patch enhances the 'File_content' utility
by throwing 'Truncated_during_read' in the limit-exceeded case as well,
in order to ease the diagnosis of such cases.

Issue #4788
2023-03-15 17:05:35 +01:00
Sebastian Sumpf
40333a8ee2 gpu/intel: use _owner.cap during session destruction
'cap()' will return invalid capability within session destructor, therefore Vram
objects that belong to the session will not be destroyed, leading to danling
references later on. Use '_owner.cap' of session instead.
2023-03-15 17:05:35 +01:00
Norman Feske
61926ebc07 base: introduce platform_init function
The new 'init_platform' function performs the platform-specific
component-local low-level initialization. It allows for the
differentiation between core and regular components as well as
kernel-dependent peculiarities.

This patch introduces a consistent notion of a 'Platform'. Within core,
the 'Platform' contains the kernel-specific initialization. Outside
core, the platform sets up the interplay with the parent component. In
all cases, the platform is constructed while running on the initial
stack.

Issue #4784
2023-03-15 17:05:01 +01:00
Pirmin Duss
9e0ef550a8 vfs_pipe: Fix large transfers after 23.02
Readers need to be woken up when data is ready.

Issue #4785
2023-03-15 17:02:51 +01:00
Pirmin Duss
d5051c439d test-libc_fifo_pipe: increase buffer size
Issue #4785
2023-03-15 17:02:51 +01:00
Stefan Kalkowski
61454178c0 vmm: support mode change in virtio gpu
Fix genodelabs/genode#4783
2023-03-13 17:01:32 +01:00
Stefan Kalkowski
cb3b6c4b88 vmm: distinguish virtio interrupts
VirtIO device models can assert interrupts to notify about
buffer and configuration changes. By now, we could only assert
buffer notification interrupts, but no configuration changes.
The latter is needed, e.g. to notify about GPU mode changes.

Ref genodelabs/genode#4783
2023-03-13 17:01:32 +01:00
Norman Feske
441186468c base: remove env_deprecated from rpc_cap_alloc
Issue #4784
2023-03-13 15:22:00 +01:00
Norman Feske
223e185b83 base-linux: rm env_deprecated from region_map_mmap
Issue #4784
2023-03-13 14:47:19 +01:00
Christian Helmuth
73771669f1 depot: update recipe hashes 2023-03-13 14:32:54 +01:00
Norman Feske
dc8fcc254d sculpt_image.run: fix var name in assert_run_arg 2023-03-13 14:32:54 +01:00
Christian Helmuth
b609411e76 part_block: add partition type to log message 2023-03-13 14:32:53 +01:00
Christian Helmuth
188a214a29 libusb: fix constructor order in vfs_libusb 2023-03-13 14:32:53 +01:00
Norman Feske
f2485f624b Link to hackster.io article in release notes 23.02
Provide a link to the new "Taking control over DMA" article
and apply a few minor style tweaks.
2023-03-13 14:32:53 +01:00
Norman Feske
805fae5bab Update README files
This patch removes outdated information and improves the language of
various README files.
2023-03-13 14:32:53 +01:00
Josef Söntgen
9b9d1f4e12 part_block: use expanding reporter
Depending on the number of partitions the current fixed size of 4096
bytes might not be sufficient for the resulting partitions report.
The use of the expanding reporter allows for accomodating large reports
while still keeping the resource usage down for the common case of
few partitions (with potentially short names).

Fixes #4782.
2023-03-13 14:32:53 +01:00
Norman Feske
d0f4791413 demo: remove use of format strings from mini_c lib
The implementations of snprintf and vsnprintf are not needed for the
loading of png images by the demo applications. So we can avoid the
dependency from the format library hosted in the libports repository.

Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
2c32e9ee18 base: remove util/avl_string.h
The use case is covered by util/dictionary.h now.

Fixes #4780
2023-03-13 14:32:53 +01:00
Sebastian Sumpf
c14007f559 vfs_trace: replace use of Avl_string by Dictionary
issue #4780
2023-03-13 14:32:53 +01:00
Josef Söntgen
ae0e0c118e nvme_drv: add support for host-memory-buffer
This commit introduces support for the HMB feature and will setup the
buffer during start-up. The host-memory-buffer (HMB) feature is mostly
used on NVMe devices that do not make use of an DRAM cache to store its
translation tables amongst other operational data. Not using HMB can
impair the performance on such devices.

The memory is allocated in 2 MiB chunks of DMA-capable memory and its
total size in bytes is configurable via the 'hmb_size' config attribute.
The driver always checks the minimal and preferred size of the HMB and
issues a warning in case it is not enabled via the configuration.
Moreover, if the configured size is less than the minimal amount
required by the device the HMB is not configured at all and a warning
is issued also. If the configured size is more than the preferred size
it will be capped to that amount.

Fixes #4715.
2023-03-13 14:32:53 +01:00
Norman Feske
239d4864e9 loader: support dynamic session upgrades
This patch converts the loader implementation to the 'Session_object'
interface to implement the ability to upgrade the session caps and RAM
after after the session creation. This is needed to accommodate the
change of the Loader::Connection in commit "Remove format strings from
connection types".

Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
c99fb2b69b core: replace use of Avl_string by Dictionary
Issue #4780
2023-03-13 14:32:53 +01:00
Stefan Kalkowski
ec700e88f7 pci_decode: do not handle signals after decoding
Remove signal handler and ACPI report ROM from Main class
to prevent to react on report changes.

Fix genodelabs/genode#4779
2023-03-13 14:32:53 +01:00
Norman Feske
8698e693d5 trace_logger: replace Avl_string by Dictionary
Issue #4780
2023-03-13 14:32:53 +01:00
Norman Feske
d4047e9af7 nic_router: remove stale include of avl_string.h 2023-03-13 14:32:53 +01:00
Norman Feske
d727d18871 base: remove format strings from API
This patch ultimatedly removes format strings from Genode's base API.
Users of the former base/snprintf.h and base/console.h headers may
use the free-standing 'format' library hosted in the ports repository.

Fixes #2064
Fixes #3869
2023-03-13 14:32:53 +01:00
Norman Feske
e9b249b709 Replace use of base/snprintf.h by format library
Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
9ef0f1b6cb libports: freestanding 'format' string library
This little library implements rudimentary format-string support. It is
useful for porting 3rd-party code that ought not depend on a full libc.

Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
50ee8dfaf8 Remove obsolete includes of base/snprint.h
Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
94b8c61e32 libc: remove internal use of base/snprintf.h
Issue #2064
2023-03-13 14:32:52 +01:00
Norman Feske
8b44f49d75 vbox5: remove use of base/snprintf.h
Issue #2064
2023-03-13 14:32:52 +01:00
Norman Feske
36c00cc294 gems: remove use of format strings
Issue #2064
2023-03-13 14:32:52 +01:00
Norman Feske
ecd0066e80 os: remove use of format strings
Issue #2064
2023-03-13 14:32:38 +01:00
Norman Feske
915adcd0dd base: remove internal use of format strings
Issue #2064
2023-03-13 14:32:38 +01:00
Norman Feske
9debad4e91 Remove format strings from connection types
Issue #2064
2023-03-13 14:32:37 +01:00
Norman Feske
fb66e733b5 base: add 'Connection' constructor accepting args
The new 'Connection' constructor accepts the session label, affinity,
and args as constructor arguments. The session arguments are passed as a
'Genode::String'. This allows for side-stepping the need for rendering a
format string passed to 'Env::session'.

Issue #2064
2023-03-13 14:32:37 +01:00
Christian Helmuth
bed084c17c Add missing sources to wireguard
The additional files provide Chacha implementation in case
may_use_simd() returns false because in_interrupt() returns true.

Related to issue #4778, commit "lx_emul: track irq state changes"
2023-03-13 14:32:37 +01:00
Christian Helmuth
9ae4fc2371 dde_linux: explicitly list patch files
Using wildcards for selecting patch files clashes with files from
linux.port.
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
6a7a30ceaa lx_emul: unify udelay implementation
Implement udelay for all architectures within common lx_emul code,
remove driver-specific version.

Always do busy looping in udelay and use cpu_relax()
like the original Linux code. Thereby, we profit from architecture specific
instructions (cpu cool down), and jiffies are updated if irqs are on.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
50541c68ec lx_emul: shadow cpu_relax to update jiffies
There are rare use-cases where cpu_relax is used inside a busy loop
(i2c bus functions), which only will break when the jiffies counter
reaches a specific value.
Because of the cooperative scheduling done in lx_emul, no timer
interrupt will break such a loop. As a workaround, we check for
necessary jiffies updates inside cpu_relax if interrupts are enabled.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
7e2c546d8e lx_emul: update jiffies during schedule
Whenever a new schedule decision is made in the Linux emulation layer,
we try to update the jiffies counter.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
c90b61f571 lx_emul: track irq state changes
To be able to check for interrupts being on or off,
the enabling and disabling is tracked in lx_emul.
When interrupts get received, they have to be turned off.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
eba2c8cf2f lx_emul: set timer irq task to highest priority
If a timer signal got received, first all time updates
have to be done, before other tasks get active.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
2c1724d7f2 lx_emul: adjust start & stop tick behaviour
Do not start and stop idle ticking within the timer interrupt
routine, but do it around the whole Lx_kit scheduling, which
is always called when Linux code gets active again, either
because of backend signals, interrupts, or timing signals.

This commit implicitly reverts the (incomplete) solution of
issue #4550

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Roland Bär
b9b18c92d0 usb_host: deliver UTF-16 strings on request
Linux kernel static functions usb_string_sub() and usb_get_langid() were
made accessible to implement robust string rerieval.

Fixes #4756
Fixes #4757
Fixes #4772
2023-03-13 14:32:37 +01:00
Christian Helmuth
ea2584e2fb Fix usb_block.run and add to autopilot.list 2023-03-13 14:32:37 +01:00
Christian Helmuth
182ba3a931 run/load/ipxe: prevent error on kill_spawned
... if the run script exits early.
2023-03-13 14:32:37 +01:00
Josef Söntgen
23cc96e661 wifi/pc: add firmware for the Intel AX210 2023-03-13 14:32:37 +01:00
Norman Feske
2e6dd010ae core: introduce 'Core' namespace
The namespace draws a clear line between the base library and the core
component.

It is declared at the new core-local header <types.h>, which is expected
to be included by all code of the core component. It is thereby a
natural place for kernel-agnostic general types like commonly used C++
utilities.

Fixes #4777
2023-03-13 14:32:37 +01:00
Josef Söntgen
487aad6db1 wifi: allow driver dump in error case
This commit implements dummies that would otherwise trigger a
'generated dummy' call that stops the driver.
2023-03-01 16:30:00 +01:00
Alexander Boettcher
98fa0a1ad2 wifi: don't use kzalloc directly
Avoid using wrong pointer when calling free_page() which causes
otherwise memory corruption.
2023-03-01 16:29:53 +01:00
Stefan Kalkowski
caef7d642a usb_block: enable WARN_STRICT_CONVERSION switch
Implicitely fixes problems with USB devices having more than 4G blocks.
Formerly the 16-Cmd LBA requests were silently casted to 32-bit.

Fix genodelabs/genode#4771
2023-03-01 16:28:55 +01:00
Christian Helmuth
57fcc7a25f version: 23.02 2023-02-28 15:11:55 +01:00
Norman Feske
f4cd47fa48 News item for version 23.02 2023-02-28 15:11:10 +01:00
Norman Feske
89e198204f Release notes for version 23.02 2023-02-28 15:11:10 +01:00
Christian Helmuth
e265cf6d49 depot: update recipe hashes 2023-02-27 08:22:51 +01:00
Roland Bär
470f07d462 Some documentation tweaks/cleanups
Fixes #4773
2023-02-27 08:22:50 +01:00
Christian Helmuth
a4d45921c6 Document event handling in acpi_event 2023-02-27 08:22:50 +01:00
Josef Söntgen
8145ff6303 qemu-usb: only copy data when packet succeeded
In case the packet is erronous the value of 'actual_size' can be
invalid and using it may lead to a page-fault due to out-of-bounce
access.

With this commit access is only performed on successful packets.

Fixes #4763.
2023-02-27 08:22:50 +01:00
Sebastian Sumpf
e2c334d6e4 linux: allow more workers when scheduling works
Workers are only summoned by the manager or when there are no workers on
a work queue. In case a work in front of a work queue depends on a work
behind it, a deadlock may occur. To solve this Linux spawns a rescue
worker using timers. Timing of Linux based drivers is currently reworked
and not reliable. Therefore, we increase the number of workers that are
spawned from 1 to 3 per work queue in order to resolve possible
deadlocks.

Fixes #4762
2023-02-27 08:22:50 +01:00
Alexander Boettcher
df27cc87b5 hw/x86: add suspend kernel syscall
using the ACPI mechanism. The syscall can be triggered solely via core's
RPC managing_system call.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
30c6feb86e hw/x86: re-init devices on resume
Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
1ea6708d84 hw/x86: prepare ACPI resume entry
Set wakeup pointer in FADT/FACS tables and prepare/place ACPI resume code
at application processors (AP) 16-bit entry. Exclude memory used for AP resume
from RAM range to avoid usage by Genode core in allocators.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
faf54244c4 hw/x86: keep cpu id after resume
The CPUs are woken all at once and up to now the IDs are assigned depending
on the arrival order, which is unfortunate for the resume case. Keep track
of once assigned IDs for CPUs, so that on resume the very same CPU id is given.
The APIC id is guaranteed to be fixed per CPU on suspend, but unfortunately
not dense packed.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
32b1aa605a hw/x86: add ACPI tables for resume
The ACPI table FACS and FADT are required to support ACPI suspend/resume. The
commits add the lookup of the ACPI table in bootstrap and the general usage
of the ACPI registers via the MMIO framework.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
dc1996d289 hw/x86: add interrupt controller re-init support
Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
1da71afbf3 hw: add Serial re-init/resume support
Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
5587476b4e hw: add Timer re-init/resume support
Add explicit init() to Timer infrastructure to re-initialize the hardware
based on the parameters given during constructing time of the timer object.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
1b5bfec8f9 hw: add CPU re-init/resume support
On resume the CPU state must be re-initialized, since all CPUs have been
potentially off (depending on sleep form) and lost state. Handle the halt
and suspend state explicitly by an extra Job implementation which can be
executed without holding the global kernel lock.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
a20a26b41b hw: add IPI type to flush and stop CPUs
as preparation before powering off the CPU

Issue #4669
2023-02-27 08:22:50 +01:00
Stefan Kalkowski
80453236c4 hw: don't depend on ARMv8 HCR, CPTR EL2 reg values
Instead of re-using the register values found in HCR_EL2 and CPTR_EL2
and setting single bits within them, define the complete content to
prevent inconsistent hardware/hypervisor state.

Ref genodelabs/genode#4759
2023-02-27 08:22:49 +01:00
Stefan Kalkowski
c5b9cabd89 vmm: enable effective C++ error switch
Several explicit casts could not be avoided yet, due to the missing
differentiation in between virtual and physical addresses that leads
to casting problems when using 32-bit ARM, and because the MMIO
register framework does not allow to return narrowed types of bitfields.

Apart from that, this commit fixes a switch-case fallthrough error in
Mmio_register::write.

Fix genodelabs/genode#4770
2023-02-27 08:22:49 +01:00
Stefan Kalkowski
adc594a7e6 os: remove conversion warnings/errors from virtio
The read_config and write_config functions in the generic virtio
headers used by all drivers lead to compiler warnings resp. errors
if effective-c++ switch is enabled. Moreover, the functions require
to define the access width as parameter. We can better turn them
into template functions using the value type to read resp. write to
derive the access width.

Ref genodelabs/genode#4344
2023-02-27 08:22:49 +01:00
Alexander Boettcher
ac69189e23 nova: support to re-enable IOMMU after ACPI resume
Issue #4669
2023-02-27 08:22:49 +01:00
Norman Feske
b044520344 Add missing includes of base/exception.h
This header used to be included implicitly by base/blocking.h, which
does no longer exist.

Issue #4768
2023-02-27 08:22:49 +01:00
Norman Feske
78b85339b0 vfs: buffer XML in <inline> file system
The use of 'Buffered_xml' removes the risk of the XML node's underlying
data to change during a component-config update.

Related to #4285
2023-02-27 08:22:49 +01:00
Norman Feske
6d25ffc70b Remove base/lock_guard.h
For Genode API users, the 'Mutex::Guard' is the way to go.
Special lock implementations can bring their own 'Guard' utilities.

Fixes #4769
2023-02-27 08:22:49 +01:00
Norman Feske
356506a67a base: remove base/blocking.h
This patch removes the obsolete exception type 'Blocking_canceled'.

Issue #4768
2023-02-27 08:22:49 +01:00
Norman Feske
32f9d1fceb os: remove server/input_event_bridge
This component was solely used during the transition of the
input-session to the event-session interface.

Fixes #4767
2023-02-27 08:22:49 +01:00
Norman Feske
b0e52ba7d4 util/misc_math.h: remove abs function
Fixes #4766
2023-02-27 08:22:49 +01:00
Norman Feske
e09941f310 Remove base/debug.h
Fixes #4765
2023-02-27 08:22:49 +01:00
Norman Feske
bdf47785b8 vfs: remove 'file_size' from read/write interfaces
The 'file_size' type denotes the size of files on disk in bytes. On
32-bit architectures it is larger than the size_t, which refers to
in-memory object sizes.

Whereas the use of 'file_size' is appropriate for ftruncate and seek, it
is not a suitable type for the parameters of read/write operations
because those operations refer to in-memory buffers.

This patch replaces the use of 'file_size' by size_t. However, since it
affects all sites where the read/write interface is uses, it takes the
opportunity to replace the C-style (pointer, size) arguments by
'Byte_range_ptr' and 'Const_byte_range_ptr'.

Issue #4706
2023-02-27 08:22:49 +01:00
Josef Söntgen
6e1517ca3c libdrm/lima: introduce disjunct contexts
Prior to this change the libdrm Lima implementation supported the
creation of multiple contexts where each context, however, was
treated as the same client like it was done in the Lima driver
itself.

With this commit each context becomes its own client while the
main context always performs all buffer object related allocation
and the other context import each needed BO before submitting.

Fixes #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
89f99df44d libdrm/lima: check buffer id in WAIT
Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
66fedecf34 libdrm/lima: handle unknown buffer ids gracefully
Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
46fc41ba50 libdrm/lima: rename Syncobj_space
Align the naming with the 'Gpu_context_space'.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
909b25db57 libdrm/lima: refactor session and context handling
Merge 'Gpu_session' and 'Gpu_context' and create the main session
as context.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
da32849ac2 libdrm/lima: move sync fd handling into DRM object
Converting from the sync-fd to the actual handle is internal
implementation detail.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
401da72a86 libdrm/lima: remove try-catch from ioctl call
Remove the exception handling as at this point all exceptions should
have been handled internally already.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
b8d8ff6d4d libdrm/lima: use sync-fd range beyond libc's reach
Sync file-descriptors a purely virtual and are not known by the libc and
should be only accessed by 'drm_poll'. To prevent accidental access move
them to range never used by the libc fd allocator.

Issue #4760.
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
c0e98f4481 base: fix conversion errors of smp timeout test
The cpu affinity index is an int no unsigned long within the interface
definition.

Ref genodelabs/genode#4344
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
e6c64290fa libpng_static: silent strncpy warnings
Ref genodelabs/genode#4344
2023-02-27 08:22:48 +01:00
Norman Feske
b88951345f depot: recipe for pkg/stdin2out 2023-02-27 08:22:48 +01:00
Norman Feske
07e3e09652 util/string.h: add 'Const_byte_range_ptr'
The new 'Const_byte_range_ptr' type is suitable as argument type that
refers to a read-only byte buffer, e.g., the source buffer of a write
operation.
2023-02-27 08:22:48 +01:00
Christian Helmuth
73f7f8aef6 dde_linux: generalize kmalloc_order() implementation 2023-02-27 08:22:48 +01:00
Sebastian Sumpf
0a8ac9fe4d gpu/intel: don't copy sesion cap for onwership check
We determine the owner of a Vram object by the session cap of the
session that created the object. We should not copy this cap to other
places because this increases reference counting, that can become very
large with many objects. Therefore, we pass a wrapper 'Owner' object
containing the cap by reference.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
34b2a83b84 gpu_session: add notes to interface
Describe differences for Intel and Lima (Mali) based GPUs.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
f1bc791c22 gpu_session: rename Gpu::Virtual_address:va
rename 'va' into 'value' to stay consistent with other types.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
d10c7c31a4 black_hole: adjust to VRAM GPU session interface
issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
8279038da2 lx_emul: provide _raw_read_lock/unlock functions
Required by i.MX8's gpu driver. '_raw_read_lock' was already present but
not implemented, add it's counter part as well.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
56e7e2ad53 libdrm/lima+etnaviv: adjust to VRAM GPU session interface
Keep buffer abstraction by mapping one buffer to one VRAM object.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
47f1eaac2a gpu/intel: add VRAM support
Remove buffer abstraction and replace it by VRAM objects.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
f72cb2b69b ibdrm/iris: add VRAM support
Allocate 16MB or larger chunks and implement buffer abstraction for Iris
which possible share VRAM.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
23b87929f5 libdrm/iris: remove unsused functions
* 'map_buffer', GTT mappings are currently not used by Iris
* 'set_tiling', tiling is currently not used by Iris because there are
  no GTT mappings

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
3260c86d15 gpu_session: VRAM interface
Change the abstraction from buffers to video RAM (VRAM). The notion of
buffers can be provided at the client side (e.g., Mesa) and multiple
buffers can be there be associated to one VRAM area, thus saving
resources (meta data overhead) when allocating many buffers. A VRAM area
can also be mapped to one single buffer as before for clients or drivers
that do not take advantage of this feature.

issue #4713
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
13453e3c68 hw: activate strict conversion checking in kernel
Fix genodelabs/genode#4753
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
da0dbd901c base: fix conversion error in Bitset_2::get()
Ref genodelabs/genode#4753
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
0212f94809 hw: eliminate -DNR_OF_CPUS, use constant instead
Fix genodelabs/genode#4752
2023-02-27 08:22:48 +01:00
Norman Feske
1d5fc3ef60 sculpt/depot: remove depot user trimpim
Fixes #4754
2023-02-27 08:22:47 +01:00
Norman Feske
c10904967b core: improve coding-style consistency 2023-02-27 08:22:47 +01:00
Martin Stein
5bdc88bf57 base-hw scheduler: sanitize access to invalid head
Issue #4755
2023-02-27 08:22:47 +01:00
Alexander Boettcher
c8cf33a251 sel4: flush vm pages on out of index pressure
re-create semantic as done before commit

"core: kernel-agnostic 'Mapping' type"

Issue #4751
2023-02-27 08:22:47 +01:00
Alexander Boettcher
d089e80906 sel4: handle non pagefault exceptions
by checking for it in core, submitting a signal (if registered) and not
replying instantly. Before this commit, an exception (a non page fault)
caused and endless "unknown exception" loop between originator and core.

This was handled before commit "core: kernel-agnostic 'Mapping' type" by
throwing an exception, which was with that commit not working anymore.

Fixes #4751
2023-02-27 08:22:47 +01:00
Sebastian Sumpf
79d389d812 base/ld: only assign .dynamic to the PT_DYNAMIC segment
Segment assignment stays valid for all sections following .dynamic,
which implies that .got and co also end up in the PT_DYNAMIC segment.
This is not intended.  Therefore, we move the .dynamic section before
bss and assign bss to the rw PT_LOAD segment only.

fixes #4750
2023-02-27 08:22:47 +01:00
Alexander Boettcher
76828f25c5 tool: bender with optional 'serial' UART discovery
By default, bender will not report any serial findings anymore, if not
explicitly asked for with the 'serial' option. Without this option, an
invalid ioport is reported, so that neither the kernel nor Genode core
will make serial output.
2023-02-27 08:22:47 +01:00
Norman Feske
62af32270b depot: remove empty config from pkg/nano3d
This allows for routing the nano3d config to a ROM services like
dynamic rom.
2023-02-27 08:22:47 +01:00
Norman Feske
291beb1145 depot: recipe for pkg/dynamic_rom 2023-02-27 08:22:47 +01:00
Norman Feske
dbf02ac3c1 depot: add runtime pkg for cpu_load_display 2023-02-27 08:22:47 +01:00
Norman Feske
6e20ffb990 gems: simple oscilloscope for audio input 2023-02-27 08:22:47 +01:00
Norman Feske
fa167bcdc4 gems: screenshot trigger for virtual print button
The screenshot trigger displays a little red dot at the upper-left
corner of the screen. When touched or clicked-on, it generates an
artificial key-press-release sequence for the print key and disappears
for one second. In this time, a separate screenshot component can handle
the print key by capturing the screen without the red dot appearing in
the saved picture.
2023-02-27 08:22:47 +01:00
Norman Feske
d26770eb40 gems/gui_buffer.h: grammar fix in comment 2023-02-27 08:22:47 +01:00
Norman Feske
4653e2eb3b touch_keyboard: make background configurable
The touch-keyboard config accepts the new attributes 'opaque="yes"
and 'background=#112233' to control the dialog background. The
attributes are passed unmodified to embedded the menu view.
2023-02-27 08:22:47 +01:00
Norman Feske
611efd9921 sculpt_manager: increase fs_tool buffer size
This speeds up the use of the fs_tool when installing system images.
2023-02-27 08:22:47 +01:00
Norman Feske
791c389923 sculpt_manager: allow image, image-index download
Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
6b3c7c9a6c sculpt_manager: 'File_operation_queue' enhancement
This patch add the support needed for implementing on-target
system-update functionality. The new 'empty' method is required for the
two-step procedure of updating image-index files - removing the old
index, followed by downloading the most current one. It is used to the
detect the completion of the first step.

Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
60a089d795 sculpt_manager: 'Download_queue' enhancements
This patch reflects more details such as the percentage value for
downloads maintained in the download queue. This makes this information
easier to display at the GUI.

Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
1f11e4b8db sculpt_manager: Popup_dialog::_scan_rom -> main
This change allows the consumption of the list of depot users by the
forthcoming system-update functionality.

Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
46eb175b17 sculpt_manager: detailed storage progress messages
This patch replaces the generic "In progress..." message by slightly
more concrete information about the type of operation. This is useful to
distinguish the two steps during the expansion of a partition.
2023-02-27 08:22:47 +01:00
Norman Feske
677c8e828c depot_download,depot_query: support system images
This patch enhances the depot_download subsystem with support for
downloading and querying system images.

The installation ROM support the following two now download types:

  <image_index path="<user>/image/index"/>
  <image       path="<user>/image/<name>"/>

Internally, the depot-download subsystem employs the depot-query
component to determine the missing depot content. This component
accepts the following two new queries:

  <images      user="..."/>
  <image_index user="..."/>

If present in the query, depot_query generates reports labeled as
"images" and "image_index" respectively.

The also tracks the completion of each job depending on the depot-
query results, so that the final report contains a result for each
installation item requested. Prior this patch, the inactivity of the
depot-download manager (indicated by an empty state report) was
interpreted as success. But that prevents the proper association of
results and requested installation items.

Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
b3bcab6c13 depot_query: split main.h from main.cc
This will allow for the implementation of 'Main' methods in .cc files.

Issue #4744
2023-02-27 08:22:47 +01:00
Norman Feske
866e84ec49 depot_query: supplement url to scanned user
The 'scan' query for depot users used to list the names of depot users.
However, the URL and existence of a pubkey is useful to know when
assembling a GUI menu from this list.

Issue #4744
2023-02-27 08:22:46 +01:00
Norman Feske
06a53abe68 tool/depot/publish: support system images
This patch equips the publish tool to handle system images.

System images reside at <depot-user/image/. The directory contains an
index file that contains the meta information of the available images
in XML form, e.g.,

  <index>
    <image name="sculpt-pinephone-2023-01-19" board="pinephone">
       <info text="initial version"/>
    </image>
  </index>

To publish a new version of the index:

  ./tool/depot/publish <depot-user>/image/index

Each system image comes in two forms, a bootable disk image and an
archive of the boot directory. The bootable disk image can be used to
install a new system from scratch by copying the image directly ot a
block device. It contains raw block data. The archive of the boot
directory contains the content needed for an on-target system update to
this version. Within the depot, this archive a directory - named after
the image - that contains the designated content of the boot directory
on target. Depending on the board, it may contain only a single file
loaded by the boot loader (e.g., uImage), or several boot modules, or
even the boot-loader configuration.

To publish both forms:

  ./tool/depot/publish <depot-user>/image/<image-name>

This results in the following - accompanied by their respective .sig
files - in the public directory:

  <depot-user>/image/<image-name>.img.gz  (disk image)
  <depot-user>/image/<image-name>.tar.xz  (boot archive)
  <depot-user>/image/<image-name>.zip     (disk image)

The .zip file contains the .img file. It is provided for users who
download the image on a system with no support for .gz.

Fixes #4735
Issue #4744
2023-02-27 08:22:46 +01:00
Norman Feske
3355d14b65 sculpt_image.run script for creating system images
Issue #4744
2023-02-27 08:22:46 +01:00
Norman Feske
4de71549d4 sculpt: supplement build info as boot module
This allows us to reflect the information about the running image to the
user.

Issue #4744
2023-02-27 08:22:46 +01:00
Norman Feske
2986d46fd3 fs_tool: add <copy-all-files> operation
Related to issue #4744
2023-02-27 08:22:46 +01:00
Norman Feske
7ada79b5ca Don't use deprecated Readonly_file::read variants
Issue #4745
2023-02-27 08:22:46 +01:00
Norman Feske
61a7671de1 os/vfs.h: read loop in Readonly_file::read
This patch improves the Readonly_file::read method such that the
capacity of the specified buffer is used as upper bound for the read
operation instead of VFS-internal I/O buffer sizes. This relieves the
caller from implementing a read loop in most cases.

As a step away from C-ish use of the API, the patch deprecates the old
'read' method that takes the buffer as char *, size_t arguments.

Fixes #4745
2023-02-27 08:22:46 +01:00
Norman Feske
345b77cfc9 menu_view: use Expanding_reporter for hover report
This allows for arbitrary large hover reports.
2023-02-27 08:22:46 +01:00
Norman Feske
3447d0ccb9 menu_view: avoid flicker when enlarging the view
Each time when enlarging the menu view, a new 'Gui_buffer' is
constructed with the new size. At its contruction time, the default
reset background color is in effect, which is evaluated by
'reset_surface' as part of the construction. A custom reset color
takes effect only after the construction. Hence, when the Gui_buffer is
flushed to screen immediately at construction time, the gray default
becomes visible for a short time.

This patch changes the Gui_buffer to accept the reset background color
as construction argument so that it takes immediate effect.

Related to #4592
2023-02-27 08:22:46 +01:00
Norman Feske
11ff774f72 tool/run/image/disk: find resize2fs in /usr/sbin
This patch adjusts the run/image/disk plugin to search for resize2fs in
/usr/sbin, which is not included in the PATH variable on Debian by
default.

Issue #4746
2023-02-27 08:22:46 +01:00
Christian Helmuth
21a9527686 pc/wifi: remove redundant Genode:: prefix 2023-02-27 08:22:46 +01:00
Christian Helmuth
de9ea43616 dde_linux: remove custom lx_backtrace (use lx_emul_backtrace) 2023-02-27 08:22:46 +01:00
Christian Helmuth
52fb4eee5f pc/wifi: restore optional MAC-address reporting
Issue #4133
2023-02-27 08:22:46 +01:00
Alexander Boettcher
208547e3af tool/grub2: factor out common part
to avoid divergence

Issue #4741
2023-02-27 08:22:46 +01:00
Alexander Boettcher
c3843cd0d6 image/disk: factor out common boot parts
to avoid divergence

Issue #4741
2023-02-27 08:22:46 +01:00
Alexander Boettcher
eb354be20d image/uefi: factor out common boot parts
to avoid divergence.

Issue #4741
2023-02-27 08:22:46 +01:00
Christian Helmuth
264ee999a1 acpi_event: generalize config for any key
Fixes #4748
2023-02-27 08:22:46 +01:00
Christian Helmuth
3403a91213 input: provide keycode-by-name lookup
The new utility returns a key code for a passed name and is implemented
by linear search, which is slow but sufficient in situations like config
updates.

Issue #4748
2023-02-27 08:22:45 +01:00
Alexander Boettcher
e8424e19fa vbox_share: increase resources for tcp_terminal 2023-02-27 08:22:45 +01:00
Christian Prochaska
f1b048c595 qt5: up-mix mono audio output data in QtWebEngine OSS backend
Fixes #4747
2023-02-27 08:22:45 +01:00
Christian Helmuth
e17d104c0a mk: restore compatibility to Make 4.1
The leading newline in the _capture function confused _filecontent,
which resulted in empty port hashes.

Fixes regression introduced in 437fd21ba0
(issue #4725).
2023-02-27 08:22:45 +01:00
Christian Prochaska
9dbaa150d6 gnu_build.mk: pass static libraries in '-l:' format
Fixes #4743
2023-02-27 08:22:45 +01:00
Alexander Boettcher
0724db2d80 sel4: avoid out_of* in several run scripts
caused by platform_drv and report_rom
2023-02-27 08:22:45 +01:00
Alexander Boettcher
d2f27a34f7 nova: avoid fault during thread migration
triggert by cpu_balancer.run on Qemu

Fixes #4742
2023-02-27 08:22:45 +01:00
Alexander Boettcher
93e26cae35 grub2: add small default font
Issue #4741
2023-02-27 08:20:46 +01:00
Christian Helmuth
84c5a7b0cd vfs_lwip: receive payload without breaking refcount
lwip uses a sophisticated reference-counting scheme in chains of pbufs,
which the former manual implementation of read() for TCP data broke.
Using pbuf_free_header() keeps the chain intact and also relieves our
implementation from the burden of "offset" maintenance.

Fixes #4722
2023-02-27 08:20:46 +01:00
Christian Helmuth
7858c00539 test/tcp: ascending integer mode
Add alternative (statically configurable) mode to fill the test data
with ascending integers for increased debugability.

Issue #4722
2023-02-27 08:20:45 +01:00
Christian Helmuth
297947bec7 Cleanup netty network tests
Issue #4722
2023-02-27 08:20:45 +01:00
Johannes Schlatow
4d0cb175da base-hw: use global timer on Cortex A9
genodelabs/genode#4360
2023-02-27 08:20:45 +01:00
Josef Söntgen
777b093cad sculpt_manager: add RTL8188EE FW routes
Issue #4714.
2023-02-27 08:20:45 +01:00
Josef Söntgen
578a8c9918 wifi/pc: add rtlwifi driver
Due to lacking hardware access the driver was test with one RTL8188EE
based device, namely [10ec:8179] (rev 01), only. As the access to the
PCI config space is restricted the driver loads the non power-saving
FW and the driver port is therefor only tested with that. The
accesses are documented should we choose to support them one way or
another later on.

The 'wifi.run' run script as well as Sculpt served as testing ground
where the driver worked fine so far.

Fixes #4714.
2023-02-27 08:20:45 +01:00
Josef Söntgen
e826095e71 legacy/lx_emul/usb: handle saturated submit queue
Check if we are able to submit the Usb packet before attempting to
allocate it. In case the queue is already full we wait until another
pending packet is freed.

Fixes #4701.
2023-02-27 08:20:45 +01:00
Josef Söntgen
25d0dc19d5 nvme_drv: provide get/set feature command
These admin commands are used to configure features of the NVMe device.

Issue #4715.
2023-02-27 08:20:45 +01:00
Josef Söntgen
00a6d1306c nvme_drv: allow for accessing admin cmd results
Up to now it was only checked if an issued admin command was processed
in a timely fashion. Otherwise it has been treated as failed.
However, the completion-queue entry was not examined and the caller was
not able to access the entry itself. Depending on the command, checking
the completion-queue entry might be necessary, e.g. GET/SET_FEATURE.

Issue #4715.
2023-02-27 08:20:45 +01:00
Josef Söntgen
9f9bed7aa8 nvme_drv: move PRP list helper construction
Since the 'Platform::Device' constructor will defer the creation until
the content of the devices ROM is valid performing the PRP list helper
creation afterwards should be done with valid IOMMU information.

Issue #4715.
2023-02-27 08:20:45 +01:00
Norman Feske
76a99015c1 Mention genodians.org in top-level README 2023-02-27 08:20:45 +01:00
Benjamin Lamowski
faf37b51e7 dde_linux: backport fix for use-after-free reported by GCC 12
On my system, compiling dde_linux fails with `-Werror=use-after-free`.
Backport the fix from mainline to get rid of the issue.

Fixes #4740
2023-02-27 08:20:45 +01:00
Josef Söntgen
1f8438a6ae tool_chain: check ncursesw as well
Fixes #4699.
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
bfa90ab3e8 vmm: make initramfs an optional feature
Fix genodelabs/genode#4723
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
80687e702c vmm: implement VirtIO input model
Fix genodelabs/genode#4698
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
85c8bd7d7e vmm: implement VirtIO GPU model
Ref genodelabs/genode#4698
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
f2188bd397 vmm: silent several VirtIO config accesses
Ref genodelabs/genode#4698
2023-01-24 12:21:21 +01:00
Christian Helmuth
9de81369a7 libusb: retry configuration-descriptor retrieval
Some USB devices (e.g., webcams) fail to deliver their configuration
descriptor early after power-up. Testing revealed that retrying the
requests usually succeeds on second or third attempt.

Fixes #4739
2023-01-24 12:18:18 +01:00
Christian Helmuth
da673cfad7 tool/depot: replace wget by curl to support file:// URLs
File-scheme URLs permit users to host downloadable archives (which may
be sync'd by other means beforehand) on the local file system.

Fixes #4737
2023-01-24 12:18:16 +01:00
Christian Helmuth
07d02f8d46 tool/port: access to metadata of ports
Fixes #4685
2023-01-24 12:17:24 +01:00
Alexander Boettcher
4ab52aaf12 acpica: access ACPI IRQ via Platform "acpi" device
Issue #4679
2023-01-24 12:14:29 +01:00
Christian Helmuth
2353082bda pci_decode: report ACPI SCI IRQ in acpi device
Issue #4679
2023-01-24 12:14:23 +01:00
Christian Helmuth
53c2cff331 acpi: report ACPI tables and SCI IRQ
Issue #4679
2023-01-24 12:10:17 +01:00
Alexander Boettcher
661330a97a acpica: add dependency on acpi device
Issue #4679
2023-01-24 12:09:19 +01:00
Alexander Boettcher
dca71dbad9 pci_decode: add acpi device
Use it as point to defer clients (e.g. ACPI-CA) until platform driver could
claim all resources.

Issue #4679
2023-01-24 12:09:16 +01:00
Christian Helmuth
25eac6b9e6 depot: update recipe hashes 2023-01-24 12:07:33 +01:00
Norman Feske
3561ff90e9 sculpt_manager: remove unused Storage::dialog
This member variable remained unused since we moved the storage dialog
into the component graph.
2023-01-24 12:07:33 +01:00
Norman Feske
ffb8321e57 sculpt_test.run: add '-boot d' to Qemu args
When using '--include image/iso', we want to ensure that the virtual
machine boots from CD-ROM.
2023-01-24 12:07:32 +01:00
Christian Prochaska
ff8f7875f3 qt5: make physical screen size info configurable
Fixes #4733
2023-01-24 12:07:32 +01:00
Christian Prochaska
14483f64fd qt5: apply fix for QTBUG-83895
Fixes #4732
2023-01-24 12:07:32 +01:00
Sebastian Sumpf
437fd21ba0 mk: use _file_content instead of echo | cat
Use _file_content function to retrieve port hash instead of 'echo | cat'
construct that lead to 'Broken pipe' erros in GNU Make 4.4.

issue #4725
2023-01-24 12:07:32 +01:00
Tomasz Gajewski
d33139c40a enable ccache for reference Linux kernel
Genode build system allows to easily enable 'ccache' for builds. This
change allows to enable using 'ccache' also for build of reference
Linux kernel used during porting device drivers.

To enable 'ccache' it is enough to pass value of 'CC' variable when
executing Linux build but this build by default depends on time when it
is built which causes 'ccache' misses. To solve this issue additional
flags are passed to make build independent from time, current user and
host on which build is performed.

Issue #4718
2023-01-24 12:07:32 +01:00
Norman Feske
114238c248 sculpt_manager: query presets
This patch queries the files at config/presets/ in addition to
config/launcher using the existing launcher_query component.

Issue #4731
2023-01-24 12:07:32 +01:00
Norman Feske
88becbe29d sculpt: integration of optional presets
With the new 'presets:' tag, .sculpt files can now refer to deploy
configurations to be integrated in the presets/ subdirectory of the
config file system. Those files can thereby be used as preconfigured
system scenarios. Such a preconfigured scenario can be loaded at
runtime by copying the preset file to config/deploy.

Issue #4731
2023-01-24 12:07:32 +01:00
Norman Feske
a7a5c5ce54 run/image/uboot: move uImage to boot/
This patch changes the 'run_image' function to replace a boot/image.elf
file by the corresponding boot/uImage file.

Issue #4730
2023-01-24 12:07:32 +01:00
Alexander Boettcher
c06f5e2661 nova: flush on iommu context change (intel)
Fixes #4717
2023-01-24 12:07:32 +01:00
Alexander Boettcher
41865e6c30 nova: avoid oom fault on cross CPU
Fixes #4719
2023-01-24 12:07:32 +01:00
Alexander Boettcher
5f0ba7d722 intel_fb: handle rapid config change gracefully
In case of very rapid config ROM change (<300ms), the linux driver may still
be in progress of applying the previous change (e.g. switching connector on/off).

During this progress all tasks may become not runnable (waiting for IRQ/timeouts
until hardware state settles), the newest config ROM change/signal gets
dispatched, which lead to continuing the previous change request, but not
to re-starting/re-applying the new config change. To avoid this situation,
explicitly track whether a previous config change was finished and track if an
interim config change request came in. If so, re-start the lx_user
task with the newest config change.

Fixes #4721
2023-01-24 12:07:32 +01:00
Norman Feske
41ebf3bd94 run: remove argument from 'run_image' function
The argument is superfluous because only run/image/uboot evaluated it
anyway, and the argument is always boot/image.elf. With this change, the
official semantics of run_image become: "replace the boot/image.elf file
by platform-specific file(s) at boot/ that can actually be booted".

Issue #4730
2023-01-24 12:07:32 +01:00
Martin Stein
eba22b7551 nic_router: rework updating of TCP/UDP links
* Update links from forward rules only with forward rules and links from
  transport-routing rules only with transport-routing rules. Besides raising
  the performance of the code, this also fixes a former bug that allowed
  forward-rule links to falsely stay active because of a transport-routing
  rule that matched the client destination ip and port.

* Don't use good-case exceptions for updating TCP/UDP links on re-configuration
  of the router.

* Make conditions when to dismiss a forward rule easier to read.
  * Introduces != operator to the public Port class in the net library.

* Fix unnecessary log message that a link was dismissed when only a potentially
  matching forward rule turned out to be not matching.

* Apply Genode coding style to if statements with a single body statement.

Fix #4728
2023-01-24 12:07:31 +01:00
Martin Stein
845694bc44 nic_router: fix updating UDP/TCP links
This fixes a bug that was introduced by this earlier commit:

"nic_router: find forward rules w/o exceptions"

The NIC router used to falsely dissolve TCP/UDP connection states when
reconfiguring although the connection states were still legal according to the
new config. The reason was that the above mention commit nested lambdas but
missed to return from the last nesting level when having found a configuration
that legitimates the connection state.

Ref #4728
2023-01-24 12:07:31 +01:00
Roman Iten
17e4e2497f tool/depot: don't overwrite PATH variable
Issue #4725
2023-01-24 12:07:31 +01:00
Sebastian Sumpf
515854a19f tool/depot: adapt to .NOPARALLEL changes in GNU make 4.4
The semantic of .NOPARALLEL has changed in GNU Make 4.4

Quote:

New feature: .NOTPARALLEL accepts prerequisites If the .NOTPARALLEL
special target has prerequisites then all prerequisites of those targets
will be run serially (as if .WAIT was specified between each
prerequisite).

This means that only prerequisites are made sequential. Before
everything within a Makefile would be done in sequential order.

Therefore, we had to add the *.hash target (appears multiple times) to
the .NOPARALLEL prerequisites.

issue #4725
2023-01-24 12:07:31 +01:00
Norman Feske
d86309957e Road map for 2023 2023-01-24 12:07:31 +01:00
Benjamin Lamowski
641fadb3e9 base-hw: remove memory hole in bootstrap page table
Tests on qemu would fail when started with RAM sizes from 1025MiB to
2048MiB, because the the mapping hole in the page table from 1GiB to
2GiB would interfere with qemu's mapping addresses for ACPI.

Identity-map the complete first 4GiB of memory to catch all early
memory accesses during bootstrap.

Fixes #4724.
2023-01-24 12:07:31 +01:00
Norman Feske
79d8d1d557 sculpt_manager: Deploy::use_as_deploy_template
This patch simplifies the 'Deploy::update_managed_deploy_config'
interface by keeping an internal copy of the currently used deploy
template inside the 'Deploy' class. The template is updated whenever
the config/deploy file is modified.

This change weakens the coupling between the '_manual_deploy_rom' and
the '_deploy' subsystem, easing the upcoming implementation of the
switching between presets.
2023-01-24 12:07:31 +01:00
Norman Feske
bf231f7fca sculpt_manager: use update_list_model_from_xml
This patch replaces the use of 'List_model::Update_policy' types by
simpler 'update_list_model_from_xml' function calls.

Issue #4317
2023-01-24 12:07:31 +01:00
Norman Feske
39ca06114b sculpt_manager: keep launchers in 'Dictionary'
This patch replaces the direct use of an 'Avl_tree' by the modern
'Dictionary' utility.
2023-01-24 12:07:31 +01:00
Norman Feske
be7022dadc util/dictionary.h: alphabetically sorted for_each
This patch reverses the AVL-tree criterion to let 'for_each' traverse
the elements in alphabetical sorting order.

Issue #4610
2023-01-24 12:07:31 +01:00
Norman Feske
0e311845bf base-hw: don't show ROM modules at boot time
On complex scenarios like Sculpt on the phone, this change noticeably
reduces the boot time.

Issue #4705
2023-01-24 12:07:31 +01:00
Martin Stein
c665f4e51d base-hw scheduler test: add to autopilot
Fix #4151
Fix #4710
2023-01-24 12:07:31 +01:00
Martin Stein
68afbbc0f0 base-hw scheduler test: print method
Adds befriended test-local wrappers for the classes Cpu_share and Cpu_scheduler
and adds a print method to the scheduler wrapper that prints the internal state
of the scheduler to the given output. Cpu_shares are referenced in the output
via a the IDs that the test uses to organize them. I.e., this corresponds to
how the CPU shares are named when calling the atomic steps the test is made of.

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
f60a004cff base-hw scheduler test: rename test.cc main.cc
Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
20fea7fdd2 base-hw scheduler test: adapt to new behavior
This adapts the test to the changes that were applied to the scheduling scheme
by the following commits:

* base-hw scheduler: optimize quota depletion events
* base-hw scheduler: fix bug on removing head
* base-hw scheduler: fix ready method
* base-hw: optimize & cleanup scheduler

Part of that is that the test used to check whether the act of setting a share
ready outdates the head or not. However, with the current version of the
scheduler, this check is not possible anymore. We can merely check whether the
head is outdated after setting the share ready. So, among other adaptions, this
commit adapts the expectations of the test to the new semantics of the check.

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
615dd377dd base-hw scheduler test: clean up
* Get rid of preprocessor macros.
* Introduce Main as class.
* Exit with -1 instead of endless loops on errors.
* Don't try to deal with error conditions, just print a message and exit
  with -1.
* Only one operation per line.

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
0467b4aaf3 base-hw scheduler: optimize quota depletion events
This is an optimization for the case that a prioritized scheduling context
needs slightly more time during a round than granted via quota. If this is the
case, we move the scheduling context to the front of the unprioritized schedule
once its quota gets depleted and thereby at least ensure that it does not have
to wait for all unprioritized scheduling contexts as well before being
scheduled again.

Note that this introduces the possibility of undeserved starvation of
unprioritized scheduling contexts to the scheduling scheme. If there are
enough prioritized contexts that deplete their quota during a round,
they may cover up also the rest of the round with their unprioritized time
slices. If this happens every round, contexts without a priority/quota may
never get a turn. In the previous scheduling scheme, this could not occur as
the unprioritized schedule was completely independent from prioritized
schedules and rounds.

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
f74962bdad base-hw scheduler: fix bug on removing head
The scheduler did not consider the consumed quota during a call to "update"
if the head that consumed the quota was removed from the scheduler. When this
occured, the internal round time did not advance as expected but remained at
its previous value untile the next call to "update" (without a removed head)
This commit introduces a new flag that is set only when the head gets removed
in order to detect and handle the situation correctly on the next call to
"update".

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
ab298b6337 base-hw scheduler: fix ready method
Setting the _need_to_schedule member in the 'ready' method of the scheduler
was not done correctly. At least, the _need_to_schedule was set true in
situations were the head was not outdated by the 'ready' operation.

Ref #4151
2023-01-24 12:07:31 +01:00
Stefan Kalkowski
1151706243 hw: rename functions of Ipc_node class signature
* Remove *request* in context of: wait, reply, send to shorten it.
* Use ready_to_* instead of can_*, which is regularily used in Genode's APIs
* Replace helping_sink with helping_destination, as destination is more common

Ref genodelabs/genode#4704
2023-01-24 12:07:30 +01:00
Stefan Kalkowski
fd3c70ec5b hw: mark threads as dead in case of ipc violations
The IPC protcol violations are:

* Sending to an unknown thread (cap)
* Waiting for messages if a reply hasn't happened yet

This silents threads that otherwise repeatedly cause kernel messages
about the violation.

Ref genodelabs/genode#4704
2023-01-24 12:07:30 +01:00
Stefan Kalkowski
fc690f1c47 hw: re-work the ipc node's internal state machine
* Split the internal state into incoming and outgoing message relations
* Avoid fragmenting of one state like formerly '_state' and '_help'
* Remove pointer to caller, use incoming FIFO instead

This commit fixes at least two bugs that were triggered by tests that
destroy threads in many different states, like run/bomb:

* The '_help' data member was not reset reliable in each situation where a
  helping relationship came to an end. However, when we fixed this bug alone
  in the old state model, the issues remained. The new state model fixes
  this bug as well.

* A thread sometimes referenced an already dead thread as receiver. This caused
  the kernel IPC code to access the vtable of an object that didn't exist any
  longer. Note that the two threads were not in direct IPC relationship while
  the receiver was destroyed, so, there must have been an intermediate node
  between them. Due to the complexity of this problem, we eventually gave up
  pin-pointing the exact reason in the kernel IPC code. The issue disappeared
  with the new state model.

Fix genodelabs/genode#4704
2023-01-24 12:07:30 +01:00
Josef Söntgen
5a558a64e1 gpt_write: use GPE LBA from header
When writing the GPT header, the tool always wrote the GPT entries
belonging to the primary header to LBA following the header. Normally
this is LBA 2 as the header is located in LBA 1. The GPT allows for
up to 128 entries that all in all cover 16 KiB of storage space.
However, on some systems, e.g. ARM-based machines, the bootloader can
be stored in this region. For this reason the GPT entries may be moved
to a different LBA.

This commit changes the tool to adhere to then given GPE LBA in header
when writing out the modified GPT data.

Fixes #4720.
2023-01-24 12:07:30 +01:00
Norman Feske
ddeaccf728 vfs: documentation of Vfs::Env::User
Issue #4706
2023-01-24 12:07:30 +01:00
Christian Prochaska
09c1a9cfc0 qt5: don't pass non-printable unicode values on key repeat
Fixes #4716
2023-01-24 12:07:30 +01:00
Norman Feske
25e4bcefbf vfs: remove 'Io_response_handler' interface
The old 'Io_response_handler::io_progress_response' interface has been
replaced by the 'Vfs::Env::User::wakeup_vfs_user' (issue #4697). The
remaining 'read_ready_response' method is now hosted in the
appropriately named 'Read_ready_response_handler'.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
74e6370187 cbe/vfs/trust_anchor_vfs.h: avoid 'Constructible' 2023-01-24 12:07:30 +01:00
Norman Feske
53b67810ba vfs/cbe_trust_anchor: Remove Io_response_handler
This patch keeps driving the internal state machines until no progress
can be made. This required fixing the return values of several execute
functions, which used to report progress while being in complete state.

Along the way, the patch removes default switch cases to ensure that all
states are covered.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
909c3571e3 vfs/cbe: Remove use of Io_response_handler
The patch also touches app/cbe_init because it depends on the
public cbe/vfs/trust_anchor_vfs.h header.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
6c79e95052 vfs_replay: Remove Io_response_handler
Note that this change has not been tested as we have no ready-to-use
run script stressing this component.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
f56883e238 cbe_init_trust_anchor: Remove Io_response_handler
Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
f4da21252b cbe_tester: Remove use of Io_response_handler
Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
bb904b9166 vfs: propagate I/O activity via 'wakeup_vfs_user'
This commit supplements the various I/O signal handlers of the VFS
plugins with calls of the new 'Vfs::Env::User::wakeup_vfs_user'
interface, which will subsequently replace the old 'Io_progress_handler'
(issue #4697).

Issue #4706
2023-01-24 12:07:30 +01:00
Stefan Kalkowski
767632e1af dde_linux: remove leftovers of legacy fec_nic_drv
Some relicts in `repos/dde_linux/lib`.

Ref #4651
2023-01-24 12:07:30 +01:00
Norman Feske
782fad0b41 vfs/lwip: remove 'blocked_handles' queue
The 'blocked_handles' queue was used to notify the VFS user via the
'io_progress_response' mechanism. This is now covered by the
'wakeup_vfs_user' interface introduced in issue #4697.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
9a2c03d2c6 vfs: remove Read_result::READ_ERR_INTERRUPT
The error condition was too vague and thereby remained unused in
practice.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
ba78cf72ae vfs: remove Read_result::READ_ERR_AGAIN
The condition is covered by READ_ERR_WOULD_BLOCK.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
1aba073e32 vfs: remove File_io_service::General_error
Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
a1fb51e050 vfs: remove File_io_service::register_read_ready
Issue #4706
2023-01-24 12:07:30 +01:00
Christian Helmuth
e483fc2525 nova: remove frame size compiler warnings 2023-01-24 12:07:30 +01:00
Christian Helmuth
89b0eca383 wm: ensure eight views fit into slab block
Issue #3834
2023-01-24 12:07:29 +01:00
Christian Helmuth
bccc57bb29 Adapt run scripts for Intel Xe GPU 2023-01-24 12:07:29 +01:00
Christian Prochaska
0c465fbb4d trace session: fix double quota accounting
Fixes #4707.
2023-01-24 12:07:29 +01:00
Christian Helmuth
b4f6f796d6 Clear board/pc/devices
Information about PS/2 and PIT where moved to app/pci_decode in the
following commit.

  pci_decode: report devices from ACPI info

We still provide an empty <devices> node as the file itself is used by
platform agnostic run scripts.
2023-01-24 12:07:29 +01:00
Norman Feske
0fefee804c vfs: remove File_io_service::ioctl interface
This interface has been obsoleted by the use of pseudo files,
implemented in the context of issue #3519.

Issue #4706
2023-01-24 12:07:29 +01:00
Stefan Kalkowski
08c56e61e1 hw: avoid overhead for cache maintainance
When running on x86, and riscv never enter the kernel for cache maintainance,
but use the dummy implementation of the generic base library instead.

On ARMv8 it is not necessary to enter privileged mode for cache cleaning, and
unification of instruction/data cache, but only for invalidating cache lines
at all levels, which is necessary for the use cases, where this function it
needed (coherency of DMA memory).

Fix genodelabs/genode#4339
2023-01-24 12:07:29 +01:00
Josef Söntgen
66fd027b96 base-hw: introduce 'cache_line_size' call
This call is used to query the cache line size of the underlying CPU.
For now it is only implemented and used by 'arm_v8' platforms.

It does not distinguish between D-/I-cache sizes and always uses the
smallest size. Furthermore it does not account for any discrepancy
in 'big.little' CPUs.

Issue #4339.
2023-01-24 12:07:29 +01:00
Josef Söntgen
e8f748cfed base-hw: unprivileged cache maintenance on ARMv8
Set 'Sctlr_el1::Uci' bit to allow for executing cache clean and
invalidate instruction from user space.

Issue #4339.
2023-01-24 12:07:29 +01:00
Stefan Kalkowski
8fe7fa5532 hw: don't take the log backend's mutex in kernel
To prevent the kernel to deadlock, or call itself with a syscall when
using a lock potentially hold by a core thread, the log console's
backend for core (hw) gets replaced by a specific variant that checks
whether it runs in the kernel context before using the mutex.

Fix genodelabs/genode#3280
2023-01-24 12:07:29 +01:00
Christian Helmuth
b59ec55d50 lx_emul: provide irqsave/restore write-lock functions 2023-01-24 12:07:29 +01:00
Christian Helmuth
6d14f5442e lx_emul: provide more pci functions
- pci_dev_present() based on devices on bus
- pci_request_regions() as dummy
- pci_release_regions() as dummy
2023-01-24 12:07:29 +01:00
Norman Feske
0fa683f244 vfs/cbe_trust_anchor: add sanity check
This patch adds a null-pointer check to the '_close_handle' method,
which triggers when using the vfs_cbe.run script in interactive mode.
2023-01-24 12:07:29 +01:00
Norman Feske
ca0d3757cc vfs: make 'File_io_service::read_ready' const
... and replace pointer argument to const reference.

Issue #4706
2023-01-24 12:07:29 +01:00
Martin Stein
1b1a9ca95c nic_router: fix bad connection states on IP change
When a domain receives a new dynamic router IP address and that domain has
active connection states (TCP/UDP/ICMP) from another domain with NAT applied,
the connection states used to stay active while becoming obsolete. They
become obsolete because their identification and their packet processor
use the old routers IP address due to NAT.

One consequence was that connections became dysfunctional when the server
domain received a new dynamic router IP address. Request packets were still
routed from client to server, but when entering the server, their source IP
address was the outdated router address. Consequently, the server responses
used the outdated address as destination and the router dropped the responses
because it did not know this address anymore.

This commit fixes the problem by letting a domain destroy all its connection
states that were initiated from within other domains whenever it detaches from
its current IP configuration.

Strictly speaking, it is not necessary to destroy all connection states, only
those that the domain applies NAT to. However, the Genode AVL tree is not built
for removing a selection of nodes and trying to do it anyways is complicated.
So, for now, we simply destroy all connection states.

Note that the other way around was handled correctly already. When a domain
detaches from its IP config, all interfaces of that domain destroy all the
connection states they created (towards other domains).

Fixes #4696
2023-01-24 12:07:29 +01:00
Martin Stein
7a7cac57d9 nic_router: futile ip config updates on dhcp renew
If the IP config does not change on updates to the router IP config of a domain
change (a common case on DHCP RENEW), prevent detaching from the old config and
attaching to the new one. Because this would not only create unnecessary CPU
overhead but also force all clients at all interfaces that are listening to
this config (via config attribute 'dns_config_from') to restart their
networking (re-do DHCP).

Ref #4696
2023-01-24 12:07:29 +01:00
Christian Prochaska
68ba648897 libdrm/lima: fix double file descriptor close
Fixes #4703
2023-01-24 12:07:29 +01:00
Christian Prochaska
16ce6b7acc mesa/lima: don't call 'close()' for non-libc fd
Fixes #4702
2023-01-24 12:07:29 +01:00
Sebastian Sumpf
2c92fc4b6f vbox6: add null pointer check for clipboard
Check 'pv == nullptr' in 'ShClSvcImplWriteData' and return
VERR_INVALID_POINTER if invalid (as is done, for example, in the X11
implementation).

issue #4666
2023-01-24 12:07:29 +01:00
Christian Helmuth
41d0c89a52 libc: remove misleading SNDCTL_DSP_RESET error message
Fixes #4676
2023-01-24 12:07:29 +01:00
Norman Feske
e5272b65a1 vfs: remove unused Fs_file_system::_read method 2023-01-24 12:07:29 +01:00
Josef Söntgen
8384d7b5ed run/acpica: fix devices report route
Issue #4679.
2023-01-24 12:07:29 +01:00
Josef Söntgen
794b019a8a sculpt/launcher: add top launcher 2023-01-24 12:07:29 +01:00
Josef Söntgen
aed3b6c6be Add test-audio_out pkg recipe 2023-01-24 12:07:29 +01:00
Josef Söntgen
14d0b72f52 black_hole: add report session support 2023-01-24 12:07:28 +01:00
Josef Söntgen
03165c96cc Add cpu_burner pkg recipe 2023-01-24 12:07:28 +01:00
Josef Söntgen
a96c7ebd8d cpu_burner: only use timer when not 100 perecent 2023-01-24 12:07:28 +01:00
Josef Söntgen
916d45b450 os: add top pkg recipe 2023-01-24 12:07:28 +01:00
Christian Helmuth
a16eeeec5d nova: set initial TSC after all CPUs are ready
Issue #4669
2023-01-24 12:07:28 +01:00
Norman Feske
2a1240d1e9 base: provide generic cpu/string.h
This patch uses the formerly x86-specific cpu/string.h for all
architectures if no spec/<arch> variant exists.

Issue #4456
2023-01-24 12:07:28 +01:00
Norman Feske
0ebb572f48 pkg/test-libc_connect_lwip: increase server RAM 2023-01-24 12:07:28 +01:00
Norman Feske
ff2176a586 vfs,libc: support write fds in select
By adding a 'write_ready' interface following the lines of the existing
'read_ready', VFS plugins become able to propagate the (de-)saturation
of I/O buffers to the VFS user. This information is important when using
a non-blocking file descriptor for writing into a TCP socket. Once the
application observes EAGAIN, it expects a subsequent 'select' call to
return as soon as new I/O buffer space becomes available.

Before this patch, the select call would always return under this
condition, causing an unnecessarily busy write loop.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
5ad98f2b7c vfs,libc: introduce Vfs::Env::User interface
The new interface is meant to replace the 'Vfs::Io_response_handler'.
In contrast to the 'Io_response_handler', which had to be called
on a 'Vfs_handle', the new interface does not require any specific
'Vfs_handle'. It is merely meant to prompt the VFS user (like the libc)
to re-attempt stalled I/O operations but it does not provide any
immediate hint, about which of the handles have become ready for
reading/writing.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
cf87b0fadb vfs: simplify File_io_service::write return values
This patch removes the 'Insufficient_buffer' exception by returning the
WRITE_ERR_WOULD_BLOCK result value instead. It also eliminates the
superfluous WRITE_ERR_AGAIN and WRITE_ERR_INTERRUPT codes.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
d9f5dda322 lwip: increase TCP send buffer 32->80 packets
Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
0584ac195c curl: increase maximum write-buffer size
The original size of 16K impedes the batched processing of network
packets. Changing the value to 256K reduces the number of context
switches when downloading large files and thereby improves the
throughput by more than 25% (base-hw on qemu_x86_64, using fetchurl
to download a file of 100 MiB via the NIC router from lighttpd).

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
8a9974b6f9 vfs/lwip: deferred wakeup of NIC server
This patch fosters the batching of network packets transferred by the
lwIP stack over the NIC connection. It replaces the eager submission of
the packet-stream's data-flow signals by explicit wakeup notifications.

The commit also increases the NIC session's buffer size from 128 to 1024
packets.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
60175631df vfs/lwip: remove obsolete mutexes
Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
5fdacae88b vfs: remove obsolete mutexes
...and tighten constness in adjacent code parts.

The VFS-internal synchronization via mutexes is no longer needed because
the access to the VFS is serialized by the VFS client, i.e., the libc.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
fcf5fcd58c libports: remove stand-alone variant of lwIP
Since the lwip library is used only by the vfs_lwip plugin, this patch
moves the Genode-specific support code local to the VFS plugin, easing
further simplification and allowing for a tighter integration with the
VFS plugin.

The recipes for api/lwip and src/vfs_lwip stay separate as both parts
use different licenses.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
e9541605ab ports: lighttpd_fetchurl.run script
This networking scenario is useful for analysing and optimizing the
interplay of the VFS, libc, TCP/IP, and the NIC router. It downloads a
file via fetchurl from lighttpd, both of which are hosted on a virtual
network.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
7d8d4f4532 vfs,libc: deferred wakeup of remote peers
This patch facilitates the batching of I/O operations in the VFS library
by replacing the implicit wakeup of remote peer (via the traditional
packet-stream interface like 'submit_packet') by explicit wakeup
signalling.

The wakeup signalling is triggered not before the VFS user settles down.
E.g., for libc-based applications, this is the case if the libc goes
idle, waiting for external I/O.
In the case of a busy writer to a non-blocking file descriptor or socket
(e.g., lighttpd), the remote peers are woken up once a write operation
yields an out-count of 0.

The deferring of wakeup signals is accommodated by the new 'Remote_io'
mechanism (vfs/remote_io.h) that is designated to be used by all VFS
plugins that interact with asynchronous Genode services for I/O.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
9421a449ab test/libc_many_writes for examining write batching
This test reveals the patters of the batching of consecutive write
operations on a file-system session. It issues 100 writes of one byte
each, which should ideally result in large batches of operations
submitted to the file-system session at once.

The run script performs the write operations through a chain of two VFS
servers, thereby exercising the write batching of both the libc and the
intermediate VFS server.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
6edede0db9 server/vfs: facilitate batching of requests
By replacing the calls of 'acknowledge_packet' and 'get_packet' with
'try_ack_packet' and 'try_get_packet', we avoid the implicit triggering
of data-flow signals. Instead, the VFS server now relies on explicit
calls of the packet stream's 'wakeup' interface.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
a15c894385 file_system_session: increase TX_QUEUE_SIZE to 32
The change of the queue size from 16 to 32 has negligible costs (4 KiB
instead of 2 KiB for the packet-stream queues) while facilitating the
batching of many small consecutive write operations.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
9c57157e44 Audit VFS-plugin improvements
- Log read and write operations
- Fix leaf_path implementation
- Support queue sync

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
9a662249eb vfs_cbe_init.run: adapt to use of libcrypto 2023-01-24 12:07:27 +01:00
Christian Helmuth
772f89e77f linux.port: xhci patch to fix "unknown event type 37"
Issue #4678
2023-01-24 12:07:27 +01:00
Christian Helmuth
8661936d7d base: aquire context mutex in local_submit()
Some signal-heavy scenarios (e.g., libc_integration) produced the
following warning that hinted a data race on signal data in the context
object.

  Warning: returning signal with num == 0

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

  424ed1b79a libc: remove Reconstructible / use local_submit in kernel

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

Issue #3923
2023-01-24 12:07:27 +01:00
Alexander Boettcher
377f2166a1 nova: support detection of Intel P & E CPUs
Fixes #4694
2023-01-24 12:07:27 +01:00
Christian Helmuth
83ac80460e depot: update recipe hashes 2022-12-05 16:37:21 +01:00
Christian Helmuth
ed9a8299b2 run/image/uboot: merge with uboot_fit
Both modules were quite similar except the the name of the FIT image
(image.itb) and the mkimage command line. FIT images are now produced by
the following RUN_OPT.

  RUN_OPT += --include image/uboot --image-uboot-fit

Issue #4693
2022-12-02 11:08:59 +01:00
Norman Feske
a9383dfa79 run/image/uboot: use gzip --fast by default
By making the use of gzip's '--best' option configurable and disabling it
by default, this patch noticably reduces the built-test cycle from 15 to
10 seconds when integrating the Sculpt system image for the PinePhone.

Fixes #4693
2022-12-02 11:08:58 +01:00
Martin Stein
f10c470969 sculpt_manager: fix router label lookup
The commit "sculpt_manager: relax nic_drv policy label" introduced the use of
the "label_prefix" attribute instead of "label" for the uplink policy in the
NIC router. However, it missed an appropriate adaption of the lookup of that
attribute when the Sculpt manager has to decide which uplink is used in a
manually managed router config. This caused the uplink to disappear whenever a
user created a manually managed router config. This commit fixes the problem.

Issue #4660
Fixes #4695
2022-12-02 09:54:33 +01:00
Norman Feske
f3fc11713a sculpt: re-enable inspect view by default
The inspect view got accidentally disabled by commit "sculpt: make graph
features configurable".
2022-12-01 13:51:58 +01:00
Christian Helmuth
4c5db31110 base: ld-<platform>.abi.so depends on symbol.map
This prevents errors like the following during parallel builds.

      MERGE    ld-hw.abi.so
  /usr/local/genode/tool/21.05/bin/genode-arm-ld:symbol.map:0: syntax error in VERSION script
2022-12-01 11:47:32 +01:00
Norman Feske
2dae1e0504 Adjust image name in release_notes/22-11.txt 2022-11-30 14:39:49 +01:00
Christian Helmuth
f44b16eaa3 version: 22.11 2022-11-30 14:02:24 +01:00
Christian Helmuth
aa2f61fa0e depot: update recipe hashes 2022-11-30 14:02:24 +01:00
Norman Feske
65135f5f7a News item for version 22.11 2022-11-30 13:58:37 +01:00
Norman Feske
faa1e6f1b2 Release notes for version 22.11 2022-11-30 13:58:36 +01:00
Norman Feske
0048ff2a2f doc: updated components.txt 2022-11-30 13:58:36 +01:00
Norman Feske
168aa04c85 doc: minor fix in release notes of version 22.08 2022-11-30 13:58:36 +01:00
Christian Helmuth
b033b30f95 depot: update recipe hashes 2022-11-29 12:32:49 +01:00
Christian Helmuth
5ff8e7cadf lx_emul: use usb_unlink_urb() in timeout handler
Replace usb_kill_urb() by usb_unlink_urb() in the timeout handler for
control URBs, as usb_kill_urb() may block and is not allowed to be
called in IRQ/bottom half contexts.

Fixes #4681
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
5cff81fc29 usb c_api: prevent exception on full ack queue
Count more accurately how much packets are in flied, and whether
new packets can be handled. Moreover, catch potential exceptions
whenever acknowledging a packet, and warn about the lost acknowledgement.

Fix genodelabs/genode#4678
2022-11-29 12:29:57 +01:00
Alexander Boettcher
8ddd93ec27 vbox: avoid uncaught nic Empty_ack_queue exception
Fixes #4677
2022-11-29 12:29:57 +01:00
Christian Prochaska
331a2e39eb qt5: reduce warning messages from QPA plugin
Fixes #4692
2022-11-29 12:29:57 +01:00
Josef Söntgen
15f75216c7 libdrm/lima: serialize poll and ioctl with mutex
There is at least one client that performs DRM calls from multiple
pthreads, which is not supported for now. We guard the concurrent
access by grabbing a pthread_mutex before each operation.
2022-11-29 12:29:57 +01:00
Christian Prochaska
f4b06be24b fetchurl: handle leading '/' in '_process_fetch()'
Fixes #4691
2022-11-29 12:29:57 +01:00
Christian Prochaska
ffb48ed030 extract: handle leading '/' in 'create_directories()'
Fixes #4690
2022-11-29 12:29:57 +01:00
Alexander Boettcher
a91467f3a8 platform_drv: support enforced 1:1 DMA mapping
Follow up commit of

"platfrom_drv: map DMA memory non-natural when iommu is present"

Issue #4665
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
b596db3eed pistachio: size-aligned I/O mem mapping in core
This commit circumvents faulty behaviour of base-pistachio, if
the PCI config space gets requested megabyte-wise. It occurs that
we get a mapping sequence in between sigma0, core and component,
like the following: 0xe1000000 => 0xbf001000 => 0x10b000,
with the consequence that the component stalls when accessing
the latter one. By requesting I/O memory aligned to the size,
the faulty behaviour vanishes.

Ref #4686
2022-11-29 12:29:57 +01:00
Christian Helmuth
424ed1b79a libc: remove Reconstructible / use local_submit in kernel 2022-11-29 12:29:57 +01:00
Christian Prochaska
acb6bbb649 hw: fix 'Kernel::time()' deviation in RISC-V timer
Issue #4360
2022-11-29 12:29:57 +01:00
Christian Prochaska
345c01677d hw: fix 'Kernel::time()' deviation in ARM generic timer
Issue #4360
2022-11-29 12:29:57 +01:00
Christian Prochaska
866df56131 libc: handle empty path string in file I/O functions
Fixes #4689
2022-11-29 12:29:57 +01:00
Christian Prochaska
5d62429164 libc: check path pointer in 'symlink' and 'unlink'
Fixes #4688
2022-11-29 12:29:57 +01:00
Johannes Schlatow
132906c925 platform_drv: update ROM in device_by_type()
This is required for scenarios in which a device appears at a later
point in time. If the ROM is not updated, the device_by_type() method may
operate on an outdated dataspace and never find the device it is waiting for.
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
f6825eea5f pci_decode: increase default ram quota
To circumvent problems of the page-table entries getting short on sel4,
increase the RAM quota for this component in all run-scripts.

Fix #4686
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
10aa5ebf03 pci_decode: report devices from ACPI info
Although we do not have the full ACPI information parsed yet, to
announce non-PCI devices derived from the ACPI tables, the device
description of the assumed devices is now integral-part of pci_decode.
Formerly, the information was gained separatedly as boot-module, whereby
we lost synchronization in between ACPI/PCI parsing, BIOS handover, and
PS/2 emulation code already acting.
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
c9efcfab17 sntp_dummy_rtc: add depot package recipe
This recipe combines the dummy_rtc_drv, which consumes a given time,
and provides the "Rtc" service to its clients with the simple NTP client,
which provides the current time to the RTC driver in regular intervals.

Ref genodelabs/genode#4687
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
7cb19ee2b3 sntp_client: add depot src recipe
Ref genodelabs/genode#4687
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
9e61fb90c5 Remove legacy platform_drv, API, and platform.inc
Fix genodelabs/genode#4671
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
08378dd148 libports: remove platform_drv.inc from run-scripts
Ref genodelabs/genode#4671
2022-11-29 12:29:56 +01:00
Stefan Kalkowski
de083efcf2 os: remove platform_drv.inc from run-scripts
* block_tester.run: use Linux only
* vfs_block: was not dependent on platform_drv anyway

Ref genodelabs/genode#4671
2022-11-29 12:29:56 +01:00
Stefan Kalkowski
3274270951 os: remove audio_out_click run-script
Almost a duplicate of repos/dde_bsd/run/audio_out.run

Ref genodelabs/genode#4671
2022-11-29 12:29:56 +01:00
Alexander Boettcher
224b766eb1 add acpi suspend test scenario
Test to trigger periodically ACPI suspend and resume and periodically
trying to restart graphic driver.

Tested successfully with X201 and T420.

Issue #4669
2022-11-29 12:29:56 +01:00
Alexander Boettcher
dee178aae5 acpica: execute suspend&resume ACPI methods
on 'system' ROM state changes.

Issue #4669
2022-11-18 14:46:04 +01:00
Alexander Boettcher
58ff53ec52 acpica: report S0-S5 sleep state support
Issue #4669
2022-11-18 14:46:04 +01:00
Alexander Boettcher
fd2a216909 base: support ACPI suspend via Pd::managing_system
Issue #4669
2022-11-18 14:45:27 +01:00
Alexander Boettcher
03470e7bab nova: use kernel with suspend/resume support
Issue #4669
2022-11-18 14:45:27 +01:00
Norman Feske
565be454aa Mention Johannes' VM guide in Sculpt documentation 2022-11-18 08:47:15 +01:00
Stefan Kalkowski
7ebe09fbf7 pci_decode: limit PCI config space mappings
Map only one PCI bus at once when parsing the PCI buses.

Fix genodelabs/genode#4686
2022-11-17 17:22:58 +01:00
Roman Iten
da60200377 libports: use GitHub mirror for fatfs
It looks like http://www.elm-chan.org is blocking certain IP ranges,
because downloading the source archive on certain machines fails with
"403 Forbidden".

Fixes genodelabs/genode#4623
2022-11-17 15:35:58 +01:00
Alexander Boettcher
790e81349f mixer.run: adjust to new platform driver
Issue #4656
2022-11-17 14:48:26 +01:00
Josef Söntgen
4bacba431b nvme_drv: do not mask interrupts
During interrupt handling the driver masked and cleared interrupts as
recommended in the spec to prevent spurious or unnecessary interrupts
from occurring.

Due to the way the current implementation operates new Block requests
got submitted while handling completions for already finished ones.
Since interrupts where masked at this point the controller did not
generate interrupts when the newly submitted requests got completed.

As the mask/clear optimization is apparently not strictly needed and
according to the spec undefined when using MSI-X it is removed.

Fixes #4684
2022-11-17 14:45:57 +01:00
Christian Helmuth
c58d799f16 depot: update recipe hashes 2022-11-17 08:00:37 +01:00
Christian Helmuth
25d7970b6f depot: fix README of pkg/usb_modem_drv 2022-11-17 08:00:37 +01:00
Sebastian Sumpf
3250f1951b vbox6: gim system time update measurement
200 TSC ticks for max measurement duration can get too small on platforms
with high TSC frequencies (e.g., >3GHz) and low CPU frequencies often
caused by HWP configurations. Therefore, we express the measurement
duration in NS (not ticks) and calculate max duration ticks using the
TSC frequency. This way the max duration becomes independent of the TSC
frequency.

fixes #4672
2022-11-17 08:00:37 +01:00
Stefan Kalkowski
b78b543011 vmm: make ARM VMM configureable
This commit enables users of the VMM to define CPU type and count, RAM size,
kernel and initrd ROM names, GIC version, and Virtio devices to be used.
Derived from the configuration values a flattened device-tree blob (DTB) is
generated and transfered to the VM.

Fix genodelabs/genode#4670
2022-11-17 08:00:37 +01:00
Benjamin Lamowski
0e9a49d1cf wifi/pc: add firmware for the Intel AX211
Lenovo Thinkpads with 12th gen Intel i7 CPUs such as the X1 Nano G2 may
contain such a wifi card.

Issue #4663
2022-11-17 08:00:37 +01:00
Benjamin Lamowski
e46a7dd6f5 dde_linux: fix Intel Intel AX211 wifi without MSI-X
Lack of MSI-X support in DDE Linux causes a timeout when the Intel AX211
tries to call back into the driver while loading the PNVM file while
interrupts are still disabled.

With the patch picked up from QubesOS the card works on an X1 Nano G2:
5fcfe0f19e

Issue #4663
2022-11-17 08:00:37 +01:00
Benjamin Lamowski
04efe88044 wifi/pc: add support for loading PNVM files
Intel wifi cards in the AX210 family need additional PNVM firmware to
function properly. Enable the bundling and loading of *.pnvm files.

Issue #4663
2022-11-17 08:00:37 +01:00
Benjamin Lamowski
bcea2a958e wifi/pc: implement firmware requests without warning
Until now, requesting optional blobs such as 'iwl-debug-yoyo.bin' has
just failed silently. To support desired blobs such as PNVM firmware,
implement the loading of optional firmware while preserving the nowarn
characteristics of the function.

Issue #4663
2022-11-17 08:00:37 +01:00
Sebastian Sumpf
0a8d6ddba9 core: Ignore constraints on allocations if allocator is exhausted
Try to allocate within constraint area first. In case the area is exhausted,
try allocation at other memory locations.

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

issue #4665
2022-11-17 08:00:37 +01:00
Sebastian Sumpf
77fc2f1e86 platfrom_drv: map DMA memory non-natural when iommu is present
Consume '<iommu/>' tag from 'devices' report. In case an IOMMU is
present map physical memory to arbitrary locations within IO page table
range 1K-4G. This way every device PD has access to ~4GB of DMA space.

issue #4665
2022-11-17 08:00:37 +01:00
Sebastian Sumpf
b66987e1ce base-nova: export iommu feature from HIP to platform_info
issue #4665
2022-11-17 08:00:37 +01:00
Christian Helmuth
a89eb5e7e3 Increase acpi_drv RAM/CAP quota in USB tests
The amount of 7M/350 matches repos/gems/sculpt/drivers/pc.
2022-11-17 08:00:37 +01:00
Johannes Schlatow
f5ab6ea7ae libports: update expat to 2.5.0
Fixes #4662
2022-11-17 08:00:37 +01:00
Christian Prochaska
d323072bb6 libc: build 'libc-string' library with -O3
Fixes #4658
2022-11-17 08:00:37 +01:00
Josef Söntgen
3936fe25dc sculpt: fix VESA framebuffer driver integration
The platform driver configuration is missing the required 'info'
attribute that allows the 'vesa_fb_drv' to map the proper I/O
memory address of the framebuffer. In addition the driver requires
at least '2' more CAPs, so raise the quota to '110'.

Fixes #4668.
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
0b569ed8c7 mesa/iris: remove binder patch
There is one binder with one memory zone per OpenGL context. The patch was
needed before because Genode didn't have proper context support (separate page
tables) leading to binders from one or more context being allocated to the same
GPU address with the same page tables. This was clearly an error and is fixed
with context support.

issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
c0367fc30e libdrm/iris: synchronization
The Morph browser seems to access libdrm multi-threaded. Put this into a
separate commit in order to revert it easily.

issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
25c1cdec95 libdrm/iris: GEN12+
* timestamp fequency
* topology

issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
aafe9ae2d6 sculpt: add Intel Xe GPU (Tigerlake)
issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
2aa01e309c gpu/intel: GEN12+
* clock frequency
* topology
* exec lists
* IRQ handling
* improved resource management

issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
852d21db14 vbox6: print error in case machine powerup fails
Retrieve error message (best effort and might fail) from progress
information.

issue #4666
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
8bd548416d sculpt: increase drivers caps for fuji4 (has ahci and nvme)
One test notebook has an AHCI and NVMe controller and reaches the quota
limit in Sculpt.

issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
f76f5db2fa drivers: use DMA buffer more consistent
Replace 'alloc_dma_buffer' by 'Dma_buffer'

issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
ff6b2bffdc ahci: use Dma_buffer instead of 'alloc_dma_buffer'
issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
22460525a0 platform_session/dma_buffer: remove 'retry_with_upgrade'
'retry_with_upgrade' is called by 'platform_session/connection.h' ->
'alloc_dma_buffer' already.

issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
1b66b1bd7c platform_drv: check quota before dma allocations (taken from legacy)
'_env_ram' allocations can lead to
'Expanding_pd_session_client::try_alloc' quota upgrades, which in turn
may lead to a resource request by the platform driver. Therefore, we
check the available quota within the platform driver before allocations.
This is not an optimal solution.

issue #4667

related issue #3767
2022-11-17 08:00:36 +01:00
Stefan Kalkowski
03a142174f os: add dummy RTC driver package 2022-11-17 08:00:36 +01:00
Norman Feske
bbcca835a5 sculpt: make graph features configurable
This patch makes the component graph better reusable for the phone
version of Sculpt. In the phone version, the '+' menu does not exist.
So we need to omit the corresponding button. Furthermore, the storage
dialog is presented in a dedicate section of the GUI instead of
presenting it inside the 'storage' graph node. The phone version
also does not offer the inspect view. So we need to omit the
corresponding buttons.
2022-11-17 08:00:36 +01:00
Stefan Kalkowski
7cb0986c1f rtc_drv: extend src package to dummy driver 2022-11-17 08:00:36 +01:00
Josef Söntgen
e507f1438a libports: add mesa_gpu-lima recipe
Similar to the others 'mesa_gpu' pkgs add one for 'lima'.
2022-11-17 08:00:36 +01:00
Christian Helmuth
49b07f898e qemu-usb: remove diagnostic error message 2022-11-17 08:00:36 +01:00
Christian Helmuth
a579e92400 wifi.run: configure /dev/urandom as libc RNG 2022-11-17 08:00:36 +01:00
Christian Helmuth
1593b64680 vbox: reduce noise of some unimplemented fucntions 2022-11-17 08:00:36 +01:00
Johannes Schlatow
f78710a4ea Fix version typo in Sculpt documentation 2022-11-17 08:00:36 +01:00
Stefan Kalkowski
bc5663f1a3 os: remove obsolete i.MX framebuffer session
Ref genodelabs/genode#4661
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
3082950e74 usb_session: align USB packet allocation correctly
To prevent caching side-effects of USB DMA memory taken from the packet stream
all allocations of USB packets need to be on separated cachelines at least.

Fix genodelabs/genode#4655
2022-11-17 08:00:35 +01:00
Josef Söntgen
b03059b933 dde_linux: allow GPIO state access
To complement the GPIO support allow for setting and reading input
pins. So far this is needed by drivers that attempt to perform I2C
bit-banging via GPIO pins.

Fixes #4624.
2022-11-17 08:00:35 +01:00
Josef Söntgen
85f98d7038 dde_linux: provide __phys_to_pfn for arm64
This macro is needed by the 'pinephone_camera_drv' driver port.

Fixes #4625.
2022-11-17 08:00:35 +01:00
Alexander Boettcher
95ee0f58f2 sculpt: enforce max width/height by configuration
Issue #4659
2022-11-17 08:00:35 +01:00
Alexander Boettcher
eb318d5ceb intel_fb: handle too large framebuffer allocation
In case the allocation fails for the largest possible connector mode,
try smaller modes. Additional add option to specify maximal resolution.

Issue #4659
2022-11-17 08:00:35 +01:00
Alexander Boettcher
72217a6771 intel_fb: support larger resolutions
Increase "assumed" internal kernel memory size based on available memory
to support allocation of framebuffer larger than 16M, which was before
hardcoded.

Issue #4659
2022-11-17 08:00:35 +01:00
Alexander Boettcher
5df68922eb linux/pc: enable IOMMU config for intel fb
to apply scanout scratch page GTT workaround

drivers/gpu/drm/i915/gt/intel_ggtt.c
 -> gen8_gmch_probe() -> intel_scanout_needs_vtd_wa(i915)

Fixes #4659
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
bb067f529b sculpt_manager: relax nic_drv policy label
When using the newer genode_c_api uplink library, an uplink connection uses
the device name as label, which enables integrators to use different policies
resp. routes for different devices driven by one driver. The nic_drv policy
of the nic_roouter configuration generated by the sculpt_manager however uses
an empty label like: "nic_drv -> ". This is the way how existent NIC drivers,
like ipxe_nic_drv requested their uplink session. To support both driver
variants this commit relaxes the policy by checking for a prefix only.

Ref genodelabs/genode#4660
2022-11-17 08:00:35 +01:00
Norman Feske
3b06a27465 sculpt: add pin_session and pin_control resources 2022-11-17 08:00:35 +01:00
Norman Feske
49b4b8597d os/pin_driver: support for time-multiplexed in/out
This patch equips the pin-driver framework with support for the
time-multiplexed operation of a pin as output or input. This is needed
when implementing I2C communication via a bit-banging driver.

To operate pin in both directions, a driver obtains both a pin-state and
a pin-control session for the same pin. The pin-state session can be
used to sense the current pin state. The control session allows the
client to set the pin to high or low (using the 'state' method), or to
set it to high-impedance via the 'yield' method. Once switched to
high-impedance, the pin can be used as input.

Issue genodelabs/genode-allwinner#10
2022-11-17 08:00:35 +01:00
Christian Prochaska
cd8538da9a qt5: apply pull request, change screen pixel format to RGB32
Fixes #4657
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
73fec3bdb7 sculpt: add ROM route to nic_drv's DTB
Ref genodelabs/genode#4652
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
11a6117da6 genode_c_api: add config update to block interface
Ref genodelabs/genode#4653
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
d8d9f94075 base-sel4: implement clean cache operations
This commit uses the seL4_BenchmarkFlushCaches syscall to partly implement
cache maintaince for this kernel.

Ref genodelabs/genode#4651
2022-11-17 08:00:35 +01:00
Christian Helmuth
a670c2a674 Download expat from GitHub
The tar.gz archive of version 2.4.9 vanished from sourceforge. As the
project moves to GitHub currently and the archive of 2.4.9 is still
available there, just update the download location.

Content and hashes did not change.
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
01e1e4e5b9 platform_drv: add "leave_operational" attribute
If a device should not be reset, powered off, and its clocks
shall stay untouched when it gets released, the leave_operational
attribute can be set to true in the device node of the related
device inside the devices ROM delivered to the platform driver.
This is useful for drivers, which only enable and initialize
their device, and can be closed afterwards.

Ref genodelabs/genode#4654
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
f0315b2715 dde_linux: remove legacy fec_nic_drv
Ref genodelabs/genode#4651
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
018c562447 lx_emul: refine configurations & memory attributes
Ref genodelabs/genode#4651
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
9482355c47 lx_emul: allow different irqchip declarations
To enable other irqchip declarations beyond the lx_emul generic code base,
make the ARM specific initialization routine public.

Ref genodelabs/genode#4651
2022-11-17 08:00:34 +01:00
Johannes Schlatow
b2189ae88b vfs/log: block indefinitely on read access
With this change, the log file system mimics the behaviour of
/dev/stdin.

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

Fixes #4647
2022-11-17 08:00:34 +01:00
Christian Helmuth
9c136f66d4 ieee754: adjust RAM quota to sel4 2022-11-17 08:00:34 +01:00
Christian Helmuth
5a06a9dec1 lx_emul: provide pci_try_set_mwi() 2022-11-17 08:00:34 +01:00
Christian Helmuth
9467d4cb0b pci_decode: initial device-report buffer of 32K
This prevents multiple generation attempts with undersized buffers on
recent hardware, which needs at least 12K.
2022-11-17 08:00:34 +01:00
Christian Helmuth
d5577421f8 wireguard: create dir before generating asm file
Prevents errors like follows.

  /bin/bash: arch/arm64/crypto/poly1305-core.S: No such file or directory
  make[4]: *** [.../genode/repos/dde_linux/lib/mk/spec/arm_64/wireguard_lx_inc_dirs.mk:17: arch/arm64/crypto/poly1305-core.S] Error 1
2022-11-17 08:00:34 +01:00
Christian Helmuth
df4c4d5be2 base: check for used blocks in Allocator_avl
The check is required for alloc_addr() as the desired range may already
be backed by a used block.
2022-11-17 08:00:34 +01:00
Johannes Schlatow
4dee72a487 sculpt: fix shape-report routing in deploy example
The deploy example mistakenly applied label rewriting for the pointer-shape
report.

Fixed genodelabs/genode#4645
2022-11-17 08:00:34 +01:00
Sebastian Sumpf
cd08cd54a4 usb_block_drv: allow for using UAS devices via BOT
Reintroduce:

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.

Additionally:

Perform configuration reset upon sessions close in order to bring USB
device to a well defined state.

fixes #4494
2022-11-17 08:00:34 +01:00
Christian Helmuth
ab7101e3d2 ahci_block: fix timer route in test
Thanks to Cedric for the patch.

Fixes #4644
2022-11-17 08:00:34 +01:00
Alexander Boettcher
7ebd3a086a nova: avoid reset on machines with too many CPUs
The NOVA kernel and Genode's roottask core are configured to be runnable
with up to 64 CPUs (MAX_SUPPORTED_CPUS in core resp. NUM_CPU in kernel).
On machines with more CPUs a reset occurred. The commit checks for this
case, bootstraps the first 64 CPUs only, and sends all other CPUs to
sleep.

Also, the platform_info ROM size is increased to host information about
more than 32 CPUs.

Issue #4640
2022-11-17 08:00:34 +01:00
Norman Feske
c0fddd0a14 nitpicker: drop double press/release events
Fixes #4639
2022-11-17 08:00:34 +01:00
Stefan Kalkowski
759ed40d98 hw: implement MSI support for x86
Fix genodelabs/genode#4633
2022-11-17 08:00:34 +01:00
Johannes Schlatow
5e4e634625 libs: use select_from_ports in eager assignments
If `select_from_ports` is evaluated lazily, we might miss a port during
the dependency check. A way to prevent this is to use the `:=` operator.

Fixes genodelabs/genode#4618
2022-11-17 08:00:34 +01:00
Christian Helmuth
c086eb088d vmm_x86: guest code page in separate asm file
Implement the guest code in dedicated assembler source file, assemble
and link the binary to vmm_x86. The resulting guest-code binary
populates one page that is mapped to host the reset vector of the guest.

This approach simplifies future guest code adaption resp. extension,
e.g., to test rdmsr/wrmsr exiting.

Fixes #4638
2022-11-17 08:00:34 +01:00
Christian Helmuth
2edf02dccb themed_decorator: break link dependency to theme
plain_decorator_theme.tar is not linked to the app but must be generated
as side effect. Therefore, use CUSTOM_TARGET_DEPS to trigger the
generation.

Fixes #4637
2022-11-17 08:00:33 +01:00
Alexander Boettcher
00ac4afb9f acpica: make battery report working for thinkpads
tested on T460p, X201, T470p

by periodically checking and reporting.

Issue #4631
2022-11-17 08:00:33 +01: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
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
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
Christian Helmuth
83f5dd8a8b pc/wifi: shared library depends on symbol.map
CUSTOM_TARGET_DEPS does not trigger relinking the lib but recreates the
.tag file only.
2022-06-02 09:33:27 +02:00
Norman Feske
6326774056 mk: trigger CUSTOM_TARGET_DEPS from 'all' rule
Build description files that feature both an actual target and
CUSTOM_TARGET_DEPS happen to re-link the target each time whenever one
of the CUSTOM_TARGET_DEPS is phony, e.g., gems/src/app/menu_view/.
The re-linking of the actual target is of course not desired. By
triggering the creation of CUSTOM_TARGET_DEPS from 'all:' instead of
'$(TARGET)', the specified files do not implicitly become link
dependencies of the target.

Issue #3972
2022-06-01 17:37:44 +02:00
Christian Helmuth
b6d313bbe6 version: 22.05 2022-05-31 13:34:17 +02:00
Norman Feske
dc0a0e0700 News item for version 22.05 2022-05-31 12:23:28 +02:00
Norman Feske
33a51ee20d Release notes for version 22.05 2022-05-31 12:23:28 +02:00
Christian Helmuth
a037fac5c5 depot: update recipe hashes 2022-05-31 10:52:11 +02:00
Stefan Kalkowski
e6602d527c lx_emul: remove duplication of ZERO_PAGE for ARM
The extra definition introduced by commit:
"lx_emul & arm: define ZERO_PAGE" re-defined the macro included
by a header of the contrib sources. This commit removes the
contrib header and defines thereby missing macros.
2022-05-31 10:52:11 +02:00
Stefan Kalkowski
d213cfa897 lx_emul: fix spinlock header for ARM
Fixes wrong atomic_*(ptr) usage with u32 pointer introduced by
commit "lx_emul: eliminate wrong include pathes". Atomic read or
write is nt needed in our case, we always schedule cooperatively.
2022-05-31 10:52:11 +02:00
Christian Helmuth
f4dabf08e2 Fix nested run in vbox5_genode_usb_hid_raw
Since "Consolidate USB test run-scripts" usb_hid_raw.run depends on
depot archives. Therefore, '--depot-dir' and '--depot-user' must be
passed to the nested run tool to cover cases that customize the depot
(e.g., our nightly CI).

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

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

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

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

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

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

Thanks to Peter for bringing this problem to our attention.

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

Fixes #4516.
2022-05-25 12:23:04 +02:00
Johannes Schlatow
c38b71146b trace_buffer: only iterate after initialization
There is a race between the trace subject doing the buffer
initialization and the monitor trying to iterate the buffer entries. If
the monitor tries to iterate entries of an uninitialized buffer, it will
read the very first entry twice. The monitor should therefore only start
iteration when the buffer has been initialised.

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

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

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

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

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

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

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

:Warning:

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

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

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

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

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

:Warning:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fix genodelabs/genode#4386
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
d0694b3e0b platform_drv: separate devices info from config
Fix genodelabs/genode#4491
2022-05-25 12:19:32 +02:00
Christian Helmuth
f032bdf81c legacy_platform_drv: configurable PCI BAR remapping
If PCI devices happen to miss complete configuration after boot, the
platform driver supports <pci-fixup> nodes for concrete devices
(specified by bus-device-functions tuples). The
<bar> node instructs the platform driver to remap BAR id 0 to address
0x4017002000, which amends the BIOS configuration and is stringently
required for BARs with address 0.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  5fed1641a4 virtualbox6: reduce 'Vm_connection' priority

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

issue #4466
2022-04-13 09:29:03 +02:00
Sebastian Sumpf
da1ef67064 base: Allocator_avl cleanup meta data
After reverting unused ranges during allocator destruction
'_meta_data.free_empty_blocks' may lead to more unused ranges because
meta data blocks maybe freed where the meta data for the blocks is
managed by other meta data blocks. This leads to dangling allocation
warnings which are caused by meta data. Therefore, we call
'_revert_unused_ranges' and 'free_empty_blocks' until no more ranges
can be freed.

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

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

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

Issue #4450
2022-04-13 09:29:03 +02:00
Johannes Schlatow
e955444302 ports/coreutils: ignore inodes when copying
genodelabs/genode#4461
2022-04-13 09:29:03 +02:00
Johannes Schlatow
410099df70 base/memset: speedup implementation
Compared to the bytewise memset, a wordwise memset (or even multi-word)
achieves a speedup of ~6.

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

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

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

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

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

genodelabs/genode#4456
2022-04-13 08:08:01 +02:00
Johannes Schlatow
052c33fc8c test/cache: refine test pattern
- run multiple access patterns (touch words, touch lines, memcpy)
- add make file for linux

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    <start name="trace_logger"/>

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

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

  Report 4

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

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

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

  ...

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

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

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

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

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
be0a1742ac base: distinct TRACED from ATTACHED trace subjects
This patch makes the trace-subject state as reflected to the trace
monitor more accurate.

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

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

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

Fixes #4447
2022-04-13 08:07:58 +02:00
Norman Feske
f3984ba5a9 base: declare build artifact for core
This is a generalization of the recent commit "base-hw: declare build
artifact for core".
2022-04-13 08:07:58 +02:00
Norman Feske
34a3209e9b base/log.h: add GENODE_TRACE_TSC
The new macros GENODE_TRACE_TSC and GENODE_TRACE_TSC_NAMED complement
the existing GENODE_LOG_TSC and GENODE_LOG_TSC_NAMED macros to simplify
TSC measurements at a low overhead of the trace mechanism.
2022-04-13 08:07:57 +02:00
Norman Feske
232a45bc14 os: add util/formatted_output.h utilities
The utilities of the new util/formatted_output.h header complement the
existing base/output.h with the text-formatting support needed to
produce tabular output.

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

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

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

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

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

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

Issue #4388
2022-03-21 13:42:17 +01:00
Johannes Schlatow
f4d0f1624a test/trace: use for_each_new_entry
genodelabs/genode#4434
2022-03-21 13:42:17 +01:00
Johannes Schlatow
c763890f04 trace_buffer: partition trace buffer
Split the trace buffer into two partitions in order to prevent overwriting
of entries when the consumer is too slow. See file comment in buffer.h.

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

genodelabs/genode#4434
2022-03-09 12:08:02 +01:00
Johannes Schlatow
d24552f5e2 trace/policy: fix event size in log_output
Returning 0 for max_event_size() can lead to writing out of buffer bounds.

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

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

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

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

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

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

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

Original commit provided by Josef Soentgen

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

Fix genodelabs/genode#4436
2022-03-07 16:42:56 +01:00
Stefan Kalkowski
8a4cbe3cc9 io_port_session: make default ram quota explicit
Ref genodelabs/genode#4436
2022-03-02 15:04:18 +01:00
Roland Bär
d45b60ceeb sntp_client.run: redundant aritfacts in image build
The run script uses core, ld.lib.so, and init from depot packages, thus
these cannot be integrated in the image explicitly from the build
directory.

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

Fixes #4437
2022-03-02 07:56:20 +01:00
6751 changed files with 289963 additions and 234879 deletions

57
README
View File

@@ -4,17 +4,19 @@
=================================
This is the source tree of the reference implementation of the Genode OS
architecture. For a general overview about the architecture, please refer to
the project's official website:
This is the source code of Genode, which is a framework for creating
component-based operating systems. It combines capability-based security,
microkernel technology, sandboxed device drivers, and virtualization with
a novel operating system architecture. For a general overview about the
architecture, please refer to the project's official website:
:Official project website for the Genode OS Framework:
:Website for the Genode OS Framework:
[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
Genode-based operating systems can be compiled for a variety of kernels: 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
@@ -22,7 +24,7 @@ one. If a microkernel pretended to be fit for all use cases, it wouldn't be
"micro". Hence, all microkernels differ in terms of their respective features,
complexity, and supported hardware architectures.
Genode allows the use of each of the kernels listed above with a rich set of
Genode allows for the use of each of the supported kernels with a rich set of
device drivers, protocol stacks, libraries, and applications in a uniform way.
For developers, the framework provides an easy way to target multiple different
kernels instead of tying the development to a particular kernel technology. For
@@ -37,7 +39,7 @@ Documentation
#############
The primary documentation is the book "Genode Foundations", which is available
on the front page of Genode website:
on the front page of the Genode website:
:Download the book "Genode Foundations":
@@ -79,10 +81,16 @@ The source tree is composed of the following subdirectories:
Source-code management tools and scripts. Please refer to the README file
contained in the directory.
:'depot':
Directory used by Genode's package-management tools. It contains the public
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
@@ -97,13 +105,32 @@ system scenarios.
[https://github.com/genodelabs/genode-world]
Community blog
##############
Genodians.org presents ideas, announcements, experience stories, and tutorials
around Genode, informally written by Genode users and developers.
:Genodians.org:
[https://genodians.org]
Contact
#######
The best way to get in touch with Genode developers and users is the project's
mailing list. Please feel welcome to join in!
The community forum is organized by Genode users to help newcomers, share ideas
and experiences, and discuss Genode-related projects.
:Genode Mailing Lists:
:Community forum:
[https://genode.discourse.group]
The mailing list is the primary way for reaching out to Genode's core
developers, for receiving announcements, and for the project's annual road-map
discussion.
:Genode Mailing List:
[https://genode.org/community/mailing-lists]

View File

@@ -1 +1 @@
22.02
24.11

View File

@@ -1,517 +0,0 @@
=======================
The Genode build system
=======================
Norman Feske
Abstract
########
The Genode OS Framework comes with a custom build system that is designed for
the creation of highly modular and portable systems software. Understanding
its basic concepts is pivotal for using the full potential of the framework.
This document introduces those concepts and the best practises of putting them
to good use. Beside building software components from source code, common
and repetitive development tasks are the testing of individual components
and the integration of those components into complex system scenarios. To
streamline such tasks, the build system is accompanied with special tooling
support. This document introduces those tools.
Build directories and repositories
##################################
The build system is supposed to never touch the source tree. The procedure of
building components and integrating them into system scenarios is done at
a distinct build directory. One build directory targets a specific platform,
i.e., a kernel and hardware architecture. Because the source tree is decoupled
from the build directory, one source tree can have many different build
directories associated, each targeted at another platform.
The recommended way for creating a build directory is the use of the
'create_builddir' tool located at '<genode-dir>/tool/'. By starting the tool
without arguments, its usage information will be printed. For creating a new
build directory, one of the listed target platforms must be specified.
Furthermore, the location of the new build directory has to be specified via
the 'BUILD_DIR=' argument. For example:
! cd <genode-dir>
! ./tool/create_builddir linux_x86 BUILD_DIR=/tmp/build.linux_x86
This command will create a new build directory for the Linux/x86 platform
at _/tmp/build.linux_x86/_.
Build-directory configuration via 'build.conf'
==============================================
The fresh build directory will contain a 'Makefile', which is a symlink to
_tool/builddir/build.mk_. This makefile is the front end of the build system
and not supposed to be edited. Beside the makefile, there is a _etc/_
subdirectory that contains the build-directory configuration. For most
platforms, there is only a single _build.conf_ file, which defines the parts of
the Genode source tree incorporated in the build process. Those parts are
called _repositories_.
The repository concept allows for keeping the source code well separated for
different concerns. For example, the platform-specific code for each target
platform is located in a dedicated _base-<platform>_ repository. Also, different
abstraction levels and features of the system are residing in different
repositories. The _etc/build.conf_ file defines the set of repositories to
consider in the build process. At build time, the build system overlays the
directory structures of all repositories specified via the 'REPOSITORIES'
declaration to form a single logical source tree. By changing the list of
'REPOSITORIES', the view of the build system on the source tree can be altered.
The _etc/build.conf_ as found in a fresh created build directory will list the
_base-<platform>_ repository of the platform selected at the 'create_builddir'
command line as well as the 'base', 'os', and 'demo' repositories needed for
compiling Genode's default demonstration scenario. Furthermore, there are a
number of commented-out lines that can be uncommented for enabling additional
repositories.
Note that the order of the repositories listed in the 'REPOSITORIES' declaration
is important. Front-most repositories shadow subsequent repositories. This
makes the repository mechanism a powerful tool for tweaking existing repositories:
By adding a custom repository in front of another one, customized versions of
single files (e.g., header files or target description files) can be supplied to
the build system without changing the original repository.
Building targets
================
To build all targets contained in the list of 'REPOSITORIES' as defined in
_etc/build.conf_, simply issue 'make'. This way, all components that are
compatible with the build directory's base platform will be built. In practice,
however, only some of those components may be of interest. Hence, the build
can be tailored to those components which are of actual interest by specifying
source-code subtrees. For example, using the following command
! make core server/nitpicker
the build system builds all targets found in the 'core' and 'server/nitpicker'
source directories. You may specify any number of subtrees to the build
system. As indicated by the build output, the build system revisits
each library that is used by each target found in the specified subtrees.
This is very handy for developing libraries because instead of re-building
your library and then your library-using program, you just build your program
and that's it. This concept even works recursively, which means that libraries
may depend on other libraries.
In practice, you won't ever need to build the _whole tree_ but only the
targets that you are interested in.
Cleaning the build directory
============================
To remove all but kernel-related generated files, use
! make clean
To remove all generated files, use
! make cleanall
Both 'clean' and 'cleanall' won't remove any files from the _bin/_
subdirectory. This makes the _bin/_ a safe place for files that are
unrelated to the build process, yet required for the integration stage, e.g.,
binary data.
Controlling the verbosity of the build process
==============================================
To understand the inner workings of the build process in more detail, you can
tell the build system to display each directory change by specifying
! make VERBOSE_DIR=
If you are interested in the arguments that are passed to each invocation of
'make', you can make them visible via
! make VERBOSE_MK=
Furthermore, you can observe each single shell-command invocation by specifying
! make VERBOSE=
Of course, you can combine these verboseness toggles for maximizing the noise.
Enabling parallel builds
========================
To utilize multiple CPU cores during the build process, you may invoke 'make'
with the '-j' argument. If manually specifying this argument becomes an
inconvenience, you may add the following line to your _etc/build.conf_ file:
! MAKE += -j<N>
This way, the build system will always use '<N>' CPUs for building.
Caching inter-library dependencies
==================================
The build system allows to repeat the last build without performing any
library-dependency checks by using:
! make again
The use of this feature can significantly improve the work flow during
development because in contrast to source-codes, library dependencies rarely
change. So the time needed for re-creating inter-library dependencies at each
build can be saved.
Repository directory layout
###########################
Each Genode repository has the following layout:
Directory | Description
------------------------------------------------------------
'doc/' | Documentation, specific for the repository
------------------------------------------------------------
'etc/' | Default configuration of the build process
------------------------------------------------------------
'mk/' | The build system
------------------------------------------------------------
'include/' | Globally visible header files
------------------------------------------------------------
'src/' | Source codes and target build descriptions
------------------------------------------------------------
'lib/mk/' | Library build descriptions
Creating targets and libraries
##############################
Target descriptions
===================
A good starting point is to look at the init target. The source code of init is
located at _os/src/init/_. In this directory, you will find a target description
file named _target.mk_. This file contains the building instructions and it is
usually very simple. The build process is controlled by defining the following
variables.
Build variables to be defined by you
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:'TARGET': is the name of the binary to be created. This is the
only *mandatory variable* to be defined in a _target.mk_ file.
:'REQUIRES': expresses the requirements that must be satisfied in order to
build the target. You find more details about the underlying mechanism in
Section [Specializations].
:'LIBS': is the list of libraries that are used by the target.
:'SRC_CC': contains the list of '.cc' source files. The default search location
for source codes is the directory, where the _target.mk_ file resides.
:'SRC_C': contains the list of '.c' source files.
:'SRC_S': contains the list of assembly '.s' source files.
:'SRC_BIN': contains binary data files to be linked to the target.
:'INC_DIR': is the list of include search locations. Directories should
always be appended by using +=. Never use an assignment!
:'EXT_OBJECTS': is a list of Genode-external objects or libraries. This
variable is mostly used for interfacing Genode with legacy software
components.
Rarely used variables
---------------------
:'CC_OPT': contains additional compiler options to be used for '.c' as
well as for '.cc' files.
:'CC_CXX_OPT': contains additional compiler options to be used for the
C++ compiler only.
:'CC_C_OPT': contains additional compiler options to be used for the
C compiler only.
Specifying search locations
~~~~~~~~~~~~~~~~~~~~~~~~~~~
When specifying search locations for header files via the 'INC_DIR' variable or
for source files via 'vpath', relative pathnames are illegal to use. Instead,
you can use the following variables to reference locations within the
source-code repository, where your target lives:
:'REP_DIR': is the base directory of the current source-code repository.
Normally, specifying locations relative to the base of the repository is
never used by _target.mk_ files but needed by library descriptions.
:'PRG_DIR': is the directory, where your _target.mk_ file resides. This
variable is always to be used when specifying a relative path.
Library descriptions
====================
In contrast to target descriptions that are scattered across the whole source
tree, library descriptions are located at the central place _lib/mk_. Each
library corresponds to a _<libname>.mk_ file. The base of the description file
is the name of the library. Therefore, no 'TARGET' variable needs to be set.
The source-code locations are expressed as '$(REP_DIR)'-relative 'vpath'
commands.
Library-description files support the following additional declarations:
:'SHARED_LIB = yes': declares that the library should be built as a shared
object rather than a static library. The resulting object will be called
_<libname>.lib.so_.
Specializations
===============
Building components for different platforms likely implicates portions of code
that are tied to certain aspects of the target platform. For example, a target
platform may be characterized by
* A kernel API such as L4v2, Linux, L4.sec,
* A hardware architecture such as x86, ARM, Coldfire,
* A certain hardware facility such as a custom device, or
* Other properties such as software license requirements.
Each of these attributes express a specialization of the build process. The
build system provides a generic mechanism to handle such specializations.
The _programmer_ of a software component knows the properties on which his
software relies and thus, specifies these requirements in his build description
file.
The _user/customer/builder_ decides to build software for a specific platform
and defines the platform specifics via the 'SPECS' variable per build
directory in _etc/specs.conf_. In addition to an (optional) _etc/specs.conf_
file within the build directory, the build system incorporates the first
_etc/specs.conf_ file found in the repositories as configured for the
build directory. For example, for a 'linux_x86' build directory, the
_base-linux/etc/specs.conf_ file is used by default. The build directory's
'specs.conf' file can still be used to extend the 'SPECS' declarations, for
example to enable special features.
Each '<specname>' in the 'SPECS' variable instructs the build system to
* Include the 'make'-rules of a corresponding _base/mk/spec-<specname>.mk_
file. This enables the customization of the build process for each platform.
* Search for _<libname>.mk_ files in the _lib/mk/<specname>/_ subdirectory.
This way, we can provide alternative implementations of one and the same
library interface for different platforms.
Before a target or library gets built, the build system checks if the 'REQUIRES'
entries of the build description file are satisfied by entries of the 'SPECS'
variable. The compilation is executed only if each entry in the 'REQUIRES'
variable is present in the 'SPECS' variable as supplied by the build directory
configuration.
Building tools to be executed on the host platform
===================================================
Sometimes, software requires custom tools that are used to generate source
code or other ingredients for the build process, for example IDL compilers.
Such tools won't be executed on top of Genode but on the host platform
during the build process. Hence, they must be compiled with the tool chain
installed on the host, not the Genode tool chain.
The Genode build system accommodates the building of such host tools as a side
effect of building a library or a target. Even though it is possible to add
the tool compilation step to a regular build description file, it is
recommended to introduce a dedicated pseudo library for building such tools.
This way, the rules for building host tools are kept separate from rules that
refer to Genode programs. By convention, the pseudo library should be named
_<package>_host_tools_ and the host tools should be built at
_<build-dir>/tool/<package>/_. With _<package>_, we refer to the name of the
software package the tool belongs to, e.g., qt5 or mupdf. To build a tool
named _<tool>_, the pseudo library contains a custom make rule like the
following:
! $(BUILD_BASE_DIR)/tool/<package>/<tool>:
! $(MSG_BUILD)$(notdir $@)
! $(VERBOSE)mkdir -p $(dir $@)
! $(VERBOSE)...build commands...
To let the build system trigger the rule, add the custom target to the
'HOST_TOOLS' variable:
! HOST_TOOLS += $(BUILD_BASE_DIR)/tool/<package>/<tool>
Once the pseudo library for building the host tools is in place, it can be
referenced by each target or library that relies on the respective tools via
the 'LIBS' declaration. The tool can be invoked by referring to
'$(BUILD_BASE_DIR)/tool/<package>/tool'.
For an example of using custom host tools, please refer to the mupdf package
found within the libports repository. During the build of the mupdf library,
two custom tools fontdump and cmapdump are invoked. The tools are built via
the _lib/mk/mupdf_host_tools.mk_ library description file. The actual mupdf
library (_lib/mk/mupdf.mk_) has the pseudo library 'mupdf_host_tools' listed
in its 'LIBS' declaration and refers to the tools relative to
'$(BUILD_BASE_DIR)'.
Building additional custom targets accompanying library or program
==================================================================
There are cases when it is important to build additional targets
besides standard files built for library or program. Of course there
is no problem with writing specific make rules for commands that
generate those target files but for them to be built a proper
dependency must be specified. To achieve it those additional targets
should be added to 'CUSTOM_TARGET_DEPS' variable like e.g. in
iwl_firmware library from dde_linux repository:
! CUSTOM_TARGET_DEPS += $(addprefix $(BIN_DIR)/,$(IMAGES))
Automated integration and testing
#################################
Genode's cross-kernel portability is one of the prime features of the
framework. However, each kernel takes a different route when it comes to
configuring, integrating, and booting the system. Hence, for using a particular
kernel, profound knowledge about the boot concept and the kernel-specific tools
is required. To streamline the testing of Genode-based systems across the many
different supported kernels, the framework comes equipped with tools that
relieve you from these peculiarities.
Run scripts
===========
Using so-called run scripts, complete Genode systems can be described in a
concise and kernel-independent way. Once created, a run script can be used
to integrate and test-drive a system scenario directly from the build directory.
The best way to get acquainted with the concept is reviewing the run script
for the 'hello_tutorial' located at _hello_tutorial/run/hello.run_.
Let's revisit each step expressed in the _hello.run_ script:
* Building the components needed for the system using the 'build' command.
This command instructs the build system to compile the targets listed in
the brace block. It has the same effect as manually invoking 'make' with
the specified argument from within the build directory.
* Creating a new boot directory using the 'create_boot_directory' command.
The integration of the scenario is performed in a dedicated directory at
_<build-dir>/var/run/<run-script-name>/_. When the run script is finished,
this directory will contain all components of the final system. In the
following, we will refer to this directory as run directory.
* Installing the Genode 'config' file into the run directory using the
'install_config' command. The argument to this command will be written
to a file called 'config' at the run directory picked up by
Genode's init process.
* Creating a bootable system image using the 'build_boot_image' command.
This command copies the specified list of files from the _<build-dir>/bin/_
directory to the run directory and executes the platform-specific steps
needed to transform the content of the run directory into a bootable
form. This form depends on the actual base platform and may be an ISO
image or a bootable ELF image.
* Executing the system image using the 'run_genode_until' command. Depending
on the base platform, the system image will be executed using an emulator.
For most platforms, Qemu is the tool of choice used by default. On Linux,
the scenario is executed by starting 'core' directly from the run
directory. The 'run_genode_until' command takes a regular expression
as argument. If the log output of the scenario matches the specified
pattern, the 'run_genode_until' command returns. If specifying 'forever'
as argument (as done in 'hello.run'), this command will never return.
If a regular expression is specified, an additional argument determines
a timeout in seconds. If the regular expression does not match until
the timeout is reached, the run script will abort.
Please note that the _hello.run_ script does not contain kernel-specific
information. Therefore it can be executed from the build directory of any base
platform by using:
! make run/hello
When invoking 'make' with an argument of the form 'run/*', the build system
will look in all repositories for a run script with the specified name. The run
script must be located in one of the repositories 'run/' subdirectories and
have the file extension '.run'.
For a more comprehensive run script, _os/run/demo.run_ serves as a good
example. This run script describes Genode's default demo scenario. As seen in
'demo.run', parts of init's configuration can be made dependent on the
platform's properties expressed as spec values. For example, the PCI driver
gets included in init's configuration only on platforms with a PCI bus. For
appending conditional snippets to the _config_ file, there exists the 'append_if'
command, which takes a condition as first and the snippet as second argument.
To test for a SPEC value, the command '[have_spec <spec-value>]' is used as
condition. Analogously to how 'append_if' appends strings, there exists
'lappend_if' to append list items. The latter command is used to conditionally
include binaries to the list of boot modules passed to the 'build_boot_image'
command.
The run mechanism explained
===========================
Under the hood, run scripts are executed by an expect interpreter. When the
user invokes a run script via _make run/<run-script>_, the build system invokes
the run tool at _<genode-dir>/tool/run_ with the run script as argument. The
run tool is an expect script that has no other purpose than defining several
commands used by run scripts, including a platform-specific script snippet
called run environment ('env'), and finally including the actual run script.
Whereas _tool/run_ provides the implementations of generic and largely
platform-independent commands, the _env_ snippet included from the platform's
respective _base-<platform>/run/env_ file contains all platform-specific
commands. For reference, the most simplistic run environment is the one at
_base-linux/run/env_, which implements the 'create_boot_directory',
'install_config', 'build_boot_image', and 'run_genode_until' commands for Linux
as base platform. For the other platforms, the run environments are far more
elaborative and document precisely how the integration and boot concept works
on each platform. Hence, the _base-<platform>/run/env_ files are not only
necessary parts of Genode's tooling support but serve as resource for
peculiarities of using each kernel.
Using run script to implement test cases
========================================
Because run scripts are actually expect scripts, the whole arsenal of
language features of the Tcl scripting language is available to them. This
turns run scripts into powerful tools for the automated execution of test
cases. A good example is the run script at _libports/run/lwip.run_, which tests
the lwIP stack by running a simple Genode-based HTTP server on Qemu. It fetches
and validates a HTML page from this server. The run script makes use of a
regular expression as argument to the 'run_genode_until' command to detect the
state when the web server becomes ready, subsequently executes the 'lynx' shell
command to fetch the web site, and employs Tcl's support for regular
expressions to validate the result. The run script works across base platforms
that use Qemu as execution environment.
To get the most out of the run mechanism, a basic understanding of the Tcl
scripting language is required. Furthermore the functions provided by
_tool/run_ and _base-<platform>/run/env_ should be studied.
Automated testing across base platforms
=======================================
To execute one or multiple test cases on more than one base platform, there
exists a dedicated tool at _tool/autopilot_. Its primary purpose is the
nightly execution of test cases. The tool takes a list of platforms and of
run scripts as arguments and executes each run script on each platform. The
build directory for each platform is created at
_/tmp/autopilot.<username>/<platform>_ and the output of each run script is
written to a file called _<platform>.<run-script>.log_. On stderr, autopilot
prints the statistics about whether or not each run script executed
successfully on each platform. If at least one run script failed, autopilot
returns a non-zero exit code, which makes it straight forward to include
autopilot into an automated build-and-test environment.

View File

@@ -16,17 +16,24 @@ research projects on Genode.
Applications and library infrastructure
#######################################
:VNC server implementing Genode's framebuffer session interface:
:Port of the Ladybird web browser:
With 'Input' and 'Framebuffer', Genode provides two low-level interfaces
used by interactive applications. For example, the Nitpicker GUI server uses
these interfaces as a client and, in turn, exports multiple virtual
'Framebuffer' and 'Input' interfaces to its clients. This enables a
highly modular use of applications such as the nesting of GUIs. By
implementing the 'Framebuffer' and 'Input' interfaces with a VNC server
implementation, all graphical workloads of Genode would become available over
the network. One immediate application of this implementation is the remote
testing of graphical Genode applications running on a headless server.
[https://ladybird.org/ - Ladybird] is a new web browser developed
independently from the large browser-engine vendors. It is designed to
be light-weight and portable. Among the supported platforms is Qt,
which is available for Genode. This makes the porting of Ladybird a
tempting application of the Goa SDK.
:Goa SDK running on Sculpt OS:
Genode's [https://github.com/genodelabs/goa - Goa SDK] is currently used
in Linux-based development environments, facilitating cross-compilation
to Genode. The goal of this project is the ability to use Goa directly on
Sculpt OS without the need for a Linux VM. This entails a number of
challenges, ranging from running the Goa tool itself by porting the expect
interpreter, over running the Genode tool chain, adjusting the
network-facing Goa commands to Genode's environment, to crafting custom
support for executing 'goa run' as a sandboxed Genode subsystem.
:Interfacing with the SAFE network:
@@ -39,25 +46,6 @@ Applications and library infrastructure
integrated in the operating system, i.e., in the form of Genode components
or a set of Genode VFS plugins.
:Interactive sound switchbox based on Genode's Audio_out session interface:
Since version 10.05, Genode features a highly flexible configuration concept
that allows the arbitrary routing of session requests throughout the
hierarchic process structure. Even though primarily designed for expressing
mandatory-access control rules, the concept scales far beyond this use case.
For example, it can be used to run an arbitrary number of processes
implementing the same interface and connecting the different interface
implementations. One special case of this scenario is a chain of audio
filters with each using the 'Audio_out' session interface for both roles
client and server. Combined with the Nitpicker GUI server and Genode's
support for real-time priorities, this base techniques enable the creation of
flexible audio mixer / switchboard applications, which require dedicated
frameworks (e.g., Jack audio) on traditional operating systems. The goal of
this project is to create a showcase implementation demonstrating the
feasibility for creating high-quality audio applications on Genode.
Furthermore, we wish for feedback regarding the current design of our bulk
streaming interface when used for low-latency applications.
:Graphical on-target IPC tracing tool using Qt:
Analysing the interaction of components of a multi-server operating system
@@ -94,31 +82,39 @@ Applications and library infrastructure
:Ports of popular software:
Genode features a ports mechanism to cleanly integrate 3rd-party software.
The [https://github.com/genodelabs/goa - Goa SDK] streamlines the process
of developing, porting, packaging, and publishing software for Genode,
and Sculpt OS in particular.
Thanks to the C runtime, the flexible per-component VFS, the standard
C++ library, and the Noux runtime (for UNIX software), porting software
to Genode is relatively straight forward. The
[https://genode.org/documentation/developer-resources/porting - porting guide]
explains the typical steps. A wish list of software that we'd like to
have available on Genode is available at
C++ library, and a variety of supported 3rd-party libraries, porting
software to Genode is relatively straight forward.
A wish list of software that we'd like to have available on Genode is
available at
[https://usr.sysret.de/jws/genode/porting_wishlist.html].
:Native Open-Street-Maps (OSM) client:
When using Sculpt OS, we regularly need to spawn a fully fledged web
browser in a virtual machine for using OSM or Google maps. The goal
of this project would be a native component that makes maps functionality
directly available on Genode, alleviating the urge to reach for a SaaS
product. The work would include a review of existing OSM clients regarding
their feature sets and the feasibility of porting them to Genode.
Depending on the outcome of this review, an existing application could
be ported or a new component could be developed, e.g., leveraging Genode's
Qt support.
When using Sculpt OS, we regularly need to spawn a fully fledged web browser
for using OSM or Google maps. The goal of this project would be a native
component that makes maps functionality directly available on Genode,
alleviating the urge to reach for a SaaS product. The work would include a
review of existing OSM clients regarding their feature sets and the
feasibility of porting them to Genode. Depending on the outcome of this
review, an existing application could be ported or a new component could be
developed, e.g., leveraging Genode's Qt support.
Application frameworks and runtime environments
###############################################
:GTK:
Genode supports Qt as a native toolkit. But many popular applications
are built upon [https://www.gtk.org/ - GTK]. A port of GTK to Genode would
allow for the use of these applications on Sculpt OS without the need
of a Linux VM. A tangible goal for this line of work could be the port
of [https://mtpaint.sourceforge.net/ - mtPaint] to Sculpt OS.
:OpenJDK:
[https://openjdk.java.net/ - OpenJDK] is the reference implementation of the
@@ -143,31 +139,6 @@ Application frameworks and runtime environments
removed from the trusted computing base of Android, facilitating the use of
this mobile OS in high-assurance settings.
:Go language runtime:
Go is a popular language in particular for web applications. In the past,
there were numerous attempts to make the Go runtime available on Genode
but so far, none of those undertakings have landed in the official
Genode source tree. To goal of this project is the hosting of
Go-written applications - in particular networking applications - as
Genode components. The topic comprises work on the tool-chain
and build-system integration, the porting the runtime libraries, and
the glue between the Go and Genode environments.
:Combination of CAmkES with Genode:
[https://wiki.sel4.systems/CAmkES - CAmkES] is a component framework for
seL4. In contrast to Genode, which is a dynamic system, CAmkES-based systems
are defined at design time and remain fixed at runtime. Hence, CAmkES and
Genode can be seen as the opposite ends of component-based used-land
architectures. The goal of this project is to build a bridge between
both projects with the potential to cross-pollinate the respective communities.
Among the principal approaches are embedding of a single CAmkES
component as a Genode component (e.g., an individual device driver),
the hosting of a dynamic Genode system as a component within a
CAmkES system, or the hosting of a CAmkES system composition as a Genode
subsystem.
:Runtime for the D programming language:
The D systems programming language was designed to overcome many gripes that
@@ -181,19 +152,6 @@ Application frameworks and runtime environments
programs, and interfacing D programs with other Genode components written in
C++.
:Using Haskell as systems-development language:
The goal of this project is the application of functional programming
i.e., Haskell, for the implementation of low-level Genode components.
Implementing critical functionalities in such a high-level language instead
of a classical systems language such as C or C++ would pave the way towards
analyzing such components with formal methods.
The use of Haskell for systems development was pioneered by the
[https://programatica.cs.pdx.edu/House/ - House Project]. A more recent
development is [https://halvm.org - HalVM] - a light-weight OS runtime for
Xen that is based on Haskell.
:Xlib compatibility:
Developments like Wayland notwithstanding, most application software on
@@ -214,45 +172,44 @@ Application frameworks and runtime environments
requests issued by a block-session client to a block-device driver,
such a bump-in-the-wire component could visualize
the access patterns of a block device. Similar ideas could be pursued for
other session interfaces, like the audio-out (sound visualization) or NIC
other session interfaces, like record/play (sound visualization) or NIC
session (live visualization of network communication).
The visualization of system behavior would offer valuable insights,
e.g., new opportunities for optimization. But more importantly, they
would be extremely fun to play with.
would be fun to play with.
Platforms
#########
:Support for additional ARM SoCs:
Genode's ARM support has been focused on NXP's i.MX family, Allwinner A64
(used by the PinePhone), and to a lesser degree the Raspberry Pi. To make
Genode compatible with a larger variety of devices, the support for further
chip families calls for exploration. For example,
[https://en.wikipedia.org/wiki/Rockchip - Rockchip] SoCs are getting
popular in products by open-source hardware vendors such as
[https://pine64.com/ - Pine64] and [https://mntre.com/ - MNT].
The first steps have been [https://github.com/mickenx/genode-rockchip - already taken]
by [https://genodians.org/mickenx/index - Michael Grunditz]!
Another example is the Mediatek SoC family, which is popular in
affordable consumer smartphones.
Another example is the Mediatek SoC family, which is popular in
affordable consumer smartphones.
The process of bringing an OS like Genode to a new SoC is full of technical
challenges and labor-intensive, yet extremely gratifying.
As a guide through this process, the
[https://genode.org/documentation/genode-platforms-23-05.pdf - Genode Platforms]
book breaks the challenge down to a sequence of manageable steps, where
each step can be celebrated as a success.
Virtualization
##############
:VirtualBox on top of KVM on Linux:
Genode's version of VirtualBox replaces the original in-kernel VirtualBox
hypervisor by the virtualization mechanism of the NOVA hypervisor or the
Muen separation kernel. Those mechanisms look very similar the KVM
interface of the Linux kernel. It should in principle be possible to
re-target Genode's version of VirtualBox to KVM. This way, VirtualBox and
Qemu/KVM-based virtual machines could co-exist on the same system, which
is normally not possible. Also, complex Genode scenarios (like Turmvilla)
could be prototyped on GNU/Linux.
:Xen as kernel for Genode:
Using Xen as kernel for Genode would clear the way to remove the
overly complex Linux OS from the trusted computing base of Xen
guests OSes.
Xen is a hypervisor that can host multiple virtual machines on one physical
machine. For driving physical devices and for virtual-machine management, Xen
relies on a privileged guest OS called Dom0. Currently, Linux is the
predominant choice to be used as Dom0, which implicates a trusted computing
base of millions of lines of code for the other guest OSes.
Even though Xen was designed as hypervisor, a thorough analysis done by Julian
Stecklina concludes that Xen qualifies well as a kernel for Genode. For
example, Julian implemented a version of Genode's IPC framework that utilizes
Xen's communication mechanisms (event channels and shared memory).
:Genode as virtualization layer for Qubes OS:
[https://www.qubes-os.org/ - Qubes OS] is a desktop operating system
@@ -278,121 +235,37 @@ Virtualization
the project bears the opportunity to explore the provisioning of the
KVM interface based on Genode's VFS plugin concept.
:Hardware-accelerated graphics for virtual machines:
In
[https://genode.org/documentation/release-notes/17.08#Hardware-accelerated_graphics_for_Intel_Gen-8_GPUs - Genode 17.08],
we introduced a GPU multiplexer for Intel Broadwell along with support
for Mesa-based 3D-accelerated applications.
While designing Genode's GPU-session interface, we also aimed at supporting
the hardware-accelerated graphics for Genode's virtual machine monitors like
VirtualBox or Seoul, but until now, we did not took the practical steps of
implementing a virtual GPU device model.
System management and tools
###########################
The goal of this project is the offering of a virtual GPU to a Linux guest
OS running on top of Genode's existing virtualization and driver
infrastructure.
:Virtual network-boot infrastructure as Sculpt component:
Network-based development work flows for PCs require a variety of tools and
network-configuration peculiarities. Think of a development network with a
custom configured DHCP server, a TFTP or HTTP server on the development
machine, the provisioning of a PXE boot loader, tooling for obtaining serial
output over AMT, or tooling for remote power control via AMT.
Device drivers
##############
The goal of this project would be the hosting of all those functions in a
Sculpt OS component "devnet" that is exclusively in charge of a dedicated
LAN port of the developer's Sculpt machine. By connecting a test machine to
this LAN port, the test machine becomes immediately available as development
target without any manual installation or configuration steps needed. The
devnet component would interface with the rest of the Sculpt system as a
client of a file-system session (containing the boot payloads) and a
terminal session (for the virtual serial connection).
:Sound on the Raspberry Pi:
:Statistical profiler using Sculpt's GDB monitor:
The goal of this project is a component that uses the Raspberry Pi's
PWM device to implement Genode's audio-out-session interface. Since
Genode's version of libSDL already supports this interface as audio
backend, the new driver will make the sound of all SDL-based games
available on the Raspberry Pi.
:Data Plane Development Kit (DPDK):
Genode utilizes the network device drivers of the iPXE project, which
perform reasonably well for everyday use cases but are obviously not
designated for high-performance networking.
The [https://dpdk.org/ - DPDK] is a vendor-supported suite of network device
drivers that is specifically developed for high-performance applications.
It presents an attractive alternative to iPXE-based drivers. This project
has the goal to make DPDK drivers available as a Genode component.
Platforms
#########
:Microkernelizing Linux:
Thanks to Genode's generic interfaces for I/O access as provided by core, all
Genode device drivers including drivers ported from Linux and gPXE can be
executed as user-level components on all supported microkernels. However, so
far, we have not enabled the use of these device drivers on Linux as base
platform. The goal of this project is the systematic replacement of in-kernel
Linux device drivers by Genode processes running in user space, effectively
reducing the Linux kernel to a runtime for Genode's core process. But moving
drivers to Genode processes is just the beginning. By employing further
Genode functionality such as its native GUI, lwIP, and Noux, many protocol
stacks can effectively be removed from the Linux kernel.
In 2018, Johannes Kliemann pursued this topic to a state where Genode
could be used as init process atop a customized Linux kernel.
[https://lists.genode.org/pipermail/users/2018-May/006066.html - His work]
included the execution of Genode's regular device drivers for VESA and
PS/2 as regular Genode components so that Genode's interactive demo
scenario ran happily on a laptop. At this time, however, only parts of
his results were merged into Genode's mainline.
The goal of this project is to follow up on Johannes' work, bring the
[https://github.com/genodelabs/genode/pull/2829 - remaining parts] into
shape for the inclusion into Genode, and address outstanding topics, in
particular the handling of DMA by user-level device drivers. Further down
the road, it would be tempting to explore the use of
[https://en.wikipedia.org/wiki/Seccomp - seccomp] as sandboxing mechanism
for Genode on Linux and the improvement of the Linux-specific implementation
of Genode's object-capability model.
:Support for the HelenOS/SPARTAN kernel:
[http://www.helenos.org - HelenOS] is a microkernel-based multi-server OS
developed at the university of Prague. It is based on the SPARTAN microkernel,
which runs on a wide variety of CPU architectures including Sparc, MIPS, and
PowerPC. This broad platform support makes SPARTAN an interesting kernel to
look at alone. But a further motivation is the fact that SPARTAN does not
follow the classical L4 road, providing a kernel API that comes with an own
terminology and different kernel primitives. This makes the mapping of
SPARTAN's kernel API to Genode a challenging endeavour and would provide us
with feedback regarding the universality of Genode's internal interfaces.
Finally, this project has the potential to ignite a further collaboration
between the HelenOS and Genode communities.
:Support for the XNU kernel (Darwin):
XNU is the kernel used by Darwin and Mac OS X. It is derived from the
MACH microkernel and extended with a UNIX-like syscall API. Because the
kernel is used for Mac OS X, it could represent an industry-strength
base platform for Genode supporting all CPU features as used by Mac OS X.
:Genode on the Librem5 phone hardware:
Even though there exists a great variety of ARM-based SoCs, Genode
primarily focuses on the NXP i.MX family because it is - in contrast
to most SoCs in the consumer space - very liberal in terms of
good-quality public documentation and reference code, and it scales
from industrial to end-user-facing use cases (multi-media).
The [https://puri.sm/products/librem-5/ - Librem5] project - with its
mission to build a trustworthy mobile phone - has chosen the i.MX family as
the basis for their product for likely the same reasons that attract us.
To goal of this work is bringing Genode to the Librem5 hardware.
For the Librem5 project, Genode could pave the ground towards new use cases
like high-security markets where a regular Linux-based OS would not be
accepted. For the Genode community, the Librem5 hardware could become an
attractive mobile platform for everyday use, similar to how we developers
use our Genode-based [https://genode.org/download/sculpt - Sculpt OS] on our
laptops.
System management
#################
Starting with version 24.04, Sculpt OS provides the ability to supervise
selected components
[https://genodians.org/chelmuth/2024-05-17-on-target-debugging - using the GDB protocol].
The underlying mechanism and infrastructure could be leveraged for
implementing a statistical profiler that monitors components live.
Using the on-target information obtained via Sculpt's "download debug info"
option, the tool could display a sorted list of the most executed
functions, facilitating interactive on-target analysis and experimentation.
:Remote management of Sculpt OS via Puppet:
@@ -406,18 +279,3 @@ System management
The project would explore the application of the Puppet approach and tools
to Sculpt OS.
Optimizations
#############
:De-privileging the VESA graphics driver:
The VESA graphics driver executes the graphics initialization code provided
by the graphics card via an x86 emulator. To initialize a graphics mode, this
code needs to access device hardware. Currently, we permit access to all
device registers requested by the graphics-card's code. These devices include
the system timer, the PCI configuration registers, and the interrupt
controller, which are critical for the proper operating of the kernel. The
goal of this work is to restrict the permissions of the VESA driver to a
minimum by virtualizing all devices but the actual graphics card.

View File

@@ -1,299 +0,0 @@
Coding style guidelines for Genode
##################################
Things to avoid
===============
Please avoid using pre-processor macros. C++ provides language
features for almost any case, for which a C programmer uses
macros.
:Defining constants:
Use 'enum' instead of '#define'
! enum { MAX_COLORS = 3 };
! enum {
! COLOR_RED = 1,
! COLOR_BLUE = 2,
! COLOR_GREEN = 3
! };
:Meta programming:
Use templates instead of pre-processor macros. In contrast to macros,
templates are type-safe and fit well with the implementation syntax.
:Conditional-code inclusion:
Please avoid C-hacker style '#ifdef CONFIG_PLATFROM' - '#endif'
constructs. Instead, factor-out the encapsulated code into a
separate file and introduce a proper function interface.
The build process should then be used to select the appropriate
platform-specific files at compile time. Keep platform dependent
code as small as possible. Never pollute existing generic code
with platform-specific code.
Header of each file
===================
! /*
! * \brief Short description of the file
! * \author Original author
! * \date Creation date
! *
! * Some more detailed description. This is optional.
! */
Identifiers
===========
* The first character of class names are uppercase, any other characters are
lowercase.
* Function and variable names are lower case.
* 'Multi_word_identifiers' use underline to separate words.
* 'CONSTANTS' and template arguments are upper case.
* Private and protected members of a class begin with an '_'-character.
* Accessor methods are named after their corresponding attributes:
! /**
! * Request private member variable
! */
! int value() const { return _value; }
!
! /**
! * Set the private member variable
! */
! void value(int value) { _value = value; }
* Accessors that return a boolean value do not carry an 'is_' prefix. E.g.,
a method for requesting the validity of an object should be named
'valid()', not 'is_valid()'.
Indentation
===========
* Use one tab per indentation step. *Do not mix tabs and spaces!*
* Use no tabs except at the beginning of a line.
* Use spaces for the alignment of continuation lines such as function
arguments that span multiple lines. The alignment spaces of such lines
should start after the (tab-indented) indentation level. For example:
! {
! <tab>function_with_many_arguments(arg1,
! <tab><--- spaces for aligment --->arg2,
! ...
! }
* Remove trailing spaces at the end of lines
This way, each developer can set his preferred tab size in his editor
and the source code always looks good.
_Hint:_ In VIM, use the 'set list' and 'set listchars' commands to make tabs
and spaces visible.
* If class initializers span multiple lines, put the colon on a separate
line and indent the initializers using one tab. For example:
! Complicated_machinery(Material &material, Deadline deadline)
! :
! <tab>_material(material),
! <tab>_deadline(deadline),
! <tab>...
! {
! ...
! }
* Preferably place statements that alter the control flow - such as
'break', 'continue', or 'return' - at the beginning of a separate line,
followed by vertical space (a blank line or the closing brace of the
surrounding scope).
! if (early_return_possible)
! return;
Switch statements
~~~~~~~~~~~~~~~~~
Switch-statement blocks should be indented as follows:
! switch (color) {
!
! case BLUE:
! <tab>break;
!
! case GREEN:
! <tab>{
! <tab><tab>int declaration_required;
! <tab><tab>...
! <tab>}
!
! default:
! }
Please note that the case labels have the same indentation
level as the switch statement. This avoids a two-level
indentation-change at the end of the switch block that
would occur otherwise.
Vertical whitespaces
====================
In header files:
* Leave two empty lines between classes.
* Leave one empty line between member functions.
In implementation files:
* Leave two empty lines between functions.
Braces
======
* Braces after class, struct and function names are placed at a new line:
! class Foo
! {
! public:
!
! void method(void)
! {
! ...
! }
! };
except for one-line functions.
* All other occurrences of open braces (for 'if', 'while', 'do', 'for',
'namespace', 'enum' etc.) are at the end of a line:
! if (flag) {
! ..
! } else {
! ..
! }
* One-line functions should be written on a single line as long as the line
length does not exceed approximately 80 characters.
Typically, this applies for accessor functions.
If slightly more space than one line is needed, indent as follows:
! int heavy_computation(int a, int lot, int of, int args) {
! return a + lot + of + args; }
Comments
========
Function/method header
~~~~~~~~~~~~~~~~~~~~~~
Each public or protected (but no private) method in a header-file should be
prepended by a header as follows:
! /**
! * Short description
! *
! * \param a meaning of parameter a
! * \param b meaning of parameter b
! * \param c,d meaning of parameters c and d
! *
! * \throw Exception_type meaning of the exception
! *
! * \return meaning of return value
! *
! * More detailed information about the function. This is optional.
! */
Descriptions of parameters and return values should be lower-case and brief.
More elaborative descriptions can be documented in the text area below.
In implementation files, only local and private functions should feature
function headers.
Single-line comments
~~~~~~~~~~~~~~~~~~~~
! /* use this syntax for single line comments */
A single-line comment should be prepended by an empty line.
Single-line comments should be short - no complete sentences. Use lower-case.
C++-style comments ('//') should only be used for temporarily commenting-out
code. Such commented-out garbage is easy to 'grep' and there are handy
'vim'-macros available for creating and removing such comments.
Variable descriptions
~~~~~~~~~~~~~~~~~~~~~
Use the same syntax as for single-line comments. Insert two or more
spaces before your comment starts.
! int size; /* in kilobytes */
Multi-line comments
~~~~~~~~~~~~~~~~~~~
Multi-line comments are more detailed descriptions in the form of
sentences.
A multi-line comment should be enclosed by empty lines.
! /*
! * This is some tricky
! * algorithm that works
! * as follows:
! * ...
! */
The first and last line of a multi-line comment contain no words.
Source-code blocks
~~~~~~~~~~~~~~~~~~
For structuring your source code, you can entitle the different
parts of a file like this:
! <- two empty lines
!
! /********************
! ** Event handlers **
! ********************/
! <- one empty line
Note the two stars at the left and right. There are two of them to
make the visible width of the border match its height (typically,
characters are ca. twice as high as wide).
A source-code block header represents a headline for the following
code. To couple this headline with the following code closer than
with previous code, leave two empty lines above and one empty line
below the source-code block header.
Order of public, protected, and private blocks
==============================================
For consistency reasons, use the following class layout:
! class Sandstein
! {
! private:
! ...
! protected:
! ...
! public:
! };
Typically, the private section contains member variables that are used
by public accessor functions below. In this common case, we only reference
symbols that are defined above as it is done when programming plain C.
Leave one empty line (or a line that contains only a brace) above and below
a 'private', 'protected', or 'public' label. This also applies when the
label is followed by a source-code block header.

View File

@@ -34,10 +34,11 @@ of them is briefly characterized as follows:
the driver is made available to other system components via
one of Genode's device-independent session interfaces, which are
'platform_session', 'capture_session', 'event_session', 'block_session',
'audio_out_session', 'log_session', 'nic_session', and 'timer_session'
(see _os/include/_ for the interface definitions). Those interfaces are
uniform across hardware platforms and kernel base platforms. Usually,
each device driver can accommodate only one client at a time.
'record_session', 'play_session', 'log_session', 'uplink_session', and
'timer_session' (see _os/include/_ for the interface definitions).
Those interfaces are uniform across hardware platforms and kernel base
platforms. Usually, each device driver accommodates one client at a
time.
:Resource multiplexers: provide mechanisms to multiplex device resources
to multiple clients. A typical resource multiplexer requests one
@@ -64,26 +65,37 @@ of them is briefly characterized as follows:
Device drivers
##############
Device drivers usually reside in the _src/drivers/_ subdirectory of source-code
Device drivers usually reside in the _src/driver/_ 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
================
:_os/src/drivers/platform/_: Platform drivers for various platforms.
:_os/src/driver/platform/_: Platform drivers for various platforms.
On x86, the platform driver uses the PCI controller as found on x86 PC
hardware. A client can probe for a particular device and request information
about physical device resources (using the 'platform_device' interface). I/O
resources for MMIO regions, I/O ports, and interrupts can be requested by the
provided device abstraction.
:_os/src/drivers/acpi/_:
:_os/src/driver/acpi/_:
On x86 platforms that use the APIC (namely Fiasco.OC, NOVA, and hw_x86_64)
this simple ACPI parser traverses the ACPI tables and reports device-resource
information (e.g., interrupt lines of PCI devices).
:_os/src/app/pci_decode/_:
A component that reports the physical information about PCI devices after
parsing and initializing the PCI bus. The reported information is usually
consumed by the platform driver.
:_os/src/app/smbios_decoder/_:
A component that parses SMBIOS information on x86 platforms and makes the
result available as a report.
@@ -102,10 +114,10 @@ UART devices
The UART device drivers implement the UART-session interface.
:_os/src/drivers/uart/spec/pbxa9/_:
:_os/src/driver/uart/spec/pbxa9/_:
Driver for the PL011 UART as found on many ARM-based platforms.
:_os/src/drivers/uart/spec/x86/_:
:_os/src/driver/uart/spec/x86/_:
Driver for the i8250 UART as found on PC hardware.
@@ -115,11 +127,11 @@ Framebuffer and input drivers
Framebuffer and input drivers are implemented as clients of the
capture-session and event-session interfaces respectively.
:_os/src/drivers/ps2/x86/_:
:_os/src/driver/ps2/x86/_:
Driver for the 'i8042' PS/2 controller as found in x86 PCs. It supports both
mouse (including ImPS/2, ExPS/2) and keyboard.
:_os/src/drivers/ps2/pl050/_:
:_os/src/driver/ps2/pl050/_:
Driver for the PL050 PS/2 controller as found on ARM platforms such as
VersatilePB. The physical base address used by the driver is obtained at
compile time from a header file called _pl050_defs.h_. The version of the
@@ -127,39 +139,36 @@ capture-session and event-session interfaces respectively.
is made available to the driver via the SPECS machinery of the Genode build
system.
:_libports/src/drivers/framebuffer/vesa/_:
:_libports/src/driver/framebuffer/vesa/_:
Driver using VESA mode setting on x86 PCs. For more information, please refer
to the README file in the driver directory.
:_libports/src/drivers/framebuffer/boot/_:
:_libports/src/driver/framebuffer/boot/_:
Driver for boot-time initialized framebuffers (e.g., UEFI GOP)
discovered from the 'platform_info' ROM
:_os/src/drivers/framebuffer/pl11x/_:
:_os/src/driver/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/_:
:_os/src/driver/framebuffer/sdl/_:
Serves as both framebuffer and input driver on Linux using libSDL. This
driver is only usable on the Linux base platform.
:_os/src/drivers/gpu/intel/_:
An experimental Intel Graphics GPU multiplexer for Broadwell and newer.
:_os/src/driver/framebuffer/virtio/_:
Driver for the Virtio virtual graphics device as supported by Qemu.
:_dde_linux/src/drivers/framebuffer/intel/_:
:_os/src/driver/gpu/intel/_:
An Intel Graphics GPU multiplexer for Broadwell and newer.
:_pc/src/driver/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/driver/usb_host/_:
USB host-controller driver that provides an USB session interface to
USB drivers.
:_dde_linux/src/drivers/usb_hid/_:
:_dde_linux/src/driver/usb_hid/_:
USB Human Interface Device driver using the USB session interface.
@@ -186,14 +195,14 @@ provided by the kernel, or a pseudo time source (busy):
Audio drivers
=============
Audio drivers implement the Audio_out session interface defined at
_os/include/audio_out_session/_ for playback and optionally the audio_in
interface for recording.
Audio drivers use the audio mixer's record session interface defined at
_os/include/record_session/_ for audio output and optionally the play
session interface _os/include/play_session/_ for audio input.
:_os/src/drivers/audio/spec/linux/_:
:_os/src/driver/audio/spec/linux/_:
Uses ALSA as back-end on the Linux base platform and supports only playback.
:_dde_bsd/src/drivers/audio/_:
:_dde_bsd/src/driver/audio/_:
Sound drivers ported from OpenBSD. Currently, the repository
includes support for Intel HD Audio as well as for Ensoniq AudioPCI
(ES1370) compatible sound cards.
@@ -205,24 +214,17 @@ 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/driver/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/_:
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/_:
:_os/src/driver/ahci/_:
Driver for SATA disks and CD-ROMs on x86 PCs.
:_os/src/drivers/nvme/_:
:_os/src/driver/nvme/_:
Driver for NVMe block devices on x86 PCs.
:_os/src/drivers/usb_block/_:
:_os/src/driver/usb_block/_:
USB Mass Storage Bulk-Only driver using the USB session interface and provides
a block-session interface.
@@ -233,38 +235,29 @@ Network interface drivers
All network interface drivers implement the NIC session interface
defined at _os/include/nic_session/_.
:_os/src/drivers/nic/spec/linux/_:
:_os/src/driver/nic/spec/linux/_:
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/driver/nic/lan9118/_:
Native device driver for the LAN9118 network adaptor as featured on the
PBX-A9 platform.
:_dde_ipxe/src/drivers/nic/_:
:_dde_ipxe/src/driver/nic/_:
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/driver/nic/pc/_:
The PC NIC-driver component uses network driver code of the Linux kernel
to drive common network cards as found in commodity PC hardware.
:_pc/src/driver/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/_:
:_dde_linux/src/driver/usb_net/_:
USB network driver using the USB session interface.
:_dde_linux/src/drivers/nic/fec/_:
Driver for ethernet NICs of the i.MX SoC family.
General-purpose I/O drivers
===========================
:_os/src/drivers/gpio/spec/imx53/_:
Driver for accessing the GPIO pins of i.MX53 platforms.
:_os/src/drivers/gpio/spec/rpi/_:
Driver for accessing the GPIO pins of Raspberry Pi platforms.
Resource multiplexers
#####################
@@ -281,9 +274,9 @@ subdirectory of a source repository.
framebuffer and a virtual input interface. Nitpicker (including a README
file) is located at _os/src/server/nitpicker/_.
:Audio output: The audio mixer located at _os/src/server/mixer/_ enables
multiple clients to use the audio-out interface. The mixing is done by simply
adding and clamping the signals of all present clients.
:Audio output: The audio mixer located at _os/src/server/record_play_mixer/_
allows for the routing and mixing of audio signals from play-session clients
to record-session clients.
:Networking: The NIC bridge located at _os/src/server/nic_bridge/_ multiplexes
one NIC session to multiple virtual NIC sessions using a proxy-ARP
@@ -295,6 +288,9 @@ subdirectory of a source repository.
session to multiple virtual NIC sessions by applying network address
translation (NAT).
The NIC-uplink component located at _os/src/server/nic_uplink/_ connects
a NIC client directly to a network driver (as uplink client) without routing.
:Block: The block-device partition server at _os/src/server/part_block/_ reads
the partition table of a block session and exports each partition found as
separate block session. For using this server, please refer to the run
@@ -431,6 +427,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 +472,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.
@@ -498,8 +500,8 @@ Libraries
Library for implementing pseudo-graphical applications (i.e., VIM) that
run on a text terminal.
:_libports/lib/mk/qt5_*/_:
Qt5 framework, using GUI session and NIC session as back end.
:_libports/qt6/_:
Qt6 application framework.
:_libports/lib/mk/vfs_jitterentropy.mk_:
A VFS plugin that makes a jitter-based random-number generator available
@@ -537,14 +539,14 @@ located in their respective directory.
:_demo/src/app/scout/_:
Graphical hypertext browser used for Genode's default demonstration scenario.
:_ports/src/app/gdb_monitor/_:
Application that allows the debugging of a process via GDB over a remote
connection.
:_os/src/monitor/_:
Variant of init that allows for the debugging of components via GDB over a
remote connection.
:_libports/src/app/qt5/qt_launchpad/_:
:_libports/src/app/qt6/qt_launchpad/_:
Graphical application starter implemented using Qt.
:_libports/src/app/qt5/examples/_:
:_libports/src/app/qt6/examples/_:
Several example applications that come with Qt.
:_os/src/app/sequence/_:
@@ -584,6 +586,9 @@ Package-management components
:_gems/src/app/depot_deploy/_:
Subsystem init configuration generator based on blueprints.
:_gems/src/app/depot_remove/_:
Tool for the orderly removal of depot content.
:_libports/src/app/fetchurl/_:
A runtime-configurable frontend to the libcURL library for
downloading content.

View File

@@ -1,70 +1,333 @@
Conventions for the Genode development
Norman Feske
==================================================
Conventions and coding-style guidelines for Genode
==================================================
Documentation
#############
Documentation and naming of files
#################################
We use the GOSH syntax [https://github.com/nfeske/gosh] for documentation and
README files.
We encourage that each directory contains a file called 'README' that briefly
explains what the directory is about.
README files
############
File names
----------
Each directory should contain a file called 'README' that briefly explains
what the directory is about. In 'doc/Makefile' is a rule for
generating a directory overview from the 'README' files automatically.
You can structure your 'README' file by using the GOSH style for subsections:
! Subsection
! ~~~~~~~~~~
Do not use chapters or sections in your 'README' files.
Filenames
#########
All normal filenames are lowercase. Filenames should be chosen to be
expressive. Someone who explores your files for the first time might not
All normal file names are lowercase. Filenames should be chosen to be
expressive. Someone who explores your files for the first time might not
understand what 'mbi.cc' means but 'multiboot_info.cc' would ring a bell. If a
filename contains multiple words, use the '_' to separate them (instead of
file name contains multiple words, use the '_' to separate them (instead of
'miscmath.h', use 'misc_math.h').
Coding style
############
A common coding style helps a lot to ease collaboration. The official coding
style of the Genode base components is described in 'doc/coding_style.txt'.
If you consider working closely together with the Genode main developers,
your adherence to this style is greatly appreciated.
Things to avoid
===============
Please avoid using pre-processor macros. C++ provides language
features for almost any case, for which a C programmer uses
macros.
:Defining constants:
Use 'enum' instead of '#define'
! enum { MAX_COLORS = 3 };
! enum {
! COLOR_RED = 1,
! COLOR_BLUE = 2,
! COLOR_GREEN = 3
! };
:Meta programming:
Use templates instead of pre-processor macros. In contrast to macros,
templates are type-safe and fit well with the implementation syntax.
:Conditional-code inclusion:
Please avoid C-hacker style '#ifdef CONFIG_PLATFROM' - '#endif'
constructs. Instead, factor-out the encapsulated code into a
separate file and introduce a proper function interface.
The build process should then be used to select the appropriate
platform-specific files at compile time. Keep platform dependent
code as small as possible. Never pollute existing generic code
with platform-specific code.
Include files and RPC interfaces
################################
Header of each file
===================
Never place include files directly into the '<repository>/include/' directory
but use a meaningful subdirectory that corresponds to the component that
provides the interfaces.
Each RPC interface is represented by a separate include subdirectory. For
an example, see 'base/include/ram_session/'. The header file that defines
the RPC function interface has the same base name as the directory. The RPC
stubs are called 'client.h' and 'server.h'. If your interface uses a custom
capability type, it is defined in 'capability.h'. Furthermore, if your
interface is a session interface of a service, it is good practice to
provide a connection class in a 'connection.h' file for managing session-
construction arguments and the creation and destruction of sessions.
Specialization-dependent include directories are placed in 'include/<specname>/'.
! /*
! * \brief Short description of the file
! * \author Original author
! * \date Creation date
! *
! * Some more detailed description. This is optional.
! */
Service Names
#############
Identifiers
===========
* The first character of class names are uppercase, any other characters are
lowercase.
* Function and variable names are lower case.
* 'Multi_word_identifiers' use underline to separate words.
* 'CONSTANTS' and template arguments are upper case.
* Private and protected members of a class begin with an '_'-character.
* Accessor methods are named after their corresponding attributes:
! /**
! * Request private member variable
! */
! int value() const { return _value; }
!
! /**
! * Set the private member variable
! */
! void value(int value) { _value = value; }
* Accessors that return a boolean value do not carry an 'is_' prefix. E.g.,
a method for requesting the validity of an object should be named
'valid()', not 'is_valid()'.
Indentation
===========
* Use one tab per indentation step. *Do not mix tabs and spaces!*
* Use no tabs except at the beginning of a line.
* Use spaces for the alignment of continuation lines such as function
arguments that span multiple lines. The alignment spaces of such lines
should start after the (tab-indented) indentation level. For example:
! {
! <tab>function_with_many_arguments(arg1,
! <tab><--- spaces for aligment --->arg2,
! ...
! }
* Remove trailing spaces at the end of lines
This way, each developer can set his preferred tab size in his editor
and the source code always looks good.
_Hint:_ In VIM, use the 'set list' and 'set listchars' commands to make tabs
and spaces visible.
* If class initializers span multiple lines, put the colon on a separate
line and indent the initializers using one tab. For example:
! Complicated_machinery(Material &material, Deadline deadline)
! :
! <tab>_material(material),
! <tab>_deadline(deadline),
! <tab>...
! {
! ...
! }
* Preferably place statements that alter the control flow - such as
'break', 'continue', or 'return' - at the beginning of a separate line,
followed by vertical space (a blank line or the closing brace of the
surrounding scope).
! if (early_return_possible)
! return;
Switch statements
~~~~~~~~~~~~~~~~~
Switch-statement blocks should be indented as follows:
! switch (color) {
!
! case BLUE:
! <tab>break;
!
! case GREEN:
! <tab>{
! <tab><tab>int declaration_required;
! <tab><tab>...
! <tab>}
!
! default:
! }
Please note that the case labels have the same indentation
level as the switch statement. This avoids a two-level
indentation-change at the end of the switch block that
would occur otherwise.
Vertical whitespaces
====================
In header files:
* Leave two empty lines between classes.
* Leave one empty line between member functions.
In implementation files:
* Leave two empty lines between functions.
Braces
======
* Braces after class, struct and function names are placed at a new line:
! class Foo
! {
! public:
!
! void method(void)
! {
! ...
! }
! };
except for one-line functions.
* All other occurrences of open braces (for 'if', 'while', 'do', 'for',
'namespace', 'enum' etc.) are at the end of a line:
! if (flag) {
! ..
! } else {
! ..
! }
* One-line functions should be written on a single line as long as the line
length does not exceed approximately 80 characters.
Typically, this applies for accessor functions.
If slightly more space than one line is needed, indent as follows:
! int heavy_computation(int a, int lot, int of, int args) {
! return a + lot + of + args; }
Comments
========
Function/method header
~~~~~~~~~~~~~~~~~~~~~~
Each public or protected (but no private) method in a header-file should be
prepended by a header as follows:
! /**
! * Short description
! *
! * \param a meaning of parameter a
! * \param b meaning of parameter b
! * \param c,d meaning of parameters c and d
! *
! * \throw Exception_type meaning of the exception
! *
! * \return meaning of return value
! *
! * More detailed information about the function. This is optional.
! */
Descriptions of parameters and return values should be lower-case and brief.
More elaborative descriptions can be documented in the text area below.
In implementation files, only local and private functions should feature
function headers.
Single-line comments
~~~~~~~~~~~~~~~~~~~~
! /* use this syntax for single line comments */
A single-line comment should be prepended by an empty line.
Single-line comments should be short - no complete sentences. Use lower-case.
C++-style comments ('//') should only be used for temporarily commenting-out
code. Such commented-out garbage is easy to 'grep' and there are handy
'vim'-macros available for creating and removing such comments.
Variable descriptions
~~~~~~~~~~~~~~~~~~~~~
Use the same syntax as for single-line comments. Insert two or more
spaces before your comment starts.
! int size; /* in kilobytes */
Multi-line comments
~~~~~~~~~~~~~~~~~~~
Multi-line comments are more detailed descriptions in the form of
sentences.
A multi-line comment should be enclosed by empty lines.
! /*
! * This is some tricky
! * algorithm that works
! * as follows:
! * ...
! */
The first and last line of a multi-line comment contain no words.
Source-code blocks
~~~~~~~~~~~~~~~~~~
For structuring your source code, you can entitle the different
parts of a file like this:
! <- two empty lines
!
! /********************
! ** Event handlers **
! ********************/
! <- one empty line
Note the two stars at the left and right. There are two of them to
make the visible width of the border match its height (typically,
characters are ca. twice as high as wide).
A source-code block header represents a headline for the following
code. To couple this headline with the following code closer than
with previous code, leave two empty lines above and one empty line
below the source-code block header.
Order of public, protected, and private blocks
==============================================
For consistency reasons, use the following class layout:
! class Sandstein
! {
! private:
! ...
! protected:
! ...
! public:
! };
Typically, the private section contains member variables that are used
by public accessor functions below. In this common case, we only reference
symbols that are defined above as it is done when programming plain C.
Leave one empty line (or a line that contains only a brace) above and below
a 'private', 'protected', or 'public' label. This also applies when the
label is followed by a source-code block header.
Naming of Genode services
=========================
Service names as announced via the 'parent()->announce()' function follow
the following convention:

View File

@@ -1,514 +0,0 @@
============================
Package management on Genode
============================
Norman Feske
Motivation and inspiration
##########################
The established system-integration work flow with Genode is based on
the 'run' tool, which automates the building, configuration, integration,
and testing of Genode-based systems. Whereas the run tool succeeds in
overcoming the challenges that come with Genode's diversity of kernels and
supported hardware platforms, its scalability is somewhat limited to
appliance-like system scenarios: The result of the integration process is
a system image with a certain feature set. Whenever requirements change,
the system image is replaced with a new created image that takes those
requirements into account. In practice, there are two limitations of this
system-integration approach:
First, since the run tool implicitly builds all components required for a
system scenario, the system integrator has to compile all components from
source. E.g., if a system includes a component based on Qt5, one needs to
compile the entire Qt5 application framework, which induces significant
overhead to the actual system-integration tasks of composing and configuring
components.
Second, general-purpose systems tend to become too complex and diverse to be
treated as system images. When looking at commodity OSes, each installation
differs with respect to the installed set of applications, user preferences,
used device drivers and system preferences. A system based on the run tool's
work flow would require the user to customize the run script of the system for
each tweak. To stay up to date, the user would need to re-create the
system image from time to time while manually maintaining any customizations.
In practice, this is a burden, very few end users are willing to endure.
The primary goal of Genode's package management is to overcome these
scalability limitations, in particular:
* Alleviating the need to build everything that goes into system scenarios
from scratch,
* Facilitating modular system compositions while abstracting from technical
details,
* On-target system update and system development,
* Assuring the user that system updates are safe to apply by providing the
ability to easily roll back the system or parts thereof to previous versions,
* Securing the integrity of the deployed software,
* Fostering a federalistic evolution of Genode systems,
* Low friction for existing developers.
The design of Genode's package-management concept is largely influenced by Git
as well as the [https://nixos.org/nix/ - Nix] package manager. In particular
the latter opened our eyes to discover the potential that lies beyond the
package management employed in state-of-the art commodity systems. Even though
we considered adapting Nix for Genode and actually conducted intensive
experiments in this direction (thanks to Emery Hemingway who pushed forward
this line of work), we settled on a custom solution that leverages Genode's
holistic view on all levels of the operating system including the build system
and tooling, source structure, ABI design, framework API, system
configuration, inter-component interaction, and the components itself. Whereby
Nix is designed for being used on top of Linux, Genode's whole-systems view
led us to simplifications that eliminated the needs for Nix' powerful features
like its custom description language.
Nomenclature
############
When speaking about "package management", one has to clarify what a "package"
in the context of an operating system represents. Traditionally, a package
is the unit of delivery of a bunch of "dumb" files, usually wrapped up in
a compressed archive. A package may depend on the presence of other
packages. Thereby, a dependency graph is formed. To express how packages fit
with each other, a package is usually accompanied with meta data
(description). Depending on the package manager, package descriptions follow
certain formalisms (e.g., package-description language) and express
more-or-less complex concepts such as versioning schemes or the distinction
between hard and soft dependencies.
Genode's package management does not follow this notion of a "package".
Instead of subsuming all deliverable content under one term, we distinguish
different kinds of content, each in a tailored and simple form. To avoid the
clash of the notions of the common meaning of a "package", we speak of
"archives" as the basic unit of delivery. The following subsections introduce
the different categories.
Archives are named with their version as suffix, appended via a slash. The
suffix is maintained by the author of the archive. The recommended naming
scheme is the use of the release date as version suffix, e.g.,
'report_rom/2017-05-14'.
Raw-data archives
=================
A raw-data archive contains arbitrary data that is - in contrast to executable
binaries - independent from the processor architecture. Examples are
configuration data, game assets, images, or fonts. The content of raw-data
archives is expected to be consumed by components at runtime. It is not
relevant for the build process for executable binaries. Each raw-data
archive contains merely a collection of data files. There is no meta data.
API archive
===========
An API archive has the structure of a Genode source-code repository. It may
contain all the typical content of such a source-code repository such as header
files (in the _include/_ subdirectory), source codes (in the _src/_
subdirectory), library-description files (in the _lib/mk/_ subdirectory), or
ABI symbols (_lib/symbols/_ subdirectory). At the top level, a LICENSE file is
expected that clarifies the license of the contained source code. There is no
meta data contained in an API archive.
An API archive is meant to provide _ingredients_ for building components. The
canonical example is the public programming interface of a library (header
files) and the library's binary interface in the form of an ABI-symbols file.
One API archive may contain the interfaces of multiple libraries. For example,
the interfaces of libc and libm may be contained in a single "libc" API
archive because they are closely related to each other. Conversely, an API
archive may contain a single header file only. The granularity of those
archives may vary. But they have in common that they are used at build time
only, not at runtime.
Source archive
==============
Like an API archive, a source archive has the structure of a Genode
source-tree repository and is expected to contain all the typical content of
such a source repository along with a LICENSE file. But unlike an API archive,
it contains descriptions of actual build targets in the form of Genode's usual
'target.mk' files.
In addition to the source code, a source archive contains a file
called 'used_apis', which contains a list of API-archive names with each
name on a separate line. For example, the 'used_apis' file of the 'report_rom'
source archive looks as follows:
! base/2017-05-14
! os/2017-05-13
! report_session/2017-05-13
The 'used_apis' file declares the APIs needed to incorporate into the build
process when building the source archive. Hence, they represent _build-time_
_dependencies_ on the specific API versions.
A source archive may be equipped with a top-level file called 'api' containing
the name of exactly one API archive. If present, it declares that the source
archive _implements_ the specified API. For example, the 'libc/2017-05-14'
source archive contains the actual source code of the libc and libm as well as
an 'api' file with the content 'libc/2017-04-13'. The latter refers to the API
implemented by this version of the libc source package (note the differing
versions of the API and source archives)
Binary archive
==============
A binary archive contains the build result of the equally-named source archive
when built for a particular architecture. That is, all files that would appear
at the _<build-dir>/bin/_ subdirectory when building all targets present in
the source archive. There is no meta data present in a binary archive.
A binary archive is created out of the content of its corresponding source
archive and all API archives listed in the source archive's 'used_apis' file.
Note that since a binary archive depends on only one source archive, which
has no further dependencies, all binary archives can be built independently
from each other.
For example, a libc-using application needs the source code of the
application as well as the libc's API archive (the libc's header file and
ABI) but it does not need the actual libc library to be present.
Package archive
===============
A package archive contains an 'archives' file with a list of archive names
that belong together at runtime. Each listed archive appears on a separate line.
For example, the 'archives' file of the package archive for the window
manager 'wm/2018-02-26' looks as follows:
! genodelabs/raw/wm/2018-02-14
! genodelabs/src/wm/2018-02-26
! genodelabs/src/report_rom/2018-02-26
! genodelabs/src/decorator/2018-02-26
! genodelabs/src/floating_window_layouter/2018-02-26
In contrast to the list of 'used_apis' of a source archive, the content of
the 'archives' file denotes the origin of the respective archives
("genodelabs"), the archive type, followed by the versioned name of the
archive.
An 'archives' file may specify raw archives, source archives, or package
archives (as type 'pkg'). It thereby allows the expression of _runtime
dependencies_. If a package archive lists another package archive, it inherits
the content of the listed archive. This way, a new package archive may easily
customize an existing package archive.
A package archive does not specify binary archives directly as they differ
between the architecture and are already referenced by the source archives.
In addition to an 'archives' file, a package archive is expected to contain
a 'README' file explaining the purpose of the collection.
Depot structure
###############
Archives are stored within a directory tree called _depot/_. The depot
is structured as follows:
! <user>/pubkey
! <user>/download
! <user>/src/<name>/<version>/
! <user>/api/<name>/<version>/
! <user>/raw/<name>/<version>/
! <user>/pkg/<name>/<version>/
! <user>/bin/<arch>/<src-name>/<src-version>/
The <user> stands for the origin of the contained archives. For example, the
official archives provided by Genode Labs reside in a _genodelabs/_
subdirectory. Within this directory, there is a 'pubkey' file with the
user's public key that is used to verify the integrity of archives downloaded
from the user. The file 'download' specifies the download location as an URL.
Subsuming archives in a subdirectory that correspond to their the origin
(user) serves two purposes. First, it provides a user-local name space for
versioning archives. E.g., there might be two versions of a
'nitpicker/2017-04-15' source archive, one by "genodelabs" and one by
"nfeske". However, since each version resides under its origin's subdirectory,
version-naming conflicts between different origins cannot happen. Second, by
allowing multiple archive origins in the depot side-by-side, package archives
may incorporate archives of different origins, which fosters the goal of a
federalistic development, where contributions of different origins can be
easily combined.
The actual archives are stored in the subdirectories named after the archive
types ('raw', 'api', 'src', 'bin', 'pkg'). Archives contained in the _bin/_
subdirectories are further subdivided in the various architectures (like
'x86_64', or 'arm_v7').
Depot management
################
The tools for managing the depot content reside under the _tool/depot/_
directory. When invoked without arguments, each tool prints a brief
description of the tool and its arguments.
Unless stated otherwise, the tools are able to consume any number of archives
as arguments. By default, they perform their work sequentially. This can be
changed by the '-j<N>' argument, where <N> denotes the desired level of
parallelization. For example, by specifying '-j4' to the _tool/depot/build_
tool, four concurrent jobs are executed during the creation of binary archives.
Downloading archives
====================
The depot can be populated with archives in two ways, either by creating
the content from locally available source codes as explained by Section
[Automated extraction of archives from the source tree], or by downloading
ready-to-use archives from a web server.
In order to download archives originating from a specific user, the depot's
corresponding user subdirectory must contain two files:
:_pubkey_: contains the public key of the GPG key pair used by the creator
(aka "user") of the to-be-downloaded archives for signing the archives. The
file contains the ASCII-armored version of the public key.
:_download_: contains the base URL of the web server where to fetch archives
from. The web server is expected to mirror the structure of the depot.
That is, the base URL is followed by a sub directory for the user,
which contains the archive-type-specific subdirectories.
If both the public key and the download locations are defined, the download
tool can be used as follows:
! ./tool/depot/download genodelabs/src/zlib/2018-01-10
The tool automatically downloads the specified archives and their
dependencies. For example, as the zlib depends on the libc API, the libc API
archive is downloaded as well. All archive types are accepted as arguments
including binary and package archives. Furthermore, it is possible to download
all binary archives referenced by a package archive. For example, the
following command downloads the window-manager (wm) package archive including
all binary archives for the 32-bit x86 architecture. Downloaded binary
archives are always accompanied with their corresponding source and used API
archives.
! ./tool/depot/download genodelabs/pkg/x86_64/wm/2018-02-26
Archive content is not downloaded directly to the depot. Instead, the
individual archives and signature files are downloaded to a quarantine area in
the form of a _public/_ directory located in the root of Genode's source tree.
As its name suggests, the _public/_ directory contains data that is imported
from or to-be exported to the public. The download tool populates it with the
downloaded archives in their compressed form accompanied with their
signatures.
The compressed archives are not extracted before their signature is checked
against the public key defined at _depot/<user>/pubkey_. If however the
signature is valid, the archive content is imported to the target destination
within the depot. This procedure ensures that depot content - whenever
downloaded - is blessed by a cryptographic signature of its creator.
Building binary archives from source archives
=============================================
With the depot populated with source and API archives, one can use the
_tool/depot/build_ tool to produce binary archives. The arguments have the
form '<user>/bin/<arch>/<src-name>' where '<arch>' stands for the targeted
CPU architecture. For example, the following command builds the 'zlib'
library for the 64-bit x86 architecture. It executes four concurrent jobs
during the build process.
! ./tool/depot/build genodelabs/bin/x86_64/zlib/2018-01-10 -j4
Note that the command expects a specific version of the source archive as
argument. The depot may contain several versions. So the user has to decide,
which one to build.
After the tool is finished, the freshly built binary archive can be found in
the depot within the _genodelabs/bin/<arch>/<src>/<version>/_ subdirectory.
Only the final result of the built process is preserved. In the example above,
that would be the _zlib.lib.so_ library.
For debugging purposes, it might be interesting to inspect the intermediate
state of the build. This is possible by adding 'KEEP_BUILD_DIR=1' as argument
to the build command. The binary's intermediate build directory can be
found besides the binary archive's location named with a '.build' suffix.
By default, the build tool won't attempt to rebuild a binary archive that is
already present in the depot. However, it is possible to force a rebuild via
the 'REBUILD=1' argument.
Publishing archives
===================
Archives located in the depot can be conveniently made available to the public
using the _tool/depot/publish_ tool. Given an archive path, the tool takes
care of determining all archives that are implicitly needed by the specified
one, wrapping the archive's content into compressed tar archives, and signing
those.
As a precondition, the tool requires you to possess the private key that
matches the _depot/<you>/pubkey_ file within your depot. The key pair should
be present in the key ring of your GNU privacy guard.
To publish archives, one needs to specify the specific version to publish.
For example:
! ./tool/depot/publish <you>/pkg/x86_64/wm/2018-02-26
The command checks that the specified archive and all dependencies are present
in the depot. It then proceeds with the archiving and signing operations. For
the latter, the pass phrase for your private key will be requested. The
publish tool prints the information about the processed archives, e.g.:
! publish /.../public/<you>/api/base/2018-02-26.tar.xz
! publish /.../public/<you>/api/framebuffer_session/2017-05-31.tar.xz
! publish /.../public/<you>/api/gems/2018-01-28.tar.xz
! publish /.../public/<you>/api/input_session/2018-01-05.tar.xz
! publish /.../public/<you>/api/nitpicker_gfx/2018-01-05.tar.xz
! publish /.../public/<you>/api/nitpicker_session/2018-01-05.tar.xz
! publish /.../public/<you>/api/os/2018-02-13.tar.xz
! publish /.../public/<you>/api/report_session/2018-01-05.tar.xz
! publish /.../public/<you>/api/scout_gfx/2018-01-05.tar.xz
! publish /.../public/<you>/bin/x86_64/decorator/2018-02-26.tar.xz
! publish /.../public/<you>/bin/x86_64/floating_window_layouter/2018-02-26.tar.xz
! publish /.../public/<you>/bin/x86_64/report_rom/2018-02-26.tar.xz
! publish /.../public/<you>/bin/x86_64/wm/2018-02-26.tar.xz
! publish /.../public/<you>/pkg/wm/2018-02-26.tar.xz
! publish /.../public/<you>/raw/wm/2018-02-14.tar.xz
! publish /.../public/<you>/src/decorator/2018-02-26.tar.xz
! publish /.../public/<you>/src/floating_window_layouter/2018-02-26.tar.xz
! publish /.../public/<you>/src/report_rom/2018-02-26.tar.xz
! publish /.../public/<you>/src/wm/2018-02-26.tar.xz
According to the output, the tool populates a directory called _public/_
at the root of the Genode source tree with the to-be-published archives.
The content of the _public/_ directory is now ready to be copied to a
web server, e.g., by using rsync.
Automated extraction of archives from the source tree
#####################################################
Genode users are expected to populate their local depot with content obtained
via the _tool/depot/download_ tool. However, Genode developers need a way to
create depot archives locally in order to make them available to users. Thanks
to the _tool/depot/extract_ tool, the assembly of archives does not need to be
a manual process. Instead, archives can be conveniently generated out of the
source codes present in the Genode source tree and the _contrib/_ directory.
However, the granularity of splitting source code into archives, the
definition of what a particular API entails, and the relationship between
archives must be augmented by the archive creator as this kind of information
is not present in the source tree as is. This is where so-called "archive
recipes" enter the picture. An archive recipe defines the content of an
archive. Such recipes can be located at an _recipes/_ subdirectory of any
source-code repository, similar to how port descriptions and run scripts
are organized. Each _recipe/_ directory contains subdirectories for the
archive types, which, in turn, contain a directory for each archive. The
latter is called a _recipe directory_.
Recipe directory
----------------
The recipe directory is named after the archive _omitting the archive version_
and contains at least one file named _hash_. This file defines the version
of the archive along with a hash value of the archive's content
separated by a space character. By tying the version name to a particular hash
value, the _extract_ tool is able to detect the appropriate points in time
whenever the version should be increased due to a change of the archive's
content.
API, source, and raw-data archive recipes
-----------------------------------------
Recipe directories for API, source, or raw-data archives contain a
_content.mk_ file that defines the archive content in the form of make
rules. The content.mk file is executed from the archive's location within
the depot. Hence, the contained rules can refer to archive-relative files as targets.
The first (default) rule of the content.mk file is executed with a customized
make environment:
:GENODE_DIR: A variable that holds the path to root of the Genode source tree,
:REP_DIR: A variable with the path to source code repository where the recipe
is located
:port_dir: A make function that returns the directory of a port within the
_contrib/_ directory. The function expects the location of the
corresponding port file as argument, for example, the 'zlib' recipe
residing in the _libports/_ repository may specify '$(REP_DIR)/ports/zlib'
to access the 3rd-party zlib source code.
Source archive recipes contain simplified versions of the 'used_apis' and
(for libraries) 'api' files as found in the archives. In contrast to the
depot's counterparts of these files, which contain version-suffixed names,
the files contained in recipe directories omit the version suffix. This
is possible because the extract tool always extracts the _current_ version
of a given archive from the source tree. This current version is already
defined in the corresponding recipe directory.
Package-archive recipes
-----------------------
The recipe directory for a package archive contains the verbatim content of
the to-be-created package archive except for the _archives_ file. All other
files are copied verbatim to the archive. The content of the recipe's
_archives_ file may omit the version information from the listed ingredients.
Furthermore, the user part of each entry can be left blank by using '_' as a
wildcard. When generating the package archive from the recipe, the extract
tool will replace this wildcard with the user that creates the archive.
Convenience front-end to the extract, build tools
#################################################
For developers, the work flow of interacting with the depot is most often the
combination of the _extract_ and _build_ tools whereas the latter expects
concrete version names as arguments. The _create_ tool accelerates this common
usage pattern by allowing the user to omit the version names. Operations
implicitly refer to the _current_ version of the archives as defined in
the recipes.
Furthermore, the _create_ tool is able to manage version updates for the
developer. If invoked with the argument 'UPDATE_VERSIONS=1', it automatically
updates hash files of the involved recipes by taking the current date as
version name. This is a valuable assistance in situations where a commonly
used API changes. In this case, the versions of the API and all dependent
archives must be increased, which would be a labour-intensive task otherwise.
If the depot already contains an archive of the current version, the create
tools won't re-create the depot archive by default. Local modifications of
the source code in the repository do not automatically result in a new archive.
To ensure that the depot archive is current, one can specify 'FORCE=1' to
the create tool. With this argument, existing depot archives are replaced by
freshly extracted ones and version updates are detected. When specified for
creating binary archives, 'FORCE=1' normally implies 'REBUILD=1'. To prevent
the superfluous rebuild of binary archives whose source versions remain
unchanged, 'FORCE=1' can be combined with the argument 'REBUILD='.
Accessing depot content from run scripts
########################################
The depot tools are not meant to replace the run tool but rather to complement
it. When both tools are combined, the run tool implicitly refers to "current"
archive versions as defined for the archive's corresponding recipes. This way,
the regular run-tool work flow can be maintained while attaining a
productivity boost by fetching content from the depot instead of building it.
Run scripts can use the 'import_from_depot' function to incorporate archive
content from the depot into a scenario. The function must be called after the
'create_boot_directory' function and takes any number of pkg, src, or raw
archives as arguments. An archive is specified as depot-relative path of the
form '<user>/<type>/name'. Run scripts may call 'import_from_depot'
repeatedly. Each argument can refer to a specific version of an archive or
just the version-less archive name. In the latter case, the current version
(as defined by a corresponding archive recipe in the source tree) is used.
If a 'src' archive is specified, the run tool integrates the content of
the corresponding binary archive into the scenario. The binary archives
are selected according the spec values as defined for the build directory.

View File

@@ -1,153 +0,0 @@
=============================
How to start exploring Genode
=============================
Norman Feske
Abstract
########
This guide is meant to provide you a painless start with using the Genode OS
Framework. It explains the steps needed to get a simple demo system running
on Linux first, followed by the instructions on how to run the same scenario
on a microkernel.
Quick start to build Genode for Linux
#####################################
The best starting point for exploring Genode is to run it on Linux. Make sure
that your system satisfies the following requirements:
* GNU Make version 3.81 or newer
* 'libSDL-dev'
* 'tclsh' and 'expect'
* 'byacc' (only needed for the L4/Fiasco kernel)
* 'qemu' and 'xorriso' (for testing non-Linux platforms via Qemu)
For using the entire collection of ported 3rd-party software, the following
packages should be installed additionally: 'autoconf2.64', 'autogen', 'bison',
'flex', 'g++', 'git', 'gperf', 'libxml2-utils', 'subversion', and 'xsltproc'.
Your exploration of Genode starts with obtaining the source code of the
[https://sourceforge.net/projects/genode/files/latest/download - latest version]
of the framework. For detailed instructions and alternatives to the
download from Sourceforge please refer to [https://genode.org/download].
Furthermore, you will need to install the official Genode tool chain, which
you can download at [https://genode.org/download/tool-chain].
The Genode build system never touches the source tree but generates object
files, libraries, and programs in a dedicated build directory. We do not have a
build directory yet. For a quick start, let us create one for the Linux base
platform:
! cd <genode-dir>
! ./tool/create_builddir x86_64
This creates a new build directory for building x86_64 binaries in './build'.
The build system creates unified binaries that work on the given
architecture independent from the underlying base platform, in this case Linux.
Now change into the fresh build directory:
! cd build/x86_64
Please uncomment the following line in 'etc/build.conf' to make the
build process as smooth as possible.
! RUN_OPT += --depot-auto-update
To give Genode a try, build and execute a simple demo scenario via:
! make KERNEL=linux BOARD=linux run/demo
By invoking 'make' with the 'run/demo' argument, all components needed by the
demo scenario are built and the demo is executed. This includes all components
which are implicitly needed by the base platform. The base platform that the
components will be executed upon on is selected via the 'KERNEL' and 'BOARD'
variables. If you are interested in looking behind the scenes of the demo
scenario, please refer to 'doc/build_system.txt' and the run script at
'os/run/demo.run'.
Using platforms other than Linux
================================
Running Genode on Linux is the most convenient way to get acquainted with the
framework. However, the point where Genode starts to shine is when used as the
user land executed on a microkernel. The framework supports a variety of
different kernels such as L4/Fiasco, L4ka::Pistachio, OKL4, and NOVA. Those
kernels largely differ in terms of feature sets, build systems, tools, and boot
concepts. To relieve you from dealing with those peculiarities, Genode provides
you with an unified way of using them. For each kernel platform, there exists
a dedicated description file that enables the 'prepare_port' tool to fetch and
prepare the designated 3rd-party sources. Just issue the following command
within the toplevel directory of the Genode source tree:
! ./tool/ports/prepare_port <platform>
Note that each 'base-<platform>' directory comes with a 'README' file, which
you should revisit first when exploring the base platform. Additionally, most
'base-<platform>' directories provide more in-depth information within their
respective 'doc/' subdirectories.
For the VESA driver on x86, the x86emu library is required and can be
downloaded and prepared by again invoking the 3rd-party sources preparation
tool:
! ./tool/ports/prepare_port x86emu
On x86 base platforms the GRUB2 boot loader is required and can be
downloaded and prepared by invoking:
! ./tool/ports/prepare_port grub2
Now that the base platform is prepared, the 'create_builddir' tool can be used
to create a build directory for your architecture of choice by giving the
architecture as argument. To see the list of available architecture, execute
'create_builddir' with no arguments. Note, that not all kernels support all
architectures.
For example, to give the demo scenario a spin on the OKL4 kernel, the following
steps are required:
# Download the kernel:
! cd <genode-dir>
! ./tool/ports/prepare_port okl4
# Create a build directory
! ./tool/create_builddir x86_32
# Uncomment the following line in 'x86_32/etc/build.conf'
! REPOSITORIES += $(GENODE_DIR)/repos/libports
# Build and execute the demo using Qemu
! make -C build/x86_32 KERNEL=okl4 BOARD=pc run/demo
The procedure works analogously for the other base platforms. You can, however,
reuse the already created build directory and skip its creation step if the
architecture matches.
How to proceed with exploring Genode
####################################
Now that you have taken the first steps into using Genode, you may seek to
get more in-depth knowledge and practical experience. The foundation for doing
so is a basic understanding of the build system. The documentation at
'build_system.txt' provides you with the information about the layout of the
source tree, how new components are integrated, and how complete system
scenarios can be expressed. Equipped with this knowledge, it is time to get
hands-on experience with creating custom Genode components. A good start is the
'hello_tutorial', which shows you how to implement a simple client-server
scenario. To compose complex scenarios out of many small components, the
documentation of the Genode's configuration concept at 'os/doc/init.txt' is an
essential reference.
Certainly, you will have further questions on your way with exploring Genode.
The best place to get these questions answered is the Genode mailing list.
Please feel welcome to ask your questions and to join the discussions:
:Genode Mailing Lists:
[https://genode.org/community/mailing-lists]

View File

@@ -1,236 +0,0 @@
==========================
Google Summer of Code 2012
==========================
Genode Labs has applied as mentoring organization for the Google Summer of Code
program in 2012. This document summarizes all information important to Genode's
participation in the program.
:[http://www.google-melange.com/gsoc/homepage/google/gsoc2012]:
Visit the official homepage of the Google Summer of Code program.
*Update* Genode Labs was not accepted as mentoring organization for GSoC 2012.
Application of Genode Labs as mentoring organization
####################################################
:Organization ID: genodelabs
:Organization name: Genode Labs
:Organization description:
Genode Labs is a self-funded company founded by the original creators of the
Genode OS project. Its primary mission is to bring the Genode operating-system
technology, which started off as an academic research project, to the real
world. At present, Genode Labs is the driving force behind the Genode OS
project.
:Organization home page url:
http://www.genode-labs.com
:Main organization license:
GNU General Public License version 2
:Admins:
nfeske, chelmuth
:What is the URL for your Ideas page?:
[http://genode.org/community/gsoc_2012]
:What is the main IRC channel for your organization?:
#genode
:What is the main development mailing list for your organization?:
genode-main@lists.sourceforge.net
:Why is your organization applying to participate? What do you hope to gain?:
During the past three months, our project underwent the transition from a
formerly company-internal development to a completely open and transparent
endeavour. By inviting a broad community for participation in shaping the
project, we hope to advance Genode to become a broadly used and recognised
technology. GSoC would help us to build our community.
The project has its roots at the University of Technology Dresden where the
Genode founders were former members of the academic research staff. We have
a long and successful track record with regard to supervising students. GSoC
would provide us with the opportunity to establish and cultivate
relationships to new students and to spawn excitement about Genode OS
technology.
:Does your organization have an application templateo?:
GSoC student projects follow the same procedure as regular community
contributions, in particular the student is expected to sign the Genode
Contributor's Agreement. (see [http://genode.org/community/contributions])
:What criteria did you use to select your mentors?:
We selected the mentors on the basis of their long-time involvement with the
project and their time-tested communication skills. For each proposed working
topic, there is least one stakeholder with profound technical background within
Genode Labs. This person will be the primary contact person for the student
working on the topic. However, we will encourgage the student to make his/her
development transparant to all community members (i.e., via GitHub). So
So any community member interested in the topic is able to bring in his/her
ideas at any stage of development. Consequently, in practive, there will be
multiple persons mentoring each students.
:What is your plan for dealing with disappearing students?:
Actively contact them using all channels of communication available to us,
find out the reason for disappearance, trying to resolve the problems. (if
they are related to GSoC or our project for that matter).
:What is your plan for dealing with disappearing mentors?:
All designated mentors are local to Genode Labs. So the chance for them to
disappear to very low. However, if a mentor disappears for any serious reason
(i.e., serious illness), our organization will provide a back-up mentor.
:What steps will you take to encourage students to interact with your community?:
First, we discussed GSoC on our mailing list where we received an overly
positive response. We checked back with other Open-Source projects related to
our topics, exchanged ideas, and tried to find synergies between our
respective projects. For most project ideas, we have created issues in our
issue tracker to collect technical information and discuss the topic.
For several topics, we already observed interests of students to participate.
During the work on the topics, the mentors will try to encourage the
students to play an active role in discussions on our mailing list, also on
topics that are not strictly related to the student project. We regard an
active participation as key to to enable new community members to develop a
holistic view onto our project and gather a profound understanding of our
methodologies.
Student projects will be carried out in a transparent fashion at GitHub.
This makes it easy for each community member to get involved, discuss
the rationale behind design decisions, and audit solutions.
Topics
######
While discussing GSoC participation on our mailing list, we identified the
following topics as being well suited for GSoC projects. However, if none of
those topics receives resonance from students, there is more comprehensive list
of topics available at our road map and our collection of future challenges:
:[http://genode.org/about/road-map]: Road-map
:[http://genode.org/about/challenges]: Challenges
Combining Genode with the HelenOS/SPARTAN kernel
================================================
[http://www.helenos.org - HelenOS] is a microkernel-based multi-server OS
developed at the university of Prague. It is based on the SPARTAN microkernel,
which runs on a wide variety of CPU architectures including Sparc, MIPS, and
PowerPC. This broad platform support makes SPARTAN an interesting kernel to
look at alone. But a further motivation is the fact that SPARTAN does not
follow the classical L4 road, providing a kernel API that comes with an own
terminology and different kernel primitives. This makes the mapping of
SPARTAN's kernel API to Genode a challenging endeavour and would provide us
with feedback regarding the universality of Genode's internal interfaces.
Finally, this project has the potential to ignite a further collaboration
between the HelenOS and Genode communities.
Block-level encryption
======================
Protecting privacy is one of the strongest motivational factors for developing
Genode. One pivotal element with that respect is the persistence of information
via block-level encryption. For example, to use Genode every day at Genode
Labs, it's crucial to protect the confidentiality of some information that's
not part of the Genode code base, e.g., emails and reports. There are several
expansion stages imaginable to reach the goal and the basic building blocks
(block-device interface, ATA/SATA driver for Qemu) are already in place.
:[https://github.com/genodelabs/genode/issues/55 - Discuss the issue...]:
Virtual NAT
===========
For sharing one physical network interface among multiple applications, Genode
comes with a component called nic_bridge, which implements proxy ARP. Through
this component, each application receives a distinct (virtual) network
interface that is visible to the real network. I.e., each application requests
an IP address via a DHCP request at the local network. An alternative approach
would be a component that implements NAT on Genode's NIC session interface.
This way, the whole Genode system would use only one IP address visible to the
local network. (by stacking multiple nat and nic_bridge components together, we
could even form complex virtual networks inside a single Genode system)
The implementation of the virtual NAT could follow the lines of the existing
nic_bridge component. For parsing network packets, there are already some handy
utilities available (at os/include/net/).
:[https://github.com/genodelabs/genode/issues/114 - Discuss the issue...]:
Runtime for the Go or D programming language
============================================
Genode is implemented in C++. However, we are repeatedly receiving requests
for offering more safe alternatives for implementing OS-level functionality
such as device drivers, file systems, and other protocol stacks. The goals
for this project are to investigate the Go and D programming languages with
respect to their use within Genode, port the runtime of of those languages
to Genode, and provide a useful level of integration with Genode.
Block cache
===========
Currently, there exists only the iso9660 server that is able to cache block
accesses. A generic solution for caching block-device accesses would be nice.
One suggestion is a component that requests a block session (routed to a block
device driver) as back end and also announces a block service (front end)
itself. Such a block-cache server waits for requests at the front end and
forwards them to the back end. But it uses its own memory to cache blocks.
The first version could support only read-only block devices (such as CDROM) by
caching the results of read accesses. In this version, we already need an
eviction strategy that kicks in once the block cache gets saturated. For a
start this could be FIFO or LRU (least recently used).
A more sophisticated version would support write accesses, too. Here we need a
way to sync blocks to the back end at regular intervals in order to guarantee
that all block-write accesses are becoming persistent after a certain time. We
would also need a way to explicitly flush the block cache (i.e., when the
front-end block session gets closed).
:[https://github.com/genodelabs/genode/issues/113 - Discuss the issue...]:
; _Since Genode Labs was not accepted as GSoC mentoring organization, the_
; _following section has become irrelevant. Hence, it is commented-out_
;
; Student applications
; ####################
;
; The formal steps for applying to the GSoC program will be posted once Genode
; Labs is accepted as mentoring organization. If you are a student interested
; in working on a Genode-related GSoC project, now is a good time to get
; involved with the Genode community. The best way is joining the discussions
; at our mailing list and the issue tracker. This way, you will learn about
; the currently relevant topics, our discussion culture, and the people behind
; the project.
;
; :[http://genode.org/community/mailing-lists]: Join our mailing list
; :[https://github.com/genodelabs/genode/issues]: Discuss issues around Genode

View File

@@ -4,13 +4,784 @@
===========
Genode OS Framework release 24.11 | 2024-11-22
##############################################
| With mirrored and panoramic multi-monitor setups, pointer grabbing,
| atomic blitting and panning, and panel-self-refresh support, Genode's GUI
| stack gets ready for the next decade. Hardware-wise, version 24.11 brings
| a massive driver update for the i.MX SoC family. As a special highlight, the
| release is accompanied by the first edition of the free book "Genode
| Applications" as a gateway for application developers into Genode.
Closing up the Year of Sculpt OS usability as the theme of our road map
for 2024, we are excited to unveil the results of two intense lines of
usability-concerned work with the release of Genode 24.11.
For the usability of the Genode-based Sculpt OS as day-to-day operating
system, the support of multi-monitor setups has been an unmet desire
for a long time. Genode 24.11 does not only deliver a solution as a
singular feature but improves the entire GUI stack in a holistic way,
addressing panel self-refresh, mechanisms needed to overcome tearing
artifacts, rigid resource partitioning between GUI applications, up to
pointer-grabbing support.
The second line of work addresses the usability of application development for
Genode and Sculpt OS in particular. Over the course of the year, our Goa SDK
has seen a succession of improvements that make the development, porting,
debugging, and publishing of software a breeze. Still, given Genode's
novelties, the learning curve to get started has remained challenging. Our new
book "Genode Applications" is intended as a gateway into the world of Genode
for those of us who enjoy dwelling in architectural beauty but foremost want
to get things done. It features introductory material, explains fundamental
concepts and components, and invites the reader on to a ride through a series
of beginner-friendly as well as advanced tutorials. The book can be downloaded
for free at [https://genode.org].
Regarding hardware support, our work during the release cycle was hugely
motivated by the prospect of bringing Genode to the MNT Pocket Reform laptop,
which is based on the NXP i.MX8MP SoC. Along this way, we upgraded all
Linux-based i.MX drivers to kernel version 6.6 while consolidating a variety
of vendor kernels, equipped our platform driver with watchdog support, and
added board support for this platform to Sculpt OS.
You can find these among more topics covered in the detailed
[https:/documentation/release-notes/24.11 - release documentation of version 24.11...]
Sculpt OS release 24.10 | 2024-10-30
####################################
| Thanks to a largely revamped GUI stack, the Genode-based
| Sculpt OS 24.10 has gained profound support for multi-monitor setups.
Among the many usability-related topics on our road map, multi-monitor
support is certainly the most anticipated feature. It motivated a holistic
modernization of Genode's GUI stack over several months, encompassing drivers,
the GUI multiplexer, inter-component interfaces, up to widget toolkits. Sculpt
OS 24.10 combines these new foundations with a convenient
[https:/documentation/articles/sculpt-24-10#Multi-monitor_support - user interface]
for controlling monitor modes, making brightness adjustments, and setting up
mirrored and panoramic monitor configurations.
Besides this main theme, version 24.10 benefits from the advancements of the
Genode OS Framework over the past six months: compatibility with Qt6,
drivers ported from the Linux kernel version 6.6.47, and comprehensive
[https:/documentation/release-notes/24.08#Goa_SDK - debugging support]
for the Goa SDK.
Sculpt OS 24.10 is available as ready-to-use system image for PC hardware,
the PinePhone, and the MNT Reform laptop at the
[https:/download/sculpt - Sculpt download page] accompanied
with updated [https:/documentation/articles/sculpt-24-10 - documentation].
Genode OS Framework release 24.08 | 2024-08-29
##############################################
| Genode 24.08 introduces the Qt6 application framework, updates all
| Linux-based components and PC device drivers to Linux version 6.6.47,
| equips the Goa SDK with remote debugging support, modernizes the base
| and GUI interfaces of the framework, extends the board support for
| i.MX-based devices, and explores AVX on x86.
The highlights of Genode 24.08 are the addition of the Qt6 application
framework in addition to the time-tested Qt5 and the major update of all
Linux-based components and PC device drivers. So Genode users can enjoy
current-generation commodity software and drivers across all kernels supported
by the framework.
For developers, the new combination of Genode's recent advances in
on-target debugging with the Goa SDK enables seamless remote debugging.
Regarding hardware support, the new version broadens the driver landscape for
NXP i.MX-based devices, paving the way for Sculpt OS on the
[https://shop.mntre.com/products/mnt-pocket-reform - MNT Pocket Reform]
open-source hardware laptop.
For the full picture, please refer to the
[https:/documentation/release-notes/24.08 - release documentation of version 24.08...]
New community forum at Discourse | 2024-08-13
#############################################
| Our new community forum is organized by Genode users to share ideas
| and experiences, help newcomers, and discuss Genode-related projects.
The new forum complements the existing
[http:/community/mailing-lists - mailing list] and
[https://github.com/genodelabs/genode - issue tracker]
with a place for casual conversation among newcomers, seasoned users,
and developers.
[https://genode.discourse.group]
As the forum is a place for users, it is moderated by users. Thanks a lot
to Spencer and Cedric for constituting the initial moderation team!
Meet us at FroSCon during August 17-18 | 2024-07-30
###################################################
| The Genode project will host a booth at this year's Free
| and Open-Source Software Conference in Sankt Augustin.
Besides FOSDEM, public appearances of Genode are rather rare.
All the more delighted we are about the opportunity to host
a booth at the upcoming FrOScon conference.
*FrOScon Free and Open-Source Software Conference*
*August 18 and 17 in Sankt Augustin*
[https://froscon.org]
The Genode stand will be maintained by the Genode team members
Stefan Kalkowski, Johannes Schlatow, Christian Helmuth, and
Norman Feske. It goes without saying that we will have Sculpt
OS in various forms and flavors with us to showcase. Whether
you like to get acquainted with our project or touch base with
us developers in person, FrOScon might present the perfect
opportunity!
Genode OS Framework release 24.05 | 2024-05-30
##############################################
| The highlights of Genode 24.05 are the new ability to run Sculpt OS on
| our custom kernel, GDB on Sculpt OS, suspend/resume, the redesign of
| the framework's USB infrastructure, and the completed transition to
| the new audio interfaces. The release is accompanied with the annual
| update of the "Genode Foundations" book.
With Genode 24.05, the underpinnings of the many usability improvements
of the [https://genode.org/news/sculpt-os-release-24.04 - latest] Sculpt OS
release found their way into the framework. Among them are a completely
redesigned USB infrastructure that allows for fine-grained and dynamic
assignment of USB devices to components and virtual machines, the consistent
use of the audio facilities introduced in February, and the driver life-cycle
management for suspend/resume.
Beside those usability-related topics, two mile-stone achievements stand out.
First, we have realized our long-time vision of running Sculpt OS on our
custom kernel specifically designed for Genode. With Intel virtualization
support, the release delivers the final missing piece of this puzzle.
Second, our long-hedged dream of natural on-target debugging via the GNU
debugger running directly on Sculpt OS has become true. This feature, which
has been in the works for more than a year, enables Sculpt OS users to
leverage GDB for the development of applications, services, and even device
drivers.
The release is accompanied by a new version of the "Genode Foundations" book,
which is the go-to documentation of the framework.
Further topics of the current release range from timing and network-throughput
optimizations, over updated 3rd-party software like Mesa, libSDL2, and cURL,
to developer tooling. Find these among many more topics covered in the detailed
[https:/documentation/release-notes/24.05 - release documentation of version 24.05...]
Sculpt OS release 24.04 | 2024-04-26
####################################
| Sculpt OS 24.04 is rich of new user-visible features.
| It now supports 4K displays and I2C touchpads out of the box,
| brings experimental support for suspend/resume,
| allows the fine-grained assignment of USB devices to applications and VMs,
| and introduces new audio-mixing capabilities.
The release of version 24.04 adheres to
our [https://genode.org/about/road-map - declared] focus on Sculpt OS usability
during this year. Seasoned users will immediately recognize the new power of the
component-management UI, offering easy control over optional features,
software providers, and software installation. Among many little
user-interface improvements, the component graph and configuration interface
have become scrollable, boosting the interactive user experience.
When looking closely at the components, users will recognize a whole new set
of drivers neatly grouped under hardware. In contrast to earlier versions,
which operated these drivers hidden from the user, the new version manages the
drivers dynamically and fully transparent for the user. The change makes the
user interface more logical and simpler. However, the driving force behind this
approach
was our aspired support for suspend/resume, which requires the dynamic
life-cycle management of drivers. This brings us to the technical highlight of
the release: After on-and-off development for more than a year, we are more
than happy offering suspend/resume as an experimental feature.
As culmination of a second long-term development, version 24.04 employs a new
and much more flexible interplay between the USB-host driver and components
accessing USB devices. The dynamic assignment of devices to virtual machines
and other components has become a breeze.
Just in time for the release, Sculpt OS has received a completely overhauled
audio stack that supports pluggable drivers, arbitrary sample rates, and the
flexible routing and mixing of audio signals. We are eager to stress and
refine the taken approach over the upcoming release cycle to make low-latency
audio a commodity on Sculpt OS.
Thanks to our routine with running Sculpt OS on modern laptops day to day,
version 24.04 bumps the range of supported hardware. Displays up to 4K are
supported out of the box now, and touchpads of laptops like the Gen13 Framework
have become operational.
Speaking of developers, the release offers two bold new features targeted at
this specific demography, namely the support for on-target debugging via GDB,
and the ability to use Sculpt OS as a remote test target of Genode's Goa SDK.
Look out for more information about these features in the upcoming weeks
at [https://genodians.org].
Sculpt OS 24.04 is available as ready-to-use system image at the
[https://genode.org/download/sculpt - Sculpt download page] accompanied
with updated [https://genode.org/documentation/articles/sculpt-24-04 - documentation].
Genode OS Framework release 24.02 | 2024-02-29
##############################################
| Version 24.02 revisits Genode's audio support for latency-sensitive
| scenarios, flexible sample rates, and pluggable drivers. It also introduces
| the new ability of the Goa SDK to use Sculpt OS as remote test target,
| comes with a new TCP/IP stack based on Linux 6.1.20, makes drivers aware
| of suspend/resume, and improves HID event handling.
Genode 24.02 kicks off the year with a profound redesign of the framework's
audio infrastructure, addressing the routing and mixing of multi-channel audio
streams at flexible sample rates, the dynamic starting and removal of audio
sources and sinks, and latency optimization.
Besides audio, the second infrastructural rework is a new TCP/IP stack based
on DDE-Linux 6.1.20. It wraps up our long-year transition from a fairly
fragmented landscape of ported driver code to the consistent use of our modern
Linux device-driver environment across all Linux-based drivers and protocol
stacks.
The feature highlight of the release is the new ability of using Sculpt OS as
a remote test target for the Goa SDK during application development. Thanks
to this new feature, Genode applications can be developed and tested in a
quick and uniform way, whether testing directly on a Linux-based development
environment, or on a Sculpt PC reachable via a local network, or a PinePhone
connected to the same wireless access point.
Further highlights of the release are the versatile handling of human-interface
devices including the calibration of motion events, the use of Vivante GPUs by
multiple clients, and the driver-related preparatory steps needed for
implementing suspend/resume for Sculpt OS.
You can find the changes presented in full detail in the
[https:/documentation/release-notes/24.02 - release documentation of version 24.02...]
Road Map for 2024 | 2024-01-18
##############################
| After intensively concentrating on deeply technical topics below the surface
| in 2023, we are going to reap user-visible rewards in 2024 by focussing on
| Sculpt OS usability.
Thanks to the input gathered from our annual road-map discussion on Genode's
[https://genode.org/community/mailing-lists - mailing list], we have updated
the project [https://genode.org/about/road-map - road map] for 2024.
Without hesitation, our developer community quickly rallied behind the topic
"Sculpt OS usability", desiring to boost the user experience with respect to
multi-monitor usage, convenient interactive UIs for common tasks,
profound support for touchpads and touchscreens, tearing-free graphics,
low-latency audio, casual on-target debugging, and suspend/resume.
The focus on usability notwithstanding, we will steadily continue with the
gardening of Genode's driver landscape, fostering the consistent use of drivers
ported from up-to-date Linux kernels, clear-cut ACPI support, and making
drivers pluggable.
In 2024, we will also promote Genode's custom (base-hw) microkernel to become
the default kernel for Sculpt OS, which is the culmination of a multi-year
effort.
Please find our reflection of the past year and the complete plan for 2024
presented on Genode's official [https:/about/road-map - road-map page].
Genode OS Framework release 23.11 | 2023-11-30
##############################################
| Genode 23.11 moves the IOMMU driver from the kernel to the user land,
| introduces CPU power/temperature/frequency monitoring and steering,
| comes with a new API for low-complexity GUI applications, and
| streamlines the framework's virtualization interface. It also improves
| developer ergonomics and showcases the port of the Linphone VoIP stack.
Version 23.11 of the Genode OS Framework introduces DMA protection as
kernel-agnostic feature, parting with the tradition of driving I/O protection
units from the kernel. This radical move is accompanied by a sweeping
modernization of the framework's virtualization interface across kernels and
instruction-set architectures. In other words, the release is dominated by
deeply technical topics.
That said, it is not void of user-facing features either, as illustrated by
the new port of the Linphone VoIP stack using the Goa tool, the extension of
the Seoul virtual machine monitor to 64-bit guests, and the support for CPU
power/temperature/frequency monitoring and steering on PC platforms.
Furthermore, developers receive better tooling for the use and distribution of
debug builds, and will observe a welcomed boost of their development-test
cycles thanks to a largely streamlined build-system.
These and more topics are covered in full detail by the
[https:/documentation/release-notes/23.11 - release documentation of version 23.11...]
Sculpt OS release 23.10 | 2023-10-26
####################################
| Modern PCs provide plenty of metering and power-management options.
| Version 23.10 of the Genode-based Sculpt operating system makes these features
| available via an interactive user interface. One can watch the temperature
| of each CPU core, monitor the individual CPU frequencies, switch between
| power profiles, and reveal details about power draw.
Our official
[https://genode.org/documentation/articles/sculpt-23-10 - documentation]
introduces Sculpt as an operating system that puts the user in the position
of full control. With the new release, this promise is taken to the precise
control and monitoring of physical CPU parameters.
Besides restricting workloads to specific CPU cores, each individual core can
be interactively parametrized, e.g., by balancing performance against power
efficiency. The effects of changing these parameters become immediately
visible by the monitored frequencies, temperature, and power draw. The new
knobs add plenty of play value and an entirely new sense of control to the
user experience. You can find the new power-control feature described in a
[https://genodians.org/alex-ab/2023-10-23-msr - dedicated article].
The advanced power-control abilities are accompanied with generally improved
support for modern laptops. E.g., on the Framework Gen 12 laptop,
features like battery monitoring, keyboard backlight control, and external
displays just work now.
Like the previous release, Sculpt OS is available for both PCs and the
PinePhone. The PinePhone version received several usability improvements
motivated by the feedback we got from the Pine64 community. Most importantly,
a new screensaver reduces the power draw to less than 40%, making the device
more viable in practice.
Under the hood, Sculpt completely removes the drivers for the display and the
touchscreen while the screen is blanked. Those drivers are restarted when
pressing the power button. Furthermore, the volume buttons have become
functional, and the dial pad has become more flexible.
Beside the user-visible improvements, the underpinnings of Sculpt OS
received a number of improvements. The entire software is now consistently
built with GCC 12.3. The former iPXE-based network driver has been replaced
by driver code of the Linux kernel 6.1.20, which works nicely on modern
machines. The new version also introduces the principle mechanisms needed
for on-target debugging, switches to a much revised virtualization interface,
and replaces the block-encryption engine of the file vault. Users of the latter
should follow the documented
[https://genodians.org/m-stein/2023-10-25-file-vault-migration-1 - migration steps].
Sculpt OS 23.10 for PC and PinePhone is available as ready-to-use system image
at the [https://genode.org/download/sculpt - Sculpt download page] accompanied
with updated [https://genode.org/documentation/articles/sculpt-23-10 - documentation].
Seasoned Sculpt users can conveniently switch to the new version via the
system-update dialog.
Genode OS Framework release 23.08 | 2023-08-24
##############################################
| The main theme of the current release is tooling for developing, debugging,
| porting, and publishing Genode components. Beyond that, the release improves
| driver support and the internals of core and the base-framework.
The headline features of this release introduce a new multi-component debug
monitor and extend the Goa tool with support for working with multiple
projects.
The new debug monitor reapproaches Genode's GDB debugging support and sets
smooth on-target debugging in Sculpt OS as its final goal. The monitor can
transparently replace the Init component and is equipped with support for
multi-component debugging by GDB inferiors. The Goa tool evolves into an
all-encompassing alternative to Genode's traditional work flows for developing,
porting, and publishing applications. With this release, runtime testing with
Goa gets extremely flexible and handling of multiple Goa projects becomes a no
brainer.
Beside the tooling topics, we round out the release with a new PC NIC driver
based on Linux, new RaspberryPi/i.MX6 USB host-controller drivers,
hardware-button and screensaver support on the PinePhone, improved Intel
GPU/display, WiFi, and audio drivers.
Find all details of changes and improvements in the
[https:/documentation/release-notes/23.08 - release documentation of version 23.08...]
Genode OS Framework release 23.05 | 2023-05-31
##############################################
| Besides the annual documentation update, the scheduled tool-chain update,
| and the switch to C++20, the release puts the spotlight on the Goa tool,
| which enables the use of existing SDKs like Lomiri or Rust's cargo for
| targeting Genode.
By now, the dedication of Genode's May releases to housekeeping tasks has
become a fine tradition, and this year is no different. With version 23.05,
the framework consistently switches from the C++ standard C++17 to C++20,
thanks to our new tool chain based on GCC 12.3, which will serve us for the
next two years. Speaking of consistency, both Genode books "Foundations" and
"Platforms" have been updated to the most recent version of the framework. You
can find the PDFs at the [https://genode.org - genode.org front page].
Following the recent release of Sculpt OS 23.04 targeting both PC and mobile
platforms, Genode 23.05 brings good news for application developers interested
in targeting Genode and Sculpt OS in particular. The release introduces the
ability to use existing SDKs, in particular the Lomiri UI toolkit as well as
Rust's cargo for crafting Genode applications.
A prominent topic among the previous releases is our Linux device-driver
environment (DDE), which allows for the use of Linux drivers as Genode
components. The current release continues this line of work by upgrading DDE
to Linux 6.1.20 and by using DDE as enabler of our cross-platform Wifi stack
that works for the PC and ARM platforms like the PinePhone. This way, Genode
users can benefit from the enormous efforts of the Linux kernel community
targeting modern hardware.
Further highlights of the new version are the initial use of our custom
base-hw microkernel as x86 hypervisor, a profoundly reworked block-encryption
stack, and updates of supported 3rd-party software like the seL4 kernel and
VirtualBox.
All changes are covered in detail by the official
[https:/documentation/release-notes/23.05 - release documentation of version 23.05...]
Sculpt OS release 23.04 | 2023-04-28
####################################
| Sculpt OS 23.04 marks the first-time PinePhone support in addition to the PC
| version. With this release, the system supports live upgrades of the boot
| image, rendering Sculpt updates and the switching between versions a matter of
| some easy steps. The new preset feature brings entire application scenarios to
| your screen after just one click/tap.
With the fresh release 23.04, the Sculpt operating system boards the PinePhone
to explore the mobile world and, thereby, adds a second platform to its
year-long support for Intel PCs. In preparation, we added two key features to
Genode during the past months, which are the phone-oriented Sculpt
user-interface variant and the system-update functionality. Now, Sculpt
versions can be switched by three easy steps directly in the integrated user
interface: downloading system images to the software depot, install the
desired version on the boot medium, and reboot the device.
Further, the release supports so-called presets in the system menu UI, which
are entire runtime scenarios. The user can load and switch between presets by
just one click. Presets currently available in Sculpt are a simple GUI demo
(nano3d), a simple desktop including background picture and window manager,
and a ready to use Falkon web browser. Still, components can be integrated
into the system (or the currently running preset) by the + menu of the
component graph.
Sculpt OS 23.04 for PC and PinePhone is available as ready-to-use system image
at the [https://genode.org/download/sculpt - Sculpt download page] accompanied
with updated [https://genode.org/documentation/articles/sculpt-23-04 - documentation].
Genode OS Framework release 23.02 | 2023-02-28
##############################################
| Version 23.02 introduces system-update functionality to the mobile version
| of Sculpt OS, enhances our ARM VMM for interactive guest OSes, adds DMA
| protection to Xilinx Zynq via a custom IP core, extends suspend/resume
| support, and makes Intel's P&E cores explicitly manageable.
For the first time, Genode has become easily installable on the PinePhone.
The first system image is not merely a re-targeted PC version of Sculpt OS but
it comes with a novel user interface, a new mechanism for rapidly switching
between different application scenarios, and system-update functionality. This
is everything we need to kick off the first public field test of Genode on the
phone. This line of development motivated plenty of optimizations - from
kernel scheduling, over the I/O throughput of the VFS, to the interfacing of
GPU drivers - that made it into version 23.02.
Besides the focus on the phone, the release continues the hardware-software
co-design story of the previous version by adding DMA protection to Xilinx
Zynq SoCs using custom FPGA fabric, which is especially tailored for Genode.
But also stationary platforms like PCs and ARM laptops received attention.
On ARM, we enabled the use of interactive virtual machines by adding
device models for the GPU and input events. For the PC, the principle support
for suspend/resume has become available to Genode's custom microkernel in
addition to NOVA, and Genode learned to distinguish Intel's performance cores
from energy-efficient cores.
Regarding application workloads, the new release is accompanied by a
substantially improved version of the Goa tool, which streamlines the
creation, packaging, and publishing of Genode components using commodity
build systems. With the new version, Goa largely automates the
porting of CMake-based 3rd-party libraries for Genode.
Find these among many more topics covered by the official
[https:/documentation/release-notes/23.02 - release documentation of version 23.02...]
Road Map for 2023 | 2023-01-17
##############################
| In 2023, we will make the mobile version of Sculpt OS fit for end users,
| unleash advanced hardware features of Intel platforms,
| switch to C++20 by default, and run the feature-complete PC version
| of Sculpt OS on Genode's custom-tailored microkernel.
After having enabled all hardware features of the PinePhone that are
fundamental for a mobile phone over the course of the past year, the
project now aims at getting the mobile version of Sculpt OS into the hands of
end users. Throughout the year, there will be multiple rounds of field tests
within the community, allowing us to reach the desired state of maturity and
usefulness in an iterative way.
On PC platforms, Genode will increasingly address advanced platform features
like the distinction between power-efficient and high-performance cores, the
management of temperatures and frequencies, or the practical use of
suspend/resume. By the end of the year, we envision the PC version of Sculpt
OS running on Genode's custom-tailored microkernel leveraging all those
aspects of modern PC hardware.
Along the planned timeline of the project, one can spot plenty of additional
topics of interest such as the continued line of work of combining Genode
with FPGAs, applications implemented in Rust, the integration of IPv6, the
use of C++20 by default, or completed driver support for the MNT Reform laptop.
An exciting year lies ahead of us!
More details including our reflections of the past year, this year's focus,
and a rough schedule are presented at our official
[https:/about/road-map - road-map page].
Genode OS Framework release 22.11 | 2022-11-30
##############################################
| Genode 22.11 enables hardware-accelerated graphics on up-to-date Intel
| GEN12+ hardware, introduces work flows for hardware-software co-design,
| wraps up the framework's unified device-driver infrastructure across PC and
| ARM, and pushes forward the use of Genode on the PinePhone.
The Genode OS framework is both a dependable foundation for custom operating
systems - like Sculpt OS - and at the same time a playground for new ideas.
The just released version 22.11 pays tribute to both facets. On the one hand,
it features the results of our year-long effort of unifying and simplifying
the framework's device-driver infrastructure across all base platforms, which
subjects the interaction of driver components with device hardware to an
unprecedentedly rigid regime of least privilege. This makes Genode-based
systems ever more dependable and clear.
The role of Genode as a playground for innovation is embodied by the
combination of the framework with reconfigurable hardware. The release
introduces new work flows for designing hardware IP cores and Genode
components in tandem, which allows for low-complexity software-hardware
co-designs that fit like a glove.
Feature-wise, the new version covers a vast area of topics. The enhancement of
our Intel GPU multiplexer to current GEN12+ hardware stands out most. Further
topics range from the emerging user interface for Genode on the PinePhone,
over plenty of device-driver work, to virtualization improvements on ARM and
PC hardware.
These and many more topics of the new version are covered by the official
[https:/documentation/release-notes/22.11 - release documentation of version 22.11...]
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 +798,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 +807,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 +823,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 +847,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 +855,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 +936,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 +949,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 +1081,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 +1105,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 +1113,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.

File diff suppressed because it is too large Load Diff

View File

@@ -219,8 +219,9 @@ Base framework and OS-level infrastructure
Increased default warning level
===============================
For building Genode components written in C++, the compiler flags -Wextra,
-Weffc++, and -Werror are now enabled in addition to -Wall by default.
For building Genode components written in C++, the compiler
flags -Wextra, -Weffc++, and -Werror are now enabled in addition
to -Wall by default.
If this strict warning level is inapplicable for a given component or
library, it is possible to explicitly disable the strictness in the

View File

@@ -21,7 +21,7 @@ disrupting network-application stacks.
Second, the release features the infrastructure needed for mobile-data
communication over LTE, which is a prerequisite for our ambition to use Genode
on the Pinephone. Section [LTE modem stack] gives insights into the involved
on the PinePhone. Section [LTE modem stack] gives insights into the involved
components and the architecture.
Third, we are happy to feature the initial version of VirtualBox 6 for
@@ -518,7 +518,7 @@ Pine-A64-LTS single board computer
==================================
Our [https://genode.org/about/road-map - road map] envisions
the use of Genode on the Pinephone by the end of the year. As a first stepping
the use of Genode on the PinePhone by the end of the year. As a first stepping
stone, the current release adds basic board support for the
[https://pine64.com/product-category/pine-a64-ltslong-term-supply/ - Pine-A64-LTS]
single-board computer. We take this line of work as a welcome opportunity to

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,13 +878,13 @@ 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 parts. First, the modem driver at
repository and consists of two parts. First, the modem driver at
_src/drivers/modem/pinephone/_ takes care of the powering and initialization
of the modem. It works in tandem with the power and reset controls of the
A64 platform driver and the GPIO controls of the PIO driver. The second part
@@ -894,12 +894,12 @@ described in
[https://wiki.pine64.org/wiki/File:Quectel_EC2x%26EG9x%26EG2x-G%26EM05_Series_AT_Commands_Manual_V2.0.pdf - Quectel documentation].
A first example scenario is provided by the
[https://github.com/genodelabs/genode-allwinner/blob/22.02/run/modem_pinephone.run modem_pinephone.run]
[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:
! build/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

1015
doc/release_notes/22-11.txt Normal file

File diff suppressed because it is too large Load Diff

887
doc/release_notes/23-02.txt Normal file
View File

@@ -0,0 +1,887 @@
===============================================
Release notes for the Genode OS Framework 23.02
===============================================
Genode Labs
With Genode's February release, almost everything goes
[https://genode.org/about/road-map - according to plan].
As envisioned on our road map, it features the first ready-to-install
system image of Sculpt OS for the PinePhone, which is not merely a re-targeted
version of the PC version but comes with a novel user interface, a new
mechanism for rapidly switching between different application scenarios, and
system-update functionality.
Section [First system image of mobile Sculpt OS (PinePhone)] gives an
overview and further links about running Genode on your PinePhone.
While enabling substantial application workloads on devices as constrained as
the PinePhone, we engaged in holistic performance optimizations, ranging from
kernel scheduling (Section [Base-HW microkernel]), over the framework's VFS
infrastructure (Section [VFS optimization and simplification]), to the
interfacing of GPU drivers (Section [GPU performance optimizations]).
For stationary ARM-based platforms like the MNT-Reform laptop,
interactive graphical virtual machines have become available now, which
brings us close to mirror the experience of the PC version of Sculpt OS on
such devices (Section [Interactive graphical VMs on ARM]). This development
is accompanied by several device-driver improvements for NXP's i.MX family.
For embedded devices based on Xilinx Zynq, the release introduces custom
FPGA fabric for implementing DMA protection that is normally not covered by
Zynq SoCs. This line of work - as outlined in
Section [Custom IP block for DMA protection on AMD/Xilinx Zynq] - exemplifies
how well Genode and reconfigurable hardware can go hand in hand.
Also, PC platforms got their share of attention, benefiting from the
new distinction between Intel's P&E cores, or the principle support of
suspend/resume on both NOVA and Genode's custom base-hw microkernel.
When it comes to running applications on top of Genode, the release brings
good news as well. Our custom Goa tool for streamlining
application-development work flows received the ability to largely automate
the porting and packaging of 3rd-party libraries using CMake
(Section [Build system and tools]).
First system image of mobile Sculpt OS (PinePhone)
##################################################
Just in time for our
[https://fosdem.org/2023/schedule/event/genode_on_the_pinephone/ - public presentation]
of Genode on the PinePhone at FOSDEM in the beginning of February,
we published a first ready-to-use system image:
:First system image of mobile Sculpt OS:
[https://genodians.org/nfeske/2023-02-01-mobile-sculpt]
It features a
[https://genodians.org/nfeske/2023-01-05-mobile-user-interface - custom user interface],
voice calls and mobile-data connectivity, on-target software installation and
system update, device controls (battery, brightness, volume, mic, reset,
shutdown), and a variety of installable software. Among the installable
applications, there is the Chromium-based Morph web browser, an OpenGL demo
using the GPU, tests for the camera and microphone, as well as a light-weight
Unix-like system shell.
The underpinnings of the Genode system image for the PinePhone are nearly
identical to Sculpt OS on the PC. However, besides the new user interface
specifically designed for the touch screen of the phone, two noteworthy
differences set it apart from the regular version of Sculpt OS.
[image pinephone_presets]
First, the phone variant allows the user to rapidly switch between different
runtime configurations, called presets. This way, the limited resources of the
phone can be accounted and fully leveraged for each preset individually, while
making the system extremely versatile. The loading of a preset can be imagined
as the boot into a separate operating system, but it takes only a fraction of
a second. The structure of the running system is made fully transparent to the
user by the component graph known from Sculpt OS.
[image pinephone_scenarios]
The variety of presets includes the Morph browser, GLMark2, a system shell,
a simple oscilloscope, and camera test.
Second, the system is equipped with an on-target system update mechanism that
allows the user to install new versions of the system image when they become
available. System updates are secured by cryptographic signatures. The
mechanism does not only allow for updating the system but also for the
rollback to any previously downloaded version. This way, the user can try
out a new version while being able to fall back to the previous one in the
case of a regression. This reinforces the end user's ultimate control.
[image pinephone_update]
Interactive graphical VMs on ARM
################################
The virtual-machine monitor (VMM) using hardware-assisted virtualization on
ARM started as a case study eight years ago for Samsung's Exynos 5250 SoC.
Originally, it supported virtualization of CPU, timer, interrupt-controller,
and a UART-device only. Since then, it received several extensions like
support for 64-bit ARMv8 systems, VirtIO devices for network, console, and
block access. With release 22.11, the VMM's I/O device access, RAM
consumption, and CPU count have come configurable.
With the current release, we further enhance the VMM for ARM devices to
provide all the means necessary to become a useful virtualization solution for
interactive scenarios.
[image mnt_interactive_debian_vm]
Sculpt OS running Debian in a virtual machine on the MNT Reform laptop
Two additional VirtIO device models are available now: A GPU model and one for
input. Both models are mapped to Genode's GUI service under the hood. One can
extend the configuration of the VMM accordingly:
! <config ...>
! <virtio_device name="fb0" type="gpu"/>
! <virtio_device name="event0" type="input"/>
! ...
! </config>
For now, only one GPU and one input device can be declared. Both devices get
mapped to the very same GUI service, according to the service routing of the
VMM.
Caution: the GPU and input model are still in an experimental state, and there
are known corner cases, e.g., when the graphical window size of the VMM gets
changed dynamically.
Formerly, the VMM always expected an initial RAM file system to be provided as
ROM dataspace, which got loaded together with the Linux kernel into the VM's
memory. Now, it is possible to omit the "initrd_rom" configuration option.
If omitted, no initrd is provided to the Linux guest.
Custom IP block for DMA protection on AMD/Xilinx Zynq
#####################################################
As a continuation of the hardware-software co-design efforts presented in the
[https://genode.org/documentation/release-notes/22.11#Hardware-software_co-design_with_Genode_on_Xilinx_Zynq - previous release],
we turned towards enabling bulk-data transfer between the Zynq's CPU and its
FPGA. In a first step, we built a custom hardware design that implements a DMA
loopback device based on Xilinx' AXI DMA IP. Since we were particularly
interested in testing out the Zynq's accelerator coherency port (ACP), we
implemented two loopback devices: one attached to the ACP and one to the
high-performance (HP) AXI port of the Zynq. In order to test the design in
Genode, we added a port of Xilinx' embeddedsw repository that hosts standalone
driver code for the Xilinx IP cores. Based on this port, we implemented the
xilinx_axidma library as a Genode wrapper in order to simplify development of
custom drivers using Xilinx' AXI DMA IP. A newly written test component takes
throughput measurements for varying transfer sizes. A more detailed account of
this story is published in an
[https://www.hackster.io/johannes-schlatow/using-axi-dma-on-genode-6482d2 - article on hackster.io].
Knowing that DMA bypasses any memory protection on the Zynq as it does not
feature an IOMMU, we further spent some development efforts on implementing a
custom IP block, called DMA Guard, for protecting against unintended DMA
transfers from/to the FPGA. The DMA Guard is configured with a limited set of
address ranges for which DMA transfers will be granted. Any out-of-range
transfer will be denied. The configuration of the DMA Guard is conducted by
the Zynq's platform driver based on the allocated DMA buffers. For the time
being, we applied several changes to the platform driver. These modifications
are currently hosted in the genode-zynq repository but are going to find their
way into the generic platform driver for the next release.
More details about the DMA Guard are covered by the dedicated article:
[https://www.hackster.io/johannes-schlatow/taking-control-over-dma-transactions-on-zynq-with-genode-fd60b6 - Taking control over DMA transactions on Zynq with Genode].
To follow this line of work, keep watching our
[https://www.hackster.io/genode - hackster.io channel].
Base framework and OS-level infrastructure
##########################################
VFS optimization and simplification
===================================
For regular applications executed on Genode, input and output involves the
virtual file system (VFS). In contrast to traditional monolithic operating
systems (which host the VFS in the kernel) or traditional microkernel-based
operating systems (which host the VFS in a dedicated server component),
Genode's VFS has the form of a library, giving each component an individual
virtual file system. The feature set of the VFS library is not fixed
but extensible by so-called VFS plugins that come in the form of optional
shared libraries. These plugins can implement new file-system types, but also
expose other I/O facilities as pseudo files. For example, TCP/IP stacks like
lwIP and lxIP (IP stack ported from Linux) have the form of VFS plugins.
The extensibility of the VFS gives us extreme flexibility without compromising
Genode's simplicity.
On the other hand, the pervasiveness of the VFS - being embedded in Genode's C
runtime - puts it on the performance-critical path whenever application I/O is
involved. The ever-growing sophistication of application workloads like
running a Chromium-based web browser on the PinePhone puts merciless pressure
on the VFS, which motivated the following I/O-throughput optimizations.
Even though the VFS and various VFS plugins work asynchronously, the batching
of I/O operations is not consistently effective across different kernels. It
particularly depends on the kernel's scheduling decision upon the delivery of
asynchronous notifications. Kernels that eagerly switch to the signal receiver
may thereby prevent the batching of consecutive write operations. We could
observe variances of more than an order of magnitude of TCP throughput,
depending on the used kernel. In the worst case, when executing a kernel that
eagerly schedules the recipient of each asynchronous notification, the
application performance is largely dominated by context-switching costs.
Based on these observations, we concluded that the influence of the kernel's
scheduler should better be mitigated by scheduling asynchronous notifications
less eagerly at the application level. By waking up a remote peer not before
the application stalls for I/O, all scheduled operations would appear at the
remote side as one batch.
The implementation of this idea required a slight redesign of the VFS,
replacing the former implicit wakeup of remote peers by explicit wakeup
signalling. The wakeup signalling is triggered not before the VFS user settles
down. E.g., for libc-based applications, this is the case when the libc goes
idle, waiting for external I/O. In the case of a busy writer to a non-blocking
file descriptor or socket (e.g., lighttpd), the remote peers are woken up once
a write operation yields an out-count of 0. The deferring of wakeup signals is
accommodated by the new 'Remote_io' mechanism (_vfs/remote_io.h_) that is
designated to be used by all VFS plugins that interact with asynchronous
Genode services for I/O.
Combined with additional adjustments of I/O buffer sizes - like the request
queue of the file-system session, the TCP send buffer of the lwIP stack, or
the packet buffer of the NIC session - the VFS optimization almost eliminated
the variance of the I/O throughput among the different kernels and generally
improved the performance. On kernels that suffered most from the eager context
switching, netperf
[https://github.com/genodelabs/genode/issues/4697#issuecomment-1342542399 - shows a 10x]
improvement. But even on kernels with more balanced scheduling, the effect is
impressive.
While we were at it, and since this structural change affected all VFS plugins
and users anyway, we took the opportunity to simplify and modernize other
aspects of the VFS-related code as well.
In particular, the new interface 'Vfs::Env::User' replaces the former
'Vfs::Io_response_handler'. In contrast to the 'Io_response_handler', which
had to be called on a 'Vfs_handle', the new interface does not require any
specific handle. It is merely meant to prompt the VFS user (like the libc) to
re-attempt stalled I/O operations but it does not provide any immediate hint
about which of the handles have become ready for reading/writing. This
decoupling led to welcome simplifications of asynchronously working VFS
plugins.
Furthermore, we removed the 'file_size' type from read/write interfaces. The
former C-style pair of (pointer, size) arguments to those operations have been
replaced by 'Byte_range_ptr' and 'Const_byte_range_ptr' argument types, which
make the code safer and easier to follow. Also, the VFS utilities offered by
_os/vfs.h_ benefit from this safety improvement.
GPU performance optimizations
=============================
Session interface changes
-------------------------
The GPU session interface was originally developed along the first version of
our GPU multiplexer for Intel devices. For this reason, the interface
contained Intel specific nomenclature, like GTT and PPGTT for memory map and
unmap operations. With the introduction of new GPU drivers with different
architectures (e.g., Mali and Vivante), the Intel specifics should have gone
away. With the current Genode release, we streamlined the map and unmap
functions to semantically be more correct on all supported hardware. There are
two map functions now: First, _map_cpu_ which maps GPU graphics memory to be
accessed by the CPU. And second, _map_gpu_ which establishes a mapping of
graphics memory within the GPU.
Additionally, we removed the concept of buffers (as used by Mesa and Linux
drivers) to manage graphics memory and replaced it by the notion of video
memory (VRAM) where VRAM stands for the actual graphics memory used by a GPU -
may it be dedicated on-card memory or system RAM. The change makes it possible
to separate the graphics-memory management from the buffer management as
required by the Mesa library.
Intel graphics
--------------
When porting 3D applications using Mesa's OpenGL, we found that Mesa allocates
and frees a lot of small GPU buffer objects (data in GPU memory) during
operation. This is sub optimal for component-based systems because the Mesa
library has to perform an RPC to the GPU multiplexer for each buffer
allocation and for each buffer mapping. As mentioned above, we changed the
session semantics from buffer object to video memory and implemented this
feature within Intel's GPU multiplexer, which now only hands out VRAM. This
made it possible to move the buffer handling completely to the Mesa client
side (libdrm). Libdrm now allocates large chunks of video memory (i.e., 16MB)
and hands out memory for buffer objects from this pool. This brings two
advantages: First, the client-side VRAM pool acts as cache, which reduces the
number of RPCs required for memory management significantly. Second, because
of the larger VRAM allocations (compared to many 4K or 16K allocations before)
fewer capabilities for the actual dataspaces that back the memory are
required. Measurements showed that almost an order of magnitude of
capabilities can be saved at Mesa or the client side this way.
Mali graphics
-------------
The 22.08 release introduced a
[https://genode.org/documentation/release-notes/22.08#GPU_and_Mesa_driver_for_Mali-400 - driver]
for the GPU found in the PinePhone. Since it was merely a rapid prototype, it
was limited to one client at a time, and was normally started and stopped
together with its client. With this release, we remedied these limitations and
enabled support for multiple concurrent clients and also revised our libdrm
backend for Mesa's Lima driver.
We have not yet explored applying the same VRAM optimizations that are employed
by our Intel graphics stack. One VRAM allocation still correlates to one
buffer-object.
More flexible ACPI-event handling
=================================
The _acpica_ component uses the Intel ACPICA library to parse and interpret
ACPI tables and AML code. One designated feature is the monitoring of several
ACPI event sources including optional reporting of information about state
changes. The supported event sources are:
* Lid, which can be open or closed
* Smart battery (SB), information about battery parameters (e.g., capacity)
and charging/discharging status
* ACPI fixed events, e.g., power buttons
* AC adapters, which reflect power cable plug/unplug
* Embedded controller (EC), events like Fn-* keys, Lid, AC, SB changes
* Vendor-specific hardware events, e.g., Fujitsu FUJ02E3 key events
Acpica optionally reports information about state changes. These reports can
be monitored by other components as ROMs. The following configuration
illustrates the feature:
!<start name="report_rom">
! <resource name="RAM" quantum="2M"/>
! <provides> <service name="ROM" /> <service name="Report" /> </provides>
! <config>
! <policy label="acpi_event -> acpi_lid" report="acpica -> acpi_lid"/>
! <policy label="acpi_event -> acpi_battery" report="acpica -> acpi_battery"/>
! <policy label="acpi_event -> acpi_fixed" report="acpica -> acpi_fixed"/>
! <policy label="acpi_event -> acpi_ac" report="acpica -> acpi_ac"/>
! <policy label="acpi_event -> acpi_ec" report="acpica -> acpi_ec"/>
! <policy label="acpi_event -> acpi_hid" report="acpica -> acpi_hid"/>
! </config>
!</start>
!
!<start name="acpica">
! <resource name="RAM" quantum="8M"/>
! <config report="yes"/>
! <route>
! <service name="Report"> <child name="acpi_state"/> </service>
! ...
! </route>
!</start>
One such ACPI monitor component is _acpi_event_ that maps ACPI events to key
events of a requested Event session based on its configuration. This way, ACPI
state changes can be processed like ordinary key press-release events via, for
example, the _event_filter_. The following configuration illustrates how to
map the ACPI event types to key events:
!<start name="acpi_event">
! <resource name="RAM" quantum="1M"/>
! <config>
! <map acpi="lid" value="CLOSED" to_key="KEY_SLEEP"/>
! <map acpi="fixed" value="0" to_key="KEY_POWER"/>
! <map acpi="ac" value="ONLINE" to_key="KEY_WAKEUP"/>
! <map acpi="ec" value="20" to_key="KEY_BRIGHTNESSUP"/>
! <map acpi="ec" value="21" to_key="KEY_BRIGHTNESSDOWN"/>
! <map acpi="hid" value="0x4000000" to_key="KEY_FN_F4"/>
! </config>
! <route>
! <service name="ROM" label="acpi_lid"> <child name="acpi_state"/> </service>
! <service name="ROM" label="acpi_battery"> <child name="acpi_state"/> </service>
! <service name="ROM" label="acpi_fixed"> <child name="acpi_state"/> </service>
! <service name="ROM" label="acpi_ac"> <child name="acpi_state"/> </service>
! <service name="ROM" label="acpi_ec"> <child name="acpi_state"/> </service>
! <service name="ROM" label="acpi_hid"> <child name="acpi_state"/> </service>
! <service name="Event"> <child name="event_filter" label="acpi"/> </service>
! ...
! </route>
!</start>
In the current release, we replaced the limited list of supported key names by
a general mechanism, which supports the use of all key names declared in
_repos/os/include/input/keycodes.h_.
Base API changes
================
As part of our continuous motive to streamline and simplify the framework's
base API as much as possible, the current release removes the interfaces
_base/blocking.h_, _base/debug.h_, and _base/lock_guard.h_ as those headers
contained parts of the API that have become obsolete by now. As a further
minor change, the 'abs' function of _util/misc_math.h_ got removed.
The string utilities _util/string.h_ received the new 'Const_byte_range_ptr'
type complementing the existing 'Byte_range_ptr'. Both types are designated
for passing arguments that refer to a byte buffer, e.g., the source buffer of
a write operation.
On-target system-update and rollback mechanism
##############################################
For the mobile version of Sculpt OS as covered in
Section [First system image of mobile Sculpt OS (PinePhone)],
we envisioned easy-to-use system updates that would enable us to quickly
iterate based on the feedback of early field testers.
This topic confronted us with a variety of concerns. Just to name a few,
conventions for booting that would not require changes in the future,
equipping (system) images with self-reflecting version information, tools for
generating and publishing digitally-signed images, on-target discovery of new
image versions, secure downloading and cryptographic checking of new images,
directing the machine's boot loader to use the new version, and possibly
reverting to an earlier version.
Fortunately, most of these concerns have a lot in common with the problems
we had to address for Genode's
[https://genode.org/documentation/release-notes/18.02#On-target_package_installation_and_deployment - package management].
For example, the off-target and on-target tooling for digital signatures,
the notion of a depot, and the concept of federated software providers
(depot users) are established and time-tested by now.
Self-reflecting version information
-----------------------------------
To allow a running Sculpt system to know its own version, the sculpt.run
script generates an artificial boot module named "build_info", which can be
evaluated at runtime by the sculpt-manager component.
! <build_info genode_version="22.11-260-g89be3404c0d"
! date="2023-01-19" depot_user="nfeske" board="pinephone">
Formalism for generating images and image metadata
--------------------------------------------------
To enable the Sculpt system to easily detect new versions, system images must
be accompanied by metadata discoverable at a known location. This information
is provided by a so-called image-index file located at
_depot/<user>/image/index_. The image index of a depot user lists the
available images in XML form, e.g.,
! <index>
! <image os="sculpt" board="pinephone" version="2023-01-19">
! <info text="initial version"/>
! </image>
! ...
! </index>
The 'os', 'board', and 'version' attributes can be used to infer the file name
of the corresponding image file. The '<info>' nodes contain a summary of
changes as information for the end user.
The new _gems/run/sculpt_image.run_ script provides assistance with generating
appropriately named images, placing them into the depot, and presenting a
template for the manually curated image index.
Signing and publishing
----------------------
For signing and publishing system images and image indices, we extended the
existing _tool/depot/publish_ tool. To publish a new version of an image
index:
! ./tool/depot/publish <depot-user>/image/index
Each system image comes in two forms, a bootable disk image and an archive of
the boot directory. The bootable disk image can be used to install a new
system from scratch by copying the image directly to a block device. It
contains raw block data. The archive of the boot directory contains the
content needed for an on-target system update to this version. Within the
depot, this archive has the form of a directory - named after the image - that
contains the designated content of the boot directory on target. Depending on
the board, it may contain only a single file loaded by the boot loader (e.g.,
uImage), or several boot modules, or even the boot-loader configuration. The
following command publishes both forms:
! ./tool/depot/publish <depot-user>/image/<image-name>
This results in the following - accompanied by their respective .sig
files - in the public directory:
! <depot-user>/image/<image-name>.img.xz (disk image)
! <depot-user>/image/<image-name>.tar.xz (boot archive)
! <depot-user>/image/<image-name>.zip (disk image)
The .zip file contains the .img file. It is provided for users who download
the image on a system with no support for .xz.
On-target image discovery, download, and verification
-----------------------------------------------------
To enable a running Sculpt system to fetch image index files and images, the
existing depot-download component accepts the following two new download
types:
! <image_index path="<user>/image/index"/>
! <image path="<user>/image/<name>"/>
Internally, the depot-download subsystem employs the depot-query component to
determine the missing depot content. This component accepts the following two
new queries:
! <images user="..."/>
! <image_index user="..."/>
If present in the query, depot_query generates reports labeled as "images" and
"image_index" respectively. These reports are picked up by the depot-download
component to track the completion of each job. The reported information is
also used by the system updater to get hold of the images that are ready to
install.
On-target image installation and rollback
-----------------------------------------
Once downloaded into the local depot of a Sculpt system, the content of the
boot directory for a given image version is readily available, e.g.,
! depot/nfeske/image/sculpt-pinephone-2023-02-02/uImage
The installation comes down to copying this content to the _/boot/_ directory.
On the next reboot, the new image is executed.
When subsequently downloading new image versions, the old versions stay
available in the depot as sibling directories. This allows for an easy
rollback by copying the boot content of an old version to the _/boot/_
directory.
Device drivers
##############
NXP i.MX Ethernet & USB
=======================
The Ethernet driver for i.MX53, i.MX6, and i.MX7 got updated to use a more
recent Linux kernel version (5.11). These drivers got aligned with the
source-code base originally ported for the i.MX8 SoC.
Using the recent approach to port Linux device drivers, trying to preserve the
original semantic, it is necessary to provide the correct clock rates to the
driver. Therefore, specific platform drivers for i.MX6 and i.MX7 were created
that enable the network related clocks and export their rate values.
The i.MX53 related platform driver got extended to support these clocks.
The USB host-controller driver for the i.MX 8MQ EVK is now able to drive the
USB-C connector of this board too.
Realtek Wifi
============
As a welcoming side effect of switching to the new DDE-Linux approach,
enabling other drivers that are part of the same subsystem has become less
involved. In the past, we mostly focused on getting wireless devices supported
by the iwlwifi driver to work as those are the devices predominantly found in
commodity laptops. That being said, every now and then, one comes across a
different vendor and especially with the shifting focus on ARM-based systems
covering those as well became necessary.
As a first experiment, we enabled the rtlwifi driver that provides support
for Realtek-based wireless devices. Due to lacking access to other hardware,
the driver has been so far tested only with a specific RTL8188EE based device
(10ec:8179 rev 01). Of course, some trade-offs were made as power-management
is currently not available. But getting it to work, nevertheless, took barely
half a day of work, which is promising.
Platforms
#########
Base-HW microkernel
===================
Cache-maintenance optimization
------------------------------
On ARM systems, the memory view on instructions and data of the CPUs, as well
as between CPUs and other devices is not necessarily consistent. When dealing
with DMA transfers of devices, developers of related drivers need to ensure
that corresponding cache lines are cleaned before a DMA transfer gets
acknowledged. When dealing with just-in-time compilation, where instructions
are generated on demand, the data and instruction caches have to be aligned
too.
Until now, the base-API functions for such cache-maintenance operations were
mapped to kernel system calls specific to base-hw. Only the kernel was allowed
to execute cache maintenance related instructions. On ARMv8 however, it is
possible to allow unprivileged components to execute most of these
instructions.
With this release, we have implemented the cache maintenance functions outside
the kernel on ARMv8 where possible. Thereby, several device drivers with a lot
of DMA transactions, e.g. the GPU driver, benefit from this optimization
enormously. The JavaScript engine used in the Morph and Falkon browsers
profits as well.
ACPI suspend & resume
---------------------
In the previous release, we started to support the low-level
[https://genode.org/documentation/release-notes/22.11#Low-level_mechanism_for_suspend_resume_on_PC_platforms - ACPI suspend and resume]
mechanism with Genode for the NOVA kernel. With the current release, we added
the required low-level support to Genode's base-hw kernel for x86 64bit
platforms. Similar to the base-nova version, on base-hw the
'Pd::managing_system' RPC function of Genode's core roottask is used to
transfer the required ACPI values representing the S3 sleep state to the
kernel. The kernel then takes care to halt all CPUs and flush its state to
memory, before finally suspending the PC using the ACPI mechanism. On resume,
the kernel re-initializes necessary hardware used by the kernel, e.g., all
CPUs, interrupt controller, timer device, and serial device. One can test
drive the new feature using the _run/acpi_suspend_ scenario introduced by the
former release.
Scheduling improvements for interactive workloads
-------------------------------------------------
As Genode conquers the PinePhone, the base-hw kernel, for the first time, has
to perform real-life multimedia on a daily basis given a resource-limited
mobile target. One particularly important and ambitious use case has become
video conferencing in the Morph browser. A combination of an already demanding
browser engine with an application that not only streams video and audio in
both directions over network but also handles video and audio I/O at the
device, and all that fluently and at the same time.
A lot of thinking went into how to optimize this scenario on each level of
abstraction and one rather low-level lever was the scheduling scheme of the
base-hw kernel. The base-hw scheduling scheme consists of a combination of
absolute priority bands with execution-time quotas that prevent higher
prioritized subjects from starving lower ones. There is the notion of a super
period and each subject owns only a fraction of that super period as quota
together with its priority. Once a subject has depleted its quota, it can't
use its priority until the end of the current super period where its quota
will be re-filled. However, during that time, the subject is not blocked - It
can become active whenever there is no subject with priority and remaining
quota present.
So, this "zero" band below all the priority bands temporarily accommodates all
subjects that have a priority but that are out of quota. It contains, however,
also subjects that have no priority in general. These might be tasks like a GCC
compilation or a ray tracer. While prioritized tasks would be user input
handlers or the display driver. Now, one difficult problem that arises with
this scheduling scheme is that system integration has to decide how much quota
is required by a prioritized task. The perfect value can't be determined as it
depends on many factors including the target platform. Therefore, we have to
consider that an important task like the audio driver in the video-conference
scenario runs out of quota shortly before finishing its work.
This is already bad as is as the audio driver now has to share the CPU with
many unimportant tasks until the next super period. But it became even worse
because, in the past implementation, subjects always entered the zero band at
the tail position. It meant that, e.g., the remaining audio handling had to
wait at least until all the unprioritized tasks (e.g. long-taking computations)
had used up their zero-band time slice. In order to mitigate this situation, we
decided that prioritized tasks when depleting their quota become head of the
zero-band, so, they will be scheduled first whenever the higher bands become
idle.
This change relaxes the consequences of quota-depletion events for
time-critical tasks in a typical system with many unprioritized tasks.
At the same time, it should not have a significant impact on the overall
schedule because depletion events are rare and zero-band time-slices short.
NOVA microhypervisor
====================
ACPI suspend & resume
---------------------
As an extension to the principal
[https://genode.org/documentation/release-notes/22.11#Low-level_mechanism_for_suspend_resume_on_PC_platforms - ACPI suspend and resume]
support introduced with the Genode 22.11 release, the NOVA kernel now supports
also the re-enablement of the IOMMU after ACPI resume. The IOMMU as a hardware
feature has been supported by Genode since
[https://genode.org/documentation/release-notes/13.02#DMA_protection_via_IOMMU - release 13.02]
and extended in
[https://genode.org/documentation/release-notes/20.11#NOVA_microhypervisor - release 20.11],
which sandboxed device hardware and (malicious/faulty) drivers to avoid
arbitrary DMA transactions.
Intel P/E cores
---------------
Starting with [https://en.wikipedia.org/wiki/Intel_Core#12th_generation - Intel CPU generation 12],
Intel introduced CPUs with heterogeneous cores, similar to
[https://en.wikipedia.org/wiki/ARM_big.LITTLE - ARM's big/LITTLE] concept.
The new CPUs have a number of so called P-cores (performance) and E-cores
(efficient), which differ in their performance and power characteristics.
The CPU cores
([https://en.wikipedia.org/wiki/Alder_Lake#CPUID_incoherence - should be])
instruction compatible and are reported as identical via x86's CPUID
instruction nowadays. However, an operating system such as Genode must be able
to differentiate the cores in order to take informed decisions about the
placement and scheduling of Genode components.
With the current release, we added support to the NOVA kernel to propagate the
information about P/E cores to Genode's 'core' roottask. In Genode's core,
this information is used to group the CPU cores into Genode's
[https://genode.org/documentation/release-notes/13.08#Management_of_CPU_affinities - affinity space].
With
[https://genode.org/documentation/release-notes/20.05#NOVA_microhypervisor - release 20.05],
we introduced the grouping of hyperthreads on the y-axis, which we keep in
case the P-cores have the feature enabled. Following the P-cores and
hyperthreads, all remaining E-cores are placed in the affinity space.
The following examples showcase the grouping in the affinity-space on x/y axis:
Core i7 1270P - 4 P-cores (hyperthreading enabled) and 8 E-cores:
! x-axis 1 2 3 4 5 6 7 8
! ----------------------------------
! y-axis 1 | P\ P\ P\ P\ E E E E
! 2 | P/ P/ P/ P/ E E E E
!
! hyperthreads \ / of same core
Core i7 1280P - 6 P-cores (hyperthreading enabled) and 8 E-cores:
! x-axis 1 2 3 4 5 6 7 8 9 10
! -----------------------------------------
! y-axis 1 | P\ P\ P\ P\ P\ P\ E E E E
! 2 | P/ P/ P/ P/ P/ P/ E E E E
!
! hyperthreads \ / of same core
The information about the P/E cores is visible in the kernel and Genode's
log output and is reported in the 'platform_info' ROM, e.g.
! kernel:
!
! [ 0] CORE:00:00:0 6:9a:3:7 [415] P 12th Gen Intel(R) Core(TM) i7-1270P
! ...
! [15] CORE:00:17:0 6:9a:3:7 [415] E 12th Gen Intel(R) Core(TM) i7-1270P
! ...
! Genode's core:
!
! mapping: affinity space -> kernel cpu id - package:core:thread
! remap (0x0) -> 0 - 0: 0:0 P boot cpu
! remap (0x1) -> 1 - 0: 0:1 P
! remap (1x0) -> 2 - 0: 4:0 P
! remap (1x1) -> 3 - 0: 4:1 P
! remap (2x0) -> 4 - 0: 8:0 P
! remap (2x1) -> 5 - 0: 8:1 P
! remap (3x0) -> 6 - 0:12:0 P
! remap (3x1) -> 7 - 0:12:1 P
! remap (4x0) -> 8 - 0:16:0 E
! remap (4x1) -> 9 - 0:17:0 E
! remap (5x0) -> 10 - 0:18:0 E
! remap (5x1) -> 11 - 0:19:0 E
! remap (6x0) -> 12 - 0:20:0 E
! remap (6x1) -> 13 - 0:21:0 E
! remap (7x0) -> 14 - 0:22:0 E
! remap (7x1) -> 15 - 0:23:0 E
! ...
! platform_info ROM:
!
! ...
! <cpus>
! <cpu xpos="0" ypos="0" cpu_type="P" .../>
! ...
! <cpu xpos="5" ypos="0" cpu_type="E" .../>
! ...
! <cpus>
! ...
Build system and tools
######################
Building and packaging CMake-based shared libraries (via Goa)
=============================================================
The [https://github.com/nfeske/goa - Goa] tool streamlines the work of
cross-developing, testing, and publishing Genode application software
using commodity build tools like CMake. The tool is particularly suited for
porting existing 3rd-party software to Sculpt OS.
Until recently, Goa was solely focused on applications whereas the porting of
3rd-party libraries required the use of the traditional approach of hand
crafting build rules for Genode's build system. This limitation of Goa got
lifted now.
In the new version, a Goa project can host an _api_ file indicating that
the project is a library project. The file contains the list of headers that
comprise the library's public interface. The build artifact of a library
is declared in the _artifacts_ file and is expected to have the form
_<library-name>.lib.so_. The ABI symbols of such a library must be listed
in the file _symbols/<library-name>_. With these bits of information supplied
to Goa, the tool is able to build and publish both the library and the API as
depot archives - ready to use by Genode applications linking to the library.
The way how all those little pieces work together is best illustrated by the
accompanied
[https://github.com/nfeske/goa/tree/master/examples/cmake_library - example].
For further details, please consult Goa's builtin documentation via 'goa help'
(overview of Goa's sub commands and files) and 'goa help api' (specifics of
the _api_ declaration file).
When porting a library to Genode, one manual step remains, which is the
declaration of the ABI symbols exported by the library. The new sub command
'goa extract-abi-symbols' eases this manual step. It automatically generates a
template for the _symbols/<library-name>_ file from the library's built shared
object. Note, however, that the generated symbols file is expected to be
manually reviewed and tidied up, e.g., by removing library-internal symbols.
_Thanks to Pirmin Duss for having contributed this welcomed new feature, which_
_makes Goa much more versatile!_
New tool for querying metadata of ports
=======================================
The integration of third-party software into Genode is implemented via _ports_
that specify how to retrieve, verify, and patch the source code in preparation
for use with our build system. Ports are managed by tools residing in the
_tool/ports_ directory. For example, _tool/ports/prepare_port_ is used to
execute all required preparation steps.
Currently, the base Genode sources support 90 ports (you may try
_tool/ports/list_ yourself) and, thus, it's not trivial to keep track of all
the ports in the repo directories. Therefore, we introduce the
_tool/ports/metadata_ tool to extract information about license, upstream
version, and source URLs of individual ports. The tool can be used as follows:
!./tool/ports/metadata virtualbox6
!
!PORT: virtualbox6
!LICENSE: GPLv2
!VERSION: 6.1.26
!SOURCE: http://download.virtualbox.org/virtualbox/6.1.26/VirtualBox-6.1.26.tar.bz2 (virtualbox)
!SOURCE: http://download.virtualbox.org/virtualbox/6.1.26/VirtualBoxSDK-6.1.26-145957.zip (virtualbox_sdk)
Harmonization of the boot concepts across ARM and PC platforms
==============================================================
To make the system-update functionality covered in
Section [On-target system-update and rollback mechanism] equally usable across
PC and ARM platforms, the conventions of booting the platforms had to be
unified.
Traditionally, a bootable disk image for the PC contains a _boot/_ directory.
E.g., when using NOVA, it contains the GRUB boot-loader config + the hypervisor +
the bender pre-boot loader + the banner image + the Genode system image.
This structure corresponds 1:1 to the _boot/_ directory as found on the 3rd
partition of the Sculpt system, which is very nice. A manual system update of
Sculpt comes down to replacing these files. However, on ARM platforms, SD-card
images used to host a _uImage_ file and a U-Boot environment configuration
file in the root directory. The distinction of these differences complicates
both the build-time tooling and the on-target handling of system updates.
The current release unifies the boot convention by hosting a _boot/_ directory
on all platforms and reinforces the consistent naming of files. On ARM, the
_uImage_ and _uboot.env_ files now always reside under _boot/_. Thanks to this
uniform convention, Genode's new system update mechanism can now equally
expect that a system update corresponds to the mere replacement of the content
of the _boot/_ directory.
Minor run-tool changes
======================
The functionality of the _image/uboot_fit_ plugin has been integrated into the
regular _image/uboot_ plugin as both plugins were quite similar.
FIT images can now be produced by adding the run option '--image-uboot-fit'.

861
doc/release_notes/23-05.txt Normal file
View File

@@ -0,0 +1,861 @@
===============================================
Release notes for the Genode OS Framework 23.05
===============================================
Genode Labs
Besides our annual documentation update, our major tool-chain update as
scheduled every two years, and the switch to C++20, version 23.05 puts the
spotlight on the Goa tool, which allows us to leverage existing SDKs like
Lomiri and Rust's cargo for Genode applications. In line with the previous
versions, DDE-Linux is prominently featured as enabler of our cross-platform
Wifi stack and the updated (6.1.20) drivers for Intel graphics and USB.
: <div class="visualClear"><!-- --></div>
: <p>
: <div style="clear: both; float: left; margin-right:20px;">
: <a class="internal-link" href="https://genode.org/documentation/genode-foundations-23-05.pdf">
: <img class="image-inline" src="https://genode.org/documentation/genode-foundations-title.png">
: </a>
: <a class="internal-link" href="https://genode.org/documentation/genode-platforms-23-05.pdf">
: <img class="image-inline" src="https://genode.org/documentation/genode-platforms-title.png">
: </a>
: </div>
: </p>
Before getting to the technical achievements, we'd like to draw your attention
to the books "Genode Foundations" and "Genode Platforms", which have been
updated to reflect the most recent state of the framework. Whereas the
"Foundations" cover Genode's architecture, developer work flows, and reference
material, the "Platforms" document is focused on low-level hardware topics and
provides plenty of practical guidance.
: <div class="visualClear"><!-- --></div>
Every two years, we update Genode's tool chain to the latest stable releases
of GCC and binutils. This time, we took the update as opportunity to switch
Genode's default from C++17 to C++20 so that modern C++ niceties can be used
for regular Genode components. The new tool chain is covered by
Section [New tool chain based on GCC 12.3, C++20 enabled by default].
For application developers, the evolving Goa tool is certainly the most
interesting feature of the current release. As detailed in
Section [Goa tool updated to Sculpt OS 23.04, initial support for Rust],
this tool enables us to reuse existing SDKs to target Genode. In particular,
we enabled the use of the Lomiri mobile UI toolkit (formerly known as Ubuntu
Touch UI toolkit) for targeting the PinePhone, and Rust's cargo.
System integrators may appreciate our continued development of the Linux
device-driver environment, which received an update to Linux 6.1.20
(Section [Device drivers]) and ultimately enabled us to use the same Wifi
stack across PC and ARM platforms
(Section [Uniform Wifi stack across PC and ARM platforms]).
Even though not end-user facing yet, two noteworthy development milestones of
the current release are the new use of our custom base-hw microkernel as x86
hypervisor (Section [Base-HW microkernel]) and the profound work on storage
encryption covered in
Section [Revision of Genode's custom block-encryption infrastructure].
Further topics making an appearance in version 23.05 range from RISC-V, over
WireGuard, VirtualBox, to seL4.
Goa tool updated to Sculpt OS 23.04, initial support for Rust
#############################################################
Last month, we [https://genode.org/news/sculpt-os-release-23.04 - released]
Sculpt OS 23.04 for PC and PinePhone. The new release comes with various
[https://genodians.org/nfeske/2023-05-11-sculpt-os - usability improvements]
such as presets and on-target system updates.
[image mobile_sculpt_23_04]
Interactive software management on the mobile variant of Sculpt OS
In particular, with Sculpt OS 23.04 running on the PinePhone, we have carved
out the base for hosting mobile apps on a Genode-based system. Yet, there are
only very few apps available right now. Since an OS is of no practical use
without apps, this urgently called for an SDK to simplify (mobile) app
development. After careful investigation, we opted for porting the
Ubuntu-Touch-UI toolkit to Genode and integrate it into Goa (Section
[Using Goa for bringing apps based on the Ubuntu-Touch-UI toolkit to Genode]),
our streamlined workflow tool for application development. In addition, we
integrated initial support for Rust's _cargo_ to make Goa palatable to a
broader developer audience (Section [Initial Rust support]).
The growing attention of the Goa tool prompted us to move it under the
[https://genodians.org/nfeske/2023-05-02-goa-genode-labs - umbrella of Genode Labs]
as we are increasing our development and maintenance efforts for the tool.
Aligned with the Sculpt release, the Goa tool has been updated with the
corresponding depot archive versions. With this Genode release, we put a
cherry on top and added bash completion to improve the user experience even
further. Having Goa installed, bash completion is enabled by the following
commands:
! goa update-goa master
! GOA_DIR=$(realpath $(which goa) | sed s#bin/goa##)
! echo "source ${GOA_DIR}/share/bash-completion/goa" >> ~/.bashrc
:Goa tool:
[https://github.com/genodelabs/goa/]
Using Goa for bringing apps based on the Ubuntu-Touch-UI toolkit to Genode
==========================================================================
While writing mobile apps might be fun, it is outside our core expertise.
Therefore, we have looked into ways of supporting established open-source SDKs
for app development on Genode. We investigated two possible options in depth,
namely Ubuntu Touch's UI toolkit now called [https://lomiri.com - Lomiri] and
the [https://docs.sailfishos.org/Tools/Sailfish_SDK - Sailfish SDK]. We have
tried to port applications for both stacks and after many iterations settled
with the Ubuntu UI toolkit. The full story can be read
[https://genodians.org/ssumpf/2023-05-06-ubunutu_ui - here]. Therefore, a port
of the Ubuntu UI toolkit is available on Genode right now and support for it
has been added to the Goa tool.
The workflow for crafting an app for the PinePhone using the Goa tool is a
fairly streamlined experience now:
# Since the UI toolkit depends on Qt5, add "genodelabs/api/qt5" to your
[https://genodians.org/nfeske/2019-11-25-goa - _used_apis_ file]
# Add "ssumpf/pkg/ubuntu_ui_toolkit" to your _archives_
[https://genodians.org/nfeske/2019-11-25-goa - file] to have the UI toolkit
available within your package
# In order to have your QML code within your packet installed, add
"<packet-name>.tar: install/" to your
[https://genodians.org/nfeske/2019-11-25-goa - _artifacts_ file]
# Configure your
[https://genodians.org/nfeske/2019-12-19-goa-unix-terminal - _runtime_ file]
# Execute your scenario on Linux for development
! goa run
# Build for the PinePhone
! goa build --arch arm_v8a
# [https://genodians.org/nfeske/2020-01-16-goa-publish - Publish] your package
! goa publish --depot-user john --depot-overwrite
Examples using QML, Qt5, and C++ can be found
[https://github.com/ssumpf/goa-projects - here]
Initial Rust support
====================
The Rust programming language has grown in popularity in the recent years.
The Genode OS Framework had support for the Rust programming language
before, contributed to Genode release 16.05 by Waylon Cude. However, as an
on-off contribution it never got traction and the support was eventually
removed with release 20.05.
While the original support focused on some low-level runtime libraries and
integration into the Genode build system, our new attempt has a somewhat
different objective, which is to facilitate the use of the existing Rust
ecosystem on the Genode OS Framework. The removal note already envisioned a
possible comeback using the Goa tool and Rust's cargo build system, for which
we have added initial support with this release.
Our objective led to the following guidelines for Rust integration:
# Make use of the native build system, cargo, to make the existing ecosystem
accessible.
# Aim for a seamless integration into the Genode OS Framework using the Goa
build tool.
# Instead of introducing our own Genode
[https://doc.rust-lang.org/nightly/rustc/platform-support.html - target triples],
leverage Genode's FreeBSD-based C library interface to use existing
supported standard library targets like 'x86_64-unknown-freebsd'.
# Strive to use the upstream tool chain, or at least stay as close to upstream
as possible.
While we largely succeeded in following these guidelines, our initial
proof-of-concept implementation relies on a marginally adapted tool chain to
work around missing support for versioned library symbols in our linker.
We are exploring avenues to overcome these limitations and expand the support
to cover more complex use cases in the next release.
To learn more about our Rust support, head over to the
[https://genodians.org/atopia/2023-05-30-bringing-rust-back-to-genode - article on Genodians.org].
Uniform Wifi stack across PC and ARM platforms
##############################################
Support for wireless LAN was mostly focused on the
[https://genode.org/documentation/release-notes/14.11#Intel_wireless_stack - PC platform]
as it was the platform predominately used for using Genode and, in extension,
Sculpt on a daily basis. In the last couple of years, however, we started to
embrace ARM-based platforms like the MNT Reform 2 and the PinePhone as well,
longing for thorough support of Sculpt OS on such systems. Thanks to our Linux
device-driver environment, we have now taken the opportunity to reuse the
existing wireless stack on vastly different platforms.
Making the wireless stack globally accessible
---------------------------------------------
The
[https://genode.org/documentation/release-notes/23.02#Realtek_Wifi - previous release]
already featured additional support for a different wireless LAN device driver -
the rtlwifi driver that supports Realtek-based devices - giving us a good
intuition on how easy it has become to extend even a complex Linux-based
driver component stack such as our wifi-driver component ('wifi_drv').
The first step was making it less x86-centric. We started by making the various
ingredients of the driver available on the ARM platforms.
On the one hand, that includes the WPA supplicant and its dependencies like
the 'nl80211' driver that in turn depends on 'libnl'. Enabling them was
straight-forward because they are already pretty platform independent and
the platform-dependent portions, e.g. libcrypto, are readily available for ARM.
On the other hand, the wireless stack was slightly more complicated because
the hardware integration of wireless networking devices on ARM platforms
varies from platform to platform. In case of the MNT Reform 2 and PC, the
integrated wireless devices are normally connected via PCIe. In contrast, the
PinePhone relies on SDIO. We separated the code to allow for a "mix-and-match"
way of selecting the necessary compilation units as the used Linux
configuration might differ between each target and could result in compilation
issues otherwise.
The next step was to make the wireless stack globally accessible by moving it
from the _pc_ to the _dde_linux_ repository. This move was motivated by the
fact that the _dde_linux_ repository is already available in all platform or
rather board-specific repositories while the _pc_ repository is not. It is
in itself a board-specific repository and therefore having it appear as
dependency for other such repositories feels unnatural.
So the bulk of the driver code now lives in the _dde_linux_ repository from
where it can be referenced by other repositories.
While moving the code, we noticed that in contrast to all other Linux-based
drivers the 'wifi_drv' is special. Since the binary itself is a libc component,
care was taken to isolate the application code, the 'wpa_supplicant', from
the driver code, the library containing the Linux wireless stack and drivers.
On all platforms, the binary stays the same while the driver library contains
all the platform-specific code. For this reason, the 'wifi_drv' binary is now
delegated to be a generic harness that includes all configuration and
management functionality shared by all wireless device driver components,
e.g., the WPA supplicant. The code of the device driver emulation environment
is located in _repos/dde_linux/src/lib/wifi_. It is referenced by the
platform-specific driver library that resides in the corresponding platform
repository. The runtime configuration needs to point the driver to a proper
driver library.
The platform-specific library is in charge of orchestrating the 3rd-party
sources utilized by the driver as well as providing the _source.list_ and
_dep.list_ files. It must include the generic library snippet
_repos/dde_linux/lib/wifi.inc_ that deals with managing the emulation
environment code. The amount of code added by the platform-specific libraries
is unimposing as it mostly consists of the dummy implementations needed by
the Linux configuration.
[image wifi_drv_architecture]
Composition of the wireless LAN driver component
All recipes for the depot archives are prefixed to the specific driver, for
example 'pkg/pc_wifi' contains a reference to 'src/pc_wifi_drv' as well as to
'raw/pc_wifi_firmware'.
Thanks to the steps outlined above, we now have three different wireless LAN
drivers, one for the PinePhone, one for the MNT Reform 2, and one for the PC
that nicely follow the same approach.
New firmware loading mechanism
------------------------------
Additionally to making it easier to enable and use the driver for new
platforms, we also refined how the driver loads its firmware images. In the
past, the driver contained a list of well-known working firmware images that
needed to be updated every now and then when new devices where enabled or the
firmware version changed due to a Linux update. In particular using the driver
with new devices was cumbersome as the driver itself already supported the
device most of the time, but it solely missed the corresponding entry in the
firmware list and adding that required recompiling the driver.
[image wifi_firmware_loading]
Firmware image loading sequence
So instead, the driver now loads the firmware images via its local VFS rather
than requesting a predetermined ROM module. Since the platform-specific driver
library has no direct access to the VFS - after all both worlds are
intentionally isolated from each other - a request/response interface was
added. The library submits a request to the _wifi_drv_ binary and will suspend
its execution waiting for the completion of the request. The binary will
acquire the firmware image and notify the driver library in return.
Streamlining the firmware acquisition in such a manner allows for using the
original probing mechanism available in Linux. Rather than following the
firmware list the actual driver code is now free to probe as it sees fit,
exactly pointing to the required uAPI revision in case the firmware is
missing.
The following snippet illustrates the configuration of the driver on the
PinePhone (omitting any integration-related routes for the config ROM as well
as state and scan reports):
!<start name="wifi_drv" caps="250" priority="-1">
! <resource name="RAM" quantum="32M"/>
! <config ld_verbose="yes">
! <report mac_address="true"/>
! <libc stdout="/dev/log" stderr="/dev/log"
! rtc="/dev/rtc" rng="/dev/urandom"/>
! <vfs>
! <dir name="dev"> <log/> <null/> <rtc/>
! <jitterentropy name="random"/>
! <jitterentropy name="urandom"/>
! <wifi/>
! </dir>
! <dir name="firmware">
! <tar name="wifi_firmware.tar"/>
! </dir>
! </vfs>
! </config>
! <route>
! <service name="ROM" label="wifi.lib.so">
! <parent label="a64_wifi.lib.so"/>
! </service>
! <service name="ROM" label="wifi_firmware.tar">
! <parent label="a64_wifi_firmware.tar"/>
! </service>
! <service name="ROM" label="dtb">
! <parent label="wifi-pinephone.dtb"/>
! </service>
! […]
! <any-services> <parent/> <any->child/> </service>
! </route>
!</start>
In this configuration, the firmware images are provided as a _.tar_ archive
that itself is requested via a ROM connection. The driver will always look
into the _/firmware_ directory to access any firmware related files. How the
directory is populated is up to the integrator of the driver.
As a further simplification step, we removed the need for the firmware library
used to contain firmware images. It is superseded by the use of a plain data
depot archive, e.g., _raw/pc_wifi_firmware_.
Additional device support and updates
-------------------------------------
We updated the firmware images to the most recent ones supported by
Linux version 6.1.20.
We enabled the ath9k PCIe driver that can be used on the MNT Reform 2 and the
PC. As the ath9k device (168c:0034) used to test the driver on the PC exhibited
problems when using MSIs, we disable their usage in the 'pci_decoder'. Similar
treatment might be necessary if other ath9k-based devices are used.
The device support in the 'rtlwifi' driver got extended by additionally
enabling support for RTL8192CE devices.
Furthermore, we updated the WPA supplicant to its latest v2.10 release and
introduce preliminary support for joining networks secured by WPA3.
Base framework and OS-level infrastructure
##########################################
New tool chain based on GCC 12.3, C++20 enabled by default
==========================================================
Following a regular cycle of two years, we updated our tool chain to recent
versions again, this time in particular to GCC 12.3.0, binutils 2.40, and GDB
13.1 while taking the opportunity to enable C++20 by default.
A noticeable change with GCC 12 is that auto-vectorization with the
'-ftree-vectorize' option is now enabled by default when building with the
'-O2' optimization level. This has the effect that more SIMD instructions are
generated, which required adaptations throughout our code base, for example by
making sure that memory allocations in ported Linux drivers adhere a suitable
address alignment and by saving and restoring ARMv8 FPU registers in the
dynamic linker.
In addition to that, GCC 12 reports new warnings and errors, which we had to
rectify at various places, the most common ones being:
* Deprecated arithmetics between different enumeration types,
* Deprecated use of '++' and '--' operators with volatile variables, and
* Undefined references to 'strlen' inside custom implementations
of 'strlen'-like functions, related to the
'-ftree-loop-distribute-patterns' option.
As an extra feature, we added Genode's library name patterns to the linker so
that the '-l' option has become able to find the corresponding libraries.
This is useful while porting 3rd-party software based on Autoconf, whenever a
'configure' script checks for a library dependency by linking a test program
with this option. This change thereby removes the need for dummy libraries
that were formerly used to satisfy the probing.
API changes
===========
As part of Genode's
[https://genode.org/documentation/release-notes/16.08#Cultivation_of_the_new_text-output_API - great API revision]
in 2016, we largely *abolished* the use of *format strings* throughout the
framework. This is desirable because a code base without format strings cannot
have format-string vulnerabilities. Still, a few occurrences, specifically the
interface for passing session-construction arguments, remained untouched since
then. With version 23.05, we finally attained our initial goal by wrapping up
the transition.
In particular, we revised 'Genode::Connection', which now accepts the session
label, affinity, and session-specific parameters as constructor arguments,
whereas the parameters are passed as a 'Genode::String'. This eliminates the
need for rendering a format string. Given this new interface, we were able to
remove format strings from all connection types, updated all components that
still happened to rely on format strings, and ultimately removed format
strings from Genode's base API.
Format strings still play a role to accommodate 3rd-party code ported
to Genode. Whenever the 3rd-party code targets the C runtime, format
strings are readily available via the libc. For free-standing ports that
avoid the dependency from the full C runtime, e.g., ported device drivers,
a new 'format' library based on Genode's former _base/snprintf.h_ and
_base/console.h_ provides rudimentary format-string support. The library
is hosted in the libports repository.
As another matter of housekeeping, we removed the _util/avl_string.h_ utility.
The use case of organizing objects by using strings as keys is covered by the
_util/dictionary.h_ now.
Towards kernel-agnostic DMA protection
======================================
As sketched in our [https://genode.org/about/road-map - road map], we plan
having a feature-complete PC version of Sculpt OS based on base-hw by the end
of this year. One of the reasons why we are still sticking to base-nova for
the PC version is the fact that we are relying on NOVA's IOMMU support. One
necessary step to decouple Sculpt OS from base-nova is to integrate the IOMMU
handling into the platform driver.
Motivated by our
[https://genode.org/documentation/release-notes/23.02#Custom_IP_block_for_DMA_protection_on_AMD_Xilinx_Zynq - custom IP block for DMA protection on AMD/Xilinx Zynq],
we integrated the notion of IOMMU-like devices into the platform driver with
this release as a preparatory step. The platform driver automatically acquires
known IOMMU-like devices for itself by looking at the device types. Other
devices can then reference these devices by using '<io_mmu>' nodes. This is
best illustrated by looking at the devices ROM for the Zynq's dma_guard IP
block:
! <devices>
!
! <device type="dma_guard" name="dma_guard_0">
! <!-- [...] -->
! </device>
!
! <device type="axi_dma" name="axi_dma_0">
! <io_mmu name="dma_guard_0"/>
! <!-- [...] -->
! </device>
!
! </devices>
This tells the platform driver that, whenever a DMA buffer is allocated/freed
for the session owning the 'axi_dma_0' device, the 'dma_guard_0' must be
configured accordingly in order to allow/deny access to the corresponding
memory ranges. With the structural changes to the platform driver, the support
for dma_guard devices is simply added by implementing specific 'Io_mmu' and
'Io_mmu_factory' objects. You can find the code in the _dma_guard.h_ within
the
[https://github.com/genodelabs/genode-zynq/blob/master/src/drivers/platform/zynq/dma_guard.h - genode-zynq repo].
For the PC version of the platform driver, we implemented a _kernel_iommu_
device that still uses device PDs to pass IOMMU configuration to the NOVA
kernel. The _kernel_iommu_ is automatically instantiated and used as a default
for each device until we replaced this by a kernel-agnostic implementation in
a future release.
With these preparations, we paved the way for implementing configuration logic
for arbitrary IOMMU-like devices within the platform driver. In particular,
the platform driver has been made capable of managing multiple IOMMU-like
devices at the same time. However, there is one limitation that comes from the
fact that DMA buffers are not device-specific but allocated per session: All
IOMMU-like devices must either operate as MMU (virtual addressing) or as MPU
(physical addressing).
Revision of Genode's custom block-encryption infrastructure
===========================================================
Tresor library
~~~~~~~~~~~~~~
For about two years, our Ada/SPARK-based CBE block encryption and its GUI
front-end, the file vault, served us well with rather manageable workloads
such as configuration and credential files in Sculpt OS on the PC. However,
with the rise of mobile Sculpt on the PinePhone, the CBE ecosystem was
suddenly confronted with new challenges and requirements.
First, mobile platforms are usually less forgiving when it comes to
performance and the CBE still exhibited a lot of potential for optimization.
Second, we envision encrypted storage to become an integral part of the base
system - the "appliance role" of mobile Sculpt OS - which shifts the role of
the component from an optional feature to a foundational mechanism. With this
role shift, however, maintainability becomes increasingly important. Third,
now that we decided to settle on this block-encryption approach and to
increasingly expose it to real workloads, we can expect new requirements to
pop up more frequently and with higher priority. Last but not least, our
Ada/SPARK runtime, so far, lacks ARM support.
This prospect forced us to carefully reconsider our relation to the existing
CBE approach, and especially to the fact that its core logic and crypto
back-end were entirely written in Ada/SPARK. When we started developing the
CBE in Ada/SPARK, we were positive that the language might become popular
among the core developers of Genode and that, eventually, other, especially
critical parts of the framework could benefit from it as well. But this idea
didn't come to fruition. Only a few of us came in touch with the new language
and, of those, even fewer acquired profound experience with it. We ultimately
realized that the friction caused by the added language boundary that emerged
with the CBE approach became a bottleneck, inhibiting the further evolution of
our block-encryption stack with a strong sense of collective code ownership.
This observation in mind, and the above-mentioned challenges in sight, we
decided to drop the CBE library and create a new implementation strongly
inspired by the CBE design but in C++, our "mother tongue". The new library is
called tresor, brings the same feature set as the CBE and is compatible with
containers created with the CBE. The file vault has been adapted to run with
the tresor library. So file-vault users can continue using their containers as
usual without further ado. The entire tresor-based ecosystem is
architecture-agnostic, which lifts the former restriction to x86.
File Vault
~~~~~~~~~~
Some new features have been added to the file vault. For instance, the
component can now be driven with one of two available user interfaces: The
usual graphical front-end or the new non-interactive interface that is driven
by a textual configuration and provides feedback through a report. This allows
for the integration of the file vault with automated controls respectively
lower or higher-level UIs. The interactive interface remains the default, but
one can replace it with the text-based variant using the new "user_interface"
configuration attribute. An example of operating the text-based interface is
provided by the new _file_vault_config_report.run_ script.
As another rather small but handy feature, a file vault can now be locked and
unlocked without having to restart the component. In the locked state, all key
material is removed from the cryptographic back end and the block-encryption
driver is shut down. The user is then prompted to provide the correct
credentials in order to re-establish access to the container.
Custom virtual machine monitor on ARM
=====================================
The
[https://genode.org/documentation/release-notes/23.02#Interactive_graphical_VMs_on_ARM - previous release], introduced interactive graphical VMs on ARM systems.
Genode's custom virtual machine monitor was enhanced by VirtIO device models
for input events and GPU. However, dynamic changes of the virtual GPU's
framebuffer resolution weren't yet handled by the initial version. With the
current release, these restrictions got removed. Now, the user is able to
resize the window of a virtual machine as expected.
NetBSD rump kernel on RISC-V
============================
We have added RISC-V to our port of the
[https://wiki.netbsd.org/rumpkernel - rump kernel].
This enables Genode to access commodity file-systems on RISC-V based devices.
Strengthened fault tolerance of on-target package management
============================================================
Genode's way of safely installing and deploying packages on-target - as
introduced in
[https://genode.org/documentation/release-notes/18.02#On-target_package_installation_and_deployment - version 18.02] -
is a corner stone of Sculpt OS. The recent move of Sculpt OS to mobile
devices, however, revealed a couple of limitations that we address with the
current release.
First, in contrast to the PC version of Sculpt OS that allows for the
straight-forward management and editing of files using a regular command-line
interface, a touch-based user interface as present on the phone is far more
constrained. Problems that can be solved by manual intervention on the PC
without second thought can become insurmountable showstoppers on the phone.
The most prominent problem is recovery from the situation where package
dependencies remain incomplete due to an interruption of the installation
process or due to packaging mistakes. On the PC, such a situation can be
resolved by simply clearing the depot using a single terminal command,
followed by a reinstall of the package. On the phone, the user was left out in
the cold with the message "package installed but incomplete" but with no
obvious or non-obvious way of recovery. The new version gracefully handles
this failure state by offering the retry of the package installation.
Second, network connectivity is far more fluctuating on mobile devices, which
increases the likelihood for download errors. The previous version that
regarded download errors as rare and sporadic issues, responded to such errors
by repeated and silent retries. We found that a mobile phone demands a more
graceful way to reflect such failure situations to the user, and to limit the
rate of futile download attempts. The new version preserves information about
download failures for user inspection and re-issues new downloads only if not
already flagged as unavailable.
Finally, we encountered the manual addition of software providers to the
system as a hurdle on the phone. On the PC, a new software provider can be
added by manually placing the provider's _download_ and _pubkey_ files in a
local depot directory, which is straight-forward when using a shell. However,
on a touch-screen device, there is no obvious and simple way to supplement the
system with such information. To still accommodate the user's desire to
download and install software from arbitrary providers, we added the option to
explicitly skip the signature verification for downloads. This is useful in
scenarios where the lack of integrity of downloaded content does not pose a
risk, e.g., for untrusted applications that are rigidly sandboxed, or during
development.
Whenever the depot-download subsystem encounters the attribute 'verify="no"'
for an '<installation>' item, it accepts the installation even if no key is
available. It still applies verification for dependencies whenever possible.
E.g., if a package of the provider "john" gets installed via 'verify="no"' and
the package depends on an archive by "genodelabs", for which the public key is
known, the integrity of the content originating from "genodelabs" is verified.
Libraries and applications
##########################
Qt5 reorganization
==================
When the Goa tool is used to build an application, all libraries of the used
API packages get linked to the application and the single Qt5 API package with
big libraries like QtWebEngine was a bit too much for simple Qt applications.
For this reason, we split the Qt5 API into smaller packages according to the
corresponding Qt modules.
As preparation for the release of a binary version of the Qt5 host tools, we
also reduced the external dependencies of these tools for improved
compatibility with different host systems and changed their install location
to the location of the other Genode host tools.
And finally, we added a 'ubuntu-ui-toolkit' meta package in the genode-world
repository which pulls in all dependencies for the Ubuntu UI toolkit,
including a runtime with the required ROMs.
WireGuard improvements
======================
There are two smaller changes related to Genode's port of WireGuard. First,
peers can now be removed from WireGuard at runtime by removing the
corresponding '<peer>' tags from the component's configuration. This operation
enforces the same assurances as removing a peer from a native WireGuard driver
in Linux.
The second change has to do with the nature of the port. The WireGuard port is
one of the rare examples where we use our Linux device driver environment
(dde_linux) for porting software that is not exactly a driver. The component
does not depend on a specific hardware configuration and therefore, the
emulated Linux kernel can be platform-agnostic. Consequently, while porting,
we created such a variant of the Linux emulation specifically for WireGuard.
However, we realized that this variant can come in handy for ports of other
hardware-agnostic kernel parts (for instance, lxip) as well. Therefore, we now
cut it out of the WireGuard port in order to make it a self-contained version
of the 'lx_emul' library. The new library is called 'virt_lx_emul' and is
accompanied by the 'virt_linux' target that can be used to build the
corresponding Linux kernel and run it in Qemu.
Updated or removed 3rd-party software
=====================================
VirtualBox updated to version 6.1.44
------------------------------------
Our port of VirtualBox underwent some maintenance work published in this
release. With the tool chain updated to GCC 12, it became necessary to update
VirtualBox to version 6.1.44 to keep up with the tool-chain changes and fix
many upstream bugs alongside. Also, we improved several aspects of the port to
improve robustness of networking, USB, multi-threading, and VM reboot. After
thorough testing in every-day scenarios, we finally adopted the handling of
the x86 time-stamp counter from version 5 and disabled the VM exit for the
RDTSC instruction, which improves the performance of selected scenarios
significantly. For Windows guests, it has become crucial to configure the
paravirtualization provider like follows in the _machine.vbox6_ file.
Otherwise, the guest's TSC calibration fails resulting in a bogus CPU
frequency assumption.
! <Paravirt provider="HyperV"/>
Removed ports of pcre16 and icu libraries
-----------------------------------------
The pcre16 and icu libraries had been used by Qt5 in the past but were not
used anymore since the last Qt updates. So we removed them from the _libports_
repository.
Device drivers
##############
Linux device driver environment updated to Linux 6.1.20
=======================================================
According to [https://genode.org/about/road-map - our roadmap], the update of
Genode's Linux device driver environment (DDE) to a more recent 6.x Linux
version was planned for release 23.08. Now, we decided to tackle this update
with this version already.
Besides the Wireguard port to Genode, the following ported drivers use the
latest Linux kernel 6.1.20 version now:
* Zynq SD-card driver
* PCI Wifi driver for i.MX 8MQ
* all PC drivers (USB host, Wifi, Intel display)
Note that a few drivers are not listed above. The existing drivers for the
Allwinner and i.MX 8MQ SoC still use older 5.x Linux kernel versions as base.
However, the Linux device driver environment has been tweaked carefully to
support a range of Linux kernel versions from 5.11 till 6.1.20.
While doing the update work, we investigated a more sustainable link between
the Linux kernel drivers for USB and display drivers (DRM/KMS) on the one
hand, and the Genode API on the other. The outcome is explained in the next
two sections.
Intel display driver
====================
During the update of DDE Linux to the Linux 6.1.20 version, the dependency on
internal structures of the Intel framebuffer driver (intel_fbdev) became a
hassle. Although the update was successful finally, we decided to remove the
direct usage of intel_fbdev in our ported Intel display driver, in order to
ease future updates. Nevertheless, the functionality of intel_fbdev is
required to manage the framebuffer memory to provide a working Genode GUI
interface by the driver. For that, we investigated the use of the
[https://www.kernel.org/doc/html/v5.0/gpu/drm-kms.html - Linux DRM/KMS]
interface, specifically to allocate and manage so called
[https://www.kernel.org/doc/html/v5.0/gpu/drm-kms.html#dumb-buffer-objects - dumb buffer objects].
As described in the linked article, the dumb buffers are a standardized and
streamlined way to make early boot graphics possible driven by user-land
tools. We adjusted our port along the ioctl's of the dumb buffer functionality
to manage the framebuffer in our ported display driver.
USB
===
Connecting different USB clients to a USB host controller driver is a delicate
task. When using a port of a Linux kernel driver, it can quickly become
brittle because the USB driver API in the Linux kernel is complex and contains
some semantic dependencies, for instance regarding synchronization, which are
not always obvious. However, the Linux kernel offers a USB device I/O API to
the user-land that is used for instance by libusb. This API has to guard the
USB subsystem against wrong usage, and implements the necessary semantics
regarding synchronization and dynamic changes of clients and devices. In the
past, we repeatedly encountered corner-case issues, if clients or devices
vanished and appeared at a high rate. For the sake of robustness, we decided
to redesign our internal linking in between the Genode USB API and Linux to
use the user-level device I/O API of the latter. Moreover, we extended the
capacity of USB packets in-flight that can be handled by the controller in
parallel to 32, to enhance the throughput for some USB devices.
NVMe storage
============
Our custom NVMe driver received the following improvements. First we added
'host-memory-buffer' (HMB) support to the driver, which is a performance
optimization for NVMe devices that do not make use of a DRAM cache for its
operational data.
The amount of memory used for the HMB can be set by adding the 'max_hmb_size'
attribute in the '<config>' node of the driver. This value is checked against
the constraints imposed by the device. Should the value be less than the
minimal required amount of memory, it will not be used and a warning is
issued. On the other hand, if the specified value is larger than the preferred
amount of memory as favored by the device, it will be capped to the useful
amount instead.
Naturally, when using the HMB, the required RAM quota of the driver component
increases by that amount.
Second, we fixed a problem detecting the block size (LBA format) of a given
namespace. The lower 4 bits of the 'FLABS' register indicate which of the (up
to) 16 supported LBA formats is used by the namespace. However, instead of
only making use of those bits, the driver looked at the whole register that
also includes other information. This led to using the wrong index for reading
the LBA format and, on certain devices, rendered the driver unusable as the
assumed block size was detected wrong.
Audio-driver update
===================
We updated the audio driver for HDA devices ported from OpenBSD to version 7.3.
The functional changes are minimal, but the new version supports more recent
PC platforms and recognizes more codecs.
Platforms
#########
Base-HW microkernel
===================
Principle x86 virtualization support (on Qemu)
----------------------------------------------
This release brings limited support for AMD's Secure Virtual Machine (SVM)
vCPUs to Genode's custom base-hw microkernel. Supporting SVM is meant as an
intermediate step towards enabling advanced virtualization workloads using
VirtualBox on Intel VMX later this year. The approach allows us to craft the
kernel's virtualization infrastructure using Qemu - which is able to emulate
SVM in software - and cross-test our implementation against other hypervisors
in a tightly controlled setting. For reference, we used the time-tested Qemu
version 4.2 for this line of work.
Implementing principle vCPU support revealed a few points of friction between
base-hw's kernel interface, which had been designed for the needs of our
custom ARM VMM, and our kernel-agnostic VM interface on x86 that has been
carefully crafted to support a range of 3rd party hypervisors, but relies on
more logic in the kernel-specific VMM library to manage the vCPU state.
The current implementation is able to run several test VM workloads like the
artificial 'vmm_x86' test, our seoul VMM run scripts with Linux, and - of
course - Genode VMs on one vCPU. It has thereby reached an important stepping
stone towards our actual goal of hosting VirtualBox on Intel hardware.
Having shown that base-hw can support the generic x86 VM interface, we will
mature our implementation and may adapt our interface to make it a better fit
to base-hw's vCPU execution model in the future.
Boot-time RAM detection on the PinePhone
----------------------------------------
For the PinePhone, we implemented dynamic detection of the system RAM size by
parsing the values of the DRAM controller as programmed by U-Boot. This way, 2
and 3 GB models of the PinePhone are supported by Genode.
Updated seL4 microkernel
========================
With this release, we updated the support of the seL4 kernel from 9.0.1 to
12.1.0 for i.MX6 Sabrelite board and x86_64 PC. The support for 32-bit PC got
removed since it is unused, and the i.MX7 Sabrelite support got removed since
it is not supported by the new seL4 kernel anymore.
The updated seL4 kernel requires additional host tools installed, namely
CMake, Ninja and additional Python3 modules, jinja2, jschonschema, and pyfdt.
Depending on the distribution, the modules are available as distribution
package or need to be installed with the python pip3 tool.

786
doc/release_notes/23-08.txt Normal file
View File

@@ -0,0 +1,786 @@
===============================================
Release notes for the Genode OS Framework 23.08
===============================================
Genode Labs
The headline features of Genode 23.08 are concerned with developer tooling.
First, we re-approached Genode's GDB debugging support with the grand vision
of easy on-target debugging directly on Sculpt OS. Our new debug monitor
introduced in Section [Multi-component debug monitor] combines the GDB
protocol with Genode's init component. Thereby, the monitor can transparently
be integrated in Genode subsystems and can be used to debug multiple
components simultaneously.
Second, the Goa tool, which started as an experiment in 2019, has been shaped
into an all-encompassing alternative to Genode's traditional work flows for
developing, porting, and publishing applications. The tool got vastly more
flexible with respect to runtime testing, and even became able to handle
dependencies between Goa projects. The massive improvements are covered in
Section [Goa tool gets usability improvements and depot-index publishing support].
Besides the headline features of the release, we admittedly deviated from the
original plans laid out on our [http:/about/road-map - road map]. Early-on in
the release cycle, we found ourselves drawn to code modernization, the
retiring of legacies, and quality assurance. E.g., we finally updated some of
the most veteran internals of the framework to our modern-day coding
practices, we urged to continue the success story of our new Linux
device-driver environment (DDE) by replacing old USB drivers by new components
leveraging the modern approach, and created a new DDE-Linux-based NIC driver
for PC hardware while retiring the aged iPXE-based traditional driver. The
outcome of this tireless work may hardly be visible from a feature perspective.
But it greatly improves the velocity and quality of the code to maintain down
the road.
It goes without saying that the other topics of the road map haven't been
disregarded. In fact we celebrated a break-through with x86 virtualization
on our base-hw kernel, are diving deep into the latest Intel platforms, and
working on the user-visible side of the mobile version of Sculpt OS. But since
those topics are not wrapped up yet, we all have to stay tuned for the next
release.
Multi-component debug monitor
#############################
The debugging of Genode components using the GNU debugger (GDB) was already
an anticipated feature when we introduced the first version of the GDB monitor
component in version
[https://genode.org/documentation/release-notes/11.05#GDB_monitor_experiment - 11.05]
and refined it in the subsequent releases
[https://genode.org/documentation/release-notes/12.02#GDB_monitor_refinements_and_automated_test - 12.02],
[https://genode.org/documentation/release-notes/13.11#GNU_Debugger - 13.11] (on-target GDB), and
[https://genode.org/documentation/release-notes/16.05#Enhanced_GDB_support_on_NOVA - 16.05] (supporting NOVA).
Despite these efforts, the feature remained rarely used in practice.
In most situations, manual instrumentation with debug messages or the use
of GDB with the Linux version of Genode remain to be the instruments of choice.
Driven by the vision of easy on-target debugging on Sculpt OS, we identified
the following limitations of the existing GDB monitor that stand in the way.
# The GDB monitor supports only one component as debugging target, which makes
the debugging of scenarios where components closely interact difficult.
# The existing implementation re-uses the gdbserver code and thereby inherits
many POSIX peculiarities that must be stubbed for Genode, yet make the
overall implementation complex. Genode is not POSIX after all.
# The integration of the GDB monitor into an existing scenario is a fairly
invasive change that requires too much work.
Given these limitations as a backdrop, two key ideas motivated a new approach
for the revision of Genode's GDB support for this release:
First, by using Genode's sandbox API as foundation for a new debug monitor,
we would become able to use the monitor as drop-in replacement for 'init',
potentially going as far as using the monitor for Sculpt's runtime subsystem.
Wouldn't that approach vastly simplify the integration issue (3)?
Second, GDB supports the debugging of multiple processes (called inferiors)
within one session, which would in principle allow us to inspect and debug
component compositions, addressing the first limitation.
And third, the casual review of the documentation of the GDB protocol left
the impression that a Genode-tailored implementation shouldn't be that
complicated.
The result of these ideas is the new *monitor* component at _os/src/monitor_
as the designated successor of the traditional gdb_monitor. By leveraging the
sandbox API, it can be used as a drop-in replacement for the init component
and monitor multiple components. In real-world scenarios like Sculpt's
runtime, we deliberately want/need to restrict the debugging to a few selected
components, however, which calls for the support of a mix of monitored and
regular components hosted side by side. Given this requirement, the sandbox
API had to be enhanced to support the selective interception of PD and CPU
sessions.
Like the original gdb_monitor, the new monitor speaks the GDB remote serial
protocol over Genode's terminal session. But the protocol implementation does
not re-use any gdbserver code, sidestepping the complexities of POSIX.
The monitor supports the essential GDB remote protocol commands for reading
and writing of memory and registers, for stopping and resuming of threads
including single-stepping, and it reports the occurrence of page faults and
exceptions to GDB. Breakpoints are managed by GDB using software breakpoint
instructions. The GDB protocol is operated in GDB's 'non-stop' mode, which
means that threads of multiple inferiors can be stopped and resumed
individually or in groups, depending on the GDB commands issued by the user.
As of now, the monitor supports NOVA on 64-bit x86 as well as Genode's custom
base-hw kernel on 64-bit ARM and x86. The 64-bit ARM support required a change
in Genode's customized GDB port to enable shared-library support for this
architecture. So in order to use Genode's host GDB with the monitor on 64-bit
ARM, the Genode tool chain needs to be rebuilt with the _tool/tool_chain_
script.
There exist three run scripts illustrating the new component. The
_os/run/monitor.run_ script exercises memory inspection via the 'm' command
and memory modification via the 'M' command by letting a test program monitor
itself. The _os/run/monitor_gdb.run_ script performs automated tests of various
GDB commands and the _os/run/monitor_gdb_interactive.run_ script allows for the
interactive use of GDB to interact with monitored components.
Details about the configuration of the monitor component are given by the
README file at the _os/src/monitor/_ directory.
Goa tool gets usability improvements and depot-index publishing support
#######################################################################
Moving the Goa tool under the umbrella of Genode Labs in the previous release
unleashed a wave of substantial improvements.
Most significantly, we were able to integrate support for depot-index projects
into Goa (Section [Support of index projects]). This greatly simplifies the
publishing of user-specific Goa projects for the upcoming Sculpt release.
One of the game-changing features of Goa is its ability to easily test-run
applications on the host system leveraging Genode's ABI compatibility between
different kernels. However, in various instances, we still required customized
runtime scenarios in order to render an application runnable by Goa. With this
release, we further streamlined Goa's base-linux runtime with Sculpt OS
(Section [Run-stage generalization]).
Apart from these major changes, the lately added shared-library support and
Rust support have seen practical improvements.
Support of index projects
=========================
With an increasing number of Genode applications being developed with Goa,
being able to manage and publish a personal depot index with Goa became due.
In the past, we needed to build, export, and publish each individual Goa
project and manually add it to the depot index in order to make it available
for a particular Sculpt release.
For this purpose, we added support for index projects to Goa. An index project
is defined by an 'index' file. This file follows the structure of a depot index
but only names the archive names (lacking depot user and version). The
'goa export' command augments these names with the current depot user and
version information. By running 'goa publish', the result is published as a
depot index for the current Sculpt version.
As Goa supports a hierarchical project structure, an index project may
contain subdirectories with other Goa projects that provide the corresponding
pkg archives. The 'goa export' command issued within such an index project
recursively scans the working directory for any Goa project providing the
required depot archives or any of their dependencies, and exports these
subprojects as well.
To make working with index projects an even more joyful experience, we changed
the way Goa looks up version information. Goa used to expect the current
version of each required depot archive to be specified in a goarc file. For
each Goa project, however, a 'version' file may be used to specify the current
version. This file was only evaluated on export of the particular project.
With this release, Goa now scans the working directory for Goa subprojects in
order to look up their 'version' file. This spares us keeping the 'version'
files and goarc files in sync. The new 'bump-version' command adds another
level of convenience as it automatically updates the 'version' file of a Goa
project. In combination with the '-r' switch, we are now able to update the
version information of all subprojects with a single command.
An example of an index project is found at _examples/index_ in the Goa
repository.
:Goa tool:
[https://github.com/genodelabs/goa/]
Run-stage generalization
========================
In addition to building, exporting, and publishing of depot archives, Goa
supports test-running an application project directly on the development
system by utilizing base-linux. Similarly to how Goa modularized the build
stage to support various build systems, we generalized the run stage to pave
the way for other targets than base-linux. The interface of the generalized
run stage and the current feature set of the linux target is documented by
'goa help targets'.
In the course of generalizing the run stage, we introduced various plausibility
checks to further accelerate application development. For instance, we check
for typos in required and provided services of a runtime, and verify the
availability of required ROM modules.
Furthermore, the linux target underwent a major revision to streamline the
application development for Sculpt OS.
* Scenarios using a terminal component require a fonts file system.
In Sculpt OS, this is typically provided by instantiating a fonts_fs
component. Doing the same in Goa lifts the need to wrap Goa-managed
Sculpt packages in a separate test project.
* A route for the mesa_gpu_drv.lib.so ROM module was implicitly added when
a Gpu was required. For consistency with existing packages, we now require
the runtime file to mention the mesa_gpu_drv.lib.so ROM explicitly.
* For NIC requirements, we used to take the label as the tap-device name to
which the NIC driver was bound. Since the 'label' attribute might be
evaluated differently by Sculpt OS, we introduced the 'tap_name' attribute
instead. For each distinct tap device, we now instantiate a pair of NIC
driver and NIC router. Each router uses a distinct subnet for its default
domain, starting at 10.0.10.0/24 and ending at 10.0.255.0/24.
* The clipboard ROM and Report requirements are now routed to a report_rom
component.
* Arbitrary ROM requirements are routed to an lx_fs component that provides
the files found in the project's _var/rom_ directory as individual ROM
modules. An example resides in _examples/external_rom_. Thanks to Pirmin
Duss for this useful contribution.
* Remaining service requirements that are not handled otherwise will be routed
to a black-hole component.
Improved support for building shared libraries
==============================================
Since release 23.02, we are able to
[https://genode.org/documentation/release-notes/23.02#Building_and_packaging_CMake-based_shared_libraries__via_Goa_ - build CMake-based shared libraries in Goa].
In this release, this feature has seen a few improvements:
* If available, Goa now calls 'make install' during build in order to install
artifacts into _<build_dir>/install_. For libraries, this typically also
installs include files into this directory. Having all include files in the
build directory is a prerequisite for extracting these as api artifacts
(see 'goa help api').
* We added support for publishing api archives.
* 'goa export' now respects the 'common_var_dir' configuration variable and
'--common-var-dir' command-line option when exporting api archives.
* We fixed an issue that resulted in large binaries when building shared
libraries with Goa.
Quality assurance and usability tweaks
======================================
Increasing our development efforts for the Goa tool demands means to catch
regressions early on. For this purpose, we added a basic testing facility,
which validates that our examples still work as expected. Note that we are
going to address automated testing for arbitrary Goa projects at some point in
the future.
With this release, we changed the name of the '.goarc' files to 'goarc'. The
original intention of these files was to allow user-specific settings
analogously to, e.g., '.bashrc'. However, these files may contain arbitrary Tcl
code, thus having various '.goarc' files checked into git repositories, made
things a little bit too obscure because those files are hidden. When a user
clones a Git repo and invokes Goa commands, this code gets executed. Hence, it
is only fair to bring this code to the user's attention by not hiding it.
In addition to all the aforementioned major changes, we added a couple of minor
usability tweaks:
* We added 'goa help import' in order to document the syntax of the 'import'
file.
* We added the 'goa depot-dir' command that allows initializing a custom depot
directory with the default depot users.
* We added a 'goa run-dir' command that prepares the run directory without
actually running the scenario. This is helpful when the run time of 'goa run'
is automatically evaluated by external scripts since 'goa run-dir' may take a
while downloading the required depot archives.
* We added the 'run_as' configuration variable and '--run-as' command-line
option. This allows changing the depot user from which 'goa run' downloads
the required archives. See 'goa help config' for more details.
Support for the mainline Rust toolchain
=======================================
When we reintroduced Rust on Genode in the
[https://genode.org/documentation/release-notes/23.05#Initial_Rust_support - previous]
release, our implementation relied on a slightly adapted Rust toolchain to
work around missing support for versioned library symbols in our linker. With
this release, we are now able to use the mainline 'x86_64-unknown-freebsd'
target provided by Rust project, eliminating the need for a custom toolchain.
On top of the streamlined Rust support, we created a Goa package for a popular
Rust command-line application, which will be published along with updated
system packages in the upcoming Sculpt release.
For details on the mainline Rust toolchain support and the ported package,
take a look at the dedicated
[https://genodians.org/atopia/2023-08-24-enabling-the-upstream-rust-toolchain - blog post on Genodians.org].
Base framework and OS-level infrastructure
##########################################
Internal core and base-framework modernization
==============================================
Genode's API received multiple rounds of modernization in the past years. But
some of the framework's deepest internals remained largely unchanged over that
time. Even though one can argue that mature and battle-tested code should
better not be disrupted, our programming practices are not carved in stone.
To make Genode's internal code a delight for reviewers, auditors, and future
maintainers, we revisited the following areas.
Core's page-fault resolution code got reworked for improved clarity and
safety, by introducing dedicated result types, reducing the use of basic
types, choosing expressive names, and fostering constness. Along the way, we
introduced a number of 'print' hooks that greatly ease manual instrumentation
and streamlines diagnostic messages printed by core. Those messages no longer
appear when a user-level page-fault handler is registered for the faulted-at
region map. So the monitor component produces less noise on the attempt to
dump non-existing memory.
Closely related to the page-fault handling, we tightened the distinction
between rx and rwx inside core by restricting 'Region_map::attach_executable'
to create read-only mappings, while offering the option to map the full rights
using a new 'attach_rwx' method. The 'attach_rwx' method is now used by the
dynamic linker to explicitly attach the linker area with full rwx rights. With
the old page-fault handling code, the execute flag was evaluated only for leaf
dataspaces, not for managed dataspaces while traversing region-map
hierarchies. With the new page-fault handling code, the execute bit is
downgraded to no-execute when passing a managed dataspace that is not attached
as executable.
We ultimately removed the last traces of the global 'env_deprecated()'
interface that was still relied-on within core and parts of the base library.
Nowadays, we no longer use global accessors but generally employ
dependency-injection patterns. Since the 'env_deprecated()' interface is
closely related to initialization code, the startup code of core and regular
components got largely refactored, eliminating the reliance on global side
effects. As a collateral change, the legacy 'main' support for native Genode
component as well as the now-obsolete 'Entrypoint::schedule_suspend' mechanism
got removed.
API changes
===========
Register framework update
-------------------------
The register framework has been updated to ease its use with '-Wconversion'
warnings enabled, which is the default for Genode components.
When reading from a bitfield, the new version returns the value in the
smallest possible integer type, not the register-access type. This way,
the user of the bitfield value can use appropriate types without the need for
casting. The update also replaces 'bool' access types with 'uint8_t' access
types.
Thanks to this change, the net lib - used by Genode's low-level network
routing components for parsing protocol headers via the register API - has
been made compliant to strict conversion warnings.
Hex-dump utility
----------------
To aid the monitoring, implementation, and debugging of binary protocols, a
handy hex-dump utility got added to _util/formatted_output.h_. The new
'Genode::Hex_dump' class can be used to print a hexadecimal dump of a byte
range. The data is printed in a format similar to that used by the 'xxd'
utility. In addition to the 'xxd' format, consecutive duplicate lines are
replaced with a single "*\n".
Libraries and applications
##########################
New NIC server for raw uplink connectivity
==========================================
With Genode
[https://genode.org/documentation/release-notes/21.02#Pluggable_network_device_drivers - 21.02],
we transitioned all network device drivers to act as session clients in order
to make them pluggable. We achieved this by introducing a new _uplink_ service
interface that is very similar to the NIC service but with the peer roles
switched. Up to now, the only uplink server and uplink-to-NIC adapter was the
NIC router. This is reasonable as it is the standard network multiplexer in
Genode and therefore normally sits in front of each network device driver
anyway. However, there is one major issue with this approach: It binds
physical network access to layer 3 and 4 routing respectively layer 2
multiplexing, which, in our case, means that NIC clients can talk to the
physical network only with what is protocol-wise supported by the NIC router.
That's why Genode 23.08 introduces the new NIC-uplink adapter component. It
re-enables raw access to physical networks in Genode by forwarding packets
unmodified and unfiltered between multiple NIC sessions and one uplink
session. The new component is accompanied by a test script _nic_uplink.run_
that demonstrates the low-level integration and a Sculpt package _pkg/pc_nic_
that can be used for deployment in more sophisticated systems together with
the PC NIC-driver as back end.
One constellation, in which the NIC-uplink server will be especially useful for
us is the planned enablement of IPv6 on different layers of Genode's network
stack. More specifically, the tool will allow us to work at IPv6 support in
both Genode's ported TCP/IP stacks and the NIC router at the same time.
New depot-remove component
==========================
_The work described in this section was contributed by Alice Domage._
_Thanks for this welcome addition._
Genode's on-target package management allows for the installation of multiple
versions of the same package side by side, which is useful to roll back the
system to an earlier state, or to accommodate software depending on an older
library version. Software is installed into the so-called _depot_ stored on
the target and populated with downloads on demand. Until now, however, the
on-target depot could only grow, not shrink. Even though this limitation
hasn't been a pressing concern for Sculpt OS on the PC, it impeded embedded
use cases.
The new depot-remove component lifts this limitation by providing an orderly
way to remove depot content and orphaned dependencies. It operates by reading
its configuration and processes delete operations based on the provided rules.
A typical configuration looks as follows.
! <config arch="x86_64" report="yes">
! <remove user="alice" pkg="nano3d"/>
! <remove user="bob" pkg="wm" version="2042-42-42"/>
! <remove-all>
! <keep user="alice" pkg="fonts_fs"/>
! </remove-all>
! </config>
For more details about the configuration options, please refer to the README
file at _/gems/src/app/depot_remove/_. Furthermore, the
_gems/run/depot_remove.run_ script illustrates the component by exercising
several practical use cases.
DDE-Linux changes
=================
With this release, we changed how external events are treated within the
Linux emulation environment.
Whenever an external event occurred, for example timer or interrupt, the
corresponding I/O signal handler was triggered. This handler unblocked the
task waiting for the event and also initiated the immediate execution of all
unblocked tasks. This, however, could lead to nested execution because these
tasks might hit serialization points, e.g., synchronously waiting for packet
stream operations, that under the hood also require handling of other I/O
signals. Such an execution model is not supported and confusing as it mixes
application and I/O level signal handling.
So the flagging of the scheduling intent is now decoupled from its execution by
using an application-level signal handler that is run in the context of the
component's main entrypoint. The I/O signal handler now triggers the scheduling
execution by sending a local signal to the EP and only flags the occurrence
of the external event by unblocking the corresponding task.
In this context, we reworked the interrupt handling itself. Previously all
interrupts were immediately processed in the I/O signal handler and only the
currently pending one was handled. Due to the decoupling change the occurrence
of interrupts becomes merely flagging a state and requires recording all
interrupts and dispatch them consecutively in one go.
To facilitate this convention, the Lx_kit initialization function got extended,
and it is now necessary to pass in a signal handler that is used to perform the
normally occurring scheduler execution. As this signal handler is part of
the main object of the DDE-Linux based component it is the natural place to
perform any additional steps that are required by the component before or after
executing the scheduler.
As it is sometimes necessary to execute a pending schedule from the EP directly,
in case the scheduler is called from within an RPC function, the scheduler is
extended with the 'execute' member function that performs the check that the
scheduler is called from within the EP and triggers the execution afterwards.
Tresor block encryptor
======================
Following the introduction of the tresor library in the
[https://genode.org/documentation/release-notes/23.05#Revision_of_Genode_s_custom_block-encryption_infrastructure - previous]
release, we further polished the tresor tester in order to make it run on a
broad spectrum of target platforms. For instance, the test can now be run
without entropy input (permanently warning the user about the security risk)
because some of our test hardware lacks support for it. Besides that, we
mainly worked at the resource consumption of the test - made it more adaptable
or reduced it through improvements. This pleased not only less powerful
hardware but our test management as well.
Furthermore, we fixed a significant former deficiency with the tresor library.
The library used to work on the raw on-disc data without decoding first. This
worked fine for some platforms but caused alignment faults on others. That
said, the tresor library now always decodes into naturally typed and aligned
C++ structs before accessing the data.
Device drivers
##############
Intel GPU
=========
The handling of GPUs is somewhat special within the driver world. A GPU is a
standalone execution unit that can be programmed much like a CPU. In the past,
there were fixed function GPUs, which have been gradually replaced by
dynamically programmable units that execute compiled machine code (think
shader compilers like GLSL or general purpose computing like CUDA or OpenCL).
This leads to a situation where a GPU driver cannot trust the client that
sends its machine code to be executed by the GPU. There exists no sufficient
way of inspecting the compiled machine code for malicious behavior by the GPU
driver. Therefore, the only reasonable solution for a GPU driver is to send
the code to the GPU and hope for the best. In case the code execution is not
successful, GPUs tend to just hang and the only thing a driver can do is to
make sure via an IOMMU that the code does not access arbitrary memory and
program a watchdog timer and reset the GPU to a graceful state in case there
is no proper response. With the current Genode release, we have implemented
this behavior for GEN9 (HD graphics) and GEN12 (Intel Iris Xe).
Intel display
=============
The ported Linux Intel display driver now supports USB Type-C connectors as
used with modern notebooks.
New PC network driver based on DDE-Linux
========================================
Since 2010, we use Ethernet drivers ported from the iPXE project in a tiny
emulation layer on Genode. While those drivers did a good job for the common
cases, they always had some rough edges that may not hurt in the original
network-booting use case but had become a nuisance in Sculpt OS and Genode
in general. Most prominently the dropped link speed with Intel E1000e cards
on cable unplug/plug and the moderate throughput on GBit links had to be
addressed.
Our new DDE Linux approach introduced this year makes the porting of drivers
from the Linux kernel much easier and less labour-intensive as in the past.
Also, Linux is a very tempting Ethernet driver donor because of the variety
of supported devices and the well known excellent performance (especially on
Intel devices). Moreover, the Intel E1000e driver addresses all issues we
had with the iPXE implementation and promises a smooth interplay with Intel
AMT/ME. Note, Intel AMT Serial-over-LAN is still an important debug console
while deploying Genode on Intel-based notebooks.
Hence, the current release brings the new _pc_nic_drv_ for Intel e1000/e1000e,
Realtek 8169, and AMD PCnet32 (Qemu) devices on PC and is fully integrated
into Sculpt OS. Performance-wise the driver easily saturates 1 GBit links in
our throughput tests.
USB host controller
===================
The USB host controller driver ports for Raspberry Pi 1 and i.MX 6 Quad got
updated to Linux kernel version 6.1.37 resp. 6.1.20. Both driver ports share
the renewed device-driver environment approach for Linux introduced in release
[https://genode.org/documentation/release-notes/21.08#Linux-device-driver_environment_re-imagined - 21.08].
Besides the update of the last remaining outdated USB host controller drivers,
we have reworked the common C/C++ Linux-to-Genode USB back end used by all USB
host controller driver incarnations. The internal changes were necessary to
address issues regarding races during USB session close attempts, resets of
USB endpoints, and potential stalls during synchronous USB RPC calls.
PC audio refinements
====================
In this release, we simplified the memory allocator in the OpenBSD-based
audio-driver component and thereby decreased its memory usage. The memory
subsystem implementation was initially brought over from DDE Linux and is
geared towards use cases where a high-performing allocator is desired. For the
audio driver with its clear memory usage pattern, such an allocator is not
necessary and since no other driver that could benefit from it was ported in
the meantime, we opted for replacing the implementation with a simpler one
with less overhead.
We also adapted the mixer state report mechanism to always generate a new
report on head-phone jack sense events.
Furthermore, we decreased the internal buffer size to implicitly limit the
number of blocks provisioned for recording that brings them in line with the
number of blocks used for playback (2).
Wifi
====
With the [DDE-Linux changes] in place, we had to adapt the initialization
procedure in the wireless LAN driver since it behaves differently to all other
DDE-Linux-based driver components. The driver is actually a 'Libc::Component'
due to its incorporation of the 'wpa_spplicant' application and the driver
itself is confined to its own shared-object to better separate the Linux code.
Since we implement the Linux initcalls as static constructors, we have to
initialize the Lx_kit before those are executed. This is normally not a
problem because they are executed manually from within the drivers main object
on construction. However, in a 'Libc::Component' this happens before our main
object is constructed. In the past, we used a VFS plugin to perform the
initialization - as the VFS is also constructed beforehand - but this is no
longer possible as the driver's main signal handler that now dispatches the
Lx_kit event signals is not available at this point.
We decided therefore to perform a multi-staged boot-up process where the
component is now implemented as regular 'Genode::Component' that triggers the
'Libc::Component' construction manually after performing the Lx_kit
initialization. This change enabled us to remove the VFS 'wifi' plugin that no
longer has to be specified in the VFS configuration.
Furthermore, we removed the handcrafted MAC address reporter in favor of the
Genode C API utility that was recently made available.
PinePhone support for buttons and screensaver
=============================================
To equip the mobile version of Sculpt OS on the PinePhone with a proper
screensaver, we added drivers for detecting user interactions with the
PinePhone's physical buttons, namely the volume buttons and the power button.
The volume buttons are connected via cascaded resistors to a single ADC of the
A64 SoC. The corresponding driver has been added to the genode-allwinner
repository at _src/drivers/button/pinephone/_ and is accompanied by the
_button_pinephone.run_ script. It reports KEY_VOLUMEUP and KEY_VOLUMEDOWN
input events to an event session.
Sensing the power button has been a slightly more delicate issue because the
power button is connected to the power-management IC (PMIC), which shall only
be accessed via the system-control processor (SCP). To detect state changes,
the PMIC's IRQ (routed through the R_INTC to the GIC) is now handled by the
power driver. This has the added benefit that also other interesting PMIC
events (like connecting AC) get immediately reported.
With the button drivers in place, we finally equipped Sculpt OS with a
screensaver as a crucial battery-conserving feature. The screensaver kicks in
after the user remained inactive in the administrative user interface for some
time. It also can be manually activated by pressing the power button. While
the screen is blanked, a press of the power button enables the display again.
Under the hood, Sculpt completely removes the drivers for the display and the
touchscreen while the screen is blanked, which considerably reduces the power
draw. The system also switches the CPU to economic mode while the screen is
blanked. Here are some illustrative data points:
! Max brightness in performance mode: 2.8 W
! Max brightness in economic mode: 2.6 W
! Low brightness in economic mode: 1.7 W
! Screensaver: 1.1 W
You can find the screensaver feature integrated in the latest mobile Sculpt OS
images published by _nfeske_.
Platforms
#########
NXP i.MX SoC family
===================
Certain parts of i.MX specific code, like the base support for the hw kernel,
and the GPIO driver for i.MX got moved from Genode's main repository to the
corresponding genode-imx repository.
Sculpt OS image creation for MNT Reform2
----------------------------------------
With this release, we introduce mainline support for Sculpt OS on the MNT
Reform2. To build a Sculpt OS image for this board you can use the common
_gems/run/sculpt_image.run_ script, like the following:
! make run/sculpt_image KERNEL=hw BOARD=mnt_reform2 DEPOT=omit
To be effective, you need to extend your RUN_OPT variable accordingly:
! RUN_OPT += --include image/imx8mq_mmc
seL4 microkernel
================
With the update of the seL4 kernel in the
[https://genode.org/documentation/release-notes/23.05#Updated_seL4_microkernel - previous]
release we now added several improvements, which reduce the boot-up time of
Genode's 'core' roottask on seL4 by converting untyped memory to I/O memory on
demand.
Build system and tools
######################
Depot autopilot on-target test orchestrator
===========================================
As the rough plan to support automated testing in Goa is shaping up, it makes
sense to share one convention about expressing the success criteria for a
package under test between the depot autopilot and Goa. This prospect motivated
us to review the convention that was used with the depot autopilot up until
now. The old syntax looked as follows:
! <runtime ...>
! <events>
! <timeout meaning="failed" sec="20"/>
! <log meaning="succeeded">
! [init -> rom_logger] ROM 'generated':*
! [init -> dynamic_rom] xray: change (finished)
! </log>
! <log meaning="succeeded">child exited</log>
! <log meaning="failed">Error: </log>
! </events>
! ...
! </runtime>
We applied the following simplifications to this syntax:
* Dropped the intermediate '<events>' tag,
* Replaced '<log meaning="succeeded">' by '<succeed>',
* Replaced '<log meaning="failed">' by '<fail>',
* Replaced '<timeout meaning="failed" sec="20"/>' by an 'after_seconds'
attribute of the '<succeed>' or '<fail>' tags.
So, the above example becomes the following:
! <runtime ...>
! <fail after_seconds="20"/>
! <succeed>
! [init -> rom_logger] ROM 'generated':*
! [init -> dynamic_rom] xray: change (finished)
! </succeed>
! <succeed>child exited</succeed>
! <fail>Error: </fail>
! ...
! </runtime>
For now, the depot autopilot maintains backwards-compatibility to allow Genode
users to adapt to the change progressively. The old scheme is used whenever
the package runtime contains an '<event>' tag. Note that backwards
compatibility will be removed after a short transition period.
All test packages of the official Genode repositories have been updated
to the new convention.
Furthermore, we took the opportunity to also add a new feature. The optional
'log_prefix' attribute in the '<succeed>' and '<fail>' tags is a simple but
handy white-list filter when it comes to typical Genode logs. When matching
the test log against the pattern given in the affected '<succeed>' or '<fail>'
tag, the depot autopilot considers only those log lines that start with the
given prefix. This is an easy way to watch only specific Genode components and
solve problems with the log order of simultaneously running components.
Last but not least, the transition prompted us to fix a minor issue with the
depot autopilot log-processing. Color sequences will now be forwarded correctly
from the test runtime to the log output of the depot autopilot, making the
analysis of test batteries a more pleasant experience.
Updated run-tool defaults for x86_64
====================================
With the update of the seL4 kernel and the update of the toolchain to GNU GCC
12 in the previous release, certain x86 assembly instructions like POPCNT are
generated, which are not supported by the Qemu CPU models we used.
Previously, the used CPU model was either the default model, or
'-cpu core2duo' for NOVA, or '-cpu phenom' for SVM virtualization.
The current release changes the default model to '-cpu Nehalem-v2', and
selects '-cpu EPYC' for SVM virtualization.
Note that the _build.conf_ file in the x86 build directory must be
re-generated by you, which otherwise may contain an older Qemu "-cpu " model,
which can collide with the new default Qemu CPU settings.

799
doc/release_notes/23-11.txt Normal file
View File

@@ -0,0 +1,799 @@
===============================================
Release notes for the Genode OS Framework 23.11
===============================================
Genode Labs
Genode 23.11 brings a healthy mix of OS architectural work, curation of the
existing framework, and new features. In an arguably radical move - but in
perfect alignment with microkernel philosophy - we move the IOMMU driver from
the kernel to user space. This way, Genode attains DMA protection independent
of the used kernel. Section [Kernel-agnostic DMA protection] covers the
background and implementation of this novel approach.
We constantly re-evaluate our existing code base for opportunities of curation
and simplification and the current release is no exception. It bears the fruit
of an intense one-year cross-examination of Genode's existing virtualization
interfaces across CPU architectures and kernels, as a collateral effort of
bringing x86 virtualization to our custom base-hw microkernel. Section
[Modernized virtualization interface] presents the story and outcome of this
deep dive.
As another curation effort, the release brings Genode's arsenal of USB device
drivers in line with our modern DDE Linux porting approach.
Section [USB device drivers updated to Linux 6.1.20] details this line of work.
Feature-wise, the release contains the underpinnings of the CPU
frequency/temperature/power monitoring and control feature of the latest
Sculpt OS release
(Section [PC power, frequency, temperature sensing and control]),
showcases the port of the Linphone VoIP stack using the Goa tool
(Section [Ported 3rd-party software]), and equips the Seoul virtual machine
monitor with the ability to host 64-bit guests
(Section [Seoul virtual machine monitor]).
Kernel-agnostic DMA protection
##############################
On our quest towards a PC version of Sculpt OS on our custom (base-hw)
microkernel, we were able to move an essential chunk away to clear another
section of the path. Based on the preparatory changes to the platform driver
regarding IOMMU handling introduced in
[https://genode.org/documentation/release-notes/23.05#Towards_kernel-agnostic_DMA_protection - release 23.05],
we were able to enable kernel-agnostic DMA protection on Intel platforms.
Similar to how the MMU protects the system against unintended CPU-initiated
memory transactions, the IOMMU protects the system against unintended DMA
transactions. Since components allocate DMA buffers via the platform driver,
the latter sits in the perfect spot to manage DMA remapping tables for its
clients and let the IOMMU know about them.
[image dma_remap]
The figure above illustrates how we added remapping to the PC version of
Sculpt OS. IOMMUs are announced in the ACPI DMAR table, which is parsed by our
ACPI driver component.
It particularly evaluates the _DMA Remapping Hardware Unit Defintions_ (DRHDs)
and _Reserved Memory Region Reporting_ (RMRRs) structures and reports the
essential details in form of an _acpi_ report. There are typically multiple
DRHDs with different device scopes. The RMRRs specify memory regions that may
be DMA targets for certain devices.
The _acpi_ report is used by our PCI decode component, which creates a
_devices_ report. It adds the DRHDs as devices to this report and annotates
the found PCI devices with corresponding '<io_mmu name="drhdX"/>' nodes
according to the DRHDs' device scopes. Moreover, it adds
'<reserved_memory .../>' nodes to the particular devices as specified by the
RMRRs.
By evaluating the _devices_ report, the platform driver has a complete picture
of the DMA remapping hardware units and knows about which PCI devices fall
into their scopes. It takes control over the mentioned _drhdX_ devices on its
own and sets up the necessary structures that are shared between all sessions
and devices. For every Platform session and _drhdX_ device used, it creates an
'Io_mmu::Domain' object that comprises a DMA remapping table. As shown in the
figure, Client A, which acquires devices in the scope of drhd0 and drhd1, the
platform driver sets up two DMA remapping tables. The tables are populated with
the DMA buffers allocated via Client A's platform session. For every acquired
device, the platform driver maps the corresponding remapping table. Note that
DMA buffers are allocated on a per-session basis so that all devices in the
same session will get access to all DMA buffers. To further restrict this,
Client A could open separate platform sessions for distinct DMA-capable
devices.
A subtle implementation detail (not shown in the figure) concerns the
aforementioned reserved memory. The reserved memory regions of a device must
be added to the corresponding DMA remapping table. Moreover, these regions
must be accessible at all times, i.e. even before the device is acquired by
any client. For this purpose, the platform driver creates a default remapping
table. This table is filled with the reserved memory regions and mapped for
every unused device that requires access to any reserved memory region.
A particular benefit of moving DMA remapping into the platform driver (apart
from becoming kernel-agnostic) is that DMA remapping tables are now properly
allocated from the session's quota. In consequence, this may increase the RAM
and capability requirements for certain drivers.
The platform driver's support for Intel IOMMUs is enabled by default on the
NOVA and base-hw kernels. The seL4 and Fiasco.OC kernels are not yet covered.
Nevertheless, we also kept NOVA's IOMMU enablement intact for the following
reasons:
* To protect the boot-up process from DMA attacks, the IOMMU should be enabled
as early as possible. The platform driver simply takes over control when it
is ready.
* The platform driver is not (yet) able to manage interrupt remapping because
this requires access to the _I/O Advanced Programmable Interrupt Controller_
(IOAPIC) controlled by the kernel. Thus, in this release, we still let NOVA
manage the interrupt remapping table.
* As we have not implemented support for AMD IOMMUs yet, we simply keep NOVA
in charge of this. If there is no Intel IOMMU present, the platform driver
falls back to the device PD for controlling the kernel-managed IOMMU.
Along with the DMA remapping support, we added an _iommu_ report to the
platform driver. On the PC version of Sculpt OS, this is enabled by default
and routed to _/report/drivers/iommu_. The report summarizes the state of each
DRHD. When the platform driver takes control, it also logs a message like
"enabled IOMMU drhd0 with default mappings". The platform driver can be
prevented from touching the IOMMU by removing the DRHD info from the _acpi_
report. This can be achieved by supplying the ACPI driver with the following
config:
! <config ignore_drhd="yes"/>
_Note that the ACPI driver does not handle configuration updates._
Orthogonal to the DMA remapping support, we changed the allocation policy for
DMA buffers in the generic part of the platform driver. The new policy leaves
an unmapped page (guard page) between DMA buffers in the virtual I/O memory
space. This ensures that a simple DMA buffer overflow does not corrupt other
DMA buffers. Since this is only a matter of virtual address allocation, it
does not add any additional RAM costs.
Base framework and OS-level infrastructure
##########################################
PC power, frequency, temperature sensing and control
====================================================
PC CPU vendors provide various CPU features for the operating system to
influence frequency and power consumption, like Intel HWP or AMD pstate to
name just two of them. Some of the features require access to various MSR CPU
registers, which can solely be accessed by privileged rdmsr and wrmsr
instructions.
Up to now, this feature was provided in a static manner, namely before Genode
boots. It was possible to set a fixed desired target power consumption via the
pre-boot chain loader bender. This feature got introduced with
[https://genode.org/documentation/release-notes/20.11#Hardware_P-State_support_on_PC_hardware - Genode version 20.11]
and was refined in
[https://genode.org/documentation/release-notes/22.11#Configurable_Intel_HWP_mode - version 22.11].
Another and desired approach is to permit the adjustment of the desired power
consumption depending on the current load of the system. This dynamic way of
power and frequency management has been in casual development since 2021 and
first got presented in one [https://genodians.org/alex-ab/2023-05-29-freq_power - sneak peak]
Genodian article. The feature now found its way into the
[https://genodians.org/alex-ab/2023-10-23-msr - Sculpt 23.10] release.
With the current Genode release, we have added general support to the
framework that permits guarded access to selected MSRs via Genode's
system-control RPC of the protection domain (PD) session. If the underlying
kernel supports this feature, presently the NOVA kernel, read and write
requests are forwarded via Genode's 'core' roottask to the kernel. A component
needs the explicit [https://genode.org/documentation/release-notes/22.02#Restricting_physical_memory_information_to_device_drivers_only - managing_system] configuration role to get
access to this functionality, which is denied by default.
The actual knowledge about how to manage Intel HWP and AMD pstate is provided
as a native Genode component, which uses the new 'Pd::system_control'
interface. The component monitors and reports changes of MSR registers for
temperature (Intel), frequency (AMD & Intel), and power consumption (Intel
RAPL). Additionally, it can be instructed - by the means of configuration
changes - to write some of the registers. Besides the low-level MSR component,
a Genode package with a GUI component is provided to make the interactive
usage of the feature more user-friendly. For Sculpt, we added an interactive
dialog to assign the system-control role to a component like the graphical MSR
package via the resource dialog. For a more detailed description please refer
to our [https://genodians.org/alex-ab/2023-10-23-msr - Genodians article]
for the Sculpt 23.10 release.
Modernized virtualization interface
===================================
When we introduced the
[https://genode.org/documentation/release-notes/19.05#Kernel-agnostic_virtual-machine_monitors - generic Virtual Machine Monitor (VMM) interface]
for x86 virtualization with Genode
[https://genode.org/documentation/release-notes/19.05#Kernel-agnostic_virtual-machine_monitors - version 19.05],
it was largely modeled after our Genode VMM API for ARM with the following
characteristics.
* A vCPU's state could be requested, evaluated, and modified with the
'state()' method.
* The vCPU was started by the 'run()' method.
* For synchronization, the vCPU could be stopped with the 'pause()' method.
However, this ostensibly uniform interface for ARM and x86 virtualization
obscures two significant differences between the architectures.
:Hardware and generic vCPU state:
On ARM, the VMM directly handles the hardware virtualization state, i.e., the
vCPU state is directly passed to the VMM. In contrast, what is passed to the
VMM on x86 is a generic _Vcpu_state_. This is due to two aspects of x86
virtualization: First, there are two competing implementations of
virtualization on x86: AMD's _Secure Virtual Machine (SVM)_ / _AMD-V_ and
Intel's _Virtual Machine Extensions (VMX)_. Second, neither interface lends
itself to passing the vCPU state directly to the VMM: VMX requires privileged
instructions to access fields in the _Virtual Machine Control Structure
(VMCS)_. Whereas SVM supports direct access to fields in its _Virtual Machine
Control Block (VMCB)_, the VMCB (as well as the VMCS) does not represent the
whole state of the vCPU. Notably, both the VMCS and the VMCB do not include
the CPU's general purpose registers, thereby warranting a separate data
structure to synchronize the vCPU state with a VMM.
:vCPU pause and state synchronization:
On ARM, the 'pause()' method simply stopped the vCPU kernel thread from being
scheduled. Since the VMM's vCPU handler runs on the same CPU core we could be
certain that the vCPU was not running while the VMM's vCPU handler was
executing, and calling 'pause()' made sure the vCPU wasn't rescheduled while
the VMM was modifying its state. In contrast, calling 'pause()' on x86 has
different semantics. It requests a synchronization point from the hypervisor,
which responds by issuing a generic _PAUSE_ or _RECALL_ exit in order to
signal the VMM that state can be injected into the vCPU. The mechanism is
woven deeply into the device models of our x86 VMMs, and therefore
asynchronous state synchronization from the VMM needed to be available in the
VMM.
API shortcomings and improvements
---------------------------------
On ARM, making the hardware vCPU state unconditionally available to the VMM via
the 'state()' method meant that the API did not enforce any synchronization
between hypervisor / hardware and VMM accesses to the vCPU state. On x86, the
asynchronous semantics of the 'pause()' method required complex state tracking
on the hypervisor side of the interface.
To address both shortcomings, we replaced the previous API with a single
'with_state()' method that takes a lambda function as an argument. The method
allows scoped access to the vCPU's state and ensures that the vCPU is stopped
before calling the supplied lambda function with the vCPU as parameter. Only
if the lambda function returns 'true', the vCPU is resumed with its state
updated by the VMM. Otherwise, the vCPU remains stopped.
As a result, the API enforces that the vCPU state is only accessed while the
vCPU is not running. Moreover, we were able to replace the ambiguous 'pause()'
method by a generic mechanism that unblocks the vCPU handler, which in turn
uses the 'with_state()' method to update the vCPU state. Finally, resuming of
the vCPU is controlled by the return value of the lambda function exclusively
and, thus, removes the error-prone explicit 'run()' method.
Porting hypervisors and VMMs
----------------------------
The new API was first implemented for *base-hw*'s using AMD's SVM
virtualization method and recently
[https://genode.org/documentation/release-notes/23.05#Base-HW_microkernel - introduced]
as part of the 23.05 release. The reduction of complexity was significant:
explicitly requesting the vCPU state via 'with_state()' did away with a vast
amount of vCPU-state tracking in the kernel. Instead, the VMM library
explicitly requests updates to the vCPU state.
With the first hypervisor ported, we were curious to see how easily our new
interface could be applied to the *NOVA* hypervisor. The initial pleasant
reduction of complex state handling in base-nova's VMM library was closely
followed by the insight that there was no way to match the NOVA-specific
execution model to our new library interface. The asynchronous nature of the
'with_state()' interface meant that we needed a way to synchronize the vCPU
state with the VMM that could be initiated from the VMM. Since NOVA's
execution model is based on the hypervisor calling into the VMM on VM exits,
we had to extend NOVA's system call interface to allow for an explicit setting
and getting of the vCPU state. This was needed because the 'with_state()'
interface requires that the vCPU state is made available to the caller within
the method call, so the old model of requesting a _RECALL_ exit that would be
processed asynchronously couldn't be used here. For the same reason, the vCPU
exit reason had to be passed with the rest of the vCPU state in the UTCB since
in this case this information wasn't provided through the VMM portal called
from the hypervisor. The new 'ec_ctrl' system call variants proved to be a
simple addition and allowed us to adapt to the new interface while still using
NOVA's execution model for processing regular exits.
The _blocking system call into the hypervisor_ execution model of *Fiasco.OC*
and *seL4* offered its own unique set of challenges to the new library
interface in the interplay between asynchronous 'with_state()' triggers and
the synchronous vCPU run loop. Fortunately, we were able to meet these
challenges without changing the kernels.
While adapting our VMMs for ARM and x86, we found varying degrees of
dependency on permanently accessible vCPU state, which we resolved by
refactoring the implementations. As a result, the new interface is already
used since the release of
[https://genode.org/documentation/articles/sculpt-23-10 - Sculpt OS 23.10].
We haven't experienced any runtime vCPU state access violations and can now be
certain that there aren't any silent concurrent accesses to the vCPU state.
All in all, the new VMM library interface has succeeded in reducing complexity
while providing a more robust access to the vCPU state, which is shared
between our various hypervisors and VMMs.
Dialog API for low-complexity interactive applications
======================================================
Since version
[https://genode.org/documentation/release-notes/14.11#New_menu_view_application - 14.11],
Genode features a custom UI widget renderer in the form of a stand-alone
component called _menu view_. It was designated for use cases where the
complexity of commodity GUI tool kits like Qt is unwanted. Menu-view-based
applications merely consume hover reports and produce dialog descriptions as
XML. In contrast to GUI toolkit libraries, the widget rendering happens
outside the address space of the application.
Today, this custom widget renderer is used by a number of simple interactive
Genode applications, the most prominent being the administrative user
interface of Sculpt OS. Other examples are the touch keyboard, file vault,
text area, and interactive
[https://genodians.org/alex-ab/2023-10-23-msr - system monitoring tools].
In each application, the XML processing used to be implemented via a rather
ad-hoc-designed set of utilities. These utilities and patterns started to get
in the way when applications become more complex - as we experienced while
crafting the
[https://genodians.org/nfeske/2023-01-05-mobile-user-interface - mobile variant]
of Sculpt OS. These observations prompted us to formalize the implementation
of menu-view based applications through a new light-weight framework called
dialog API. The key ideas are as follows.
First, applications are to be relieved from the technicalities of driving a
sandboxed menu-view component, or the distinction of touch from pointer-based
input, or the hovering of GUI elements. These concerns are to be covered by
a runtime library. The application developer can thereby focus solely on the
application logic, the UI representation (view) of its internal state (model),
and the response to user interaction (controller).
Second, the dialog API promotes an immediate translation of the application's
internal state to its UI representation without the need to create an object
for each GUI element. The application merely provides a 'view' (const) method
that is tasked to generate a view of the application's state. This approach
yields itself to the realization of dynamic user interfaces needing dynamic
memory allocation inside the application.
The 'view' method operates on a so-called 'Scope', which loosely corresponds
to Genode's 'Xml_generator', but it expresses the generated structure using
C++ types, not strings. A scope can host sub scopes similar to how an XML node
can host child nodes. Hence, the _view_ method expresses the application's
view as a composition of scopes such as frames, labels, vbox, or hbox.
Third, user interaction is induced into the application by three callbacks
'click', 'clack', and 'drag', each taking a location as argument. The location
is not merely a position but entails the structural location of the user
interaction within the dialog. For interpreting of the location, the
application uses the same C++ types as for generating the view. Hence, the C++
type system is leveraged to attain the consistency between the view and the
controller, so to speak.
Fourth, structural UI patterns - made out of nested scopes - can be combined
into reusable building blocks called widgets. In contrast to scopes, widgets
can have state. Widgets can host other widgets, and thereby allow for the
implementation of higher-level GUI parts out of lower-level elements.
The API resides at _gems/include/dialog/_ and is accompanied by the dialog
library that implements the runtime needed for the interplay with the
menu-view widget renderer. Note that it is specifically designed for the needs
of Sculpt's UI and similar bare-bones utilities. It is not intended to become
a desktop-grade general-purpose widget set. For example, complex topics like
multi-language support are decidedly out of scope. During the release cycle,
the administrative user interface of Sculpt OS - for both the desktop and
mobile variants - has been converted to the new API. Also, the text-area
application and the touch keyboard are using the new API now.
Given that the new API has been confronted with the variety of use cases found
in Sculpt's administrative user interface, it can now be considered for other
basic applications. Since we target Genode-internal use for now, proper
documentation is still missing. However, for the curious, an illustrative
example can be found at _gems/src/test/dialog/_ accompanied by a corresponding
_dialog.run_ script. For a real-world application, you may consider studying
the _app/sculpt_manager/view/_ sub directory of the gems repository.
API changes
===========
Simplified list-model utility
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The so-called 'List_model' utility located at _base/include/list_model.h_ has
become an established pattern used by Genode components that need to maintain
an internal data model for XML input data. It is particularly useful whenever
XML data changes over time, in particular when reconfiguring a component at
runtime.
The original utility as introduced in version
[https://genode.org/documentation/release-notes/18.02#API_changes - 18.02]
relied on a policy-based programming pattern, which is more ceremonial than it
needs to be, especially with recent versions of C++. The current release
replaces the original policy-based 'update_from_xml' by a new method that
takes three functors for creating, destroying, and updating elements as
arguments. XML nodes are associated with their corresponding internal data
models by annotating the element type with the 'type_matches' class function
and the 'matches' method.
Besides the interface change, two minor aspects are worth noting. First, to
improve safety, list model elements can no longer be copied. Second, to foster
consistency with other parts of Genode's API, the 'apply_first' method has
been renamed to 'with_first'.
Pruned IRQ-session arguments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So far, we have used the 'device_config_phys' argument of the IRQ session to
implicitly request the use of _Message-Signalled Interrupts_ (MSI) to core.
This argument specifies the address to the PCI configuration space. However,
with the addition of Intel IOMMU support to the platform driver, we encountered
an instance where we need an MSI for a non-PCI device in order to receive fault
IRQs from the IOMMU. We therefore added an 'irq_type' argument to the IRQ
session, which allows the explicit specification of whether a LEGACY interrupt
or an MSI is requested.
Yet, as we exceeded the character limit by adding another argument, we pruned
the IRQ-session arguments: Since 'device_config_phys' is not relevant for
LEGACY interrupts, we removed this from the default _Irq_connection_
constructor. We further added an alternative constructor for MSI, which sets
'device_config_phys' but omits the 'irq_trigger' and 'irq_polarity' arguments.
Libraries and applications
##########################
Seoul virtual machine monitor
=============================
The Seoul/Vancouver VMM - introduced to Genode with release 11.11 - is an
experimental x86-based VMM which runs on Genode@NOVA, Genode@seL4, and
Genode@Fiasco.OC, and Genode@hw on Intel and on AMD hardware. It has been up
to now solely used with 32-bit and special crafted VMs. With the addition of
[https://genode.org/documentation/release-notes/22.11#Seoul_VMM - VirtIO support]
for GPU, input, and audio, the usage as specialized tailored
[https://genodians.org/alex-ab/2023-05-09-seoul-23-04 - disposable VMs] became
quite comfortable.
However, time is ticking for 32bit on x86 and some features aren't provided in
the same quality as for 64bit VMs. For example, when using Firefox on 32bit,
the video playback on some webpages gets denied while functioning on 64bit
without complaints. So, the time came to extend the Seoul VMM by 64bit guest
support to make it fit for today and avoid further hassles.
Over the year 2023, the Seoul VMM got extended by enabling the instruction
emulator - called Halifax - to decode
[https://wiki.osdev.org/X86-64_Instruction_Encoding - x86_64 instructions]
with additional prefixes and additional 8 general purpose registers. Besides
the necessary deep dive through this special topic, the Seoul VMM required
extensions to handle more than 4G guest physical memory. Several changes to
the guest-memory layout handling and the memory-layout reporting, e.g.,
[https://wiki.osdev.org/Detecting_Memory_(x86) - VBios e820], were necessary.
Once an early prototype successfully booted a 64bit Linux kernel, we found the
initial user task of some Linux distributions to fail by complaining about
unsupported CPUs. As it turned out, glibc-based software (and later also
llvm-based) have several detection mechanism to identify the running CPU - and
if they feel uncomfortable, deny to work. So, we had to extend the support to
report more of the native CPUID values of the host and as an after-effect,
have to emulate more MSR accesses as performed by 64bit Linux guests.
Unfortunately, the MSRs between Intel and AMD differ in subtle ways, so a per
CPU differentiation became necessary in the vCPU model.
Additionally, during testing of the native 64bit Debian VM installation with
the Seoul VMM, several improvements during early boot, especially for the
interactive usage of the GRUB bootloader were made. Ready to use packages to
test drive the 64bit Seoul VMM on Sculpt OS are available via the "alex-ab"
depot.
[image seoul_64bit]
Two instances of the Seoul VMM executing 64-bit Linux
Ported 3rd-party software
=========================
Linphone SIP client
-------------------
Sculpt on the PinePhone used to provide only support for making and receiving
regular phone calls but did not yet provide any VoIP functionality. Now, the
"Linphone Console Client" and the "SIP Client for Ubuntu Touch" got ported to
Genode to expand the available features on the PinePhone when it comes to
mobile communication.
We decided to port the [https://linphone.org - Linphone-SDK], the console
client in particular, to Genode because it seems to be a time-tested solution
on a range of OSes. Furthermore, it uses the [https://cmake.org - cmake]
build-system, which makes it the ideal candidate for stressing
[https://github.com/genodelabs/goa - Goa] with a reasonably complex project.
Using Goa itself turned out to be straight-forward and by re-using the already
existing back ends for POSIX-like systems, e.g. OSS for handling audio via the
mediastreamer library, we only had to tweak the build-system in very few
places. In the process, we encountered a few short-comings regarding the
handling of shared libraries in cmake-based Goa projects. We were happy to
address these and the fixes are part of the current Goa release.
Since the user interface of the console client cannot be used comfortably on
the PinePhone, it had to be complemented by a GUI application that handles the
user interaction. While looking for such an application we noticed the
[https://gitlab.com/ubports-linphone/linphone-simple/ - SIP Client for Ubuntu Touch]
that utilizes the Ubuntu Touch UI Toolkit - where a port to Genode already
exists. We adapted that project for our needs and - with the major components
now in place - created a preset for Sculpt on the PinePhone.
The preset's structure is depicted by the following chart.
[image linphone_preset]
Structure of the linphone preset
Each of the two components has its own requirements: The Linphone client needs
access to the network, has to store its configuration, and requires access to
the audio subsystem. It is the driving force behind the operation while it
receives its instructions from the GUI. The GUI needs access to the GPU
driver, as required for fluent rendering of QML on the PinePhone, as well as
access to input events for user interaction.
Naturally these requirements are satisfied by other components also
incorporated into the preset:
* The _Dynamic chroot_ component selects and limits the file-system access of
the client to the configured directory. In case of the PinePhone it points
to the '/recall/linphone' directory on the SD-card.
* The _SNTP_ component provides the client with a correct real-time clock
value. Note that the SNTP component uses a different TCP/IP-stack than the
client itself.
* The _Audio driver_ component makes the speaker as well as the microphone
available to the client.
* The _GPU driver_ component allows the GUI to render the interface via OpenGL
on the GPU.
* The _Touch keyboard_ collects the touch events and translates them into key
events that are then consumed by the GUI.
The Linphone client and the GUI themselves are connected via the _terminal
crosslink_ component where the control channel is formed by connecting stdout
from the GUI to stdin from the client and vice versa.
As denoted by the chart, the client actually functions as a _daemon_ that is
running in the background, whereas the GUI is the _app_ the user interacts
with.
For more information and a usage guide, please refer to the corresponding
[https://genodians.org/jws/2023-11-16-sip-client-for-genode - Genodians article].
Socat
-----
We ported socat, a multipurpose relay (SOcket CAT), to Genode and created a
ready-to-use pkg archive that allows for making a terminal session available
on port '5555'.
SDL libraries
-------------
This release also makes more SDL-related libraries available on Genode.
The common helper libraries like SDL2-image, SDL2-mixer, SDL2-net, and SDL2-ttf
complement the SDL2 support, while the SDL-gfx library enhances the support
of SDL1.2. All these libraries are located in the _genode-world_ repository.
Device drivers
##############
USB device drivers updated to Linux 6.1.20
==========================================
With our ongoing effort to replace our traditional device-driver porting
approach by our new
[https://genode.org/documentation/release-notes/21.08#Linux-device-driver_environment_re-imagined - device-driver environment],
USB-device drivers were subject to this porting effort during this release
cycle. This includes the HID driver for keyboard, mouse, and touch support,
the network driver, which supports USB NICs like AX88179 or the PinePhone's
CDC Ether profile of its LTE Modem, as well as the USB modem driver that
offers basic LTE-modem access for modems relying on the
[https://www.usb.org/document-library/mobile-broadband-interface-model-v10-errata-1-and-adopters-agreement - MBIM]
configuration.
Architecture
------------
In contrast to the USB host-controller drivers, USB device drivers do not
communicate with the hardware directly, but only send messages to the USB host
controller through Genode's USB-session interface. So, from Genode's point of
view, they can be classified as protocol stacks. Therefore, we based these
drivers not on the DDE Linux version that offers direct hardware access, but
on 'virt_linux' as described in release
[https://genode.org/documentation/release-notes/23.05#WireGuard_improvements - 23.05].
We replaced the actual Linux calls that create USB messages (like control,
bulk, or IRQ transfers) by custom implementations that forward these messages
through a USB client session to the host controller. The client-session
implementation is written in C++. Since our DDE Linux strictly separates C++
from C-code, we introduced a USB-client C-API that can be called directly by
the replacement functions.
The same goes for the services the USB drivers offer/use. These services
are accessed through the respective C-APIs. For example, the HID driver
communicates with Genode's event session through the event C-API and the NIC
driver through the uplink C-API.
USB HID driver
--------------
The HID driver is a drop-in replacement of its predecessor. It still offers
support to handle multiple devices at once, and the configuration remains
unchanged.
Note that we have dropped support for multi-touch devices, like Wacom, because
touch was merely in a proof of concept state that should be redesigned and
rethought for Genode if needed.
USB modem
---------
The LTE-modem driver (usb_modem_drv) has been integrated into the network
driver (see below).
USB net
-------
The 'usb_net_drv' is a drop-in replacement for its predecessor with the
exception that an additional configuration attribute is available:
!<config mac="2e:60:90:0c:4e:01 configuration="2" />
Next to the MAC address (like in the previous version), the USB configuration
profile can be specified with the 'configuration' attribute. For USB devices
that provide multiple configuration profiles, the Linux code will always
select the first non-vendor-specific configuration profile found. This may not
be the desired behavior, and therefore, can now be specified.
The available configuration profile of a device can be found out under Linux
using:
! lsusb -s<bus>:<device> -vvv
Currently the driver supports NICs containing an AX88179A chip and that offer
the NCM or the ECM profile. Support for the SMSC95XX line of devices has been
dropped, but may be re-enabled if required.
As mentioned above, the LTE modem support for MBIM-based modems has been
merged into this driver because an LTE modem is merely a USB networking device
(for data) plus a control channel. In case the driver discovers an LTE modem,
it will announce a Genode terminal session as a control channel.
Example configuration for the Huawai ME906s modem:
!<start name="usb_net_drv">
! <resource name="RAM" quantum="10M"/>
! <provides>
! <service name="Terminal"/>
! </provides>
! <config mac="02:00:00:00:01:01" configuration="3"/>
! <route>
! <service name="Uplink"><child name="nic_router"/></service/>
! ....
! </route>
!</start>
The MBIM interface is enabled using configuration profile "3" and the service
"Terminal" is provided.
We have tested the driver mainly on Lenovo Thinkpad notebooks using Huawai's
ME906e and Fibocoms's L830-EB-00 modems, but different modems might work as
well.
Current limitations
-------------------
The current version of 'virt_linux' does not support arm_v6 platforms like
Raspberry Pi (Zero). We will address this shortcoming with the next release
and update the drivers accordingly.
Platforms
#########
Linux
=====
Following the official
[https://wiki.libsdl.org/SDL2/MigrationGuide - migration guide] of SDL, the
fb_sdl framebuffer driver was updated from SDL1 to SDL2 by Robin Eklind.
Thanks to this valuable contribution, fb_sdl is now ready to run on modern
Linux installations especially in environments that use the Wayland display
server. Note, to compile the component from source, the installation of
libsdl2 development packages (e.g., libsdl2-dev, libdrm-dev, and libgbm-dev on
Ubuntu/Debian) is required.
Build system and tools
######################
Debug information for depot binaries
====================================
So far, the Genode build system created symbolic links to unstripped binaries
in the _debug/_ directory to provide useful debug information, but binaries
from depot archives did not have this information available.
With this release, the 'create', 'publish' and 'download' depot tools received
an optional 'DBG=1' argument to create, publish, and download 'dbg' depot
archives with debug-info files in addition to the corresponding 'bin' depot
archives.
To avoid the storage overhead from duplicated code with archived unstripped
binaries, we now create separate debug info files using the "GNU debug link"
method in the Genode build system and for the 'dbg' depot archives.
Decommissioned implicit trigger of shared-library builds
========================================================
Since the very first version, Genode's build system automatically managed
inter-library dependencies, which allowed us to cleanly separate different
concerns (like CPU-architecture-specific optimizations) as small static
libraries, which were automatically visited by the build system whenever
building a dependent target.
When we later
[https://genode.org/documentation/release-notes/9.11#Completed_support_for_dynamic_linking - introduced]
the support for shared libraries, we maintained the existing notion of
libraries but merely considered shared objects as a special case. Hence,
whenever a target depends on a shared library, the build system would
automatically build the shared library before linking it to the target.
With the later introduction of Genode's ABI's in version
[https://genode.org/documentation/release-notes/17.02#Genode_Application_Binary_Interface - 17.02],
we effectively dissolved the link-time dependency of targets from shared
objects, which ultimately paved the ground for Genode's package management.
However, our build-system retained the original policy of building shared
libraries before linking dependent targets. Even though this is arguably
convenient when using many small inter-dependent libraries, with complex
shared libraries as dependencies, one always needs to locally build those
complex libraries even though the library internals are rarely touched or the
library is readily available as a pre-built binary archive. In the presence of
large 3rd-party libraries, the build system's traditional policy starts to
stand in the way of quick development-test cycles.
With the current release, we dissolve the implicit built-time dependency of
targets from shared libraries. Shared libraries must now be explicitly listed
in the 'build' command of run scripts. For example, for run scripts that build
Genode's base system along with the C runtime, the build command usually
contains the following targets.
! core lib/ld init timer lib/libc lib/libm lib/vfs lib/posix
However, in practice most run scripts incorporate those basic ingredients as
depot archives. So those targets need to be built only if they are touched by
the development work. To incorporate the results of all explicitly built
targets into a system image, the 'build_boot_image' command can be used as
follows. Note that the listing of boot modules does not need to be maintained
manually anymore.
! build_boot_image [build_artifacts]
During the release cycle of version 23.11, we have revisited all run scripts
in this respect, and we encourage Genode users to follow suit. The run tool
tries to give aid to implement this change whenever it detects the presence of
a .lib.so 'build_boot_image' argument that is not covered by the prior build
command. For example, on the attempt to integrate 'ld.lib.so' without having
built 'lib/ld', the following diagnostic message will try to guide you.
! Error: missing build argument for: ld.lib.so
!
! The build_boot_image argument may be superfluous or
! the build step lacks the argument: lib/ld
!
! Consider using [build_artifacts] as build_boot_image argument to
! maintain consistency between the build and build_boot_image steps.
The inconvenience of the need to adopt existing run scripts notwithstanding,
developers will certainly notice a welcome boost of their work flow,
especially when working with complex 3rd-party libraries.

677
doc/release_notes/24-02.txt Normal file
View File

@@ -0,0 +1,677 @@
===============================================
Release notes for the Genode OS Framework 24.02
===============================================
Genode Labs
Version 24.02 focuses on developer experience and framework infrastructure.
Genode's Goa SDK has reached prominence in the past few releases. It largely
streamlines the porting, development, and publishing of software targeting
Genode and Sculpt OS in particular.
With the current release, Goa has become able to conveniently use Sculpt OS as
a remote test target. Regardless of whether targeting a PC or the PinePhone,
either can be turned into a test target in seconds and the developer's
compile-test cycle looks exactly the same
(Section [Sculpt OS as remote test target for the Goa SDK]).
A long anticipated infrastructure topic is the rework of Genode's audio stack
to accommodate latency-sensitive scenarios, using flexible sample rates, and
making audio drivers pluggable.
Section [Revised audio infrastructure] gives an overview of the taken
architectural approach, the interfaces, and a low-complexity mixer modelled
as self-sufficient resource multiplexer.
Speaking of infrastructure, we are excited to report to have wrapped up the
transition to our modern Linux device-driver environment based on Linux 6.x.
The last piece of the puzzle was the TCP/IP stack that was still based
on code originating from Linux 4.4.3.
Section [TCP/IP stack based on DDE-Linux version 6.1.20] details the new
TCP/IP stack.
According to our [https://genode.org/about/road-map - road map], we plan to
add suspend/resume as feature to Sculpt OS 24.04. As a crucial stepping stone
towards this goal, all drivers that cannot be easily restarted must become
suspend/resume aware.
Section [Suspend/resume awareness of GPU, AHCI, and NVMe drivers] explains
this achievement for the AHCI, NVMe, and Intel GPU drivers.
Further highlights of the release are the much improved handling of HID
events including the generalized calibration of motion events, API safety
improvements, the prospect of de-privileged tracing in Sculpt OS, and
multi-client support for Vivante GPUs.
On our road map, we had scheduled two further topics that are notably absent,
namely USB and SMS. But don't fret. Even though the large rework of our USB
infrastructure for fine-grained and dynamic USB access has been completed just
in time, we felt that this far-reaching change should better not be rushed
into the release. It will be merged shortly after, and settle into the upcoming
Sculpt OS version 24.04 just fine. The second topic not covered is SMS support
for the PinePhone, which is a topic actively
[https://github.com/genodelabs/genode/issues/5127 - worked on] but with no
user-visible effect until its integration in Sculpt OS in April.
Revised audio infrastructure
############################
After first introduced in version
[https://genode.org/documentation/release-notes/10.05#Device-class_interfaces_for_NIC_and_Audio-out - 10.05],
Genode's
[https://genode.org/documentation/genode-foundations/23.05/components/Common_session_interfaces.html#Audio_output - audio support]
slowly evolved over the years, covering audio mixing in
version
[https://genode.org/documentation/release-notes/10.11#Audio_mixer - 10.11],
leveraging OpenBSD's audio driver since version
[https://genode.org/documentation/release-notes/15.05#Audio_drivers_ported_from_OpenBSD - 15.05]
and offering the OSS interface as VFS plugin since version
[https://genode.org/documentation/release-notes/20.11#Streamlined_ioctl_handling_in_the_C_runtime___VFS - 20.11].
With our recent focus on use cases like
[https://genodians.org/jws/2023-11-16-sip-client-for-genode - VoIP on the PinePhone] or
[https://genode.org/documentation/release-notes/21.05#Webcam_support - video conferencing],
however, we identified limitations that cannot be overcome without an
architectural revision.
First, in the name of simplicity, we used to tie the inter-component audio
interfaces to a fixed sample rate of 44100 Hz. This has recently become a
problem because some audio drivers tend to support only 48000 Hz.
Second, in latency-sensitive scenarios, we observed that the existing
interfaces were prone to effects caused by the drifting of time between the
producer and consumer of audio data. One effect are buffer under-runs, which
produce audible noise. The other is the slow accumulation of buffered sample
data, which increases latency over time (affecting the effectiveness of
acoustic echo cancellation) and yields an audible buffer overrun after a
while.
Third, the mixer is a single client of the audio driver, which makes the mixer
dependent on the liveliness of the driver. Therefore, the driver cannot be
restarted without also restarting the mixer and - transitively - each client
of the mixer. The rigid relation between the audio driver and the mixer also
stands in the way of routing audio between different audio devices operated
by separate drivers.
After having successfully introduced the concept of _pluggable drivers_ for graphics in version
[https://genode.org/documentation/release-notes/20.08#The_GUI_stack__restacked - 20.08]
and applying the same idea to networking in version
[https://genode.org/documentation/release-notes/21.02#Pluggable_network_device_drivers - 21.02],
the time was ripe for turning the audio infrastructure upside down.
[image audio_vs_recordplay]
original layered architecture (left) compared to the new pluggable
architecture (right)
The new architecture as shown on the right turns the mixer into a
self-sufficient resource multiplexer, which offers a service for playing audio
and a service for recording audio. Both audio drivers as well as audio
applications are becoming mere clients of the mixer. With this architecture,
the dynamic starting, removal, and restarting of the driver, of even multiple
drivers, is trivially solved.
To bridge the gap between audio clients operating at different sample rates,
the mixer automatically detects and converts sample rates as needed. Both play
and record clients are expected to operate periodically. The number of samples
produced per period is up to each client and does not need to be constant over
time. The mixer infers the used sample rates and periods by observing the
behavior of the clients. It measures the jitter of clients to automatically
adjust buffering parameters to attain continuous playback while trying to
optimize for low latency. Those runtime-measurements can be augmented by
explicit configuration values.
Multi-channel playing and recording are realized by one session per channel
whereas one channel is used to drive the time allocation while all further
channels merely enqueue/obtain data into/from their respective sessions
without any synchronous interplay with the mixer.
The mixer routes and mixes audio signals produced by play clients to record
clients according to its configuration. Typical play clients are an audio
player or a microphone driver whereas typical record clients are an audio
recorder or an audio-output driver. A simple mixer configuration looks as
follows:
! <config>
!
! <mix name="left"> <play label_suffix="left"/> </mix>
! <mix name="right"> <play label_suffix="right"/> </mix>
!
! <policy label_suffix="left" record="left"/>
! <policy label_suffix="right" record="right"/>
!
! </config>
This configuration defines two signals "left" and "right" that are mixed from
the audio input of the matching <play> clients. In the example, each play
session labeled as "left" is mixed into the "left" signal. Each <mix> node can
host an arbitrary number of <play> nodes. The same <play> policy can appear at
multiple <mix> nodes. A <policy> node assigns a signal to a record client. In
the example, a record client labeled "left" is connected to the <mix> signal
"left".
The mixer allows for the cascading of <mix> nodes. For example, the following
signal "lefty" is a mix of the two signals "left" and "right", weighted by
respective volume attributes.
! <mix name="lefty">
! <signal name="left" volume="0.7"/>
! <signal name="right" volume="0.3"/>
! </mix>
[image mixed_waveforms]
Example of the mixer output for a sine wave as the "left" signal (top),
a signal mixed 70:30, a signal mixed 30:70, and a square wave as the
"right" signal (bottom).
The operation and configuration of the mixer is described in more detail by
the accompanied README at _os/src/record_play_mixer/_. The inter-component
interfaces are located at _os/include/play_session/_ and
_os/include/record_session/_.
The _gems/run/waveform_player.run_ script illustrates the integration of the
mixer by using a waveform generator as multi-channel play client and an
oscilloscope as record client.
Current state and next steps
----------------------------
The new infrastructure is ready to be exercised by the synthetic example
mentioned above as well as by the _audio_out.run_ and _audio_in.run_ scripts
located at _repos/dde_bsd/run/_. The OpenBSD-based audio driver can be
operated in either of two modes. By default, it is compatible to the old audio
in/out interfaces. The new record/play mode can be enabled by setting the
'record_play="yes"' config attribute. Over the next release cycle, we will
successively convert the other pieces of the audio stack, in particular the
other drivers and the OSS VFS plugin, to the new record and play interfaces.
Following this transition, the original audio in/out interfaces will be
removed.
Sculpt OS as remote test target for the Goa SDK
###############################################
The run-stage generalization from
[https://genode.org/documentation/release-notes/23.08#Run-stage_generalization - release 23.08],
paved the way for the new run-target "sculpt" that allows using Sculpt OS as
a remote test target for 'goa run'. Since Goa already placed all the required
files for running a scenario into a _var/run_ directory, adding this target
merely involved coming up with a solution for synchronizing the run directory
with Sculpt OS and getting a hold of the log output. The implementation in Goa
is accompanied by a _goa_testbed_ package that starts a remotely-controlled
subsystem on Sculpt OS. It particularly hosts a _lighttpd_ and _tcp_terminal_
component. The former is used for run-directory synchronization based on HTTP
PUT. The latter provides the log output of the test scenario via telnet. For
more details, you may take a look at the corresponding
[https://genodians.org/jschlatow/2024-01-29-goa-sculpt - blog post on genodians.org].
In order to integrate support for this mechanism into Sculpt OS, we
supplemented the NIC router configuration with a _http_ and a _telnet_ domain.
Each of these domains is intended to accommodate a single client. Ports 80 and
23 of the _uplink_ domain are then forwarded to the clients in the _http_ and
_telnet_ domain respectively. This is complemented by the _goa_testbed_ preset
added to the PC and PinePhone version of Sculpt OS that turns the system into
a ready-to-use remote test target. You can see this feature in action in our
[https://genodians.org/nfeske/2024-02-15-fosdem-aftermath - FOSDEM talks].
When implementing the Sculpt target in Goa, we also had to come up with a way
to supply Goa with the IP address of the remote test target. Goa's modularity
w.r.t. custom run stages motivated us to implement a generic mechanism for
target-specific options. For this purpose, we added the config variable
'target_opt' that is defined as a Tcl array. The Sculpt target evaluates the
array elements 'sculpt-server', 'sculpt-port-http' and 'sculpt-port-telnet'.
We further augmented Goa's command-line parsing such that individual elements
of the 'target_opt' as well as the 'version' config variables, which are both
arrays, can be supplied as command-line arguments. The corresponding arguments
follow the pattern '--target-opt-<option>' and '--version-<user>/<type>/<name>'.
Base framework and OS-level infrastructure
##########################################
TCP/IP stack based on DDE-Linux version 6.1.20
==============================================
Over the course of the previous four releases, we have gradually modernized
the arsenal of Linux-based drivers to use our modern Linux device-driver
environment based on Linux 6.x.
The final piece of code standing in the way of the removal of our legacy DDE
Linux approach has been Linux's TCP/IP stack. The stack was based on Linux
version 4.4.3 and did not even take advantage of lx_kit supported features
like cooperative scheduling.
For this reason, it was about time to update the TCP/IP port while also
adapting it to our
[https://genode.org/documentation/release-notes/21.08#Linux-device-driver_environment_re-imagined - modern]
DDE approach. Being in such an ancient state, this effort ended up being more
of a re-write than an actual update. The IP stack is also one of the few DDE
Linux components that is a shared library, as opposed to most drivers, which
are executable binaries. This led to improvements of our lx_kit, for example,
we had to replace static C++ constructors by automatically generated functions
for kernel module-initialization calls because C++ constructors are supposed
to be called by the binary and not during library initialization
(Section [Linux-device-driver environment (DDE)]).
Additionally, we took the opportunity of experimenting with a socket C-API
with the ultimate goal to replace the VFS plugins for Linux (vfs_lxip) and
lwIP (vfs_lwip) with a unified version, but this is an ongoing effort.
Nevertheless, with the current release, the update of our Linux TCP/IP port is
complete and, from a user perspective, the new version as well as the updated
VFS plugin are drop-in replacements for version 4.4.3. The transition should
be seamless.
While porting the IP stack, we also investigated a long-standing issue
regarding the memory consumption of the IP stack, which always seemed a little
too high. We were able to identify the hash tables used for locating sockets
as the main reason. These tables are configured for server loads per default
(meaning > 1 million sockets), which Genode with one or few (VFS server)
clients per IP stack does not default to. This enabled us to reduce the amount
of hash table allocations during IP stack initialization, which leads to
reduced memory demands (>10MB) of the IP stack.
With the new IP stack in place and no legacy components remaining, we removed
the DDE Linux port file (_dde_linux.port_) and the legacy lx_kit/lx_emul
marking the update to the current DDE approach as complete.
De-privileged tracing
=====================
Genode got equipped with a light-weight event tracing facility in
[https://genode.org/documentation/release-notes/13.08#Light-weight_event_tracing - version 13.08].
The underlying core service - appropriately named TRACE - used to be an
outlier among core's services in that it provided a privileged interface with
system-global reach. A trace client is assumed to play a privileged role and
must be ultimately trusted. This is arguably fine for the typical use cases
where event tracing is used in the lab. However, anticipating on-target
debugging on Sculpt OS, the desire for on-target tracing by untrusted trace
monitors casually running on Sculpt OS is anything but far-fetched. To allow
for the secure use of untrusted trace monitors, the global reach of core's
trace service is no longer satisfactory.
The current release changes core's trace service to expose trace subjects
only if their PD label matches up with the label of the trace monitor. Hence,
by default, a trace monitor can only observe itself and its child components.
Only if the trace monitor's parent rewrites the trace-session's label, the
view of the trace monitor can become broader. For example, when rewriting the
trace label to an empty string "", the trace monitor becomes able to observe
the sibling components hosted in the same init instance as the trace monitor.
Note that the trace-subject label as reported as subject info to a trace
monitor is now given relative to the label of the trace session.
To grant a trace session the special privilege of obtaining a global
system view (including the kernel's trace subjects), the top-level init
has to rewrite the session's label to an empty string. At core, this
specific label "init -> " is handled as a special case that discharges
the namespacing of trace subjects.
In Sculpt OS, the user can now select one of three options when connecting a
trace monitor to core's trace service. The "component" option restricts the
tracing to the trace monitor itself, the "deployment" option exposes the
entire runtime subsystem to the trace monitor, whereas the "system" option
exposes the entire Sculpt system to the trace monitor. The latter two options
require adequate trust in the trace monitor.
Deferred unlinking of files in VFS RAM file systems
===================================================
UNIX systems defer the physical deletion of a file until the last file
descriptor referring to the file is closed. Since Genode's VFS does not (try
to) implement this scheme, we encountered a few difficulties while porting
3rd-party software to Genode. In some situations, a parent process of a
Unix-like subsystem may pass the content of an unlinked file to a forked child
process. This can be observed when using the 'exec' command in Tcl scripts.
Another example is the use of the 'tmpfile()' POSIX function.
In the use cases we observed, the mechanism was merely used for _/tmp_ files,
which are usually backed by a '<ram>' file system in Genode's VFS. Hence, to
accommodate these programs, we changed the unlink operation of the ram fs to
defer the destruction of a file until it is no longer referenced by any VFS
handle. When unlinked, the file no longer appears in the directory.
But it can still be opened and accessed.
Improved API safety of MMIO accesses
====================================
The 'Register' respectively 'Mmio' APIs have become predominant in Genode's
native drivers where the type-safe access to hardware registers has become a
second nature. However, up until recently, one point of uncertainty remained:
Since the 'Mmio' utility evaluated only the base address of a memory-mapped
I/O range, all associated register definitions were assumed to be fully
contained within the corresponding local memory mapping. An accidental
violation of this assumption would remain undetected.
The current release replaces this optimistic assumption by a combination of
two mandatory upper-bounds checks. Each 'Mmio' instance is now qualified with
a 'size_t' template parameter denoting the size of the memory-mapped I/O range
in bytes. Each register definition within the 'Mmio' is statically checked
against this upper bound at compile time. At runtime, the local memory mapping
of the I/O range is checked against the statically defined 'Mmio::SIZE'.
A violation is considered a non-recoverable driver bug, prompting an error
message along with a 'Range_violation' exception.
This change modifies the API. Existing driver code must be adapted in two
respects. First, each 'Mmio' definition must be annotated with the expected
size in bytes as template argument. Second, the 'Mmio' constructor requires a
'Byte_range_ptr' argument instead of a plain 'addr_t' value.
Application-level VFS file watching
===================================
The convenience API at _os/vfs.h_ provides utilities for using the VFS as
a stand-alone library without depending on the libc. Among its utilities,
there exists the so-called watch handler that can be used to monitor file
modifications. As watch handlers were primarily used by VFS plugins and
the C runtime, they used to operate in the context of low-level I/O signal
handlers. Code executed in this context should generally not involve any
global side effects that depend on I/O signals themselves (like synchronous
file access).
With the current release, the 'Watch_handler' becomes safe to use at
application level where global side effects are anticipated. The former use
case is now covered by the dedicated 'Io::Watch_handler'.
Device drivers
##############
Linux-device-driver environment (DDE)
=====================================
ARMv6 compatibility
-------------------
In the previous release, we updated our
[https://genode.org/documentation/release-notes/23.11#USB_device_drivers_updated_to_Linux_6.1.20 - USB device drivers]
to Linux 6.1.20 using 'virt_linux'. Drivers or protocol stacks based on
'virt_linux' do not access hardware directly. They either communicate through
another instance - like the USB host controller for USB device drivers - with
the hardware or do not require hardware at all (e.g., TCP/IP, WireGuard).
The 'virt_linux' flavour is still CPU-architecture specific because it
contains low-level assembly code. A limitation of Genode release 23.11 was
that there is no support for ARMv6 in 'virt_linux'. As devices based on ARMv6
can still be found in the wild (e.g., Raspberry Pi Zero), the current release
supplements support for ARMv6 to 'virt_linux', the USB device drivers, and the
TCP/IP stack. For this to work, we had to separate code shared by ARMv6 and
ARMv7 platforms. In many places, there would be a directory like _spec/arm_,
which would contain build rules or code for both architectures. ARMv6 and
ARMv7 have many things in common - until they don't. With the current release,
we have split these folders into _arm_v6_ and _arm_v7_ respectively and while
we were at it renamed _arm_64_ into _arm_v8_ for consistency. With this
approach, it became possible to introduce ARMv6 and ARMv7 specific kernel
configurations to 'virt_linux', and thus, enable support for drivers/protocol
stacks for both architectures.
Initcall handling without relying on global constructors
--------------------------------------------------------
When porting Linux drivers, a lot of code is placed into modules. Modules
always have a magic module-function call (e.g., 'module_init'), which
registers a function for the initialization of the module and is executed
during kernel startup prior device probing. DDE Linux mapped 'module_init'
indirectly to a macro that generated a function as a static constructor
(ctor), which in turn registered the required module function (Note: This is
simplified because there is also an order that must be preserved). This
solution required all ported components to call 'exec_static_constructors' in
order to trigger the registration of module-init calls before executing any
other Linux kernel code, but not before the 'Lx_kit' initialization because
the init-call functions had to be registered in advance. This scheme led to
hen-and-egg problems in our TCP/IP stack
(Section [TCP/IP stack based on DDE-Linux version 6.1.20]) and our WiFi driver
port because they are shared libraries where static constructors must be
called at a later stage.
In order to avoid these kinds of problems, we changed the module-init approach
by replacing the macro-generated functions with global-function pointers with
a well known prefix. These pointers are collected by the DDE-Linux-build
system using ELF reading tools (i.e., 'nm') after the compile step and are
placed into a function ('lx_emul_register_initcalls') which is called during
'Lx_kit' startup. This way, no changes to existing drivers are necessary, and
the static constructor problem disappeared for the shared library cases.
Note: Any ported driver still using 'exec_static_constructors' can remove the
call after checking if there are no static constructors from other C++ objects
present.
Suspend/resume awareness of GPU, AHCI, and NVMe drivers
=======================================================
As a further step towards general ACPI suspend/resume support, our
custom-developed drivers for Intel GPU, NVME, and AHCI got re-worked to
cooperate with the feature.
Before the final suspend, the drivers can now be notified to stop processing
further client data and to shut down the devices used by closing the
'Platform::Device'. This prompts the platform driver to power-off the
corresponding PCI device. However, DMA buffers containing all the client data
are kept in memory and are not de-allocated. This means that the client
sessions for GPU and 'Block_session' can stay intact (for ACPI S3 - suspend to
memory) and don't require a restart of the users of GPU, NVME, and AHCI on
resume.
On resume, after the kernel is up again, the drivers need to get notified to
re-acquire the PCI device from the platform driver. The platform driver will
power-on the re-acquired devices and the GPU/NVME/AHCI drivers will set up the
device resources, e.g. MMIO and IRQ, and then re-initialize the devices. The
drivers will finally restart processing session requests. This way the clients
will just continue to operate as though nothing had happened.
The test scenario for suspend/resume can be test-driven by using
_run/acpi_suspend_, which contains a periodic suspend-resume cycle for
developing purposes.
Dynamic aperture handling for high resolution framebuffers
==========================================================
We extended the Intel GPU driver with a configuration option to specify the
amount of the graphics aperture provided to the ported Intel display driver.
Beforehand it was a fixed amount (64M), which may not suffice for all
use-cases. The aperture is a shared resource, which must be used for various
GPU-related internal data structures and is used from CPU side for access to
the framebuffers by the display driver. When the display driver sets up
several framebuffers with high resolutions, the fixed amount may be too small.
The snippet below shows the new configuration option and the default value:
! <start name="intel_gpu_drv" ...>
! <resource name="RAM" .../>
! <provides>
! <service name="Gpu"/>
! <service name="Platform"/>
! </provides>
! <config max_framebuffer_memory="64M">
! ...
Improved human-interface device handling
========================================
In preparation of the _support for I2C-based HID (touchpad) devices_
[https://genode.org/about/road-map#February_-_Release_24.02 - road-map item],
we dusted off several aspects of our input-event handling from the drivers
over the event API to the event-filter component. At the heart of the
improvements, we developed a broad understanding of the specifics of the
different motion-event device types that are widely in use. First, there are
mice and touchpads, which generate relative-motion events that are translated
by the GUI stack to movements of the GUI pointer. Then, we have three kinds of
absolute-motion devices: pointers (e.g., Qemu usb-tablet or IP-KVM device like
[https://pikvm.org/ - PiKVM]), touchscreens, and graphics-tablet tools (e.g.,
stylus). These devices require translation of device-specific absolute
coordinates to screen coordinates.
On the driver side, we rewrote our custom *evdev* driver that interfaces
with all current and future ported Linux input drivers. Now, evdev covers
all peculiarities of the different device types, for example, touch devices
that report up to 16 event slots (resp. fingers), and reports them via
Genode Event sessions. Also, we implemented minimal "gesture" support for
simple tap-to-click for touchpads that could be improved in the future,
e.g., by two-finger-scrolling. Based on the rewrite, we could easily enable
support for the Magic Trackpad in usb_hid_drv.
The event filter was extended by a filter node to transform touch and
absolute-motion event coordinates by a sequence of primitives expressed in
sub-nodes, namely translation (move), scaling, rotation, and flipping.
For example, the scaling of 32767x32767 touch coordinates to a FullHD screen
is configured like follows. All primitives are documented in the event-filter
README file.
! <transform>
! <input name="usb"/>
! <scale x="0.0586" y="0.0330"/>
! </transform>
Additionally, the event filter now supports to optionally log motion and touch
events beside keys and buttons.
! <log motion="true"> <input name="usb"/> </log>
Unfortunately, the developments outlined above delayed the actual integration
of the prospected I2C HID support to a later release.
Multi-client use of Vivante GPU (i.MX8)
=======================================
In this release, we brought our port of the etnaviv driver, which was still
limited to one client only, up to speed. It now joins the other GPU drivers in
providing multi-client support.
Back in release
[https://genode.org/documentation/release-notes/21.11#Vivante_GPUs__i.MX8_ - 21.11],
we added support for the Vivante GC7000L GPU featured in the i.MX8MQ SoC to
Genode via a port of the etnaviv Linux and Mesa3D driver. As a blueprint, it
served us well when enabling another GPU for a different ARMv8 SoC, namely the
Mali GPU in the PinePhone. The etnaviv port itself, however, never left its
initial state and was able to cater to one client only. For this reason it was
co-located and deployed in tandem with the client requiring its service. This
factor somewhat restricted its usefulness in Sculpt when used in a
desktop-like capacity on, e.g., the MNT Reform.
The current release lifts this limitation and enables the driver to accommodate
multiple clients at the same time.
Libraries and applications
##########################
VirtualBox
==========
As a debugging aid, we enabled the reporting of Windows Blue Screen of Death
(BSOD) reasons in our VirtualBox port. To enable the output, the new release
adds a default of '+dbgf+gim' to the 'VBOX_LOG' environment variable. With
VirtualBox Guest Additions installed in the Windows guest, after a "Guest
indicates a fatal condition!", the reason for the blue screen will be printed
to the log.
Seoul VMM
=========
Several improvements got added since the previous Genode release, which showed
up during daily use of a Genode developer VM. On the one hand, the exported
guest-cursor shape was a bit offset from its actual position. Besides the
guest shape, small hot_x, hot_y shifts are exported, which are now considered
in order to position the mouse cursor shape more accurately. Additionally, the
processing of alt-gr and <>| keys on German keyboard layouts got enabled.
Finally, the AHCI model and the bindings to the Genode block session got
reworked. Up to now, the AHCI model could not cope with delaying a block
request in case the block session was saturated. Instead of making temporary
copies, as done before, the AHCI model now supports keeping guest requests in
guest memory when necessary and resumes block operations as soon as the block
session is able to process more requests.
Lighttpd web server version 1.4.73
==================================
We updated our port of the [https://www.lighttpd.net - lighttpd] HTTP server
and at the same time also extended its feature-set by enabling the WebDAV
module.
Rather than being used as a general purpose HTTP server that comes with all
bells and whistles, it powers our [https://genodians.org - Genodians]
appliance in static fashion and with WebDAV in place is now also the
foundation for the goa testbed introduced in
Section [Sculpt OS as remote test target for the Goa SDK].
Jitterentropy version 3.4.1
===========================
Back in 2014, we ported the
[https://www.chronox.de/jent/index.html - jitterentropy library] as a basic
component-local entropy source for seeding pseudo random-number generators like
[https://prng.di.unimi.it/ - Xoroshiro] or [https://www.pcg-random.org/ - PCG].
As the last port update dates back years, we brought the most recent version
3.4.1 of jitterentropy to Genode. The new library is API-compatible to the old
version and can be integrated as usual via the '<jitterentropy>' plugin into
your VFS configuration.
Build system and tools
######################
Goa SDK
=======
In addition to the support for using Sculpt as test target for Goa
(Section [Sculpt OS as remote test target for the Goa SDK]), the latter
underwent quite a few usability adjustments.
As announced in
[https://genode.org/documentation/release-notes/23.08#Support_of_index_projects - release 23.08],
Goa has been enabled to export and publish a personal depot index. The depot
index lists the depot user's packages in a nested structure of '<index>' nodes.
The initial support for index projects, however, was restricted to two levels
of '<index>' nodes. We eliminated this restriction in order to clear the path
for large depot indexes with hierarchical structure.
When using Goa to export and publish a depot index, one always had to provide
the '--depot-overwrite' switch in order to overwrite the current depot index.
Goa also propagated this switch to any sub-project that got exported along
with the depot index. In practice, however, an index project will typically be
exported and published when development on all sub-projects has finished,
hence there is no need for re-exporting already exported sub-projects.
We therefore added the '--depot-retain' switch in order to express the intent
to not overwrite any depot content. Instead of propagating the
'--depot-overwrite' switch, Goa now uses the '--depot-retain' switch when it
automatically exports sub-projects.
Along with the support for index projects, Goa had been equipped with the
ability to lookup version information from other project directories. By
default, Goa uses the current working directory as a starting point for the
lookup of projects and their versions. The practical use of this was still
limited, though, since it required using the '-C' argument to execute Goa
from a different directory than the project directory. We thus introduced the
'search_dir' config variable that allows defining the directory from which Goa
starts searching for depended on projects.
When porting CMake-based projects with Goa, we often needed to patch the
_CMakeLists.txt_ or add quirks to Goa in order to disarm CMake's
'find_library' command. Instead of resorting to those ad-hoc solutions, we
decided to add support for _FindXXX.cmake_ files in api archives. Any api
archive mentioned in the _used_apis_ file is now added to the
'CMAKE_MODULE_PATH' so that CMake is able to correctly identify the presence
of depended on libraries via the _FindXXX.cmake_ files. An example is found
in the Goa repository at _examples/cmake_sdl2_.
In addition to the aforementioned changes, we added a couple of minor tweaks:
* We added the sub-commands 'goa help index' and 'goa help runtime' to document
the structure of _index_ and _runtime_ files.
* The sub-command 'goa bump-version' now creates a _version_ file if none exists.
Convenient parsing of backtraces
================================
The new _tool/backtrace_ parses the copied and pasted shared library info of a
component (generated with <config ld_verbose="yes"/>) and the log output of the
'Genode::backtrace()' function and prints the corresponding source locations in
a convenient way.

740
doc/release_notes/24-05.txt Normal file
View File

@@ -0,0 +1,740 @@
===============================================
Release notes for the Genode OS Framework 24.05
===============================================
Genode Labs
The main driver behind Genode 24.05 was the
[https://genode.org/news/sculpt-os-release-24.04 - recent release] of Sculpt
OS 24.04 ([https://genodians.org/nfeske/2024-04-26-sculpt-os - What's new?]).
Among the many usability advances of Sculpt OS is the flexible assignment
of USB devices to components and virtual machines.
Section [Fine-grained and dynamic assignment of USB devices/interfaces]
introduces the underpinnings that made our new quality of life possible.
Another user-facing feature with a surprisingly deep technical reach is
suspend/resume. Section [Suspend/resume infrastructure] details the changes of
the framework on that account. The new ability of seamlessly using the GNU
debugger on top of Sculpt OS is a game changer for developers
(Section [On-target debugging using the GNU debugger (GDB)]).
Further user-visible and user-audible topics are the support for
high-resolution displays and the wrapped-up transition to our new audio stack
(Section [Transition to the new audio interfaces introduced in 24.02]).
Besides the many usability-motivated topics of our
[https://genode.org/about/road-map - road map], however, we celebrate
the break-through of running Sculpt OS directly on our custom microkernel
alternatively to using a 3rd-party kernel.
Section [First version of Sculpt OS based on Genode's custom kernel]
details the background story, the showstoppers we had to overcome, and the
prospects of this achievement.
: <div class="visualClear"><!-- --></div>
: <p>
: <div style="clear: both; float: left; margin-right:20px;">
: <a class="internal-link" href="https://genode.org/documentation/genode-foundations-24-05.pdf">
: <img class="image-inline" src="https://genode.org/documentation/genode-foundations-title.png">
: </a>
: </div>
: </p>
The "Genode Foundations" book covers Genode's architecture, developer work
flows, and reference material. In tandem with the current release, the
document received its annual update, which includes not only adjustments
to the most recent version but also new material about accessing GPIO pins,
audio, debugging, and prominent APIs like the list model.
Further topics of the current release reach from timing and network-throughput
optimizations, over the profound rework of storage encryption, to updated
3rd-party software such as Mesa, libSDL2, and Curl.
: <div class="visualClear"><!-- --></div> <p></p>
First version of Sculpt OS based on Genode's custom kernel
##########################################################
The ability to use a wide variety of kernels is certainly a distinctive
feature of Genode. Since the very first version, the framework accommodated
both a microkernel and the Linux kernel.
Over the years, we embraced most members of the L4 family of kernels
([https://genode.org/documentation/release-notes/9.05#Supporting_the_OKL4_kernel_as_new_base_platform - OKL4],
[https://genode.org/documentation/release-notes/9.02#Genode_on_L4ka__Pistachio - Pistachio],
[https://genode.org/news/genode-os-framework-release-8.08 - Fiasco],
[https://genode.org/documentation/release-notes/10.02#Codezero_kernel_as_new_base_platform - Codezero]),
all object-capability microkernels we could get our hands on
([https://genode.org/documentation/release-notes/10.02#NOVA_hypervisor_as_new_base_platform - NOVA],
[https://genode.org/documentation/release-notes/11.02#Support_for_Fiasco.OC - Fiasco.OC],
[https://genode.org/documentation/release-notes/15.05#Proof-of-concept_support_for_the_seL4_kernel - seL4]),
and even combined the framework with a static isolation kernel
([https://genode.org/documentation/release-notes/15.08#Genode_on_top_of_the_Muen_Separation_Kernel - Muen]).
Confronting the framework with largely different kernel mechanisms has
undoubtedly strengthened Genode's software design, but also gave us a great
depth of insights into the landscape of kernel designs and the implications of
the respective design choices. It did not take us long to question some of
these choices, and we started experimenting with custom kernel designs on our
own. This work made its first appearance in version
[https://genode.org/documentation/release-notes/11.02#Approaching_platform_support_for_Xilinx_MicroBlaze - 11.02]
targeting Xilinx Microblaze softcore CPUs.
Without haste, we steadily evolved this kernel as a research endeavour, mainly targeting ARM CPUs
([https://genode.org/documentation/release-notes/14.05#Multi-processor_support - SMP],
[https://genode.org/documentation/articles/trustzone - TrustZone],
[https://genode.org/documentation/release-notes/15.02#Virtualization_on_ARM - virtualization],
[https://genode.org/documentation/release-notes/19.08#64-bit_ARM_and_NXP_i.MX8 - 64 bit]),
and later also addressing the
[https://genode.org/documentation/release-notes/15.05#Feature_completion_of_our_custom_kernel__base-hw_ - x86]
architecture.
When we
[https://genode.org/documentation/release-notes/18.02#Sculpt_for_Early_Adopters - started]
creating Sculpt OS as a Genode-based operating system for commodity PCs, we
picked NOVA as kernel of choice. NOVA's unique combination of microkernel and
virtualization mechanisms served us extremely well. It is truly a technical
marvel! But like any other 3rd-party kernel, it imposes certain complexities
and points of friction onto the user land. In contrast to 3rd-party kernels
like NOVA or seL4, which are self-sufficient programs, our custom kernel is
melted with Genode's core component. This alleviates redundant data structures
between kernel and user space and makes Genode's resource management directly
applicable to kernel objects. In other words, it fits like a glove. Hence,
looking ahead, we foresee a much simpler and ever more coherent trusted
computing base of Sculpt OS.
In order to realize this vision, we had to tackle a couple of long-time
showstoppers. First of all, we needed to move IOMMU support out of the kernel
into the user-level platform driver to render it kernel-agnostic. We completed
a major part of this transition with
[https://genode.org/documentation/release-notes/23.11#Kernel-agnostic_DMA_protection - release 23.11].
Second, virtualization of commodity operating systems is a common use case for
Sculpt installations, ours at Genode Labs included. Therefore, adding support
for Intel's Virtual-Machine Extensions (VMX) was another important missing
piece of the puzzle. Under the hood, we refactored and generalized the
kernel's x86 hypervisor support to allow for the selection of the available
virtualization technology at runtime and consolidated code for page-table
handling. Even though we still have some way to go before the kernel is ready
to replace the time-tested NOVA hypervisor as the default kernel for Sculpt
OS, this release is a milestone in that direction.
The Sculpt OS variant using our custom kernel is now available as a
ready-to-use system image at [https://depot.genode.org/jschlatow/image]
for Intel systems up to 8th generation core processors (Whiskey Lake).
Note, when using Sculpt's integrated update mechanisms, you must already run
at least Sculpt 24.04. The system image includes a launcher for running a
Tiny-Core-Linux VM with a Firefox browser in VirtualBox. The launcher requires
a window manager that is best deployed by switching to the corresponding
preset. You also need to enable the _system clock_ and _mixer_ options.
Note that there are still a few areas of improvement for this Sculpt variant:
The IOMMU support currently omits IRQ remapping, which is important to shield
the system from rogue devices sending arbitrary interrupts. Moreover, we plan
to improve the kernel scheduling for interactive and time-critical workloads.
Fine-grained and dynamic assignment of USB devices/interfaces
#############################################################
USB support has a long history within the Genode framework and for almost one
decade its client session API has remained stable. Back in
[https://genode.org/documentation/release-notes/15.02#USB_session_interface - 2015],
we split the USB host-controller driver parts from other USB client device
drivers. Since then, a USB client component could request exactly one USB
device per session from the USB server resp. USB host-controller driver.
Moreover, a client had to drive the device in its entirety.
This former approach led to some limitations and intricateness. First, USB
drivers capable of driving more than one device of the same class needed to
know each device to request in advance. This information was not delivered by
the USB session but by means of configuration. The out-of-band information
path complicated the management of USB devices in complex systems like Sculpt
OS, e.g., when passing arbitrary USB devices to a guest OS running inside a
virtual machine.
The second drawback was related to USB devices with multiple interfaces of
different interface classes, most prominently, USB headsets with extra buttons
for volume control. Such devices typically have several USB interfaces for
audio playback and recording, and at least one interface for HID input events.
Whereas the development of one driver for each interface class is certainly an
attainable goal, creating driver mixtures for each potential combination of
interfaces is unrealistic. Ultimately, we strive to freely operate different
interfaces of a single device by dedicated drivers.
These limitations accompanied us for quite some time, and a design to overcome
them matured at the back of our minds. With the current release, the USB
session eventually received its long-anticipated redesign.
The new USB session API provides a _devices_ ROM to its client. Within this
ROM a client can retrieve all relevant information about existing devices it
is allowed to access. You can think of it as a virtual private USB bus for
this client. When a new device gets connected that matches the client's policy
of the USB host controller driver, the ROM gets updated appropriately. If a
device gets removed physically, it'll vanish from the _devices_ ROM, which
may, for example, look as follows.
! <devices>
! <device name="usb-1-10" class="0x0" product="USB Optical Mouse"
! vendor_id="0x1bcf" product_id="0x5" speed="low" acquired="true">
! <config active="true" value="0x1">
! <interface active="true" number="0x0" alt_setting="0x0"
! class="0x3" subclass="0x1" protocol="0x2">
! <endpoint address="0x81" attributes="0x3"
! max_packet_size="0x7"/>
! </interface>
! </config>
! </device>
! </devices>
As can be seen in the example, the human-readable XML representation of the
USB devices already contains most information that normally resides in the
full-length device descriptor of the USB standard. That means a driver can
parse relevant information about available configurations, interfaces, and
endpoints - including their types and identifiers - without the need to
communicate with the device in the first place.
Besides the _devices_ ROM, the new USB-session API consists of an acquire
function and a function to release a formerly acquired device. The acquisition
of a device returns a capability to a new device RPC API. This distinct API
includes a function to obtain a packet-stream buffer to exchange USB control
requests with the USB host-controller driver. The host-controller driver
sanity-checks the control requests, and potentially forwards them to the
device. Thereby, a client can change the configuration of the device, enable
an alternate interface, or request additional descriptors regarding
device-class specific aspects.
Moreover, the device RPC API provides functions to acquire or release an
interface of the device. When acquiring an interface, a capability to the
interface RPC API gets returned. This third new RPC API provides a
packet-stream buffer to the client, which allows for the exchange of
interrupt, bulk, or isochronous transfers with the host-controller driver.
The host-controller driver checks these transfer requests for plausibility,
and forwards them directly to the device and vice versa.
The whole internals of the different RPC API layers, however, are not imposed
on the developer. Instead, convenient helper utilities are provided within
_repos/os/include/usb_session/device.h_. Those helper classes simplify the
acquisition of USB devices and interfaces. Moreover, they support the notion
of USB Request Blocks (Urbs) on the level of device (control) and interface
(irq, bulk, isochronous). For an example component that makes use of these
utilities, please refer to the USB block driver.
All components that directly use the USB session have been adapted to the new
API. This includes the Linux USB driver ports for host controllers, HID, USB
Ethernet cards, the libusb library port, our XHCI model within VirtualBox, and
the black-hole component.
Practical considerations
------------------------
For users of the framework or Sculpt OS, the most notable change is that all
USB clients use their own _devices_ ROM to react to device appearance and
disappearance. No global information is required anymore. That means the
addition of a new policy rule in the USB host-controller's configuration is
sufficient to, e.g., let a device appear in a Linux guest. If the rule already
exists, even the pure physical connect will result in the appearance of the
device.
Because one USB session can now control an arbitrary number of devices, the
syntax of the policy rules for a USB host controller driver changed a bit:
! <config>
! <policy label="usb_net">
! <device vendor_id="0x0424" product_id="0xec00"/>
! </policy>
! <policy label="usb_hid">
! <device class="0x3"/>
! </policy>
! <policy label="vm">
! <device name="usb-2-2"/>
! <device name="usb-2-4"/>
! </policy>
! </config>
As you might notice, there is no differentiation in the policy rules on the
interface-level yet. In short, each device is still handled by only one
driver. As a prerequisite to assign drivers to individual interfaces, drivers
first have to become resilient against denied device-acquisition attempts.
This is not the case for most ported drivers or virtualized guest OSes. Hence,
even though the USB session API is now prepared for driving interfaces of one
USB device by dedicated drivers, we decided against activating this feature on
the policy level at the current time. Nonetheless, once a set of interface
drivers gets in place, we can enable the added flexibility without touching
the USB session API again.
Sculpt OS
---------
The outcome of this line of work is already present in
[https://genodians.org/nfeske/2024-04-26-sculpt-os - Sculpt OS 24.04], which makes the
[https://genode.org/documentation/articles/sculpt-24-04#Assignment_of_USB_devices_to_components - assignment of USB devices]
to components intuitive and secure.
On-target debugging using the GNU debugger (GDB)
################################################
The renovation of our debugging monitor in
[https://genode.org/documentation/release-notes/23.08#Multi-component_debug_monitor - Genode 23.08]
was driven by the vision of easy on-target debugging on Sculpt OS. Just
imagine, any runtime component from applications over device drivers to VMMs,
like VirtualBox, could be started with debugging optionally enabled. The key
to make this vision come true is the debug monitor at the heart of the Sculpt
runtime. All other missing ingredients for viable on-target debugging - above
all a GDB front end - are introduced with this release.
The _debug monitor_ component got introduced in version
[https://genode.org/documentation/release-notes/23.08#Multi-component_debug_monitor - 23.08].
It is a drop-in replacement for the init component with the added ability to
control the execution and memory content of selected child components using
the GDB remote serial protocol. On Sculpt, the debug monitor now acts as the
runtime init component. The user decides which components are made available
to debugger control with a check mark in the launcher menu before the
component is started. If the component is selected for debugging, the monitor
configuration part for this component is added to the Sculpt runtime
configuration.
The [https://www.sourceware.org/gdb/ - GDB] component is the user-facing part
of the debugging experience. It presents a command line interface in a
graphical terminal window and communicates with the debug monitor in the
background. The user can enter GDB commands for inspecting and modifying the
state of monitored components.
In order to debug a component in a meaningful way, GDB usually needs to
evaluate the executable files of the component and profits hugely from
additional debug information like symbol names and source-code location
information generated by the compiler. As this information can take up a lot
of space, we decided to store it in separate debug info files shipped in
dedicated _dbg_ depot packages since version
[https://genode.org/documentation/release-notes/23.11#Debug_information_for_depot_binaries - 23.11].
Two small support components help to make this information available to GDB at
runtime:
The _dbg_download_ component can be started by the user by checking the
_download debug info_ option in the Sculpt launcher menu. It evaluates the
Sculpt runtime configuration in the background and downloads any missing _dbg_
archive content of monitored components into the depot.
The _gdb_support_ component is started automatically together with GDB. It
evaluates the Sculpt runtime configuration in the background and dynamically
creates directories with symbolic links to the depot binaries and debug info
files of monitored components in a RAM file system shared with GDB, and
thereby allows GDB to access these files in a convenient way.
[image on_target_gdb]
With this setup in place, the user can debug multiple components at once
and control the execution of threads on an individual basis thanks to GDB's
_non-stop_ mode.
Learn how to integrate and use GDB on Sculpt with our article and screencast
video on [https://genodians.org/chelmuth/2024-05-17-on-target-debugging - Genodians.org].
One noteworthy challenge discovered while testing on Sculpt was that GDB
apparently was not prepared for the case that there are no initial inferiors
and that the first inferior could appear spontaneously on the remote side
instead of being actively started by GDB. We had to make some adaptations to
the GDB source code to support this situation and some more adaptations might
be necessary in the future, for example to update the output of the
_info inferiors_ command when the first inferior appears.
Base framework and OS-level infrastructure
##########################################
Transition to the new audio interfaces introduced in 24.02
==========================================================
In Genode's
[https://genode.org/documentation/release-notes/24.02#Revised_audio_infrastructure - February release],
we introduced new audio 'Record' and 'Play' sessions intended to supersede the
old 'Audio_in' and 'Audio_out' interfaces. In the time following up to the
current release, we worked on integrating the new sessions into the existing
components. In fact, they are already exercised in the most recent
[https://genode.org/news/sculpt-os-release-24.04 - Sculpt release].
As most prominently used by ported software, the VFS OSS plugin plays a vital
role in interfacing with Genode's native audio stack. The already existing
VFS plugin got renamed to _legacy_oss_ while the new one takes its place and
is usable as a drop-in replacement. Existing users have to adapt the session
routes accordingly or change their VFS configuration to make use of the
legacy plugin, if the use of the new sessions is not yet desirable.
In contrast to the old plugin, it is possible to configure the fragment size a
client is allowed to use via its configuration and thereby enforce its latency
requirements. The fragment size ranges from 2048 to 8192 bytes, which equals a
period length of around 11.6 to 46.4 ms when using a sample rate of 44.1 kHz.
The plugin leverages the ability of the _report_play_mixer_ to convert sample
rates. However, to constrain the resource requirements of the plugin, it is
limited from 8 kHz to 48 kHz, which covers a reasonable range. Please consult
the _repos/gems/src/lib/vfs/oss/README_ file for more information.
The _black_hole_ component gained additional support for providing the play
and record sessions so that it is able to perform its role when using the new
sessions. We also removed the custom audio subsystem from our SDL1.2 port in
favor of using its own OSS back end, which brings it in line with our SDL2
port.
As there are no critical components left that exclusively use the old sessions
directly, the way is paved to remove them. However, we keep the legacy audio
sessions intact to give users time to migrate their components and become
comfortable with the new interfaces.
Improved timing stability
=========================
Our recent work on real-time audio processing moved the timing characteristics
of the framework into focus. Low latency cannot be attained in the presence of
high jitter. But in a component-based system carrying general-purpose
workloads, jitter can be induced for many reasons including kernel scheduling,
spontaneous high-priority events, or the interference between clients of
shared services. The timer driver in particular is such a shared service.
While analyzing the timer's behaviour under stress, we indeed observed
unwelcome interference between timer clients. E.g., the stability of a
waveform generated at a period of 5 milliseconds would be effected by
otherwise unrelated spontaneous USB-HID events. Those observations motivated
the following improvements:
First, we simplified the timer implementation to make it dead-simple to
understand and straight-forward to trace its behavior. The timer no longer
relies on TSC-interpolated measurements but only on ground-truth values
obtained from the timing device (or from the underlying kernel). Second, to
improve accuracy at the client side, the timer no longer limits the time
resolution when the current time is queried. The deliberate limiting of the
time resolution is applied only to the triggering of timeouts in order to cap
the timer's CPU load induced by its clients. Third, to limit the rate of
inter-component communication, the timer batches the wake-up of clients that
have timeouts closely clustered together. Combined, those measures reduced the
cross-client interferences between timer clients comfortably below the level
relevant for our synthetic test setup using audio periods of 5 ms. Note that
such small periods are not generally usable in practice because real-world
audio applications are subjected to additional sources of jitter.
The improvements are in effect for the timers used on NOVA, the base-hw
kernel, and the PIT-based timer as used on seL4, OKL4, and Pistachio. Linux,
Fiasco.OC, and L4/Fiasco are not covered yet.
Device drivers
##############
Linux-device-driver environment (DDE)
=====================================
Porting Linux drivers to Genode is a multi-staged process with the
configuration of a minimal yet functional platform-specific Linux kernel as
an essential step. The device support in this kernel is the baseline and
reference for the final Genode driver. To simplify the testing of minimal
kernel images, we introduced new run scripts for i.MX boards and PCs. Now, a
plain execution of 'make run/pc_linux' or 'make run/imx_linux' runs Linux on
the test target as known from Genode scenarios. In case of i.MX, a FIT image
is generated, whereas we provide an i.PXE-bootable image for PCs. The run
scripts integrate busybox into an initial RAM disk and, for i.MX, amend this
image with _memtool_, a tool by Pengutronix to inspect all kind of memory
under Linux (via _/dev/mem_).
Furthermore, we address some deficiencies in DDE Linux with this release.
We improved support for fine-grained, sub-millisecond timing by enabling
high-resolution timers and attended to a long-standing pc_nic_drv link reset
bug that manifested in some situations on some platforms only. For driver
developers, we added the 'lx_emul_trace_msg()' function for the generation
of low-overhead trace entries that can be used to debug timing-sensitive or
high-traffic scenarios.
Intel framebuffer and GPU driver
================================
An essential prerequisite for providing a GUI as Sculpt OS does, is having a
driver for the graphics controller. In Genode, this task is split between the
framebuffer driver and the GPU driver. Exposing these to a growing range of
devices led to a few robustness and compatibility improvements for the Intel
framebuffer/GPU drivers.
In the context of the latest Sculpt release, we made the accounting of maximum
framebuffer memory configurable. Previously, this was derived from the
component's RAM quota, which implicitly limited the maximum display
resolution. The separate configuration explicitly sets the maximum framebuffer
memory by default to 64 MiB, which suffices for resolutions of at least
3840x2160. The actual memory used by the component depends on the configured
display resolution. If the RAM quota is depleted, the component will issue a
resource request. The configuration follows the scheme established for the GPU
driver with
[https://genode.org/documentation/release-notes/24.02#Dynamic_aperture_handling_for_high_resolution_framebuffers - release 24.02].
In this release, we also incorporated a vendor check in the Intel framebuffer
driver in order to ensure that it only operates Intel devices. Our central
platform driver typically hands out all VGA-class devices to the driver,
including GPUs of other vendors. This caused issues on platforms with an
additional Nvidia GPU for multiple users. Thanks to Alice Domage for this
contribution.
Furthermore, we fixed a few issues that popped up when test-driving Sculpt OS
on the ZimaBlade. By doing this, we added support for Intel HD Graphics 500 to
the Intel framebuffer/GPU drivers. This GPU can be found in various Intel
Processors in the Pentium/Celeron N-series.
Suspend/resume infrastructure
=============================
As planned in our [https://genode.org/about/road-map - road map], we
integrated the current state of x86 suspend/resume as a feature into Sculpt
OS. The sculpt manager got enhanced to drive the system state and manage the
life cycle of driver components during suspend-resume cycles.
The new
[https://genode.org/documentation/articles/sculpt-24-04#System_power_control - power options]
can be found in the _System_ menu once the ACPI support option is activated.
[image sculpt_24_04_system_power]
Non-stateful drivers are removed from the runtime before suspending and are
restarted during resume, e.g., network drivers. Stateful drivers like NVME,
AHCI, and GPU drivers participate cooperatively in the system states by
stopping their processing and reporting their fulfillment. Currently, the USB
host driver needs to be restarted forcefully on resume. To avoid data loss,
the power suspend feature is not offered while a USB block device is in use.
Additionally, during Sculpt integration, several drivers got enhanced. The
acpica application now reflects the completion of the last action, which the
sculpt manager monitors and incorporates into the system state machine. The PC
platform driver saves and restores the IOMMU configurations before and after
suspend. Additionally, the platform driver gained the ability to trigger the
final suspend RPC to Genode's core. Furthermore, the Intel display driver now
participates in the system state changes by switching off all connectors
before suspend in order to reduce graphical noise on displays during the
transition.
Mesa updated to version 24.0.1
==============================
With the goal to add support for more recent Intel GPUs (Alder Lake+), we took
the first step by updating our three-year-old Mesa 21 to version 24. Because
Mesa is under heavy development, the effort to do so was more elaborate than
anticipated. For the current release, we enabled all the previously supported
GPUs, which are Intel Gen8 (Broadwell), Gen9 (Skylake up to Whiskey Lake),
Gen12 (Tiger Lake) using the Iris Gallium driver, Vivante as found in i.MX8
SoCs, and Mali on the PinePhone. There are still many improvements to be
explored, like buffer life-time management, using Mesa's native build system
(Meson) for simplifying future updates, testing Alder Lake, replacing softpipe
with llvm for software rendering, and adding Vulkan support, to name a few.
We are looking forward to tackle these topics in future Genode releases.
Removed obsolete loader component and session interface
=======================================================
The loader was originally introduced in version
[https://genode.org/documentation/release-notes/10.11#Qt4 - 10.11] as part of an
early [https://genode.org/news/genode-live-demonstration-2010-11 - live CD].
It later served the purpose of dynamically starting and stopping preconfigured
subsystems. As of today, the latter use case has long been covered by the
dynamically reconfigurable init component. The only substantial client of the
loader remained to be the qpluginwidget in combination with the Arora web
browser. But as the blending of plugins with websites never moved beyond a
fancy tech demo and Arora was replaced by Falkon, the current release removes
the now obsolete loader infrastructure.
Libraries and applications
##########################
Consolidation of Tresor block encryptor and File Vault
======================================================
Genode [https://genode.org/documentation/release-notes/23.05#Revision_of_Genode_s_custom_block-encryption_infrastructure - 23.05]
marked a big update of the core logic for block-data security and management
behind the file vault. It replaced the former Ada/SPARK-based implementation
called CBE with a C++-based, modernized library that we named _Tresor_. As a
side effect of this endeavor, we improved testing and fixed many issues of the
former approach. However, the tresor library also inherited some unwelcome
traits from its predecessor. The CBE approach was shaped in many ways by the
semantic restrictions imposed by SPARK and the tresor library had retained
some of these at the expense of code redundancy. In addition, we had adopted a
rather peculiar approach to execution flow that led to unforeseen
implementation complexity down the road. In order to improve this situation,
the current release comes with a comprehensive re-design of the tresor
library, relieving it from legacy burdens, significantly shrinking the code
base, and making it much easier to understand.
Once warmed up with the topic, we stepped one level up in the block-encryption
stack and continued reworking the tresor VFS plugin because it also suffered
from over-complexity and redundancy. After finishing that, we noticed that the
next higher layer - the File Vault - could also be improved in two ways:
First, the file vault used to combine two unrelated tasks in one component:
The logic for modeling typical user work-flows on the tresor VFS and the
operation of a graphical user interface. We found that these are better
assigned to separate components that work together via a narrow and
well-defined interface. Second, the file vault used to operate directly on
the low-level interface of the menu view component in order to drive its GUI
instead of using the newer and far easier dialog API for this purpose.
[image file_vault_gui]
For the component that deals with the logic, we stayed with the name
_file vault_ whereas the new front-end is the _file vault gui_.
Putting all these changes together, the whole ecosystem around the tresor block
encryption and the file vault becomes far more manageable and its code base
has been cut in half while providing the same feature set as before:
component | 23.05 | 24.05 | difference
-----------------------------------------------------------
-----------------------------------------------------------
lib/tresor | 14374 | 5212 | -63%
-----------------------------------------------------------
lib/vfs/tresor | 2728 | 1823 | -33%
-----------------------------------------------------------
lib/vfs/tresor_crypto | 1162 | 1213 |
-----------------------------------------------------------
lib/vfs/tresor_trust_anchor | 1800 | 1992 |
-----------------------------------------------------------
app/tresor_init | 159 | 93 |
-----------------------------------------------------------
app/tresor_init_trust_anchor | 166 | 163 |
-----------------------------------------------------------
app/file_vault | 5429 | 1256 | -76%
-----------------------------------------------------------
app/file_vault_gui | - | 617 |
-----------------------------------------------------------
-----------------------------------------------------------
total | 25818 | 12369 | -52%
But the update is not only about cleaning up. We also consolidated the stack
by, for instance, fixing and re-enabling asynchronous rekeying, implementing
robust handling of corner-case configurations, patching several performance
limitations, and further improving the test suite.
Last but not least, the file vault received two handy usability enhancements.
First, the new file-vault GUI is fully controllable via keyboard.
The hotkeys are documented in _repos/gems/src/app/file_vault_gui/README_.
Second, as an implication of separating GUI from logic, the text-based
interface of the file vault became the canonical way to steer that component.
In order to achieve that, the interface had to be extended to the full feature
set, which has the welcome side effect of easing the combination of the file
vault with alternative front ends. For instance, the file vault could now
become an integrated part of the administrative user interface of Sculpt OS.
The new interface is mostly backwards compatible (only the non-functional
version attribute disappeared) and documented in
_repos/gems/src/app/file_vault/README_.
Despite the extensive overhaul, file vault version 24.05 remains compatible
with old containers created via the 23.05 version and we also kept the
structure and appearance of the new graphical front end close to that of the
old version in order to make the transition as smooth as possible.
VirtualBox network-throughput improvements
==========================================
The Uplink and NIC session interfaces provide means to batch several network
packets before informing the other side to process the packets. The batching
is crucial to achieve good network throughput and also to keep the CPU
overhead per packet at a moderate level. Up to now, our ports of VirtualBox
did not leverage this feature, which became noticeable on systems under high
CPU load. By adding the batching of network packets to our VirtualBox ports,
we were able to reduce the CPU load and achieve stable throughput
measurements, which otherwise fluctuate more depending on other factors like
scheduling.
Seoul virtual machine monitor
=============================
Since the
[https://genode.org/documentation/release-notes/24.02#Seoul_VMM - previous]
release, the VMM received several improvements.
Notably, the former global motherboard lock got replaced by fine-grained
locking within each device model where appropriate. Thanks to the better CPU
utilization, long-running work, for example compilation, now finishes earlier.
The network binding got reworked and now reflects network link-state changes
from the Genode interface into the guest VMs. The legacy audio-session binding
got replaced by Genode's new Play interface.
The so far unused ACPI model of the Seoul sources got enabled and adjusted
to support so-called fixed ACPI events, e.g., power-button press event. On
GUI window close, the event is now triggered and forwarded to the guest VM.
Depending on the configuration of the guest, the VM may power down
automatically, similar as done by our port of VirtualBox.
Finally, a USB XHCI model powered by our qemu-usb library has been added to
Seoul, which got developed during our recent
[https://github.com/genodelabs/genode/issues/4989 - Hack'n'Hike] event.
With this new model, USB devices can be passed through to the guest. It has
been successfully tested with several USB storage, keyboard, and audio
devices.
SDL2 improvements
=================
We enhanced our SDL2 port by enabling more subsystems, improving its window
handling, and adding support for its text-input API.
This release adds preliminary support window resizing. It works well for some
of the currently available ports but still has issues with others (especially
those using an OpenGL context) as it depends to some degree on the component
itself using the SDL2 library. As an additional feature, we added support for
setting the initial window geometry via the '<initial>' node, e.g.:
! <initial width="800" height="600"/>
This allows for restricting the initial window size because otherwise the
actual screen size will be used and that might be too large depending on the
attached display.
Support for using SDL2's text-input API has been enabled. Once the application
enables text input, any key press that has a valid Unicode codepoint is sent
as text input.
Curl updated to version 8.7.1
=============================
We updated our cURL port to version 8.7.1 to support the use of
elliptic-curve algorithms for TLS (CURLOPT_SSL_EC_CURVES).
In setups where no service is employed to provide entropy, it might be
necessary to increase the amount of statically configured entropy. Doubling
the content of the '<inline>' VFS plugin as used in static configurations
seems satisfactory. Furthermore, DNS resolving needs a configured '<pipe>'
plugin to work properly. For an exemplary configuration, please look at the
_repos/libports/run/fetchurl.inc_ run-script snippet.
The 'fetchurl' component also gained a 'verbose' configuration option to
enable verbose operations as a convenience feature to ease debugging.
Platforms
#########
NOVA microhypervisor
====================
Some of the command-line options changed. The 'iommu' option is now split up
into 'iommu_amd' and 'iommu_intel', so that they may be enabled/disabled
separately. The 'novga' option turned into 'vga' since it is unused nowadays.
The tagged TLB feature for virtual machines is now enabled by default.
The kernel now supports the 'mwait' instruction besides the 'hlt' instruction,
which can be used to give hints to the CPU to enter deeper sleep states.
The feature is off by default and can be utilized via the 'Pd::system_control'
interface.
Build system and tools
######################
Goa SDK
=======
Aligned with the Sculpt release, the Goa tool has been updated with the
corresponding depot archive versions for Sculpt 24.04. This also involved
adding support for the new audio play and record sessions.
The _Goa testbed_ package and preset have been updated accordingly so that
an out-of-the-box Sculpt 24.04 lends itself as a
[https://genode.org/documentation/release-notes/24.02#Sculpt_OS_as_remote_test_target_for_the_Goa_SDK - remote test target for Goa].

451
doc/release_notes/24-08.txt Normal file
View File

@@ -0,0 +1,451 @@
===============================================
Release notes for the Genode OS Framework 24.08
===============================================
Genode Labs
Genode 24.08 puts emphasis on the tracking of the supported 3rd-party software
and consolidation work. It features the Qt6 application framework in addition
to the time-tested Qt5, consistently updates all Linux-based components and
PC device drivers from Linux version 6.1 to version 6.6.47, and updates Mesa
to version 24.0.8. The consolidation work revisits the framework's base and
GUI interfaces with respect to C++20 style, the move away from exception-based
error handling, and the use of strict types.
Combining Genode's recent advances of
[https://genode.org/documentation/release-notes/24.05#On-target_debugging_using_the_GNU_debugger__GDB_ - on-target debugging]
with the
[https://genode.org/documentation/release-notes/23.08#Goa_tool_gets_usability_improvements_and_depot-index_publishing_support - Goa SDK],
the release introduces remote debugging via Goa (Section [Debugging]). Further
topics of version 24.08 range from enhanced board support for i.MX-based
devices (Section [Improvements for NXP's i.MX family]), over the exploration
of AVX on x86 (Section [NOVA microhypervisor]), to steady improvements of
Genode's custom microkernel (Section [Execution on bare hardware (base-hw)]).
Base framework and OS-level infrastructure
##########################################
Reduced reliance on the C++ exception mechanism
===============================================
In [https://genode.org/documentation/release-notes/21.11#New_pattern_for_C___error_handling - version 21.11],
we introduced the
[https://genode.org/documentation/genode-foundations/24.05/api/Fundamental_types.html#Exception-less_error_handling - Attempt]
utility as an alternative to exception-based error handling. While gradually
applying this pattern, in particular for newly introduced interfaces, we
observed our code becoming more rigid and concrete, leaving no condition
unconsidered. Given this added assurance, we ultimately decided to remove
the reliance on C++ exceptions from the base framework over time. The current
release takes a huge leap in this direction.
:base/id_space.h:
A new 'Id_space::apply' overload takes a second functor 'missing_fn' as
argument, which is called whenever the lookup fails. It thereby allows the
use of the 'Id_space' utility without 'Unknown_id' exceptions.
:util/xml_node.h:
The two 'Xml_node::attribute' accessors have been removed along with the
'Nonexistent_attribute' exception. Attributes are generally accessed via the
'attribute_value' method, which handles the case via a default value.
:Core RPC interfaces:
Exceptions have been entirely removed from the RPC interfaces provided by
the core component, namely 'Trace', 'Pd', 'Cpu', 'Rm', and 'Region_map'.
While touching these interfaces, we took the opportunity for modernization
and consolidation of both the interfaces and their implementations. E.g.,
core's trace service received a welcome facelift, e.g., the former use of
basic types got replaced by dedicated types.
The revised 'Region_map' interface uses an 'Attr' compound struct for
specifying arguments to the 'attach' operation, which makes the intent of
client code more obvious. The operation returns a 'Range' instead of a
'Local_addr' now. The 'Region_map::State' type got renamed to 'Fault'.
:base/child.h:
The 'Child_policy::Nonexistent_id_space' exception has been removed by
making the 'server_id_space' mandatory for each policy. The former
'Child::Process' and 'Child::Process::Loaded_executable' classes got
replaced by class functions that return failure conditions as return
values, eliminating the use of C++ exceptions by the child framework.
The overall ambition of cutting back the use of C++ exceptions is not limited
to the base framework but can be observed for critical components as well.
In particular, the NIC router received a profound rework in this respect.
Cultivation of C++20 programming style
======================================
[https://genode.org/documentation/release-notes/23.05#New_tool_chain_based_on_GCC_12.3__C__20_enabled_by_default - One year ago],
we enabled C++20 as default. With the current release, we took the chance to
update the codebase according to this version of the standard.
:C++20 function template syntax:
The 'auto' keyword can be used in many places where template arguments had
to be declared manually. We updated all sources of the base framework
accordingly.
:Using 'using' instead of 'typedef':
C-style type aliases are no longer used within the framework.
:util/geometry.h:
The header has been moved from the os repository to the base repository.
'Point', 'Area', and 'Rect' have been turned into plain compound types,
making 'x', 'y', 'w', 'h', 'at', and 'area' accessible without a method
call. 'Rect' is now represented as a tuple of 'Point' and 'Area', which is
the most common form of initialization. The companion utilities have been
updated ('constexpr', eliminating out parameters) as well.
:util/color.h:
The 'Color' type has been converted from a class to a POD type by replacing
the constructors by the named create functions 'rgb', 'clamped_rgb', and
'clamped_rgba'. This enables the initialization of color values using the
'{ .r = ... }' syntax and makes the type usable in const expressions. The
change also narrows the type for the color components and alpha values to
'uint8_t'. So possible integer overflows of computed values are detected
by '-Wconversion'.
Tightened GUI-session interface
===============================
On our [https://genode.org/about/road-map - road map], we anticipated
intensive work on user-facing topics, many being related to graphical user
interfaces. While approaching these topics, we sensed that the clean
implementation of our ideas would benefit from a revisit of the framework's
existing GUI infrastructure, in particular the GUI-session interface as
provided by the nitpicker GUI server and the window manager. Note that we
barely touched this corner of the framework in the past ten years since
version
[https://genode.org/documentation/release-notes/14.08#New_GUI_architecture - 14.08].
The changes are as follows.
* The 'Gui::Session::session_control' RPC function got removed because its
functionality has long been superseded by the window manager and layouter.
* The interfaces and components received a thorough coding-style update,
embracing C++20, avoiding plain pointers, using 'Attr' structs for passing
attributes, removing the notion of invalid handles/IDs, replacing basic
types by dedicated types, and removing the use of C++ exceptions.
* The out-of-RAM and out-of-caps conditions are now consistently handled by
the 'Gui::Connection', which does no longer inherit the 'Gui::Session'
interface and can thereby introduce tailored result types.
* The creation of top-level views and child views are now two distinct
operations ('view' and 'child_view').
* The access of the subsumed framebuffer and input interfaces is now
mediated by the plain public members 'Connection::framebuffer' and 'input'.
This simplifies the client-side code. E.g., '_gui.input()->pending()'
becomes '_gui.input.pending()'.
* Corner cases of view-stacking operations are now expressed as dedicated
commands. The new stacking commands are FRONT, BACK, FRONT_OF, and BEHIND_OF.
* View handles are managed as 'Id_space' and hence named view IDs now. The
allocation of view IDs has been moved from the server side to the client,
which gives clients more flexibility and reduces the surface of possible
error conditions between client and server. To ease the client-side ID
management, the 'Gui::Connection' hosts a 'view_ids' ID space for optional
use. E.g., the new 'Top_level_view' class uses this ID space for ID
allocation. This class accommodates the most typical use case of opening a
single window.
* The creation of new views accepts initial view attributes now, which
accommodate typical client use cases with less code.
_As a note of caution, this line of work will continue over the course of the_
_next release cycle. The GUI-related APIs of the framework are expected to_
_undergo further changes during that time._
Fostered consistency of naming
==============================
Within our code base, we are ardent about consistency. However, two relics
from the infancy of the project remained standing out like sore thumbs. First,
the '_drv' suffix of driver executables remained at odds with our established
[https://genode.org/documentation/developer-resources/conventions - style]
of naming things without artificial abbreviations. Second, the plural naming
of the _<repo>/src/drivers/_ directory nagged us by being inconsistent with
the sibling directories _test/_, _app/_, _server/_. The current release
rectifies both inconsistencies. The '_drv' suffix has been dropped and the
directory has been renamed to _driver/_.
Device drivers
##############
Linux device-driver environment (DDE)
=====================================
We last adapted Linux DDE for kernel 6.1 in May/August 2023. According to
our plan of approximately one update per year, it was time to roll up our
sleeves for the adaption to Linux 6.6 LTS and ready our driver base for
future (especially PC) platforms. With this release, we limited our efforts
to the emulation library itself as well as virt_linux and pc_linux driver
ports.
Thus, from now on, PC platforms use Linux driver sources of kernel version
6.6.47 for USB host controllers and devices, Wifi and Ethernet adapters,
Intel display, lxip TCP/IP protocols, and wireguard. Non-x86 platforms were
updated for USB devices and network protocols only, but will be adapted in
future releases step-by-step. All drivers work as drop-in-replacements of
older versions with respect to integration and configuration.
Our Wifi driver port got amended by an online quality update concerning the
currently established connection, which can be enabled by the configuration
attribute 'update_quality_interval'. With this feature, user interfaces are
enabled to reflect connection-quality changes almost instantly. Additionally,
we added support for Intel AX200/9560 wireless adapters and restored support
for Wifi devices found in Thinkpad T430 notebooks.
During this release cycle, we analyzed a noticeable network throughput drop
resp. CPU load increase when using the
[https://github.com/genodelabs/genode/issues/5151 - PC Ethernet driver].
We eventually traced the effect to runtime overhead originating from our DDE
memory allocator. The positive impact of a simple allocation-cache
implementation confirmed our suspicion veritable. Hence, we replaced our
custom allocator by the Linux kernel-internal SLUB allocator that is based
on page/folio allocation. The folio API is well hidden in the kernel
internals, still in flux, and offers only incomplete (resp. outdated)
documentation, which required quite a bit of research efforts reading and
understanding the kernel's implementation.
In the end, we improved our emulation implementation sufficiently and managed
to get the PC NIC driver to work robustly with gigabit performance and with
CPU load reduced by 25-40% on Intel Kaby/Tiger Lake notebooks.
Platform driver
===============
During ACPI suspend, the PCI bridges in the system may forget their PCI
configuration. Hence on resume, this configuration needs to be restored to
render all PCI devices behind the bridge usable again. With this release, we
added support to the pci_decode component to report all relevant information,
which is then picked up by the platform driver after an ACPI resume to
re-configure the used PCI bridges. This change enables the successful
restart of the Wifi driver after resume on many platforms.
Improvements for NXP's i.MX family
==================================
The current release comprises a lot of updates and additional support for the
i.MX family of devices.
First of all, we have updated all existent Linux driver ports to Linux kernel
version 6.1.20. In detail, drivers for the Freescale Ethernet Device (FEC) for
ARMv7 and ARMv8, the display management for the i.MX 8M Quad EVK and the MNT
Reform 2, as well as the SD-card Host Controller for the same two boards got
refreshed.
Alice Domage of Gapfruit AG contributed outstanding work to enable platform
support for the i.MX 8M Plus SoC and Compulab's IOT Gateway, which is based on
it. Besides clock, powering, and reset support by a platform driver specific
to this SoC, support is now available for both Ethernet cards (FEC and ST
Microelectronics' STMMAC), SD-card host controller, I2C, and GPIO.
Genode's custom kernel supports two more boards now, namely the F&S Embedded
armStone Starterkit and MNT Pocket Reform. Both are using the i.MX 8M Plus SoC
mentioned above. The support is currently limited to the very basics, and no
peripherals apart from CPU and timer are integrated yet.
For the fine-grained control of GPIO pins, release
[https://genode.org/documentation/release-notes/21.11#Pin_I_O_session_interfaces - 21.11],
introduced the pin I/O session interfaces, superseding the older 'Gpio'
session interface. So far, however, our driver for the GPIO controller as
present on all i.MX SoC's merely supported the old interface. With this
release, we introduce a pin driver implementing the favored pin I/O session
interface instead. All occurrences in packages and run-scripts under Genode's
umbrella use the new driver now, which can be found under _src/driver/pin/imx_
within the genode-imx repository. The old driver and the 'Gpio' session
interface are still existent. But now, as there is no hard dependency or
necessity for it anymore, we mark the old driver as well as the 'Gpio' session
interface as deprecated.
Finally, we moved all remaining i.MX specific parts out of Genode's main
repository into the [https://github.com/genodelabs/genode-imx - genode-imx]
repository to be consistent with our recent approach of vendor-specific
external repositories.
Libraries and applications
##########################
Qt6 application framework
=========================
With this release, we started updating the Qt application framework from Qt5
to Qt6 by adding an initial port of Qt 6.6.2, covering the _qtbase_,
_qtdeclarative_, _qtshadertools_, and _qtsvg_ modules. We are planning to
support the _qtwebengine_ module as well in the near future, which will remove
the dependency from Python 2 and provide us with a more recent Chromium engine
for the Falkon and Morph web browsers.
We also improved the Qt build process for both Qt6 and Qt5 by making sure that
Qt libraries are only built when needed and stub libraries generated from
symbol files are used otherwise.
The Qt6 port uses updated host tools, which need to be built with the
_tool/tool_chain_qt6_ script. Please note that Qt6 requires CMake version 3.19
or higher to build successfully.
Mesa version 24.0.8
===================
With release
[https://genode.org/documentation/release-notes/24.05#Mesa_updated_to_version_24.0.1 - 24.05],
we updated Mesa to major version 24. During the past few months, we improved
the memory allocation and synchronization for Intel's Iris driver and as a
side effect updated Mesa to version 24.0.8.
Platforms
#########
Execution on bare hardware (base-hw)
====================================
Under the hood of Genode's custom kernel, the way how CPU-local memory is
arranged changed fundamentally. The kernel's virtual memory layout now
comprises a CPU area. Each CPU has its own slot within this area, containing
kernel stack, CPU object data resp. all CPU-local data. This change is
transparent to most Genode developers. It was motivated to ease CPU detection
and bootstrapping at run time, for kernel stack overflow detection, and for
increasing the kernel's flexibility regarding multi-core hardware.
NOVA microhypervisor
====================
The kernel received support to handle the x86 CPU FPU extension
[https://de.wikipedia.org/wiki/Advanced_Vector_Extensions - AVX], which is a
family of SIMD instruction extensions used for optimized implementations of
mathematical algorithms, e.g., it is used in multimedia applications. In
principle, the kernel has to detect the available AVX versions, e.g., AVX,
AVX-2, AVX-512. Depending on the version, it has to save and restore
additional FPU state during thread switching. Besides the general
availability to Genode applications, the Seoul VMM has become the first user
of the feature. The VMM now announces the AVX feature to the guest VMs, so
that the guest kernel can enable it and guest user applications can utilize
it, e.g., for web browser and video encoding/decoding use-cases. The feature
got tested with the Seoul VMM on Intel and AMD systems.
Additionally, we adapted the core component to support Intel SoCs with E-Core
only CPUs, which were formerly named Intel Atom and are nowadays branded as
Intel N-Series CPUs.
Finally, the NOVA kernel now supports the freeing of vCPU related data
structures during VM destruction, got optimized to reduce resource overhead
during cross CPU IPC and improved VM MSR exit handling.
Build system and tools
######################
Improved reproducibility
========================
The demand for reproducible builds has been increasing during the past few
years. The main hindrance that makes builds unreproducible are timestamps. On
Genode, especially components that produce TAR files suffered from this
limitation, since the date of the archived data was set to the time of
archiving. To avoid this issue, we introduced a customizable global TAR_OPT in
Genode's build system that sets the date of the archived files to the date of
the epoch and the user/group to one. As a starting point, we added the TAR_OPT
to the Qt-build process while other targets will incrementally follow.
Additionally, we enabled our Rump-kernel port to be reproducible.
Goa SDK
=======
Debugging
~~~~~~~~~
After the addition of on-target debugging on Sculpt OS in
[https://genode.org/documentation/release-notes/24.05#On-target_debugging_using_the_GNU_debugger__GDB_ - Genode 24.05],
it was about time to equip [https://github.com/genodelabs/goa - Goa] with
debugging support as well. For this purpose, the tool received an optional
'--debug' command-line switch, which instructs Goa to consider
[https://genode.org/documentation/release-notes/23.11#Debug_information_for_depot_binaries - dbg archives]
in its download, export and publish steps.
When provided with this switch on 'goa run', the tool also creates a
_<project-name>.gdb_ file in the project's _var/_ directory. This file contains
initialization commands for the GNU debugger (GDB) and can be passed to GDB
via the '--command' argument.
[image goa_gdb_sculpt]
The _Goa testbed_ package and preset have been updated accordingly to make use
of our debug monitor. The figure illustrates how Goa interoperates with the
Goa testbed. Sculpt's default NIC router configuration now comprises an
additional _gdb_ domain that is intended to accommodate a single client to
which the router forwards port 9999 of the _uplink_ domain. This is intended
for making the testbed's debug monitor available as a remote GDB target. Note
that these changes will become effective with the next Sculpt release in
October. In the meantime, you may cherry-pick the
[https://github.com/genodelabs/genode/commit/aeb42b0983143e6fe0a01f7f5316612709da1a9d - corresponding commit].
Along with debugging support, Goa also received a '--with-backtrace' switch and
a 'backtrace' command. The former instructs the tool to preserve frame-pointer
information by supplying the '-fno-omit-frame-pointer' flag to GCC. The
'goa backtrace' command is a shortcut for 'goa run --debug --with-backtrace'
that additionally passes the log output to our
[https://genode.org/documentation/release-notes/24.02#Convenient_parsing_of_backtraces - backtrace tool].
For detailed instructions, please refer to the corresponding
[https://genodians.org/jschlatow/2024-07-31-goa-gdb - Genodians article].
Meson build system
~~~~~~~~~~~~~~~~~~
Projects like Qemu, glib, and Mesa have switched to the Python-based
[https://mesonbuild.com - Meson] build system. Mesa, for example, produces a
large number of generated C/C++ files using Meson features. In order to ease
future porting effort of Meson-based projects to Genode, we have added basic
support for this build system to Goa.
A Meson project can be built and executed like any other Goa-supported build
system with the addition that there can be a _meson_args_ file (analogously to
_cmake_args_ for CMake) where additional arguments can be passed to the meson
command. Otherwise, Goa will look for a _meson.build_ file in the _src_
directory, which identifies the project's build system as Meson.
As a simple test, you can check out the _hello_meson_ example in the _examples_
directory of Goa.
At the current stage, only binary targets for the x86_64 architecture are
supported by Goa/Meson. Shared libraries and ARM support will be addressed
next.
Rust & Cargo
~~~~~~~~~~~~
From Rust 1.77 onward, the binary distribution of the _std_ library
('x86_64-unknown-freebsd') assumes that the underlying OS kernel supports
thread-local storage via the FS segment register on x86. As Genode does not
provide a TLS area via FS, TLS accesses by the library would end up in invalid
memory, which renders the binary version of the std library unusable on
Genode. In response, we have implemented a custom Genode target profile for
Rust, which allows us to still leverage the FreeBSD port of Rust's standard
library while using the _emulated_ TLS model. In order to compile the parts of
the std library used by an application for the custom profile, we have moved
to using a _nightly_ Rust tool chain. For detailed instructions for setting up
the tool chain, head over to the
[https://genodians.org/atopia/2024-08-27-building-rust-with-a-custom-profile - blog post]
at Genodians.org.

579
doc/release_notes/24-11.txt Normal file
View File

@@ -0,0 +1,579 @@
===============================================
Release notes for the Genode OS Framework 24.11
===============================================
Genode Labs
During the discussion of this year's road-map roughly one year ago, the
usability concerns of Sculpt OS stood out.
Besides suspend/resume, which we addressed
[https://genode.org/documentation/release-notes/24.05#Suspend_resume_infrastructure - earlier this year],
multi-monitor support ranked highest on the list of desires. We are more than
happy to wrap up the year with the realization of this feature.
Section [Multi-monitor support] presents the many facets and outcomes of this
intensive line of work.
Over the course of 2024, our Goa SDK has received tremendous advances, which
make the development, porting, debugging, and publishing of software for
Genode - and Sculpt OS in particular - a breeze.
So far however, the learning curve for getting started remained rather steep
because the underlying concepts largely deviate from the beaten tracks known
from traditional operating systems. Even though there is plenty of
documentation, it is rather scattered and overwhelming.
All the more happy we are to announce that the current release is accompanied
by a new book "Genode Applications" that can be downloaded for free and
provides a smooth gateway for application developers into the world of Genode
(Section [New "Genode Applications" book]).
Regarding hardware-related technical topics, the release focuses on the
ARM-based i.MX SoC family, taking our ambition to run Sculpt OS on the MNT
Pocket Reform laptop as guiding theme. Section [Device drivers and platforms]
covers our driver and platform-related work in detail.
New "Genode Applications" book
##############################
Complementary to our _Genode Foundations_ and _Genode Platforms_ books, we have
been working on a new book that concentrates on application development.
_Genode Applications_ centers on the Goa SDK that we introduced with
[https://genode.org/documentation/release-notes/19.11#New_tooling_for_bridging_existing_build_systems_with_Genode - Genode 19.11]
and which has seen significant improvements over the past year
([https://genode.org/documentation/release-notes/23.08#Goa_tool_gets_usability_improvements_and_depot-index_publishing_support - 23.08],
[https://genode.org/documentation/release-notes/24.02#Sculpt_OS_as_remote_test_target_for_the_Goa_SDK - 24.02],
[https://genode.org/documentation/release-notes/24.08#Goa_SDK - 24.08]).
: <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-applications-title.png">
: </a>
: </div>
: </p>
The book intends to provide a beginner-friendly starting point for application
development and porting for Genode and Sculpt OS in particular. It starts off
with a getting-started tutorial for the Goa tool, and further recapitulates
Genode's architecture and a subset of its libraries, components, and
conventions such as the C runtime, VFS, NIC router, and package management.
With these essentials in place, the book is topped off with instructions for
application debugging and a collection of advanced tutorials.
Aligned with the release of Sculpt 24.10, we updated the Goa tool with the
corresponding depot archive versions. Furthermore, the Sculpt-integrated and
updated _Goa testbed_ preset is now prepared for remote debugging.
: <div class="visualClear"><!-- --></div>
:First revision of the Genode Applications document:
[https://genode.org/documentation/genode-applications-24-11.pdf]
Multi-monitor support
#####################
Among the users of the Genode-based Sculpt OS, the flexible use of multiple
monitors was certainly the most longed-after desire raised during our public
road-map discussion roughly one year ago. We quickly identified that a
profound solution cannot focus on piecemeal extensions of individual
components but must embrace an architectural step forward. The step turned
out being quite a leap.
In fact, besides reconsidering the roles of display and input drivers in
[https://genode.org/documentation/release-notes/20.08#The_GUI_stack__restacked - version 20.08],
the GUI stack has remained largely unchanged since
[https://genode.org/documentation/release-notes/14.08#New_GUI_architecture - version 14.08].
So we took our multi-monitor ambitions as welcome opportunity to incorporate
our experiences of the past ten years into a new design for the next ten
years.
Tickless GUI server and display drivers
=======================================
Up to now, the nitpicker GUI server as well as the display drivers used to
operate in a strictly periodic fashion. At a rate of 10 milliseconds, the GUI
server would route input events to the designated GUI clients and flush
graphical changes of the GUI clients to the display driver.
This simple mode of execution has benefits such as the natural ability of
batching input events and the robustness of the GUI server against overload
situations. However, in Sculpt OS, we observed that the fixed rate induces
little but constant load into an otherwise idle system, rendering
energy-saving regimes of modern CPUs less effective than they could be.
This problem would become amplified in the presence of multiple output channels
operating at independent frame rates. Moreover, with panel self-refresh
support of recent Intel graphics devices, the notion of a fixed continuous
frame rate has become antiquated.
Hence, it was time to move to a tickless GUI-server design where the GUI
server acts as a mere broker between events triggered by applications (e.g.,
pushing pixels) and drivers (e.g., occurrence of input, scanout to a display).
Depending on the behavior of its clients (GUI applications and drivers alike),
the GUI server notifies the affected parties about events of interest but
does not assert an active role.
For example, if a display driver does not observe any changed pixels for 50
ms, it goes to sleep. Once an application updates pixels affecting a display,
the GUI server wakes up the respective display driver, which then polls the
pixels at a driver-defined frame rate until observing when the pixels remain
static for 50 ms. Vice versa, the point in time when a display driver requests
updated pixels is reflected as a sync event to GUI applications visible on
that display, enabling such applications to synchronize their output to the
frame rate of the driver. The GUI server thereby asserts the role of steering
the sleep cycles of drivers and applications. Unless anything happens on
screen, neither the GUI server nor the display driver are active. When two
applications are visible on distinct monitors, the change of one application
does not induce any activity regarding the unrelated display. This allows for
scaling up the number of monitors without increasing the idle CPU load.
This change implies that the former practice of using sync signals as a
time source for application-side animation timing is no longer viable.
Sync signals occur only when a driver is active after all. GUI applications
may best use sync signals for redraw scheduling but need to use a real time
source as basis for calculating the progress of animations.
Paving the ground for tearing-free motion
=========================================
Tearing artifacts during animations are rightfully frowned upon. It goes
without saying that we strive to attain tearing-free motion in Genode. Two
preconditions must be met. First, the GUI server must be able to get hold
of a _consistent_ picture at any time. Second, the flushing of the picture
to the display hardware must be timed with _vsync_ of the physical display.
Up to now, the GUI stack was unable to meet the first precondition by design.
If the picture is composed of multiple clients, the visual representation of
each client must be present in a consistent state.
The textures used as input of the compositing of the final picture are buffers
shared between server and client. Even though clients traditionally employ
double-buffering to hide intermediate drawing states, the final back-to-front
copy into the shared buffer violated the consistency of the buffer during
the client-side copy operation - when looking at the buffer from the server
side. To overcome this deficiency, we have now equipped the GUI server with
atomic blitting and panning operations, which support atomic updates in two
fashions.
_Atomic back-to-front blitting_ allows GUI clients that partially update their
user interface - like regular application dialogs - to implement double
buffering by placing both the back buffer and front buffer within the GUI
session's shared buffer and configuring a view that shows only the front
buffer. The new blit operation ('Framebuffer::Session::blit') allows the client
to atomically flush pixels from the back buffer to the front buffer.
_Atomic buffer flipping_ allows GUI clients that always update all pixels -
like a media player or a game - to leverage panning
('Framebuffer::Session::panning') to atomically redirect the displayed pixels to
a different portion of the GUI session's shared buffer without any copy
operation needed. The buffer contains two frames, the displayed one and the
next one. Once the next frame is complete, the client changes the panning
position to the portion containing the next frame.
Almost all GUI clients of the Genode OS framework have been updated to use
these new facilities.
The vsync timing as the second precondition for tearing-free motion lies in
the hands of the display driver, which can in principle capture pixel updates
from the GUI server driven by vsync interrupts. In the presence of multiple
monitors with different vsync rates, a GUI client may deliberately select
a synchronization source ('Framebuffer::Session::sync_source'). That said,
even though the interfaces are in place, vsync timing is not yet provided by
the current display drivers.
Mirrored and panoramic monitor setups
=====================================
A display driver interacts with the nitpicker GUI server as a capture client.
One can think of a display driver as a screen-capturing application.
Up until now, the nitpicker GUI server handed out the same picture to each
capture client. So each client obtained a mirror of the same picture. By
subjecting each client to a policy defining a window within a larger panorama,
a driver creating one capture session per monitor becomes able to display the
larger panorama spanning the connected displays. The assignment of capture
clients to different parts of the panorama follows Genode's established
label-based policy-selection approach as explained in the
[https://github.com/genodelabs/genode/blob/master/repos/os/src/server/nitpicker/README - documentation]
of the nitpicker GUI server.
Special care has been taken to ensure that the pointer is always visible. It
cannot be moved to any area that is not captured. Should the only capture
client displaying the pointer disappear, the pointer is warped to the center
of (any) remaining capture client.
A mirrored monitor setup can in principle be attained by placing multiple
capture clients at the same part of nitpicker's panorama. However, there is
a better way: Our Intel display-driver component supports both discrete and
merged output channels. The driver's configuration subsumes all connectors
listed within a '<merge>' node as a single encompassing capture session at the
GUI server. The mirroring of the picture is done by the hardware. Each
connector declared outside the '<merge>' node is handled as a discrete capture
session labeled after the corresponding connector. The driver's
[https://github.com/genodelabs/genode/blob/master/repos/pc/src/driver/framebuffer/intel/pc/README - documentation]
describes the configuration in detail.
Sculpt OS integration
=====================
All the changes described above are featured in the recently released
Sculpt OS version 24.10, which gives the user the ability to attain mirrored
or panoramic monitor setups or a combination thereof by the means of manual
configuration or by using interactive controls.
[image sculpt_24_10_intel_fb]
You can find the multi-monitor use of Sculpt OS covered by the
[https://genode.org/documentation/articles/sculpt-24-10#Multi-monitor_support - documentation].
Revised inter-component interfaces
==================================
Strict resource partitioning between GUI clients
------------------------------------------------
Even though Genode gives server components the opportunity to strictly operate
on client-provided resources only, the two prominent GUI servers - nitpicker
and the window manager (wm) - did not leverage these mechanisms to full
extent. In particular the wm eschewed strict resource accounting by paying out
of its own pocket. This deficiency has been rectified by the current release,
thereby making the GUI stack much more robust against potential resource
denial-of-service issues. Both the nitpicker GUI server and the window manager
now account all allocations to the resource budgets of the respective clients.
This change has the effect that GUI clients must now be equipped with the
actual cap and RAM quotas needed.
Note that not all central parts of the GUI stack operate on client-provided
resources. In particular, a window decorator is a mere client of the window
manager despite playing a role transcending multiple applications. As the
costs needed for the decorations depend on the number of applications present
on screen, the resources of the decorator must be dimensioned with a sensible
upper bound. Fortunately, however, as the decorator is a plain client of the
window manager, it can be restarted, replaced, and upgraded without affecting
any application.
Structured mode information for applications
--------------------------------------------
Up to now, GUI clients were able to request mode information via a plain
RPC call that returned the dimensions and color depth of the display.
Multi-monitor setups call for more flexibility, which prompted us to
replace the mode information by XML-structured information delivered as
an 'info' dataspace. This is in line with how meta information is handled
in other modern session interfaces like the platform or USB sessions.
The new representation gives us room to annotate information that could
previously not be exposed to GUI clients, in particular:
* The total panorama dimensions.
* Captured areas within the panorama, which can be used by multi-monitor
aware GUI clients as intelligence for placing GUI views.
* DPI information carried by 'width_mm' and 'height_mm' attributes.
This information is defined by the display driver and passed to the GUI
server as 'Capture::Connection::buffer' argument.
* The closed state of a window interactively closed by the user.
Note that the window manager (wm) virtualizes the information of the nitpicker
GUI server. Instead of exposing nitpicker's panorama to its clients, the wm
reports the logical screen hosting the client's window as panorama and the
window size as a single captured rectangle within the panorama.
Mouse grabbing
--------------
Since the inception of the nitpicker GUI server, its clients observed absolute
pointer positions only. The GUI server unconditionally translated relative
mouse-motion events to absolute motion events.
To accommodate applications like games or a VM emulating a relative pointer
device, we have now extended the GUI server(s) with the ability to selectively
expose relative motion events while locking the absolute pointer position.
This is usually called pointer grabbing. It goes without saying that the user
must always retain a way to forcefully reassert control over the pointer
without the cooperation of the application.
The solution is the enhancement of the 'Input::Session' interface by a new RPC
function that allows a client to request exclusive input. The nitpicker GUI
server grants this request if the application owns the focus. In scenarios
using the window manager (wm), the focus is always defined by the wm, which
happens to intercept all input sessions of GUI applications. Hence, the wm is
in the natural position of arbitrating the grabbing/ungrabbing of the pointer.
For each GUI client, the wm records whether the client is interested in
exclusive input but does not forward this request to nitpicker. Only if a GUI
client receives the focus and has requested exclusive input, the wm enables
exclusive input for this client at nitpicker when observing a mouse click on
the application window. Whenever the user presses the global wm key (super),
the wm forcefully releases the exclusive input at nitpicker until the user
clicks into the client window the next time.
Furthermore, an application may enable exclusive input transiently during a
key sequence, e.g., when dragging the mouse while holding the mouse button.
Transient exclusive input is revoked as soon as the last button/key is
released. It thereby would in principle allow for GUI controls like knobs to
lock the pointer position while the user adjusts the value by moving the mouse
while the mouse button is held. So the pointer retains its original position
at the knob.
While operating in exclusive input mode, there is no useful notion of an
absolute pointer position at the nitpicker GUI server. Hence, nitpicker hides
GUI domains that use the pointer position as coordinate origin. Thereby, the
mouse cursor automatically disappears while the pointer is grabbed.
Current state and ongoing work
==============================
All the advances described above are in full effect in the recently released
version 24.10 of [https://genode.org/download/sculpt - Sculpt OS]. All
components hosted in Genode's main and world repositories have been updated
accordingly, including Genode-specific components like the widget toolkit
used by the administrative user interface of Sculpt OS, window decorators,
over Qt5 and Qt6, to SDL and SDL2.
[image multiple_monitors]
Current work is underway to implement multi-monitor window management and to
make multiple monitors seamlessly available to guest OSes hosted in VirtualBox.
Furthermore, the Intel display driver is currently getting equipped with the
ability to use vsync interrupts for driving the interaction with the GUI
server, taking the final step to attain tearing-free motion.
Device drivers and platforms
############################
Linux device-driver environment (DDE)
=====================================
With our
[https://genode.org/documentation/release-notes/24.08#Linux_device-driver_environment__DDE_ - recent]
update of the DDE Linux kernel to version 6.6 for PC platforms and as a
prerequisite to support the MNT Pocket Reform, we have adapted all drivers for
the i.MX5/6/7/8 platforms to Linux kernel version 6.6.47. The list of drivers
includes Wifi, NIC, display, GPU, USB and SD-card.
MNT Pocket Reform
~~~~~~~~~~~~~~~~~
The [https://shop.mntre.com/products/mnt-pocket-reform - MNT Pocket Reform] is
a Mini Laptop by MNT aiming to be modular, upgradable, and repairable while
being assembled completely using open-source hardware. Being modular implies
that a range of CPU modules is available for the MNT Pocket. Some of these
chips, like the Rockchip based modules, are not officially supported by
Genode, yet. But there is a choice of an i.MX8MP based module available which
fits nicely into Genode's i.MX infrastructure.
Genode already supports the MNT Reform 2 i.MX8MQ based
[https://genodians.org/skalk/2020-06-29-mnt-reform - laptop]. So an update from
MQ to MP doesn't sound like a big issue because only one letter changed,
right? It turns out that there are more changes to the platform than mere
adjustments of I/O resources and interrupt numbers. Additionally, the MNT
Reform team offers quite a large patch set for each supported Linux kernel
version. Luckily there is
[https://source.mnt.re/reform/reform-debian-packages/-/tree/main/linux/patches6.6?ref_type=heads - one]
for our just updated Linux 6.6 kernel. With this patch set, we were able to
produce a Linux source tree (imx_linux) that we now take as basis for driver
development on Genode. Note that these Linux kernel sources are shared by all
supported i.MX platforms. Of course, additional patch series were necessary to
include device-tree sources from other vendor kernels, for instance from
Compulab.
With the development environment in place and after putting lots of effort in,
we ultimately achieved initial Genode support for the MNT Pocket Reform with
Genode 24.11.
On the device-driver side of things, we did not have to port lots of new
drivers but were able to extend drivers already available for the i.MX8MQ
platform. In particular these drivers are for the wired network card, USB host
controller, display, and SD card.
For the wireless network device that is found on the i.MX8MP SoM in the MNT
Pocket Reform, we needed to port a new driver. It has a Qualcomm QCA9377
chipset and is attached via SDIO. Unfortunately the available _ath10k_ driver
in the vanilla kernel does not work properly with such a device and therefore
is also not used in the regular Linux kernel for the MNT Pocket Reform. A
slightly adapted external QCACLD2 reference driver is used instead. So we
followed suit by incorporating this particular driver in our _imx_linux_
source tree as well.
[image sculpt_mnt_pocket]
Sculpt OS running on the MNT Pocket Reform
Being the initial enablement, there are still some limitations.
For example, the display of the MNT Pocket is physically
[https://mntre.com/documentation/pocket-reform-handbook.pdf - rotated] by 90
degrees. So, we had to find a way to accommodate for that. Unfortunately,
there seems to be no hardware support other than using the GPU to perform
a fast rotation. With GPU support still missing on this system, we had to
resort to perform the rotation in software on the CPU, which is obviously
far from optimal.
Those early inefficiencies notwithstanding, Sculpt OS has become able to run
on the MNT Pocket Reform. We will provide a preview image that exercises the
available features soon.
Platform driver for i.MX 8M Plus
================================
While enabling support for the MNT Pocket Reform (Section [MNT Pocket Reform]),
it was necessary to adjust the i.MX8MP specific platform driver, which was
originally introduced in the previous
[https://genode.org/documentation/release-notes/24.08#Improvements_for_NXP_s_i.MX_family - release 24.08]
to drive the Compulab i.MX 8M Plus IOT Gateway.
Some of the I/O pin configurations necessary to set up the SoC properly are
statically compiled into this driver because they do not change at runtime.
However, the pin configuration is specific to the actual board. Therefore, the
i.MX8MP platform driver now needs to distinguish between different boards (IOT
Gateway and MNT Pocket) by evaluating the 'platform_info' ROM provided by
core.
Moreover, while working on different drivers, we detected a few missing clocks
that were added to the platform driver. It turned out that some clocks that we
initially turned off to save energy, have to be enabled to ensure the
liveliness of the ARM Trusted Firmware (ATF) and thereby the platform. Also,
we had to adapt the communication in between ATF and our platform driver to
control power-domains. The first version of the i.MX8MP platform driver shared
the ATF power-domains protocol with the i.MX8MQ version. However, the
power-domain enumerations of the different firmwares varies also and we
adapted that.
Finally, the watchdog hardware is now served by the platform driver in a
recurrent way. Originally our driver used the watchdog only to implement reset
functionality. But in case of the MNT Pocket Reform, the watchdog hardware is
already armed by the bootloader. Therefore, it needs to get served in time, to
prevent the system from rebooting. As a consequence, the platform driver is
mandatory on this platform if it needs to run longer than a minute.
Wifi management rework
======================
Our management interface in the wifi driver served us well over the years
and concealed the underlying complexity of the wireless stack. At the same
time it gained some complexity itself to satisfy a variety of use-cases.
Thus, we took the past release cycle as opportunity to rework the management
layer to reduce its complexity by streamlining the interaction between
various parts, like the manager layer itself, 'wpa_supplicant' as well as
the device driver in order to provide a sound foundation for future
adaptions.
Included is also an update of the 'wpa_supplicant' to version 2.11.
The following segments detail the changes made to the configuration options as
they were altered quite a bit to no longer mix different tasks (e.g. joining a
network and scanning for hidden networks) while removing obsolete options.
At the top-level '<wifi_config>' node, the following alterations were made:
* The 'log_level' attribute was added and configures the supplicant's
verbosity. Valid values correspond to levels used by the supplicant
and are as follows: 'excessive', 'msgdump', 'debug', 'info', 'warning',
and 'error'. The default value is 'error' and configures the least
amount of verbosity. This option was introduced to ease the investigation
of connectivity issues.
* The 'bgscan' attribute may be used to configure the way the
supplicant performs background-scanning to steer or rather optimize
roaming decision within the same network. The default value is set
to 'simple:30:-70:600'. The attribute is forwarded unmodified to the WPA
supplicant and thus provides the syntax supported by the supplicant
implementation. It can be disabled by specifying an empty value, e.g.
'bgscan=""'.
* The 'connected_scan_interval' attribute was removed as this functionality
is now covered by background scanning.
* The 'verbose_state' attribute was removed altogether and similar
functionality is now covered by the 'verbose' attribute.
The network management received the following changes:
* Every configured network, denoted by a '<network>' node, is now implicitly
considered an option for joining. The 'auto_connect' attribute was
removed and a '<network>' node must be renamed or removed to deactivate
automatic connection establishment.
* The intent to scan for a hidden network is now managed by the newly
introduced '<explicit_scan>' node that like the '<network>' node has
an 'ssid' attribute. If the specified SSID is valid, it is incorporated
into the scan request to actively probe for this network. As the node
requests explicit scanning only, a corresponding '<network>' node is
required to actually connect to the hidden network.
The 'explicit_scan' attribute of the '<network>' node has been removed.
The following exemplary configuration shows how to configure the driver
for attempting to join two different networks where one of them is hidden.
The initial scan interval is set 10 seconds and the signal quality will be
updated every 30 seconds while connected to a network.
!<wifi_config scan_interval="10" update_quality_interval="30">
! <explicit_scan ssid="Skynet"/>
! <network ssid="Zero" protection="WPA2" passphrase="allyourbase"/>
! <network ssid="Skynet" protection="WPA3" passphrase="illbeback"/>
!</wifi_config>
For more information please consult the driver's
[https://github.com/genodelabs/genode/blob/master/repos/dde_linux/src/driver/wifi/README - documentation]
that now features a best-practices section explaining how the driver should be
operated at best, and highlights the difference between a managed (as used in
Sculpt OS) and a user-generated configuration.
Audio driver updated to OpenBSD 7.6
===================================
With this release, we updated our OpenBSD-based audio driver to a more recent
revision that correlates to version 7.6. It supports newer devices, e.g. Alder
Lake-N, and includes a fix for using message-signaled interrupts (MSI) with
HDA devices as found in AMD-based systems.
AVX and hardware-based AES in virtual machines
==============================================
The current release adds support for requesting and transferring the AVX FPU
state via Genode's VM-session interface. With this prerequisite fulfilled, we
enabled the announcement of the AVX feature to guest VMs in our port of
VirtualBox6.
Additionally, we enabled the announcement of AES and RDRAND CPU features to
guest VMs to further improve the utilization of the hardware.
Build system and tools
######################
Extended depot-tool safeguards
------------------------------
When using the run tool's '--depot-auto-update' feature while switching
between different git topic branches with committed recipe hashes, a binary
archive present in the depot may accidentally not match its ingredients
because the depot/build tool's 'REBUILD=' mode - as used by the depot
auto-update mechanism - merely looks at the archive versions. This situation
is arguably rare. But when it occurs, its reach and effects are hard to
predict. To rule out this corner case early, the depot/build tool has now been
extended by recording the hashes of the ingredients of binary archives. When
skipping a rebuild because the desired version presumably already exists as a
binary archive, the recorded hashes are compared to the current state of the
ingredients (src and api archives). Thereby inconsistencies are promptly
reported to the user.
Users of the depot tool will notice .hash files appearing alongside src and
api archives. Those files contain the hash value of the content of the
respective archive. Each binary archive built is now also accompanied by
a .hash file, which contains a list of hash values of the ingredients that went
into the binary archive. Thanks to these .hash files, the consistency between
binaries and their ingredients can be checked quickly.
_As a note of caution, when switching to the Genode 24.11 with existing depot,_
_one will possibly need to remove existing depot archives (as listed by the_
_diagnostic messages) because the existing archives are not accompanied by_
_.hash files yet._

View File

@@ -14,128 +14,173 @@ The road map is not fixed. If there is commercial interest of pushing the
Genode technology to a certain direction, we are willing to revisit our plans.
Review of 2021
Review of 2023
##############
Genode's year 2021 was defined by three extremely challenging lines of work.
The overarching theme of the road map in 2023 was the conquering of advanced
platform aspects beyond mere functionality, speaking of temperature sensing,
frequency control, battery monitoring, power management, and suspend/resume.
We aimed at "Rocking the platforms we support!".
The achievements made are best illustrated by the example of the Gen12
Framework laptop. At the beginning of 2023, Sculpt OS was in principle working
on this hardware, but with compromises that spoiled the user experience: fan
noise, an erratic touchpad (using the firmware's PS/2 emulation), Fn key
having no effect, strange issues when re-plugging an external display, and no
indication of the battery state. By the end of 2023, not only were all these
[https://genodians.org/nfeske/2023-11-03-sculpt-os#Framework_laptop - rough edges gone]
but we even gained the ability to exercise
[https://genode.org/documentation/release-notes/23.11#PC_power__frequency__temperature_sensing_and_control - precise control]
over the machine's performance/frequency/temperature/power characteristics
using an interactive GUI. It is fair to say that Genode advanced beyond the
state of "working" and has entered the territory of "rocking". That said, not
all lines of platform work such as suspend/resume are wrapped up yet.
First, we conquered the territory of GPU support that was ridden with
uncertainties and seemed almost impenetrable when we started. But at the end
of the year, our custom Intel-GPU multiplexer has landed in Sculpt OS like it
always belonged there. In tandem with the Intel-GPU work, we explored the
Vivante GPU as a representative of an ARM platform. The work required a deep
dive into the respective GPU architectures and the Mesa software stack. It
eventually led us to the design of Genode's device-agnostic GPU interfaces.
Besides PC hardware, we put much emphasis on the PinePhone as a reference device
for Genode on the phone. As one highlight of 2023, we got the
[https://genodians.org/nfeske/2023-05-11-sculpt-os#Mobile_Sculpt_OS_on_the_PinePhone - mobile version of Sculpt OS]
into the hands of a pilot group of users who provided instructive
feedback to us. The system-update mechanism that Sculpt OS gained in April has
been a game changer for such scenarios as it reduces the effort and risk of
test-driving experimental versions to almost zero.
The second line of work was concerned with the reuse of Linux drivers as
Genode components. Over the year, the puzzle pieces of our new Linux
device-driver environment come together, replacing former confusion and chaos
with knowledge and order, ultimately uncovering the treasure of Linux drivers
for Genode with very little friction. On the way, we created new methodology
and tooling, as well as extensive documentation in the form of the "Genode
Platforms" document. Thanks to the new drivers ported from the Linux kernel,
we were able to witness interactive Genode scenarios becoming alive on the
Pinephone by the end of the year.
At the beginning of 2023, we declared our ambition to run Sculpt OS on
Genode's custom (base-hw) microkernel as alternative to the time-tested NOVA
kernel. At that time, two showstoppers remained, namely
[https://genode.org/documentation/release-notes/23.11#Kernel-agnostic_DMA_protection - DMA protection] and
[https://genode.org/documentation/release-notes/23.11#Modernized_virtualization_interface - virtualization]
support. Both of these deeply technical topics got covered over
the course of the year. Refinements, optimizations, and real-world testing
notwithstanding, we are happy to be well on track towards our goal.
The third major topic was the growing sophistication of Genode-native
workloads, with the media features of the Chromium-based browser on 64-bit ARM
being the most impressive example. Apart from the apparent functional benefits
for Genode and Sculpt OS, this is the long outstanding validation of some bold
design decisions we took years ago, in particular the role and architecture of
the VFS and its interplay with the libc.
When reviewing the road map for 2021, some items remained uncovered. In
particular the seL4-related topics became stale. At the end of 2020 - when we
assembled the road map for the past year - there was a tangible prospect of
pursuing this topic as funded work. However, those plans were repeatedly
deferred and remained uncertain. Also, there are some items that have seen
healthy doses of progress - like the topics related to Ada/SPARK or Goa - but
received less attention than anticipated. On the other hand, the four releases
([https://genode.org/documentation/release-notes/21.02 - 21.02],
[https://genode.org/documentation/release-notes/21.05 - 21.05],
[https://genode.org/documentation/release-notes/21.08 - 21.08],
[https://genode.org/documentation/release-notes/21.11 - 21.11])
of 2021 covered quite a few topics not advertised at the road
map, e.g., webcam support, Xilinx Zynq, or RISC-V.
It is fair to say that the level of technical risks we took in 2021 had been
unprecedented in Genode's development history. We are more than proud of the
outcome, which will hopefully propel Genode to new heights in 2022.
Besides working on Genode's actual operating-system code, we fully embraced
developer tooling as focus area. In 2023, the
[https://genode.org/documentation/release-notes/23.08#Goa_tool_gets_usability_improvements_and_depot-index_publishing_support - Goa SDK]
for streamlining the application development for Genode has reached the level
of maturity and flexibility that allowed us to port software stacks as
sophisticated as
[https://genodians.org/jws/2023-11-16-sip-client-for-genode - Linphone]
to Genode. Not only for porting but also for developing applications
and libraries, the tool has become a go-to solution. As another noteworthy
developer-tooling topic, we tirelessly followed our vision of on-target
debugging on Sculpt OS. Specifically, we pursued the idea to implement a
debugging instrument as a specialized version of init augmented with the GDB
protocol. Sculpt OS 23.10 has this
[https://genode.org/documentation/release-notes/23.08#Multi-component_debug_monitor - monitor component]
already built-in, albeit it is not utilized yet.
2022 - Mobile Usability
#######################
2024 - Sculpt OS 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
routinely use it for advanced applications, in particular video chat. This
vision confronts us with a multitude of hard technical nuts to crack such as
power efficiency, UI latency, quality-of-service of audio processing, drivers
for multi-media devices, WebRTC performance, and usability. This grand theme
will not only address the Pinephone specifically. The efficiency gains will
benefit all Genode use cases large and small.
During our annual road-map discussion on Genode's
[https://genode.org/community/mailing-lists - mailing list], it became
apparent that many of us developers long for harvesting user-visible rewards
after concentrating so intensively on topics below the surface,
eagerly rallying behind the theme "Sculpt OS usability" for 2024.
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.
Of the many aspects of usability, the following stood out during the
discussion: multi-monitor support, desktop utilities (file management,
configuration dialogs, drag'n'drop), improved discoverability (on-target docs),
suspend/resume, and profound support for touchscreens and touchpads.
Accommodating those topics will require us to rethink several parts of the GUI
stack, from the drivers over the low-level GUI server, window management, up
to the application and widget-toolkit level.
Besides the Pinephone, we will steadily nurture the quality and scope of
driver support on PC hardware, which remains the primary platform for the
day-to-day use of Sculpt OS. So you can expect us to keep up with recent
generations of Intel-based hardware. In this area, we plan to make IOMMU
support available with kernels beyond NOVA, and explore the use of
power-management features like suspend-resume with Sculpt OS.
A second recurring interest is the further consolidation of Genode's driver
landscape towards fully pluggable drivers, the consistent use of drivers
ported from up-to-date Linux kernels, and clear-cut ACPI support.
As continuations of 2023, the vision of Sculpt OS on Genode's custom kernel
will come to fruition, and we will bring our goal of easy-to-use on-target
debugging to completion.
Since we added
[https://genodians.org/atopia/2023-10-26-a-first-complex-rust-package - Rust support]
to the Goa tool mid of 2023, we have been looking for natural synergies
between Rust-based projects and Genode. During the road-map discussion, we
identified the use of Rust-based components as building blocks for a
multi-component e-mail client a tempting opportunity. Throughout the year, we
plan to take an (open-ended) e-mail scenario as motivator for combining our
interests in Sculpt usability, Goa-based development work flows, and Rust.
Device-wise, we will continue our engagement with the PinePhone, look forward
to the upcoming MNT PocketReform, and take on the latest Intel-based PC
platforms. We also want to explore the use of Sculpt OS on form factors like
the ZimaBlade single-board server (headless operation) or the StarLite tablet
(touch-based UI).
Milestones for 2022
Milestones for 2024
###################
In the following, we present a rough schedule of the planned work. As usual,
it is not set in stone. If you are interested in a particular line of work,
please get in touch.
February - Release 22.02
February - Release 24.02
========================
* OpenGL in VirtualBox 6
* Sculpt OS as tool kit for special-purpose OS images
* Pinephone
* Modem access
* Touch-screen compatibility of Sculpt OS
* Revised audio infrastructure
(timing robustness, pluggable drivers, adaptive sample rates)
* Suspend/resume awareness of GPU, AHCI, and NVMe drivers
* Support for I2C based HID devices in Intel GEN12 (e.g., touchpad)
* Fine-grained and dynamic assignment of USB devices/interfaces
* Use of Sculpt OS as a remote test target for Goa
* TCP/IP stack based of DDE-Linux version 6.x
* PinePhone support for receiving and sending SMS messages
May - Release 22.05
May - Release 24.05
===================
* Annual update of the "Genode Foundations" book
* Second edition of the "Genode Platforms" documentation
* WireGuard VPN
* Updated drivers for PC hardware (Wifi, Intel framebuffer, USB)
* New tracing tool with support for CTF and PCAP
* Pinephone telephony
* Sculpt OS on the PC
* Suspend/resume
* Scalability to large monitors
* On-target debugging
* Scrollable component graph
* Controls for saving the current deployment and settings
* Updated "Genode Foundations" book
* Drivers
* Revised PC platform discovery and ACPI sandboxing
* i.MX drivers updated to DDE-Linux version 6.x
* ALSA-based audio driver for PC platforms
* Audio on MNT Reform
* Alder Lake GPU support + updated Mesa library stack
* Audio components converted to new APIs introduced in 24.02
* Optimized base-hw multimedia support
(kernel scheduling, latency, cache attributes)
* First Sculpt PC variant on the base-hw kernel
(integration of the kernel-agnostic IOMMU support, virtualization)
* Consolidation of the Tresor block encryptor and file vault
* Application-level compositing using Genode's dialog API
August - Release 22.08
August - Release 24.08
======================
* Pinephone
* Morph browser
* Media record and playback capabilities
* FPGA-powered DMA protection for the Zynq-7000 SoC
* Kernel-agnostic IOMMU support for PC hardware
* Optimized GUI latency and synchronization
* Sculpt OS
* Low-complexity custom file manager
* User profiles
* On-target documentation view
* Assignment of individual directories as file systems
* DDE-Linux update to kernel version 6.6 LTS
* Updating Qt and QtWebEngine to Qt6
* GUI stack
* Multi-monitor support
* Tearing-free graphics
* Touch aware GUI server and window manager
* Drag'n'drop between applications
* Mouse grabbing
* Convenience UI tools showcasing the use of the Goa SDK
(e.g., NIC-router config, USB-passthrough config, file launcher)
* User-friendly bootstrapping/installation of Linux VMs on ARM
November - Release 22.11
November - Release 24.11
========================
* Pinephone
* WebRTC-based video chat
* Power management
* Base mechanism for suspend-resume on PC hardware
* Support for hardware-based trust anchor for CBE and WireGuard
* Software-hardware co-design example for the Zynq-7000 SoC
* Sculpt OS
* Multi-monitor window management
* Use of dev tools on target
* "Genode applications" book focused on component development
* Port of Qemu via Goa
* Dynamic VFS configuration, VFS / file-system interface optimizations
* Pluggable USB-Host driver
* Show case of a multi-component e-mail user agent

View File

@@ -30,16 +30,18 @@ tool chain. It can be obtained in two ways: as pre-compiled binaries or
manually compiled:
:Pre-compiled:
Our pre-compiled tool chain is runnable on Linux x86_32 and x86_64. The
archives for both versions will be extracted to
_/usr/local/genode/tool/<version>_.
[https://github.com/genodelabs/genode/releases/download/23.05/genode-toolchain-23.05.tar.xz - Download the tool chain]
pre-compiled for Linux x86_64.
! SHA256 880886efba0f592a3d3c5ffb9fa63e692cb6bd643e13c5c468d0da027c22716e
To extract the archive, use the following command:
! sudo tar xPf genode-toolchain-<version>-<arch>.tar.xz
The use of the 'P' option ensures that the tool chain will be installed at
the correct absolute path where the build system expects it to reside by
default. Please note, Genode OS Framework releases require a Genode tool
chain with an equal or next smaller version number.
[https://sourceforge.net/projects/genode/files/genode-toolchain/ - Download the pre-compiled tool chain...]
_/usr/local/genode/tool/<version>_, which is the location expected by
Genode's build system.
:Compile from source:
For those of you who prefer compiling the tool chain from source, we provide

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

@@ -4,6 +4,6 @@ LIBS += syscall-fiasco base-fiasco-common cxx timeout
SRC_CC += thread_start.cc
SRC_CC += cache.cc
SRC_CC += capability_slab.cc
SRC_CC += capability_space.cc
SRC_CC += signal_transmitter.cc signal.cc
SRC_CC += platform.cc

View File

@@ -1,4 +1,4 @@
L4_SRC_DIR = $(call select_from_ports,fiasco)/src/kernel/fiasco/fiasco/snapshot
L4_SRC_DIR := $(call select_from_ports,fiasco)/src/kernel/fiasco/fiasco/snapshot
FIASCO_BUILD_DIR = $(shell pwd)/build
FIASCO = $(FIASCO_BUILD_DIR)/fiasco
@@ -6,24 +6,29 @@ FIASCO_SRC = $(L4_SRC_DIR)/kernel/fiasco
KERNEL_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [fiasco] /"
KERNEL_CXXFLAGS = -std=gnu++98 -fno-delete-null-pointer-checks $(CXXWARN) \
-Wno-address-of-packed-member
KERNEL_CFLAGS = -std=gnu89 \
-fno-tree-loop-distribute-patterns \
$(CWARN)
KERNEL_CXXFLAGS = -std=gnu++98 \
-fno-delete-null-pointer-checks \
-fno-tree-loop-distribute-patterns \
-Wno-address-of-packed-member \
$(CXXWARN)
$(FIASCO_BUILD_DIR):
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FIASCO_SRC) BUILDDIR=$@ \
$(KERNEL_BUILD_OUTPUT_FILTER)
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $@ oldconfig \
$(KERNEL_BUILD_OUTPUT_FILTER)
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(FIASCO): $(FIASCO_BUILD_DIR)
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= CFLAGS="-std=gnu89 $(CWARN)" \
$(VERBOSE_MK) MAKEFLAGS= \
CFLAGS="$(KERNEL_CFLAGS)" \
CXXFLAGS="$(KERNEL_CXXFLAGS)" \
$(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FIASCO_BUILD_DIR) \

View File

@@ -33,6 +33,9 @@ ifeq ($(VERBOSE),)
L4_VERBOSE = V=1
endif
# do not confuse third-party sub-makes
unexport .SHELLFLAGS
#
# Execute the rules in this file only at the second build stage when we know
# about the complete build settings, e.g., 'CROSS_DEV_PREFIX'.
@@ -61,10 +64,11 @@ CXXWARN = $(WARN) -Wno-bool-compare -Wno-c++11-compat -Wno-class-memaccess
# 'off64_t' type, which is used by bootstrap.
#
%.tag:
$(VERBOSE_MK) set -o pipefail; \
MAKEFLAGS= CPPFLAGS="$(CC_MARCH)" \
CFLAGS="$(CC_MARCH) -std=gnu89 $(CWARN)" \
CXXFLAGS="$(CC_MARCH) -D_GNU_SOURCE -std=gnu++98 $(CXXWARN)" \
$(VERBOSE_MK) MAKEFLAGS= CPPFLAGS="$(CC_MARCH)" \
CFLAGS="$(CC_MARCH) -std=gnu89 $(CWARN) \
-fno-tree-loop-distribute-patterns" \
CXXFLAGS="$(CC_MARCH) -D_GNU_SOURCE -std=gnu++98 $(CXXWARN) \
-fno-tree-loop-distribute-patterns" \
ASFLAGS="$(CC_MARCH)" LDFLAGS="$(LD_MARCH)" \
$(MAKE) $(VERBOSE_DIR) O=$(L4_BUILD_DIR) $(L4_VERBOSE) \
-C $(L4_PKG_DIR)/$* \

View File

@@ -6,7 +6,7 @@
# userland that comes with Fiasco.
#
L4_SRC_DIR = $(call select_from_ports,fiasco)/src/kernel/fiasco/fiasco/snapshot
L4_SRC_DIR := $(call select_from_ports,fiasco)/src/kernel/fiasco/fiasco/snapshot
L4_BUILD_DIR := $(shell pwd)
#
@@ -15,7 +15,7 @@ L4_BUILD_DIR := $(shell pwd)
.Makeconf.bid.old:
$(VERBOSE)mkdir -p $(dir $@)
$(VERBOSE)cp $(L4_CONFIG) $(@:.old=)
$(VERBOSE_MK) set -o pipefail; \
$(VERBOSE_MK) \
MAKEFLAGS= make $(VERBOSE_DIR) -C $(L4_SRC_DIR)/l4 \
O=$(L4_BUILD_DIR) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" oldconfig \
2>&1 | sed "s/^/ [l4build] /"

View File

@@ -0,0 +1,15 @@
gcc12.patch
diff --git fiasco/snapshot/l4/pkg/sigma0/server/src/region.h fiasco/snapshot/l4/pkg/sigma0/server/src/region.h
index ad7cf95..c323bae 100644
--- fiasco/snapshot/l4/pkg/sigma0/server/src/region.h
+++ fiasco/snapshot/l4/pkg/sigma0/server/src/region.h
@@ -1,6 +1,8 @@
#ifndef SIGMA0_REGION_H__
#define SIGMA0_REGION_H__
+#include <l4/cxx/iostream.h>
+
class Region
{
private:

View File

@@ -1 +1 @@
386db79cbd4039ea2e3cbf028fac095a1bc96c31
8b9803659db40a251898289ef8f347351aeaf29d

View File

@@ -1,10 +1,10 @@
LICENSE := GPLv2
VERSION := 1.0
DOWNLOADS := fiasco.archive
URL(fiasco) := http://downloads.sourceforge.net/project/genode/3rd/3rd_fiasco.tar.bz2
URL(fiasco) := https://genode.org/files/fiasco.tar.bz2
SHA(fiasco) := b5737901001e6ab09adecf03914c0a7e04f03a2d561e9b2c7a12f3c92edc7dd0
DIR(fiasco) := src/kernel/fiasco
PATCHES := $(shell find $(REP_DIR)/patches -name *.patch)
PATCHES := $(sort $(wildcard $(REP_DIR)/patches/*.patch))
PATCH_OPT := -p0 -d src/kernel/fiasco
$(call check_tool,wget)

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
sed -i "s/fiasco_timer/timer/" src/timer/fiasco/target.mk

View File

@@ -1 +1 @@
2022-02-27 f339b49bb923456b6ca69bb7abd1a883d31b51fc
2024-12-10 408b474f632eefaaa19db35812a9aa94a48e6bdb

View File

@@ -17,7 +17,7 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Core;
void Core_log::out(char const c) { Fiasco::outchar(c); }

View File

@@ -30,10 +30,10 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode { class Ipc_pager; }
namespace Core { class Ipc_pager; }
class Genode::Ipc_pager
class Core::Ipc_pager
{
private:

View File

@@ -21,7 +21,7 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
namespace Core {
/**
* Map page locally within core

View File

@@ -29,10 +29,10 @@
#include <boot_modules.h>
#include <assertion.h>
namespace Genode { class Platform; }
namespace Core { class Platform; }
class Genode::Platform : public Platform_generic
class Core::Platform : public Platform_generic
{
private:
@@ -45,7 +45,7 @@ class Genode::Platform : public Platform_generic
/*
* Shortcut for the type of allocator instances for physical resources
*/
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
using Phys_allocator = Synced_range_allocator<Allocator_avl>;
char _core_label[1]; /* to satisfy _core_pd */
Platform_pd *_core_pd = nullptr; /* core protection domain object */
@@ -112,7 +112,8 @@ class Genode::Platform : public Platform_generic
*/
Sigma0();
int pager(Ipc_pager &) override { /* never called */ return -1; }
/* never called */
Pager_result pager(Ipc_pager &) override { return Pager_result::STOP; }
};
/**
@@ -130,7 +131,8 @@ class Genode::Platform : public Platform_generic
*/
Core_pager(Platform_pd &core_pd);
int pager(Ipc_pager &) override { /* never called */ return -1; }
/* never called */
Pager_result pager(Ipc_pager &) override { return Pager_result::STOP; }
};
/**

View File

@@ -21,21 +21,27 @@
#include <base/allocator.h>
/* core includes */
#include <platform_thread.h>
#include <address_space.h>
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
namespace Core {
class Platform_thread;
class Platform_pd;
}
class Genode::Platform_pd : public Address_space
class Core::Platform_pd : public Address_space
{
public:
struct Thread_id { unsigned value; };
enum class Alloc_thread_id_error { EXHAUSTED };
using Alloc_thread_id_result = Attempt<Thread_id, Alloc_thread_id_error>;
private:
/*
@@ -60,35 +66,11 @@ class Genode::Platform_pd : public Address_space
Fiasco::l4_taskid_t _l4_task_id { }; /* L4 task ID */
/**********************************************
** Threads of this protection domain object **
**********************************************/
/***************************************
** Threads of this protection domain **
***************************************/
Platform_thread *_threads[THREAD_MAX];
/**
* Initialize thread allocator
*/
void _init_threads();
/**
* Thread iteration for one task
*/
Platform_thread *_next_thread();
/**
* Thread allocation
*
* Again a special case for Core thread0.
*/
int _alloc_thread(int thread_id, Platform_thread &thread);
/**
* Thread deallocation
*
* No special case for Core thread0 here - we just never call it.
*/
void _free_thread(int thread_id);
Platform_thread *_threads[THREAD_MAX] { };
/******************
@@ -179,18 +161,25 @@ class Genode::Platform_pd : public Address_space
static void init();
/**
* Bind thread to protection domain
*
* \return true on success
* Allocate PD-local ID for a new 'Platform_thread'
*/
bool bind_thread(Platform_thread &thread);
Alloc_thread_id_result alloc_thread_id(Platform_thread &);
/**
* Unbind thread from protection domain
*
* Free the thread's slot and update thread object.
* Release PD-local thread ID at destruction of 'Platform_thread'
*/
void unbind_thread(Platform_thread &thread);
void free_thread_id(Thread_id);
/**
* Return L4 thread ID from the PD's task ID and the PD-local thread ID
*/
Fiasco::l4_threadid_t l4_thread_id(Thread_id const id) const
{
Fiasco::l4_threadid_t result = _l4_task_id;
enum { LTHREAD_MASK = (1 << 7) - 1 };
result.id.lthread = id.value & LTHREAD_MASK;
return result;
}
/**
* Assign parent interface to protection domain

View File

@@ -27,14 +27,14 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
namespace Core {
class Platform_pd;
class Platform_thread;
}
class Genode::Platform_thread : Interface
class Core::Platform_thread : Interface
{
private:
@@ -44,92 +44,74 @@ class Genode::Platform_thread : Interface
Platform_thread(Platform_thread const &);
Platform_thread &operator = (Platform_thread const &);
int _thread_id = THREAD_INVALID; /* plain thread number */
using Name = String<32>;
Fiasco::l4_threadid_t _l4_thread_id;
Name const _name; /* name to be registered at the kernel debugger */
Platform_pd &_pd;
using Id = Platform_pd::Alloc_thread_id_result;
Id const _id { _pd.alloc_thread_id(*this) };
typedef String<32> Name;
Name const _name; /* thread name that will be
registered at the kernel
debugger */
Platform_pd *_platform_pd = nullptr; /* protection domain thread
is bound to */
Pager_object *_pager = nullptr;
public:
enum {
THREAD_INVALID = -1, /* invalid thread number */
};
/**
* Constructor
*/
Platform_thread(size_t, const char *name, unsigned priority,
Affinity::Location, addr_t utcb);
Platform_thread(Platform_pd &pd, Rpc_entrypoint &, Ram_allocator &,
Region_map &, size_t, const char *name, unsigned,
Affinity::Location, addr_t)
: _name(name), _pd(pd) { }
/**
* Constructor used for core-internal threads
*/
Platform_thread(const char *name);
Platform_thread(Platform_pd &pd, const char *name)
: _name(name), _pd(pd) { }
/**
* Destructor
*/
~Platform_thread();
/**
* Return false if thread IDs are exhausted
*/
bool valid() const { return _id.ok(); }
/**
* Start thread
*
* \param ip instruction pointer to start at
* \param sp stack pointer to use
*
* \retval 0 successful
* \retval -1 thread could not be started
*/
int start(void *ip, void *sp);
void start(void *ip, void *sp);
/**
* Pause this thread
*/
void pause();
void pause() { /* not implemented */ }
/**
* Enable/disable single stepping
*/
void single_step(bool) { }
void single_step(bool) { /* not implemented */ }
/**
* Resume this thread
*/
void resume();
/**
* This thread is about to be bound
*
* \param thread_id local thread ID
* \param l4_thread_id final L4 thread ID
* \param pd platform pd, thread is bound to
*/
void bind(int thread_id, Fiasco::l4_threadid_t l4_thread_id,
Platform_pd &pd);
/**
* Unbind this thread
*/
void unbind();
void resume() { /* not implemented */ }
/**
* Override thread state with 's'
*
* \throw Cpu_session::State_access_failed
*/
void state(Thread_state s);
void state(Thread_state) { /* not implemented */ }
/**
* Read thread state
*
* \throw Cpu_session::State_access_failed
*/
Thread_state state();
@@ -167,7 +149,7 @@ class Genode::Platform_thread : Interface
* Return identification of thread when faulting
*/
unsigned long pager_object_badge() const {
return convert_native_thread_id_to_badge(_l4_thread_id); }
return convert_native_thread_id_to_badge(native_thread_id()); }
/**
* Set CPU quota of the thread to 'quota'
@@ -184,9 +166,16 @@ class Genode::Platform_thread : Interface
** Fiasco-specific Accessors **
*******************************/
int thread_id() const { return _thread_id; }
Fiasco::l4_threadid_t native_thread_id() const { return _l4_thread_id; }
Name name() const { return _name; }
Fiasco::l4_threadid_t native_thread_id() const
{
using namespace Fiasco;
return _id.convert<l4_threadid_t>(
[&] (Platform_pd::Thread_id id) { return _pd.l4_thread_id(id); },
[&] (Platform_pd::Alloc_thread_id_error) { return L4_INVALID_ID; }
);
}
Name name() const { return _name; }
};
#endif /* _CORE__INCLUDE__PLATFORM_THREAD_H_ */

View File

@@ -18,10 +18,13 @@
#include <base/allocator.h>
#include <base/capability.h>
namespace Genode { class Rpc_cap_factory; }
/* core includes */
#include <types.h>
namespace Core { class Rpc_cap_factory; }
class Genode::Rpc_cap_factory
class Core::Rpc_cap_factory
{
private:

View File

@@ -28,7 +28,10 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
/* core includes */
#include <types.h>
namespace Core {
inline void log_event(const char *s)
{
@@ -95,7 +98,7 @@ namespace Genode {
inline addr_t map_src_addr(addr_t core_local_addr, addr_t) {
return core_local_addr; }
inline size_t constrain_map_size_log2(size_t size_log2) { return size_log2; }
inline Log2 kernel_constrained_map_size(Log2 size) { return size; }
inline unsigned long convert_native_thread_id_to_badge(Fiasco::l4_threadid_t tid)
{

View File

@@ -19,10 +19,10 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Core;
void Io_mem_session_component::_unmap_local(addr_t base, size_t)
void Io_mem_session_component::_unmap_local(addr_t base, size_t, addr_t)
{
platform().region_alloc().free(reinterpret_cast<void *>(base));
}
@@ -38,8 +38,11 @@ static inline bool can_use_super_page(addr_t, size_t)
}
addr_t Io_mem_session_component::_map_local(addr_t phys_base, size_t size)
Io_mem_session_component::Map_local_result Io_mem_session_component::_map_local(addr_t const phys_base,
size_t const size_in)
{
size_t const size = size_in;
auto map_io_region = [] (addr_t phys_base, addr_t local_base, size_t size)
{
using namespace Fiasco;
@@ -91,14 +94,16 @@ addr_t Io_mem_session_component::_map_local(addr_t phys_base, size_t size)
size_t align = (size >= get_super_page_size()) ? get_super_page_size_log2()
: get_page_size_log2();
return platform().region_alloc().alloc_aligned(size, align).convert<addr_t>(
return platform().region_alloc().alloc_aligned(size, align).convert<Map_local_result>(
[&] (void *ptr) {
addr_t const core_local_base = (addr_t)ptr;
map_io_region(phys_base, core_local_base, size);
return core_local_base; },
return Map_local_result { .core_local_addr = core_local_base, .success = true };
},
[&] (Range_allocator::Alloc_error) -> addr_t {
[&] (Range_allocator::Alloc_error) {
error("core-local mapping of memory-mapped I/O range failed");
return 0; });
return Map_local_result();
});
}

View File

@@ -12,17 +12,17 @@
*/
/* Genode includes */
#include <base/log.h>
#include <util/arg_string.h>
/* core includes */
#include <irq_root.h>
#include <irq_args.h>
#include <util.h>
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Core;
bool Irq_object::_associate()
@@ -78,10 +78,11 @@ void Irq_object::_wait_for_irq()
}
void Irq_object::start()
Thread::Start_result Irq_object::start()
{
::Thread::start();
Start_result const result = ::Thread::start();
_sync_bootup.block();
return result;
}
@@ -126,7 +127,9 @@ Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
_irq_alloc(irq_alloc),
_irq_object(_irq_number)
{
long msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
Irq_args irq_args(args);
bool msi { irq_args.type() != Irq_session::TYPE_LEGACY };
if (msi)
throw Service_denied();

View File

@@ -11,9 +11,6 @@
* under the terms of the GNU Affero General Public License version 3.
*/
/* Genode includes */
#include <base/log.h>
/* core includes */
#include <ipc_pager.h>
#include <pager.h>
@@ -25,7 +22,7 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Core;
using namespace Fiasco;
@@ -106,3 +103,6 @@ Untyped_capability Pager_entrypoint::_pager_object_cap(unsigned long badge)
{
return Capability_space::import(native_thread().l4id, Rpc_obj_key(badge));
}
void Core::init_page_fault_handling(Rpc_entrypoint &) { }

View File

@@ -20,7 +20,7 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Core;
void Pager_object::wake_up()
@@ -45,5 +45,5 @@ void Pager_object::wake_up()
void Pager_object::unresolved_page_fault_occurred()
{
state.unresolved_page_fault = true;
state.state = Thread_state::State::PAGE_FAULT;
}

View File

@@ -12,7 +12,6 @@
*/
/* Genode includes */
#include <base/log.h>
#include <base/allocator_avl.h>
#include <base/sleep.h>
#include <util/misc_math.h>
@@ -35,7 +34,7 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Core;
using namespace Fiasco;
@@ -124,7 +123,7 @@ static void _core_pager_loop()
}
Platform::Sigma0::Sigma0()
Core::Platform::Sigma0::Sigma0()
:
Pager_object(Cpu_session_capability(), Thread_capability(),
0, Affinity::Location(), Session_label(),
@@ -134,23 +133,22 @@ Platform::Sigma0::Sigma0()
}
Platform::Sigma0 &Platform::sigma0()
Core::Platform::Sigma0 &Core::Platform::sigma0()
{
static Sigma0 _sigma0;
return _sigma0;
}
Platform::Core_pager::Core_pager(Platform_pd &core_pd)
Core::Platform::Core_pager::Core_pager(Platform_pd &core_pd)
:
Platform_thread("core.pager"),
Platform_thread(core_pd, "core.pager"),
Pager_object(Cpu_session_capability(), Thread_capability(),
0, Affinity::Location(), Session_label(),
Cpu_session::Name(name()))
{
Platform_thread::pager(sigma0());
core_pd.bind_thread(*this);
cap(Capability_space::import(native_thread_id(), Rpc_obj_key()));
/* pager needs to know core's pd ID */
@@ -168,7 +166,7 @@ Platform::Core_pager::Core_pager(Platform_pd &core_pd)
}
Platform::Core_pager &Platform::core_pager()
Core::Platform::Core_pager &Core::Platform::core_pager()
{
static Core_pager _core_pager(core_pd());
return _core_pager;
@@ -250,7 +248,7 @@ static inline int sigma0_req_region(addr_t *addr, unsigned log2size)
}
void Platform::_setup_mem_alloc()
void Core::Platform::_setup_mem_alloc()
{
/*
* Completely map program image by touching all pages read-only to
@@ -297,7 +295,7 @@ void Platform::_setup_mem_alloc()
}
void Platform::_setup_irq_alloc()
void Core::Platform::_setup_irq_alloc()
{
_irq_alloc.add_range(0, 0x10);
}
@@ -348,13 +346,10 @@ static l4_kernel_info_t *get_kip()
}
void Platform::_setup_basics()
void Core::Platform::_setup_basics()
{
l4_kernel_info_t * kip = get_kip();
/* add KIP as ROM module */
_rom_fs.insert(&_kip_rom);
/* parse memory descriptors - look for virtual memory configuration */
/* XXX we support only one VM region (here and also inside RM) */
using L4::Kip::Mem_desc;
@@ -401,12 +396,12 @@ void Platform::_setup_basics()
}
Platform::Platform()
Core::Platform::Platform()
:
_ram_alloc(nullptr), _io_mem_alloc(&core_mem_alloc()),
_io_port_alloc(&core_mem_alloc()), _irq_alloc(&core_mem_alloc()),
_region_alloc(&core_mem_alloc()),
_kip_rom((addr_t)get_kip(), L4_PAGESIZE, "l4v2_kip")
_kip_rom(_rom_fs, "l4v2_kip", (addr_t)get_kip(), L4_PAGESIZE)
{
/*
* We must be single-threaded at this stage and so this is safe.
@@ -436,10 +431,9 @@ Platform::Platform()
* interface that allows us to specify the lthread number.
*/
Platform_thread &core_thread = *new (core_mem_alloc())
Platform_thread("core.main");
Platform_thread(*_core_pd, "core.main");
core_thread.pager(sigma0());
_core_pd->bind_thread(core_thread);
/* we never call _core_thread.start(), so set name directly */
fiasco_register_thread_name(core_thread.native_thread_id(),
@@ -460,8 +454,8 @@ Platform::Platform()
memset(core_local_ptr, 0, size);
content_fn(core_local_ptr, size);
_rom_fs.insert(new (core_mem_alloc())
Rom_module(phys_addr, size, rom_name));
new (core_mem_alloc())
Rom_module(_rom_fs, rom_name, phys_addr, size);
},
[&] (Range_allocator::Alloc_error) {
warning("failed to export ", rom_name, " as ROM module"); }
@@ -478,8 +472,8 @@ Platform::Platform()
[&] (void *core_local_ptr, size_t size) {
Xml_generator xml(reinterpret_cast<char *>(core_local_ptr),
size, "platform_info",
[&] () {
xml.node("kernel", [&] () {
[&] {
xml.node("kernel", [&] {
xml.attribute("name", "fiasco"); }); }); });
}
@@ -488,7 +482,7 @@ Platform::Platform()
** Generic platform interface **
********************************/
void Platform::wait_for_exit()
void Core::Platform::wait_for_exit()
{
/*
* On Fiasco, Core never exits. So let us sleep forever.

View File

@@ -29,7 +29,7 @@
#include <fiasco/syscall.h>
using namespace Fiasco;
using namespace Genode;
using namespace Core;
static bool _init = false;
@@ -37,7 +37,8 @@ static bool _init = false;
void Platform_pd::init()
{
if (_init) return;
if (_init)
return;
unsigned i;
Pd_alloc reserved(true, true, 0);
@@ -52,10 +53,6 @@ void Platform_pd::init()
}
/****************************
** Private object members **
****************************/
void Platform_pd::_create_pd(bool syscall)
{
enum { TASK_ID_MASK = (1 << 11) - 1,
@@ -135,97 +132,27 @@ void Platform_pd::_free_pd()
}
void Platform_pd::_init_threads()
Platform_pd::Alloc_thread_id_result Platform_pd::alloc_thread_id(Platform_thread &thread)
{
unsigned i;
for (i = 0; i < THREAD_MAX; ++i)
_threads[i] = 0;
}
Platform_thread* Platform_pd::_next_thread()
{
unsigned i;
/* look for bound thread */
for (i = 0; i < THREAD_MAX; ++i)
if (_threads[i]) break;
/* no bound threads */
if (i == THREAD_MAX) return 0;
return _threads[i];
}
int Platform_pd::_alloc_thread(int thread_id, Platform_thread &thread)
{
int i = thread_id;
/* look for free thread */
if (thread_id == Platform_thread::THREAD_INVALID) {
for (i = 0; i < THREAD_MAX; ++i)
if (!_threads[i]) break;
/* no free threads available */
if (i == THREAD_MAX) return -1;
} else {
if (_threads[i]) return -2;
for (unsigned i = 0; i < THREAD_MAX; i++) {
if (_threads[i] == nullptr) {
_threads[i] = &thread;
return Thread_id { i };
}
}
_threads[i] = &thread;
return i;
return Alloc_thread_id_error::EXHAUSTED;
}
void Platform_pd::_free_thread(int thread_id)
void Platform_pd::free_thread_id(Thread_id const id)
{
if (!_threads[thread_id])
warning("double-free of thread ", Hex(_pd_id), ".", Hex(thread_id), " detected");
if (id.value >= THREAD_MAX)
return;
_threads[thread_id] = 0;
}
if (!_threads[id.value])
warning("double-free of thread ", Hex(_pd_id), ".", Hex(id.value), " detected");
/***************************
** Public object members **
***************************/
bool Platform_pd::bind_thread(Platform_thread &thread)
{
/* thread_id is THREAD_INVALID by default - only core is the special case */
int thread_id = thread.thread_id();
l4_threadid_t l4_thread_id;
int t = _alloc_thread(thread_id, thread);
if (t < 0) {
error("thread alloc failed");
return false;
}
thread_id = t;
enum { LTHREAD_MASK = (1 << 7) - 1 };
l4_thread_id = _l4_task_id;
l4_thread_id.id.lthread = thread_id & LTHREAD_MASK;
/* finally inform thread about binding */
thread.bind(thread_id, l4_thread_id, *this);
return true;
}
void Platform_pd::unbind_thread(Platform_thread &thread)
{
int thread_id = thread.thread_id();
/* unbind thread before proceeding */
thread.unbind();
_free_thread(thread_id);
_threads[id.value] = nullptr;
}
@@ -245,15 +172,13 @@ void Platform_pd::flush(addr_t, size_t size, Core_local_addr core_local_base)
L4_FP_FLUSH_PAGE);
}
Platform_pd::Platform_pd(Allocator &, char const *)
{
/* check correct init */
if (!_init)
panic("init pd facility via Platform_pd::init() before using it!");
/* init threads */
_init_threads();
int ret = _alloc_pd(PD_INVALID);
if (ret < 0) {
panic("pd alloc failed");
@@ -269,9 +194,6 @@ Platform_pd::Platform_pd(char const *, signed pd_id)
if (!_init)
panic("init pd facility via Platform_pd::init() before using it!");
/* init threads */
_init_threads();
int ret = _alloc_pd(pd_id);
if (ret < 0) {
panic("pd alloc failed");
@@ -283,10 +205,11 @@ Platform_pd::Platform_pd(char const *, signed pd_id)
Platform_pd::~Platform_pd()
{
/* unbind all threads */
while (Platform_thread *t = _next_thread()) unbind_thread(*t);
bool any_thread_exists = false;
for (Platform_thread *t : _threads) any_thread_exists |= (t != nullptr);
if (any_thread_exists)
error("attempt to destruct platform PD before threads");
_destroy_pd();
_free_pd();
}

View File

@@ -15,8 +15,6 @@
*/
/* Genode includes */
#include <base/log.h>
#include <util/string.h>
#include <cpu_session/cpu_session.h>
/* core includes */
@@ -28,14 +26,17 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Core;
using namespace Fiasco;
int Platform_thread::start(void *ip, void *sp)
void Platform_thread::start(void *ip, void *sp)
{
if (_id.failed())
return;
l4_umword_t dummy, old_eflags;
l4_threadid_t thread = _l4_thread_id;
l4_threadid_t thread = native_thread_id();
l4_threadid_t pager = _pager
? Capability_space::ipc_cap_data(_pager->cap()).dst
: L4_INVALID_ID;
@@ -47,38 +48,47 @@ int Platform_thread::start(void *ip, void *sp)
&old_eflags, &dummy, &dummy,
0, l4_utcb_get());
if (old_eflags == ~0UL)
warning("old eflags == ~0 on ex_regs ",
warning("start ", _name, ": old eflags == ~0 on ex_regs ",
Hex(thread.id.task), ".", Hex(thread.id.lthread));
fiasco_register_thread_name(thread, _name.string());
return 0;
}
void Platform_thread::pause()
Thread_state Platform_thread::state()
{
warning(__func__, " not implemented");
Thread_state s { };
l4_umword_t old_eflags, ip, sp;
l4_threadid_t thread = native_thread_id();
l4_threadid_t pager = L4_INVALID_ID;
l4_threadid_t preempter = L4_INVALID_ID;
l4_threadid_t cap_handler = L4_INVALID_ID;
l4_inter_task_ex_regs(thread, ~0UL, ~0UL,
&preempter, &pager, &cap_handler,
&old_eflags, &ip, &sp,
L4_THREAD_EX_REGS_NO_CANCEL, l4_utcb_get());
if (old_eflags == ~0UL)
warning("state old eflags == ~0 on ex_regs ",
Hex(thread.id.task), ".", Hex(thread.id.lthread));
/* fill thread state structure */
s.cpu.ip = ip;
s.cpu.sp = sp;
s.state = Thread_state::State::VALID;
return s;
}
void Platform_thread::resume()
Platform_thread::~Platform_thread()
{
warning(__func__, " not implemented");
}
if (_id.failed())
return;
void Platform_thread::bind(int thread_id, l4_threadid_t l4_thread_id, Platform_pd &pd)
{
_thread_id = thread_id;
_l4_thread_id = l4_thread_id;
_platform_pd = &pd;
}
void Platform_thread::unbind()
{
l4_umword_t dummy, old_eflags;
l4_threadid_t thread = _l4_thread_id;
l4_threadid_t thread = native_thread_id();
l4_threadid_t pager = thread;
l4_threadid_t preempter = L4_INVALID_ID;
l4_threadid_t cap_handler = L4_INVALID_ID;
@@ -95,63 +105,10 @@ void Platform_thread::unbind()
&old_eflags, &dummy, &dummy,
0, l4_utcb_get());
if (old_eflags == ~0UL)
warning("old eflags == ~0 on ex_regs ",
warning("unbind old eflags == ~0 on ex_regs ",
Hex(thread.id.task), ".", Hex(thread.id.lthread));
_thread_id = THREAD_INVALID;
_l4_thread_id = L4_INVALID_ID;
_platform_pd = 0;
}
void Platform_thread::state(Thread_state)
{
warning(__func__, " not implemented");
throw Cpu_thread::State_access_failed();
}
Thread_state Platform_thread::state()
{
Thread_state s;
l4_umword_t old_eflags, ip, sp;
l4_threadid_t thread = _l4_thread_id;
l4_threadid_t pager = L4_INVALID_ID;
l4_threadid_t preempter = L4_INVALID_ID;
l4_threadid_t cap_handler = L4_INVALID_ID;
l4_inter_task_ex_regs(thread, ~0UL, ~0UL,
&preempter, &pager, &cap_handler,
&old_eflags, &ip, &sp,
L4_THREAD_EX_REGS_NO_CANCEL, l4_utcb_get());
if (old_eflags == ~0UL)
warning("old eflags == ~0 on ex_regs ",
Hex(thread.id.task), ".", Hex(thread.id.lthread));
/* fill thread state structure */
s.ip = ip;
s.sp = sp;
return s;
}
Platform_thread::Platform_thread(size_t, const char *name, unsigned,
Affinity::Location, addr_t)
: _l4_thread_id(L4_INVALID_ID), _name(name) { }
Platform_thread::Platform_thread(const char *name)
: _l4_thread_id(L4_INVALID_ID), _name(name) { }
Platform_thread::~Platform_thread()
{
/*
* We inform our protection domain about thread destruction, which will end up in
* Thread::unbind()
*/
if (_platform_pd)
_platform_pd->unbind_thread(*this);
_id.with_result(
[&] (Platform_pd::Thread_id id) { _pd.free_thread_id(id); },
[&] (Platform_pd::Alloc_thread_id_error) { });
}

View File

@@ -17,7 +17,7 @@
/* core includes */
#include <ram_dataspace_factory.h>
using namespace Genode;
using namespace Core;
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component &) { }

View File

@@ -21,7 +21,7 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Core;
using namespace Fiasco;

View File

@@ -20,9 +20,8 @@
/* core includes */
#include <platform.h>
#include <core_env.h>
using namespace Genode;
using namespace Core;
void Thread::_thread_start()
@@ -34,18 +33,18 @@ void Thread::_thread_start()
}
void Thread::start()
Thread::Start_result Thread::start()
{
/* create and start platform thread */
native_thread().pt = new (platform().core_mem_alloc())
Platform_thread(_stack->name().string());
platform_specific().core_pd().bind_thread(*native_thread().pt);
Platform_thread(platform_specific().core_pd(), _stack->name().string());
native_thread().pt->pager(platform_specific().core_pager());
native_thread().l4id = native_thread().pt->native_thread_id();
native_thread().pt->start((void *)_thread_start, stack_top());
return Start_result::OK;
}

View File

@@ -20,11 +20,9 @@
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
namespace Core { struct Platform_thread; }
struct Platform_thread;
struct Native_thread;
}
namespace Genode { struct Native_thread; }
struct Genode::Native_thread
@@ -38,7 +36,7 @@ struct Genode::Native_thread
* thread object, which is going to be destroyed on destruction of the
* 'Thread'.
*/
Platform_thread *pt;
Core::Platform_thread *pt;
};
#endif /* _INCLUDE__BASE__INTERNAL__NATIVE_THREAD_H_ */

View File

@@ -19,7 +19,7 @@
namespace Genode {
typedef Fiasco::l4_threadid_t Rpc_destination;
using Rpc_destination = Fiasco::l4_threadid_t;
static inline Rpc_destination invalid_rpc_destination()
{

View File

@@ -14,7 +14,6 @@
/* Genode includes */
#include <base/log.h>
#include <base/ipc.h>
#include <base/blocking.h>
/* base-internal includes */
#include <base/internal/ipc_server.h>
@@ -166,10 +165,6 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
rcv_header.extract_caps(rcv_msg);
if (L4_IPC_IS_ERROR(ipc_result)) {
if (L4_IPC_ERROR(ipc_result) == L4_IPC_RECANCELED)
throw Genode::Blocking_canceled();
error("ipc_call error ", Hex(L4_IPC_ERROR(ipc_result)));
throw Genode::Ipc_error();
}

View File

@@ -21,11 +21,18 @@
using namespace Genode;
static Thread_capability main_thread_cap(Thread_capability main_cap = { })
{
static Thread_capability cap = main_cap;
return cap;
}
/*****************************
** Startup library support **
*****************************/
void prepare_init_main_thread() { }
void Genode::prepare_init_main_thread() { }
/************
@@ -41,3 +48,9 @@ void Thread::_init_platform_thread(size_t, Type type)
_thread_cap = main_thread_cap();
}
void Genode::init_thread_bootstrap(Cpu_session &, Thread_capability main_cap)
{
main_thread_cap(main_cap);
}

View File

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

View File

@@ -0,0 +1,417 @@
/*
* \brief Timer driver for L4/Fiasco
* \author Norman Feske
* \author Alexander Boettcher
* \date 2024-06-14
*/
/*
* Copyright (C) 2024 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.
*/
/* Genode includes */
#include <base/component.h>
#include <base/heap.h>
#include <base/session_object.h>
#include <base/attached_rom_dataspace.h>
#include <root/component.h>
#include <timer_session/timer_session.h>
/* base-internal includes */
#include <base/internal/alarm_registry.h>
/* L4/Fiasco includes */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/kip.h>
#include <l4/sys/kernel.h>
}
#pragma GCC diagnostic pop
using namespace Fiasco;
namespace Timer {
using namespace Genode;
struct Tsc { uint64_t tsc; };
struct Clock;
struct Device;
struct Alarm;
struct Root;
struct Session_component;
struct Main;
using Alarms = Alarm_registry<Alarm, Clock>;
}
struct Timer::Clock
{
uint64_t us;
static constexpr uint64_t MASK = uint64_t(-1);
uint64_t value() const { return us; }
void print(Output &out) const { Genode::print(out, us); }
};
class Timer::Device
{
private:
Attached_rom_dataspace const _kip_ds;
public:
struct Wakeup_dispatcher : Interface
{
virtual void dispatch_device_wakeup() = 0;
};
struct Deadline : Clock { };
static constexpr Deadline infinite_deadline { uint64_t(-1) };
private:
struct Waiter : Thread
{
l4_timeout_s mus_to_timeout(uint64_t const mus) const
{
if (mus == 0)
return L4_IPC_TIMEOUT_0;
else if (mus == ~0ULL)
return L4_IPC_TIMEOUT_NEVER;
long e = Genode::log2((unsigned long)mus) - 7;
if (e < 0) e = 0;
uint64_t m = mus / (1UL << e);
enum { M_MASK = 0x3ff };
/* check corner case */
if ((e > 31 ) || (m > M_MASK)) {
Genode::warning("invalid timeout ", mus, ", using max. values");
e = 0;
m = M_MASK;
}
return l4_timeout_rel(m & M_MASK, (unsigned)e);
}
Wakeup_dispatcher &_dispatcher;
Mutex _mutex { }; /* protect '_deadline' */
Deadline _deadline { ~0ULL };
l4_threadid_t _myself { };
Device &_device;
Waiter(Env &env, Wakeup_dispatcher &dispatcher, Device &device)
:
Thread(env, "waiter", 8*1024*sizeof(addr_t)),
_dispatcher(dispatcher),
_device(device)
{
start();
}
void entry() override
{
_myself = l4_myself();
for (;;) {
auto deadline_atomic = [&]
{
Mutex::Guard guard(_mutex);
return _deadline;
};
{
auto const deadline = deadline_atomic();
auto const now = _device.now();
if (now.us < deadline.us) {
auto usecs = min(deadline.us - now.us,
100ull * 1000 * 1000);
l4_ipc_sleep(l4_timeout(L4_IPC_TIMEOUT_NEVER,
mus_to_timeout(usecs)));
}
}
if (_device.now().us >= deadline_atomic().us)
_dispatcher.dispatch_device_wakeup();
}
}
void update_deadline(Deadline const deadline)
{
Mutex::Guard guard(_mutex);
bool const sooner_than_scheduled = (deadline.us < _deadline.us);
_deadline = deadline;
if (sooner_than_scheduled) {
/* cancel old timeout by waking sleeping waiter */
l4_umword_t dummy { };
l4_threadid_t preempter { L4_INVALID_ID };
l4_threadid_t pager { L4_INVALID_ID };
l4_thread_ex_regs_flags(_myself, ~0UL, ~0UL,
&preempter, &pager, &dummy, &dummy,
&dummy, 0 /* flags */);
}
}
} _waiter;
public:
Device(Env &env, Wakeup_dispatcher &dispatcher)
: _kip_ds(env, "l4v2_kip"), _waiter(env, dispatcher, *this) { }
Clock now() const
{
auto const kip = _kip_ds.local_addr<Fiasco::l4_kernel_info_t>();
return { .us = kip->clock };
}
void update_deadline(Deadline deadline) {
_waiter.update_deadline(deadline); }
};
struct Timer::Alarm : Alarms::Element
{
Session_component &session;
Alarm(Alarms &alarms, Session_component &session, Clock time)
:
Alarms::Element(alarms, *this, time), session(session)
{ }
void print(Output &out) const;
};
static Timer::Device::Deadline next_deadline(Timer::Alarms &alarms)
{
using namespace Timer;
return alarms.soonest(Clock { 0 }).convert<Device::Deadline>(
[&] (Clock soonest) -> Device::Deadline {
/* scan alarms for a cluster nearby the soonest */
uint64_t const MAX_DELAY_US = 250;
Device::Deadline result { soonest.us };
alarms.for_each_in_range(soonest, Clock { soonest.us + MAX_DELAY_US },
[&] (Alarm const &alarm) {
result.us = max(result.us, alarm.time.us); });
return result;
},
[&] (Alarms::None) { return Device::infinite_deadline; });
}
struct Timer::Session_component : Session_object<Timer::Session, Session_component>
{
Alarms &_alarms;
Mutex &_alarms_mutex;
Device &_device;
Signal_context_capability _sigh { };
Clock const _creation_time = _device.now();
uint64_t _local_now_us() const { return _device.now().us - _creation_time.us; }
struct Period { uint64_t us; };
Constructible<Period> _period { };
Constructible<Alarm> _alarm { };
Session_component(Env &env,
Resources const &resources,
Label const &label,
Diag const &diag,
Alarms &alarms,
Mutex &alarms_mutex,
Device &device)
:
Session_object(env.ep(), resources, label, diag),
_alarms(alarms), _alarms_mutex(alarms_mutex), _device(device)
{ }
~Session_component()
{
Mutex::Guard guard(_alarms_mutex);
_alarm.destruct();
}
/**
* Called by Device::Wakeup_dispatcher with '_alarms_mutex' taken
*/
void handle_wakeup()
{
if (_sigh.valid())
Signal_transmitter(_sigh).submit();
if (_period.constructed()) {
Clock const next = _alarm.constructed()
? Clock { _alarm->time.us + _period->us }
: Clock { _device.now().us + _period->us };
_alarm.construct(_alarms, *this, next);
} else /* response of 'trigger_once' */ {
_alarm.destruct();
}
}
/******************************
** Timer::Session interface **
******************************/
void trigger_once(uint64_t rel_us) override
{
Mutex::Guard guard(_alarms_mutex);
_period.destruct();
_alarm.destruct();
Clock const now = _device.now();
rel_us = max(rel_us, 250u);
_alarm.construct(_alarms, *this, Clock { now.us + rel_us });
_device.update_deadline(next_deadline(_alarms));
}
void trigger_periodic(uint64_t period_us) override
{
Mutex::Guard guard(_alarms_mutex);
_period.destruct();
_alarm.destruct();
if (period_us) {
period_us = max(period_us, 1000u);
_period.construct(period_us);
handle_wakeup();
}
_device.update_deadline(next_deadline(_alarms));
}
void sigh(Signal_context_capability sigh) override { _sigh = sigh; }
uint64_t elapsed_ms() const override { return _local_now_us()/1000; }
uint64_t elapsed_us() const override { return _local_now_us(); }
void msleep(uint64_t) override { }
void usleep(uint64_t) override { }
};
struct Timer::Root : public Root_component<Session_component>
{
private:
Env &_env;
Alarms &_alarms;
Mutex &_alarms_mutex;
Device &_device;
protected:
Session_component *_create_session(const char *args) override
{
return new (md_alloc())
Session_component(_env,
session_resources_from_args(args),
session_label_from_args(args),
session_diag_from_args(args),
_alarms, _alarms_mutex, _device);
}
void _upgrade_session(Session_component *s, const char *args) override
{
s->upgrade(ram_quota_from_args(args));
s->upgrade(cap_quota_from_args(args));
}
void _destroy_session(Session_component *session) override
{
Genode::destroy(md_alloc(), session);
}
public:
Root(Env &env, Allocator &md_alloc,
Alarms &alarms, Mutex &alarms_mutex, Device &device)
:
Root_component<Session_component>(&env.ep().rpc_ep(), &md_alloc),
_env(env), _alarms(alarms), _alarms_mutex(alarms_mutex), _device(device)
{ }
};
void Timer::Alarm::print(Output &out) const { Genode::print(out, session.label()); }
struct Timer::Main : Device::Wakeup_dispatcher
{
Env &_env;
Device _device { _env, *this };
Mutex _alarms_mutex { };
Alarms _alarms { };
Sliced_heap _sliced_heap { _env.ram(), _env.rm() };
Root _root { _env, _sliced_heap, _alarms, _alarms_mutex, _device };
/**
* Device::Wakeup_dispatcher
*/
void dispatch_device_wakeup() override
{
Mutex::Guard guard(_alarms_mutex);
/* handle and remove pending alarms */
while (_alarms.with_any_in_range({ 0 }, _device.now(), [&] (Alarm &alarm) {
alarm.session.handle_wakeup(); }));
/* schedule next wakeup */
_device.update_deadline(next_deadline(_alarms));
}
Main(Genode::Env &env) : _env(env)
{
_env.parent().announce(_env.ep().manage(_root));
}
};
void Component::construct(Genode::Env &env) { static Timer::Main inst(env); }

View File

@@ -1,9 +1,6 @@
TARGET = fiasco_timer_drv
LIBS += syscall-fiasco
GEN_DIR := $(dir $(call select_from_repositories,src/timer/main.cc))
INC_DIR += $(GEN_DIR)/periodic
SRC_CC += periodic/time_source.cc fiasco/time_source.cc
TARGET = fiasco_timer
INC_DIR += $(PRG_DIR)
SRC_CC += component.cc
LIBS += base syscall-fiasco
vpath %.cc $(GEN_DIR)
include $(GEN_DIR)/target.inc
REP_INC_DIR += src/include

View File

@@ -25,14 +25,9 @@ namespace Genode { struct Foc_thread_state; }
struct Genode::Foc_thread_state : Thread_state
{
Foc::l4_cap_idx_t kcap; /* thread's gate cap in its PD */
uint16_t id; /* ID of gate capability */
addr_t utcb; /* thread's UTCB in its PD */
/**
* Constructor
*/
Foc_thread_state() : kcap(Foc::L4_INVALID_CAP), id(0), utcb(0) { }
Foc::l4_cap_idx_t kcap { Foc::L4_INVALID_CAP }; /* thread's gate cap in its PD */
uint32_t id { }; /* ID of gate capability */
addr_t utcb { }; /* thread's UTCB in its PD */
};
#endif /* _INCLUDE__FOC__THREAD_STATE_H_ */

View File

@@ -13,4 +13,3 @@ SRC_CC += rpc_dispatch_loop.cc
SRC_CC += thread.cc thread_bootstrap.cc thread_myself.cc utcb.cc
SRC_CC += capability.cc
SRC_CC += signal_source_client.cc
SRC_CC += platform.cc

View File

@@ -4,6 +4,7 @@ LIBS += base-foc-common syscall-foc cxx
SRC_CC += cap_map_remove.cc cap_alloc.cc
SRC_CC += cache.cc
SRC_CC += capability_slab.cc
SRC_CC += thread_start.cc
SRC_CC += signal_transmitter.cc signal.cc
SRC_CC += stack_area_addr.cc

View File

@@ -8,15 +8,13 @@ MAKEOVERRIDES := $(filter-out KERNEL=%,$(MAKEOVERRIDES))
unexport KERNEL
$(FOC_BUILD_DIR):
$(VERBOSE_MK) set -o pipefail; \
$(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) $(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_DIR) -C $(FOC_SRC) BUILDDIR=$@ \
$(KERNEL_BUILD_OUTPUT_FILTER)
$(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out
$(FOC): $(FOC_BUILD_DIR)
$(VERBOSE_MK) set -o pipefail; \
$(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
$(VERBOSE_MK) $(MAKE) CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \
CC="$(CC)" CXX="$(CXX)" \
$(VERBOSE_DIR) -C $(FOC_BUILD_DIR) \
$(KERNEL_BUILD_OUTPUT_FILTER)

View File

@@ -39,6 +39,9 @@ PKG_TAGS = $(addsuffix .tag,$(addsuffix .$(BOARD),$(PKGS)))
BUILD_OUTPUT_FILTER = 2>&1 | sed "s~^~ [$*] ~"
# do not confuse third-party sub-makes
unexport .SHELLFLAGS
#
# Execute the rules in this file only at the second build stage when we know
# about the complete build settings, e.g., 'CROSS_DEV_PREFIX'.
@@ -55,8 +58,7 @@ endif
.NOTPARALLEL: $(PKG_TAGS)
%.$(BOARD).tag:
$(VERBOSE_MK) set -o pipefail; \
$(MAKE) $(VERBOSE_DIR) O=$(L4_BUILD_DIR) -C $(L4_PKG_DIR)/$* \
$(VERBOSE_MK) $(MAKE) $(VERBOSE_DIR) O=$(L4_BUILD_DIR) -C $(L4_PKG_DIR)/$* \
"$(L4_BUILD_OPT)" WARNINGS=$(WARNINGS) $(BUILD_OUTPUT_FILTER)
$(VERBOSE)mkdir -p $(dir $@) && touch $@

View File

@@ -37,7 +37,7 @@ CC_OPT += -DL4SYS_USE_UTCB_WRAP=1 -Wno-unused-function
# build system will stuble over predefined variables, i.e., 'LIB'
#
$(L4_BUILD_DIR)/.kconfig:
$(VERBOSE_MK) set -o pipefail; \
$(VERBOSE_MK) \
MAKEFLAGS= $(MAKE) $(VERBOSE_DIR) -C $(L4_SRC_DIR)/l4 \
B=$(L4_BUILD_DIR) DROPSCONF_DEFCONFIG="$(L4_CONFIG)" \
VERBOSE="$(VERBOSE)" CROSS_COMPILE="$(CROSS_DEV_PREFIX)" \

View File

@@ -11,10 +11,11 @@ diff --git a/l4/pkg/l4re-core/l4sys/include/kdebug.h b/l4/pkg/l4re-core/l4sys/in
index cfb17464..64ee9900 100644
--- a/l4/pkg/l4re-core/l4sys/include/kdebug.h
+++ b/l4/pkg/l4re-core/l4sys/include/kdebug.h
@@ -133,6 +133,13 @@ __kdebug_op_1(unsigned op, l4_mword_t val) L4_NOTHROW
@@ -133,6 +133,14 @@ __kdebug_op_1(unsigned op, l4_mword_t val) L4_NOTHROW
return res;
}
+__attribute__((optimize("no-tree-loop-distribute-patterns")))
+L4_INLINE unsigned __kdebug_strlen(char const * s)
+{
+ unsigned r = 0;

View File

@@ -1,15 +0,0 @@
L4: enable GCC 10
diff --git a/l4/mk/Makeconf b/l4/mk/Makeconf
index eb59b51..a7b5955 100644
--- a/l4/mk/Makeconf
+++ b/l4/mk/Makeconf
@@ -52,7 +52,7 @@ L4_KIP_OFFS_SYS_DEBUGGER = 0x900
L4_STACK_ADDR ?= $(L4_STACK_ADDR_$(ARCH))
L4_STACK_SIZE ?= $(if $(L4_STACK_SIZE_MAIN_THREAD),$(L4_STACK_SIZE_MAIN_THREAD),0x8000)
-CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9
+CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9 10
CC_WHITELIST-clang := 3.5 3.6 3.7 3.8 3.9
# This is quite bad: There is no other chance to disable the page-alignedment

View File

@@ -0,0 +1,15 @@
L4: enable GCC 12
diff --git a/l4/mk/Makeconf b/l4/mk/Makeconf
index eb59b51..a7b5955 100644
--- a/l4/mk/Makeconf
+++ b/l4/mk/Makeconf
@@ -52,7 +52,7 @@ L4_KIP_OFFS_SYS_DEBUGGER = 0x900
L4_STACK_ADDR ?= $(L4_STACK_ADDR_$(ARCH))
L4_STACK_SIZE ?= $(if $(L4_STACK_SIZE_MAIN_THREAD),$(L4_STACK_SIZE_MAIN_THREAD),0x8000)
-CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9
+CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9 10 11 12
CC_WHITELIST-clang := 3.5 3.6 3.7 3.8 3.9
# This is quite bad: There is no other chance to disable the page-alignedment

View File

@@ -1,15 +0,0 @@
FOC: enable GCC 10
diff --git a/src/Makeconf b/src/Makeconf
index de5b656..7660daa 100644
--- a/src/Makeconf
+++ b/src/Makeconf
@@ -244,7 +244,7 @@ ifeq ($(CC_TYPE),gcc)
endif
-CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9
+CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9 10
CC_WHITELIST-clang := 3.6 3.7 3.8 3.9 4.0 5.0 6.0 7.0 8.0 9.0
CC_WHITELIST := $(CC_WHITELIST-$(CC_TYPE))

View File

@@ -0,0 +1,15 @@
FOC: enable GCC 12
diff --git a/src/Makeconf b/src/Makeconf
index de5b656..7660daa 100644
--- a/src/Makeconf
+++ b/src/Makeconf
@@ -244,7 +244,7 @@ ifeq ($(CC_TYPE),gcc)
endif
-CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9
+CC_WHITELIST-gcc := 4.7 4.8 4.9 5 6 7 8 9 10 11 12
CC_WHITELIST-clang := 3.6 3.7 3.8 3.9 4.0 5.0 6.0 7.0 8.0 9.0
CC_WHITELIST := $(CC_WHITELIST-$(CC_TYPE))

View File

@@ -0,0 +1,94 @@
From 8d55cdc73b07dd56ae59a42bcc11cde82614334a Mon Sep 17 00:00:00 2001
From: Frank Mehnert <frank.mehnert@kernkonzept.com>
Date: Mon, 10 May 2021 00:00:00 +0000
Subject: [PATCH] ia32: add implementation for '__udivmoddi4()'
This function is implicitly required by code in jdb.cpp performing a
64-bit integer division on 32-bit systems. This function is required
by code generated with gcc-11. Code generated with older versions of
gcc was satisfied with the existing implementation for '__udivdi3'.
Also fix cosmetic issues in gcc_lib.c and add Doxygen documentation.
Change-Id: If5b44a9e98429c4fc3eacdd5af8bdaf33c9c2a8f
---
src/lib/libk/gcc_lib.c | 49 +++++++++++++++++++++++++++++++++++-------
1 file changed, 41 insertions(+), 8 deletions(-)
diff --git a/src/lib/libk/gcc_lib.c b/src/lib/libk/gcc_lib.c
index e5626145..b121cb63 100644
--- a/src/lib/libk/gcc_lib.c
+++ b/src/lib/libk/gcc_lib.c
@@ -1,6 +1,8 @@
unsigned long long __umoddi3(unsigned long long, unsigned long long);
unsigned long long __udivdi3(unsigned long long, unsigned long long);
+unsigned long long __udivmoddi4(unsigned long long, unsigned long long,
+ unsigned long long *);
struct llmoddiv_t
{
@@ -31,15 +33,15 @@ static struct llmoddiv_t llmoddiv(unsigned long long div, unsigned long long s)
while (1)
{
if (div >= s)
- {
- div -= s;
- i |= tmp;
- }
+ {
+ div -= s;
+ i |= tmp;
+ }
if (div == 0)
- break;
+ break;
tmp >>= 1;
if (!tmp)
- break;
+ break;
s >>= 1;
}
@@ -47,8 +49,39 @@ static struct llmoddiv_t llmoddiv(unsigned long long div, unsigned long long s)
}
+/**
+ * 64-bit unsigned modulo for 32-bit machines.
+ *
+ * \param div Dividend.
+ * \param s Divisor.
+ * \return div / s.
+ */
unsigned long long __umoddi3(unsigned long long div, unsigned long long s)
-{ return llmoddiv(div,s).mod; }
+{ return llmoddiv(div, s).mod; }
+/**
+ * 64-bit unsigned division for 32-bit machines.
+ *
+ * \param div Dividend.
+ * \param s Divisor.
+ * \return div / s.
+ */
unsigned long long __udivdi3(unsigned long long div, unsigned long long s)
-{ return llmoddiv(div,s).div; }
+{ return llmoddiv(div, s).div; }
+
+/**
+ * 64-bit unsigned division + modulo for 32-bit machines.
+ *
+ * \param n Dividend.
+ * \param d Divisor.
+ * \param[out] r Pointer to the result holding div % s.
+ * \return div / s.
+ */
+unsigned long long __udivmoddi4(unsigned long long div, unsigned long long s,
+ unsigned long long *r)
+{
+ struct llmoddiv_t md = llmoddiv(div, s);
+ if (r)
+ *r = md.mod;
+ return md.div;
+}

View File

@@ -0,0 +1,17 @@
Fix reboot loop when built with GCC 12.
diff --git a/src/Makeconf b/src/Makeconf
index bb7ad16c..2fe11226 100644
--- a/src/Makeconf
+++ b/src/Makeconf
@@ -167,8 +167,8 @@ NOOPT_SHARED_FLAGS += $(NOOPT_SHARED_FLAGS-$(CC_TYPE))
# Standard compile flags
ASFLAGS += $(SHARED_FLAGS) -DASSEMBLER
ASFLAGS-clang += -no-integrated-as
-CFLAGS += $(SHARED_FLAGS) -Wbad-function-cast -Wstrict-prototypes
-CXXFLAGS += $(SHARED_FLAGS) -fno-rtti -fno-exceptions
+CFLAGS += $(SHARED_FLAGS) -Wbad-function-cast -Wstrict-prototypes -fno-tree-loop-distribute-patterns
+CXXFLAGS += $(SHARED_FLAGS) -fno-rtti -fno-exceptions -fno-tree-loop-distribute-patterns
OPT_CFLAGS += $(OPT_SHARED_FLAGS)
OPT_CXXFLAGS += $(OPT_SHARED_FLAGS)
NOOPT_CFLAGS += $(NOOPT_SHARED_FLAGS)

View File

@@ -1 +1 @@
abe2de76835f33297ca4e4ac687e69bc04f83dc5
00cfb7994fee75bb5aae010a3d2c16a7ffd29ec9

View File

@@ -37,11 +37,13 @@ PATCH_OPT(patches/0014-Always-enable-user-mode-access-for-performance-monit.patc
PATCH_OPT(patches/0015-VMX-disable-event-injection-if-requested-by-VMM.patch) := -p3 -d${DIR(foc)}
PATCH_OPT(patches/0016-svm-provide-cr0-to-guest-if-np-enabled.patch) := -p3 -d${DIR(foc)}
PATCH_OPT(patches/0017-svm-avoid-forceful-exit-on-task-switch.patch) := -p3 -d${DIR(foc)}
PATCH_OPT(patches/0018-L4-enable-gcc_10.patch) := -p2 -d${DIR(mk)}
PATCH_OPT(patches/0018-L4-enable-gcc_12.patch) := -p2 -d${DIR(mk)}
PATCH_OPT(patches/0019-Bootstrap-do-not-depend-on-any-libstdcxx-feature.patch) := -p1 -d${DIR(bootstrap)}
PATCH_OPT(patches/0020-Bootstrap-fix-amd64-build-with-binutils-2_32.patch) := -p1 -d${DIR(bootstrap)}
PATCH_OPT(patches/0021-FOC-enable-gcc_10.patch) := -p1 -d${DIR(foc)}
PATCH_OPT(patches/0021-FOC-enable-gcc_12.patch) := -p1 -d${DIR(foc)}
PATCH_OPT(patches/0022-FOC-amd64-split-_syscall_entry-into-code-and-data.patch) := -p1 -d${DIR(foc)}
PATCH_OPT(patches/0023-FOC-arm-link-bootstrap-as-et_rel.patch) := -p1 -d${DIR(foc)}
PATCH_OPT(patches/0024-FOC-ia32-add-implementation-for-__udivmoddi4.patch) := -p1 -d${DIR(foc)}
PATCH_OPT(patches/0025-FOC-no-tree-loop-distribute-patterns.patch) := -p1 -d${DIR(foc)}
$(call check_tool,gawk)

View File

@@ -1 +1 @@
2022-02-27 cf39679df76dd41650f89694fffa660af1c6ee32
2024-12-10 4247239f4d3ce9a840be368ac9e054e8064c01c6

View File

@@ -1 +1 @@
2022-02-27 eedec64df2d3b087b1396078b2b8bc6da36bf6ae
2024-12-10 39609d3553422b8c7c6acff2db845c67c5f8912b

View File

@@ -1 +1 @@
2022-02-27 035701a0c05461ee2381447de985f42fab5dbe34
2024-12-10 7867db59531dc9086e76b74800125ee61ccc310e

View File

@@ -1 +1 @@
2022-02-27 bd9cc55e5f41615e5474586a4d10483999545194
2024-12-10 3fc7c1b2cae2b9af835c97bf384b10411ec9c511

View File

@@ -1 +1 @@
2022-02-27 6268532bb738c2d80d7f740ae32a931885bd94e8
2024-12-10 68ee5bc5640e1d32c33f46072256d5b1c71bef9b

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
sed -i "s/foc_timer/timer/" src/timer/foc/target.mk

View File

@@ -1,4 +1,4 @@
build "core init test/cap_integrity"
build { core init lib/ld test/cap_integrity }
create_boot_directory
@@ -20,7 +20,7 @@ install_config {
</config>
}
build_boot_image "core ld.lib.so init test-cap_integrity"
build_boot_image [build_artifacts]
append qemu_args "-nographic "

View File

@@ -17,7 +17,7 @@
/* Fiasco.OC includes */
#include <foc/syscall.h>
using namespace Genode;
using namespace Core;
void Core_log::out(char const c)

View File

@@ -20,24 +20,25 @@
#include <base/mutex.h>
#include <synced_range_allocator.h>
namespace Genode { class Cap_id_allocator; }
/* core includes */
#include <types.h>
namespace Core { class Cap_id_allocator; }
class Genode::Cap_id_allocator
class Core::Cap_id_allocator
{
public:
using id_t = uint16_t;
enum { ID_MASK = 0xffff };
using id_t = unsigned;
private:
enum {
CAP_ID_RANGE = ~0UL,
CAP_ID_MASK = ~3UL,
CAP_ID_NUM_MAX = CAP_ID_MASK >> 2,
CAP_ID_OFFSET = 1 << 2
CAP_ID_OFFSET = 1 << 2,
CAP_ID_MASK = CAP_ID_OFFSET - 1,
CAP_ID_RANGE = 1u << 28,
ID_MASK = CAP_ID_RANGE - 1,
};
Synced_range_allocator<Allocator_avl> _id_alloc;

View File

@@ -18,15 +18,18 @@
#include <base/internal/native_thread.h>
#include <base/internal/cap_map.h>
namespace Genode {
/* core includes */
#include <types.h>
namespace Core {
class Core_cap_index;
class Platform_thread;
class Pd_session_component;
class Core_cap_index;
}
class Genode::Core_cap_index : public Native_capability::Data
class Core::Core_cap_index : public Native_capability::Data
{
private:

View File

@@ -16,16 +16,15 @@
/* core includes */
#include <cap_index.h>
#include <util/noncopyable.h>
namespace Genode { class Cap_mapping; }
namespace Core { class Cap_mapping; }
/**
* A Cap_mapping embodies a capability of core, and its mapped
* copy in another protection domain.
*/
class Genode::Cap_mapping : Noncopyable
class Core::Cap_mapping : Noncopyable
{
private:

View File

@@ -27,16 +27,16 @@
/* base-internal includes */
#include <base/internal/native_thread.h>
/* core-local includes */
/* core includes */
#include <mapping.h>
/* Fiasco.OC includes */
#include <foc/syscall.h>
namespace Genode { class Ipc_pager; }
namespace Core { class Ipc_pager; }
class Genode::Ipc_pager : public Native_capability
class Core::Ipc_pager : public Native_capability
{
public:

View File

@@ -20,10 +20,13 @@
#include <irq_session/irq_session.h>
#include <cap_index.h>
namespace Genode { class Irq_object; }
/* core includes */
#include <types.h>
namespace Core { class Irq_object; }
class Genode::Irq_object
class Core::Irq_object
{
private:
@@ -56,8 +59,8 @@ class Genode::Irq_object
uint64_t msi_address() const { return _msi_addr; }
addr_t msi_value() const { return _msi_data; }
void sigh(Genode::Signal_context_capability cap) { _sig_cap = cap; }
void notify() { Genode::Signal_transmitter(_sig_cap).submit(1); }
void sigh(Signal_context_capability cap) { _sig_cap = cap; }
void notify() { Signal_transmitter(_sig_cap).submit(1); }
bool associate(unsigned irq, bool msi, Irq_session::Trigger,
Irq_session::Polarity);

View File

@@ -22,7 +22,7 @@
/* Fiasco.OC includes */
#include <foc/syscall.h>
namespace Genode {
namespace Core {
/**
* Map pages locally within core

View File

@@ -18,15 +18,18 @@
#include <base/rpc_server.h>
#include <foc_native_cpu/foc_native_cpu.h>
namespace Genode {
/* core includes */
#include <types.h>
namespace Core {
class Cpu_session_component;
class Native_cpu_component;
}
class Genode::Native_cpu_component : public Rpc_object<Cpu_session::Native_cpu,
Native_cpu_component>
class Core::Native_cpu_component : public Rpc_object<Cpu_session::Native_cpu,
Native_cpu_component>
{
private:

View File

@@ -17,10 +17,10 @@
#include <base/mutex.h>
#include <foc/thread_state.h>
namespace Genode { struct Pager_object_exception_state; }
namespace Core { struct Pager_object_exception_state; }
struct Genode::Pager_object_exception_state
struct Core::Pager_object_exception_state
{
Mutex mutex { };
unsigned exceptions; /* counts exceptions raised by the thread */

View File

@@ -21,7 +21,7 @@
#include <base/synced_allocator.h>
#include <base/allocator_avl.h>
/* Core includes */
/* core includes */
#include <pager.h>
#include <cap_id_alloc.h>
#include <platform_generic.h>
@@ -32,10 +32,10 @@
namespace Foc { struct l4_kernel_info_t; }
namespace Genode { class Platform; }
namespace Core { class Platform; }
class Genode::Platform : public Platform_generic
class Core::Platform : public Platform_generic
{
private:
@@ -55,13 +55,14 @@ class Genode::Platform : public Platform_generic
*/
Sigma0(Cap_index*);
int pager(Ipc_pager &) override { /* never called */ return -1; }
/* never called */
Pager_result pager(Ipc_pager &) override { return Pager_result::STOP; }
};
/*
* Shortcut for the type of allocator instances for physical resources
*/
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
using Phys_allocator = Synced_range_allocator<Allocator_avl>;
Platform_pd *_core_pd = nullptr; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
@@ -132,7 +133,8 @@ class Genode::Platform : public Platform_generic
*/
Core_pager(Platform_pd &core_pd, Sigma0 &);
int pager(Ipc_pager &) override { /* never called */ return -1; }
/* never called */
Pager_result pager(Ipc_pager &) override { return Pager_result::STOP; }
};
/**

View File

@@ -36,14 +36,14 @@
/* Fiasco.OC includes */
#include <foc/syscall.h>
namespace Genode {
namespace Core {
class Platform_thread;
class Platform_pd;
}
class Genode::Platform_pd : public Address_space
class Core::Platform_pd : public Address_space
{
private:

View File

@@ -26,14 +26,14 @@
#include <cap_mapping.h>
#include <assertion.h>
namespace Genode {
namespace Core {
class Platform_pd;
class Platform_thread;
}
class Genode::Platform_thread : Interface
class Core::Platform_thread : Interface
{
private:
@@ -45,7 +45,7 @@ class Genode::Platform_thread : Interface
enum State { DEAD, RUNNING };
typedef String<32> Name;
using Name = String<32>;
friend class Platform_pd;
@@ -60,6 +60,7 @@ class Genode::Platform_thread : Interface
Platform_pd *_platform_pd; /* protection domain thread is bound to */
Pager_object *_pager_obj;
unsigned _prio;
bool _bound_to_pd = false;
Affinity::Location _location { };
@@ -74,8 +75,8 @@ class Genode::Platform_thread : Interface
/**
* Constructor for non-core threads
*/
Platform_thread(size_t, const char *name, unsigned priority,
Affinity::Location, addr_t);
Platform_thread(Platform_pd &, Rpc_entrypoint &, Ram_allocator &, Region_map &,
size_t, const char *name, unsigned priority, Affinity::Location, addr_t);
/**
* Constructor for core main-thread
@@ -93,16 +94,18 @@ class Genode::Platform_thread : Interface
*/
~Platform_thread();
/**
* Return true if thread creation succeeded
*/
bool valid() const { return _bound_to_pd; }
/**
* Start thread
*
* \param ip instruction pointer to start at
* \param sp stack pointer to use
*
* \retval 0 successful
* \retval -1 thread could not be started
*/
int start(void *ip, void *sp);
void start(void *ip, void *sp);
/**
* Pause this thread
@@ -133,15 +136,11 @@ class Genode::Platform_thread : Interface
/**
* Override thread state with 's'
*
* \throw Cpu_session::State_access_failed
*/
void state(Thread_state s);
/**
* Read thread state
*
* \throw Cpu_session::State_access_failed
*/
Foc_thread_state state();
@@ -156,10 +155,10 @@ class Genode::Platform_thread : Interface
Affinity::Location affinity() const;
/**
* Make thread to vCPU
* Turn thread into vCPU
*/
Foc::l4_cap_idx_t setup_vcpu(unsigned, Cap_mapping const &,
Cap_mapping &, Region_map::Local_addr &);
Cap_mapping &, addr_t &);
/************************

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