Compare commits

..

1011 Commits

Author SHA1 Message Date
Christian Helmuth
abc9a2f232 depot: update recipe hashes 2021-10-14 13:46:25 +02:00
Norman Feske
0a35e02961 sculpt: documentation update
Issue #4281
2021-10-14 13:22:18 +02:00
Christian Helmuth
98ffa60577 Increase cap quota for system-shell terminal 2021-10-14 11:48:23 +02:00
Josef Söntgen
9980718c92 libyuv: build unoptimized on ARMv8 2021-10-14 11:46:42 +02:00
Josef Söntgen
2e0d9c8521 libdrm: short-cut tiling in iris back end
Apparently the iris driver does not make use of tiling by the kernel, so
we shortcut the 'SET_TILING' call to keep iris happy with this quickfix.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #4291
2021-10-14 11:02:13 +02:00
Christian Helmuth
c7abc9f983 vbox6: add pkg with webcam capture support
Issue #4281
Issue #4287
2021-10-14 11:02:13 +02:00
Christian Helmuth
d078f7db76 qemu-usb: adapt to webcam capture on/off changes
Issue #4287
2021-10-14 11:02:13 +02:00
Norman Feske
6f1d3862cd base: introduce Env::try_session
The new 'Env::try_session' method mirrors the existing 'Env::session'
without implicitly handling exceptions of the types 'Out_of_ram',
'Out_of_caps', 'Insufficient_ram_quota', and 'Insufficient_cap_quota'.
It enables runtime environments like init to reflect those exceptions to
their children instead of paying the costs of implicit session-quota
upgrades out of the own pocket.

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

Issue #3767
2021-10-14 11:02:12 +02:00
Christian Prochaska
d5d7915b4d audio_in: fix compile errors when strict warnings are enabled
Fixes #4290
2021-10-14 11:02:11 +02:00
Christian Prochaska
b337ee2f2b vfs_oss: fix output fragment limit calculations
Fixes #4289
2021-10-14 11:02:11 +02:00
Johannes Schlatow
ef8a43c546 base-hw: cache maintenance
touch each page before flushing to ensure that it's present in the page table

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Thanks to Peter for the initial fix.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* Catch errors during resource allocation

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Issue #4258
2021-10-13 14:01:02 +02:00
Tomasz Gajewski
e34d1550a4 ssh_terminal: added missing include
Issue #4258
2021-10-13 14:01:02 +02:00
Christian Helmuth
77a5cf7fd4 vbox6: enable audio via OSS plugin 2021-10-13 14:01:02 +02:00
Christian Helmuth
2ba5e4a5b1 libc/oss: check argp per ioctl
... as some ioctls do not require a valid pointer.
2021-10-13 14:01:02 +02:00
Christian Helmuth
5c82045170 vbox6: enable mouse wheel reporting 2021-10-13 14:01:02 +02:00
Christian Helmuth
4a87fcc4cf vbox6: fix TPR handling 2021-10-13 14:01:02 +02:00
Christian Helmuth
e5b828ae8f Switch to genodelabs depot in depot_download test 2021-10-13 14:01:02 +02:00
Martin Stein
f1b72d0281 cxx: define delete operator with alignm. arg
Using 'alignas' in declarations might cause GCC to request for an
implementation of 'operator delete(void*, unsigned long, std::align_val_t)'
although it might actually never be called. This commit adds a dummy
implementation to 'cxx/new_delete.cc' that does nothing more than printing an
error to the log that a proper implementation is missing. This approach is
coherent with our treatment of other global delete operators.

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

Ref #4217
2021-10-13 13:59:57 +02:00
Christian Helmuth
64e2912a2f version: 21.08 2021-08-31 12:02:22 +02:00
Norman Feske
339dda8b43 News item for version 21.08 2021-08-31 12:02:22 +02:00
Norman Feske
397a3e45d1 Release notes for version 21.08 2021-08-31 12:02:22 +02:00
Norman Feske
f8898f3a56 doc: add server/black_hole to components.txt 2021-08-31 12:02:22 +02:00
Christian Helmuth
83c5648d33 depot: update recipe hashes 2021-08-30 15:00:39 +02:00
Martin Stein
7fdebc6a09 nic_router: let DHCP client request domain name
The NIC router parses, stores and forwards DNS domain names from DHCP replies.
Yet the routers DHCP client used to not request DNS domain-name information on
DHCP requests. This caused DHCP servers to skip this information on their
replies although it was available. This commit fixes the issue by adding the
DNS domain name code to the request parameter list of requests from the routers
DHCP client.
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
4782f9376c recipe: Qt5 texedit adjust to new Mesa version
Add dependency to 'libdrm' as it is required by Mesa 21

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

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

<config>
	<audio_out/>
</config>

Issue #3653
2021-08-30 15:00:38 +02:00
Johannes Schlatow
2b0bb6dda0 trace: comment x86 timestamp() implementations
Fixes genodelabs/genode#4243
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
31b049864c qt5_opengl: Disable Vulkan feature
With Mesa-21, Qt5 detects Vulkan to be enabled, even though it is not
supported in Genode. Also add DRM library in Qt5 run script.

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
46be4f1145 mesa_demo: adjust to Mesa 21.0.0
* support argc/argv + double buffering (Alexander Boettcher)
* Route intel/gpu driver to platform driver
* Use Gui session instead of framebuffer session (Josef Söntgen)

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
e4ae817e82 ram_fb_drv: RAM framebuffer driver for Qemu
Enable "-device ramfb" to use in Qemu. Also add drivers interactive
using this framebuffer for the "virt_qemu" platform.

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
38d731bd79 libports: Add Mesa-21.0.0 support
* Switch mesa support from DRI to gallium
  Supported drivers are
    - softpipe (Sebstian Sumpf)
    - iris for Intel GPUs (Alexander Boetcher)
    - etnaviv for Vivante GPUs (Josef Söntgen)

* Mesa's generated files are placed into 'contrib/mesa-<hash>/generated'
  and are cloned per default from a separate Git repo in order to avoid
  hash updates upon package build. In case you need to generate files
  yourself use
  ! prepare_port mesa GENERATE_FILES=1

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
9041567f14 libports: Remove Mesa-11.2.2
issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
b6ec4bdf05 libc/stdcxx ABI: symbols for Mesa-21.0.0
issue #4254
2021-08-30 15:00:38 +02:00
Josef Söntgen
dd90424129 libports: libdrm-2.4.105 update
Support for iris and etnvaviv

* entaviv:
  - libdrm on FreeBSD is not prepared for !PCI (and libc our is missing
    <sys/pciio.h>
  - missing <sys/types.h> include in xf86drmMode.c
  - etnaviv relies on linux header files - dummy in $(INC_DIR)
  - IOCTL FreeBSD ↔ Linux have swapped IO/OUT bit
  - O_CLOEXEC differs between FreeBSD ↔ Linux

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
c26c50e59b libports: remove libdrm 2.4.21
issue #4254
2021-08-30 15:00:38 +02:00
Josef Söntgen
ac9e0947fd libc: add HM_REALMEM sysctl
Used by Mesa in the Gallium etnaviv driver.

issue #4254
2021-08-30 15:00:37 +02:00
Josef Söntgen
fb4d357b59 libc: pull in sys/pciio.h
This header is needed by recent versions of libdrm that feature
FreeBSD support.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
7a4626861e gpu/intel: add w/a for gen9 kabylake a0-b0 stepping
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
bac7381be3 gpu/intel: adjust submit batch to linux 5.13 handling
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
6b1f1794c4 gpu/intel: add gen9 forcewake support
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
eab92f8d6f gpu/intel: add clock gating for kabylake
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
ee283c0d12 gpu/intel: dump more in error case
- show hardware read tail & head pointer of ring buffer

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
c5d8a43418 gpu/intel: sanity check tail pointer alignment
According to spec the tail pointer points to the next qword instructions
which will be used by the software.

p 1354, Doc Ref # IHD-OS-BDW-Vol 2c-11.15

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
cc2363d421 gpu/intel: report slice, subslice, eu via gpu info
used by libdrm & mesa-21 clients

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
b287c4888a gpu/intel: update context inhibit setup
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
66ac2dc635 gpu/intel: avoid one-by-off in ring buffer
during wrap.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
6c7bcdd32e gpu/intel: add gen9 w/a for submit batch
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
b2440a72c3 gpu/intel: add more debug registers
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
8a285a7bee gpu/intel: add more debug registers
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
c9809fde67 gpu/intel: remove unused superpage scratch code
Superpages (2M, 1G) are not supported by now, but partially copied over code
from base-hw was around. Remove unused register definitions and remove
non-working super page code do avoid confusion.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
de8327c11a gpu/intel: add more supported chips
support for Gen > 8

+ determine platform, revision and stepping

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
0aa17661cc gpu/intel: avoid overlapping ggtt range allocation
Size argument of ggtt free range check is ignored, which leads to
overlapping allocations inside, which leads to unavailable IO-MEM exceptions
thrown by core.

issue #4254
2021-08-30 15:00:37 +02:00
Norman Feske
82a51d8eaa build: operate ccache in preprocessor mode
This avoids consistency problems when header files are shadowed.

Fixes #4256
2021-08-30 15:00:37 +02:00
Norman Feske
040628894c build: introduce GLOBAL_DEPS variable
The new varible can be used to trigger the rebuild of the entire target
whenever any of the listed files changes.

Fixes #4255
2021-08-30 15:00:37 +02:00
Johannes Schlatow
b5dd1dd01b trace: consolidate Trace_buffer implementations
Both, trace_logger and vfs_trace had their own trace_buffer.h. This
commit consolidates the existing implementations and provides the
resulting trace_buffer.h at 'include/trace/'. It thereby becomes part of
the trace api archive.

genodelabs/genode#4244
2021-08-30 15:00:37 +02:00
Johannes Schlatow
ffbd26d63f depot: add trace policy api
genodelabs/genode#4244
2021-08-30 15:00:36 +02:00
Johannes Schlatow
1416b2258f Trace_buffer: do not reprocess last read entry
genodelabs/genode#4244
2021-08-30 15:00:36 +02:00
Norman Feske
436d946300 recipes/api/genode_c_api: add src/lib/genode_c_api
The source codes are needed to use the API because they are statically
linked.
2021-08-30 15:00:36 +02:00
Norman Feske
324ad33736 lx_emul: prevent clk_disable_unused
Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
2cb4157211 lx_emul: support IRQCHIP_DECLARE initcalls
Similar to CLK_OF_DECLARE, this patch extends lx_emul with ability to
extend the __irqchip_of_table with secondary interrupt controllers.

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
c95af254f4 lx_emul: sanitize size 0 for __kmalloc
Driver code such as mfd-core.c may pass 0 as argument n to kcalloc,
which eventually results in an allocation size 0.

  res = kcalloc(cell->num_resources, sizeof(*res), GFP_KERNEL);

Since 'res' is checked against NULL for success, kmalloc must not return
a NULL pointer in this case. The patch works around this issue by
forcing an allocation size of 1 byte in this case.

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
29032caf40 lx_emul: support CLK_OF_DECLARE initcall mechanism
Clock providers such as drivers/clk/sunxi-ng/ccu-sun8i-r.c don't use
regular init calls but declare their init functions via CLK_OF_DECLARE,
which fill the __clk_of_table. Linux populates the table statically by
using special sections declared in the linker script. In contrast, we
populate the table by expanding the macro to global constructor
functions.

The __clk_of_table is then processed by the call of of_clk_init(NULL).

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
36af114d78 lx_emul: enhance krealloc implementation
Issue #4253
2021-08-30 15:00:36 +02:00
Christian Prochaska
149bd999f3 vfs_oss: support more commands for VirtualBox 6 and sndio
Fixes #4252
2021-08-30 15:00:36 +02:00
Christian Helmuth
a6fb61dbf2 vbox6: support dynamic framebuffer resolution
Issue #4031
2021-08-30 15:00:36 +02:00
Johannes Schlatow
50cc51f132 tool: support new u-boot FIT image format
Fixes genodelabs/genode#4250
2021-08-30 15:00:36 +02:00
Christian Helmuth
c54473abea vbox6: update to version 6.1.26
Issue #4031
2021-08-30 15:00:35 +02:00
Christian Helmuth
611e93a5f2 vbox6: kick AHCI asynchronous IO thread
Issue #4031
2021-08-30 15:00:35 +02:00
Christian Helmuth
d6bde82894 vbox6: add libyuv to pkg recipe
Issue #4031
2021-08-30 15:00:35 +02:00
Johannes Schlatow
88b3880c77 base: fix shift overflow error in Bitfield::mask()
Fixes genodelabs/genode#4249
2021-08-30 15:00:35 +02:00
Christian Helmuth
7618c9410a depot: update recipe hashes 2021-08-18 15:06:12 +02:00
Johannes Schlatow
5e284bfb35 trace: disable tracing when owner disappears
* Disable trace source and release ownership on subject destruction.
* Note, since the policy module is also destroyed on descruction of the
  session component, the traced component must not access the policy
  module when acknowledging the disabled state (else: page fault).

Fixes genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Johannes Schlatow
81d939f947 test-trace: test destruction of trace subjects
If the trace subjects are not properly destructed when the TRACE client
disappears, enabled sources will be owned by a non-existing client.
In other words, when a TRACE client disappears all sources owned by the
client must be disabled.

genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Johannes Schlatow
9898341d4a depot_autopilot: fix ineffective test-trace
test-trace always passed, although tracing was never enabled because the
trace subject was not within the first 32 subjects.

* increase number of queried subjects
* output error if trace subject was not found

genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Martin Stein
812fdec27c nic_router: propagate dns domain name via dhcp
With this commit, the NIC router DHCP client reads out the first DNS domain
name (DHCP option 15) if any from a DHCP reply that generates an IPv4 config
for a domain and stores the name together with the IPv4 config for that domain.
DNS domain names are reported via the new report tag '<dns-domain>' if the
'config' attribute in the config tag '<report>' is set.

Furthermore, the NIC router DHCP server becomes able to obtain a DNS domain
name from another domain that has a DHCP client dynamically (given the config
attribute 'dns_config_from' is set and no static DNS config is given) or
statically from its configuration (new config tag '<dns-domain>') and propagate
this name with DHCP replies (DHCP option 15).

The 'nic_router_dhcp_*' tests are adapted to test the new feautures.

The commit also gets rid of some mirrored files in
'test/nic_router_dhcp/manager'.

Fixes #4246
2021-08-18 15:06:12 +02:00
Martin Stein
fa64aae7f8 nic_router: config attribute 'dns_config_from'
WARNING: BREAKS CONFIG COMPATIBILITY!

This commit changes the configuration interface of the NIC router in a way that
may break systems that use the component without proper adjustment!

How to adjust:
At each occurrence of the 'dns_server_from' attribute in a NIC router
configuration replace the attribute name with 'dns_config_from'. The attribute
value remains unaltered.

DETAILED DESCRIPTION

The new attribute name 'dns_config_from' reflects that also other aspects of
the DNS configuration of the denominated domain are used by the DHCP server
that holds the attribute. This commit is a preparation for forwarding also the
domain name (DHCP option 15) with the mechanism behind the attribute.

Ref #4246
2021-08-18 15:06:12 +02:00
Martin Stein
1111472af7 nic_router: make Ipv4_config a class
The fact that the IPv4 config was a struct with all data members public was a
mere leftover of an early state of the NIC router. Today, the router
implementation style is to avoid structs and public data members wherever
possible.

This commit slightly changes the behavior of the router regarding log output.
The router used to print malformed IPv4 configurations to the log only if
the 'verbose' config flag was set using this style:

! [my_domain] malformed dynamic IP config: interface 10.0.2.1/24 ...

Now, malformed IPv4 configurations are only printed if the
'verbose_domain_state' config flag is set (like with any IP4v configuration
states) using this style:

! [my_domain] dynamic IP config: malformed (interface 10.0.2.1/24 ...)

Fixes #4242
2021-08-18 15:06:12 +02:00
Martin Stein
9e6f7988c2 nic_router: list dns servers in one dhcp option 6
The NIC router DHCP server used to add an extra option 6 field to DHCP replies
for each DNS server address. This conflicts with RFC #2132 section 3.8 which
states that the addresses should be listed within one option 6 field without
delimiter. The discrepancy is fixed by this commit.

Ref #4242
2021-08-18 15:06:12 +02:00
Johannes Schlatow
80c1459e79 fs_query: catch File::Truncated_during_read
Fixes genodelabs/genode#4241
2021-08-18 15:06:12 +02:00
Johannes Schlatow
0840cfe834 vfs_trace: report correct size for value files
File size must be the same as the number of bytes that can be read from
the file. Otherwise, this will trigger a `Truncated_during_read`
exception.

Fixes genodelabs/genode#4240
2021-08-18 15:06:12 +02:00
Martin Stein
e648e7255a nic_router: optional icmp type 3 on fragm. ipv4
Via a new configuration attribute, the user can decide whether the router
should answer dropped fragmented IPv4 with an ICMP "destination unreachable"
packet and, if so, which value the ICMP code field of this packet should have.
The default is that the router doesn't send such responses (silently dropping
fragmented IPv4). The behavior is tested by the 'nic_router_ipv4_fragm' test.

Fixes #4236
2021-08-18 15:06:12 +02:00
Martin Stein
06a4608f4a nic_router: report dropped fragmented IPv4
If the new attribute 'dropped_fragm_ipv4' of the <report> tag in the NIC router
config is set "yes", the router will report the number of packets that were
dropped per interface respectively domain because fragmented IPv4 is not
supported. The default is not to report the counter. The behavior is tested by
the 'nic_router_ipv4_fragm' test.

Ref #4236
2021-08-18 15:06:12 +02:00
Martin Stein
619474bc90 nic_router: drop fragmented IPv4
The NIC router used to ignore the IPv4 header fields "More fragments" and
"Fragment offset" completely. Therefore higher-level protocols of fragmented
IPv4 were interpreted wrong because each fragment was considered a self-
standing packet, expecting, for instance UDP/TCP headers somewhere inside of
the UDP/TCP data field. Normally, such packets were dropped as soon as the
UDP/TCP checksum check failed because of the misinterpretation. However,
it was also possible for fragmented IPv4 to pass the router although normally
only partially.

IPv4 fragmentation support in the router would introduce some potential
security risks and is presumably not an easy endeavor. So, for now, we settled
on not supporting IPv4 fragmentation. With this commit, the router simply drops
all fragmented IPv4. This is reflected to the log for each fragment as "drop
packet (fragmented IPv4 not supported)" when 'verbose_packet_drop="yes"' is
configured.

The new test 'run/nic_router_ipv4_fragm' is an automated test for this
behavior. The test is added to the autopilot list.

Ref #4236
2021-08-18 15:06:12 +02:00
Martin Stein
b0e558f486 net/icmp: cast from integer to 'Code' enum
Add a function to the header for doing this cast.

Ref #4236
2021-08-18 15:06:12 +02:00
Christian Prochaska
d7a27c448d qt5: implement 'CancelableSyncSocket::Shutdown()'
Fixes #4239
2021-08-18 15:06:12 +02:00
Martin Stein
626b2f9cf2 run/libc_vfs_fs_fat: add to autopilot
Excludes board 'virt_qemu' from the test as we don't have block device drivers
for this board.

Ref #4220
2021-08-18 15:06:12 +02:00
Martin Stein
2533d7b4b6 vfs/fatfs: cleanup implementation
- remove redundant file system factory

- remove dead code block

  The code was guarded by preprocessor directives checking whether the
  contrib code define "_USE_MKFS" is 1. As "_USE_MKFS" is not set one
  for our port of FAT, the code was never executed and can be removed.

- remove uneffective config attributes

  Apparently, the former XML attributes to the plugin 'drive' and
  'codepage' had no effect. I tested them in a scenario with the VFS
  block server on a disk-image boot-module as back end. Regardless of
  the 'drive' value, the block session label was always "0". Regardless
  of the 'codepage' value, the FAT on the disk image succeeded to mount
  when not using '--codepage' for 'mkfs.fat' and failed to mount when
  using '--codepage' to specify a supported but foreign codepage for
  'mkfs.fat' (e.g. "720").

Ref #4220
2021-08-18 15:06:12 +02:00
Martin Stein
60c8369718 lib/fatfs: get rid of global static constructors
There was one global static constructor:

! namespace Fatfs { static Constructible<Platform> _platform; }

This caused applications that used the lib or the <fatfs> VFS plugin to end up
in an uncaught exception due to Genode::Component complaining that method
'construct' returned without executing pending static constructors if they
didn't call Genode::Env::exec_static_constructors().

As the use of Genode::Env::exec_static_constructors() is discouraged in Genode,
this commit rather moves the '_platform' object to the scope of the
initializing function and introduces a global static pointer to the object that
gets set by the initializing function. Although this prevents the exception, it
is, technically speaking even worse than the former solution as the new pointer
isn't checked for validity in contrast to the 'Constructible' object.

However, so far, I don't see a clean solution to this problem without the need
for Genode::Env::exec_static_constructors().

Fixes #4220
2021-08-18 15:06:12 +02:00
Christian Helmuth
b59e2ba677 microcode_intel: archive moved to GitHub finally
As version 20180807a is not provided on GitHub, I updated the port to
the most recent release 20210608.

Issue #2762
2021-08-18 15:06:12 +02:00
Sebastian Sumpf
c3e8c22a6d sculpt: integrate intel_gpu_drv
* the GPU multiplexer now offers the platform service to the Intel
  framebuffer driver (driver_manager)
* ajdusted drivers_managed-pc to hand out resources to the GPU driver
* adjust quotas

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
2fe70f111b intel_fb_drv: Aperture exhaustion and display IRQ patch
* display an error in case the aperture is too small for all
  framebuffers
* handle display engine IRQs only

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
1727de30b7 gpu/intel: free DMA, clear ggtt
* free DMA caps in case platform client's session is closed
* clear GGTT of platform client upon session close

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
6c003a13d2 gpu/intel: add platform service for display handling
The platform services is intented to be used by dde_linux's intel_fb_drv
in order to initlialize displays.

* implement and announce platform session
* limit accessible GTT and aperture of client to 64 MB
* forward display engine IRQs to platform client
* move all PCI resources to 'Igd::Resources' class in order to make them
  accessible by the platform service and the GPU driver
* fix fence register allocation for id zero (return true)

issue #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
11192b18e6 gpu/intel: dump status context register bits
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
fe867765a8 gpu/intel: support multiple exec buffer per client
required for mesa-21

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
ffc89f3edf gpu/intel: let guard page handling up to client
For mesa-21 the client takes care and manages
the virtual address space of the vGPU by itself and the intel/gpu driver
can't add silently a guard page anymore. Move the patch to the drm/ioctl
of the former mesa version.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
067b7d7c67 gpu/intel: deny virtual address above 1 << 48
commit avoids memory corruption in the ppgtt page insertion code

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Josef Söntgen
4b653fbac1 gpu/intel: handle double insertion in PPGTT
As the PPGTT is populated by the client, the client has to account for
guard pages and so forth.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Josef Söntgen
7dc997c8e6 gpu/intel: handle CSB correctly
As it turns out reading both dwords as qword results in mirrored
values, DDTT.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
5d6ea5ef22 gpu/intel: allocate vcpu/engine as part of session
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
a721933771 gpu/intel: move context/ring handling into objects
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
c949e5c90d gpu/intel: remove allocator_guard
Issue #3759 #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
243a9ec3ca gpu/intel: free up context/memory ring
_unmap_dataspace_ggtt requires the cap of Ggtt::Mapping (ring_map, ctx_map)
in order to find the right metadata and to free up the ggtt entries. Also the
pte range is removed already if the metadata was found.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
b3147050cc gpu/intel: add support to report finished batches
- extend gpu multiplexer to report last completed execution buffer
- on client side lookup finished buffers and disable busy state

issue #4233
2021-08-18 15:06:11 +02:00
Martin Stein
f8953de7ac nic_router: replace term "uplink" with "NIC client"
BREAKS CONFIG COMPATIBILITY:
This commit changes the configuration interface of the NIC router in a way that
may break systems that use the component without proper adjustment!

HOW TO ADJUST:
At each occurrence of the '<uplink ...>' tag in a NIC router configuration
replace the tag name 'uplink' with 'nic-client'. The rest of the tag stays the
same.

The term "uplink" for network interfaces in the router that have a NIC session
client as back end was introduced in a time when Uplink sessions didn't yet
exist. Now, they do and, although both an uplink and an Uplink session
normally describe a network session between router and network device driver,
they are based on two different service types (NIC and Uplink). This can easily
cause confusion when integrating the router (the <uplink> is not related to
Uplink sessions) or trying to understand its functioning (an 'Uplink' object
has nothing to do with the Uplink service).

Therefore, this commit introduces the more specific term "NIC client" for an
interface that is based on a NIC session requested by the router. This doesn't
imply any semantic changes at the NIC router. However, the commit also brings a
broader update of the router's README and removes the term "downlink" that was
used only in documentation to refer to interfaces backed by a NIC session
provided by the router. The term was only associated with this meaning because
it is the natural counterpart to an uplink. This isn't appropriate anymore as
the terms for interface types have moved to a more technical level.

The commit adjusts all scenarios in the basic Genode repositories properly.

Fixes #4238
2021-08-18 15:06:11 +02:00
Christian Helmuth
fce525f122 depot: update recipe hashes 2021-07-28 11:27:05 +02:00
Martin Stein
2afae7e7c1 nic_router: uncaught exc. on handling link state
An interface that received a signal for a link-state change accessed its
domain reference without assuming that it could not be attached to a domain
at that moment. This caused the NIC router to crash with an uncaught exception
of type 'Net::Pointer<Net::Domain>::Invalid'. The commit adds a catch
directive for this exception resulting in the handler doing nothing if not
attached to any domain.

Fixes #4222
2021-07-28 11:27:05 +02:00
Martin Stein
d06773b957 run/tz_vmm: remove usb_armory support
The test script failed during preparation of the on-target execution for
USB Armory with the following error:

! can't read "tz_vmm_block_irq": no such variable

Presumably, the script wasn't run anymore since the introduction of the
'tz_vmm_block_irq' variable for i.MX53 QSB. As we do not have infrastructure
for automated testing of the USB Armory and there seems to be not much
interest in using Genode on this platform, this commit simply removes the
support from the script.
2021-07-28 11:27:05 +02:00
Martin Stein
c8a8cbd7be run/tz_vmm: fix deprecated use of board specs
Filtering boards in a run script by specs isn't the right way anymore (the
specs do not exist anymore). Nowadays, we have to use [have_board] instead.

Ref #4229
2021-07-28 11:27:05 +02:00
Martin Stein
00e8e363d8 run/tz_vmm: fix broken network test
For unknown reasons, the former 'wget genode.org' call, that was meant to test
network in the Trustzone guest on imx53_qsb_tz, didn't succeed anymore although
the same call succeeded on my Sculpt VM Linux. However, 'ping 1.1.1.1' still
works, so, the script now uses this as test for networking instead.

Fixes #4229
2021-07-28 11:27:05 +02:00
Martin Stein
8bc861ca71 nic_router: do not re-use ARP request as reply
So far, in order to create an ARP reply, the NIC router merely created a copy
of the corresponding ARP request and modified only those values that differ.
This approach has the disadvantage of re-using bad parameters from a broken
request. The specific use-case that made this visible was an early version of
the Pine board network driver that used to forward ARP requests with a greater
size than required. The ARP replies of the router re-used this size and
confused other network nodes with that. In general, the NIC router should
rely on the data of incoming packets the least possible. Therefore, with this
commit, the router creates a new ARP reply from scratch and uses only those
values required from the corresponding ARP request.

Fixes #4235
2021-07-28 11:27:04 +02:00
Martin Stein
9384e075cb ipv4: get rid of C++ bitsets, add DF/MF flags
The former declaration of the IPv4 packet did not only use the questionable
tool of implementation-defined C++ bitsets but also lacked access to flags
"don't fragment" (DF) and "more fragments" (MF). This commit replaces the
C++ bitsets by using the register framework and introduces accessors for the
missing flags.

Ref #4236
2021-07-28 11:27:04 +02:00
rolandbaer
52011ec034 smbios_decoder: fix timer error message
added timer to run file to fix error message.

Fixes #4237
2021-07-28 11:27:04 +02:00
Alexander Boettcher
908d581a8c qemu-usb/webcam: reset delay packet state
on feature reset initiated by guest

Issue #4078
2021-07-28 11:27:04 +02:00
Johannes Schlatow
b38ec9f238 usb_webcam: correctly enable auto exposure mode
genodelabs/genode#4231
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
9334ec09e2 sculpt: route non-usb block sessions to 'drivers' 2021-07-28 11:27:04 +02:00
Johannes Schlatow
1bfc828826 libuvc: add UVC 1.50 support
genodelabs/genode#4231
2021-07-28 11:27:04 +02:00
Johannes Schlatow
b51b9e1ef3 libusb: fix size of control messages
Fixes genodelabs/genode#4230
2021-07-28 11:27:04 +02:00
Norman Feske
3d36291d7f run/load/fastboot: support 64-bit ARM
This patch lifts the limitation for 32-bit ARM platforms and makes the
parameter --load-fastboot-device optional. If only one device is
present, it can be omitted.

Fixes #4232
2021-07-28 11:27:04 +02:00
Johannes Schlatow
2afb7c5567 nic_router: fix Tcp_packet header fields
data_offset and NS flag were incorrectly read due to missing endianess
conversion. Also fix name of CWR flag.

Fixes genodelabs/genode#4227

genodelabs/genode#4227
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
ee045a68cc os: introduce C-API to Genode services
This commit introduces a C-API to the Uplink session, as well as to
serve as a Block service. It can be used by drivers ported from
C-only projects, like the Linux kernel, or BSD kernels for instance.

Fix #4226
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
1a526e73a3 dde_linux: introduce new lx_emul/lx_kit library
The re-newed approach currently supports ARM 64-bit only.
It depends on the Platform API of the ARM architecture.
It tries to meet the original semantic of the Linux kernel
functions as far as possible. To achieve this, device drivers
using this library should reference the original Linux kernel
headers at foremost. Only the headers in `src/include/lx_emul/shadow`
have to shadow clone the original ones.

Fix #4225
2021-07-28 11:27:04 +02:00
Johannes Schlatow
1aba330ae6 dde_linux: fix packet size calc. of Nic drivers
skb_push() already increases the skb->len by ETH_HLEN, hence adding
ETH_HLEN to the packet_size is redundant.

A too large packet size becomes a problem for large MTUs. With a maximum
MTU of 1500, adding ETH_HLEN twice will lead to a packet size of 1528.
Since this is larger than what we expect for good-old Ethernet (max. 1522),
some clients (e.g. the e1000 model in vbox5) may drop these packets.

Fixes genodelabs/genode#4228
2021-07-28 11:27:04 +02:00
Christian Helmuth
119d72ad94 fetchurl: User-Agent header and HTTP response code
I discovered thinkbroadband.com requires the User-Agent header field and
rejects requests missing it with HTTP response code 403 "access to the
requested resource is forbidden". Now, fetchurl always adds the
User-Agent header fetchurl/LIBCURL_VERSION.

Also the error message now contains the HTTP response code.
2021-07-28 11:25:21 +02:00
Stefan Kalkowski
b16bb82f8b dde_linux: mark lx_emul and lx_kit as legacy
* Move headers in src/include into legacy sub-directory
* Move src/lx_kit to src/lib/legacy/

Fix #4223
2021-07-28 11:25:21 +02:00
Stefan Kalkowski
f939b9ffb5 base-hw: print addr as hex value in cache warning
Ref #4207
2021-07-28 11:25:21 +02:00
Norman Feske
45f5ed173a tool/run: use [board] for naming driver packages
This patch replaces the enumeration of boards in the drivers_nic_pkg and
drivers_interactive_pkg functions by inferring the package names from
the [board] name. This eases the addition of driver packages in external
repositories.

Fixes #4221
2021-07-28 11:25:21 +02:00
Norman Feske
6de19e4a9b tool_chain_auto.run: exercise 'ln -s'
as a regression test for issue #4219.
2021-07-28 11:25:21 +02:00
Norman Feske
5138aeba80 libc: fix nested monitor call in 'symlink'
The symlink implementation wrongly constructed a 'Sync' object within
the context of a monitor call. The 'Sync' constructor indirectly
depended on libc I/O for obtaining the current time, ultimately
resulting in a nested attempt of a monitor call. This could be
reproduced via the base.run script:

  $ cd /home
  $ ln -s a b

The 'ln' command resulted in the following log message:

  [init -> /bin/bash -> 7] Error: deadlock ahead, mutex=0x10ff8c70, return ip=0x500583a7

The patch fixes the problem by splitting the single monitor call into
two monitor calls and moving the construction of the 'Sync' object
in-between both monitor calls, thereby executing the constructor at the
libc application level.

Fixes #4219
2021-07-28 11:25:21 +02:00
Norman Feske
f3908b8283 tool: refine help text of list_dependencies
Issue #4204
2021-07-28 11:25:21 +02:00
Christian Helmuth
fdc4bd2f90 tool/run: absolute source path for load_tftp_inst_cmd 2021-07-28 11:25:21 +02:00
Sebastian Sumpf
4d4cc4fd02 libm: use libm from libc and remove openlibm
- enable libm for x86/arm
- update ieee754 to slightly changed output
- remove openlibm from port

fixes #4213
2021-07-28 11:25:21 +02:00
Sebastian Sumpf
4b10aa94ec base-hw: save/restore fpcr register for ARM_V8
The floating-point (fpcr) control register is user land accessible and
controls, for example, rounding mode.

fixes #3723 and related to #4213
2021-07-28 11:25:20 +02:00
Martin Stein
688379d1ed sel4: fix segmentation fault with CCACHE=yes
Building the elfloader in kernel-sel4.inc has a problem with Genodes CCACHE
make variable. When issuing ...

! ./tool/depot/create mstein/bin/*/base-sel4-* CCACHE=yes

..., building the elfloader used to consume all memory of the host system and
then run into a segmentation fault:

! make[6]: *** [elfloader/elfloader.o] Segmentation fault (core dumped)

This is because the other build system invokes the CCACHE variable as a command
in front of the compiler command. If CCACHE is set to 'yes', the 'yes' command
is called and produces an endless output into some output file. The problem
can be fixed by locally re-setting the CCACHE variable for the
'make ... elfloader' command to 'ccache' (Genode CCACHE==yes) or '' (Genode
CCACHE!=yes).

Fixes #4212
2021-07-28 11:25:20 +02:00
Martin Stein
0074a7c4ac tool/depot: fix forwarding of CCACHE
The depot tool 'build_bin_archive' used to ask only whether CCACHE is empty or
not and, if it wasn't empty, the tool added 'CCACHE := yes' to the build.conf
of the temporary build dir. This caused the sub-build processes to use ccache
even when the top-level CCACHE variable was set to a bogus value.

Also adds documentation of the CCACHE variable to the help message of the
'build' and 'build_bin_archive' tool.

Ref #4212
2021-07-28 11:24:56 +02:00
Martin Stein
388e2a0e6d fec nic driver: fix compiler warnings
Fixes #4178
2021-07-28 11:24:55 +02:00
Christian Prochaska
a856bfb4ab qt5: implement 'SyncSocket' with pipes on Genode
Fixes #4208
2021-07-28 11:24:55 +02:00
Christian Prochaska
3824c0ca5f qt5: ignore 'fcntl(F_SETLK)' error in sqlite3 implementation
Fixes #4194
2021-07-28 11:24:55 +02:00
Robin Eklind
40e2aa6617 builddir/run_x86: add note regarding missing -no-kvm switch
Also, add -enable-kvm notes as commented out QEMU_OPT option.

Updates #500.
2021-06-28 11:38:20 +02:00
Martin Stein
2d017ad7b7 nic_router: guard against exception in free_ip
Adds try-catch-statement with diagnostic errors in Dhcp_server::free_ip in
order to guard against exceptions from the underlying bit allocator. These
exceptions should never happen given that the router is programmed correctly
and always feeds Dhcp_server::free_ip with sane arguments (which it should).
However, should this not be the case, we can assume that the failed IP freeing
indicates that the IP isn't allocated anyway and it's fine to continue using
the router. Furthermore, IP allocations are a mere client service and not
relevant for the integrity or safety of the router.

Ref #4200
2021-06-25 11:57:28 +02:00
Martin Stein
be644098d7 nic_router: fix exc. in Interface::handle_config_3
When Interface::handle_config_3 (third step of applying a new configuration to
interfaces) tried to detach the interface from the current IP config because
the old and new IP config differed, it did so using the new domain. The former
steps of the reconfiguration already installed the new domain reference at the
interface. Therefore, also the DHCP server of the new domain was used. This,
however caused uncaught exceptions because detaching from an IP config
includes dissolving all DHCP allocations. This dissolving of DHCP allocations
now operated on a DHCP server (the one of the new domain) that wasn't related
to the allocations and, in the worst case, caused an uncaught exception
because the IPs were out of its range.

That said, this commit ensures that detaching an interface from an IP config
is always done on the domain from which the IP config originated. Normally,
this is the domain the interface is attached to. But in the case of
Interface::handle_config_3, it is another - the former domain the interface
was attached to.

The commit also adapts the nic_router_dhcp_* tests in a way that they
reconfigure the router in a way that would trigger the uncaught exception
without the fix.

Fixes #4200
2021-06-25 11:57:24 +02:00
Sebastian Sumpf
fd9bc43be1 ldso: Fix RISC-V support with 21.05 tool chain
- force inlining of more functions
- force -O2 for RISC-V (even if -O0 is set globally)
- intialize cxx guard after self relocation

issue #4094
2021-06-25 11:56:22 +02:00
Sebastian Sumpf
a6fe6c90d4 tool_chain: add ENABLE_FEATURE support
default: "c c++ ada go gdb"

This allows to build a subset of the Genode tool chain

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

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

Fixes #4207
2021-06-25 11:43:41 +02:00
Stefan Kalkowski
ed0cc5330e tool/dde_linux: add list_dependencies utility
Fix #4204
2021-06-25 11:43:41 +02:00
Johannes Schlatow
b83c8f35c6 depot: ffi for x86_32
genodelabs/genode#4201
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
a242bfce48 libports: ffi for x86_32
- Required by glib

issue #4201
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
19a7997734 qemu-usb: consume device report during controller construction
Initially parse the USB devices report after the signal handler is
registered, do not rely on a signal to be triggered (issue #1788).

Fixes #4206
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
a58473dece autopilot: add usb_hid_reconnect run script
- Adjust script to run on Qemu x86 only

fixes #4205
2021-06-25 11:43:41 +02:00
Christian Helmuth
cd25dc4e6a dde_bsd: prevent ‘nonnull’ argument warning
The implementation conflicted with the implicit declaration of bzero:

.../repos/dde_bsd/src/lib/audio/mem.cc: In function ‘void bzero(void*, size_t)’:
.../repos/dde_bsd/src/lib/audio/mem.cc:377:2: warning: ‘nonnull’ argument ‘b’ compared to NULL [-Wnonnull-compare]
2021-06-25 11:41:46 +02:00
Christian Helmuth
c585e008b1 acpica: prevent recursive 'memset()' calls with gcc 10
Thanks to Peter for the patch.

Issue #4125
2021-06-25 11:41:45 +02:00
Norman Feske
5b85bd9602 mk: make LD_SCRIPT_DYN customizable
This way, a target.mk becomes able to override the default linker
script, e.g., for adding custom symbols.
2021-06-25 11:41:45 +02:00
Martin Stein
0dc7084b0f wifi_drv: fix compile warnings with gcc 10
Fixes #4202
2021-06-25 11:41:45 +02:00
Martin Stein
16c4aacf34 vfs/dir_fs: allow opening empty dirs
Adapts Dir_file_system::open_composite_dirs in a way that it returns "success"
when the leaf node of the path is an empty directory but "lookup failed", as
usual, if one of the other directories on the way to the leaf node is empty.

I couldn't find a technical reason why we used to return "lookup failed" when
only the leaf node was empty.

The commit also adds a test for en empty root directory and empty
sub-directories to the fs_query run script.

Fixes #4198
2021-06-25 11:41:45 +02:00
Martin Stein
6bfdddd0b5 fs_query: gracefully deal with missing directories
The fs_query component used to exit with an uncaught exception if a queried
directory didn't exist. Now, fs_query will catch this event and simply skip the
affected query, thereby indicating to the user the inexistence of the
queried directory.

Ref #4032
2021-06-25 11:41:45 +02:00
Johannes Schlatow
026b117a63 separate sandbox api from os
genodelabs/genode#4191
2021-06-25 11:41:45 +02:00
Norman Feske
e5600fea06 dde_linux/extract_initcall_order: support v5.12
This patch adjusts the 'extract_initcall_order' utility to the changed
initcall symbol syntax introduced in Linux by the following commit:

   https://github.com/torvalds/linux/commit/a8cccdd9

It uses an additional sed step to strip away the kmod prefix,
__COUNTER__, and __LINE__ information so that the symbol names match
those of earlier kernel versions.

Issue #4188
2021-06-25 11:41:45 +02:00
Norman Feske
f541668604 dde_linux/create_dummies: show objs for variables
Issue #4188
2021-06-25 11:41:45 +02:00
Norman Feske
bf7500ad7b dde_linux/create_dummies: out-of-tree build dir
This patch enables the tool/dde_linux/create_dummies tool to operate on
a out-of-tree build directory. The Linux source tree is determined by
examining the build directory's Makefile.

Issue #4188
2021-06-25 11:41:45 +02:00
Norman Feske
29b7c5a202 dde_linux/create_dummies: show symbol details
When combining the 'show' command with a defined LINUX_KERNEL_DIR,
each symbol gets annotated with the object file where it is defined.

Issue #4188
2021-06-25 11:41:45 +02:00
Johannes Schlatow
7346defc26 usb_modem_drv: remove nic_server mode
genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
dff1df0b49 usb_modem: do not fail on netif_stop_queue
genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
2c87c68a5d depot: add ffi api and src archives
Fixes genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
52a4293bbc depot: add usb_modem_drv archives
genodelabs/genode#4201
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
ff57bf617b usb_webcam: webcam run script
Run script for quickly testing webcams in Qemu or on target.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
818f1682ee qemu-usb: flush EP improve isochronous handling
- Patch the XHCI model in order to handle frame wrapping correctly. For
  this adjust 'mfindex_kick' to the correct period (same, before, or after
  'mfindex').

- Flush EP when it is stopped, this causes all pending packets for the EP
  to be acked. Correct counting of packets in flight.

- Add BEI patch by Josef.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
eabda8907f usb_host: add support to flush EP transfers
This causes all pending transfers of a EP to be canceled and in turn to
be acked by the raw session.

issue #4196
2021-06-25 11:41:44 +02:00
Alexander Boettcher
4aa99fd1a9 qemu-usb: reduce cpu load by webcam model
if no new frame is available for capturing

Fixes #4078 #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
ff452619e3 vbox5-nova-capture: Set camera to 640x480@30fps
Default to 30fps

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
19a5fee70b depot_deploy: add <capture> session announcement
Announce Capture session if node is present in runtime.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
c66a196f76 usb_webcam: package recipes
- API packages for: libusb, libuvc, and libyuv
- Source packages for: API packages + USB webcam app
- Meta package for USB webcam
- Raw package for USB webcam configuration

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
9165c7601d libyuv: make shared object
- Adjust port to Genode expected layout
- Make shared library
- Adjust dependent infrastructure to change

issue #4196
2021-06-25 11:41:44 +02:00
Martin Stein
ff128df131 dde_linux/fec: fix unsynchronized TX DMA write
Unfortunately, our current implementation of 'wmb()' doesn't seem to do what we
want it to do. On base-hw + imx6q_sabrelite, the write of bdp->cbd_sc seems to
get re-ordered after the write to txq->bd.reg_desc_active in the transmission
path of the contrib code. Due to this, the transmission of the packet is only
triggered the next time a packet is sent. However, we only quick-fix it by
enforcing the execution of the write with a volatile global read as we will
soon update the FEC NIC port with a new DDE approach anyway.

Fixes #4010
2021-06-25 11:41:44 +02:00
Christian Prochaska
747d01e854 qt5: adapt QtWebEngine contrib code for use of nss
Fixes #4192
2021-06-25 11:41:44 +02:00
Christian Helmuth
331844c979 vbox6: support capslock="rom" mode
In ROM mode the global CapsLock state is controlled by the capslock ROM
by virtual KEY_CAPSLOCK events.

Guests are easily confused by spurious KEY_CAPSLOCK input events in
caps="rom" mode. These spurious events may reach the VMM if KEY_CAPSLOCK
is not pressed as first key in a combination and, therefore, is not
filtered as global key. We filter KEY_CAPSLOCK in ROM mode in the VMM
explicitly, but let it pass in non-ROM mode.

Per default RAW mode is used and CapsLock key events are sent unfiltered
to the guest.
2021-06-25 11:41:44 +02:00
Christian Helmuth
434d007dc1 stdcxx: some missing symbols for basic_string
Revealed with -O0 when linking test/lx_fs_notify/file_writer.

Issue #4070
2021-06-25 11:41:44 +02:00
Pirmin Duss
7db6f457d4 lx_fs: enable watch
Enable watching files via the inotify interface of the Linux Kernel.

Delivery of watches to components is staggered in order to prevent an
overflow of the ACK queue in cases when a lot of changes are made to the
file system from the Linux side.

Fixes #4070
2021-06-25 11:41:44 +02:00
Christian Helmuth
37f1873f2e vbox5: drop KEY_CAPSLOCK events on capslock="rom"
Guests are easily confused by spurious KEY_CAPSLOCK input events in
caps="rom" mode. These spurious events may reach the VMM if KEY_CAPSLOCK
is not pressed as first key in a combination and, therefore, is not
filtered as global key. Now, we filter KEY_CAPSLOCK in ROM mode in the
VMM explicitly, but let it pass in non-ROM mode.

Fixes #4087
2021-06-25 11:41:43 +02:00
Christian Helmuth
002037ce15 vbox6: support MAC address overwrite 2021-06-25 11:41:43 +02:00
Christian Helmuth
2a1a47b598 vbox6: update to version 6.1.22 2021-06-25 11:41:43 +02:00
Alexander Boettcher
ab31de0f6a libc_integration: reduce rounds for x86_32
autopilot mode. The test machine is less powerful as the x86_64 one.

Issue #3967
2021-06-25 11:41:43 +02:00
Pirmin Duss
a37ff1d985 lx_fs: enable session quota upgrades
Issue #4070
2021-06-25 11:41:43 +02:00
Pirmin Duss
4053e1628b lx_fs: support for unlink
This is based on the work of @ehmry and @sidhussmann.

Issue #4070
2021-06-25 11:41:43 +02:00
Alexander Boettcher
27004e1fd5 usb: remove monolithic usb driver
+ adjust README files

Fixes #4173
2021-06-25 11:41:43 +02:00
Johannes Schlatow
b09e69a444 ports: change bashrc path
genodelabs/genode#4163
2021-06-04 11:29:04 +02:00
Johannes Schlatow
758c0a21cc depot: add jschlatow download and pubkey
Fixes #4185
2021-06-03 08:23:50 +02:00
Christian Prochaska
60eec251e0 qt5: increase stack size of QtWebEngine render thread
Fixes #4168
2021-06-02 10:36:01 +02:00
Stefan Kalkowski
336350fe60 sculpt: enable support for MNT Reform2 2021-06-01 15:53:48 +02:00
Stefan Kalkowski
8408bf6ac0 fec_nic_drv: remove nic_server mode
Issue #4133
2021-06-01 15:51:22 +02:00
Alexander Boettcher
73d87073af vbox5/6: avoid negative timeouts in xhci model
Fixes #4184
2021-05-31 15:36:53 +02:00
Sebastian Sumpf
cf2527269f qemu-usb: allocate host devices after webcam
Because qemu-usb allocated host devices after 'USB_HOST_DEVICE' in the
object array and 'USB_WEBCAM' is loacated after 'USB_HOST_DEVICE' the
webcam model can overwrite an already allocated pass-through device. As
a solution add the 'USB_FIRST_FREE' to make it clear from where host
devices can be allocated. Also increase the number of supported host
devices to eight.

fixes #4182
2021-05-31 15:19:46 +02:00
Christian Prochaska
520b69ef0d libports: update expat port
Fixes #4183
2021-05-31 15:19:44 +02:00
Christian Helmuth
c0150f97e5 version: 21.05 2021-05-31 13:24:05 +02:00
Norman Feske
5dc7d55cc0 News item for version 21.05 2021-05-31 13:24:04 +02:00
Norman Feske
fd2f137a9b Release notes for version 21.05 2021-05-31 12:41:38 +02:00
Christian Helmuth
1d52bd017d depot: update recipe hashes 2021-05-28 14:16:46 +02:00
Josef Söntgen
e06f3bba27 drivers_managed-imx8q_evk: fix hdmi device node
By now the 'compatible' name is set via the 'type' attribute.

Fixes #4181.
2021-05-28 14:16:46 +02:00
Stefan Kalkowski
1d12755401 depot: add i2c api package
Fixes #4180
2021-05-28 14:16:46 +02:00
Stefan Kalkowski
f2ac341003 depot: add architectural content to os api package
Fixes #4179
2021-05-28 14:16:45 +02:00
Christian Prochaska
f2ff1a6d52 dde_linux: save and restore ARM FPU state in setjmp.S
Fixes #4161
2021-05-28 14:16:45 +02:00
Johannes Schlatow
4383579db6 window_layouter: improve focus history
If no window has ever been focused, next() always returns an invalid
window id. As a consequence, there is no way to cycle through the focus
history without an explicit focus event (e.g. mouse hover).

Instead, next() should return the first window from the focus history if the
currently focused window is not present.

Fixes genodelabs/genode#4164
2021-05-28 14:16:45 +02:00
Christian Helmuth
f0b9549376 wifi_drv: optionally report MAC address
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
aab6f52325 wifi_drv: remove nic_server mode
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
6e85a73a28 ipxe_nic_drv: optionally report MAC address
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
4abc530974 ipxe_nic_drv: remove nic_server mode
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
583ba0e9db ipxe_nic_drv: eliminate static constructors
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
62f83b7198 linux_nic_drv: optionally report MAC address
Issue #4133
2021-05-28 14:16:45 +02:00
Christian Helmuth
464f0eaf8b linux_nic_drv: remove nic_server mode
Issue #4133
2021-05-28 14:16:45 +02:00
Josef Söntgen
0f72a342f3 wifi_drv: fix setting 'bssid' in config
The wpa_supplicant refuses to set the BSSID in case it is quoted.
Removing the quotes allows for specifying the BSSID in the
configuration.

Fixes #4175.
2021-05-28 14:16:45 +02:00
Alexander Boettcher
3dff399fba netperf_*_usb: fix cap quota for sel4+hw x86
Fixes #4016
2021-05-28 14:16:45 +02:00
Alexander Boettcher
0aa99648d7 run: use usb/hid driver in VM tests
Issue #4173
2021-05-28 14:16:45 +02:00
Alexander Boettcher
6b9fcc9449 drivers_interactive-rpi: use usb host/hid driver
Issue #4173
2021-05-28 14:16:45 +02:00
Alexander Boettcher
f9c7947c45 drivers_interactive-pc: use usb host/hid driver
Issue #4173
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
28189ba77a tool: simplify initcall order extraction
The new tool `extract_initcall_order` generates a header file out of a
Linux kernel build, which provides a sorted array with the initcall function
names of the kernel build. The order states the order in which the initcall
have to be called. It gets extrated out of the Linux kernel System.map.

Fixes #4172
2021-05-28 14:16:45 +02:00
Alexander Boettcher
fc5903c917 themed_decorator: upgrade cap and memory on demand
Issue #4150
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
7f6f710bd2 imx8mq_platform_drv: introduce reset domains
A reset domain can consist of one or several reset-pins
denoted by name that are assigned to a device.
When the device gets acquired via the Platform RPC API,
the pins are de-asserted, and asserted again when the
device gets released.

A configuration looks like the following:

  <device name="mipi_dsi>
    <reset-domain name="mipi_dsi_pclk"/>
    ...
  </device>

Fixes #4171
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
ed7d6c74f4 i2c: extend API to support transactions
Introduces the notion of a transaction that consists of one or more
messages. Whereby a message has a read or write direction and consists
of one or more bytes.

Issue #4170
Fixes #4169
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
9f099bd61c base-hw: use generalized util/array.h
Issue #4170
2021-05-28 14:16:45 +02:00
Stefan Kalkowski
6780cf0790 base: introduce array utility
Fixes #4170
2021-05-28 14:16:45 +02:00
Christian Prochaska
7b197d54ed tool chain: update gdb to version 10.2
Issue #4094
2021-05-28 14:16:44 +02:00
Alexander Boettcher
933de21339 base: add platform_info to microkernel platforms
Add to older platforms also the info ROM to avoid confusion/red messages.

Issue #4016
2021-05-28 14:16:44 +02:00
Alexander Boettcher
509e5aa776 platform(x86): report features via platform_info
Report via platform_info the capabilities of the kernel, e.g. ACPI and MSI.

With the commit the try-catch pattern on IRQ session creation by the platform
driver is avoided.

Issue #4016
2021-05-28 14:16:44 +02:00
Christian Prochaska
e1abd2db4e base-linux: update arm32 seccomp policy
Issue #4136
Issue #3466
2021-05-28 14:16:44 +02:00
Christian Helmuth
faf491ce92 smartcard: replace usb_drv by usb_host_drv 2021-05-28 14:16:44 +02:00
Alexander Boettcher
98f524bb41 qemu-usb/webcam: signal capturing off earlier
based on comment in Linux sources. Reduce fallback off-capturing detection
to 1s.

Issue #4078
2021-05-28 14:16:44 +02:00
Sebastian Sumpf
7fcf9053b9 usb_hid: perform device destruction on unplug signal only
- Do not perform desctruction on report updatea in EP because
  'unregister_device' may block on Led state 'update' (synchronous
  control message) leading to the driver being stuck because no more
  signals are received
- Check if device is present in 'submit_urb' calls

fixes #4166
2021-05-28 14:16:44 +02:00
Sebastian Sumpf
6910b880e7 usb_host: make device creation/destruction robust
- Signal device ready depending on state (ready or not) immediately or
  when "actconfig" is set
- Report new devices when ready
- Drain packet stream in case there is no device present (needed for
  synchronous operations at client side)
- Do not use 'session_device' on device destruction, check pointer
  directly instead

issue #4149
2021-05-28 14:16:44 +02:00
Alexander Boettcher
708b7f4619 cpu_balancer.run: adjust quota for seL4 2021-05-28 14:15:28 +02:00
Alexander Boettcher
921a99bb9b tool/run: option to copy tftp served files (x86)
Fixes #4153
2021-05-28 14:15:28 +02:00
Norman Feske
a13dee8d19 tool/dts: for extracting content from dts files
The new tool eases the inspection and pruning of device-tree source
files.

Fixes #4165
2021-05-28 14:15:28 +02:00
Martin Stein
0069660958 rump: fix compiler warning
Fixes two warnings of this type:

! src/lib/vfs/rump/vfs_rump.cc:214:52: warning: narrowing conversion of
! ‘(s.stat::st_mode & 64)’ from ‘__mode_t’ {aka ‘unsigned int’} to ‘bool’
! [-Wnarrowing]
!
!  214 |                           .executable = (s.st_mode & S_IXUSR) };
!      |                                         ~~~~~~~~~~~^~~~~~~~~~

Fixes #4160
2021-05-28 14:15:28 +02:00
Johannes Schlatow
7b09675236 depot: add less recipe
genodelabs/genode#4162
2021-05-28 14:15:28 +02:00
Johannes Schlatow
4bed825956 depot: add diffutils recipe
genodelabs/genode#4162
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
5135ff2dc2 usb_webcam: An app using libuvc for USB webcams
issue #4158
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
4a56171a77 libports: port of libuvc
by Josef Soentgen

issue #4158
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
ae5b4c9624 libusb: Make USB library more robust
- Add reference count for open/close
- Add cancel transfer support
- Handle packet stream correctly

issue #4158
2021-05-28 14:15:28 +02:00
Josef Söntgen
46c846ef91 libports: add iso handling to libusb
issue #4158
2021-05-28 14:15:28 +02:00
Sebastian Sumpf
c8c589d91a libyuv: enable MJPEG support
issue #4158
2021-05-28 14:15:28 +02:00
Josef Söntgen
5254930930 libports: update jpeg library to v9d
issue #4158
2021-05-28 14:15:28 +02:00
Martin Stein
70797fe879 fs_tool: add <new-file> operation
Adds the <new-file> operation to the fs_tool. When configured, the
<new-file path="...">...</new-file> tag will cause creation or overwriting of
the file given through the 'path' attribute. The file will contain the text
content of the tag.

Ref #4032
2021-05-28 14:15:28 +02:00
Norman Feske
100583e262 os/vfs.h: New_file utility
This patch moves the utility from the app/text_area to os/vfs.h to make
it easier to use by other components. By hosting the 'New_file' as a
friend alongside the 'Directory', we can now pass a 'Directory' as
constructor argument, which is consistent with other utilities such as
'File_content'.

As a further improvement, the new version supports the implicit creation
of the directory hierarchy leading to the new file.

Issue #4032
2021-05-28 14:15:27 +02:00
Norman Feske
57fbd2b658 os/vfs.h: Directory::create_sub_directory
This method can be used to create a directory hierarchy within a
'Directory'.

Issue #4032
2021-05-28 14:15:27 +02:00
Alexander Boettcher
9549eeeca4 ssh_terminal: avoid deadlock during bind callback
Issue #4095
2021-05-28 14:15:27 +02:00
Christian Helmuth
9166a75f2c foc: map uncached normal memory bufferable
Mapping normal memory bufferable restores support for unaligned reads on
DMA memory and prevents the following errors on imx6q_sabrelite.

  KERNEL0: alignment error at 18003061 (PC: 0102e3f8, SP: 401ffb18, FSR: 90000001, PSR: 20000110)

Issue #4094
Issue #4157
2021-05-28 14:15:27 +02:00
Martin Stein
dd587c6712 fs_query: support querying file sizes
By adding an attribute 'size="yes"' to a query, one instructs fs_query to
report also the size of each queried file as attribute 'size' of the
corresponding 'file' node.

Ref #4032
2021-05-28 14:15:27 +02:00
Martin Stein
3ed26e7bb2 fs_query: watch only readable files
The fs_query component used to try watching all files it found resulting in
errors on files that are not watchable. For some files, however, the watch-
feature doesn't make sense as they are not readable (no content, no size).
Now, fs_query will check first whether a file is readable and skip watching
if it isn't.

Ref #4032
2021-05-28 14:15:27 +02:00
Martin Stein
6e900f147c fs_query: read content only from readable files
When configuring fs_query to print the content of files it used to try so for
all files it found resulting in errors on files that are not readable. Now,
fs_query will check first whether a file is readable and skip printing the
content of those that are not.

Ref #4032
2021-05-28 14:15:27 +02:00
Tomasz Gajewski
0507d3f44b ssh_terminal: fixed managing ssh file descriptors
Managing ssh event file descriptors was performed from two different
threads which could cause reallocation of structure used in other thread
in a call to 'poll' function.

Splitted initialization to parts and moved ssh event part into ssh loop.

Issue #4095
2021-05-28 14:15:27 +02:00
Tomasz Gajewski
0b641ba581 ssh_terminal: fixed race condition during startup
Moved creating ssh loop thread after initialization of wake up server
file descriptors to make sure that they will be properly handled even in
first loop run.

Issue #4095
2021-05-28 14:15:27 +02:00
Martin Stein
b3a229eebb vfs_block: write less to the log
Remove calls to the Genode log functions that were done unconditionally or
according to a static verbosity flag.

Ref #4032
2021-05-28 14:15:27 +02:00
Martin Stein
fd0a4e78c8 rump: write less to the log
Remove calls to the Genode log functions that were done unconditionally or
according to a static verbosity flag.

Ref #4032
2021-05-28 14:15:27 +02:00
Stefan Kalkowski
74d826d1ad tool: simplify Linux dummy function generation
The new tool `create_dummies` easily lists missing references,
while porting subsystems of the Linux kernel to Genode, e.g., device drivers.
Moreover it can automatically generate dummy implementations for functions
and global variables.

Fixes #4156
2021-05-28 14:15:27 +02:00
Alexander Boettcher
b6b9801c20 seoul: fix ahci model busy bit handling
A warning, discovered during GCC 10.3 update, got fixed wrongly.

Issue #4097
2021-05-28 14:15:27 +02:00
Stefan Kalkowski
b22d9385f1 imx8mq_platform_drv: enable root clock div setting
Fixes #4155
2021-05-28 14:15:27 +02:00
Stefan Kalkowski
516601b7ba os: add Platform::Device::sigh_omit_initial_signal
Add possibility to register an interrupt handler without triggering
an initial spurious interrupt for ported device driver code.

Fixes #4154
2021-05-28 14:15:27 +02:00
Alexander Boettcher
67a8f29697 rump_ext2.run: increase cap quota for sel4 2021-05-28 14:15:27 +02:00
Josef Söntgen
3e284558a1 drm: account for guard page
This makes the rendering issue with mesa gears disappear.

Issue #4148
2021-05-28 14:15:27 +02:00
Alexander Boettcher
04d8e03ecb mesa: use 32bit RGB in egl platform lib
Fixes distortion in mesa gears i965

Issue #4148
2021-05-28 14:15:27 +02:00
Alexander Boettcher
cfe29b0e52 libc_integration.run: specify random source
After update of stdcxx, either hardware (CPU) random sources are taken
or, if not available/insufficient, /dev/urandom is used.

Issue #3967
Issue #4094
2021-05-28 14:15:27 +02:00
Alexander Boettcher
d4b9be8d44 stdcxx: support /dev/urandom
when cpu does not provide sufficient hardware support. (happens on our
nightly test machine as also build machine).

Issue #4094
2021-05-28 14:15:27 +02:00
Johannes Schlatow
db97af8dec vfs: fix read of large files in fs_file_systems
For fs_file_systems, reads are limited to the size of the packets from the
File_system session. Hence, we cannot read the large files in one go.

This fix is particularly helpful for fonts_fs, as it enables including font
files from a File_system.

genodelabs/genode#4135
2021-05-28 14:15:27 +02:00
Johannes Schlatow
4daf19ec7e vfs_ttf: update glyphs when font file changes
genodelabs/genode#4135
2021-05-28 14:15:27 +02:00
Christian Prochaska
18a43c1afd base-foc: fix assignment in 'Ipc_pager::acknowledge_exception()'
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Helmuth
813f4d976b lxip: allocate skb with properly aligned IP header
Comment in Linux sources:

  Since an ethernet header is 14 bytes network drivers often end up with
  the IP header at an unaligned offset. The IP header can be aligned by
  shifting the start of the packet by 2 bytes. Drivers should do this
  with:

  skb_reserve(skb, NET_IP_ALIGN);

This is ensured when using netdev_alloc_skb_ip_align().

Issue #4094
2021-05-28 14:15:26 +02:00
Sebastian Sumpf
a24224ffc3 usb_host: improve isochronous performance on Intel
This patch takes advantage of block transfer interrupts on Intel XHCI
controllers which is used during isochronous transfers. Because of a bug
in hardware (see usb_host_isoc_bei.patch header), this feature has been
disabled for Intel leading to up to 8000 interrupts/s for isochronous
transfer causing severe CPU consumption on Genode. With this commit we
lower host driver consumption to normal levels.

issue #4149
2021-05-28 14:15:26 +02:00
Sebastian Sumpf
9543161827 usb_host: Move task to device in USB session
A Lx::Task is now associated to a USB device not the session any more.
This implies that a task lives as long as the device making it possible
to gracefully handle outstanding requests (i.e., synchronous) in case
the session has been closed.

issue #4149
2021-05-28 14:15:26 +02:00
Martin Stein
a0517686ca ports/libsparkcrypto: update for GCC 10
The old port version contained '*.ali' files that were build with an older GCC
which led to problems when compiling packages that use the port with the new
GCC 10. The '*.ali' files of the new port version were generated with GCC 10.

Fixes #4145
2021-05-28 14:15:26 +02:00
Sebastian Sumpf
9209dfc9d5 ldso: output loaded objects of 'Shared_object' interface
When loading shared libraries via the 'Shared_object' interface display
all additionaly loaded libraries in case 'ld_verbose' is configured. Up
until now, only the loaded library was displayed. In order to determine
if a dependend library had arlready been loaded prior to loading the
'Shared_object' the reference counter is used.

fixes #4147
2021-05-28 14:15:26 +02:00
Alexander Boettcher
f8d0552d52 libc_integration: fix out-of-bound access
which leads to sporadic pagefaults/segmentation faults.

Fixes #3967
2021-05-28 14:15:26 +02:00
Martin Stein
139a2cfae9 tool: use local LC_ALL=C instead of LC_COLLATE=C
We used to export 'LC_COLLATE=C' for the environment of Genode tools. This was
meant to ensure that sorting is always done C-style and not dependent on the
users locale settings. This is required, for instance, to ensure that the same
archive always yields the same hash.

However, 'export LC_COLLATE=C' is not sufficient. It can be outruled by an
'LC_ALL' setting in the users environment. The manual of 'sort' recommends to
set 'LC_ALL=C' locally if you want reliable results and this is what this
commit does. Furthermore it removes the former 'export LC_COLLATE=C'
directives.

Note that I couldn't find a way to set 'LC_ALL' local to 'exec ... sort' in
TCL. This is why I set it global instead using TCLs 'env' array.

Note that the Make directive '$(sort ...)' and the TCL directive 'lsort',
unlike the Shell directive 'sort', are not affected by the users locale
settings.

Fixes #4144
2021-05-28 14:15:26 +02:00
Alexander Boettcher
1c20ed12c1 qemu: sanity check misconfigured memory for okl4
Issue #4095
2021-05-28 14:15:26 +02:00
Alexander Boettcher
d516544a1f ssh_exec_channel.run: use default Qemu memory size
The default size is on most kernels 512M. On OKL4 we have to use 800M,
because of the statically configured memory ranges in the OKL4 kernel.

By avoiding a specific amount of memory, the default Qemu memory sizes are
used.

Issue #4095
2021-05-28 14:15:26 +02:00
Martin Stein
f8b2fd522b ports/ada-runtime: update to support gcc 10
Fixes #4128
2021-05-28 14:15:26 +02:00
Christian Prochaska
471d34a367 Remove mpc and mpfr ports
These ports are not needed anymore with the 21.05 tool chain update.

Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
d5e4ffd191 sanitizer: update to version 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
4a4b754bf2 gcov: update to version 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
a0f5d34e25 stdcxx: update to version 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
9a3d5dcf21 tool_chain: update ali2dep for gcc 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Christian Prochaska
9c05cda6e7 tool_chain: update gcc to version 10.3.0
Issue #4094
2021-05-28 14:15:26 +02:00
Sebastian Sumpf
6639261126 binutils: augment equally-named sections again
Revert GNU ld to the old behavior where sections with the same name in multiple
ld scripts are merged. Binutils 2.36.1 creates two sections with the same name.

Fixes #4126
2021-05-10 11:52:27 +02:00
Christian Prochaska
fc902d9e66 tool_chain: update binutils to version 2.36.1
Issue #4094
2021-05-10 11:19:13 +02:00
Christian Prochaska
6a11b78cdf tool_chain: use gcc-provided dependency libraries
Download gmp, mpc and mpfr with the download script provided by the
gcc source tree and let the gcc build system handle the build of these
libraries with the correct compile options. This fixes build issues on
armhf Linux and removes the need to maintain mpc and mpfr ports in
the Genode tree.

Issue #4094
2021-05-10 11:19:11 +02:00
Christian Prochaska
7fd598f0c1 tool_chain: build 'gprbuild' from source
The 'gprbuild' version which is provided by Ubuntu 18.04 has a bug
which prevents it from building 'ali2dep' with gcc/gnat 10. With
this commit, a newer 'gprbuild' version is built from source.

Issue #4094
2021-05-10 11:19:09 +02:00
Christian Helmuth
777923f9bd depot: update recipe hashes 2021-05-10 11:18:12 +02:00
Martin Stein
d2bf565503 nic/zynq: fix packed conversion error with gcc 10
Fixes #4142
2021-05-10 11:17:21 +02:00
Alexander Boettcher
384a8da50b ssh_terminal: use pthread_mutex
to avoid sporadic deadlocks between EP thread and the server loop pthread.

Issue #4095
2021-05-10 11:17:20 +02:00
Alexander Boettcher
b6bdd91cfa nova: avoid unaligned warnings by gcc10
Issue #4126
2021-05-10 11:17:20 +02:00
Christian Helmuth
a5385cebf4 block_cache: explicitly instantiate template function
The explicit instantiation is required because the function is defined
in the compilation unit only but referenced externally.

Fixes #4108
2021-05-10 11:17:20 +02:00
Josef Söntgen
c5c3d7ca98 gpt_write: address unaligned access for name
Turn member into byte array to prevent unaligned memory access.

Fixes #4141.
2021-05-10 11:17:20 +02:00
Norman Feske
d19b751632 nano3d: remove surface-clear optimization
This patch fixes a GCC-10 compile error. Even though the optimization
was quite effective - I measured a speedup of factor 2 - it is not all
that important for the overall application performance. In the nano3d
case, we are talking about 1 vs. 2 percent of CPU time.

Fixes #4140
2021-05-10 11:17:20 +02:00
Christian Prochaska
ff160decec gdb: fix build errors with gcc 10
Fixes #4139
2021-05-10 11:17:20 +02:00
Norman Feske
a4115cfea9 base-linux: discharge timestamp on AARCH64
The kernel-agnostic 'Trace::timestamp' function for arm_64 executes the
'mrs %0, pmccntr_el0' instruction, which is not permitted for user-level
programs on Linux. This patch shadows the generic timestamp.h header
with dummy that returns zero. This return value prompts the timeout
framework to disable the interpolation of time based on timestamps. This
avoid the illegal-instruction abort but comes with two llimitations:

First, time measurements are effectlively limited to a granulariry of 1
millisecond (deliberately constrained by the timer driver).

The quirk is applied when using the base-linux API. Should a generic
application (that uses the base API only) call 'Trace::timestamp'
directly, the illegal instruction is executed.

Issue #4136
2021-05-10 11:17:20 +02:00
Norman Feske
2f9d430c00 base-linux: 64-bit ARM support
This patch adds support for running Genode/Linux on the AARCH64
architecture.

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

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

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

Issue #4136
2021-05-10 11:17:20 +02:00
Christian Helmuth
718f44ae5b Check max_len before dereferencing pointer in Cstring constructor
Fixes #4112
2021-05-10 11:17:20 +02:00
Martin Stein
66feb939e6 cbe_tester: compile errors/warnings with gcc 10
Fixes #4113
2021-05-10 11:17:20 +02:00
Christian Helmuth
1baf844e20 vfs_stress: fix handling of 'char' in error message
Issue #4112
2021-05-10 11:17:20 +02:00
Martin Stein
5fa2efa745 net/dhcp: print readable message types
When a DHCP packet is printed out, it first tries to determine the most
specific message type from the DHCP options and print its human-readable name
right after the protocol name. If finding the message type fails, the less
specific opcode is printed instead, but also in a human-readable way.

Fixes #4131
2021-05-10 11:17:20 +02:00
Norman Feske
ad847d0543 sculpt: fix glitch in fs-browser back arrow
Fixes #4124
2021-05-10 11:17:20 +02:00
Norman Feske
0b36d81c0c base-linux: separate x86-specific code
By moving core's build-description to a library - a pattern already
employed for the other base platforms - we become able to cleanly split
x86-specific code (I/O-port access) from generic code. This is a
prerequisite for enabling non-x86 architectures such as AARCH64.

Issue #4136
2021-05-10 11:17:20 +02:00
Jean-Adrien DOMAGE
a4727c90a8 lx_fs: add os/run/lx_fs_import.run run script
This new runscript demonstrates how a file can be overwritten by vfs
import with the flag overwrite set to false. This is due to a bug
in lx_fs that is not propagating an ernno EEXIST syscall error.

Issue genodelabs#4104
2021-05-10 11:16:24 +02:00
Jean-Adrien DOMAGE
e65b7f3b82 lx_fs: fix errno EEXIST not propagated
This commit introduces a fix for lx_fs to propagate errno EEXIST error.
This prevents vfs <import overwrite="false"> to overwrite an imported
file, if it already exists, without the overwrite flag set to true.

Issue genodelabs#4104
2021-05-10 11:16:24 +02:00
Josef Söntgen
0f0edc0134 usb_host: implement sg_pcopy_* as TRACE dummies
The former implementation called 'TRACE_AND_STOP' which led to the
'usb_host_drv' to stop whenever such a function was called. Rather
than stopping return '0' and let the contrib code deal with this
situation.

Issue #4116.
2021-05-10 11:16:24 +02:00
Josef Söntgen
d0f084d449 usb_host: backport xhci bounce-buffer fix
This commit backports the Linux upstream commit (d4a6106) [*]
that introduces a check to prevent the sglist from being used
unconditionally.

[*] 'xhci: fix bounce buffer usage for non-sg list case'

Fixes #4116.
2021-05-10 11:16:24 +02:00
Christian Prochaska
c7b2314d23 foc: fix errors with gcc 10 and binutils 2.36
Fixes #4118
2021-05-10 11:16:24 +02:00
Christian Helmuth
eb94f03416 microcode.run: do not twiddle with MAKEFLAGS
Unconditionally setting MAKEFLAGS to just 's' is not nice because other
flags cannot be passed through the run script. What the script desires
is to disable the automatically enabled '--print-directory' for sub-make
instances when calling tool/port/current by declaring
'--no-print-directory'.
2021-05-05 11:55:27 +02:00
Norman Feske
516a9a6925 depot: update recipe hashes 2021-05-05 11:35:31 +02:00
Norman Feske
fdb1a4dd88 base-linux: avoid legacy syscalls
Until now, Genode's Linux system call bindings were based on original
Unix system calls that were later superseded by more flexibile variants.
E.g., 'openat' is a modern version of 'open'. Even though Linux upholds
the compatiblity with the original versions for existing architectures
like x86, the legacy syscalls are absent for the recently added AARCH64
architecture. A good overview of the system calls accross the prominent
architectures can be found at

https://chromium.googlesource.com/chromiumos/docs/+/master/constants/syscalls.md

This patch updates Genode's syscall bindings to avoid legacy versions,
thereby easing the support for AARCH64. The used "modern" versions
were introduced back in Linux version 2 days. So we are fine to rely
on them.

The patch slightly changes the signature for lx_stat because this system
call is merely used to check for the existance of a file and its size.
The new name 'lx_stat_size' draws a closer connection to its use case.
That said, the stat syscall has not been updated to the modern statx
since statx is still a fairly recent addition.

Issue #4136
2021-05-05 11:35:31 +02:00
Norman Feske
d477062c56 base-linux: simplify clone syscall binding
This patch simplifies the use of the clone system call for creating
processes and threads. Until now, the binding used an opaque pointer
argument to pass context information to the newly created process or
thread. However, upon close inspection, this is not a strict
requirement.

A newly created thread accesses its contextual information by
using its stack pointer as key. The pointer argument is not used.

The creation of processes is strictly serialized because the
intermediate stack used in-between clone and execve is a global
variable. Since we rely on the serialization anyway, we can pass the
context information of a new process via a global variable as well.

This change simplifies the syscall binding for the upcoming AARCH64
support, which would otherwise require us to deal with the notion
of TLS on Linux.

Issue #4136
2021-05-05 11:35:31 +02:00
Norman Feske
811009d18b News item about Sculpt 21.03b update 2021-05-05 11:35:31 +02:00
Christian Prochaska
00d13cf304 qt5: fix build errors with gcc 10
Fixes #4132
2021-05-05 11:35:31 +02:00
Martin Stein
49184fb938 net: circumvent stringop-overflow error
With the update to GCC 10, the compiler stopped with an error when compiling
places where a MAC address is copied from outside into a packed object using
the Net::Netaddress::copy method (e.g. in
Net::Arp_packet::dst_mac(Mac_address)):

! error: writing 6 bytes into a region of size 4 [-Werror=stringop-overflow=]

While trying to find a clean solution for this error, I found posts on
gcc.gnu.org and github that stated that the size calculations that cause these
errors are incorrect. Indeed, I could verify that the actual size of the two
regions was static and exactly the same in places were the error occured.

Furthermore, I couldn't find a way of making it more clear to the compiler
that the sizes are the same. By accident, we found that using the address of
the first element of the array that forms the second region instead of the
array address itself, somehow circumvents the error.

Fixes #4109
2021-05-05 11:35:31 +02:00
Martin Stein
52e8c95321 net: fix packed-conversion compiler warning
With the update to GCC 10 the compiler used to warn when using the internet
checksum functions on packet classes (like in
Net::Ipv4_packet::update_checksum):

warning: converting a packed ‘Net::[PACKET_CLASS]’ pointer
         (alignment 1) to a ‘const uint16_t’ {aka ‘const short
         unsigned int’} pointer (alignment 2) may result in an
         unaligned pointer value

Apparently, the 'packed' attribute normally used on packet classes sets the
alignment of the packet class to 1. However, for the purpose of the
internet-checksum functions, we can assume that the packet data has no
alignment. This is expressed by casting the packet-object pointer to a pointer
of the new packed helper struct 'Packed_uint16' that contains only a single
uint16_t member before handing it over to the checksum function (instead of
casting it to a uint16_t pointer).

Ref #4109
2021-05-05 11:35:31 +02:00
Christian Prochaska
9b854e1496 Prevent recursive 'memset()' calls with gcc 10
Fixes #4125
2021-05-05 11:35:31 +02:00
Christian Prochaska
d5e7870532 virtualbox5: fix build errors with gcc 10
Fixes #4106
2021-05-05 11:35:31 +02:00
Christian Prochaska
bc8dbc6b1a bash: fix build error with gcc 10
Fixes #4107
2021-05-05 11:35:31 +02:00
Christian Prochaska
8f23e377d9 lxip: fix build error with gcc 10
Fixes #4102
2021-05-05 11:35:31 +02:00
Christian Prochaska
aebece5110 readline: fix build error with gcc 10
Fixes #4103
2021-05-05 11:35:31 +02:00
Christian Prochaska
82604f2c2b lx_fs: fix build errors with gcc 10
Fixes #4123
2021-05-05 11:35:31 +02:00
Norman Feske
4563baae77 app/text_area: fix build error with gcc 10
Fixes #4098
2021-05-05 11:35:30 +02:00
Christian Prochaska
c4e3d3dbc4 hw: fix build error with gcc 10
Fixes #4115
2021-05-05 11:35:30 +02:00
Alexander Boettcher
eb53f8c113 seoul: adjust to GCC 10.03
Fixes #4097
2021-05-05 11:35:30 +02:00
Christian Prochaska
07649b667b sel4: fix build errors with gcc 10
Fixes #4121
2021-05-05 11:35:30 +02:00
Christian Prochaska
0f679bb35e pistachio: fix build error with gcc 10
Fixes #4119
2021-05-05 11:35:30 +02:00
Christian Prochaska
d6e9d74038 nitpicker: fix build error with gcc 10
Fixes #4110
2021-05-05 11:35:30 +02:00
Christian Prochaska
405e6744fb nova: update kernel for gcc 10
Fixes #4114
2021-05-05 11:35:30 +02:00
Christian Prochaska
fad85c3fd5 virtualbox6: fix build errors with gcc 10
Fixes #4105
2021-05-05 11:35:30 +02:00
Christian Prochaska
49392dfa44 dde_ipxe: fix build error with gcc 10
Fixes #4101
2021-05-05 11:35:30 +02:00
Christian Prochaska
e627f8320f verify: fix build error with gcc 10
Fixes #4099
2021-05-05 11:35:30 +02:00
Christian Prochaska
8196e229b0 netperf: fix build error with gcc 10
Fixes #4096
2021-05-05 11:35:30 +02:00
Christian Prochaska
0a8394c891 depot_autopilot: store signal context capability as copy
Fixes #4129
2021-05-05 11:35:30 +02:00
Christian Prochaska
66e8f8d764 base: increase bss alignment to 8 bytes
Fixes #4127
2021-05-05 11:35:30 +02:00
Christian Prochaska
84e4cbb54c cxx: add 'strchr()'
Fixes #4122
2021-05-05 11:35:30 +02:00
Tomasz Gajewski
23b21812dd Fixes in gdb_monitor_interactive/target_config.run
Fixes #4134
2021-05-05 11:35:30 +02:00
Norman Feske
d66e55ec37 aes_cbc_4k.run: increase timeout
needed for foc/qemu/x86_32
2021-05-05 11:35:29 +02:00
Martin Stein
5dbc9ef244 nic_router: more descriptive port allocator code
This renames some members and local variables in the port allocator in order to
make the code more descriptive.

Fixes #4086
2021-05-05 11:35:29 +02:00
Sid Hussmann
4e822436fc nic_router: use increasing src port for new nat
The NAT feature of the NIC router used to prefer re-using source ports that
have been freed recently. From an external server's perspective, if a client
dies and restarts, chances are high that the new connect arrives with the same
source-IP/source-port as the old connection. The server has to forcefully reset
the connection. If that happens a lot, the server may even start to ignore
further connections from this IP/port combination for a while as a mitigation.

This patch adds a continuous counter feature that makes sure that every new
port allocation will increment and result in a port that hasn't been used for a
long time.

The NAT feature of the nic_router is now more in line with RFC 6056 chapter 4.

Ref #4086
2021-05-05 11:35:29 +02:00
Alexander Boettcher
ce75b25fd4 ssh_exec_channel: adjust cap quota for seL4
Issue #4095
2021-05-05 11:35:29 +02:00
Josef Söntgen
118e8ee6e1 ssh_terminal: flush buffer on Terminal cleanup
Issue #4095.
2021-05-05 11:35:29 +02:00
Alexander Boettcher
f236e99b5c ssh_terminal: avoid deadlock of EP and pthread.0
pthread.0 acquires a write buffer mutex and calls potentially
blocking fs operations. The EP thread handles session requests and tries to
acquire the same write buffer lock. IO progress events for pthread.0 are
handled by the EP thread, which however is blocking on the write buffer mutex.

The commit uses two write buffers, one which is filled by the EP and a second
which is used by pthread.0. The two buffers are swapped protected by a mutex
without invoking blocking fs operations.

Issue #4095
2021-05-05 11:35:29 +02:00
Alexander Boettcher
86e09b60c4 exec_terminal: sandbox errors about unknown node
The exec_terminal generates a config report which is used as input ROM for
sandbox/init, which does not support an "<empty>" node.

An empty config node is empty, without an node.

Issue #4095
2021-05-05 11:35:29 +02:00
Johannes Schlatow
373b45a0f0 depot: fix content.mk of drivers_managed-pc
Was still using the event_filter.config from drivers_interactive-pc
although a dedicated file is present in the raw archive.

The fix is just for consistency reasons, as sculpt manager is generating the
event_filter.config anyway.
2021-05-05 11:35:29 +02:00
Johannes Schlatow
a2491c30b3 event_filter: add new test cases
genodelabs/genode#4069
2021-05-05 11:35:29 +02:00
Johannes Schlatow
d80b2a150a event_filter: add <log> node
genodelabs/genode#4069
2021-05-05 11:35:28 +02:00
Johannes Schlatow
c802de2cf9 event_filter: add <ignore-key> node
Fixes genodelabs#4069
2021-05-05 11:35:28 +02:00
Johannes Schlatow
e86387d557 event_filter: allow remapping of KEY_UNKNOWN
KEY_UNKNOWN is a collective symbols for all unknown keycodes.
Remapping thus requires iterating through all corresponding codes
instead of only applying the policy to the first match.

Issue genodelabs#4069
2021-05-05 11:35:28 +02:00
Norman Feske
f6aabfe233 Sculpt: prevent nitpicker's resize warnings
This patch increases the RAM quota of the top-level nitpicker instance
to 12 MiB so that resize operations can be buffered for resolutions up
to 2560x1080. It mutes diagnostic messages of the form "Warning: Gui
(...) not enough RAM to preserve buffer content during resize" and
improves the window-resize experience.
2021-05-05 11:35:28 +02:00
Norman Feske
8617e5cee0 Sculpt: un-inspect failed USB storage
With this patch, the user is able to re-gain access to the inspect view
by toggling the inspect button of a file system unrelated to the failed
USB storage device.

Fixes #4090
2021-05-05 11:35:28 +02:00
Johannes Schlatow
2db94b8438 platform_drv/x86: support to disable MSI-X
+ disable for wifi driver MSI-X

Issue #4079
2021-05-05 11:35:28 +02:00
Alexander Boettcher
7b9e7361ba vbox5: add capture pkg version
Issue #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
910ea16405 qemu-usb: restrict build to x86
Issue #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
58db8c647a qemu-usb: add usb webcam model
Fixes #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
4826bd82fe qemu-usb: fix spelling
Issue #4078
2021-05-05 11:35:28 +02:00
Alexander Boettcher
7b90f8f857 libports: add libyuv support
Issue #4078
2021-05-05 11:35:28 +02:00
Johannes Schlatow
bf3ad3baff vbox5/6: pass extra mouse buttons to VM
Fixes #4120
2021-05-05 11:35:28 +02:00
Johannes Schlatow
8a4b52d9e3 vbox: only clear screen if virtual_fb_mode changed
Fixes genodelabs/genode#4085
2021-05-05 11:35:28 +02:00
Johannes Schlatow
a47fd36b9f vbox: fix high VM load after resize
break circle of repeated guest notifications if the guest never
acknowledges a VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST

genodelabs/genode#4084
2021-05-05 11:35:28 +02:00
Christian Prochaska
a2e62db6ec qt5: fix libpng vulnerabilities
Fixes #4089
2021-05-05 11:35:28 +02:00
Alexander Boettcher
7503472ae6 stdcxx: add missing symbols for istream and thread
Issue #3967

triggers using -O0 with test-libc_integration:

libc_integration/main.cc:146: undefined reference to `std::istream::operator>>(unsigned long&)'

contrib/stdcxx-80f380143250d4f951433876698b54fdac32b95f/include/stdcxx/std/thread:67: undefined reference to `vtable for std:🧵:_State'
2021-05-05 11:35:27 +02:00
Johannes Schlatow
1c49da8ce4 terminal: don't overwrite last column until eol
Introduce a new _overflowed state variable to indicate whether the
horizontal boundary was reached already and to omit subsequent character
output.

This state is necessary to maintain a valid cursor position at all
times. The _overflowed attribute is reset once the cursor is moved into
a valid position again.

To harmonise the bounds checking for _cursor_pos modifications, the
`constrain()` method was added.

Fixes genodelabs/genode#4093

Also fixes a bug in `vpa()` and `vpb()` which moved the cursor
horizontally instead of vertically.
2021-05-05 11:35:27 +02:00
Norman Feske
9cb8c37e3a terminal: fix sporadic freeze on font-size changes
The direct execution of application-level code by a watch handler is
troublesome because those handlers are executed at the I/O signal level.
In the concrete case, the watch handler got recursively called because
the handler called _handle_config (application-code), which called the
VFS, which in turn performed a wait_and_dispatch_one_io_signal, which
again invoked the watch handler.

The patch works around the problem by letting the watch notification
trigger the application-level signal for the _config_handler.

Fixes #4091
2021-05-05 11:35:27 +02:00
Pirmin Duss
bb6617ad03 New libc_integration test
I created a test program which stresses the interplay between libc,
pthreads and vfs_pipe and may detect regressions.

The program starts a thread that spawns a bunch of workers, sends and
receives data to them through a pipe. When all data of a worker is
collected, the worker is finished (join()) and a new worker is started.
Both the number of bytes sent to the worker and the size of its
answer are random.

Issue #3967
2021-05-05 11:35:27 +02:00
Tomasz Gajewski
f49ec5b171 tool/run: extract function to copy files
Issue #4073
2021-05-05 11:32:09 +02:00
Tomasz Gajewski
507a7789fb tool/run: avoid error if init.xsd is missing
Issue #4073
2021-05-05 11:32:09 +02:00
Stefan Kalkowski
421d2bed40 platform driver: make device info XML optional
* The device XML information dataspace is only provided,
  when the client's policy states `info="yes"`
* The device XM information gets changed to include the
  physical resource names (I/O memory and IRQ addresses)
  instead of virtual ids and page offset

Fix #4077
2021-05-05 11:31:16 +02:00
Norman Feske
6caa74a18e Remove os/slave.h API
Fixes #3754
2021-05-05 11:21:43 +02:00
Norman Feske
5ac3c335dc Remove pkg/test-dynamic_config_slave
Issue #3754
2021-05-05 11:21:43 +02:00
Norman Feske
e8b97ad684 test/resource_yield: don't use os/slave.h
Issue #3754
2021-05-05 11:21:43 +02:00
Christian Helmuth
3f450a77e1 Fix touchscreen config in usb_hid README 2021-05-05 11:21:43 +02:00
Johannes Schlatow
462bff5aef dde_linux: test subdevice id for device matching
As linux drivers may distinguish device configuration by pci subdevice id in
addition to the pci device id, the former must also be used for finding the
matching entry. Otherwise, e.g., the iwlwifi driver might load the wrong
firmware.

Side note: Add break statement to save superfluous iterations after
match was identified.

Fixes genodelabs#4076
2021-05-05 11:21:43 +02:00
Norman Feske
ace7c9172b Disambiguate Mmio::local_addr
This is a follow-up fix for "Streamline platform-device API on ARM".
There is an ambiguity of the 'local_addr' method between the inherited
'Attached_dataspace' and the local declaration, which results in the
double application of the sub-page Range::start.

Issue #4075
2021-05-05 11:21:43 +02:00
Emery Hemingway
173264ed1e depot: remove ehmry
Fixes #4082
2021-05-05 11:21:43 +02:00
Christian Prochaska
190eafeaa6 base: handle 'unpack_string()' error in 'Arg::string()'
Fixes #4100
2021-05-05 11:21:43 +02:00
Josef Söntgen
ddf6a0c276 os: add invalid path exception to Path_base
In case the path is invalid during import raise the 'Path_invalid'
exception.

Issue #4088
2021-05-05 11:21:42 +02:00
Josef Söntgen
8f30fc993d libc: check path pointer in file I/O functions
Fixes #4088
2021-05-05 11:21:42 +02:00
Alexander Boettcher
33a64f79dc libc: place pthreads round-robin
if the number of threads started exceed configured placement configuration

Issue #3967
2021-05-05 11:21:42 +02:00
Pirmin Duss
7de62734e5 libc: add pipe2 symbol to symbols
Issue #3967
2021-05-05 11:21:42 +02:00
Norman Feske
d73eaaa14c libc: exclude arm_initfini.c
This compilation unit contains a global constructor, which violates our
assumption that the libc is free of global constructors on ARMv7.
Specifically, the graphical terminal fails with the following message:

[init -> terminal] Error: Component::construct() returned without executing
                          pending static constructors (fix by calling
                          Genode::Env::exec_static_constructors())
[init -> terminal] Error: Uncaught exception of type 'Linker::Fatal'

In this case, the libc-less terminal uses the VFS. The VFS mounts the
ttf VFS plugin. The ttf VFS plugin depends on the libc.

The compilation unit 'arm_initfini.c' can safely be excluded because it
merely initializes the global '_libc_arm_fpu_present' variable, which
is not used by the current version of our libc/libm.

Fixes #4080
2021-04-20 12:12:48 +02:00
Norman Feske
efbed6f7bf depot: update recipe hashes 2021-04-20 12:10:58 +02:00
Norman Feske
5ca024ff8b vfs_block.run: adjust cap quota for seL4 2021-04-20 12:10:58 +02:00
Norman Feske
dc8c899c1d Streamline platform-device API on ARM
This API rework eases the access to memory-mapped I/O registers and
interrupts when using the platform driver. It introduces the notions of

- Platform::Device       - one device obtained from a platform session
- Platform::Device::Mmio - locally-mapped MMIO registers of a device
- Platform::Device::Irq  - interface for receiving device interrupts

The patch touches several drivers. Some drivers would require a
significant structural change to adopt the new API (e.g., net/virtio,
dde_linux drivers, imx gpio). In these cases, the patch adds
compatibility shims meant to be temporary. In other cases (e.g., imx
i2c), the adaptation was simple enough to carry through.

Fixes #4075
2021-04-20 12:10:58 +02:00
Stefan Kalkowski
d1cf9c86b8 os: introduce device type in platform driver
* Move "compatible" property value to "type" attribute
* Turn device_by_property helper in Platform::Connection into device_by_type

Fix #4074
2021-04-20 12:10:58 +02:00
Norman Feske
46ca576eac Adjust gcov cap quota for seL4 2021-04-20 12:10:58 +02:00
Norman Feske
70281715c6 ssh_exec_channel.run: fix server IP pattern
This patch adjusts the matching of the IP address such that the external
IP address is used as opposed the the NAT-local address. It is follow-up
fix of the conversion to the uplink session interface.

Issue #3961
2021-04-20 12:10:58 +02:00
Norman Feske
4546148ab7 Adjust test-libc_fifo_pipe cap quota for seL4 2021-04-20 12:10:58 +02:00
Sebastian Sumpf
80cf47d906 ldso: protect object list with mutex
When we allowed symbol resolution during exceptions, we used the shared
object lock to protect ELF object list manipulation (e.g., dlopen,
dclose) when executing exception unwinding code in the linker.
Unfortunately, sometimes libraries that are loaded by 'dlopen' may raise
exceptions in the process, leading to a deadlock within the unwind code.
In order to resolve this, we now protect the object list operations
(i.e., enqueue, removal, iteration) by a separate mutex. This allows
the shared object interface to throw exceptions.

issue #4071
2021-04-20 12:10:58 +02:00
Norman Feske
7c01053842 Adjust test-fault_detection cap quota for seL4 2021-04-20 12:10:58 +02:00
Norman Feske
e28709d54d acpi_drv: use expanding reporter
This makes the driver work on newer machines that produce reports larger
than 16 KiB. E.g., Sculpt OS boots successfully on a Lenovo P53s laptop
now.
2021-04-20 12:10:58 +02:00
Norman Feske
dc89ebf978 core: kernel-agnostic 'Mapping' type
This patch unifies the core-internal 'Mapping' type across all base
platforms.

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

Issue #2243
2021-04-20 12:10:57 +02:00
Norman Feske
7ae1210531 fs_rom: remove "ROM file is missing" messages
These messages pollute the boot log of Sculpt OS when ROM modules are
requested for files of the config fs before the sculpt manager has
created their first version.
2021-04-20 12:10:57 +02:00
Norman Feske
c9d904df71 vfs/tar: remove "tar archive ..." message
This diagnostic output is a mere debugging artifact. By removing them,
we make the boot of Sculpt less noisy.
2021-04-20 12:10:57 +02:00
Norman Feske
21e9e1840a chroot: forward cap-quota upgrades to the server
Fixes #4072
2021-04-20 12:10:57 +02:00
Norman Feske
4e714d3f3a base: handle cap depletion during session upgrade
When the own cap quota of a client does not suffice for a cap upgrade of
an existing session to a server, the client must issue a cap-resource
request to the parent. This logic was already in place for RAM quota but
was missing for cap quota.

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

fixes #4071
2021-04-20 12:10:57 +02:00
Norman Feske
af490bdd5b Revert "sculpt: tweak window motions in leitzentrale"
Apparently the skewed motion timings came from the issue fixed by
"timer: restore semantics of periodic timeout 0". With the current
version of the timer, the original motion parameters work just fine.
2021-04-20 12:10:57 +02:00
Norman Feske
0339318572 platform_session: cache arg for alloc_dma_buffer
This patch extends the 'Platform_session::alloc_dma_buffer' interface
with a 'Cache' argument that corresponds to the argument accepted by
'Ram_allocator::alloc', which is used by the platform driver under the
hood.

Since the x86 platform driver used to be hardwired to allocate DMA
buffers as UNCACHED, I adjusted all drivers by specifying the UNCACHED
argument. Right now, this is needed as a hint for core to steer the
allocation of I/O page tables. Once we eliminate the need for such hints
(by introducing an explicit 'Region_map::attach_dma' operation), we can
revisit the drivers individually because cached DMA buffers should
generally be fine on the x86 architecture.

Issue #2243
2021-04-20 12:10:57 +02:00
Norman Feske
53e44f8bfd x86/platform_session: import Genode namespace
This change avoids many repetetive Genode:: prefixes, making the code
easier to read. The patch also includes a few consistency fixes
regarding include guards and file headers. It also renames
Platform_device::String to Platform_device::Device:name.

Issue #2243
2021-04-20 12:10:57 +02:00
Norman Feske
a839b4f0bb gdb_monitor: adapt to sandbox library changes
Issue #4068
2021-04-20 12:10:57 +02:00
Norman Feske
468e7a825c base/cache.h: rename Cache_attribute to Cache
The short name is better because the type will become prominently
visible at the API.

Issue #2243
2021-04-20 12:10:31 +02:00
Norman Feske
3ed8df9089 x86/platform_drv: add Platform::Session::dma_addr
This patch adds the designated alternative to Dataspace::phys_addr to
the platform-session interface. Under the hood, the platform driver
still calls Dataspace::phys_addr but it should eventuelly become the
only caller before we can abolish this function.

Issue #2243
2021-04-20 12:03:05 +02:00
Norman Feske
97a9ad114c platform_session: bus_addr_dma_buffer to dma_addr
Issue #2243
2021-04-20 12:03:04 +02:00
Norman Feske
f5f5b8c1f1 sandbox/init: route model
This commit optimizes the 'Child::resolve_session_request'
implementation by introducing an internal 'Route_model' for quickly
traversing routing rules instead of parsing XML on each session request.

Fixes #4068
2021-04-20 12:03:04 +02:00
Norman Feske
b661459aca sandbox/init: parse config using 'List_model'
This commit replaces the hand-crafted config processing by the use of
the 'List_model' utility. This has the following advantages:

- The parsing follows a common formalism that makes the code
  easier to maintain and to understand. Several parts of the code
  had to be changed (for the better) to make it fit the list model
  approach. E.g., the child states have become more expressive
  and logical.

- In the common case, the XML data is traversed only once, which
  increases the parsing speed in dynamic scenarios.

- The code becomes easier to optimize. In particular, the patch skips
  the re-evaluation of the session routing if no service is affected
  by the config change.

The patch also revisits the init test by removing overly long sleep
phases and extending a few sleep phases that were too short when
executing the test on Qemu.

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

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

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

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

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

Fixes #4066
2021-04-20 12:03:03 +02:00
Norman Feske
ac07f9d08e sculpt: skip GUI handling until framebuffer is up
This avoids unneeded activity of the Leitzentrale GUI (e.g., the
decorator) at the early boot phase of Sculpt.
2021-04-20 12:03:03 +02:00
Norman Feske
ed9487b452 rtc_drv: defer init until first use
This patch avoids the RTC driver's aggressive polling during the
(CPU-bounded) boot of Sculpt OS. As the RTC is not needed during bootup,
this patch reduces the boot time (on Qemu) by 2-4 seconds.

Fixes #4065
2021-04-20 12:03:03 +02:00
Norman Feske
729b22f04f rtc_drv/x86: code structure
Give the driver code a proper context in the form of a 'Driver' class.

Adjusted while investigating issue #4065.
2021-04-20 12:03:03 +02:00
Norman Feske
698f6eb86c gdb_monitor: weaken reliance on sandbox internals
GDB monitor re-uses internal parts of the sandbox library. It thereby
relies on the internal detail of how local headers are included (using
"" instead of the now usual practice <>). A seemingly unrelated change
"init/sandbox: avoid repetitive state reports" eventually broke the
build of the GDB monitor.

This patch makes the GDB monitor less reliant on the way of how the
sandbox includes headers internally.

It also fixes a few warnings caused by the double definition of
__GENODE__ (adding an missing include guard and making the #define
conditional).

Related to issue #4064
2021-04-20 12:03:03 +02:00
Norman Feske
73e8d64c34 init/sandbox: avoid repetitive state reports
Fixes #4064
2021-04-20 12:03:03 +02:00
Christian Helmuth
cb9a26f1ed vbox6: sculpt runtime package
Issue #4031
2021-04-20 12:03:03 +02:00
Norman Feske
49481dd3fb timer: restore semantics of periodic timeout 0
The 'Timer::Session::trigger_periodic' RPC function used to accept 0 as
a way to de-schedule the periodic processing. Several components such as
nitpicker relied on this special case. In "timeout: rework timeout
framework", the value of zero was silently clamped to 1, which has the
opposite effect: triggering signals at the maximum rate. This results in
a visible effect in Sculpt where the leitzentrale-nitpicker instance
produces a constant load of 2% CPU time.

This patch restores the original timer semantics by

- Documenting it in timer_session.h,

- Handling the case explicitly in the timer implementation, and

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

Issue #3884
2021-04-20 12:03:03 +02:00
Norman Feske
dc8dd3396d base: move Xml_generator::Node::Node behind ABI
Fixes #4063
2021-04-20 12:03:03 +02:00
Christian Helmuth
9ac23a18d4 vbox6: synchronize guest-memory handling 2021-04-20 12:03:03 +02:00
Norman Feske
ae8050bb82 wm.run: let nitpicker request fb and input
This patch restores the ability to launch nitpicker within a gui_fb
window. It is a follow-up fix for "nitpicker: make framebuffer and input
optional".

Issue #3812
2021-04-20 12:03:02 +02:00
Tomasz Gajewski
0a849a1681 prepare_port: cache handling for files with paths
This patch is a follow-up fix for issue #4028 that fixes #4061.
2021-04-20 12:03:02 +02:00
Christian Prochaska
f89414c637 libports: update expat port
Fixes #4060
2021-04-20 12:03:02 +02:00
Christian Helmuth
4cdfeb13e2 vbox6: cleanup code and log output
Issue #4031
2021-04-20 12:03:02 +02:00
Christian Helmuth
1a57a5a959 vbox6: refactor vcpu implementation
Also add recent SVM changes from vbox5.

Issue #4031
2021-04-20 12:03:02 +02:00
Norman Feske
96cc660f95 sculpt: system reset via PS/2 and ACPI
This patch enables sculpt to utilize the CPU reset mechanism via the
PS/2 controller as well as the information provided via the ACPI FADT
information. Whenever the /config/system file is changed to <system
state="reset"/>, both mechanisms are triggered.

Supporting both mechanisms is useful because the PS/2-based reset does
not work reliably on modern machines. The PS/2-based reset is useful in
the case when the FADT reset information refers to the PS/2 command
port. In this case, the platform driver is unable to access this port
because it is already handed out to the PS/2 driver. In this case, the
PS/2 driver kicks in.

Issue #2726
2021-04-20 12:03:02 +02:00
Norman Feske
2c7c7767fc platform_drv: respond to <system state="reset"/>
If 'system="yes"' is specified in the <config>, the platform driver now
monitors the content of the system ROM. Should the value become "reset",
a reset is triggered using information obtained from the ACPI driver.

Related to issue #2726
2021-04-20 12:03:02 +02:00
Norman Feske
9f8c555e7d ps2_drv: respond to <system state="reset"/>
This patch adds the option for monitoring a system ROM to the PS/2
driver and issuing a CPU reset whenever the state becomes "reset".

Issue #2726
2021-04-20 12:03:02 +02:00
Norman Feske
fb9f6812e1 acpi_drv: export ACPI reset info from FADT
The change of the platform driver is needed to avoid a parsing error of
the ACPI ROM when encountering an unexpected <reset> node.

Thanks to Alexander Boettcher for the preventing the regression of #3829
and improving the adherence to the ACPI spec when parsing the reset type.

Related to issue #2726
2021-04-20 12:00:09 +02:00
Christian Helmuth
839183d2b6 vbox6: unify EMT and vCPU entrypoint
Issue #4031
2021-04-20 11:57:19 +02:00
Christian Helmuth
c67e78a7f0 vbox6: update to version 6.1.18
Issue #4031
2021-03-29 15:49:59 +02:00
Christian Helmuth
0ac4d1d411 libc: rename special-purpose pthread creation functions
The functions are used by our VirtualBox ports to hook into thread
creation and, thus, are listed in the ABI symbols.

Issue #4031
2021-03-29 15:48:11 +02:00
Norman Feske
0f9cb72cfa depot: update recipe hashes 2021-03-29 13:46:49 +02:00
Norman Feske
27527bf165 wm: allow clients to upgrade session caps
This patch adds the handling neccessary for clients to upgrade the cap
quota of their GUI session. Until now, the upgrade mechanism supported
only RAM quota.

The limitation became visible once a client - in the particular case the
motif_decorator - attempted the cap upgrade of its GUI session. The cap
quota would arrive at the wm, but the wm would keep it instead of
forwarding the quota to nitpicker. This resulted in an infinite retry
loop at the motif_decorator, ultimatedly depleting all its cap quota.
2021-03-29 13:45:25 +02:00
Norman Feske
f839b3ecba wm: make hover handling robust against input races
The window manager infers the overall state from the intercepted input
events for the decorator and all GUI clients. However, each of those
parties have an independent input-event stream. Whereas the order of
events within one GUI session is strict, the order of events between GUI
sessions is arbitrary. The window manager wrongly relied on a global
event ordering to track the pointed-at GUI session.

The patch removes the assumption of a global event order by tracking the
relevant pointer state for each GUI session independently and evaluating
these states when propagating the pointer position to the decorator.

Fixes #4059
2021-03-29 13:45:24 +02:00
Norman Feske
bfea27a258 Tweak to support delete key in bash
This commit modified bash's builtin mapping of character sequences to
readline-functionality to detect the sequence of the delete symbol as
generated by the terminal.

Fixes #4058
2021-03-29 13:45:24 +02:00
Christian Helmuth
4f91d71cf9 zynq_qemu: disable fb_bench and nic_router_flood tests 2021-03-29 13:45:24 +02:00
Jean-Adrien DOMAGE
32169cd137 add I2c driver for imx8q based platform
This commit introduces a new i2c driver for the imx8q_evk based platform.

Fixes #4052
2021-03-29 13:45:24 +02:00
Norman Feske
eb89b13327 depot: update recipe hashes 2021-03-24 11:32:53 +01:00
Norman Feske
b51c1a0fe3 News item for Sculpt 21.03 2021-03-24 11:32:53 +01:00
Norman Feske
f90cd542cb sculpt: documentation update 2021-03-24 11:32:53 +01:00
Christian Helmuth
dce272ba8f tool/xkb2ifcfg: update README to event_filter 2021-03-24 11:09:08 +01:00
Alexander Boettcher
141af733aa vbox5: remove priority bands from vbox5-* packages 2021-03-24 10:34:55 +01:00
Alexander Boettcher
945b4760ef sculpt: remove vfs.lib and init from common rules
to support packages using own build versions and to detect packages missing
to specify dependency on init.
2021-03-24 10:34:55 +01:00
Alexander Boettcher
53041f4cd8 usb_host: support to disable usb controller types
The commits adds the same configuration values as supported up to now by
the monolithic usb driver. In contrast to the original, by default all drivers
are started. Disabling a controller type is used by Sculpt, e.g. for OHCI if
running Sculpt inside Virtualbox.
2021-03-23 11:50:37 +01:00
Alexander Boettcher
521f61b9e0 usb_hid: disable wacom driver
Issue #3997
2021-03-23 11:32:24 +01:00
Norman Feske
ca50a41d28 depot: update recipe hashes 2021-03-23 11:28:53 +01:00
Norman Feske
b29f1497bf depot_query: sort depot-user scan results
Related to issue #4054
2021-03-23 11:28:21 +01:00
Norman Feske
ca5522d4d9 sculpt: move chargen files to config/keyboard/
The addition of further keyboard layouts would otherwise pollute the
config/ directory too much.

Caution: When updating Sculpt OS, don't reuse your existing
config/event_filter file unmodified! You need to replace the chargen
includes, pointing to the new location, e.g.,

  <include rom="en_us.chargen"/>
  <include rom="special.chargen"/>

must be changed to

  <include rom="keyboard/en_us"/>
  <include rom="keyboard/special"/>

Issue #4055
2021-03-23 11:28:21 +01:00
Norman Feske
36ef41626a sculpt: keyboard-layout selection dialog
This patch extends the settings dialog with the ability to select the
keyboard layout between the options that are included in the sculpt
image. The manual configuration is of course still possible by editing
the /config/event_filter directly.

If both the fonts configuration and the event-filter configuration are
managed manually, the settings button and window are not displayed.

Fixes #4055
2021-03-23 11:28:21 +01:00
Norman Feske
e9ac14ed49 fs_query: report dir content in alphabetic order
By sorting the reported output, all consumers of the reports become able
to rely on a deterministic order. For example, the file browser of
Sculpt OS, the launcher menu items, and the depot-selection items will
appear in a predictable order.

Fixes #4054
2021-03-23 11:28:20 +01:00
Norman Feske
8f1db47c26 sculpt: screen capturing and event injection
This patch adds session-routing options to connect components to the
capture/event interfaces of the global nitpicker GUI server or the
leitzentrale GUI server. It thereby enables the implementation of screen
capturing components, remote management tools, or virtual keyboards.

Since those services are very powerful, they are subsumed under the
"hardware" category of the component graph as opposed to the GUI
category, which guarantees the separation of clients.

Fixes #4053
2021-03-23 11:28:20 +01:00
Norman Feske
d2fc834bfa os: depot recipe for pkg/test-capture
This package allows for experimenting with the capture-session
interface.
2021-03-18 17:36:35 +01:00
Christian Prochaska
3d432331b9 libc: mmap: use VFS handle as reference for shared mappings
Fixes #4050
2021-03-17 16:30:41 +01:00
Christian Prochaska
446df00d0d libc: support 'RLIMIT_DATA' resource in 'getrlimit()'
Fixes #4049
2021-03-16 17:45:40 +01:00
Tomasz Gajewski
2f0898d2a9 dde_linux: fixes in makefiles
Issue #3972
2021-03-16 11:25:25 +01:00
Christian Prochaska
9a0217f21a imx8: use 'snps,dis_u2_susphy_quirk'
Fixes #4048
2021-03-16 11:19:32 +01:00
Christian Prochaska
0cfafa1c8f usb_host_drv: support command timeouts and bool properties
Fixes #4047
2021-03-16 11:19:17 +01:00
Norman Feske
2c85e48a0d Revert "run: tweak CRLF translation in log scripts"
The substitution eats carriage-return characters in some cases such as
the Pine-A64-LTS board connected via an TTL-232R-RPi cable.
2021-03-12 15:08:11 +01:00
Norman Feske
15780a657c sd_card_bench.run: allow timer to reach IO_MEM
This is needed on seL4 on i.MX6 where the user-level timer driver
accesses memory-mapped I/O registers directly.
2021-03-12 12:09:17 +01:00
Norman Feske
5c5b56d1e0 depot: update recipe hashes 2021-03-12 12:08:24 +01:00
Norman Feske
00900d82b5 sculpt: tweak window motions in leitzentrale 2021-03-12 12:01:39 +01:00
Alexander Boettcher
18182b11da base: exit loop on cpu session close
if session can't be closed immediately, e.g. if the service is provided by
a child (cpu_balancer) and not by the parent.

Issue #4029
2021-03-12 12:01:39 +01:00
Norman Feske
8eb514d6b5 sculpt: interactive priority configuration
This patch reworks the resource-assignment dialog to allow the user to
select the scheduling priority in addition to the CPU affinity.

Fixes #4045
2021-03-12 12:01:39 +01:00
Alexander Boettcher
8a8de970a5 sculpt: add system clock package to index
Issue #4046
2021-03-12 12:01:39 +01:00
Sid Hussmann
cae3e447d6 vfs/pipe: fix pagefault during congested pipes
Issue #4030
2021-03-12 12:01:39 +01:00
Alexander Boettcher
f98d10a3f3 depot_deploy: support packages providing Rtc
Fixes #4046
2021-03-12 12:01:39 +01:00
Alexander Boettcher
521663c6de system_rtc: add standalone runtime package
Package contains no rtc driver, which must be provided separately.

Issue #4046
2021-03-12 12:01:39 +01:00
Alexander Boettcher
9b5bedefc7 expanding_pd_session: remove cap warning message
which are caused often when a component runs a bit longer and has dynamic
resource usage, e.g. running Genode's tool chain.
2021-03-12 12:01:39 +01:00
Norman Feske
8ecc258d3f sculpt: introduce runtime priorities
This patch adds 4 priority levels to the runtime subsystem. The highest
priority is used for components that are critical for the operation of
Sculpt, in particular the Leitzentrale GUI. All regularly deployed
components are assigned the lowest priority by default.

With priorities available in the runtime subsystem, this patch flattens
the priority levels at the top-level init to only two levels and
overlays the priority bands of the drivers, leitzentrale, and runtime
subsystems into one priority band. This has three benenfits:

- This change prevents the starvation of the Leitzentrale GUI from a
  spinning high-priority driver (issue #3997).

- The change will also ease the hosting of latency-critical components
  in the runtime subsystem that are prioritized higher than regular
  components, the storage stack, and the network stack.

- The Leitzentrale GUI remains always perfectly responsive regardless
  of the workloads deployed from packages. In the previous version,
  the runtime graph was sometimes stuttering on high system load.

Issue #4045
2021-03-12 12:01:39 +01:00
Sebastian Sumpf
7bbd050f25 riscv: adjust timeout run script to RISC-V
* Limit required memory for RISC-V to 15 MB per buffer

issue #4021
2021-03-12 12:01:39 +01:00
Norman Feske
7e7c10e66c Add sandbox test to depot autopilot
Issue #4044
2021-03-12 12:01:39 +01:00
Norman Feske
d5d3b3c3a4 test.run: support binaries other than init
This change enables the use of runtime pkgs that specify the test binary
directly as attribute in the <runtime> node.
2021-03-12 12:01:39 +01:00
Norman Feske
2baa283d87 vfs_lwip: reduce repeated warnings
This patch avoids the repeated warning "read blocked until lwIP
interface is ready" by printing the message only once. Otherwise,
the log is flooded with those warnings when falkon web browser
is started on Sculpt OS without network connectivity.
2021-03-12 12:01:39 +01:00
Josef Söntgen
4a12b5c653 mixer: fix README with regard to boolean values
Issue #4043.
2021-03-12 12:01:39 +01:00
Josef Söntgen
ba6c4a664f mixer: use audible default settings
In case there is no valid configuration the component used to mute
output by default. This, however, might lead to the assumption that
audio is not working at all. Instead set the master output volume to
50% and the per application volume to 100%.

Fixes #4043.
2021-03-12 12:01:38 +01:00
Norman Feske
9093c293cb sandbox: destroy 'Session_state' of local services
This patch adds the missing destruction of session-state objects of
local services when closing a session. Because of the missing
destruction, those session-state object remained part of the server
ID space. This becomes a problem once the backing store of the session
state object vanishes, that is when the client child gets removed from
the sandbox. Hence, the removal of a child with an open session to a
local service would lead to the corruption of the server ID space.

This patch adds the missing session.destroy() call.

Fixes #4044
2021-03-12 12:01:38 +01:00
Norman Feske
935bb36fe4 base: fix child destruction while close requested
This patch fixes a corner case where a child is destructed while a
asynchronous close request to a sibling server is still pending.

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

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

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

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

Fixes #4039
2021-03-12 12:01:38 +01:00
Norman Feske
755aed7cb2 dde_linux: don't spin when panicking
Issue #3997
2021-03-12 12:01:38 +01:00
Sebastian Sumpf
6223ae4413 riscv: Interrupt controller support
- Enable the "platform-level interrupt controller" PLIC on base-hw
- The RISC-V specification offers only a register description, but no
  layout for the register set. This implies the layout is platform
  dependent, and therefore, implemented separately for Qemu

issue #4042
2021-03-12 12:01:38 +01:00
Sebastian Sumpf
bebba3876e run boot_dir hw: build debug ELF binaries again
- build debug version of core and bootstrap found under
  _var/run/<runscript>.core_ (.bootstrap). This is a regression when
  switching from object to archive library linkage of core.

fixes #4027
2021-03-12 12:01:38 +01:00
Norman Feske
aa0a98bd43 base-foc/hw: avoid use of placement new operator
Fixes #2106
2021-03-12 12:01:38 +01:00
Josef Söntgen
42f3d2eccd qemu-usb: reset completion pointer
Reset the completion pointer to prevent a double free in case the
packet is processed during ISOC IN request handling.

Fixes #4041.
2021-03-12 12:01:38 +01:00
Josef Söntgen
c03534e355 boot_dir/nova: enable intel_hwp
Instruct bender to enable Intel HWP on supported CPUs unconditionally
to gain more insight by using the feature most prominently in Sculpt.

Fixes #4040.
2021-03-12 12:01:38 +01:00
Norman Feske
1e0d843464 libc: avoid using placement new operator
Issue #2106
2021-03-12 12:01:38 +01:00
Norman Feske
8c7d34ff21 rpi_platform_drv: remove placement new operator
Issue #2106
2021-03-12 12:01:38 +01:00
Norman Feske
d6a312f438 tool/builddir: pass --ccache to run tool
With this patch, the build directory's CCACHE configuration is applied
to the building of depot archives when using the --depot-auto-update
feature.

Note that this is effective only when resetting the hash files before
building so that each depot-auto-update results in the same-named
versions. Otherwise, the include paths (that include the version name as
part of the path) make cache hits impossible.

Issue #4004
2021-03-12 12:01:38 +01:00
Norman Feske
6544cca320 tool/run: add --ccache argument
If this argument is combined with --depot-auto-update, the run tool
enables the use of ccache when invoking the depot/create tool.

Issue #4004
2021-03-12 12:01:38 +01:00
Norman Feske
3d0ed5992d tool/depot/create: add CCACHE=1 option
This commit complements issue #4004 with support for the depot/create
tool. If CCACHE=1 is specified at the command line, the build directory
for building a binary archive is configured with 'CCACHE := yes'.
2021-03-12 12:01:38 +01:00
Norman Feske
366fda0e47 sculpt: release part_block after device discovery
This patch triggers the immediate removal of part_block once the
discovery of a fresh inserted USB stick has completed. Without the
patch, part_block was retained until the runtime was reconfigured the
next time for other reasons (e.g., toggling an inspect view). Until the
next reconfituration, part_block tended to stand in the way of directly
assigning the USB device to a VM.
2021-03-12 12:01:38 +01:00
Christian Helmuth
7ce1f8e92d Enable en_us chargen in drivers_interactive-imx8q_evk
Issue #4038
2021-03-12 12:01:37 +01:00
Christian Helmuth
6e9843bd05 test-libc_fifo_pipe: more cap quota required for sel4/x86_64
Issue #4030
2021-03-12 12:01:37 +01:00
Norman Feske
2ff252360d sculpt: avoid flickering of leitzentrale
This patch increases the RAM quota of the nitpicker instance for the
leitzentrale to make it suffice for the buffering of content during
resize operations. This fixes a flickering artifact when having an
inspect view open while entering a WLAN passphrase. When the connect
button appears or disappears (depending on the number of written
characters), some parts of the inspect terminal would flicker sometimes.
2021-03-12 12:01:37 +01:00
Norman Feske
9de61e7014 base: detect truncated session args
This patch reflects the truncation of session arguments (e.g., by very
long session labels) by denying the session request.

Fixes #4037
2021-03-12 12:01:37 +01:00
Norman Feske
6712eac7e6 platform driver: use same label for all device PDs
Fixes #4037
2021-03-12 12:01:37 +01:00
Martin Stein
25a212aa24 nic_router: fix uncaught bit alloc exception
* catch every possible path of the Bit_allocator_dynamic::Out_of_indices
  exception
* add unconditional log output in the new "catch" directives, so, we will be
  able to debug the problem a bit more in detail next time

Fixes #4036
2021-03-12 12:01:37 +01:00
Alexander Boettcher
89ffc48576 depot_deploy: integrate shim and adapt sculpt
Issue #3837
Issue #4029
2021-03-12 12:01:37 +01:00
Norman Feske
9a5bc9caf0 cpu_balancer.run: use shim for hosting cpu_burner
This way, the redirected env sessions for the CPU burner are no longer
called directly by init. Init stays independent from the behavior of the
CPU balancer.

Issue #3837
Issue #4029
2021-03-12 12:01:37 +01:00
Norman Feske
c0a7565c21 os: shim helper for safe routing of env sessions
This shim component can be used in case where env sessions of child
(i.e., child's PD session) must be routed to another child of init.

Without the shim, init would directly need to interact with these
sessions and would thereby make itself dependent of the server's
behavior. RPC calls to a server hosted as a child lead to all kinds of
problems such as livelock situations, and putting the robustness of init
at the whim of its child.

With the shim, init merely needs to bootstrap the shim component by
routing the shim's env sessions to core as usual. The server is only
used for the sessions for the actual application hosted atop the shim.

Issue #3837
Issue #4029
2021-03-12 12:01:37 +01:00
Alexander Boettcher
a02ec07e49 sculpt_manager: add PD as service
Issue #3837
2021-03-12 12:01:37 +01:00
Alexander Boettcher
1f29055927 depot_deploy: support providing CPU and PD service
Issue #3837
2021-03-12 12:01:37 +01:00
Alexander Boettcher
7af276ac81 cpu_balancer: add support to provide PD service
Issue #3837
2021-03-12 12:01:37 +01:00
Tomasz Gajewski
de62582905 prepare_port: simple cache for downloads
Fixes #4028
2021-03-12 12:01:37 +01:00
Norman Feske
ba567f4ba8 Avoid double slashes in select_from_repositories
Issue #4019
2021-03-12 12:01:37 +01:00
Alexander Boettcher
ee0ed273e6 vm_stress: increase cap quota for 3 & 4 vcpu test
due to changes by

   base: refactor VM/vCPU API

   Issue #3554
2021-03-12 12:01:37 +01:00
Norman Feske
e1bb0e8e15 usb_host: refine class heuristics on device report
This patch is an interim fix for using HID devices that offer a HID
interface as not the first interface. It also supplements the
interface classes as supplemental information to the USB-devices
report.

Fixes #4035
2021-03-12 12:01:37 +01:00
Norman Feske
2e4ccc1459 usb_host: reflect ENOSPC as STALL
Issue #4035
2021-03-12 12:01:37 +01:00
Norman Feske
80522fadf6 usb_hid: don't touch non-HID interfaces
Issue #4035
2021-03-12 12:01:36 +01:00
Norman Feske
2ce4a3b400 sculpt: version 21.03 2021-03-12 12:01:36 +01:00
Norman Feske
c68443e2eb base-hw: support packaging of multi-arch boards
With this patch, the board/<name>/arch property file can have multiple
lines where each line denotes an instruction-set architecture supported
for the board.

Issue #4019
Fixes #4034
2021-03-12 12:01:36 +01:00
Stefan Kalkowski
9685a8b60d drivers_managed-imx8q_evk: add dummy_rtc_drv
Ref #4033
2021-03-12 12:01:36 +01:00
Tomasz Gajewski
23e3079f46 tool/run: option to copy tftp served files
Fixes #3386
2021-03-12 12:01:36 +01:00
Stefan Kalkowski
10b56afff0 rtc_drv: add dummy driver
* Add dummy driver implementation and depot package
* Extend configuration to allow setting an initial RTC value

Fix #4033
2021-03-12 12:01:36 +01:00
Sebastian Sumpf
d4b58b689c base-hw: fix RISC-V duration calculation
Simplify calculation of Timer::_duration, the old implementation caused
the time running backwards sometimes. This makes
'nic_router_dhcp_*' and 'event_filter' run scripts succeed.

issue #4021
2021-03-12 12:01:36 +01:00
Norman Feske
1826ff8a59 sculpt: constrain initial log-window size
This prevents the log terminal from adjusting itself to the whole screen
size before the leitzentrale window layout is applied. This intermediate
size can otherwise exhaust the 8 MiB of RAM quota of the log terminal.

Issue #3970
2021-03-12 12:01:31 +01:00
Christian Helmuth
86ad4ed17f version: 21.02 2021-02-25 11:26:18 +01:00
Norman Feske
1d1b5b88c5 News item for version 21.02 2021-02-25 11:24:28 +01:00
Norman Feske
4f1a3a8000 Release notes for version 21.02 2021-02-25 11:24:28 +01:00
Christian Helmuth
0afd3db894 depot: update recipe hashes 2021-02-25 11:24:23 +01:00
Christian Helmuth
cbe81d35b9 autopilot: disable run script not supported by riscv
Issue #4021
2021-02-25 11:22:59 +01:00
Josef Söntgen
1d551bd967 vbox6: add QEMU xHCI device-model 2021-02-25 11:22:59 +01:00
Alexander Boettcher
812c3599de vbox6: add network backend using the nic session
as used in vbox5 already.
2021-02-25 11:22:59 +01:00
Christian Helmuth
20caac5f3b Port of VirtualBox 6.1.14 2021-02-25 11:22:59 +01:00
Christian Helmuth
a47b374905 vim.run: import clipboard archive only once 2021-02-23 13:22:50 +01:00
Christian Helmuth
7a3dc68f34 vbox5: fix typo 2021-02-23 13:22:48 +01:00
Christian Prochaska
dd92ab126b libc: test TLS support in pthread test
Fixes #4023
2021-02-23 12:19:25 +01:00
Sebastian Sumpf
f68e655312 mk: link core to library archive instead of .o file
Do not link base and core libraries into on large relocatable .o file,
which is linked later to core - causing long link times. Create an
independent library archive out of the base and core libraries that can
be linked faster.

issue #4027
2021-02-23 12:17:04 +01:00
Norman Feske
64165d829e depot: update recipe hashes 2021-02-23 12:07:18 +01:00
Norman Feske
c2feba065f Reduce pointers to doc/ in top-level README
Avoid referencing the content of doc/ for topics that are covered by the
Genode Foundations book.
2021-02-23 12:07:18 +01:00
Christian Helmuth
219809ffed base: refactor VM/vCPU API
Issue #3554
2021-02-23 12:07:18 +01:00
Sid Hussmann
6e8728f2d3 vfs/pipe: use local signal handling
This commit improves the performance of the pipe plugin by using local
signal handling and avoiding sending a signal during write when pipe
buffer is full.

Issue #3583
2021-02-23 12:07:17 +01:00
Stefan Kalkowski
90d9470dfd vmm: add virtio block device model
* Add new virtio device model
* Extend test run-script with vfat block test image
* Add vmm depot src recipe
* Use packages in test run-script

Fix #4025
2021-02-23 12:07:17 +01:00
Stefan Kalkowski
2879aa003b vmm: cleanup virtio model, make it extensible
* Introduce different index types for ring counters and descriptor arrays
  within the Virtio split queue implementation
* Be more accurate in reporting the queue number supported, and raise it
  to 512
* Introduce abstractions for mmio register access, where several values
  are stored at the same place, and selector registers exist.
* Turn Virtio_device into a template to define the Virio queue type,
  and its numbers per device model (needed for e.g., future block model)

Issue #4025
2021-02-23 12:07:17 +01:00
Stefan Kalkowski
83c2309710 run: don't rebuild core/bootstrap when available
Fix #4026
2021-02-23 12:07:17 +01:00
Christian Prochaska
59459e60e7 libc: pthread TLS optimizations
Fixes #4024
2021-02-23 12:07:17 +01:00
Sid Hussmann
8d13121e84 vfs/pipe: refactor read/write synchronization
All pipe-ends were notified at the same time which leads to dead-locks.
This commit mitigates this by having a signal handler for each pipe and
each pipe-end respectively.

Issue #3583
2021-02-23 12:07:17 +01:00
Sid Hussmann
3ff0efd627 vfs/pipe: add fifo feature to pipe plugin
The vfs pipe plugin can now be used as named pipe which anables data
transfer via file handles from one component to another. E.g. if one
would like to send data from component A to stdin of a libc component B,
one can do so by simply writing to that fifo file.

Issue #3583
2021-02-23 12:07:16 +01:00
Norman Feske
10605a6903 Spelling fix 2021-02-23 12:07:16 +01:00
Martin Stein
6937eb7d94 drivers_nic-rpi: use usb_net and usb_host
Ref #3961
2021-02-23 12:07:16 +01:00
Martin Stein
a462a8e741 usb_host: compile errors with DEBUG_LINUX_PRINTK
Ref #3961
2021-02-23 12:07:16 +01:00
Martin Stein
3485282909 drivers/platform/rpi: remove dead code
Ref #3961
2021-02-23 12:07:16 +01:00
Sebastian Sumpf
b6d20b4742 autopilot: disable run script not supported by riscv
- libc and nic driver are currently not available on RISC-V

issue #4021
2021-02-23 12:07:16 +01:00
Sebastian Sumpf
7318ca6084 depot: add 'riscv' to depot spec
issue #4021
2021-02-23 12:07:16 +01:00
Sebastian Sumpf
ca777fe93f riscv: add riscv_qemu base-hw recipe
issue #4021
2021-02-23 12:07:16 +01:00
Sebastian Sumpf
ccd9ba4161 riscv: move CPU header from base-hw to base
issue #4021
2021-02-23 12:07:16 +01:00
Christian Helmuth
954f03257d Update curl to version 7.70.0
Issue #3773
2021-02-23 12:07:16 +01:00
Pirmin Duss
190b4784c5 openssl: do not depend on ARM CPU probing
With this commit libcrypto does not use ARM NEON extension as long as
SPECS includes "neon". arm_v7a does declare "neon" per default while
arm_v8a does.

Issue #3773
2021-02-23 12:07:16 +01:00
Christian Helmuth
f23e302475 Update OpenSSL to version 1.1.1i
Note, OpenSSL now comes as one combined depot archive *openssl* that
replaces the former *libssl* and *libcrypto* archives. The libraries are
still separate binaries for compatibility with legacy software.

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

issue #4019
2021-02-23 12:07:15 +01:00
Martin Stein
ce31c90bc3 run/netperf.inc: fix problem with reused ports
It seems that with the nigthly autopilot the data port (that is choosen by the
client) may stay some time (minutes) allocated after the a test run. This
causes successive tests to fail when trying to reuse the port.

* Use a unique data port for each target platform in the range of 18000-18099.
* Add documentation on how to prepare for running the test on a Linux target.
* Remove Qemu-specific code paths as Qemu isn't supported anymore by the script
  since the introduction of the Uplink session (running with a NIC router on
  Qemu was never supported and now we always need a NIC router).

Ref #3961
2021-02-23 12:02:46 +01:00
Martin Stein
f9c258a372 lwip_lx.run: typo in doc
Ref #3961
2021-02-23 12:02:45 +01:00
Norman Feske
048a4625c5 base: remove stale spec/fpu_vfpv3.mk file 2021-02-23 12:02:45 +01:00
Norman Feske
db3f86d603 base-hw: avoid double slashes in path names 2021-02-23 12:02:45 +01:00
Norman Feske
fa68325a57 base-hw: streamline extraction of depot archives
This patch simplifies the packaging of the base-hw kernel for a given
board, in particular when the board support is hosted as an external
repository such as genode-world. Regardless of where the board-support
is hosted, the content.mk file becomes as simple as:

  include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc

The board name is automatically inferred from the path of the src
recipe. The architecture is determined from board/<name>/arch files,
following the pattern of the image_link_address. The attempt to build a
base-hw-<board> binary archive for the wrong architecture is now
gracefully handled by skipping all targets (using the REQUIRES
mechanism).

Besides the improved convenience, the patch results in depot archives
that are much closer tailored to the actual board by omitting files for
architectures that are not used by the board. E.g., the src/base-hw-pc
archive does not contain any ARM-related content.

The patch also restores the package builds for core/bootstrap object
files as a follow-up fix of "base: remove SPEC variables of boards",
which happened to left 'BOARD' undefined in the src archives.

Fixes #4019
2021-02-23 12:02:45 +01:00
Josef Söntgen
1b77cb3832 qemu-usb: add ring-buffer for ISOCH OUT transfers
Be more in line with the original host implementation in Qemu and
buffer transfers. Having transfers in-flight helps to smoothen playback
in case other components utilize the CPU.

Issue #4018.
2021-02-23 12:02:44 +01:00
Josef Söntgen
19d9409a34 qemu-usb: adapt ISOCH IN handling for audio
Linux as well as Windows guests want queue to a varying number of
transfers, where each transfer only covers one transaction (iso frame).
The best results were obtained by following that behaviour rather
than queuing multiple iso frames per requests (like is done with OUT
transfers).

The number of requests queued is increased to 32 while the number of
packets per reques is decreased to 1.

Issue #4018.
2021-02-23 12:02:44 +01:00
Josef Söntgen
9918a8f88d qemu-usb: update port to 5.2.0
The contrib code is updated from 2.4.1 to version 5.2.0 and the used
device-model is changed to QEMU xHCI. Due to this change older guests
OSes, namely Windows 7, that relied on the NEC xHCI device-model will
not work anymore.

The 'Qemu::Controller' interface was extended by an 'info' method, which
returns the vendor and product ID. This allows for removing the
hard-coded values in the VirtualBox glue code.

Issue #4018.
2021-02-23 12:02:44 +01:00
Josef Söntgen
a6f0b05834 usb_host: properly handle ISOC read requests
* Update the 'packet_size' information with the actual length for
  each isoc frame to be able to handle short reads at the client side.

* Copy the whole transfer buffer because the host controller stores
  the data at the original offsets, i.e., the buffer is not densely
  packed.

Fixes #4018.
2021-02-23 12:02:44 +01:00
Josef Söntgen
b51ae104c2 qemu-usb: use bounce buffer to access DMA memory
The former implemention assumed that the guest physical memory is
mapped continously. This, however, is not true. Writing larger
files to an USB stick with a Windows 10 guest would therefore lead
to data corruption.

The current implementation uses a bounce buffer to copy the data
to and from the guest physical memory and leaves dealing with the
memory mappings entirely up to the VMM.

Fixes #4017.
2021-02-23 12:02:44 +01:00
Martin Stein
23620942bf usb_net: allow calling netif_stop_queue dummy
When the usb_net_drv was introduced in ports/run/netperf.inc, the
netperf_lxip_usb test on x86_64/hw/pc triggered the calling of the
netif_stop_queue dummy at
contrib/<DDE_LINUX>/src/drivers/usb_net/drivers/net/usb/usbnet.c:1464. As
netif_start_queue was also a dummy and allowed to be called, we tried allowing
calls to the netif_stop_queue dummy as well which fixed the
netperf_lxip_usb test on x86_64/hw/pc.

Ref #3961
2021-02-23 12:02:44 +01:00
Norman Feske
a99f6a81b6 libc: clone 'environ' pointer value after fork
The 'environ' pointer is a global variable that must be considered as
part of the application state. It must be copied from the parent to the
child process during fork. Otherwise, a child returning from fork is
unable to access environment variables before invoking execve. The
actual environment variables and their values are already captured
because they reside at the application heap, which is cloned from the
parent. So the copied 'environ' pointer refers to valid data.

Fixes #4015
2021-02-23 12:02:44 +01:00
Sebastian Sumpf
fd0e6685fc riscv: Use Qemu and update to ISA v1.10
- remove Spike/BBL support in favour of Qemu (>=4.2.1)
- add 'riscv_qemu' board, remove 'spike' board'
- update to privileged ISA v1.10 (from v1.9.1)
- use direct system calls for privileged core threads (they call into
  the kernel and don't use mode changing system calls, i.e. 'ecall',
  semantics)
- use 'OpenSBI' semtantics for SBI calls (to machine mode) instead of
  BBL

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

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

Issue #4014
2021-02-23 12:02:44 +01:00
Martin Stein
19d0142e10 ports/recipes/src: usb_net_drv
Ref #3961
2021-02-23 12:02:44 +01:00
Martin Stein
983a18d06e ports: rename *_usb30.run *_usb.run
Ref #3961
2021-02-23 12:02:43 +01:00
Christian Prochaska
f654e6f02d usb_host_drv: dwc_otg stability improvements
- improve NYET error handling
- use split interrupt transaction hack
- clear TT buffers in error situations

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

issue #4012
2021-02-23 12:02:43 +01:00
Alexander Boettcher
c58acd0b2b allocator_avl: avoid memory leakage
Fixes #4013
2021-02-23 12:02:43 +01:00
Alexander Boettcher
26506673c4 seoul-auto: limit to one CPU on Qemu
Issue #3965
2021-02-23 12:02:43 +01:00
Norman Feske
df38140ed6 base-pistachio: coding style 2021-02-23 12:02:43 +01:00
Norman Feske
9633a0a524 wm.run: increase RAM quota for wm_backdrop
Overcomes a startup issue of the wm_backdrop component on base-linux:

[init] child "wm_backdrop" requests resources: ram_quota=10855936
2021-02-23 12:02:43 +01:00
Norman Feske
7d568247e3 wm: fix deadlock in destroy-view handling
The deadlock reported in #3236 could be reproduced via the wm.run script
and the modification of test/nitpicker in commit "nitpicker: fix destroy
with invalid handle" by clicking on the testnit entry of the launchpad.

This patch fixes the deadlock by releasing the locked pointer early in
the destruction path, which is legitimate as the wm is single-threaded.

Fixes #3236
2021-02-23 12:02:43 +01:00
Norman Feske
b5fb37ddee nitpicker: invalidate dangling hovered ptr
This patch adds the missing invalidation of the _hovered pointer to
User_state::forget, which is required to cover the situation where the
owner of the hovered view vanishes.

Fixes #4011
2021-02-23 12:02:43 +01:00
Alexander Boettcher
d29b843a0f dde_ipxe: improve throughput for Realtek devices
By increasing the ring descriptor count the throughput increased from
few kB/s to the range of MB/s.

Issue #3939
2021-02-23 12:02:43 +01:00
Alexander Boettcher
8958c769ab dde_ipxe: poll once again on irq without rx packets
This quirk is required for Realtek devices.

Fixes #3939
2021-02-23 12:02:43 +01:00
Christian Helmuth
210f5073e3 platform_drv.inc: check board=pc not spec=x86
Fixes run scripts for Linux/x86.
2021-02-23 12:02:43 +01:00
Martin Stein
ef88d05f2b os: api/net archive
Ref #3961
2021-02-23 12:02:43 +01:00
Alexander Boettcher
d6a5a66623 vbox5: enable 64bit SVM support
Fixes #3965
2021-02-23 12:02:42 +01:00
Alexander Boettcher
d186e4361e Measure TSC variance of CPUs in test-smp
Issue #3965
2021-02-23 12:02:42 +01:00
Emery Hemingway
2acfacb639 genode_dyn.ld: do not emit PHDR segment
Recent versions of binutils check that PHDR segments are covered
by a LOAD segment. In this case the unloaded PHDR segment can be
ommited.

Fix #4003
2021-02-23 12:02:42 +01:00
Alexander Boettcher
696d8f030f libgmp: avoid undefined gmpn_*_2 symbols (x86_64)
__gmpn_addmul_2
__gmpn_mul_2

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

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

turns into:

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

Fixes #4002
2021-02-23 12:02:42 +01:00
Christian Prochaska
5c5d16f524 ports: add 'vbox5_genode_usb_hid_raw' run script
Fixes #4009
2021-02-23 12:02:42 +01:00
Christian Prochaska
c16611dff2 usb_hid_raw.run: add "Timer" service route
Fixes #4008
2021-02-23 12:02:42 +01:00
Christian Prochaska
33406940f3 usb_hid_drv: stability improvements
Fixes #4007
2021-02-23 12:02:42 +01:00
Christian Prochaska
e1698cf200 dde_linux: fix possible memory leak in wait queue implementation
Fixes #4006
2021-02-23 12:02:42 +01:00
Christian Prochaska
2670ae399b usb_host_drv: improve error handling
Fixes #4005
2021-02-23 12:02:42 +01:00
Christian Helmuth
91a7fb1da7 cxx: localize operator new(unsigned long) in supc++.o
Otherwise, base code in ld.lib.so may accidentally use 'new' without
passing an allocator.
2021-02-23 12:02:41 +01:00
Martin Stein
a9c4ebc9e9 drivers/nic/mode: exception on malformed values
Ref #3961
2021-02-23 12:02:41 +01:00
Norman Feske
e3783b00bb coding_style.txt: initializers, control flow 2021-02-23 12:02:41 +01:00
Norman Feske
493924a35e base-hw: coding style
Improve consistency with the other base repositories, in particular

- Indentation of class initializers
- Vertical whitespace around control-flow statements
- Preferably place control-flow statements (return, break, continue) at
  beginning of a line
- Placing the opening brace of a namespace at the end of line
- Placing the opening brace of a class at a new line
- Removing superfluous braces around single statements
- Two empty lines between methods/functions in implementation files
2021-02-23 12:02:41 +01:00
Norman Feske
cbae9bc1c8 Add ccache support to build system
This patch simplifies the use of ccache with the build system. Up until
now, each developer had to set up the ccache hooks manually, adjust the
PATH variable, and customize the etc/tools.conf in each build directory.
With the patch, ccache can be enabled by un-commenting a single line in
the etc/build.conf file.

Fixes #4004
2021-02-23 12:02:41 +01:00
Norman Feske
8cc2662aac Remove support for the Muen separation kernel
Fixes #3995
Fixes #3994
2021-02-23 11:55:44 +01:00
Christian Helmuth
af9ab9190b sd_card_bench.run: add missing braces
This is a follow-up fix for "base: remove SPEC variables of boards (fix #3971)".
2021-02-23 11:53:59 +01:00
Christian Helmuth
14db22c77c nic_router.run: disable test 2 UDP
Issue #3992 is still pending but has low priority, so disable the test
to reduce the noise and increase the chance to spot independent
regressions.
2021-02-23 11:53:42 +01:00
Martin Stein
691be92046 Don't use the NIC server mode of NIC drivers
Issue #3961
2021-02-23 11:53:41 +01:00
Christian Helmuth
9f3c5d92b3 base: cleanup Noncopyable declarations/coding style 2021-02-23 11:51:57 +01:00
Josef Söntgen
36b55e065a usb_host: check ep pointer before using it
The Usb session allows for submitting packets even when the interface
in question is not yet enabled. Enabling an interface will configure
the udev members properly and is normally done implicitly during
processing of an 'ALT_SETTING' packet.

In case the interface was not enabled this leads to a page-fault in
the USB host-controller driver as 'ep' is NULL.

Fixes #3999.
2021-02-23 11:51:57 +01:00
Alexander Boettcher
6789ce8b83 platform_drv(x86): support dynamic reconfiguration
Fixes #3989
2021-02-23 11:51:39 +01:00
Norman Feske
a981fb864c depot: update recipe hashes 2021-01-25 14:00:43 +01:00
Norman Feske
c4cf9b6e6d base-hw: introduce board-property directories
This patch moves the bootstrap-link-address information from the
tool/run/boot_dir/hw file to board-specific property files that can be
accessed by using the board as key. This eliminates the need to
customize boot_dir/hw when hosting board-support in an external
repository.

Fixes #3998
2021-01-25 14:00:43 +01:00
Norman Feske
4bc9b9a2ef tool/run: coding style 2021-01-25 14:00:43 +01:00
Piotr Tworek
ad4211ae2c os: Make Redistributor class inherit Genode::Interface.
The Vmm::Gic::Gicd_banked::Redistributor is used with Constructible, but
does not have a virtual destructor even though it has virtual methods.
This prompts clang to issue the following warning:

  reconstructible.h:122:4: warning: destructor called on non-final
  'Vmm::Gic::Gicd_banked::Redistributor' that has virtual functions
  but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]

Fix this by inheriting Genode::Interface.

Issue #3984
2021-01-25 14:00:43 +01:00
Norman Feske
ff28ed0f8c base: avoid superfluous postprocessing of ldso
Even though the binary patching of ldso must be performed only once,
this postprocessing step was executed on each run because the
postprocess.tag rule is phony (the tag file is never created).
This patch removes this phony behavior by creating the tag file.

Issue #3974
2021-01-25 14:00:43 +01:00
Tomasz Gajewski
693a4d78dd lib.mk: avoid checking abi on every build
Fixes #3974
2021-01-25 14:00:43 +01:00
Piotr Tworek
8f6b934caa base-hw: Fully define _crt0_start_stack value on arm_64
The _crt0_start_stack label points to a memory location containing the
size of the bootstrap stack. On AArch64 this should be an 8 byte value,
but the code only only defines half of those using asm .long statement.
The other half is expected to be 0, which is true when using GNU as.
This is not the case when using clang's integrated as however. Since
_crt0_stack_size is defined inside .text section clang uses 0xd503201f
value (aarch64 nop instruction) to fill the extra 4 bytes.

Fix this minor incompatibility by explicitly defining both halfs of
this 8 byte quantity.

Fixes #3987
2021-01-25 14:00:43 +01:00
Piotr Tworek
384cf14bee libc: Remove unused variables from Libc::Kernel.
The _dispatch_pending_io_signals and _original_suspended_callback member
variables are not used anywhere in the code. This prompts clang to produce
a warning message about it. Remove both variables to fix it.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
90b20b4daf nitpicker: Fix unsigned long to unsigned int cast.
The "unsigned Nitpicker::Gui_session::layer()" function returns
~0UL. This prompts clang to produce a warning about implicit unsigned
long to unsigned int conversion. Fix it by returning ~0U instead of
~0UL.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
80318b9ae0 libc: Add semicolons after [[fallthrough]]
GCC doesn't care, but clang complains if [[fallthrough]] is not followed
by a semicolon. Existing Genode code is also not consitent in this regard.
This patch adds the extra semicolons since it works in both GCC and
clang.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
fce5c249c2 gems: Drop unused variables from Window_list class
No code in this class uses this private member variable. This prompts
clang to produce a warning message about it. Fix it by dropping the
variable.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
71abfb3b4f libc: Mark Libc::Vfs_plugin class as final.
The class has final destructor, but is not itself final. This prompts
clang to produce the following warning message:

class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
                ~Vfs_plugin() final { }
                              ^
vfs_plugin.h:39:13: note: mark 'Libc::Vfs_plugin' as 'final' to silence this warning

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
395a9b5bf5 libc: Remove unused print function from select.cc.
This static inline function is not used anywhere. GCC does not care,
but clang warns about this. Remove the function to allow the code to
compile cleanly with both clang and GCC.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
53081ac6b3 libc: Dont't use local_addr in try/catch block.
The code in Libc::Cloned_malloc_heap_range initializes its local_addr
member variable by calling Region_map::attach_at. This function can
throw Region_conflict exception. The handler for this exception uses the
local_addr to produce an error message. Such error log is IHMO
useless, or even incorrect since the value of local_addr is undefined
in such case.

Its also worth noting that clang 12 produces the following warning for
this code:
  "cannot refer to a non-static member from the handler of a constructor
   function try block"

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
c6d5b98227 decorator: Remove unused _topped_cnt variable.
This private member variable is not used anywhere in the code. This
produces compilation warning when using clang instead of GCC. Drop the
unused variable.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
c402cc1045 window_layouter: Drop unused code.
The State enum and _state private member variable are not used anywhere.
This produces an extra warning when building the code with clang instead
of GCC. Remove this dead code.

Issue #3985
2021-01-25 14:00:42 +01:00
Piotr Tworek
1edac9730c scout: Instantiate templates in their namespace.
When building the code with clang the following warning message is
prodiced:

  "explicit instantiation of 'Scout::Browser_window' must occur in namespace 'Scout'
   template class Browser_window<Genode::Pixel_rgb888>"

 This happens for several different types. This patch fixes the problem
 by instantiating all those templates using their explicit full name.

Issue #3985
2021-01-25 14:00:14 +01:00
Piotr Tworek
d475015ada launchpad: Fix _spacer member initialization.
The Scout::Spacer constructor requires two arguments. The initialization
of the type in Launchpad_window declaration does not specify them. The
variable is however initialized a second time in class constructor. This is
most likely why GCC accepts this code. Clang on the other hand
complains about it.

Fix this by properly initializing both _spacer and _docview only once at
declaration time.

Issue #3985
2021-01-25 13:58:11 +01:00
Piotr Tworek
ffb931f8b1 nano3d: Fix header guard in sqrt.h
The code fails to build with clang due to the following warning/error:

  error: '_INCLUDE__NANO3D__SQRT_H_' is used as a header guard here,
  followed by #define of a different macro [-Werror,-Wheader-guard]

Fix this by removing the extra underscore from this header guard
definition.

Issue #3985
2021-01-25 13:58:11 +01:00
Piotr Tworek
b4d294f62e os: Drop unused Net::Arp_cache::_init member.
Not used anywhere in the code. Clang 11 complains about this.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
052f678225 os: Add missing override keyword.
The _device_specific_features() implements part of the Virtio_device
interface. Decorate it with override keyword to make this clear and
also satisfy clang which produces warning regarding this.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
3fdf323e6e os: Drop unused Net::Dhcp_client::_alloc member.
Not used for anything so technically a dead code. Clang 11 complains
about this.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
05c36d67ce os: Fix clang constant warning in Port_allocator.
Clang 11 produces the following warning when building port_allocator.cc:

port_allocator.cc:27:21: error: result of comparison of constant 65536 with
expression of type 'const Genode::uint16_t' (aka 'const unsigned short') is
always true [-Werror,-Wtautological-constant-out-of-range-compare]
               (port.value <  (unsigned)(Port_allocator::FIRST +

Basically the code compares Port::value (uint16_t) against a constant
65536 which is larger than UINT16_MAX (65535). This comparison will always
be true.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
ffc2a2f306 os: Disambiguate File_system in ram_file_system.h.
According to clang there are two symbols which File_system can refer to:
1. namespace File_system from ram_fs/chunk.h.
2. Vfs::File_system class from  vfs/file_system.h.
Make it clear we refer to the File_system namespace in this case.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
fc089a1673 nic_dump: Remove unused Net::Interface::_alloc
This private member variable is not used anywhere in the code. This
breaks builds using clang instead of GCC. Drop the variable.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
428de89f9a nic_dump: Disambiguate "Interface" in component.cc.
Clang 12 complains that Interface can both refer to Genode::Interface
and Net::Interface in this case. Explicitly state the code refers to
the latter.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
30429a5228 nic_flood: Drop Dhcp_client::_alloc member.
This private member variable is not used anywhere in the code. This
breaks builds using clang instead of GCC. Drop it.

Issue #3984
2021-01-25 13:58:11 +01:00
Piotr Tworek
e6a9e06f62 base-linux: Drop parentheses from .cfi_undefined.
According to GNU as manual the syntax of this directive is:
  .cfi_undefined register

The manual does not mention the register should be in parentheses.
This works in GNU as even when those are present, but unfortunately
clang integrated-as does not parse this correctly. Both GNU and
clang's integrated assembler work fine when the extra parentheses
are omitted.

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

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

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

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

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

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

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

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

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

Where as one can guess Object_identity_reference_list is defined as:

using Object_identity_reference_list
	= Genode::List<Object_identity_reference>;

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

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

Fixes #3990
2021-01-25 13:58:10 +01:00
Alexander Boettcher
9d239957bc libc: update seek state on opening O_APPEND fds
If a fd is opened in append mode and just is to be used (so never written by
the parent component) for the to be forked child, the seek state was not
pointing to the end of the file.  The wrong seek value then was used in
File_descriptor_allocator::generate_info().

Issue #3991
2021-01-25 13:58:10 +01:00
Alexander Boettcher
5fa91c573b libc: update O_APPEND fds on joined child
The fds in O_APPEND state may have changed by the child. The local seek
state needs to be valid/current for the next to be forked child, which seek
state is set by File_descriptor_allocator::generate_info().

Issue #3991
2021-01-25 13:58:10 +01:00
Norman Feske
9bfd812a88 tool/run: search repos for run-tool plugins
This patch allows for supplementing the existing run-tool plugins with
additional plugins hosted inside a repository. E.g., it enables the run
tool to find world/tool/run/boot_dir/hw automatically.

Fixes #3993
2021-01-25 13:58:10 +01:00
Norman Feske
1ccf8a280c base-hw: simplify board support in external repo
Avoid use of REP_DIR in *.mk files to simplify the use of these files as
templates for a board hosted in a separate repository.

Use REP_INC_DIR for searching headers, thereby considering headers
hosted in an external repository.

Issue #3168
2021-01-25 13:58:10 +01:00
Stefan Kalkowski
f034f560be create_builddir: remove deprecated platforms
Fix #3996
2021-01-25 13:58:10 +01:00
Martin Stein
f45aa85e9f nic_router.run: fix redundant IPv4 subnets 2021-01-25 13:58:10 +01:00
Norman Feske
84443d6548 os: div_zero trace policy
This trace policy can be used as a fault-injection mechanism.
Once installed, the next time the traced thread passes a trace point
(e.g., RPC call, RPC request, ...), the policy produces a divide-by-zero
exception.
2021-01-25 13:58:10 +01:00
Norman Feske
a6a923c31b driver manager: restart intel_fb when frozen
This patch introduces heartbeat monitoring and automated restarting
of the intel framebuffer driver.
2021-01-25 13:58:10 +01:00
Norman Feske
f687d4824b sculpt: set lower bound for font size 2021-01-25 13:58:10 +01:00
Norman Feske
0a478dac7f pdf_view: tweaks for showing 16:10 slides
- Shave off two pixels on right, which are rendered white for no reason.
- Adjust resolution to make the slides fit vertically by default.
2021-01-25 13:58:10 +01:00
Norman Feske
5905e0a4a0 Road map for 2021 2021-01-25 13:58:09 +01:00
Martin Stein
d0ac8a6036 cbe_tester.run: use /tmp for image on autopilot 2021-01-25 13:58:09 +01:00
Stefan Kalkowski
bdd923406f base: remove SPEC variables of boards (fix #3971)
* Remove SPEC declarations from mk/spec
* Remove all board-specific REQUIRE declaratiions left
* Replace [have_spec <board>] run-script declarations with have_board where necessary
* Remove addition of BOARD variable to SPECS in toplevel Makefile
* Move board-specific directories in base-hw out of specs
2021-01-25 13:58:09 +01:00
Stefan Kalkowski
5a123e37c9 run: introduce have_board helper function
The new helper function returns a boolean value analoque to 'have_spec' if the
BOARD variable corresponds to the given value. It shall replace [have_spec <board>]
declarations in run-scripts.

Ref #3971
2021-01-25 13:58:09 +01:00
Christian Helmuth
6cfaac182a Remove Cpu_session::Native_cpu definition from API
This type can be a forward declaration in the public API because its
definition is required only in kernel-specific code.

Related to #3979
2021-01-25 13:58:09 +01:00
Christian Helmuth
3e73d8d7b6 drivers_nic-muen: permit Timer access in platform_drv 2021-01-25 13:58:09 +01:00
Pirmin Duss
a4d5687510 base-hw: allow out of tree imx8 platforms
Issue #3911
2021-01-25 13:58:09 +01:00
Alexander Boettcher
2b0170fb6a base-hw: ack thread capability on construction
Fixes #3982
2021-01-25 13:58:09 +01:00
Martin Stein
2d21d04c76 cbe_tester.run: raise timeout to 6 minutes 2021-01-25 13:58:09 +01:00
Martin Stein
f6d195a9de nic drivers: provide optional Uplink-client mode
In order to perform a smooth transition from NIC drivers that act only as NIC
session clients to NIC drivers that act only as Uplink session clients, this
commit introduces an intermediate state in which all NIC drivers support both
modes. That said, a NIC drivers mode is now statically determined through a new
optional 'mode' attribute in the drivers <config> tag that can be set to either
'nic_server' (default value) or 'uplink_client'. Reconfiguring this attribute
at a driver doesn't have any effects. Whithout this attribute being set, all
NIC drivers will behave the same as they did before the commit. When set to
'uplink_client', however, instead of providing a Nic service, they request
an Uplink session whenever their network interface becomes "UP" and close the
session whenever their network interface becomes "DOWN".

Ref #3961
2021-01-25 13:58:09 +01:00
Martin Stein
1d2649b49a nic_router: act as "Uplink" server
Let the NIC router provide an Uplink service besides the Nic service that it
already provided. Requests for an Uplink session towards the NIC router are
assigned to Domains using the same <policy> configuration tags that are used in
order to assign Nic session requests. The MAC addresses of Uplink session
components are _NOT_ considered during the allocation of MAC addresses for NIC
session components at the same Domain. The task of avoiding MAC address clashes
between Uplink session components and Nic session components is therefore left
to the integrator. Apart from that, Uplink session components are treated by
the NIC router like any other interface.

Ref #3961
2021-01-25 13:57:43 +01:00
Martin Stein
cf72d1aac3 os: introduce new "Uplink" session
Adds new Uplink session interface, the corresponding client side (Client,
Connection), and the corresponding API archives. An Uplink session is almost
the same as a NIC session with the difference that the roles of the end points
are swapped. An Uplink client is the one that provides a network interface
(for instance, a NIC driver) whereas an Uplink server is the one that uses
that network interface (for instance, a networking stack).

Therefore, in contrast to the NIC session, MAC address and link state come from
the Uplink client. The link state is reflected through the lifetime of an
Uplink session: The client requests the session only when the link state is
"UP" and closes it whenever the link state becomes "DOWN" again. The MAC
address is transmitted from the Uplink client to the Uplink server as an
argument of the session request.

Ref #3961
2021-01-25 13:48:09 +01:00
Martin Stein
9222463565 run/ping: support running manually on Linux
* Adds documentation how to prepare and finalize a Linux for running the
  scenario ontop of it
* Adds consideration of env variable 'ON_LINUX_WITH_DST_IP' that, if set,
  adapts the run script to running on Linux with the given ping destination IP

Ref #3961
2021-01-25 13:48:09 +01:00
Norman Feske
8ff75346dd sticks_blue_backdrop: inherit roms from backdrop
This patch moves the <content> <rom/> ... </content> declarations that
refer to pkg/backdrop to the runtime file of pkg/backdrop.

Issue #3981
2021-01-25 13:48:09 +01:00
Norman Feske
cae5d380c4 depot_query: inherit pkg rom content from deps
This patch relaxes the need to specify the rom content of all pkg dependencies
in each runtime file. Whenever a dependency features a runtime file, the
contained <content> <rom/> ... </content> nodes are implicitely included.

Fixes #3981
2021-01-25 13:48:09 +01:00
Alexander Boettcher
14d8627186 platform_drv: avoid using Register in Bdf type
Issue #3963
2021-01-25 13:48:09 +01:00
Alexander Boettcher
f358fcbda6 nova: flush Intel IOMMU caches
- when memory is detached

Issue #3963
2021-01-25 13:48:09 +01:00
Alexander Boettcher
b185f3fac1 platform_drv: add support to power PCI devices
- depending on available PCI power cap power off and on
- save and restore PCI bars if required
- reset PCI devices after power on if supported

Fixes #3963
2021-01-25 13:48:09 +01:00
Alexander Boettcher
5f7fe7498f platform_drv: add mmio delayer support
required after power on and function level reset

Issue #3963
2021-01-25 13:48:08 +01:00
Alexander Boettcher
c89864c830 platform_drv: add typesafe PCI config access
using Register_set && Register. It is derived from Genode::Mmio, however uses
as backend the Config_access implementation which is still used widely in
the platform driver.

Issue #3963
2021-01-25 12:51:54 +01:00
Alexander Boettcher
59fafac4d6 platform_drv: increase readability
by adding convenience functions to make code easier readable

Issue #3963
2021-01-25 12:51:54 +01:00
Alexander Boettcher
ebf7f8f599 platform_drv: introduce structured PCI BDF type
Replace explicit usage of bus, device, function arguments to methods or
variables all over the code by a single data type. It eases the reading of and
shorten the code.

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

Fixes #3979
2021-01-25 12:51:54 +01:00
Christian Helmuth
5ca3847c89 cbe_tester requires x86_64 currently 2021-01-25 12:51:53 +01:00
Norman Feske
eee8f64fd4 sculpt: fix dialog sizes with manual fonts config
Fixes #3976
2021-01-25 12:51:53 +01:00
Alexander Boettcher
0a5741f076 acpica.run: add acpi_hid evaluation support
Evaluate acpi_hid report in acpi_event

Showcase feature in acpica.run for FUJITSU FUJ02E3 and KEY_FN_F4.
2021-01-25 12:51:53 +01:00
Alexander Boettcher
1147f35972 acpica: add limited support for FUJ02E3 ACPI dev
The keys, mute, touchpad toggle (Fn-F4) and rfkill may be reported by some
Fujitsu machines via the ACPI FUJ02E3 ACPI device. With this commit limited
support to detect the 3 keys are added and will be reported as Genode report.
2021-01-25 12:50:55 +01:00
Norman Feske
d698e0876d window_layouter/decorator: drag-state corner cases
This patch complements the commit "nitpicker: defer hover changed while
dragging" with fixes of the window layouter and motif decorator.

- Handling of empty pointer model (after unhovering a decoration)
  instead of not updating it.

- Re-applying the hover model to the window layout when leaving the
  drag state. This addresses the corner case that the hover model
  changed during the drag operation (which is rightfully not handled
  while dragging).

- Letting the window layouter enter the drag state only if a dragged
  window is defined.

Issue #3973
2021-01-25 12:50:55 +01:00
Tomasz Gajewski
98798f18b5 Fix minor inconsistencies in mk files
Fixes #3972
2021-01-25 12:50:54 +01:00
Christian Helmuth
8bed4c1d54 base: support hexa-decimal values in ascii_to(long)
This aligns the behavior of ascii_to(long&) with the behavior of
unsigned integer types, e.g., when parsing XML nodes into signed long
variables.
2021-01-25 12:50:54 +01:00
Norman Feske
72801975cd nitpicker: defer hover changed while dragging
When holding at least one key or button, the hovering should never
change. In the previous version, this invariant was not enforced,
but the symptoms for eventual inconsistencies were masked by two
checkes: one when generating the hover report, and one when submitting
the leave event. This patch enforces the invariant by suppressing any
change of 'User_state::_hovered' while in dragged state.

Fixes #3973
2021-01-25 12:50:54 +01:00
Norman Feske
7266f29491 decorator: disable sync handling when idle
When idle, the decorator still consumes a bit of CPU time when triggered
by the GUI session's sync signal. This patch installs the sync handler
each time the decorator goes idle.
2021-01-25 12:50:38 +01:00
Norman Feske
2c82636a98 terminal: respond to font-size changes
Issue #3970
2020-12-23 13:38:39 +01:00
Norman Feske
d47f87a768 terminal: use GUI session directly
Issue #3196
Fixes #3970
2020-12-23 13:38:31 +01:00
Norman Feske
887fcecf63 base-linux: disable initramfs build on 32-bit
The build tries to access the host header asm/unistd.h, which is
apparently not present on 64-bit hosts (in particular our CI).
2020-12-18 09:11:25 +01:00
Christian Prochaska
0428e5e8b9 qt5: improve quickcontrols2 module support
Fixes #3968
2020-12-18 09:11:25 +01:00
Alexander Boettcher
0359ee6a76 sandbox: fix position scaling in affinity filter
During position scaling use the location width/height which is the permitted
dimension within the child space, instead of using the whole possible
child space. (Fixup for "init: scale affinity location" Issue #1412)

Thanks to the report by Peter.
2020-12-18 09:11:25 +01:00
Christian Helmuth
1bef11accf depot: update recipe hashes 2020-12-18 09:10:52 +01:00
Alexander Boettcher
c5de2acf57 vm_session(x86): support cstar register
Fixes #3964
2020-12-09 14:02:12 +01:00
Norman Feske
9189342b77 base-okl4: coding style 2020-12-09 14:02:11 +01:00
Norman Feske
abd688097a base-fiasco: coding style 2020-12-09 14:02:11 +01:00
Norman Feske
6930372d55 base-foc: remove stale README content 2020-12-09 14:02:11 +01:00
Martin Stein
a124f5b88d nic_router: support and show-case disabling arp at a domain
* Introduce 'use_arp' configuration flag at the NIC router in order to disable
  requesting IP-to-MAC address resolutions via ARP for domains.
* Add automated run/nic_router_disable_arp test to the autopilot that tests
  the effect of the new flag
* Document the new flag and the new test in the NIC router README

Fixes #3935
2020-12-09 14:02:11 +01:00
Sebastian Sumpf
0beda6bca4 dde_linux: USB MBIM modem driver support
Thise driver supports USB LTE modems for Huawais' ME906s through MBIM
and provides a traditional Nic session. The "control" interface is a
Terminal session, which can be used via libmbim/mbimcli.

issue #3822
2020-12-09 14:02:11 +01:00
Norman Feske
a0fb944721 Propagate session diag flag to core
This commit restores the diag feature for selecting diagnostic output of
services provided by core. This feature became unavailable with commit
"base: remove dependency from deprecated APIs", which hard-wired the
diag flag for core services to false.

To control this feature, three possible policies can be expressed in a
routing target of init's configuration:

* Forcing silence by specifying 'diag="no"'
* Enabling diagnostics by specifying 'diag="yes"'
* Forwarding the preference of the client by omitting the 'diag'
  attribute

Fixes #3962
2020-12-09 14:02:11 +01:00
Sebastian Sumpf
36eeab6df2 dde_linux: usb support extra data and zero config
- Vendor devices add addtional data to the config descriptor, read and
  added to the usb session
- allow '0' configuration within the usb session

issue #3822
2020-12-09 14:02:11 +01:00
Sebastian Sumpf
537472e9af libports: ffi for ARM_64
Required by 'glib'

issue #3822
2020-12-09 14:02:10 +01:00
Christian Helmuth
496dc5508f usb_hid: support for Apple HID devices
Issue #3953
2020-12-09 14:02:10 +01:00
Christian Helmuth
2a659cb750 usb_hid: support for Holtek-based mice fixups
This enables USB mice based on the Holtek chipsets, which need USB
descriptor fixups. An example mouse is the Sharkoon Drakonia.

Issue #3953
2020-12-09 14:02:10 +01:00
Alexander Boettcher
b097e598f1 usb_hid: use heap instead of dma/mem allocator
The usb_hid driver does not need to distinguish between
normal memory and DMA capable memory, since all requests are routed via the
USB raw session to the usb host driver. The default Malloc implementation
implements this distinction, however exposes restrictions on the size of
allocations. As seen now by several USB HID devices, the size of device
driver allocations depend on read out hardware features and can be
larger than we support with our specialized default Malloc implementation.

Since we don't need this functionality, switching to an well
tested allocator (Heap) which can cope with varying sizes of allocation,
we can mitigate the size restriction.

Fixes #3953
2020-12-09 14:02:10 +01:00
Alexander Boettcher
2c639169fd dde_linux: use linux memory primitives in impl/usb
Issue #3953
2020-12-09 14:02:10 +01:00
Martin Stein
bad8caee3f nic_router: support multiple DHCP option 6 entries
* The NIC router now considers, memorizes, and, if configured, reports
  multiple DHCP option 6 entries from DHCP replies that it received as DHCP
  client
* A DHCP server at the NIC router can now be configured statically with
  multiple DNS server addresses to propagate
* The 'dns_server_from' attribute of the DHCP server of the NIC router now
  supports the forwarding of multiple DNS server addresses
* The automated run/nic_router_dhcp test tests all the above mentioned new
  functionality and reconfiguring it at runtime. The test was added to the
  autopilot.
* All run scripts were adapted to fit the new NIC router configuration
  interface

Fixes #3952
2020-12-09 14:02:10 +01:00
Emery Hemingway
306466fc60 libc: always set argv and envp to valid arrays
The arrays passed to main(…) must always be valid null-terminated arrays.

Fix #3955
2020-12-09 14:02:10 +01:00
Martin Stein
063e4bd072 remove remnants of 'virtualbox_nic_router' test
Ref #3952
2020-12-09 14:02:10 +01:00
Martin Stein
e14b58a82c net/dhcp.h: more specific include guards
Ref #3952
2020-12-09 14:02:10 +01:00
Martin Stein
8d8edaea5d nic_router: fix link state on dhcp server reconfig
When reconfiguring the NIC router modifies the information that DHCP clients
received through a DHCP server of the NIC router, the link state of the
correspodning interface has to do a "down-up" sequence. This provides a signal
to the DHCP clients to redo DHCP, receive the new information and update
accordingly.

Fixes #3931
2020-12-09 14:02:10 +01:00
Martin Stein
b0327d0544 nic_router: preserve session link state until read
See the NIC router README paragraph "Behavior regarding the NIC-session link
state" for further information.

Ref #3931
2020-12-09 14:01:42 +01:00
Martin Stein
a7b878cbb5 nic_router: allow for config values of 0 seconds
Ref #3931
2020-12-09 14:01:42 +01:00
Martin Stein
7ac6f93838 nic_router: clean up init of configuration members
Ref #3931
2020-12-09 14:01:42 +01:00
Norman Feske
70ff3d9c90 base-foc: coding style
- Cosmetic adjustments according to
  https://genode.org/documentation/developer-resources/coding_style

- Replace manual inclusion of kernel headers by one new compound
  header foc/syscall.h

- Rename namespace Fiasco to Foc
2020-12-09 14:01:42 +01:00
Norman Feske
0209a2465d base-foc: update cap_integrity.run 2020-11-28 19:37:15 +01:00
Alexander Boettcher
b6408cec1c ssh_terminal: close terminal fd in pthread context
Issue #3682
2020-11-27 14:40:41 +01:00
Christian Helmuth
3fac8b106d version: 20.11 2020-11-27 14:01:47 +01:00
Norman Feske
5c27270b17 News item for version 20.11 2020-11-27 13:57:55 +01:00
Norman Feske
3f15d18392 Release notes for version 20.11 2020-11-27 13:57:54 +01:00
Christian Helmuth
f2e0c164c2 depot: update recipe hashes 2020-11-27 09:21:06 +01:00
Norman Feske
d672e95090 doc: update components.txt 2020-11-27 09:19:09 +01:00
Norman Feske
98211db63d doc: move release notes to sub directory
This keeps the doc/ directory tidy and neat.
2020-11-27 09:19:09 +01:00
Sebastian Sumpf
722254f864 dde_rump: Set '-fcommon' for rump host tools
GCC 10 has `-fno-common` as default which leads to multiple definitions of
of symbols.

Fixes #3960
2020-11-27 09:19:09 +01:00
Stefan Kalkowski
b907629341 sculpt: add basic support for i.MX8 Quad EVK
* Introduce CPU quota for driver subsytem (needed by sd_card_drv)
* Introduce CPU quota for runtime subsytem and nic_drv (needed by fec_nic_drv)
* Increase CAP quota for inspect terminal slightly
* Add sculpt packages for imx8q_evk

Fix #3958
2020-11-27 09:19:09 +01:00
Stefan Kalkowski
22852f2e50 sculpt: move pc-specifics away from generic part
* Introduce sculpt-[board] specific package
* Move rtc driver into managed drivers sub-system
* Name nic_drv in a generic fashion in sculpt_manager
* Copy over pc-specific config files only when building for PC

Ref #3958
2020-11-27 09:19:09 +01:00
Christian Prochaska
e22e2540ee qt5: add Qt5Xml library
Fixes #3959
2020-11-27 09:19:09 +01:00
Alexander Boettcher
78ab3c8db5 usb: avoid memset on failed memory allocation
Issue #3953
2020-11-27 09:19:09 +01:00
Alexander Boettcher
ffdd49f9ce platform_drv: free ever non PCI devices on close
Fixes #3957
2020-11-27 09:19:09 +01:00
Stefan Kalkowski
0cbd1d1b7c os: adjust sd_card_drv to use platform API
Fix #3956
2020-11-27 09:19:09 +01:00
Stefan Kalkowski
f4ac642f64 platform_drv: reset pointer when releasing device
Ref #3956
2020-11-27 09:19:09 +01:00
Martin Stein
955afd8837 ada runtime: support image of enums
Ref #3937
2020-11-27 09:19:09 +01:00
Norman Feske
9b544787bd base: make Affinity::Space::location_of_index const 2020-11-27 09:19:09 +01:00
Alexander Boettcher
774b1f4277 base: remove Thread_deprecated
Fixes #3954
2020-11-27 09:19:08 +01:00
Josef Söntgen
dbcb1ff480 ssh_terminal: flush before closing connection
Originally the outgoing buffer was flush when the terminal was
detached. Since we cannot do that at this point, make the flushing
part of the common cleanup procedure.

Issue #3682.
2020-11-27 09:19:08 +01:00
Josef Söntgen
551b17591c ssh_terminal: handle detached term in event loop
Rather than calling 'ssh_disconnect' from within the Terminal session,
flag the detached terminal in the session and let the event loop do the
cleanup. Otherwise it might happen that the 'ep' (handling the Terminal
session) as well as the 'pthread.0' (executing the ssh event loop) end
up both triggering the cleanup concurrently.

Issue #3682.
2020-11-27 09:19:08 +01:00
Josef Söntgen
51a50ece60 libc: guard select call in socket_fs with monitor
Issue #3682.
2020-11-27 09:19:08 +01:00
Norman Feske
0dcb526ae5 base-linux: coding style 2020-11-27 09:19:08 +01:00
Christian Helmuth
dc016cbd5c ldso: log linker-area info on 'ld_verbose' 2020-11-27 09:19:08 +01:00
Christian Prochaska
e5f442f2d3 qt5: use integrated virtual keyboard in example application
Fixes #3949
2020-11-27 09:19:08 +01:00
Piotr Tworek
5db2971903 base-hw/arm_v7a: Mark r1 as out in Kernel::call64
In case of arm_v7a Kernel::call64 the syscall will use both r0 and r1 as
output registers. Unfortunately the inline asm does not reflect this and
only r0 is explicitly specified as output. GCC manages to produce output
which we'd like to see. Clang on the other hand takes adventage of the fact
r1 should not be touched by swi and produces fewer instructions which do
what the code describes, but not what we actually want.

Basically the code which we want and is generated by GCC is:
  svc     0
  mov     r2, r0
  mov     r0, r1
  mov     r1, r2
  bx      lr

Clang on the other hand generates correct assembly given the code, but
incorrect given what the function is supposed to do:
  svc     0
  mov     r1, r0
  mov     r0, #0
  bx      lr

Both GCC and clang generate the same, expected assembly output when r1
is marked as output register from the inline asm swi call.

Fixes #3951
2020-11-27 09:19:08 +01:00
Alexander Boettcher
aa7f5bc95f os: add cpu balancer component
Issue #3843
2020-11-27 09:19:08 +01:00
Alexander Boettcher
6872fdb0de cpu_burner: utilize all assigned CPUs
Issue #3843
2020-11-27 09:19:08 +01:00
Piotr Tworek
48220dfd9b os: Add missing {} around sub-object initializers.
Clang complains when a sub-object is initialized without {}.

Issue #3950
2020-11-27 09:19:08 +01:00
Piotr Tworek
50ab86cd72 base-hw: Remove unused rdtsc function for x86_64
This function has no callers. Clang warns about this.

Issue #3950
2020-11-27 09:19:08 +01:00
Piotr Tworek
cc7de65c9e nitpicker: Remove unused hover_reported variables
Fix for unused private member variable warning reported by clang.

Issue #3950
2020-11-27 09:19:08 +01:00
Piotr Tworek
cc193a9155 base: drop Trace::Session_component::_parent_levels
Clang correctly asserts this private member variable is not used
anywhere in the code. I'm not sure what the intention of the code is,
might be this is a part of some unfinished feature. This patch just does
the minimum amount of work to allow the code to build with clang. If
required I can also drop the parent_levels constructor argument and
clean up the call sites.

Issue #3950
2020-11-27 09:19:08 +01:00
Piotr Tworek
c0309a634e base: Silence unused arg warning in rpc_server.h
The msg argument in Genode::Rpc_dispatcher::_read_arg is not used. GCC
does not care about this, but clang does and prints a warning regaring
this. Silence it by removing unused argument name.

fixup! base: Silence unused arg warning in rpc_server.h
2020-11-27 09:19:08 +01:00
Martin Stein
30b8f4efc8 gems: import Genode-specific code of the CBE
The CBE repository contained a lot of Genode-specific code despite the fact
that the CBE core logic is not bound to Genode in any way. Therefore the
Genode-specific CBE code is moved to the 'gems' repository to form part of
Genode mainline. The remaining CBE code becomes a port in Genode instead of
being invoked as sub-repository.

The commit combines the following work steps:

* add all files removed from CBE repository
* add CBE port files
* make all CBE libs and targets build again
* make all CBE run scripts succeed again
* make all CBE recipes build again
* make CBE autopilot succeed again
* let CBE autopilot use 'libsparcrypto' contrib dir and Genode build dir
  instead of '.ci' dir in CBE contrib dir (remove '.ci' dir from CBE repo)
* let CBE autopilot always check for all ports
* make CBE autopilot directly executable
* fix license headers in all Genode CBE files
* remove unused VFS replay component
* remove unused CBE test
* remove unused external crypto
* remove unused files in run dir
* remove unused external trust anchor
* add cbe_tester test to autopilot list
* get rid of directories 'include/cbe_*' and 'include/utils'

Fixes #3937
2020-11-27 09:19:08 +01:00
Alexander Boettcher
24181f2bf6 driver_manager: use componentized usb driver
Fixes #3943
2020-11-23 12:03:00 +01:00
Alexander Boettcher
fae3c12366 usb: skip reporting of incomplete init. usb device
Fixes #3944
2020-11-23 12:03:00 +01:00
Stefan Kalkowski
4e90dc4512 dde_linux: adjust fec_nic_drv to use platform_drv
Fix #3947
2020-11-23 12:03:00 +01:00
Alexander Boettcher
a4c7837fb3 Update to bender with optional microcode and HWP
plugin support.

Fixes #3871
2020-11-23 12:03:00 +01:00
Christian Prochaska
764ab3be20 qt5: use libc 'posix_memalign()' in qtwebengine
Fixes #3916
2020-11-23 12:03:00 +01:00
Alexander Boettcher
c6a2e287d0 trace: forward exceptions during construction
The control area is constructed during session creation and the caller can
handle the Out_of_* exception by increasing the quota by the next attempt.

Fixes #3917
2020-11-23 12:03:00 +01:00
Emery Hemingway
d16a1bd922 vfs_lwip: log warning when blocking application
Log a warning when the lwIP VFS plugin queues a read while waiting
for an interface to become ready. By comparision the Lxip plugin
has the same behavior but a more verbose initialization process.

Fix #3920
2020-11-23 12:03:00 +01:00
Alexander Boettcher
b7ba508110 nova: update to kernel supporting AMD IO-MMU
Fixes #3928
2020-11-23 12:03:00 +01:00
Alexander Boettcher
d9cde328cb acpi: support amd iommu detection
Issue #3928
2020-11-23 12:03:00 +01:00
Alexander Boettcher
6b20a6bc7c tool: add hint how to enable vga console in nova
Issue #3928
2020-11-23 12:03:00 +01:00
Alexander Boettcher
95c2e5beb3 run: extend pci test to show more information
Add some more vendors and classcode decoding. Additionally, walk PCI cap
space of each device and decode some of the types.

Issue #3928
2020-11-23 12:03:00 +01:00
Josef Söntgen
194305a8bb dde_bsd: apply HP sense quirk for Fujitsu S398
This quirk is needed for properly switching between the internal and
an external headphone.

Thanks to Peter for the patch.

Issue #3929.
2020-11-23 12:03:00 +01:00
Josef Söntgen
b6912a3d87 dde_bsd: query initial head-phone state
Account for the situation where the driver is started while the HP
is already plugged in and configure the mixer accordingly.

Thanks to Peter for the patch.

Issue #3929.
2020-11-23 12:03:00 +01:00
Josef Söntgen
1b4444ce9e dde_bsd: use right member for iterating mixer set
Due to what seems like a copy-and-paste error, the wrong union member
was used to compare the label. Fortunately, as both structs have the
same memory layout that did not result in any issue.

Issue #3929.
2020-11-23 12:03:00 +01:00
Josef Söntgen
b9869b666a dde_bsd: use bsd_task to handle I/O
Originally, the kernel code should have been executed within the
context of the main task like it is done in dde_linux. The initial
port of the HDA driver, however, did not required doing so and the
session called code directly.

When using USB device, that is no longer possible as we have to
suspend the execution during the execution of the kernel code. So
we pass in the audio data and schedule the kernel.

Fixes #3929.
2020-11-23 12:03:00 +01:00
Josef Söntgen
cd7c99afdc dde_bsd: implemented delayed session announcement
This becomes necessary in case of the USB audio driver where we have
to wait for and query the function first.

That being said, alternatively we could also announce the session but
ignore any request until there is a device we can use.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
2ec398e550 dde_bsd: use timeout framework for time handling
With this commit the timer back-end uses the timeout framework to
schedule any occuring timeouts and for providing the current time.
For now there is only one timeout, the unsolicited azlia codec event
and therefore the timeout queue consists of solely one timeout object.

In addition a timer session is used for implementing 'delay()' where
we have to block until the delay is completed.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
bdb71d94c2 dde_bsd: pull strlcpy in via contrib code
For historical reason the 'strlcpy' implemention was directly pull in
into the emulation environment. There is, however, no reason not to
use the contrib sources in the usual fashion.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
7193902cc0 dde_bsd: properly name PCI audio driver component
Instead of the generic name, call the PCI driver 'pci_audio_drv'.

This is preliminary clean-up work before introducing the USB audio
driver.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
3faf5c43a8 dde_bsd: seperate PCI back end
The supported drivers so far exclusively used PCI and for practical
reasons the emulation environment was to tied to. To make future
addition of drivers that employ other transport busses easier, split
the bus handling into its own backend.

This is preliminary clean-up work before introducing the USB audio
driver.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
6c7f0cb7cc dde_bsd: properly enable recording in run script
* Updating the run script was missed in commit "dde_bsd: remove
    configration attributes".

  * Decrease output and input volume to "more sane" levels.

Issue #3929.
2020-11-23 12:02:59 +01:00
Josef Söntgen
54d36a7d1b mixer: apply config on new sessions
Updating the config and using its settings instead of only reporting
the new session allows to apply stored channel settings immediately.

In case of Sculpt this is useful when an existing launcher already
contains a valid config that sets the volume levels appropiately or
the 'recall_fs' is used.

Fixes #3930.
2020-11-23 12:02:59 +01:00
Martin Stein
9b164d20fd vfs directory service: name enum Open_mode
Fixes #3936
2020-11-23 12:02:59 +01:00
Alexander Boettcher
cd8b436566 usb_hid: avoid destruction of used signal handler
Fixes #3945
2020-11-23 12:02:59 +01:00
Piotr Tworek
87e90d640f base-linux: Drop unused member variables
The _root, _gid and _uid private member variables are not used for
anything. GCC does not care, but clang likes to complain about things
like this.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
db71cb8c63 base-linux: Drop ununsed Message::_addr
Not used anywhere in the current codebase. GCC does not care but clang
warns about this.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
a892018926 base-hw: Define Entry function as noreturn.
Right now the code marks specific instance of this function as noreturn.
It then tries to initialize it using a value that has the same type,
except for the noreturn part. GCC does not care, but clang complains this
technically assigns the value of entry from incompatible pointer type.

Fix this by defining Entry function as no return.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
1643d623e4 base-hw: Fix warning about unused lambda capture
The lambda function passed to Board::Vm_page_table_array does not
actually use "this" for anything. GCC does not warn about this, but
clang does. Remove the extra capture to make clang happy.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
9b84a8a402 base-hw: Add semicolons after [[fallthrough]]
GCC doesn't care, but clang complains if [[fallthrough]] is not followed
by a semicolon. Existing code is also not consitent in this regard. Lets
just fix it to make clang happy.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
db17d51ff1 os: Drop unused _tree member in Root_clock_divider
Its not used anywhere in the code. Clang produces warning due to this.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
736b000c19 os: Drop ununsed Main::_id_id variable in ping
The variable is not used anywhere in the code. This produces warning
when building with clang.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
187b8ece27 os: Drop ununsed Virtdev_rom::Root::_env member
Set but not accessed from anywhare. This triggers compilation warning
when building the code with clang.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
93288bccb3 os: Refer to ::Sandbox::Child explicitly.
When compiling this code, clang complains reference to 'Sandbox' is
ambiguous. It can either mean ::Sandbox namespace from
os/src/lib/sandbox/types.h, or Genode::Sandbox declared in
repos/os/include/os/sandbox.h. Since the code refers to ::Sandbox::Child
and its already in ::Sandbox namespace we can just drop "Sandbox" and
refer to just Child, which makes clang happy.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
444bc18fcf base: Drop unused Cpu_root::_md_alloc member
This private variable has no uses in the context of the class. Spotted
when building the code with clang.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
18be6315cb base: Drop unused _ram member variable
Its initialized in constructor but never used. Spotted when building the
code with clang.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
9c3ce58e57 base: Drop unused "verbose" variable
Spotted when building the code with clang. This is not used anywhere in
the file.

Issue #3938
2020-11-23 12:02:59 +01:00
Piotr Tworek
d4a3aa7eda base: explicit copy constructor for Rpc_in_buffer
According to the "rule of three" [1] and C++11 [2] Rpc_in_buffer needs
to have an explicit copy constructor since it also has user defined
copy assignment operator. Both clang and newer versions of GCC complain
about this.

[1] https://en.cppreference.com/w/cpp/language/rule_of_three
[2] https://www.ece.uvic.ca/~frodo/cppdraft/n4659/html/depr.impldec

Issue #3938
2020-11-23 12:02:58 +01:00
Piotr Tworek
8d6ca9556f base: fix clang warning for void cast of retval
This path fixes a void cast used to silence unused return value warning.
Its a common pattern to use void cast to do that. The code uses void *
cast instead. It works for GCC, but clang complains about this.

Issue #3938
2020-11-23 12:02:58 +01:00
Piotr Tworek
81a49bffee base: exception specification for operator delete
Clang is rather picky about this and prints the following warning when
compiling new_delete.cc:

  error: function previously declared with an explicit exception
  specification redeclared with an implicit exception specification
  [-Werror,-Wimplicit-exception-spec-mismatch]

Issue #3938
2020-11-23 12:02:58 +01:00
Piotr Tworek
53a990579b base: Fix UAF in Genode::Pd_session_component::free
This was discovered when building the code with clang instead of GCC. In
this setup the run/ping on base-hw/arm_v8a/virt_qemu would crash
on shutdown due to uncaught Deref_unconstructed_object exception thrown
for Genode::Reconstructible<Genode::Account<Genode::Ram_quota>>. The
specific instance throwing this exception was
Pd_session_component::_ram_account. My investigation exposed the
following problem:

1. The Pd_session_component has a _sliced_heap member backed by
   _constrained_ram_alloc which in turn uses Pd_session_component itself
   as its Ram_allocator.
2. When ~Pd_session_component is called it first destroys _ram_account,
   followed by _signal_broker.
3. The signal broker holds a reference to
   Pd_session_component::_sliced_heap as Signal_broker::_md_alloc.
4. The base-hw implementation of ~Signal_broker destroys some contexts
   and does this by calling Genode::destroy on some slabs using the
   _md_alloc (ref to Pd_session_component::_sliced_heap).
5. The Genode::Slab calls the Ram_allocator::free which ends up calling
   Pd_session_component::free.
6. The Pd_session_component::free can among other things call replenish
   method on Pd_session_component::_ram_account which has already been
   freed at this point.

From my POV calling replenish at this point is basically an undefined
behavior. The Genode::Constructible holding the Genode::Account was
already detroyed at this point. GCC builds happen to somehow manage to
go through the -> operator call without raising any alarms, while clang
builds trip on the _check_constructed() call.

This fix moves the _ram_account a bit higher in class declaration to
ensure its destroyed after _sliced_heap. This seems like the simpliest
solution for this problem.

Fixes #3941
2020-11-23 12:02:58 +01:00
Christian Helmuth
a8d3cd9b15 libc: open socket files early on socket creation
This prevents later file-descriptor shortage when opening files on
demand, which can't be reflected to the application in a sane manner.

The real fix is to open socket files not on libc level but on VFS level
only effectively consume one libc file descriptor for one socket.
2020-11-23 12:02:58 +01:00
Christian Helmuth
5dfca79bcc libc: use pthread mutex in getifaddrs() 2020-11-23 12:02:58 +01:00
Christian Prochaska
ff429a8056 base-linux: build 'lx_iopl()' function on x86 only
Fixes #3934
2020-11-23 12:02:58 +01:00
Christian Prochaska
eafbfb8edf base-linux: socket descriptor caps for RPC (BOARD=pc)
Fixes #3932
2020-11-23 12:02:58 +01:00
Christian Prochaska
b72503e581 base-linux: remove 'lx_ioperm()' function
Fixes #3933
2020-11-23 12:02:58 +01:00
Stefan Kalkowski
429cd8d37a os: enable smp support for ARM vmm
* Fix GIC model to support priority and cpu target settings correspondingly
* Fix semantic of SGIR register for GICv2
* Minor GIC model IRQ state fix
* Introduce synchronization for VirtIO and GIC models
* Enable multiple CPUs in test run-script for ARMv8

Fix #3926
2020-11-23 12:02:58 +01:00
Stefan Kalkowski
6be09a27ca os: minor fix terminal_expect_send test-component
When an empty line was send, it could occur
that a previous line got printed instead.

Ref #3926
2020-11-23 12:02:58 +01:00
Stefan Kalkowski
7298b00013 base-hw: make ARMv7/v8 hypervisor smp ready
* Introduce hypervisor-stack per CPU
* Introduce host world context per CPU
* Mark EL2 translation table memory as inner shareable
* The VMID is not bound to a single VCPU, but to the Vm_session as a whole
* Set affinity of the VCPU accordingly
* Add VMPIDR to VM state

Ref #3926
2020-11-23 12:02:58 +01:00
Stefan Kalkowski
1d826a2c48 base-hw: do direct syscall when run/pause a VCPU
Instead of calling core to run/pause a VCPU, go directly to the kernel.
Apart from the performance win, it would otherwise involve a more complex
protocol, when a VCPU on another core has to be removed from the scheduler.
Core's entrypoint handling those request runs on the boot-cpu only.

Ref #3926
2020-11-23 12:02:58 +01:00
Stefan Kalkowski
40445d7011 base: extend vm_session API with native vcpu cap
To enable the interaction of a VMM with the kernel directly,
a hidden RPC gets introduced. It allows a kernel-specific
base-library implementation of the Vm_session::Client to request
a kernel-specific capability to address a VCPU, e.g., to
run/stop it.

Ref #3926
2020-11-23 12:02:58 +01:00
Alexander Boettcher
11e261ada4 platform_drv(x86): use 32bit writes for MSI-X
Fixes #3927
2020-11-23 12:02:57 +01:00
Christian Helmuth
c93f3a1136 libusb: establish/terminate USB session
Now, the USB connection is established on backend initialization and
terminated on backend exit triggered by high-level libusb code.

Thanks to Peter for the patch.
2020-11-23 12:02:57 +01:00
Christian Helmuth
e339dd542c Prevent warning in test-pthread 2020-11-23 12:02:57 +01:00
Christian Helmuth
3d23c8c419 libports: update curl download location 2020-11-23 12:02:57 +01:00
Martin Stein
89d28c8222 timeout: no volatile stackvars, better warnings 2020-11-23 12:02:57 +01:00
Christian Prochaska
dff3bac441 libc: submit monitor execution signals locally
Issue #3924
2020-11-23 12:02:55 +01:00
Christian Prochaska
798beab30e base: support process-local signal submission
Issue #3923
2020-11-23 12:02:53 +01:00
Christian Prochaska
50e0f3b977 base: don't throw exceptions in 'Signal_receiver::pending_signal()'
Issue #3922
2020-11-23 12:02:49 +01:00
Josef Söntgen
f754e2a7d7 stdcxx: add symbols needed by testsuite
Fixes #3921
2020-10-23 15:12:06 +02:00
Josef Söntgen
1dd1bfe692 stdcxx: add new/delete aligned variants (C++17)
Issue #3921
2020-10-23 15:08:40 +02:00
Josef Söntgen
a74b572e1f stdcxx: force symlinks to allow for re-preparing
Issue #3921
2020-10-23 14:59:56 +02:00
Josef Söntgen
a24911296a stdcxx: adapt header files for testsuite
Issue #3921
2020-10-23 14:59:49 +02:00
Josef Söntgen
563cc07cb0 libports: posix src archive implements posix API
Issue #3921
2020-10-23 14:58:27 +02:00
Josef Söntgen
59f562f627 libc: add symbols needed by testsuite
Issue #3921
2020-10-23 14:58:04 +02:00
Josef Söntgen
4981eb425e ld: add symbols needed by testsuite
Issue #3921
2020-10-23 14:58:01 +02:00
Josef Söntgen
de8411a5e1 cxx: add missing low-level symbols
Issue #3921
2020-10-23 14:56:36 +02:00
Christian Helmuth
5be1c793a5 depot: update recipe hashes 2020-10-23 14:16:38 +02:00
Emery Hemingway
b4076e762c libc: log a message and exit for raise(...)
Fix #3919
2020-10-21 09:14:55 +02:00
Christian Helmuth
6ea628195f dde_bsd: update mirror URL
It seems RWTH Aachen mirrors only ancient versions currently.
2020-10-20 09:14:40 +02:00
Martin Stein
64487ded7c timeout: don't warn "timestamp value too big" too often
Fixes #3657
2020-10-19 14:26:56 +02:00
Christian Prochaska
405955eaef libc: implement 'posix_memalign()'
Fixes #3915
2020-10-15 15:41:55 +02:00
Alexander Boettcher
0aaed47652 nova: re-/store ep fpu state in vm_session
Fixes #3913
2020-10-13 14:42:06 +02:00
Alexander Boettcher
20606bc6de foc: save/restore fpu state in vm_session
Issue #3913
2020-10-13 14:42:03 +02:00
Christian Prochaska
9cd38a6846 libc: rwlock cleanup
Issue #3912
2020-10-13 14:38:43 +02:00
Christian Prochaska
bf4afefaa1 libc: use semaphore in rwlock implementation
Fixes #3912
2020-10-13 08:21:04 +02:00
Christian Helmuth
f09b0dc224 Improve synchronization in lwip.run
The lynx HTTP GET test was started before the HTTP server was up and
therefore failed on Qemu/PBXA9.

Issue #3874
2020-10-09 16:13:14 +02:00
Christian Prochaska
658030ef49 qt5: update port for qtwebengine improvements
- unlink shared memory files
- lower maximum number of socket pool sockets to reduce chance of file
  descriptor exhaustion
- fix a build dependency which caused sporadic parallel build errors

Fixes #3910
2020-10-09 13:51:26 +02:00
Christian Prochaska
4e8bfed5b1 libc: duplicate the file descriptor on shared 'mmap()' mappings
Fixes #3909
2020-10-09 13:50:35 +02:00
Christian Prochaska
5c47fa0d41 libc: reduce file descriptor lookup exceptions in 'select()'
Fixes #3908
2020-10-09 13:48:23 +02:00
Christian Prochaska
058f2e687c libc: make 'mmap()' address alignment configurable
With this commit, the alignment of anonymous 'mmap()' allocations can be
configured like this:

<config>
  <libc>
    <mmap align_log2="21"/>
  </libc>
</config>

Fixes #3907
2020-10-09 13:47:33 +02:00
Josef Söntgen
7d21335ac9 vfs/oss: VFS plugin for Audio_out access via files
This plugin gives access to the Audio_out session by roughly
implementing a OSS pseudo-device. It merely wrapps the session and does
not provide any resampling or re-coding.

Fixes #3891.
2020-10-09 13:44:27 +02:00
Josef Söntgen
3d2b0cab93 libc: implement SNDCTL I/O control handling
In the same vein as the terminal and block I/O controls, the sound
controls are implemented via poperty files and match the OSS
API ([1] features a nice overview while [2] is v3 and [3] gives
in-depth information on the current v4.x API we eventually might want
to implement).

  [1] https://wiki.freebsd.org/RyanBeasley/ioctlref/
  [2] http://www.opensound.com/pguide/oss.pdf
  [3] http://manuals.opensound.com/developer/

The controls currently implemented are the ones used by the cmus OSS
output plugin, which was the driving factor behind the implementation.
It uses the obsolete (v3) API and does not check if the requested
parameter was actually set, which should be done according to the
official OSS documentation.

At the moment it is not possible to set or rather change any
parameters. In case the requested setting differs from the parameters
of the underlying Audio_out session - in contrast to the suggestion in
the OSS manual - we do not silently adjust the parameters returned
to the callee but outright fail the I/O control operation.

The following list contains all currently handled I/O controls.

  * SNDCTL_DSP_CHANNELS sets the number of channels. We return the
    available channels here and return ENOTSUP if it differs from
    the requested number of channels.

  * SNDCTL_DSP_GETOSPACE returns amount of playback data that can
    be written without blocking. For now it amounts the space left
    in the Audio_out packet-stream.

  * SNDCTL_DSP_POST forces playback to start. We do nothing and return
    success.

  * SNDCTL_DSP_RESET is supposed to reset the device when it is
    active before any parameters are changed. We do nothing and return
    success.

  * SNDCTL_DSP_SAMPLESIZE sets the sample size. We return the
    sample size of the underlying Audio_out session and return ENOTSUP
    if it differs from the requested number of channels.

  * SNDCTL_DSP_SETFRAGMENT sets the buffer size hint. We ignore the
    hint and return success.

  * SNDCTL_DSP_SPEED sets the samplerate. For now, we always return
    the rate of the underlying Audio_out session and return ENOTSUP
    if it differs from the requested one.

This commit serves as a starting point for further implementing the
OSS API by exploring more users, e.g. as VirtualBox/Qt5/SDL2 audio
backend or a more sophisticated progam like sndiod.

Issue #3891.
2020-10-09 13:44:14 +02:00
Christian Helmuth
bcf1cc6397 Ensure high priority for timer in test.run 2020-10-09 13:37:17 +02:00
Martin Stein
bff624c75a test/entrypoint: extend timeout interval
At least on some PIT-based platforms (x86_32 + pistachio/okl4/sel4), we run
into trouble with the reworked timeout framework that now proccesses all
pending timeouts before calling their handlers. This order change leads to a
higher rate of handling of short periodic timeouts in the timer driver which
can cause lower prioritized components to starve. Especially, if submitting
signals (from timer to client) isn't cheap (as is the case on qemu + pistachio
for example).

Issue #3884
2020-10-09 13:37:14 +02:00
Martin Stein
512be0a52a test/timer_rate: determine lowest accurate period 2020-10-09 13:37:10 +02:00
Christian Helmuth
91f8281618 depot: update recipe hashes 2020-10-09 13:35:57 +02:00
Christian Prochaska
0e01729d77 libc: handle file descriptor allocation errors
Fixes #3906
2020-10-09 13:35:57 +02:00
Sebastian Sumpf
fe1ee05186 recipe: imx53_qsb_drivers
Do not copy imx53 specfic source code since it has been unified within
the GPIO driver.

follow up for issue #3900
2020-10-09 13:35:57 +02:00
Christian Helmuth
ec957739e9 Adapt some RAM quotas for 2560x1080 screens 2020-10-09 13:35:57 +02:00
Piotr Tworek
8d5005e03a os: add VirtIO nic driver
The driver is faily simple and does not support fancy features like
TCP checksum offloading or vlan filtering, but it is fully capable of
running every Genode network based scenario I've tried. Its currently
known to work on virt_qemu arm platforms and x86_64.

Fix #3825
2020-10-09 13:35:57 +02:00
Piotr Tworek
7fbb245710 os: add VirtIO device helper classes.
To simplify writing native VirtIO drivers for Genode add helper classes
representing VirtIO device and queue. The queue implementation should
be platform independant. The device abstraction however is closely tied
to the VirtIO transport being used (PCI/MMIO). Both PCI and MMIO
implementations expose the same public API so the actual driver logic
should be the same regardless of which transport is used.

Its also important to note that the PCI version of Virtio::Device
currently does not support MSI-X interrupts. Unfortunately my kowledge
about PCI bus is very limited and my main area of interest was to get
VirtIO drivers working on virt_qemu ARM/Aarch64 platform. As such all
the VirtIO drivers I plan to submit will work with PCI bus, but might
not use some extended capabilities.

Ref #3825
2020-10-09 13:35:57 +02:00
Piotr Tworek
9bd548c4bd os: add platform_drv config generator for virt_qemu
The VirtIO device configuration on Qemu is dynamic. The
order and presence of different command line switches affects
base address and interrupt assignment of each device. One could
probably hard-code the necessary switches and resulting XML ARM
platform driver configuration in each run script, but this seems
like troublesome and hard to maintain solution.

This patch explores an alternative approach to the problem.
It implements a ROM driver which probes the address space region
Qemu virt machines assign to VirtIO MMIO devices and exposes the
result as XML via a ROM session. This XML output can be fed directly
as config to the generic ARM platform driver.

Ref #3825
2020-10-09 13:35:57 +02:00
Piotr Tworek
fe0ad0addb tool: Consolidate qemu nic setup.
Right now the same code dealing with nic setup on qemu is duplicated
in many different run scripts. It makes it unnecesarily complex to
change the existing config or add support for new nic types. Lets move
all this common code to qemu.inc.

Ref #3825
2020-10-09 13:35:57 +02:00
Stefan Kalkowski
aa2511e209 platform_drv: make it available for arm_64 generic
Ref #3825
2020-10-09 13:35:57 +02:00
Stefan Kalkowski
3cf3344fa3 sel4 + foc: extend port's tool check rules 2020-10-09 13:35:56 +02:00
Sebastian Sumpf
c79687f5f4 gpio: introduce Pin and '_with_gpio'
- make GPIO server more robust on imx by not throwing exceptions for
  unknown pins, use '_with_gpio' instead
- use 'Gpio::Pin' data type instead of POD 'unsigned'

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
b9bd179e54 gpio_drv: remove specs for imx53 and imx6
Also cleanup run scripts and recipes were gpio driver is not required,
update the ones were it is.

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
6c6deb7e8b dde_linux: add touch to i.MX8 recipe
Add touch screen and event filter to drivers interactive package.

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
d387eba0ba os: driver recipe for i.MX8 drivers
Includes touch and gpio driver

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
96eb83f19a os: Synaptics DSX touch screen driver
Provides touch event service for i.MX8M Quad only

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
89972b11b7 gpio_drv: use platform session for i.MX
This makes the driver work for all i.MX boards. A platform driver with
the board specific configuration is required.

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
664b861f9d imx8_fb_drv: MIPI DSI display support
- support for Northwest Logic MIPI DSI bridge
- support for Radium panel (NXP MX8_DSI_OLED1)
- new 'DSI-1' connector in driver config file

issue #3900
2020-10-09 13:35:56 +02:00
Sebastian Sumpf
27f705bc48 bootstrap: iomux adaptions for i.MX8 MIPI
These settings were obtained with a JTAG debugger from a running Linux
system. They work for MIPI as well as for HDMI.

issue #3900
2020-10-09 13:35:56 +02:00
Alexander Boettcher
325e9cb9fa platform_drv(x86): avoid memory leak 2020-10-09 13:35:56 +02:00
Alexander Boettcher
50b10ef4a5 aes_cbc_4k: extend test and run in autopilot
- to compare crypted text with host openssl

Fixes #3905
2020-10-09 13:35:56 +02:00
Alexander Boettcher
c0f8022a78 aes_cbc_4k: use libcrypto
Issue #3905
2020-10-09 13:35:56 +02:00
Alexander Boettcher
5d808cdc01 platform_drv: extend MSI-X supports
The patch handles the case, that the memory for the MSI-X table is part
of one of the Pci::Resource Memory BARs, which got allocated beforehand already.

With this commit, the platform driver will not fall back to use legacy IRQs or MSI, whereby MSI-X is available actually. Additionally, this patch avoids a lot of red
messages about non available IO-MEM printed by the roottask.

Fixes #3904
2020-10-09 13:35:56 +02:00
Christian Helmuth
abefca500b libc: fix deadlock in pthread_cond_timedwait/signal()
The deadlock occured with three concurrently running threads: two
waiters calling pthread_cond_timedwait() and one signaller calling
pthread_cond_signal().

If waiter W1 hits its timeout, the signaller may have called
pthread_cond_signal(), detected this waiter and posted the internal
'signal_sem' concurrently. Then, the signaller waits for 'handshake_sem'
to ensure the waiter got woken up.

Waiter W1 can't consume the 'signal_sem' post by
'sem_wait(&c->signal_sem)' because another waiter W2 may have consumed
the post already above in sem_wait/timedwait(). Waiting for a post on
'signal_sem' would block the waiter W1 in perfect deadlock with
signaller on 'handshake_sem'. As W1 also owns 'counter_mutex' in this
situation, waiter W2 would block when trying to aquire 'counter_mutex'
and can't resolve the situation.

So, W1 does nothing in this case and we accept the spurious wakeup on
next pthread_cond_wait/timedwait().
2020-10-09 13:35:56 +02:00
Martin Stein
7feea78991 timeout: rework timeout framework
* get rid of alarm abstraction
* get rid of Timeout::Time type
* get rid of pointer arguments
* get rid of _discard_timeout indirection
* get rid of 65th bit in stored time values
* get rid of Timeout_scheduler interface
* get rid of uninitialized deadlines
* get rid of default arguments
* get rid of Timeout::_periodic
* get rid of Timeout::Raw
* use list abstraction
* only one interface for timeout handlers
* rework locking scheme to be smp safe
* move all method definitions to CC file
* name mutexes more accurate
* fix when & how to set time-source timeout
* fix deadlocks

Fixes #3884
2020-10-09 13:35:56 +02:00
Martin Stein
9e5d479d03 timeout: test smp support
Ref #3884
2020-10-09 13:35:56 +02:00
Christian Helmuth
26011a7151 libc: update status for component select handlers
In case of contexts blocked in select() the monitor updates the
file-descriptor status, but if the entrypoint is just blocked for the
select handler, the status must be updated explicitly on
dispatch_select().
2020-10-09 13:35:56 +02:00
Stefan Kalkowski
bbb017dc24 muen: update to Community 2019 toolchain version
Fix #3903
2020-10-09 13:35:55 +02:00
Alexander Boettcher
04d3c9e750 nova: re-enable DMAR super pages in kernel
Fixes #3902
2020-10-09 13:35:55 +02:00
Alexander Boettcher
e5fe9c6fc7 qemu-usb: catch exception on already gone devices
Fixes #3893
2020-10-09 13:35:55 +02:00
Norman Feske
04821b1abc nitpicker: apply focus change w/o input events
This patch fixes the corner case where the keyboard focus is defined
independently from user interactivity, e.g., the activation of a
screensaver or lock screen.

In this case, nitpicker would update its internal focus state not before
the next input event is handled. Should this input event be a press
event, this event would wrongly be delivered to the prior focused
session. Another problematic situation is the initial state before the
very first input event occurs. Since the focus remains undefined until
the first input event is handled, an initial key press event would not
be delivered.

This is a regression caused be the transition to the event-session
interface and the removal of the nitpicker's periodic way of operation.
The patch fixes the problem by applying pending focus changes not only
at the input processing but also on the code path that responds to focus
changes (e.g., focus-rom update).

Issue #3812
2020-10-09 13:35:55 +02:00
Alexander Boettcher
afab15f1a4 linux: round up dataspace to 4k sizes
Issue #3901
2020-10-09 13:35:55 +02:00
Alexander Boettcher
e61f6cfd38 base: add thread migration test
Issue #3842
2020-10-09 13:35:55 +02:00
Alexander Boettcher
90bea1499e core: store new affinity on successful migration
Adjust the base-* platforms to acknowledge new thread location solely if
migration is supported and succeeded. Otherwise the wrong thread
locations are observed via the trace session and utilization time calculation
get wrong.

Issue #3842
2020-10-09 13:33:36 +02:00
Alexander Boettcher
99fa203673 nova: add migration support for global threads
Fixes #3842
2020-10-09 13:33:36 +02:00
Martin Stein
1b41d9db90 base: remove alarm library from base
Ref #3884
2020-10-09 13:33:36 +02:00
Martin Stein
c1d0179194 dde_rump: move private headers to src/include
Ref #3884
2020-10-09 13:33:36 +02:00
Martin Stein
04463806a8 dde_rump: remove unused rump_cgd
Ref #3884
2020-10-09 13:33:36 +02:00
Martin Stein
af01370cc1 run/rump_fat: raise ram quota
Ref #3884
2020-10-09 13:33:35 +02:00
Martin Stein
4eb4bd6f96 trace_logger: warn on multiple buffer wraps
Ref #3884
2020-10-09 13:33:35 +02:00
Christian Prochaska
d2d74cc5fa tool chain: fix build error on Ubuntu 20.04 (GCC 9)
Fixes #3899
2020-10-09 13:33:35 +02:00
Josef Söntgen
f53df495db libc: provide 'sys/soundcard.h' header file
Issue #3891.
2020-10-09 13:33:35 +02:00
Josef Söntgen
f3268cade6 libc: split ioctl method
Use one ioctl method for each type of I/O control because by now the
general method will become increasingly long.

Fixes #3890.
2020-10-09 13:33:35 +02:00
Josef Söntgen
1a54ee895e vfs: use compound ioctl in Block-VFS plugin
Instead of using the old 'ioctl' Vfs::File_io_services API implement
the I/O control functionality in a buch of files. This is similar to
the terminal-VFS plugin.

Fixes #3889.
2020-10-09 13:33:35 +02:00
Josef Söntgen
27d4cb871f libc: use property files for block ioctl
Like already done for terminal I/O controls use collect the information
by reading property files instead of using the old VFS ioctl interface.

Fixes #3888.
2020-10-09 13:33:35 +02:00
Josef Söntgen
2312ad35dd libc: match ioctl request type to contrib type
There is a type mismatch as in the FreeBSD contrib code the type of the
request is 'unsigned long'. So far, only I/O controls where the request
falls into the signed range where used and this was not a problem.

Some of the SNDCTL requests, however, have the bit set.

Fixes #3887.
2020-10-09 13:33:35 +02:00
Christian Prochaska
85a84f5042 qt5: generate enter events related to popup menus
Fixes #3894
2020-09-18 15:23:45 +02:00
Sebastian Sumpf
0fd979b147 imx8_fb_drv: make 'Capture' constructible
Reconstruct capture connection on config update in order to receive
update of complete screen data from GUI session.

fixes #3878
2020-09-18 15:21:10 +02:00
Christian Helmuth
ad595d2701 sculpt: version 20.09 2020-09-18 15:20:18 +02:00
Christian Helmuth
f6337a6446 depot: update recipe hashes 2020-09-18 14:04:56 +02:00
Stefan Kalkowski
f1b3e826d5 sculpt: update building section of sculpt README 2020-09-18 14:04:56 +02:00
Alexander Boettcher
2afba3c137 driver_manager: provide more memory to boot_fb
Fixes #3896
2020-09-18 14:04:56 +02:00
Norman Feske
e0d9a04f67 libc: resolve circular dependency in fork
This patch is a follow-up for the commit "libc: use monitor for fork".
It removes the use of the monitor mechanism from the
'Local_clone_service::close' RPC function because the fork_ep must stay
responsive for the destruction and creation of 'Child' objects.

Issue #3874
2020-09-18 14:04:56 +02:00
Norman Feske
274f306315 release_notes-20-08.txt: minor style fixes 2020-09-18 14:04:56 +02:00
3700 changed files with 143360 additions and 52779 deletions

26
README
View File

@@ -65,34 +65,24 @@ The source tree is composed of the following subdirectories:
:'doc':
This directory contains general documentation. Please consider the following
document for a quick guide to get started with the framework:
! doc/getting_started.txt
If you are curious about the ready-to-use components that come with the
framework, please review the components overview:
! doc/components.txt
This directory contains general documentation along with a comprehensive
collection of release notes.
:'repos':
This directory contains the so-called source-code repositories of Genode.
Please refer to the README file in the 'repos' directory to learn more
about the roles of the individual repositories.
This directory contains the source code, organized in so-called source-code
repositories. Please refer to the README file in the 'repos' directory to
learn more about the roles of the individual repositories.
:'tool':
Source-code management tools and scripts. Please refer to the README file
contained in the directory.
:'depot' and 'public':
:'depot':
Local depot and public archive of Genode packages. Please refer to
! doc/depot.txt
for more details.
Directory used by Genode's package-management tools. It contains the public
keys and download locations of software providers.
Additional community-maintained components

View File

@@ -1 +1 @@
20.08
21.08

View File

@@ -1 +0,0 @@
https://depot.1337.cx

View File

@@ -1,37 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQENBFm3BlYBCADR2ZGIWiYurf/urQ+rAZs3HMobXQ/fckc3FOAdY9qiklrvPr9s
maZZyMF+Wn4J2AmsGctJbBUt3ujcmk09AgZIzrHpVJRagUSz9q+bK7NvAfenDC2q
w4HS5yE9DYxXOjxrcS5a2HhKfE5sZef1zPtFIkEZCJXCvh4IL6maLijOrUZPf9R6
VJ+0itNh0hK9KiYsKA7CwrWuFaw7ZenVkEBV1HGXybFh9aInTTSqopyU6qYLDK1X
U0NG24cjM8TDbMGTaoScpLchcftBGEhjYg7Y2FCu455MDVdrmoOoxDINYgDU1KN6
8GBKKJ+xqG703/o550l+rCMB+TxMN5zKTFhXABEBAAG0IkVtZXJ5IEhlbWluZ3dh
eSA8ZWhtcnlAcG9zdGVvLm5ldD6JAVQEEwEIAD4CGwMFCwkIBwIGFQgJCgsCBBYC
AwECHgECF4AWIQRuEEFO5xYHgfX+6P+xTQQ6JrPSxwUCWgHubgUJAZm9OgAKCRCx
TQQ6JrPSxyJ0B/0eBOIloo3zJwtuQnNXe2ZFAmHFF7MJhrr0IpZ0n5K0OHTFPqXN
VJ+vhTGuI/SlF3a9YEHohIT2KKal1aq+/wVkX6Kdi4G4nGTEXdRsTwlzN/GXHBPF
IW0iUOInJOliKReaamsR/rgXXH5sstq2IU4x+NpHMT/OrkQPNSqVX0RjS9i76Awo
+EqdtW8g3y8qWd8WtTfhbMlQLhuzm99aADbspr4nK9WhZ7UHYLJAz/u7LzZlRiI5
hNa85BCPhNuYz5NTHhn4L9r6PdbKPzUV173XrlAtlteYuGIHk4d/zSAwlgDevChL
0MDRq1vvgfQ2V0SwIqRqIfnO31Ph8uktJ8WRiQEfBBABCAAJBQJaAReyAgcAAAoJ
EIZq4LBroLaERpQH/3Dw0H6N9YF2ATmkse6NNNQjxhKSUoA34UBWj0v4Q1AvXEe6
nHRR0mAa9Gije9ixKUg85VbKM3lUhXCFqW5jzyzpF1rzzTpAHaUTYKb8M2D9iRKo
9ejTK3KrgpstYJ8jthfosxeC+lK24WUXKKWPjgoIhv7Thd31ea/PZdkFVd1MpSwg
5BHRHcogsJI9uou7zWYbap9/k0lxKHJWklLh/oXet+aAoUIL0kTU+nILy3/RZJGW
9WlnZR9g3qSQ8YNpgNSrraEtXpcs6MGsWZSzbzJ1U95NL87NbWEOYgHZA++vhEy5
EXVrd8SuSHbUbqNF36gz1cxmEuKwxAaWZ1/UbGW5AQ0EWbcGVgEIANC9LozG/TXV
4j0TniuLrsq7kkNH+OJQexcD19pBrmEV4eYYD6c8BB9CaBITqvKIqtG0VJrmB5S5
D0oW4mQI+TkcX+Q7y3S7dUkc856d03aUX3vVcNhXEbNgM19qxAGieC8WH2kr4XU1
psu1WvFCXOktrE5c8H0rPCQ1jseB0S67XCA9BLwAqlqu0OuTpbWddjXuE1ahi0ig
Yt5YsHvgCMLup208azQqGCnJ5tFotqzbLg3I6+QzMcLySqsN4BzYmUGbOSSZdUhX
DWxwAK1dB8qa27iwsxCMncdGnqOTkq+mXRmu8ztPTUivyC6YHJ+O5lXvMMADZi4j
8RpQQlh5gFkAEQEAAYkBNgQYAQgAIBYhBG4QQU7nFgeB9f7o/7FNBDoms9LHBQJZ
twZWAhsMAAoJELFNBDoms9LHTmIH/0PuzpA3Ezdrb4xfVwnhUUZGiqfNzULCZipT
qtfym6Ove6To4BbXAihWwnCYs4sgipabW1WaXsDDvU+AmOmz4EPyTna23fUzYRSL
MT/kk77d+BGRGeA8/Gj/BgjPlHlFa7ukbT1DL1lSV0RMQ32tDGnhJ7wMBx4GoYU+
xjlsxrYKKdvZKOQVCCFn4KY/GavqT+8pYYI63stSPGspboQR2iboKqc350MVMvzz
IaDt14YiOYlgV6LoNj2VaPJvFqm9ML+plYl4PPQZTV6KAhFWCDJq2DzEQqwG6RU4
SsneHAqMlG4A5SSMTLEd9F2gZ2sJicybr1WbNLj1KF74ckUhpM4=
=p4q9
-----END PGP PUBLIC KEY BLOCK-----

1
depot/jschlatow/download Normal file
View File

@@ -0,0 +1 @@
https://depot.genode.org

59
depot/jschlatow/pubkey Normal file
View File

@@ -0,0 +1,59 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGBlsG4BEADBMY44lF/LYiZByj1clJa+aNCEMGtoulxhFgCLIt2DR9r5KRmi
iAiweobH6ofbSXYKTOZqhAcmmkw3ihIVCsd1mHbdAAhlsnJetHLgOPL90aXVwce/
CM5QDubFmSu1VuaCgp/GaPqtQ/yaIq4LPMK+w2BfNG2M5XBeM8qLzjIHF7KNN4nZ
CX48Gx7q2DtIYCMUdIP0oK4dNfPDy6tvXiYvcz3lA2SNa6kszW3/mgIsurUEUFF6
vtCjBS5f6vJikWsglvTXqS0Sw5aIPzvosL/U0fjM0BVdi2NK6dWfM4HUduzr5MTD
Xc26CETmZ/8Sl4+mj0oUAuHU0SKDm22LNc+qRzXZxtkryDbFuikwtioYf3nIDTiA
63YPsx1jHp3mitTQgvRlJdlncmKIxXIUyGXqWpc+QHGUsvbDFdsXRxtt3J+8QWso
yLlaeP54E0OTQqdm+EnWGHahEKIwsn8/Gfs87phQsaF8Dlw+A132RukxB6zD35xF
/rqu25/8B0tL603Z3TLIyLDNbh4xO/iNohTB1ps+ALRwu48MsXcTMGUeWuRt2YVJ
RPG3KfIfnd+KcvJa2XFuzZCk57Jc8qGPmINPY5fJ7F9qIT0/9O7dlxzdoksfKXMf
RdiSCiFgmgJTqpXyfEcV7GUHCj9e0WdCSmDIH13bbuUpaTQXxO5d+XkzGwARAQAB
tDVKb2hhbm5lcyBTY2hsYXRvdyA8am9oYW5uZXMuc2NobGF0b3dAZ2Vub2RlLWxh
YnMuY29tPokCVAQTAQgAPhYhBBHurPU5I/pstoojMcciWBOKaz+1BQJgZbBuAhsD
BQkJZgGABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEMciWBOKaz+1L28P/R+T
usXX/AdgaTRSY3hFDVnhV+adcyFdmTKWey0lMUMWRGsALd1EIJbqk4HAA81jW68j
9XG/kZgkhGKz+vOwOD40Y6G6f1GfKIEknzWok5RgH4p0BT5+ZhbqfX3/Z6z0CsOD
mXAo1At9JvGmP6OnpHbCwutEa/KAB2fgrjjgGMZcBlDzIsBugbT+shEAE5et0b0J
TrsClqoO71wknMkNp0ijfvCT4VtiCq/UBD5XqYRtzDQC6dMic/dNXKp3JmcsYf17
DUNM7RVdVx+v9onWiUre9poVn9YgA/MYwVb4hMyjJEc9R8yQhENSJtdhX2pkXVF6
l4ONbkdaw3xJqVO1ouPBI68Ddirwfwk6kgvpkvJ+iCVQ2lWSvPbtrhmTGpeerfQD
vbFwtUX1OZhZma5Gq8n5r6VM7N29hQalYaKPBS9AoL3YBO51NsUwde/EmZydlYl6
C7Ny+2iuPgKCoXS2zAxM2t9Ar9K0ZhhaiEbSZHoT596M/cWnn483edt15CQZO5w0
QNBv5nNKh0J/GmM45TtbhUya9Cpc9Ad2SVYSlNB3KQgC/n+1UQm+8UHOBq/5nuC/
Ww2It8g1G9pkGijG/f7flh1qE7KqqYec3cMLWj8hHRYSak3omSYlt4aOJEQPinjo
XUw+WBi/Mjrnd6UxB6mNs0VADOHDrCmFBBHcfWIAiQEzBBABCAAdFiEEwNwMDXup
zMtoYvj6v6ZIQUWP8uIFAmBlu6wACgkQv6ZIQUWP8uKNqwf+IjqK19dU8zATB50s
x4aEqTF6U5J2xO4xiBJlWv55zewjmmOsjJZYKBJd4UzTHqG/0CRUiDzUmsn3q1o+
GEwC+bB/LQMi+MaSG4w901Hz2cZ/qXonHfOtISKxmW2wDcOlG8Xsds0X5gfLgIZv
4EYK+Nh1HqcEj2/RHRzfT8/WkDSC7AzSd8nuwQL03ZkAW5woh8vX5A/Fgj77mJb+
APi6flqnTXxsVnRLHP8ErWQ8Akg07xV5fsOt1bFpY0aKgw2HJCoFyPDzVR09QILo
Th3jiHBdNTlbd+Hb1kQJfIyhIpwkNRKBxdbM0wZoKdVMl7xiDMMDHkYpvNyBQTkJ
nug/1LkCDQRgZbBuARAAzwJSYFegsVTJxm/6N9gN3vcfbZkvxttQYhNefw2eog7a
UZq8Eog4LUuhDmuVt0CWZh5YOz7u4XwjxOzNk6fw630AKiWiNkYtiLYwPyT1tPcz
I0XI6EcIYShyOfVZ+egPUELkjdC+SVwIQttQCPpEYnzWjbg22n+XeNRUfAI4EGKj
H5bqhKx6sR2cmbB4FPUO1kpYoqhEVdk1wdZI7n93SDPSLsoJSO+xBMPj6HqfXeab
gvr3dpqNg05G5g5JQBznILEJBHZBuCfy01j7WNRftdwWCGfWAh53uq6ug1vilodd
T1jvWmIbFE66rljH+sbtkZwBuEbEDnwZxNK/g72aQkog3AeDljG1a8GjazN6/upe
JD8LfoE8gjlj9Ncg9eYvqnrGR3nv566i7cq7UO10Dl5d6bedpEIo2htm90AI3M8p
nmtAZ18cbQodwerFvdQcegdejlpYJmI/3xaPZQqPH0puhDpT3oA53ObmjPb12ztH
Za06+klrr1MYb+x4IQYAOO8wwVRY/+YS+YU+6mxePyPMUDJYnIgOcTkg04/O55MF
KghOumAY3KTFoE7VlWXrBbhE/MW+Owp8zbtyFovJbmo8H718JHBQwlxzd1cS2Fvd
7g7r5eqWZNl+bMJQmgA0ZTAI0gD5PJU+GJEhiky3e29H2tBKqozX539HCxdOJycA
EQEAAYkCPAQYAQgAJhYhBBHurPU5I/pstoojMcciWBOKaz+1BQJgZbBuAhsMBQkJ
ZgGAAAoJEMciWBOKaz+1y94QAMD//6IqvIQEvsmDsv0hDy/ryPgYA7+2gKQCrvsq
rdhXYrBYGwgUPAeuYKgIFQIE+UqFZDwMbZ38DozyXvg4QYTEYQtPOio5WZGMHsNa
VYXel8qOKAbSECuP6GFiyX+NsSKYzs+iQLCzzLJS2/N8U1TMbgOwpqcVovpKOHvE
XPTUTwnUP25ubY32ElslRACZ/REJIm1Ftmloef50qnFggfCQdSsjevl74Q2+QOHk
Nb5w+a+vM6CmTGM1kqEATSJfBkxS7jCnGH4H9t44cEYqECpOYm4eUjxpM/9rxMw8
itrVs8preL28zzgKydVLO1JAX4WAw+X1k1Q9EGcRcXRnlxptZ71Lgnv4qCshPAXk
Sm5acLgdoOOSDDCSGFtjenyDjoHWfDk22CBwmEtMDtQ02m0+IzkfpNizqKGHBpKm
/hsu36teJilJWdAQOmDyrb0VsRweWM+rqClq3GS1+r791836WxQlKvx0/eO0gZOP
QjQxOjeCzZ/H8h7HBZ4bwRjQzHGgIbl7k6WPIwmvM4vLQfB44YEi/zDW5ivBcDEo
2VnHwAC2EPiVRwhRB/9+I8U09Ngrg2SnO8MkgmZpob1amblnhItM1US8bq/KDKld
4sWgWcZO21jEqnEaep4n/9vaxvLHfFa7AYY2EbB+Dfrns80oAqHG78qFyzflnLxx
kLJD
=7iZV
-----END PGP PUBLIC KEY BLOCK-----

View File

@@ -362,6 +362,20 @@ in its 'LIBS' declaration and refers to the tools relative to
'$(BUILD_BASE_DIR)'.
Building additional custom targets accompanying library or program
==================================================================
There are cases when it is important to build additional targets
besides standard files built for library or program. Of course there
is no problem with writing specific make rules for commands that
generate those target files but for them to be built a proper
dependency must be specified. To achieve it those additional targets
should be added to 'CUSTOM_TARGET_DEPS' variable like e.g. in
iwl_firmware library from dde_linux repository:
! CUSTOM_TARGET_DEPS += $(addprefix $(BIN_DIR)/,$(IMAGES))
Automated integration and testing
#################################

View File

@@ -93,6 +93,24 @@ 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
~~~~~~~~~~~~~~~~~

View File

@@ -35,7 +35,7 @@ of them is briefly characterized as follows:
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
(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.
@@ -64,7 +64,7 @@ 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/drivers/_ subdirectory of source-code
repositories. The most predominant repositories hosting device drivers are
'os', 'dde_ipxe', 'dde_linux'.
@@ -72,23 +72,23 @@ repositories. The most predominant repositories hosting device drivers are
Platform devices
================
:'os/src/drivers/platform/': Platform drivers for various platforms.
:_os/src/drivers/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/drivers/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/smbios_decoder':
:_os/src/app/smbios_decoder/_:
A component that parses SMBIOS information on x86 platforms and makes the
result available as a report.
:'libports/src/app/acpica':
:_libports/src/app/acpica/_:
In addition to our ACPI base driver, the acpica component uses the
ACPICA library to provide access to dynamic functions like battery
states, events (e.g., notebook lid close and power buttons), as well
@@ -102,10 +102,10 @@ UART devices
The UART device drivers implement the UART-session interface.
:'os/src/drivers/uart/spec/pbxa9':
:_os/src/drivers/uart/spec/pbxa9/_:
Driver for the PL011 UART as found on many ARM-based platforms.
:'os/src/drivers/uart/spec/x86':
:_os/src/drivers/uart/spec/x86/_:
Driver for the i8250 UART as found on PC hardware.
@@ -115,60 +115,58 @@ 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/drivers/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/drivers/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
VersatilePB platform can be found at 'os/include/platform/vpb926/' and
compile time from a header file called _pl050_defs.h_. The version of the
VersatilePB platform can be found at _os/include/platform/vpb926/_ and
is made available to the driver via the SPECS machinery of the Genode build
system.
:'libports/src/drivers/framebuffer/vesa':
:_libports/src/drivers/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/drivers/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/drivers/framebuffer/pl11x/_:
Driver for the PL110/PL111 LCD display.
:'os/src/drivers/framebuffer/imx53':
:_os/src/drivers/framebuffer/imx53/_:
Driver for LCD output on i.MX53 SoCs.
:'os/src/drivers/framebuffer/rpi':
:_os/src/drivers/framebuffer/rpi/_:
Driver for the HDMI output of the Raspberry Pi.
:'os/src/drivers/framebuffer/sdl':
:_os/src/drivers/framebuffer/sdl/_:
Serves as both framebuffer and input driver on Linux using libSDL. This
driver is only usable on the Linux base platform.
:'os/src/drivers/gpu/intel':
:_os/src/drivers/gpu/intel/_:
An experimental Intel Graphics GPU multiplexer for Broadwell and newer.
:'dde_linux/src/drivers/framebuffer/intel':
:_dde_linux/src/drivers/framebuffer/intel/_:
Framebuffer driver for Intel i915 compatible graphic cards based on
the Linux Intel KMS driver.
:'dde_linux/src/drivers/usb':
USB driver that makes USB HID and USB storage devices available as an input
event stream and a block session respectively. For examples of using this
driver, refer to the run scripts at 'dde_linux/run/usb_hid' and
'dde_linux/run/usb_storage'.
:_dde_linux/src/drivers/usb_host/_:
USB host-controller driver that provides an USB session interface to
USB drivers.
:'dde_linux/src/drivers/usb_hid':
:_dde_linux/src/drivers/usb_hid/_:
USB Human Interface Device driver using the USB session interface.
Timer drivers
=============
The timer driver located at 'os/src/drivers/timer' implements the timer-session
The timer driver located at _base/src/timer/_ implements the timer-session
interface. Technically, it is both a device driver (accessing a timer
device) and a resource multiplexer (supporting multiple timer-session clients
at the same time). Depending on the base platform, the implementation uses
@@ -189,13 +187,13 @@ Audio drivers
=============
Audio drivers implement the Audio_out session interface defined at
'os/include/audio_out_session/' for playback and optionally the audio_in
_os/include/audio_out_session/_ for playback and optionally the audio_in
interface for recording.
:'os/src/drivers/audio/spec/linux':
:_os/src/drivers/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/drivers/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,77 +203,73 @@ Block drivers
=============
All block drivers implement the block-session interface defined at
'os/include/block_session/'.
_os/include/block_session/_.
:'os/src/drivers/sd_card/spec/pl180':
:_os/src/drivers/sd_card/spec/pl180/_:
Driver for SD-cards connected via the PL180 device as found on the PBX-A9
platform.
:'os/src/drivers/sd_card/spec/imx53':
:_os/src/drivers/sd_card/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':
:_os/src/drivers/sd_card/spec/rpi/_:
Driver for SD-cards connected to the Raspberry Pi.
:'dde_linux/src/drivers/usb':
USB driver that makes USB storage devices available as block sessions.
For an example of using this driver, refer to the run script at
'dde_linux/run/usb_storage'.
:'os/src/drivers/ahci':
:_os/src/drivers/ahci/_:
Driver for SATA disks and CD-ROMs on x86 PCs.
:'os/src/drivers/nvme':
:_os/src/drivers/nvme/_:
Driver for NVMe block devices on x86 PCs.
:'os/src/drivers/usb_block':
USB Mass Storage Bulk-Only driver using the USB session interface.
:_os/src/drivers/usb_block/_:
USB Mass Storage Bulk-Only driver using the USB session interface and provides
a block-session interface.
Network interface drivers
=========================
All network interface drivers implement the NIC session interface
defined at 'os/include/nic_session'.
defined at _os/include/nic_session/_.
:'os/src/drivers/nic/spec/linux':
:_os/src/drivers/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/drivers/nic/spec/lan9118/_:
Native device driver for the LAN9118 network adaptor as featured on the
PBX-A9 platform.
:'dde_ipxe/src/drivers/nic':
:_dde_ipxe/src/drivers/nic/_:
Device drivers ported from the iPXE project. Supported devices are Intel
E1000 and pcnet32.
:'dde_linux/src/drivers/wifi':
:_dde_linux/src/drivers/wifi/_:
The wifi_drv component is a port of the Linux mac802.11 stack, including the
iwlwifi driver. It enables the use of Intel Wireless 6xxx and 7xxx cards.
:'dde_linux/src/drivers/usb':
For the OMAP4 platform, the USB driver contains the networking driver.
:_dde_linux/src/drivers/usb_net/_:
USB network driver using the USB session interface.
:'dde_linux/src/drivers/nic/fec':
:_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':
:_os/src/drivers/gpio/spec/imx53/_:
Driver for accessing the GPIO pins of i.MX53 platforms.
:'os/src/drivers/gpio/spec/rpi':
:_os/src/drivers/gpio/spec/rpi/_:
Driver for accessing the GPIO pins of Raspberry Pi platforms.
Resource multiplexers
#####################
By convention, resource multiplexers are located at the 'src/server'
By convention, resource multiplexers are located at the _src/server/_
subdirectory of a source repository.
:Framebuffer and input: Framebuffer and input devices can be multiplexed using
@@ -285,35 +279,35 @@ subdirectory of a source repository.
service for input drivers, a capture service for output drivers, and a GUI
service for the applications. Each GUI session contains a virtual
framebuffer and a virtual input interface. Nitpicker (including a README
file) is located at 'os/src/server/nitpicker'.
file) is located at _os/src/server/nitpicker/_.
:Audio output: The audio mixer located at 'os/src/server/mixer' enables
: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.
:Networking: The NIC bridge located at 'os/src/server/nic_bridge' multiplexes
:Networking: The NIC bridge located at _os/src/server/nic_bridge/_ multiplexes
one NIC session to multiple virtual NIC sessions using a proxy-ARP
implementation. Each client has to obtain a dedicated IP address visible to
the physical network. DHCP requests originating from the virtual NIC sessions
are delegated to the physical network.
The NIC router located at 'os/src/server/nic_router' multiplexes one NIC
The NIC router located at _os/src/server/nic_router/_ multiplexes one NIC
session to multiple virtual NIC sessions by applying network address
translation (NAT).
:Block: The block-device partition server at 'os/src/server/part_block' reads
: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
script at 'os/run/part_block'.
script at _os/run/part_block.run_.
:File system: The VFS file-system server allows multiple clients to
concurrently access the same virtual file system. It is located at
'os/src/server/vfs'. The VFS can be assembled out of several builtin
_os/src/server/vfs/_. The VFS can be assembled out of several builtin
file-system types (like a RAM file system, or pseudo file systems for
various Genode session interfaces) as well as external plugins such as rump
(mounting file systems supported by the NetBSD kernel).
:Terminal: The terminal_mux service located at gems/src/server/terminal_mux
:Terminal: The terminal_mux service located at _gems/src/server/terminal_mux/_
is able to provide multiple terminal sessions over one terminal-client
session. The user can switch between the different sessions using a keyboard
shortcut, which brings up an ncurses-based menu.
@@ -328,130 +322,129 @@ one session interface to another, or in the form of libraries.
Separate components
===================
:'os/src/server/gui_fb':
:_os/src/server/gui_fb/_:
Translates a GUI session to a pair of framebuffer and input sessions.
Each 'gui_fb' instance is visible as a rectangular area on screen presenting
a virtual frame buffer. The area is statically positioned. For more
information, please refer to 'os/src/server/gui_fb/README'.
information, please refer to _os/src/server/gui_fb/README_.
:'gems/src/server/wm':
:_gems/src/server/wm/_:
Window manager that implements the GUI session interface but manages
each client view as a separate window. The window decorations are provided
by a so-called decorator (e.g., 'gems/src/app/decorator'). The behaviour
by a so-called decorator (e.g., _gems/src/app/decorator/_). The behaviour
is defined by a so-called window layouter such as the floating window
layouter located at 'gems/src/app/floating_window_layouter/'.
layouter located at _gems/src/app/floating_window_layouter/_.
:'demo/src/server/liquid_framebuffer':
:_demo/src/server/liquid_framebuffer/_:
Implements the same translation as 'gui_fb' but by presenting an interactive
window rather than a statically positioned screen area.
:'os/src/server/tar_rom':
:_os/src/server/tar_rom/_:
Provides each file contained in a tar file obtained via Genode's ROM session
as separate ROM session.
:'os/src/server/iso9660':
:_os/src/server/iso9660/_:
Provides each file of an ISO9660 file system accessed via a block session as
separate ROM session.
:'os/src/server/lx_fs':
:_os/src/server/lx_fs/_:
A file system server that makes the file system of a Linux base platform
available to Genode.
:'os/src/server/rom_block':
Provides the content of a ROM file as a block session, similar to the
loop-mount mechanism on Linux
:_os/src/server/vfs_block/_:
Provides the content of a file obtained from a VFS as a block session,
similar to the loop-mount mechanism on Linux
:'os/src/server/ram_block':
Provides the content of a RAM dataspace as a block session. In contrast
to 'rom_block', this server provides a writeable block device.
:'os/src/server/terminal_log':
:_os/src/server/terminal_log/_:
Adapter for forwarding LOG messages to a terminal session.
:'os/src/server/log_terminal':
:_os/src/server/log_terminal/_:
Adapter for forwarding terminal output to a LOG session.
:'os/src/server/fs_log':
:_os/src/server/fs_log/_:
Adapter that writes LOG messages to files on a file system.
:'demo/src/server/nitlog':
:_demo/src/server/nitlog/_:
Provides a LOG session, printing log output on screen via a GUI session.
:'os/src/app/rom_logger':
:_os/src/app/rom_logger/_:
The rom_logger component requests a ROM session and writes the
content of the ROM dataspace to the LOG.
:'os/src/server/rom_filter':
:_os/src/server/rom_filter/_:
The ROM filter provides a ROM module that depends on the content of
other ROM modules steered by the filter configuration, e.g., dynamic
switching between configuration variants dependent on the state of
the system.
:'os/src/server/log_terminal':
:_os/src/server/log_terminal/_:
Forwards terminal output to a LOG session.
:'gems/src/server/file_terminal':
:_gems/src/server/file_terminal/_:
Provides terminal sessions that target files on a file system.
:'gems/src/server/terminal':
:_gems/src/server/terminal/_:
Provides a terminal session via a graphical terminal using a framebuffer
session and an input session.
:'gems/src/server/tcp_terminal':
:_gems/src/server/tcp_terminal/_:
Provides one or multiple terminal sessions over TCP connections.
For further information, refer to 'gems/src/server/tcp_terminal/README'.
For further information, refer to _gems/src/server/tcp_terminal/README_.
:'os/src/server/terminal_crosslink':
:_os/src/server/terminal_crosslink/_:
The terminal crosslink service allows to terminal clients to talk to each
other.
:'gems/src/server/http_block':
:_gems/src/server/http_block/_:
A block service that fetches a virtual block device over the network from
a HTTP server.
:'os/src/server/fs_rom':
:_os/src/server/fs_rom/_:
A ROM service that translates the 'File_system' session interface to the
'ROM' session' interface. Each request for a ROM file is handled by looking
up an equally named file on the file system.
Please refer to 'os/src/server/fs_rom' for more information.
Please refer to _os/src/server/fs_rom/_ for more information.
For use cases where ROMs are known to be static, the
'os/src/server/cached_fs_rom' can be considered as a faster alternative to
_os/src/server/cached_fs_rom/_ can be considered as a faster alternative to
the regular 'fs_rom' server. Note that 'cached_fs_rom' is not supported
in base-linux though.
:'os/src/server/chroot':
:_os/src/server/chroot/_:
An intermediate file-system server that makes a sub directory of a file
system available as the root of a file system handed out to its client.
:'os/src/server/dynamic_rom':
:_os/src/server/dynamic_rom/_:
A simple ROM service that provides ROM modules that change in time according
to a configured timeline.
:'os/src/server/report_rom':
:_os/src/server/report_rom/_:
A service that implements both the report session interface and the ROM
session interface. It reflects incoming reports as ROM modules.
:'os/src/server/fs_report':
:_os/src/server/fs_report/_:
Report server that writes reports to file-systems
:'os/src/server/clipboard':
:_os/src/server/clipboard/_:
This component is both a report service and a ROM service. The
clients of the report service can issue new clipboard content, which
is then propagated to the clients of the ROM service according to a
configurable information-flow policy.
:'os/src/server/event_filter':
:_os/src/server/event_filter/_:
A component that transforms and merges input events from multiple sources
into a single event stream.
:'libports/src/app/acpi_event':
:_libports/src/app/acpi_event/_:
A component that transforms ACPI events into Genode input events.
:'gems/src/server/gui_fader':
:_gems/src/server/gui_fader/_:
A wrapper for nitpicker's GUI session interface that applies alpha-blending
to the of views a GUI client.
:_os/src/server/black_hole/_:
Mockup implementation of Genode session interfaces.
VFS plugins
===========
@@ -461,37 +454,37 @@ implement the VFS-plugin interface. They can be combined with any application
based on Genode's C runtime, with the VFS server, and with non-POSIX
components that use the Genode's VFS library directly.
:'gems/src/lib/vfs/trace':
:_gems/src/lib/vfs/trace/_:
A VFS plugin that makes core's TRACE service accessible as a pseudo
file system.
:'gems/src/lib/vfs/import':
:_gems/src/lib/vfs/import/_:
A VFS plugin that pre-populates a VFS with initial content.
:'gems/src/lib/vfs/pipe':
:_gems/src/lib/vfs/pipe/_:
A VFS plugin that provides bi-directional pipes for exchanging streamed
data between components.
:'gems/src/lib/vfs/ttf':
:_gems/src/lib/vfs/ttf/_:
A VFS plugin that makes rendered pixel data of the glyphs of Truetype fonts
available as a pseudo file system.
:'libports/src/lib/vfs/jitterentropy':
:_libports/src/lib/vfs/jitterentropy/_:
A VFS plugin that provides random numbers based on the jitter of executing
CPU instructions.
:'libports/src/lib/vfs/lwip':
:_libports/src/lib/vfs/lwip/_:
A VFS plugin that uses the light-weight IP (lwIP) stack to provide a
network socket interface as a pseudo file system.
:'dde_linux/src/lib/vfs/lxip':
:_dde_linux/src/lib/vfs/lxip/_:
A VFS plugin that uses the TCP/IP stack ported from the Linux kernel to
provide a network socket interface as a pseudo file system.
:'libports/src/lib/vfs/fatfs':
:_libports/src/lib/vfs/fatfs/_:
A VFS plugin that allows for the mounting of FAT-formatted block devices.
:'dde_rump/src/lib/vfs/rump':
:_dde_rump/src/lib/vfs/rump/_:
A VFS plugin that enables the use of NetBSD's file-system drivers such
as ext2 or msdos.
@@ -499,41 +492,41 @@ components that use the Genode's VFS library directly.
Libraries
=========
:'libports/lib/mk/libc':
:_libports/lib/mk/libc/_:
C runtime ported from FreeBSD.
:'libports/lib/mk/stdcxx':
:_libports/lib/mk/stdcxx/_:
Standard C++ library
:'libports/lib/mk/mesa_api':
:_libports/lib/mk/mesa_api/_:
Mesa OpenGL API with backends for software rasterization (egl_swrast)
and Intel Graphics (egl_i965)
:'libports/lib/mk/mupdf':
:_libports/lib/mk/mupdf/_:
PDF rendering engine.
:'libports/lib/mk/ncurses':
:_libports/lib/mk/ncurses/_:
Library for implementing pseudo-graphical applications (i.e., VIM) that
run on a text terminal.
:'libports/lib/mk/qt5_*':
:_libports/lib/mk/qt5_*/_:
Qt5 framework, using GUI session and NIC session as back end.
:'libports/lib/mk/vfs_jitterentropy.mk':
:_libports/lib/mk/vfs_jitterentropy.mk_:
A VFS plugin that makes a jitter-based random-number generator available
as a file within the process-local VFS.
:'libports/lib/mk/libarchive.mk':
:_libports/lib/mk/libarchive.mk_:
Library providing a common interface to a variety of archive
formats.
:'libports/lib/mk/lz4.mk':
:_libports/lib/mk/lz4.mk_:
Library for processing LZ4 lossless compression archives.
:'libports/lib/mk/liblzma.mk':
:_libports/lib/mk/liblzma.mk_:
Library for processing LZMA archives.
:'libports/lib/mk/libgcrypt.mk':
:_libports/lib/mk/libgcrypt.mk_:
GnuPG library for OpenPGP processing, e.g., signature verification.
@@ -541,100 +534,96 @@ Applications
############
Applications are Genode components that use other component's services but
usually do not provide services. They are typically located in the 'src/app/'
usually do not provide services. They are typically located in the _src/app/_
subdirectory of a repository. Most applications come with README files
located in their respective directory.
:'gems/src/app/backdrop':
:_gems/src/app/backdrop/_:
GUI client application that sets a composition of PNG images as desktop
background.
:'demo/src/app/launchpad':
:_demo/src/app/launchpad/_:
Graphical application for interactively starting and killing subsystems.
:'gems/app/launcher': Graphical launcher of Genode subsystems.
:'demo/src/app/scout':
:_demo/src/app/scout/_:
Graphical hypertext browser used for Genode's default demonstration scenario.
:'libports/src/test/mesa_demo':
Example programs for using the Mesa OpenGL graphics stack.
:'ports/src/app/arora':
Arora is a Qt-based web browser using the Webkit engine.
:'ports/src/app/gdb_monitor':
:_ports/src/app/gdb_monitor/_:
Application that allows the debugging of a process via GDB over a remote
connection.
:'libports/src/app/qt5/qt_launchpad':
:_libports/src/app/qt5/qt_launchpad/_:
Graphical application starter implemented using Qt.
:'libports/src/app/qt5/examples/':
:_libports/src/app/qt5/examples/_:
Several example applications that come with Qt.
:'os/src/app/sequence':
:_os/src/app/sequence/_:
Simple utility to serialize the execution of multiple components
:'ports/src/noux-pkg':
:_ports/src/noux-pkg/_:
Ports of popular commandline-based Unix software such as VIM, bash,
coreutils, binutils, gcc, findutils, and netcat. The programs are supposed
to be executed within the Noux runtime environment.
:'ports/src/app/lighttpd':
:_ports/src/app/lighttpd/_:
Lighttpd is a fast and feature-rich web server. The port of lighttpd uses
a file-system session to access the website content and the web-server
configuration.
:'os/src/app/trace_logger':
:_os/src/app/trace_logger/_:
Convenient, runtime-configurable frontend to the tracing facility.
:'os/src/app/rom_reporter':
:_os/src/app/rom_reporter/_:
The ROM-reporter component requests a ROM session and reports the
content of the ROM dataspace to a report session with the same label
as the ROM session.
:'os/src/app/log_core':
:_os/src/app/log_core/_:
Component transforming core and kernel output to Genode LOG output.
Package-management components
=============================
:'gems/src/app/depot_query':
:_gems/src/app/depot_query/_:
Tool for querying subsystem information from a depot.
:'gems/src/app/depot_download_manager':
:_gems/src/app/depot_download_manager/_:
Tool for managing the download of depot content.
:'gems/src/app/depot_deploy':
:_gems/src/app/depot_deploy/_:
Subsystem init configuration generator based on blueprints.
:'libports/src/app/fetchurl':
:_libports/src/app/fetchurl/_:
A runtime-configurable frontend to the libcURL library for
downloading content.
:'libports/src/app/extract':
:_libports/src/app/extract/_:
Tool for extracting archives using libarchive.
:'ports/src/app/verify':
:_ports/src/app/verify/_:
This component verifies detached OpenPGP signatures using libgcrypt.
Runtime environments
####################
:'ports/src/app/seoul': Seoul is a virtual-machine monitor developed for
:_ports/src/app/seoul/_: Seoul is a virtual-machine monitor developed for
the use with the NOVA platform. It virtualizes 32bit x86 PC hardware
including various peripherals.
:'os/src/server/loader': A service that allows the creation and destruction
:_os/src/server/loader/_: A service that allows the creation and destruction
of Genode subsystems via a session interface. For further information,
refer to 'os/src/server/loader/README'.
refer to _os/src/server/loader/README_.
:'ports/src/virtualbox': VirtualBox running on top of the NOVA hypervisor.
:_ports/src/virtualbox5/_: VirtualBox running on top of the NOVA hypervisor.
:'os/src/server/vmm': A virtual machine monitor that is based on
:_os/src/server/vmm/_: A virtual machine monitor that is based on
hardware-assisted virtualization of ARM platforms. It is supported on
the base-hw kernel only.
:_os/src/server/cpu_balancer/_: The CPU balancer intercepts the interaction
of components with core's low-level services to migrate threads dynamically
between CPU cores.

View File

@@ -4,6 +4,239 @@
===========
Genode OS Framework release 21.08 | 2021-08-31
##############################################
| The highlights of Genode 21.08 are revamped GPU support as well as new
| drivers for the Pinephone and MNT-Reform laptop based on a new streamlined
| approach for porting Linux kernel code. Further topics range from VirtualBox
| improvements, over media playback in the native web browser, to LTE
| connectivity in Sculpt OS.
For complex driver stacks, Genode largely relies on code ported from other
operating systems. The Linux kernel plays a special role because - being the
basis for Android - it is the de-facto reference for driving the peripherals
of most ARM SoCs. Up to now, however, the porting efforts of driver code from
Linux to Genode used to be a time-intensive affair, which forced a narrow
focus on very few SoCs on us. With the streamlined porting approach introduced
with the new release, we become able to dramatically reduce the costs,
creating the prospect of a much broader hardware support. The first success
stories of the new way of porting are added graphics drivers for the Pinephone
and the MNT-Reform laptop, a network driver for the Pine-A64-LTS board, and an
SD-card driver for the MNT-Reform.
The second spotlight of the release is the largely revamped support for Intel
GPUs. In contrast to our experimental GPU-related work of the past, we have
now identified a way to cleanly integrate GPU support into the GUI
architecture of sophisticated Genode systems such as Sculpt OS. This work is
accompanied with an up-to-date version of the Mesa library stack. In
combination with the improvements of our custom GPU multiplexer, we are now on
a good track to make the use of hardware-accelerated graphics a commodity on
Genode.
Even though most topics of the current release revolve around low-level
driver-related work, the new version improves higher-level functionality as
well. In particular, it adds the modular integration of mobile-data
connectivity to Sculpt OS and enables media playback for our port of the
Chromium web engine. Those and more topics are described in the detailed
[https:/documentation/release-notes/21.08 - release documentation of version 21.08...]
Genode OS Framework release 21.05 | 2021-05-31
##############################################
| Version 21.05 introduces webcam support, features an encrypted file vault
| for Sculpt OS, and adds new drivers for the i.MX8 SoC and Pine-A64.
| Furthermore, it is accompanied with a new tool chain based on GCC 10
| and new guidance documentation for driver development.
Device-driver support remains a prominent topic for almost every release.
The just released version 21.05 is no exception, touching hardware topics
ranging from USB, over I2C on i.MX8, over GPIO on Pine-A64, to networking on
RISC-V. Until now, such nitty-gritty driver-development work has been pursued
almost exclusively by the core team at Genode Labs. To encourage developers
outside the inner circle to join the fun, the release is accompanied with the
initial version of a comprehensive guidance documentation for
hardware-related topics.
Feature-wise the two highlights of the new version are webcam support and an
easy-to-use encrypted file store based on our custom CBE block encrypter.
As detailed by the release documentation, both features leverage Genode's
architecture in unique ways to attain high flexibility without an inflation of
complexity.
The release is rounded up by a new tool chain based on GCC 10 and Binutils
2.36, profound performance optimizations, framework refinements, and new
assistive tooling for porting Linux drivers. All the details of the new
version are covered by the official
[https:/documentation/release-notes/21.05 - release documentation of version 21.05...]
Sculpt OS 21.03 boots now in 2.5 seconds | 2021-05-03
#####################################################
| We have released an updated Sculpt 21.03 image featuring several
| hardware-compatibility tweaks and performance improvements.
Since the official Sculpt OS 21.03 release end of March, we continued our
efforts with refining the user experience and broadening hardware
compatibility, thanks to the user feedback we received. We have now released
an updated system image that includes those refinements as well as several
performance optimizations that boost the boot time of Sculpt to less than 2.5
seconds from the first life sign of the kernel to the graphical user
interface (measured on a 5-years old Lenovo x250 laptop).
You can get the new version of the system image named sculpt-21-03b at the
[https://genode.org/download/sculpt - Sculpt OS download] page.
It is binary compatible with the original release version. So you can use it
as a drop-in-replacement.
For manually reproducing the image, please refer to the corresponding
[https://github.com/chelmuth/genode/commits/sculpt_21_03b - Git branch].
Sculpt OS release 21.03 | 2021-03-24
####################################
| Version 21.03 of the Sculpt operating system makes the system resilient
| against classes of driver failures, adds configurable real-time priorities,
| and introduces interfaces for screen capturing and user-event injection.
Sculpt OS 21.03 incorporates the many improvements of the latest two Genode
releases. Thanks to Genode's concept of
[https://genode.org/documentation/release-notes/21.02#Pluggable_network_device_drivers - pluggable device drivers],
the system has reached a new level of robustness against malfunctioning
drivers. For example, if the Intel graphics driver trips over an unsupported
external display, the driver gets automatically restarted while all graphical
applications keep running. Or as another example, should the overly complex
Wifi driver have a hick-up, it can be restarted with a simple mouse click
without harming the networking stacks running on top.
Even though Genode supports static-priority scheduling since more than a
decade, Sculpt did not make this feature available to end users so far. The
new version changes that. For each component, the user can now take a
deliberate decision about the hard scheduling priority, e.g., prioritizing
latency-critical multi-media applications over computational workloads or
virtual machines.
Speaking of workloads, to push the limits of what is possible with Sculpt OS,
the new version introduces additional interfaces that can be assigned to
components. First, it has become possible to redirect the interaction of a
component with the kernel through another component, thereby enabling features
like dynamic CPU-load balancing to be implemented as plain user-level
services. Second, there are new interfaces for capturing the screen and for
injecting input events. The latter interfaces pave the ground for virtual
keyboards, screen-sharing application, or remote administration scenarios.
Under the hood, there are plenty of improvements that make the life of
Sculpt users better. The keyboard layout can now be picked from a menu.
The Chromium-based Falkon web browser runs circles around the previous
version. Menu items and file lists appear nicely sorted. Terminal windows
immediately respond to global font-size changes. On modern Intel machines,
Sculpt leverages Intel Hardware P-states (HWP) for power and thermal
management now. You can find an illustrated tour of these and more changes in
a dedicated
[https://genodians.org/nfeske/2021-03-24-sculpt-os - article at Genodians.org].
The updated [https://genode.org/documentation/articles/sculpt-21-03 - manual]
goes into detail about the use of the new system.
The ready-to-use system image for version 21.03 is available at the
[https://genode.org/download/sculpt - Sculpt download page].
Genode OS Framework release 21.02 | 2021-02-25
##############################################
| The highlights of version 21.02 are the addition of VirtualBox 6,
| mobile-data connectivity via LTE, pluggable network drivers, initial
| 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
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
schemes.
For PC hardware, the flagship feature of version 21.02 is the addition of
VirtualBox 6, giving us the prospect to eventually replace the aging port of
VirtualBox 5. Speaking of VirtualBox, the release comes with profound
improvements of the USB-device pass-through abilities, most importantly
covering audio headsets.
Besides these prominent features, the new version comes with many further
improvements. Just to name a few, virtual machines on ARM have become
able to provide VirtIO-block devices to guests, named pipes can now
be used to connect components, Genode's RISC-V support received an
update to ISA spec 1.10, and OpenSSL has been bumped to version 1.1.1.
For the full story, please refer to the
[https:/documentation/release-notes/21.02 - release documentation of version 21.02...]
Road Map for 2021 | 2021-01-15
##############################
| 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
[https://genode.org/community/mailing-lists - mailing list],
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
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
a top priority this year. The opportunities are plenty, ranging from
micro-optimizations, over API refinements, to architectural changes if
needed.
Another recurring topic is the request for GPU support, which is required
by many modern workloads such as video conferencing or streaming on mobile
device. Therefore, we will revamp our past developments of GPU multiplexing
on Intel hardware while also starting the investigation of GPUs on ARM-based
devices.
More information about our review of the past year, this year's focus, and a
rough schedule are presented at our official
[https:/about/road-map - road-map page].
Genode OS Framework release 20.11 | 2020-11-27
##############################################
| Genode 20.11 brings Sculpt OS to 64-bit ARM hardware, introduces dynamic
| CPU-load balancing, and enables multicore virtualization on ARM. Driver-wise,
| the release improves audio on PC hardware, and adds VirtIO networking support.
ARM 64-bit has been a recurring theme of the Genode releases this year and the
just released version 20.11 is no exception. We are proud to announce that our
Genode-based custom general-purpose OS called Sculpt has come to life on
64-bit ARM hardware, namely the NXP i.MX8 EVK board. This is the result of
intensive work on the framework's driver architecture for ARM and several
SoC-specific device drivers. Closely related to this line of work is the new
ability to run multicore virtual machines on ARM.
Another highlight of version 20.11 is a new CPU balancing mechanism, which
automates the dynamic assignment of threads to CPU cores for complex
workloads. With traditional operating systems, such policies are normally part
of the OS kernel. Thanks to Genode's component architecture, we are able to
implement such potentially complex policies in the form of an optional
component, which offers ultimate flexibility while keeping the kernel
untainted by complex heuristics.
Further topics of the current release are improved power management and audio
support on PC hardware, a new OSS API emulation that allows for the
reuse of popular audio applications on Genode, and new support for VirtIO
networking. The full picture is given by the
[https:/documentation/release-notes/20.11 - release documentation of version 20.11...]
Sculpt OS release 20.08 | 2020-09-17
####################################
@@ -181,7 +414,7 @@ please consult the
Road Map for 2020 | 2020-01-20
##############################
| In 2019, we will be concerned about dwarfing the barrier of entry into
| In 2020, we will be concerned about dwarfing the barrier of entry into
| the Genode world.
Following the last year's leitmotif of "bridging worlds", we turn our
@@ -2924,7 +3157,7 @@ applications, most prominently, it serves as the foundation of the KDE project.
Since the release 9.05, the official distribution of Genode supports Qt4 as a
regular feature. The document "Portierung von Qt auf Genode" _(german)_
describes the challenging endeavor of porting this high-complexity C++
framework to Genode. Major problems to overcome had been the missing C libary
framework to Genode. Major problems to overcome had been the missing C library
(at the time when the project started), the integration of the Qt4 project
files with Genode's build system, the adaption of Qt4 to the basic primitives
provided by Genode, and the integration of Qt4 with Genode's GUI. In addition

View File

@@ -34,10 +34,10 @@ like swapping out or updating drivers on the fly without reboot.
Besides these main topics, the current release features the continuation of of
two long-term projects, namely the CBE block encrypter and the profound
support of 64-bit ARM devices.
Section [Consistent Block Encrypter] describes the CBE's new *pluggable
crypto* and trust anchor facilities.
Section [Device drivers] goes into detail about the steadily emerging *driver
landscape on 64-bit ARM*.
Section [Consistent Block Encrypter] describes the CBE's new *pluggable crypto*
and trust anchor facilities.
Section [Device drivers] goes into detail about the steadily
emerging *driver landscape on 64-bit ARM*.
The GUI stack, restacked
@@ -423,8 +423,8 @@ C runtime
Serialized VFS access
~~~~~~~~~~~~~~~~~~~~~
Unsurprisingly, the VFS is an integral part of the C runtime as _everything is
a file_ in the UNIX philosophy. The basis for the libc VFS is the VFS library
Unsurprisingly, the VFS is an integral part of the C runtime as _everything is_
_a file_ in the UNIX philosophy. The basis for the libc VFS is the VFS library
and its versatile plugin concept. As the libc (and other users of the library)
may employ multiple threads, which could use the VFS, the integrity of data
structures, esp. those of more complex plugins like the network stack in

629
doc/release_notes/20-11.txt Normal file
View File

@@ -0,0 +1,629 @@
===============================================
Release notes for the Genode OS Framework 20.11
===============================================
Genode Labs
With Genode 20.11, we focused on the scalability of real-world application
workloads, and nurtured Genode's support for 64-bit ARM hardware. We thereby
follow the overarching goal to run highly sophisticated Genode-based systems
on devices of various form factors.
When speaking of real-world workloads, we acknowledge that we cannot always
know the exact behavior of applications. The system must deal gracefully with
many unknowns: The roles and CPU intensity of threads, the interplay of
application code with I/O, memory-pressure situations, or the sudden fragility
of otherwise very useful code. The worst case must always be anticipated. In
traditional operating systems, this implies that the OS kernel needs to be
aware of certain behavioral patterns of the applications, and has to take
decisions based on heuristics. Think of CPU scheduling, load balancing among
CPU cores, driving power-saving features of the hardware, memory swapping,
caching, and responding to near-fatal situations like OOM.
Genode allows us to move such complex heuristics outside the kernel into
dedicated components. Our new CPU balancer described in Section
[CPU-load balancing] is a living poster child of our approach. With this
optional component, a part of a Genode system can be subjected to a CPU-load
balancing policy of arbitrary complexity without affecting the quality of
service of unrelated components, and without polluting the OS kernel with
complexity.
A second aspect of real-world workloads is that they are usually *not*
designed for Genode. To accommodate the wealth of time tested applications, we
need to bridge the massive gap between APIs of olde (think of POSIX) and
Genode's clean-slate interfaces.
Section [Streamlined ioctl handling in the C runtime / VFS] shows how the
current release leverages our novel VFS concept for the emulation of
traditional ioctl-based interfaces. So useful existing applications come to
live without compromising the architectural benefits of Genode.
Platform-wise, the new release continues our mission to host Genode-based
systems such as [https://genode.org/download/sculpt - Sculpt OS] on 64-bit
ARM hardware. This work entails intensive development of device drivers and
the overall driver architecture.
Section [Sculpt OS on 64-bit ARM hardware (i.MX8 EVK)] reports on the
achievement of bringing Sculpt to 64-bit i.MX8 hardware. This line of work
goes almost hand in hand with the improvements of our custom virtual machine
monitor for ARM as outlined in Section [Multicore virtualization on ARM].
CPU-load balancing
##################
Migrating load over CPUs may be desirable in dynamic scenarios, where the
workload is not known in advance or too complex. For example, in case of POSIX
software ported to Genode, amount and roles of threads and processes can
generally not planned for. With the current release, we add an optional CPU
service designated for such dynamic scenarios. The new component called
[https://genodians.org/alex-ab/2020-11-16-cpu-balancer - CPU balancer] is able
to monitor threads and their utilization behaviour. Depending on configured
policies, the balancer can instruct Genode's core via the CPU session
interface to migrate threads between CPUs.
[image cpu_balancer]
The CPU balancer intercepts the interaction of a Genode subsystem
(workload) with core's low-level CPU service.
This feature requires a kernel that supports thread migration, which are
Fiasco.OC, seL4, and to some degree the NOVA kernel. For the NOVA kernel,
solely threads with an attached scheduling context can be migrated, which are
'Genode::Thread' and POSIX pthread instances. Genode's entrypoint and virtual
CPU instances are not supported.
The feature can be tested by the scenario located at _repos/os/run/cpu_balancer.run_.
Further information regarding policy configuration, a demo integration into
Sculpt 20.08, and a screencast video are available as a dedicated
[https://genodians.org/alex-ab/2020-11-16-cpu-balancer - CPU balancer]
article.
Sculpt OS on 64-bit ARM hardware (i.MX8 EVK)
############################################
Within the last year, a lot of effort was put into Genode's support for ARM
64-bit hardware. A consequent next step was to port Sculpt OS to the i.MX8 EVK
board, which we have used so far as reference platform. With the current
release, we proudly present the first incarnation of Sculpt OS for this board.
In contrast to the original x86 PC variant, this first ARM version ships with
a static set of devices inside the drivers subsystem. No device manager
component probes for the used hardware and starts drivers on demand. Instead,
the set of drivers defined in the _drivers_managed-imx8q_evk_ package enables
USB HID devices to make use of mouse and keyboard peripherals connected to the
board. It drives the SD-card, which can be used as storage back end for
Genode's depot package management. Finally, it contains drivers to manage the
display engine and the platform's device resources.
With Sculpt OS for ARM 64-bit, we not only aim for classical desktop/notebook
systems - like on x86 - but also for embedded consumer hardware like phones
and tablets. In order to leverage this goal, we enabled support for
[https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-8-series-accessory-boards:i.MX8-ACCESSORY-BOARDS - NXP's MX8_DSI_OLED1]
display on the i.MX8 platform on Genode. The panel features an OLED display as
well as a Synaptics RMI4 compliant touch screen.
Genode's i.MX8 display driver that we released with version
[https://genode.org/documentation/release-notes/20.02#Display_engine - 20.02]
supported HDMI devices only, whereas the OLED display is connected via
[https://www.mipi.org/specifications/dsi - MIPI DSI] to the SoC. Therefore, we
extended the display driver by the MIPI DSI infrastructure as well as the
actual driver for the OLED display. This endeavor turned out to be a very
rocky one, which we have documented in detail on our
[https://genodians.org/ssumpf/2020-09-30-mipi_touch - Genodians] website.
[image imx8_oled]
The administrative user interface of Sculpt OS responds to touch input.
In order to enable the touch screen device, we implemented a new Genode
component from scratch. The touch screen is connected via an I2C bus to the
SoC where data can be sent to and received from. At the moment, the I2C
implementation is hidden within the driver but as more devices require I2C
access, it will eventually become a standalone component. Interrupts are
delivered via GPIO pins from the touch screen to the SoC, which made it
necessary to enable i.MX8 support within Genode's generic i.MX GPIO driver. We
took this as an opportunity to streamline, cleanup, and make the driver more
robust. Additionally, all driver components now take advantage of the new
platform driver API for ARM that has been introduced with release
[https://genode.org/documentation/release-notes/20.05#New_platform_driver_for_the_ARM_universe - 20.05].
In its current incarnation, the driver for the display management is not able
to switch in between HDMI or MIPI-DSI connected displays dynamically.
Therefore, the display to be used in Sculpt has to be configured in the
framebuffer configuration manually. By default the HDMI connector is used.
Beyond the driver subsystem, there are few components dependent on the actual
hardware, which is why the look & feel of the Sculpt desktop does not actually
differ from the x86 PC version, with the following exceptions:
When you select the network configuration dialog, you'll have no "Wifi" option
because of the missing hardware. However, the "Wired" option allows you to
start the corresponding driver for the i.MX FEC Ethernet device. The second
difference to the Sculpt OS x86 PC variant is the absence of a virtual machine
solution at the moment. Although Genode comprises a mature
virtual-machine-monitor solution for ARM - see
Section [Multicore virtualization on ARM] - it still lacks a reasonable
storage back end. Therefore, we left virtualization out of the picture for
now. Lastly, there is no possibility to use USB block devices, because the
required management component - a driver manager for i.MX8 - does not exist
yet. We plan to bridge these remaining few gaps compared to the x86 version
with the upcoming Genode releases.
To give Sculpt a try on the i.MX8 EVK board, you have to start the well-known
Sculpt run-script as usual, but for the base-hw kernel. For example:
! tool/create_builddir arm_v8a
! cd build/arm_v8a
! make run/sculpt KERNEL=hw BOARD=imx8q_evk
Under the hood, the run script requests a sculpt-<board> specific package from
the depot package system. Currently, _sculpt-pc_ and _sculpt-imx8q_evk_ are
available.
Multicore virtualization on ARM
###############################
The written-from-scratch virtualization solution for Genode on ARMv8 entered the
picture exactly one year ago with
[https://genode.org/documentation/release-notes/19.11#Virtualization_of_64-bit_ARM_platforms - release 19.11].
Since then, a couple of improvements and validations have been incorporated
into it. Support for VirtIO network and console models had been added.
Moreover, it got streamlined with our prior existing ARMv7 hypervisor and
virtual-machine monitor (VMM). But although the architecture of the VMM was
designed from the very beginning with more than one virtual-CPU (VCPU) in
mind, running a VM on multiple cores had not been addressed nor tested.
With this release, we enhance the virtualization support of the base-hw
kernel, acting as the ARM hypervisor, to support multicore virtual machines.
The VMM implementation got extended to start an entrypoint for each VCPU owned
by a VM. The affinities of those entrypoints are configured to distribute over
all physical CPUs available to the VMM. The affinity of an entrypoint that
handles events of a VCPU is automatically used as the affinity of the VCPU
itself. Whenever a VCPU exit needs to be handled, this is delegated to the VMM
entrypoint running on the same CPU. Once the VMM's entrypoint successfully
handled the exit reason, it resumes the VCPU.
Formerly, the control to start or stop a VCPU was implemented by core's VM
service that runs on the first CPU. But that implied that all different VMM
entrypoints running on distinct CPUs would have needed to frequently call
core's service entrypoint on the first CPU, inducing costly cross-CPU
communication. This is amplified by the fact that core's entrypoint uses a
system call to instruct the kernel's internal scheduler of the corresponding
target CPU, which again would potentially target a remote CPU. For simplifying
the implementation and for improving performance, we slightly extended the
VM-session interface to return a kernel-specific capability addressing a VCPU
directly. With this capability, a VMM's entrypoint is able to directly call
the kernel to start or stop a VCPU instead of using the indirection over core.
However, the detail whether the kernel is called directly or not is hidden
behind the VM session client API and transparent to the user.
Base framework and OS-level infrastructure
##########################################
C runtime
=========
We improved the support for aligned memory allocations to fix sporadic memory
leaks, which occurred with our port of the Falkon web browser. One relevant
change is the implementation of the 'posix_memalign()' function, another
change is that the address alignment of anonymous 'mmap()' allocations is now
configurable like follows:
! <config>
! <libc>
! <mmap align_log2="21"/>
! </libc>
! </config>
Standard C++ library
====================
Even though Genode uses C++ as its primary programming language, we do not
rely on or make use of any C++ standard library within the Genode OS
framework. However, since a C++ STL is a vital part of application programming
with C++, we provide one for applications built on top of the base framework;
in particular the GNU C++ STL library (_libstdc++_). It is treated as a
regular 3rd party library and its functionality is extended on demand. This
approach worked well enough to even enable larger C++-based software like Qt5
and Chromium's Blink engine (as part of QtWebEngine) to run on Genode. That
being said, for developers using _libstdc++_ on Genode, it is not immediately
clear, which features are supported and which are not.
Fortunately, _libstdc++_ includes a testsuite that - as the name suggests -
allows for testing the range of functionality of the library on a given
platform. So we turned to it to establish a base line of supported features.
We were particularly interested in how our port behaves when C++17 is
requested. It goes without saying that this only includes the aspects, which
are specifically probed by the testsuite. Rather than adding thorough Genode
support to the testsuite, we opted for providing an
[https://github.com/cnuke/genode-libstdcxx-testsuite/ - environment] that
mimics the common 'unix' target and allows us to execute the testsuite on
the Linux version of Genode via a regular Linux host OS. It uses the Genode
tool chain to compile the tests and spawns a Genode base-linux system to
execute them.
Executing the testsuite was an iterative process because in the beginning, we
encountered many falsely failed tests. On one hand, most of them were due to
the way C++ is applied in Genode or rather how our build system works
internally. For one, _libsupc++_ on Genode is part of the _cxx_ library. This
library in turn is part of _ldso.lib.so_, the dynamic linker that provides
the base API. As the build system uses stub libraries generated from 'symbol'
files containing the ABI of a given shared object, each missing symbol must
be made available. Otherwise the linking step is going to fail complaining
about undefined references because components use these stub libraries
during compilation. On the other hand, we had to get cozy with the testsuite's
underlying test framework in order to get our test environment straight.
In case of the testsuite, there were a lot of symbols missing because we did
not encounter them so far in our workloads, and thus, were not part of the
symbols file. After all, templates will always generate specific symbols that
are difficult to foresee. Besides that, we lacked support for aligned 'new'
and 'delete' operators. With these adaptions in place, we were able to
successfully execute the testsuite.
In the end, the results paint a good picture. The current short-comings boil
down to
* Support for the *stdc++fs* library is not available as the library is
not ported yet.
* Proper *locale* support in the 'libc' as well as 'stdc++' is not available.
* Support for parallel operations with *openmp* is not available.
* Various subsystems ('std::thread', 'std::random_device', numerics library)
need further attention for proper functionality. This is most prominent
for the failing execution tests where sometimes the threads appear to
get stuck.
These findings are documented at issue
[https://github.com/genodelabs/genode/issues/3925 - 3925].
Consistent Block Encrypter (CBE)
================================
The CBE is a library for the management of encrypted block-devices that is
entirely written in SPARK. It was first announced and integrated with
[https://genode.org/documentation/release-notes/19.11#Preliminary_block-device_encrypter - Genode 19.11],
reached feature-completeness with
[https://genode.org/documentation/release-notes/20.05#Feature-completeness_of_the_consistent_block_encrypter - Genode 20.05],
and has received a highly modular back-end system with version
[https://genode.org/documentation/release-notes/20.08#Consistent_Block_Encrypter - 20.08].
For this release, we thoroughly streamlined the CBE repository, added enhanced
automated quality assurance, and switched to another default encryption
back end.
Repository restructuring
------------------------
Generally speaking, the [https://github.com/m-stein/cbe - CBE repository] has
been freed from everything that is not either part of the SPARK-based core
logic (cbe, cbe_common, and the hashing algorithm), the essential SPARK-based
tooling (initialization, checking), or the Ada-based C++ bindings (*_cxx
libraries). The whole Genode-specific integration, testing, and packaging
moved to Genode's 'gems' repository and the former Genode sub-repository 'cbe'
was replaced by the new CBE port _gems/ports/cbe.port_. We also took the
opportunity to remove many unused remnants of earlier development stages and
to drastically simplify the ecosystem of CBE-related packages.
We hope that this allows for certain characteristics of the CBE project, like
its strong OS-independence or a completely "flow-mode"-provable core logic to
become more clear, while at the same time, the Genode-specific accessories can
benefit from being part of Genode's mainline development.
Automated testing, benchmarking, and proving
--------------------------------------------
The CBE tester is a scriptable environment meant for testing all aspects of
the CBE library and its basic tooling. Through its XML command interface, one
can not only access and validate data of CBE devices but also initialize them,
check their consistency, analyze their meta data, execute performance
benchmarks, manage device snapshots, perform online re-keying or online
re-dimensioning of devices, and, last but not least, manage the required Trust
Anchors.
Before this release, the CBE tester was a mere patchwork solution and many of
the above mentioned features were limited or even missing. For instance block
access was issued only in a synchronous fashion, the Trust-Anchor was managed
implicitly, and validating read data wasn't possible. Besides adding the
missing features, we also reworked the component entirely to follow a clean
and comprehensible implementation concept. The new CBE tester comes together
with the run script _gems/run/cbe_tester.run_ that shall serve as both a
demonstration how to use the tester and an extensive automated test and
benchmark for the CBE.
Furthermore, we created the CBE-specific autopilot tool _tool/cbe_autopilot_
that is meant to establish a common reference for the quality of CBE releases
as well as for their integration in Genode. Running the tool without arguments
will give instructions how to use it. In a nutshell, when running
'tool/cbe_autopilot basics', the tool will GNAT-prove what is expected to be
provable, run all CBE-related run scripts expected to work, and build all
CBE-related packages (existing build and depot directories are not touched in
this process). The idea is to make the successful execution of the test
mandatory before advancing the master branch of the CBE repository or
releasing a new version of the integration in Genode. A handy side-feature of
the tool is that one can run 'tool/cbe_autopilot prove' to do only the
GNAT-proving part. With 'tool/cbe_autopilot clean' finally, the tool cleans up
all of its artifacts.
Libcrypto back end for block encryption
---------------------------------------
The introduction of VFS plugins for CBE back ends in the previous Genode
release made it much easier to interchange concrete implementations. This
motivated us to play around a bit in our endeavour of optimizing execution
time. It turned out that especially the choice of the block-encryption back
end has a significant impact on the overall performance of CBE block
operations. It furthermore seemed that especially the 'libsparkcrypto'
library, our former default for block encryption, prioritizes other qualities
over performance.
That said, in general, we want to enable an informed user to decide for him-
or herself which qualities one prefers in such an algorithm. The VFS plugin
mechanism pays tribute to this. And it also seems very natural to us to
combine a SPARK-based block-device management with a SPARK-based encryption
back-end like 'libsparkcrypto'. But for our default use case, we came to the
conclusion that the 'libcrypto' library might be a better choice.
Streamlined ioctl handling in the C runtime / VFS
=================================================
The Genode release
[https://genode.org/documentation/release-notes/19.11#C_runtime_with_improved_POSIX_compatibility - 19.11]
introduced the emulation of ioctl operations via pseudo files. This feature
was first used by the Terminal. With the current release, we further employ
this mechanism for additional ioctl operations, like the block-device related
I/O controls, as the long-term plan is to remove the notion of ioctl's from
the 'Vfs::File_io_services' API all-together.
We therefore equipped the block VFS-plugin with a compound directory hosting
the pseudo files for triggering device operations:
:info: This file contains the device information structured as 'block'
XML node having 'size' and 'count' attributes providing the used block size
as well as the total number of blocks.
:block_count: contains the total number of blocks.
:block_size: contains the size of one block in bytes.
Furthermore, we split the existing 'ioctl' handling method in the libc into
specific ones for dealing with terminals and block devices because at some
point more different groups of I/O controls are to follow.
The first one to follow is the 'SNDCTL' group. This group deals with audio
devices and corresponds to the standard set by the OpenSoundSystem (OSS)
specification years ago. In the same vein as the terminal and block I/O
controls, the sound controls are implemented via property files.
The controls currently implemented are the ones used by the OSS-output plugin
of [https://cmus.github.io/ - cmus], the driving factor behind the
implementation, which uses the (obsolete) version 3 API.
At the moment, it is not possible to set or rather change any parameters. In
case the requested setting differs from the parameters of the underlying
audio-out session - in contrast to the suggestion in the OSS manual - we do
not silently adjust the parameters returned to the callee but let the I/O
control operation fail.
The following list contains the currently handled SNDCTL I/O controls:
:SNDCTL_DSP_CHANNELS: sets the number of channels. We return the available
channels here and return ENOTSUP if it differs from the requested number of
channels.
:SNDCTL_DSP_GETOSPACE: returns the amount of playback data that can be written
without blocking. For now it amounts the space left in the stream buffer of
the audio-out session.
:SNDCTL_DSP_POST: forces playback to start. We do nothing and return success.
:SNDCTL_DSP_RESET: is supposed to reset the device when it is active before
any parameters are changed. We do nothing and return success.
:SNDCTL_DSP_SAMPLESIZE: sets the sample size. We return the sample size of the
underlying audio-out session and return ENOTSUP if it differs from the
requested format.
:SNDCTL_DSP_SETFRAGMENT: sets the buffer size hint. We ignore the hint and
return success.
:SNDCTL_DSP_SPEED: sets the sample rate. For now, we always return the rate of
the underlying audio out session and return ENOTSUP if it differs from the
requested one.
The libc extension is accompanied by an OSS VFS plugin that gives access to an
audio-out session by roughly implementing an OSS pseudo-device. It merely
wraps the session and does not provide any form of resampling or re-coding of
the audio stream.
[image cmus]
Image [cmus] depicts how the various pieces work together in a real-world
scenario. The interplay of the extended libc with the OSS VFS plugin allows
for listening to MP3s - for the time being the format is restricted to
44.1kHz/16bit - on Sculpt using the [https://cmus.github.io/ - cmus]
audio player.
The current state serves as a starting point for further implementing the OSS
API to cover more use cases, especially with ported POSIX software like
VirtualBox and Qt5 or even as SDL2 audio back end. While showing its age, OSS
is still supported by the majority of middle ware and makes for a decent
experimentation target.
Device drivers
##############
VirtIO support
==============
Thanks to the remarkable contribution by Piotr Tworek, the Genode OS framework
has become able to drive VirtIO network devices.
He did not only provide a single VirtIO network driver but a framework to
easily add more VirtIO driver classes in the future. Either the devices are
connected as PCI devices or directly as platform devices with fixed
memory-mapped I/O addresses. The framework supports both and abstracts away
from the concrete connection type.
The VirtIO network driver enables networking for Genode when using the
'virt_qemu' board on either the ARMv7a or ARMv8a architecture. However, the
VirtIO device configuration on Qemu is dynamic. The order and presence of
different command line switches affect the bus address and interrupt
assignment of each device. To make the use of Genode with Qemu robust in
changing environments, a tiny helper component was supplemented. This
component named 'virtdev_rom' probes the memory-mapped I/O areas of the system
bus and detects available and known VirtIO devices. The results are provided
in the form of a configuration that can be consumed by the platform driver to
assign the correct device resources to the corresponding VirtIO driver.
The VirtIO network driver in action, as well as the interplay of the platform
driver and the 'virtdev_rom' component can be observed when using the
'drivers_nic-virt_qemu' package.
Improved support for OpenBSD audio drivers
==========================================
So far, the supported drivers exclusively used PCI as transport bus and for
practical reasons, the emulation environment was tied to it. The bus handling
has now moved into its own compilation unit to make future addition of drivers
that employ other transport buses easier. On the same account, the component
got renamed to 'pci_audio_drv' to reflect its bus connection.
While at it, the execution flow of the component got adapted. The kernel code
should have been executed within the context of the main task like it is done
in the DDE Linux drivers. The initial port of the HDA driver, however, called
the code directly from within the session as there was no immediate reason to
use a task context because suspending the execution was not needed. When using
USB devices, that is no longer possible as we have to suspend the execution
during the execution of the kernel code. So we pass in the audio data and
schedule the emulated BSD kernel code.
The above mentioned changes are mostly preliminary clean-up work for the
upcoming support of USB audio devices.
Furthermore, we implemented timeout handling in the driver and use Genode's
timeout framework API to schedule timeouts and for providing the current time.
For now there is only one timeout - the unsolicited Azalia codec event - and
therefore the timeout queue consists of solely one timeout object. Those
events are important for detecting plugged in headphones.
Supporting headphones was further refined by accounting for the situation
where the driver is started while headphones are already plugged in and the
mixer needs to be configured accordingly. In particular, on the Fujitsu S938
the driver lacked the proper quirk for switching between the internal and
external microphone.
In addition to the changes made to the audio driver component, the behaviour
of the audio mixer was adjusted with regard to handling the configuration
of a new session. The mixer now applies the settings already stored in its
configuration to new sessions instead of only reporting them. In case of
Sculpt, where an existing launcher already contains a valid configuration,
that allows for setting the volume levels appropriately for known sessions
prior to establishing the connection.
Retiring the monolithic USB driver
==================================
With [https://genode.org/documentation/release-notes/18.08#Decomposed_USB_stack - release 18.08],
a componentized USB stack got introduced next to our time-tested monolithic
USB driver. With the current release, the driver manager as used by Sculpt OS
switched to use the new USB stack in order to benefit from the de-composition
and from more supported USB devices. The monolithic driver was still based on
an older DDE-Linux revision compared to the componentized version. This step
paves the ground to retire the monolithic USB driver with the next Genode
release and will improve the number of supported USB devices with the upcoming
Sculpt OS release.
Platforms
#########
Hardware P-State support on PC hardware
=======================================
Intel CPUs feature Speed Shift respectively Hardware P-State (HWP)
functionality in order to balance CPU frequency and voltage for performance
and power efficiency. Up to now, the UEFI firmware of the notebooks we worked
with selected or made an option selectable in the UEFI configuration to
specify the desired behaviour, e.g. optimize for performance or power
efficiency.
With a recent Lenovo notebook, however, we faced the issue that either the fan
would run for too long after some load and/or the performance of the CPUs
regressed. Finding a well working sweet spot
[https://github.com/genodelabs/genode/issues/3871 - seems hard].
This experience prompted us to investigate how the Intel HWP feature can be
set and configured. After some experiments, we achieved to reduce the fan
noise and received better performance by tweaking the Intel HWP settings.
However, changing the Intel HWP settings requires access to the privileged
mode on all available CPUs. Since Genode supports several kernels, a solution
would require us to modify all kernels or the feature would remain solely
available to one kernel. We went for a different approach.
On x86, we use the tools from the
[https://genode.org/documentation/release-notes/18.08#New_Intel_Microcode_update_mechanism - Morbo project],
e.g., bender and microcode, to run code before the kernels are booted. The
jobs of the tools are to scan, enable, or apply changes to the CPUs and
chipset, which are not required to change during runtime. We came to the
conclusion that the named bootstrap tools are good places to apply such
one-time Intel HWP settings for the moment.
During the course of adding the Intel HWP functionality, we merged the
microcode functionality into the bender tool and made it configurable via the
boot options 'microcode' and 'intel_hwp'. A typical generated grub2
configuration by using both options would look like this:
| insmod multiboot2
| insmod gzio
| multiboot2 /boot/bender bender microcode intel_hwp
| module2 /boot/micro.code micro.code
| module2 /boot/hypervisor hypervisor ...
| module2 /boot/image.elf.gz image.elf ...
When using the NOVA kernel and Genode's _run_ tool for booting respectively
disk-image creation, one may use the existing 'options_bender' variable in
_tool/run/boot/nova_. The microcode option is added by setting the
'apply_microcode' flag in the same file. The 'intel_hwp' option, at the other
hand, can simply be appended to 'options_bender'. On startup, bender will print
the applied HWP settings for each core to the serial output if the
'intel_hwp' option was set. The new feature will try to set Intel HWP to
'PERFORMANCE' mode, the mode for which we observed the best results.
NOVA microhypervisor
====================
The IO-MMU is a hardware feature to protect operating systems, e.g., Genode,
against misbehaving devices and/or corresponding device drivers. The feature
is supported on x86 since the
[https://genode.org/documentation/release-notes/13.02#DMA_protection_via_IOMMU - 13.02 release]
and described in the release notes. Up to now, this feature is solely
supported for Intel hardware, in particular CPUs and chipsets supporting Intel
VT-d.
With the current release, we add support for AMD's IO-MMU variant to the
Genode framework for the NOVA kernel - being the first one out of the
supported microkernels. Being conceptionally equivalent, the actual
implementation for AMD differs from Intel unsurprisingly. In order to add the
support, a new IO-MMU interface abstraction for accommodating both versions -
Intel and AMD - has been added to the NOVA kernel. Further, the discovery of
the available AMD IO-MMUs required the traversal of different ACPI tables than
for Intel and another page table format for the IO-MMU had to be added. On the
Genode framework side, only very few changes were necessary, namely the
detection of the IO-MMU feature by parsing the ACPI tables in Genode's ACPI
driver as well as the ported Intel ACPICA component.
The change has been already successfully tested on various Ryzen desktops and
notebooks on a backported Sculpt 20.08 branch.

663
doc/release_notes/21-02.txt Normal file
View File

@@ -0,0 +1,663 @@
===============================================
Release notes for the Genode OS Framework 21.02
===============================================
Genode Labs
Genode 21.02 stays close to the plan laid out on our
[https://genode.org/about/road-map - road map], featuring a healthy dose
of optimizations, extends the framework's ARM SoC options, and introduces
three longed-for new features.
First, we extended our concept of pluggable device drivers to all network
drivers, including Ethernet and Wifi.
As reported in Section [Pluggable network device drivers], such drivers can
now gracefully be started, restarted, removed, and updated at runtime without
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
components and the architecture.
Third, we are happy to feature the initial version of VirtualBox 6 for
Genode. Section [VirtualBox 6.1.14] gives an overview of the already
supported feature set and the outlook to reach feature-parity to our version
of VirtualBox 5 soon.
Speaking of VirtualBox in general (both versions), we were able
to significantly improve the USB-device pass-through abilities, specifically
covering audio headsets.
Further noteworthy improvements of the current release range from added
VirtIO-block device support for virtual machines on ARM
(Section [VirtIO block devices for virtual machines on ARM]),
revived developments on RISC-V (Section [RISC-V]),
over VFS support for named pipes (Section [VFS support for named pipes]),
to streamlined tooling (Section [Build system and tools]).
Pluggable network device drivers
################################
The results of our approach to
[https://genode.org/documentation/release-notes/20.08#The_GUI_stack__restacked - pluggable framebuffer and input drivers]
encouraged us to take on the third major driver category, namely networking
drivers, which subsumes not only Ethernet drivers but also wireless networking
drivers and mobile baseband drivers. The latter two are of course particularly
interesting for mobile communication devices.
Similarly to the story linked above for the framebuffer and input drivers,
Genode's network drivers used to play the roles of NIC servers, providing a
network-interface service to network applications. As a consequence, the
lifetime of a network application was always bound to the lifetime of the
underlying NIC driver. This is unfortunate because those drivers can be
obscenely complex, putting the liveliness of the dependent application stack
at risk.
[image layered_nic_multi_app_risk]
However, in most scenarios, networking applications do not operate directly on
a network interface because this would prevent the use of the network interface
by more than one application at a time. Instead, there is usually a NIC
multiplexing component in-between the driver and one or multiple applications.
In most contemporary scenarios this is the NIC router that acts as NIC client
towards the driver and as NIC server towards the applications.
Thus, we contemplated the idea of letting the NIC driver operate as NIC client
of the NIC router instead. This would decouple the application from the
driver's lifetime while the driver's special role would be modeled solely by a
routing policy. However, even though the data channel of the NIC interface is
bi-directional, we realized that the reversal of the role of the driver does
not only entail the communication of network payload but also propagation of
the link state and the MAC address. This prompted us to introduce a new Genode
session type called "Uplink" that precisely models the NIC-driver-as-client
scenario.
[image nic_router_services]
In a nutshell, an Uplink session is almost the same as a NIC session with only
three minor differences. First, the MAC address is given by the client (the
driver) as an argument at session-creation time. Second, the roles of the TX
and RX packet streams are interchanged compared to a NIC session. I.e., the
_client_ transmits via TX and receives through RX while at the server side it's
vice-versa. And third - as a mere interface optimization - the link state of an
uplink session is always "up". The session is requested by the client (the
driver) only in the event of a "link-up" edge. Analogously, whenever the link
goes "down", the client closes the session again.
With this new session interface in place, the NIC router becomes the only
long-running component in the scenario. It provides both a NIC and an uplink
session interface. The NIC session interface is used by network applications.
The uplink session interface is used by drivers. Inside the router, uplink
sessions are treated the same as NIC sessions. Therefore, we decided that the
well known '<policy>' tags in the configuration are now simply applied to both
session types. This means, that each '<uplink>' tag that connected a driver in a
router configuration can now be replaced by a '<policy>' tag with a label
attribute that matches the driver's session request.
[image nic_uplink_multi_app]
We divided the process for this architectural change into the following
autonomous steps:
# Introduce the uplink session and uplink-session support in the NIC router.
# Let NIC drivers support both modes, "NIC session server" and "Uplink session
client" depending on a new _transitional_ <config>-tag attribute 'mode'.
This attribute is optional and has two possible values, 'uplink_client'
and 'nic_server', of which it defaults to the latter.
# Adapt all network scenarios in the basic Genode repositories to use NIC
drivers only with '<config mode="uplink_client">'.
# Remove support for the "NIC session server" mode from all NIC drivers and
with it also the transitional 'mode' attribute.
All steps except the last one are completed by now. The transitional 'mode'
attribute and the "NIC session server" mode will remain available in all NIC
drivers until the next Genode release in order to give others the opportunity
to gracefully adapt their NIC drivers and network scenarios to the change.
Further information
-------------------
The overarching topic of pluggable device drivers was covered by our recent
presentation at [https://fosdem.org/2021/ - FOSDEM 2021]. You can find the
video recording and the presentation slides at the following link.
:Pluggable device drivers for Genode:
_presented at FOSDEM 2021_
[https://fosdem.org/2021/schedule/event/microkernel_pluggable_device_drivers_for_genode/]
LTE modem stack
###############
With the current release, Genode adds LTE broadband modem support for packet data
connections. This way, it becomes possible to browse the internet using the SIM
card of your broadband service provider. For a description of the protocols and
the general terminology when talking about LTE modems, our
[https://genodians.org/ssumpf/2020-12-04-mbim - LTE modem support for Genode]
Genodians article is a good starting point.
From the device side, LTE modems register themselves as USB devices at the USB
host controller. The speciality is that a modem offers two interfaces. First, a USB
network interface (like NCM or ECM) and second, a
[https://www.usb.org/document-library/class-definitions-communication-devices-12 - Wireless Mobile Communication Device],
which is a challenge/response control channel to the modem and used to configure
the device. For the actual communication through the control channel, there exist two
binary protocols: Namely, Mobile Broadband Interface Model (MBIM) and Qualcomm
Mobile Station Interface (QMI). Whereas the former is a USB standard, QMI is a
proprietary protocol by Qualcomm. Therefore, we picked a modem that supports the
MBIM standard for our line of work.
USB modem support
=================
In order to enable modem communication, we added the Linux USB modem driver for
MBIM to our _dde_linux_ device driver environment. This driver implements the
NCM and WDM interfaces for the modem and provides a network uplink session for
the NCM network interface and a terminal session for the WDM interface.
[image lte_mbim]
MBIM protocol
=============
MBIM is a binary protocol that is, for example, implemented by
[https://www.freedesktop.org/wiki/Software/libmbim/ - libmbim]. Therefore, we
ported _libmbim_ to Genode. Since it requires _glib_, we had to enable features
and improve our _glib_ support on Genode. The _libmbim_ library offers MBIM command handling only.
For actually triggering modem-communication, the _mbimcli_ tool is required. We
ported _mbimcli_ and changed its front end to trigger a modem packet-connection
sequence via _libmbim_ through the terminal session of the USB modem driver.
During this sequence, the SIM card is unlocked through the PIN, the packet
service is attached, and connection information (e.g., IP, gateway, DNS server)
is retrieved. The connection data is then used by _mbimcli_ to configure the
uplink of Genode's NIC router, which in turn makes the network connectivity available
to network applications. The holistic view is shown in image [lte_mbim].
Base framework and OS-level infrastructure
##########################################
NIC router
==========
The NIC router received two practical features, the consideration of
multiple DNS server entries on DHCP and an ARP-less mode for domains.
The latter was motivated by the fresh support for LTE modems (see Section
[LTE modem stack]). An LTE modem normally doesn't respond to ARP. So when
using it as uplink for the NIC router, the corresponding domain can't request
IP-to-MAC-address resolutions as usual. This is addressed through the new
optional attribute 'use_arp' in '<domain>' tags of the NIC router configuration.
By default, it is set to 'yes', which yields the same behavior as in the past.
However, when set to 'no' for a domain, this domain will prevent sending ARP
requests in general. This leaves the question how to determine the destination
MAC address for a packet that shall be sent at this domain when only the
destination IP address is known. This is solved by the router by simply using
the source MAC address also as destination MAC address, an approach that we
could observe also in other IP stacks and that worked just fine in our tests.
The ARP-less domain mode is demonstrated through the run script
_repos/os/run/nic_router_disable_arp.run_.
The consideration of multiple DNS-server entries on DHCP comes in two parts.
First, when acting as DHCP client at a domain, the router will now parse all
option 6 entries in DHCP ACK replies from the server and memorize them as part
of the resulting IP config of the domain. These entries will then also be
reported if '<report config="yes"/>' is set in the router's config. A router
report with multiple DNS server entries will look like this:
! <state>
! <domain name="uplink_1" ipv4="10.0.0.3/24" gw="10.0.0.1">
! <dns ip="10.0.0.2"/>
! <dns ip="1.1.1.1"/>
! <dns ip="8.8.8.8"/>
! ...
! </domain>
! <domain name="uplink_2" ipv4="168.192.0.200/24" gw="168.192.0.1">
! <dns ip="168.192.0.10"/>
! <dns ip="168.192.0.8"/>
! ...
! </domain>
! ...
! </state>
On the other hand, when acting as DHCP server at a domain, one has two
options. Option 1 is to configure the DHCP server to fetch DNS server entries
automatically from another domain:
! <domain name="downlink" interface="10.0.1.1/24">
! <dhcp-server dns_server_from="uplink_1" .../>
! </domain>
In this case, the router will now reflect not only one but all DNS server
entries from the source domain ("uplink") through the DHCP replies sent at the
destination domain ("downlink") without changing the entry order. This approach
is demonstrated through the new _repos/os/run/nic_router_dhcp_unmanaged.run_
run script.
Option 2 is to configure the DNS server entries manually at the DHCP
server:
! <domain name="downlink" interface="10.0.1.1/24">
! <dhcp-server ...>
! <dns-server ip="10.0.0.2"/>
! <dns-server ip="1.1.1.1"/>
! <dns-server ip="8.8.8.8"/>
! </dhcp-server>
! </domain>
The order of the '<dns-server>' tags determines the order of
option 6 entries in the replies of the DHCP server. Besides its use for static
DNS server configurations, this option can also be used for more sophisticated
forwarding of DNS server entries through a separate management component. The
management component could listen to the reported IP config of the source
domains, apply custom policies like address filters to the result, and
re-configure the DHCP servers of the destination domains accordingly. This
approach is demonstrated in the new _repos/os/run/nic_router_dhcp_managed.run_
run script.
Please note that the former 'dns_server' attribute of the '<dhcp-server>' tag
is no longer considered by the router as the new '<dns-server>' tag replaces it.
Thus, you might want to adapt your NIC router scenarios accordingly.
VFS support for named pipes
===========================
The VFS-pipe plugin received new support for named pipes. The main motivation was to
easily stream data from pure Genode components to libc components via
file-system sessions that can be attached to stdin, stdout, and stderr. This
feature further makes it possible to chain the data flow between several components together,
similarly to how it is done on Unix. Additionally, the thread synchronization
has been improved so that large data chunks can be transferred without
blocking.
A named pipe can be created by adding a '<fifo>' sub node to the '<pipe>' node
of the VFS:
! <vfs>
! <pipe>
! <fifo name="upstream"/>
! </pipe>
! ...
! </vfs>
Each pipe is exposed as a set of pseudo files.
! /upstream
! /.upstream/in/in
! /.upstream/out/out
The _/upstream_ pseudo file can be opened either as read-only or write-only
file. It allows for the access of both ends of the pipe. In contrast, each of
the pseudo files _/.upstream/in/in_ and _/.upstream/out/out_ represents only
one end of the pipe, which can be subjected to an individual directory-based
access-control policy.
Thanks to Sid Hussmann for contributing this valuable feature!
Terminal
========
While
[https://genode.org/documentation/release-notes/20.08#The_GUI_stack__restacked - revising the GUI stack]
in Genode 20.08, we largely abolished the use of the framebuffer and input
session interfaces. The graphical terminal, however, still relied on those
interfaces instead of the GUI session. In practice, there was always a gui_fb
component needed as an intermediate between the terminal and the GUI server.
To complete the GUI-stack transition, we changed the terminal to use the GUI
session directly and adjusted all current scenarios that use the terminal.
One useful feature of the gui_fb component was the definition of an initial
window size. This enabled packages such as Sculpt's system shell to present
terminal windows with a reasonable default size smaller than the entire
screen.
To accommodate this special case, the initial terminal size can now be
explicitly configured in the terminal configuration.
! <config>
! <initial width="800" height="600"/>
! ...
! </config>
While we were at it, we also enhanced the terminal with the ability to
dynamically respond to font changes. So the adjustment of the global font
settings in Sculpt OS takes immediate effect on all terminal windows.
OpenSSL 1.1.1i, curl 7.70.0
===========================
OpenSSL experienced some quite important security updates during the last
months. This prompted us to update our port to version 1.1.1i. During
the porting work, we kept an eye on performance and enabled CPU-specific
optimizations where feasible. Optimizations are enabled by default on
x86 and ARMv8. For ARMv7, we enable NEON-based functions only when the
build SPECS include "neon" to support common SoCs that lack these
capabilities in the default configuration. Please note, the updated
port does only provide one combined depot archive "openssl" that
replaces the former "libcrypto" and "libssl" archives. The libraries
are still distinct for compatibility with existing applications and
build systems. As a side effect, we also updated the curl library to
version 7.70, which is compatible with recent OpenSSL versions.
Thanks to Pirmin Duss for his valuable contribution to this update.
Virtualization
##############
VirtualBox 6.1.14
=================
Genode supports virtualization with VirtualBox
[https://genode.org/documentation/release-notes/14.02#VirtualBox_on_top_of_the_NOVA_microhypervisor - since 2014].
Back then, we enabled VirtualBox version 4 to support use cases with unmodified
Linux and Windows guests like Sculpt's predecessor
[https://genode.org/documentation/release-notes/15.11#Genode_as_desktop_OS - "Turmvilla"].
In 2016, we updated VirtualBox to version 5 to enable recent guest OS
versions notably Ubuntu 16.04 and Windows 10. VirtualBox 5 is an
integral part of Sculpt OS since its first release.
As VirtualBox 5 is no longer maintained upstream and also shows its age
when running recent versions of Windows 10, we accepted the challenge
to once again enable a new version of this VMM. This time we did not
go for a NOVA-specific port but exclusively use the kernel-agnostic
virtualization interfaces introduced in
[https://genode.org/documentation/release-notes/19.05#Kernel-agnostic_virtual-machine_monitors - Genode 19.05].
This way, VirtualBox 6 is prepared to run on NOVA, seL4, and Fiasco.OC alike with
minimal extra efforts.
The first development snapshot we publish with this release is ready to
run Linux and Windows guests with limited support for multiple cores,
integrates network and USB-passthrough as well as preliminary support
for Guest Additions like mouse integration and display. We are
committed to finalize the feature set and optimize the performance of
VirtualBox 6 until the upcoming Sculpt release but do not plan to replace
version 5 completely yet. In fact, the update paves the way to explore
more experimental grounds like enablement of GPU-based
acceleration of guest OSes.
As a starting point for exploring VirtualBox 6 on Genode, we recommend the run script
_ports/run/virtualbox6.run_.
VirtualBox 5
============
With this release, we extended our VirtualBox port and made USB
pass-through more robust.
So far, we most prominently use VirtualBox on Intel systems that feature
VT-x. This release enables support for also running 64bit guests on AMD
systems with SVM.
When it comes to USB pass-through support, we rely on the xHCI device-model
ported from Qemu. With this release, we updated the 3rd-party sources to
version 5.2.0 and the type of the exposed device has changed to QEMU xHCI. Due to
this change, older guest OSes - namely Windows 7 - that relied on the NEC
xHCI device will no longer work.
Thanks to the update, it becomes possible to use USB devices requiring isochronous
transfers, in particular audio devices, with Windows 10 guests. For now
we focused on USB-Audio-Class v1 devices using adaptive
synchronisation, which enables a variety of popular USB headsets for
the passthrough use case.
A glimpse into our USB machinery unveils that fine-tuned buffering and USB
transfer configuration is the key to robust USB passthrough. On one hand, the
handling of isochronous OUT transfers in our host connection batches multiple
packets and queues transfers, which helps to smoothen out playback in case other
Genode components utilize the CPU concurrently. On the other hand, the number of
IN requests queued is increased but the number of packets per request set to 1.
We obtained the best results by following this configuration observed in Linux
and Windows guests alike.
VirtIO block devices for virtual machines on ARM
================================================
With release
[https://genode.org/documentation/release-notes/20.02#Custom_virtual_machine_monitor_on_ARM - 20.02],
the first VirtIO device models entered Genode's virtual
machine monitor for ARM. They enabled a virtual machine to access network and
terminal services. This time, the VMM got extended with a block device model,
which again is compliant to the VirtIO 1.1 specification. Moreover, the generic
model implementation, which is common to all VirtIO devices, got polished fairly.
The new block device model is not configurable yet. By now, the VMM is
hard-coded to provide exactly one block device. Consequently, one route to a
Block service needs to be provided to the VMM component.
The execution of the test run-script in _repos/os/run/vmm_arm.run_ shows
the new VirtIO block device in action.
Device drivers
##############
Power-gating of PCI devices on x86
==================================
PCI devices have several PCI capabilities that describe the feature set
the device supports, as defined by the PCI specification. The platform driver - which
is the gatekeeper of devices on Genode - got extended to power on and power off
devices whenever the PCI power capability is supported. When powering on, a device reset
is issued if it is supported by the PCI device. During release of a driver from a
device, all DMA memory associated to the device is
flushed from the IO-MMU TLB to avoid any further access.
Additionally, the platform driver has become able to respond to configuration
changes. Special care must be taken if the configuration of a running device
driver changes. If the configuration re-evaluation concludes that a driver is no longer
permitted to use an already assigned PCI device, the Platform session
will be closed forcefully, making the device inaccessible to the driver.
The extended features of the platform driver supplement our previous work of
restarting respectively replacing a running graphics driver in Sculpt OS. The driver
manager, as used by Sculpt, uses Genode's heartbeat monitoring to check for the
liveliness of the Intel framebuffer driver and restarts it automatically if the
driver becomes unresponsive. Restarting
involves closing the Platform session, thereby powering off the Intel device,
and reopening the Platform session, thereby powering and resetting the
Intel device into a functional state.
This self-healing mechanism can be seen in action in the recording of our
[https://fosdem.org/2021/schedule/event/microkernel_pluggable_device_drivers_for_genode/ - FOSDEM talk]
about pluggable device drivers.
USB drivers
===========
Additional HID devices
~~~~~~~~~~~~~~~~~~~~~~
It's a sad truth that some popular USB keyboards and mice do not fully
comply with the USB HID standard. The Linux kernel comes with dozens
of special functions to fix up quirks and enable these devices
for Linux systems also. With the current release, we adopt quirk functions
for Apple HID devices and mice based on the Holtek chipset (e.g., the
Sharkoon Drakonia) that are applied automatically if one of these
devices is plugged.
USB robustness
~~~~~~~~~~~~~~
We improved the robustness of the USB HID driver with regard to device
reconnection, as well as the robustness of the DWC OTG host driver for
the Raspberry Pi when used with HID devices.
Isochronous transfers
~~~~~~~~~~~~~~~~~~~~~
While looking more closely into supporting isochronous transfers
driven by the USB pass-through use-case, we encountered and addressed shortcomings
in the current implementation in the USB host-controller driver
when dealing with IN transfers containing multiple isochronous frames.
However, this is only a first step as we identified significant potential for
optimization and robustness improvements.
Platforms
#########
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
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
thoroughly document the porting process. You can find the work explained in
great detail in the following article series.
# [https://genodians.org/nfeske/2020-12-10-pine-fun-warmup - Warming up for some Pine fun]
# [https://genodians.org/nfeske/2020-12-17-pine-fun-serial - Bare-metal serial output]
# [https://genodians.org/nfeske/2021-01-28-pine-fun-kernel-skeleton - Kernel skeleton]
# [https://genodians.org/nfeske/2021-02-11-pine-fun-debugging - How did we come here?]
# [https://genodians.org/nfeske/2021-02-18-pine-fun-user-land - Excursion to the user land]
The latest state of this line of work is available at a dedicated repository:
:Genode board support for Allwinner SoCs:
[https://github.com/nfeske/genode-allwinner]
RISC-V
======
RISC-V development has been on the hold at Genode Labs for a while. But with the
current release this has changed. One of the main goals we had for a long time
is the use of Qemu instead of the Spike emulator for our test infrastructure, since
every other platform runs on Qemu, Spike causes additional overhead at Genode
Labs.
By updating the privileged ISA specification support from 1.9.1 to 1.10,
we became able to use recent Qemu versions (e.g., 4.2.1).
Thanks to this change, we could remove the _spike_ board and add a new
_riscv_qemu_ board to our _base_hw_ kernel implementation.
As another nice side effect, Qemu ships its own OpenSBI machine binary, which
implements the machine mode and SBI calls. It can be enabled through the "-bios"
command line option. With a machine mode for ISA 1.10 in place, we were able to
remove the old [https://github.com/ssumpf/bbl-lite - BBL] machine mode
implementation from Genode.
For more information on this topic please refer to the corresponding
[https://genodians.org/ssumpf/2021-02-24-riscv - Genodians article].
In order to improve development speed, we were able to reduce the link time for
_core_ and its debugging variant from about 50 to 5 seconds. Additionally, we
fixed long standing link errors that were caused by mixing up soft float and
hard float objects as well as misconfigured linker scripts.
Removal of Muen separation kernel support
=========================================
Since
[https://genode.org/documentation/release-notes/15.08#Genode_on_top_of_the_Muen_Separation_Kernel - version 15.08],
Genode supported the use of the [https://muen.sk - Muen] separation kernel as
underlying platform. The driving force behind the original development was the
joyful collaboration with the Muen developers Adrian-Ken Rueegsegger and Reto
Buerki and the prospect for products that combine the rigidity of a separation
kernel with the dynamic workloads enabled by Genode.
However, over the past 5 years, this potential synergy remained untapped.
In hindsight, the stacking of one microkernel-based system onto another
microkernel-based system is a tough sell. Hosting dynamic workloads in a Linux
VM atop Muen is certainly more relatable to Muen users. Vice versa, for Genode
users, Genode on bare hardware is less complex and more flexible than using
the framework atop a separation kernel.
Without adoption of the joint platform, neither of both teams can justify the
ongoing effort needed for the continued maintenance of Genode on Muen. Hence,
we [https://github.com/genodelabs/genode/issues/3995 - concluded] to remove
Muen as an officially supported platform.
Build system and tools
######################
Streamlined distinction of boards by build and run tools
========================================================
In
[https://genode.org/documentation/release-notes/20.05#Board_support_outside_the_Genode_main_repository - Genode 20.05],
we introduced the principle ability to decouple board-support packages from
the project's main repository. We thereby want to enable developers outside
the Genode core team to port Genode to diverse hardware platforms.
With the current release, we further refined the structure of the code base and
the tooling to largely eliminate remaining points of friction when hosting
board support in external repositories.
We ultimately removed the use of board-specific SPEC values throughout the
build system and run scripts. SPEC values are now solely used to refer to
aspects of an instruction-set architecture, e.g., x86, 64bit, or arm_v8a.
In run scripts, the new convenience function 'have_board' has become the
preferred way to distinguish the behavior of run scripts depending on the
targeted board now. It replaces all former uses of 'have_spec <board>'.
Moreover, the long deprecated option of the _create_builddir_ tool to create
board-specific build directories has been removed.
To simplify the hosting of board support in separate source-code repositories,
board-specific properties have moved from run-tool scripts to the new notion
of *board property directories*. Such directories named
_<repo>/board/<board>/_ contain files with board-specific information.
In particular, the 'image_link_address' file contains the physical
link address of the system image taking the board's physical memory
constraints into account, and the 'arch' file contains the CPU
architecture of the SoC. The run tool picks up this information
from the board-property files.
Furthermore, the *packaging* of the board-specific base-hw kernel has
become more formalized by leveraging the board-property directories.
This makes the packaging vastly simpler. Regardless of where the board-support
is hosted, the _content.mk_ file for a kernel source archive becomes as simple
as:
! include $(GENODE_DIR)/repos/base-hw/recipes/src/base-hw_content.inc
The board name is automatically inferred from the path of the src recipe. The
architecture is determined from _board/<name>/arch_ files. The attempt to
build a base-hw-<board> binary archive for the wrong architecture is now
gracefully handled by skipping all targets (using the REQUIRES mechanism).
Besides the improved convenience, the resulting depot archives
have become much closer tailored to the actual board by omitting files for
architectures that are not used by the board. E.g., the src/base-hw-pc
archive does not contain any ARM-related content.
Compiler cache
==============
The [https://ccache.dev - ccache] tool is a fantastic way to accelerate the
developer workflow when repeatedly building software. Since ccache is -
strictly speaking - orthogonal to the build system, configuring the Genode
build system for the use of ccache was left to each developer.
Setting up ccache is not straight-forward though. One must manually create
hooks (symlinks shadowing the compiler executables), tweak the PATH
environment variable, and customize the CROSS_DEV_PREFIX in
_etc/tools.conf_. In short, only seasoned developers jump through those hoops.
Many others may miss out on the joys of ccache.
With the current release, the build-system front end makes ccache easily
available by enabling a simple option in the _etc/build.conf_ file:
! CCACHE := yes

817
doc/release_notes/21-05.txt Normal file
View File

@@ -0,0 +1,817 @@
===============================================
Release notes for the Genode OS Framework 21.05
===============================================
Genode Labs
The most prominent user-visible features of Genode 21.05 are the support for
webcams and an easy-to-use component for file encryption on
[https://genode.org/download/sculpt - Sculpt OS]. Both topics greatly benefit
from Genode's component architecture. The video-conferencing scenario
described in Section [Webcam support] sandboxes the webcam driver in a
disposable Genode component while using a second instance of the nitpicker GUI
server as a video bridge. This design strikes a beautiful combination of
simplicity, robustness, and flexibility.
The new file vault described in Section
[File vault based on the CBE block encrypter] leverages Genode's dynamic
sandboxing capabilities to manage the creation and operation of an encrypted
file store. Even though the underpinnings can be described as nothing less
than sophisticated machinery, the package presented to the user combines ease
of use with a great sense of control.
The second focus of the current release are the manifold improvements of
Genode's driver and platform support as described in Sections [Device drivers]
and [Platforms]. Our USB support received the attention needed to accommodate
the webcam scenario, the arsenal of i.MX8 drivers got enriched with I2C and
power-domain control, the Pine-A64 board support is growing, Genode has become
able to run on 64-bit ARM Linux, and we enabled principle networking for
RISC-V.
Speaking of platforms, this release features the first version of a new
"Genode Platforms" documentation (Section [Updated and new documentation])
that aids the porting of Genode to new ARM SoCs. With this document, we share
our former in-house know-how and methodology about the porting and development
of drivers with developers outside of Genode Labs.
The release is rounded up by several performance optimizations
(Section [Performance optimizations]) to the benefit of most Genode system
scenarios. Furthermore, it is accompanied with an updated tool chain,
following our established two-years rhythm
(Section [Tool-chain update to GCC 10.3 and binutils 2.36]).
Webcam support
##############
During 2020, the amount of home office and remote work took an unexpected turn.
Video conferences and video chats have become the norm, which people and
companies rely upon. Even though, not to be found on our
[https://genode.org/about/road-map - road map] for 2021, this development
prompted the Genode team to explore the field of webcam and video chat support
on Genode.
Webcams are generally connected via USB to a host device and implement the USB
video device class
([https://www.usb.org/sites/default/files/USB_Video_Class_1_5.zip - UVC spec]).
Therefore, it is possible to drive many different webcam devices using the
same USB interface. To support this protocol, we enabled
[https://ken.tossell.net/libuvc/doc - libuvc], which offers fine-grained control
over UVC exporting USB devices. In order to enable _libuvc_ on Genode, we
simply integrated the library into Genode's port system with no further
changes required. _libuvc_ depends on [https://libusb.info - libusb] as a back
end to access the actual webcam device. While there exists a port of _libusb_
for Genode - that connects through Genode's USB session interface to the USB
host controller - the port still lacked support for isochronous USB transfers
as required by UVC devices. Isochronous transfers represent a continuous
stream of data (either input or output) with a constant rate without delivery
guarantees. We extended _libusb_ to handle isochronous transfers, which were
already supported by Genode's USB session. Observing that this kind of
transfers can cause high load within the USB host driver, we optimized
isochronous transfer support at the host driver level (Section [USB]).
At the front-end side, we created a small _usb_webcam_ component that uses
_libuvc_ in order to enable, disable, and configure the camera. The component
connects to a GUI session, and thus, can be interfaced directly, for example,
to the Nitpicker component for rendering webcam images natively on screen.
Whereas Genode's pixel format is 32 bit RGB, webcams stream data in the YUV2,
MJPEG, or H.264 formats. To handle the conversion of these formats to Genode's
pixel format, we utilize the
[https://chromium.googlesource.com/libyuv/libyuv - libyuv] library and thereby
support the YUV2 as well as the MJPEG pixel format for webcams.
Additionally, we wanted to be able to transfer the webcam data directly into
our VirtualBox port, thus enabling, sophisticated video conference systems
like Jitsi or Skype.
[image webcam]
Our USB host-controller support for VirtualBox is based on the ported Qemu USB
3.0 (XHCI) controller model. Since no USB webcam device model is available for
Qemu, we were required to develop a one from scratch. The new USB webcam model
is attached to the QEMU USB XHCI controller and operates as a bulk endpoint.
In contrast to an isochronous endpoint, the model causes less CPU load and
fewer virtual interrupts. The supported formats offered to the guest are YUV2
and BGR3. By enabling the USB webcam model within the Genode VirtualBox
configuration, a _Capture_ session is used to capture pictures at the rate of
a configured _fps_ value. The following snippet shows the default values of
the supported configuration attributes.
!<config ...>
! ...
! <webcam width="640" height="480" fps="15" vertical_flip="false"
! screen_size="false" report="false"/>
! ...
!</config>
If the _screen_size_ attribute is set to _true_, the device model determines
the resolution from the established capture session. Otherwise, the specified
_width_ and _height_ values are used. The _vertical_flip_ attribute is useful
for the BGR3 format, which is - when interpreted by Linux guests - flipped
vertically and can be flipped back by setting the attribute to _true_.
If the _report_ attribute is set to _true_, a report will be generated
whenever the guest changes the state of the webcam model, either by switching
capturing on/off or by changing the pixel format.
! <capture enabled="true/false" format="YUV2/BGR3"/>
[image webcam_chat]
Finally, our developers, croc and lion, setup the Webcam scenario in Sculpt
and test drive the new feature fascinated. The picture shows a session via
Jitsi, on the right side croc participates at the meeting via a Win10 VM on
Sculpt and lion sitting left joined via an Android tablet.
Performance optimizations
#########################
One of the overarching topics of this year's
[https://genode.org/about/road-map - roadmap] is optimization.
As part of working on the Sculpt OS
[https://genode.org/news/sculpt-os-21.03-boots-now-in-2.5-seconds - version 21.03],
we identified several optimization vectors with the potential for user-visible
improvements. In particular, while interacting with the system, a few effects
made us curious.
Operations that involved changes to the runtime subsystem, e.g., adding or
reconfiguring a component, seemed to interfere with multi-media workloads.
When running a graphical animation, we could see it stutter in such
situations. Another direction of our curiosity was the boot time of the
system. The boot time of Sculpt OS has always been relatively quick compared
to commodity operating systems. E.g., on a 5-years old laptop like a Lenovo
x260, the system used to boot in about 5 seconds to the graphical user
interface. However, with the anticipation of Sculpt OS on lower-end platforms
like the Pinephone and with the vision of instant-on systems, we wondered
about the potential for improvement.
While gathering a CPU-load profile of the boot process using the top tool, we
learned that the boot time was bounded not by I/O but by the CPU load (the
kernel's idle thread did not appear in the profile). Interestingly, a
significant portion of the cycles were consumed by various instances of the
init component, which prompted us to turn our attention to the implementation
of init.
Clock-cycle measurements
------------------------
The next natural step was the benchmarking of various code paths of init using
a cycle-accurate time-stamp counter (TSC). Even though Genode has a
'Trace::timestamp' utility readily available, it remains barely used for
manual instrumentation because such instrumentations require too much labor:
allocation of state variables for gathering the statistics, computing time
differences, traffic-shaping of the debug noise (needed whenever investigating
highly frequently called code). These tasks should better be covered by a
utility so that friction-less performance analysis can become a regular part
of our development work. As a side effect of our investigation, we came up
with a new utility called GENODE_LOG_TSC. This utility is covered by a
dedicated article.
:Performance analysis made easy:
[https://genodians.org/nfeske/2021-04-07-performance]
Thanks to GENODE_LOG_TSC, we were able to identify three concrete
opportunities for optimization in a course of one evening. First, the dynamic
reconfiguration of init apparently did not scale well with a growing number of
components. The code for analysing differences of configuration versions
relied on doubly nested loops in order to stay as simple as possible. With the
typical number of 30 or more components/subsystems hosted in Sculpt's runtime,
we passed a tipping point where quadratic time complexity is justifiable.
Second, during a configuration update, the XML data is evaluated in multiple
passes, which puts pressure on the efficiency of Genode's XML parser. This
pressure could in principle be relieved. Third, the process of taking
session-routing decisions involved XML parsing. In scenarios as sophisticated
as Sculpt, the routing rules can become quite elaborate. Since the rules are
consulted for each session route, the costs for the rule evaluations stack up.
Init optimizations
------------------
These realizations motivated us to replace the hand-crafted configuration
processing by the use of Genode's generic 'List_model' utility. This way, the
parsing follows a common formalism that makes the code easier to maintain and
to understand while reducing the XML parsing to a single pass. The increased
formality cleared the way for further optimizations. In particular, init
became able to skip the re-evaluation of the session routing whenever no
service is affected by the configuration change. This is actually the common
case in Sculpt.
To alleviate the costs for evaluating session routes, we introduced an
internal data model for the routing rules that is optimized for the matching
of routes. With this model, the detection of a definite mismatch (the common
case) comes down to a comparison of a single numeric value.
Combined, those optimizations yield a great effect. In a typical Sculpt
system, the time of a dynamic reconfiguration got reduced by factor 10 to the
order of 10 to 20 milliseconds. Hence, the visual stuttering we observed
during structural changes of the runtime are completely eliminated.
Besides the major optimization of init, we were able to shave off a few
milliseconds from the boot procedure here and there. For example, by deferring
the initialization of the real-time clock driver to its first use, we avoid a
potentially expensive active polling loop during the highly contended boot
phase. Another obvious heuristic improvement is the skipping of the GUI
handling until the framebuffer driver is up because all the nice pixels would
not be visible anyway.
Combined, these optimizations were able to reduce the boot time of Sculpt from
the entering of the kernel up to the graphical user interface down to only 2.3
seconds. The improved performance of init is impactful beyond Sculpt OS
because it is a central component of all Genode systems large and small.
Updated and new documentation
#############################
Genode Platforms
----------------
We are proud to introduce the first version of a new "Genode Platforms"
document, which complements the existing Genode Foundations book with
low-level hardware-related topics. It is primarily intended for integrators
and developers of device drivers.
: <div class="visualClear"><!-- --></div>
: <p>
: <div style="clear: both; float: left; margin-right:20px;">
: <a class="internal-link" href="https://genode.org">
: <img class="image-inline" src="https://genode.org/documentation/genode-platforms-title.png">
: </a>
: </div>
: </p>
In this first edition, the document features a practical guide for the steps
needed to bring Genode to a new ARM SoC. The content is based on the ongoing
Pine Fun article series at [https://genodians.org - Genodians.org].
We plan to continuously extend it with further practical topics as we go.
:Initial revision of the Genode Platforms document:
[https://genode.org/documentation/genode-platforms-21-05.pdf]
Genode Foundations
------------------
The "Genode Foundations" book received its annual update. It is available at
the [https://genode.org] website as a PDF document and an online version.
The most noteworthy additions and changes are:
: <div class="visualClear"><!-- --></div>
: <p>
: <div style="clear: both; float: left; margin-right:20px;">
: <a class="internal-link" href="https://genode.org">
: <img class="image-inline" src="https://genode.org/documentation/genode-foundations-title.png">
: </a>
: </div>
: </p>
* Adaptation to the re-stacked GUI stack introduced in
[https://genode.org/documentation/release-notes/20.08#The_GUI_stack__restacked - version 20.08]
* Coverage of the new uplink, capture, and event session interfaces
* Updated API documentation
: <div class="visualClear"><!-- --></div>
To examine the changes in detail, please refer to the book's
[https://github.com/nfeske/genode-manual/commits/master - revision history].
Base framework and OS-level infrastructure
##########################################
API refinements
===============
VFS-access utilities
--------------------
Low-complexity native Genode components do not depend on a C runtime. To allow
such components to still enjoy the power and flexibility of the Genode's VFS
infrastructure, we provide an evolving front-end API
[https://github.com/genodelabs/genode/blob/master/repos/os/include/os/vfs.h - os/vfs.h]
first introduced in version
[https://genode.org/documentation/release-notes/19.11#Virtual_file-system_infrastructure - 19.11].
The API is tailored and refined according to the relatively simple use cases
of low-complexity Genode components. The current release introduces a new
utility for the creation of new files, appropriately named 'New_file'. The
change is accompanied by a new 'Directory::create_sub_directory' method for
the easy creation of directory hierarchies.
Safeguarded arrays
------------------
To handle arrays in a safe and C++-like fashion, a new helper class has become
available at _base/include/util/array.h_. It accommodates an increasingly used
pattern where elements are dynamically added at construction time but stay the
same once the array is constructed.
Cosmetic changes
----------------
We refined the 'Range_allocator::alloc_aligned' interface to make it more
safe. The former 'from' and 'to' arguments are replaced by a single 'range'
argument. The distinction of the use cases of regular allocations vs.
address-constrained allocations is now covered by a dedicated overload instead
of relying on a default argument. The 'align' argument has been changed from
'int' to 'unsigned' to be better compatible with 'addr_t' and 'size_t'.
The 'Cache_attribute' type has been renamed to 'Cache'.
Input-event handling
====================
A central component for Genode's input-event handling functionality is the
event filter. It merges input events from multiple event sources and passes
them to the event sink (typically the GUI server). In between, it performs
low-level key remapping and applies character mapping rules. Character mapping
rules are essential for supporting different keyboard layouts (including
dead-key sequences). Low-level key remapping is, for instance, used for
changing the emitted key codes of the Num Pad keys according to the Num Lock
state. The different filter functionalities can be arbitrarily assembled into
a filter chain and provided as a dynamic config ROM to the event filter
component. The event sink then receives and processes the filtered events.
Some input devices emit unusual and/or extra key codes in certain situations,
which impedes the event sink's ability to detect key combos correctly. We
therefore added the functionality to completely mute certain key codes. In
order to ignore all unknown key codes for instance, we can now add an
'<ignore-key>' node to the config of the event filter.
! <remap>
! <ignore-key name="KEY_UNKNOWN"/>
! ...
! </remap>
Note, that '<ignore-key>' is part of the '<remap>' filter. The name attribute
refers to the low-level key name before any remapping rule has been applied.
As a second addition, we implemented a '<log>' filter that allows low-level
debugging of the event-filter component and its configuration. The '<log>'
filter can appear at each stage in the filter chain. For instance, we can log
the input events before and after the remap filter as follows.
! <log prefix="REMAPPED ">
! <remap>
! <log prefix="RAW ">
! ...
! </log>
! </remap>
! </log>
The optional 'prefix' attribute thereby helps to distinguish the log output
from different stages.
File-system helpers
===================
The
[https://genode.org/documentation/release-notes/18.08#New_component_for_querying_information_from_a_file_system - fs_query]
component is a simple helper to query information from a file system. E.g., it
is used by the file browser of Sculpt OS to obtain the directory structure.
The component received two welcomed improvements. First, directory content is
now reported in alphabetic order. Thereby, all consumers of the reports become
able to rely on deterministic output. For example, the file browser of Sculpt
OS, the launcher menu items, and the depot-selection items will appear in a
predictable way. Second, the size of files can be queried now. By adding an
attribute 'size="yes"' to a query, fs_query is instructed to report the size
of each queried file as attribute 'size' of the corresponding 'file' node.
Whereas fs_query inspects a file system without changing it, its sister
component fs_tool is able to perform file-system modifications. The new
version adds a '<new-file path="...">' operation, which writes the content of
the XML node into the file specified as 'path' attribute. The directory
structure leading to the file is implicitly created if needed. Should a file
with the specified name already exist, the original file will be overwritten.
Applications
############
File vault based on the CBE block encrypter
===========================================
Over several releases
([https://genode.org/documentation/release-notes/19.11#Preliminary_block-device_encrypter - 19.11],
[https://genode.org/documentation/release-notes/20.05#Feature-completeness_of_the_consistent_block_encrypter - 20.05],
[https://genode.org/documentation/release-notes/20.08#Consistent_Block_Encrypter - 20.08],
[https://genode.org/documentation/release-notes/20.11#Consistent_Block_Encrypter__CBE_ - 20.11]),
we persistently worked at a native solution for modern block encryption - the
SPARK-based CBE-library - and its integration into Genode's VFS. Even though,
this work was already suitable for real-world scenarios like
[https://genodians.org/m-stein/2020-06-12-cbe-linux-vm - hosting a Linux VM on top of an encrypted block device],
it still lacked stress-testing by a regular user base because its integration
into an end-user system - like Sculpt - required tedious low-level wizardry.
This situation had to change because we want to encourage as many people as
possible to expose the codebase around the CBE to their workflows and let it
mature. Therefore, we came up with a new package called file vault that can be
readily deployed on Sculpt OS. It is a graphical front end that aims at making
the creation, use, and maintenance of a CBE-based encrypted file store as
intuitive and secure as possible.
:Introducing the file vault:
[https://genodians.org/m-stein/2021-05-17-introducing-the-file-vault]
[image file_vault_setup]
The file vault only requires two file-system sessions from you (the trust
anchor is stored separately from the payload data). With that, it will
automatically create and connect a trust anchor, set up a CBE image, prepare
an ext2 FS on top of the CBE image and provide it through a file system
service - ready to be used like a simple directory. The directory can be
locked by closing the file vault and unlocked by starting the file vault on
the same trust anchor and entering the correct user passphrase. All controls
for the file vault's underlying CBE encrypter - like for its re-sizing and
re-keying functionality - are presented through a simple and guiding UI that
also provides you with the most relevant status information of your vault.
The file vault package is accompanied by some notable improvements regarding
CBE's key management. Whereas in the previous release, this aspect was still
merely a prototype with almost no protective value, the current implementation
embraces well-known algorithms to generate and encrypt the keys used within
the CBE respectively the file vault. This is explained in detail in the
aforementioned article.
As a note of caution, the primary purpose of the current version of the file
vault is to lift native block encryption in Genode from the development stage
to product quality. At the current stage, it is neither time-tested nor
reviewed by independent cryptography experts. Consequently, you should use it
with a healthy dose of suspicion, for non-critical data only! We would be more
than happy to receive feedback on your experience with the file vault.
VirtualBox
==========
Since the previous release, we continued the enablement of VirtualBox 6 on
Genode and put efforts into stabilizing the port. Therefore, we updated to
version 6.1.18 and reorganized the internal structure for a more
comprehensible execution model with fewer threads. Further, we improved
synchronization in multi-processor use cases and added a Sculpt runtime
package for vbox6.
Finally, as a little treat, our ports of VirtualBox now support to pass extra
buttons of five-button mice to the guest.
Device drivers
##############
Platform driver on ARM
======================
The current release streamlines Genode's API for interacting with the platform
driver on ARM platforms. It eases the access to memory-mapped I/O registers
and interrupts by introducing the notions of
:'Platform::Device': one device obtained from a platform session
:'Platform::Device::Mmio': locally-mapped MMIO registers of a device
:'Platform::Device::Irq': interface for receiving device interrupts
The API is covered in detail by the following article.
:One Platform driver to rule them all:
[https://genodians.org/nfeske/2021-04-29-platform-driver]
It goes without saying that this change touches most ARM-specific drivers.
Closely related, we also revised the concept of the XML based device-info
mechanism provided by the platform driver to accommodate both complex drivers
operating on multiple devices simultaneously such as driver stacks ported from
Linux as well as low-complexity drivers for simple devices. In the new
version, the device XML-information dataspace is only provided if the client's
session policy states 'info="yes"'. The format of the XML information got
refined to include the physical resource names (I/O memory and IRQ addresses)
instead of virtual IDs and page offsets and by using a 'type' attribute
instead of a '<compatible>' node to uniquely identify devices.
Changes specific to i.MX8
-------------------------
The platform driver incarnation specific to i.MX8 got slightly improved. It
can handle the configuration of reset-pins now. Analogously to the already
existent power domains, one can assign reset domains per device. Whenever a
device with a reset domain gets acquired, its reset-pins are de-asserted. When
the device gets released again, its reset-pins are asserted to put it into
reset state. A sample configuration looks as follows:
! <device name="mipi_dsi>
! <reset-domain name="mipi_dsi_pclk"/>
! ...
! </device>
Technically, those reset domains map to pin settings of the System Reset
Controller (SRC) that is part of the i.MX8 SoC. The SRC is under control of
the platform driver now. Currently, only the pins for the MIPI DSI Phy get
exported. They are used by the graphical subsystem to handle panels connected
via MIPI DSI.
I2C driver for i.MX8
====================
Thanks to Jean-Adrien Domage from [https://www.gapfruit.com - gapfruit], an
API for I2C bus transactions and a new I2C bus driver for the i.MX8 SoC
entered our framework. Coincidentally, the need to use the new I2C API more
intensively arose soon after his initial contribution. As a consequence, the
API got extended a bit. The result is a nice joint venture, and looks like the
following:
! void transmit(Transaction & t);
Hereby a 'Transaction' is a simple array of 'Message' objects, and a 'Message'
is an array of bytes that are either read or written. For very simple
use-cases, e.g., a client that polls single bytes from a temperature sensor,
some convenience utilities are incorporated into the 'I2c::Connection'.
USB
===
The USB-driver system has received quite a few refinements, performance
improvements, and robustness handling efforts during the current release
cycle. The HID subsystem is now capable of handling devices where the HID USB
interface is at an arbitrary location within the device descriptors - as
opposed to the assumption that the HID interface is always at the first
position in the interface list of the device. Also, the HID driver now handles
session destruction more gracefully and supports unlimited plug and unplug
events of an associated HID device.
For the USB host driver, various fixes of newer Linux kernel versions have
been back ported, which concern the handling of DMA memory. Error code and
timeout handling have been improved in order to support more corner cases, and
the USB session handles outstanding USB requests (synchronous and
asynchronous) on sudden session disconnects gracefully now.
The CPU usage of the host driver for isochronous transfers has been reduced
significantly for Intel XHCI controllers by adding a fix that reduces the
triggering of an interrupt for every completed isochronous packet to one
interrupt per eight packets, bringing the worst case scenario down to 1000
interrupts per second from a possible 8000 IRQs before.
NIC drivers
===========
Drivers for iPXE-supported Ethernet devices, Wifi adapters, and Linux TAP
devices now support the reporting of the MAC address of detected adapters.
The feature can be enabled by a '<report>' node in the driver configuration as
follows, prompting the driver to request a report session with the label
_devices_.
! <config>
! <report mac_address="true"/>
! </config>
The resulting report is depicted below.
! <devices>
! <nic mac_address="02:00:00:00:00:01"/>
! </devices>
Platforms
#########
Genode/Linux on 64-bit ARM
==========================
The release introduces the support for running the Linux version of Genode on
64-bit ARM platforms. As a part of this line of work, Genode's system call
bindings for Linux underwent a modernization to harmonize the system calls
across the supported CPU architectures. Furthermore, we took the opportunity
to simplify the use of the clone system call by eliminating the need for
passing a TLS pointer.
Expecting that the 64-bit Genode/Linux version will remain a niche use case of
Genode in the foreseeable future, we do not provide a pre-built tool chain.
Hence, as a preparatory step for using this version of Genode, the tool chain
must be built manually via Genode's _tool/tool_chain_ script.
As a known limitation, Genode's 'Trace::timestamp' function is not available
on this version of Genode because Linux prevents the user land from accessing
the cycle counter (pmccntr_el0). So the accuracy of timing is somewhat impeded
to the order of milliseconds. Also, the jitterentropy random-number generator
cannot be used.
Those limitations notwithstanding, one can successfully execute scenarios as
complex as _leitzentrale.run_. When using AARCH64 Linux as host, run scripts
can be executed with the same convenience as on Linux on a PC.
! $ make run/<script> KERNEL=linux BOARD=linux
Pine-A64-LTS single board computer
==================================
The current release continues
[https://genode.org/documentation/release-notes/21.02#Pine-A64-LTS_single_board_computer - our story]
of porting Genode to the
[https://pine64.com/product-category/pine-a64-ltslong-term-supply/ - Pine-A64-LTS]
board. We document the progress in great detail as we go.
# [https://genodians.org/nfeske/2021-03-05-pine-fun-testing - Kernel packaging and testing]
# [https://genodians.org/nfeske/2021-03-17-pine-fun-device-access - Device access from the user level]
# [https://genodians.org/nfeske/2021-04-29-platform-driver - One Platform driver to rule them all]
# [https://genodians.org/nfeske/2021-05-12-pine-fun-linux - Taking Linux out for a Walk]
# [https://genodians.org/nfeske/2021-05-19-pine-dts-pruning - Pruning device trees]
The accumulated material forms the basis for the evolving Genode Platforms
document introduced in Section [Updated and new documentation].
The code of this line of work is available at a dedicated repository:
:Genode board support for Allwinner SoCs:
[https://github.com/nfeske/genode-allwinner]
RISC-V
======
The support for the RISC-V architecture has further been developed into the
direction of a fully supported Genode platform. With this release, we wanted
to enable basic device driver support, which requires a working interrupt
controller. Since the "platform-level interrupt controller" (PLIC) is now
present on most hardware as well as on the Qemu emulator, we have added
support for the PLIC within our base-hw kernel.
With the interrupt controller in place, we implemented a driver for the
[https://opencores.org - OpenCores] Ethernet device as present on the
[https://hensoldt-cyber.com/mig-v - MiG-V] board. The driver component runs on
Qemu (with OpenCores enabled) as well as on the MiG-V board itself. Our RISC-V
board specific line of work can now be found within a separate
[https://github.com/ssumpf/genode-riscv - repository].
With driver support in place, the final step for full RISC-V support in Genode
is to extend our C library for this architecture.
Build system and tools
######################
Tool-chain update to GCC 10.3 and binutils 2.36
===============================================
About every two years, we update our tailored Genode tool chain to recent
versions. This year's update includes GCC 10.3.0, binutils 2.36.1 and GDB 10.2
together with their corresponding Genode libraries and tools (stdcxx, ADA
runtime, libsparkcrypto, gcov, sanitizer).
Feature-wise, changes are not as significant this time as with the
[https://genode.org/documentation/release-notes/19.05#Tool_chain_based_on_GCC_8.3.0_and_binutils_2.32 - previous update],
nevertheless we had to overcome some hurdles worth noting.
* The _gprbuild_ tool, which is needed to build the _ali2dep_
tool had a bug in the version provided by Ubuntu 18.04, which prevented it
from building _ali2dep_ with GCC/GNAT 10. To still be able to build the
tool chain on Ubuntu 18.04, the _gprbuild_ tool is now built from
source (of a newer version) when running the _tool_chain_ script.
* When building the tool chain on armhf Linux, errors occurred because
of mismatching float-abi compiler flags used when building the
dependency libraries (_gmp_, _mpc_, _mpfr_) with the host tool chain and
when building the Genode tool chain with the intermediate bootstrap
tool chain. To solve this problem, the dependency libraries are now
downloaded and built using the GCC build system. This also had the
effect that the _mpc_ and _mpfr_ Genode ports were not needed anymore
and got removed.
* GCC 10 reports more compile errors, which had to be fixed. The most common
errors related to narrowing conversions and potential unaligned pointers
from packed members.
* GCC 10 has the _-fno-common_ option set by default, which caused link
errors especially with some 3rd party ports.
* GCC 10 generated 'memset()' calls in implementations of 'memset()',
which caused stack overflows from this recursion.
* The ARM compiler generates more VFP instructions now, especially when
building for armv6, so we had to update the 'setjmp()' and 'longjmp()'
functions used by _dde_linux_ drivers to additionally save and restore the
FPU registers on ARM.
* With the new binutils version, linker sections with the same name in
multiple linker scripts are not merged anymore. Since we rely on this
behavior when building _core_ for NOVA, we reverted the corresponding change
with a patch.
* With the new binutils version, executable files are not allowed as input
when linking executable output files anymore. The build process of the
Fiasco.OC kernel relied on this behavior and needed to be adapted by the
upstream developers.
The new tool chain has not been enabled for RISC-V yet, because of an unsolved
issue on initialization (resp. initial relocation) of our dynamic linker.
Until we finalized the RISC-V support, we recommend using the tool chain
version 19.05 for this CPU architecture by adding the following two lines to
your build directory's _etc/tools.conf_.
! CROSS_DEV_PREFIX = /usr/local/genode/tool/19.05/bin/genode-riscv-
! REQUIRED_GCC_VERSION = 8.3.0
The updated tool chain can be built from source or downloaded in binary form
as described in this [https://genode.org/download/tool-chain - document].
Utilities for porting Linux drivers
===================================
Dummy-function generator
------------------------
While porting device drivers from the Linux kernel to Genode, one has to
tailor the environment that replaces the original kernel code. Thereby, tons
of missing function and variable implementations have to be written. Most of
them won't even be called by the driver under normal circumstances, but
nonetheless they are needed to link the executable binary.
The production of these dummy functions in the first place is a tiresome and
somewhat annoying work. To free developers from this burden, a new tool
entered the Genode framework under _tool/dde_linux/create_dummies_. Apart from
the creation of missing kernel functions and variables, it can also be used to
easily summarize all missing symbols during the porting work.
For a more detailed explanation of the new tool, please have a look at the
following article.
:Linux device driver ports - Breaking new ground:
[https://genodians.org/skalk/2021-04-08-dde-linux-experiments-1]
Device-tree source processing
-----------------------------
Device-tree source files as featured in the source tree of the Linux kernel
contain valuable information about the structure and parameters of SoCs and
boards. The porting and implementation of device drivers for Genode calls for
tooling that is able to extract and convert this information into digestible
forms. The current release introduces the first version of a new tool set at
_tools/dts/_ for this purpose.
[image dts_extract]
The tool aids the understanding of the hardware and allows for the pruning of
device trees down to a manageable complexity. As an illustration, the
spiderweb on the left shows the device-interdependencies of the Pine-A64-LTS
board. On the right, the device tree is pruned to cover only what's needed to
use Ethernet. The tool is covered in more detail by the following dedicated
article.
:Pruning device trees:
[https://genodians.org/nfeske/2021-05-19-pine-dts-pruning]
Cache for downloaded ports
==========================
When working with ports, it is not uncommon that a port hash is changed due to
some minor change like the addition of a patch. A subsequent call of
'prepare_port' would download the same files that were already downloaded
while preparing a previous version of the port even if the downloaded content
remains the same. This wastes internet bandwidth and developer time. The
current release introduces a simple cache for downloaded archives, which
alleviates these costs.
_Thanks to Tomasz Gajewski for his continuous contributions to improve our_
_development workflows._
Common hook for custom build rules
==================================
There are cases that call for building custom targets in addition to a regular
library or program. For example, the executable binary of an application may
be accompanied by generated data files. The creation of such build artifacts
can be expressed by custom make rules. However, a rule is triggered only if it
is a dependency of the build target. This can now be achieved by adding the
rule to the 'CUSTOM_TARGET_DEPS' variable. For example,
! CUSTOM_TARGET_DEPS += menu_view_styles.tar
!
! menu_view_styles.tar:
! $(VERBOSE)cd $(PRG_DIR); tar cf $(PWD)/bin/$@ styles
_Thanks to Tomasz Gajewski for this welcome contribution._

671
doc/release_notes/21-08.txt Normal file
View File

@@ -0,0 +1,671 @@
===============================================
Release notes for the Genode OS Framework 21.08
===============================================
Genode Labs
Genode 21.08 puts device drivers into the spotlight. It attacks the costs of
porting drivers from the Linux kernel and takes a leap forward with respect to
GPU support. This low-level work is complemented by several topics that
contribute to our vision of hosting video-conferencing scenarios natively on
Genode.
For those of you who follow Genode's release notes over the years, the
so-called DDE-Linux is a recurring topic. DDE is short for device-driver
environment and denotes our principal approach of running unmodified Linux
device-driver code inside Genode components. For over a decade, we iterated
many times to find a sustainable and scalable solution for satisfying Genode's
driver needs. Thanks to this enduring work, Genode enjoys support for modern
hardware such as Intel wireless chips or Intel graphics devices. However, when
looking beyond PC hardware, in particular at the plethora of ARM SoCs as
potential target platforms for Genode, we found our existing DDE-Linux
approach increasingly prohibitive because the investment of manual labour per
driver would become unbearable. It was time to recollect, draw from our
collective experience gathered over the past years, and re-envision what
DDE-Linux could be. Section [Linux-device-driver environment re-imagined]
presents the results of this recent line of development that promises to dwarf
the costs of driver-porting work compared to our time-tested approach. The
results have an immediate impact on our ambition to bring Genode to the
Pinephone as our added network and framebuffer drivers for the Allwinner A64
SoC leverage the new DDE already.
The challenge of using hardware-accelerated graphics (GPUs) on Genode makes a
guest appearance in the release notes on-and-off since version
[https://genode.org/documentation/release-notes/10.08#Gallium3D_and_Intel_s_Graphics_Execution_Manager - 10.08].
However, until now, GPU support has not become a commodity for Genode yet.
With the work presented in Section [Advancing GPU driver stack], we hope to
change that. For the first time, we identified a clear path to the
architectural integration of GPU support in sophisticated Genode scenarios
such as Sculpt OS. This outlook prompted us to revive the GPU stack in a
holistic way, including our custom Intel GPU multiplexer as well as the Mesa
stack.
Further highlights of the current release are an improved and updated version
of VirtualBox 6, refined user-level networking, the maturing integration with
host file systems when running Genode on top of Linux, and new media-playback
capabilities for our port of the Chromium web engine.
Linux-device-driver environment re-imagined
###########################################
Over more than a decade, the domestication of Linux device drivers for Genode
has evolved into a quest of almost epic proportions. This long-winded story
has been covered by a recent series of Genodians articles
([https://genodians.org/skalk/2021-04-06-dde-linux-experiments - first],
[https://genodians.org/skalk/2021-04-08-dde-linux-experiments-1 - second],
[https://genodians.org/skalk/2021-06-21-dde-linux-experiments-2 - third]),
which also goes into a technical deep dive of our recent developments.
On the one hand, we draw an enormous value from the device drivers of the
Linux kernel. Genode would be nowhere as useful without the Intel wireless
stack, USB host-controller drivers, or the Intel graphics driver that we
ported over from Linux. On the other hand, those porting efforts are draining
a lot of our energy. Linux kernel code is not designed for microkernel-based
systems after all. Consequently, the transplantation of such code does not
only require a solid understanding of Linux kernel internals, but also ways to
overcome the friction between two radically different operating-system-design
schools (monolithic and component-based) and friction between implementation
languages (C and C++).
Even though we are not short of evidence of successful driver ports, we are
very well aware of several elephants in the room:
Economically, each driver port must be understood as a distinct project of
non-trivial costs. E.g., the port of the i.MX8 graphics driver took us two
months. That's certainly minuscule compared to a driver written from scratch.
But it is still expensive and we feel that those expenses hold us back.
Second, once ported, later updates of drivers to a new kernel version are
costly and risky. But such updates are unavoidable to keep up with new
hardware. The larger the arsenal of device drivers, the bigger this problem
becomes.
Third, the skill set of the porting work is the cross point of Linux kernel
competence and Genode competence. In other words, it's rare. To make Genode
compatible to a broader spectrum of hardware in the long run, driver porting
must become an easily attainable skill rather than black art.
With the current release, we introduce a vastly improved approach to the reuse
of Linux device drivers on Genode. It entails three aspects:
:Code: Reusable building blocks for crafting custom runtime environments
to bring Linux kernel code to fly, and for interfacing Genode's session
interfaces with Linux kernel interfaces.
:Tooling: A custom tool set that automates repetitive work such as generating
dummy implementations of Linux kernel functions.
:Methodology: Consistent patterns and exemplary test scenarios serving as
guiding rails for the development work.
The following illustration maps out the first aspect, the various pieces of
code involved in hosting unmodified Linux driver code on Genode.
The clear separation of those parts reinforces a degree of formalism - in
particular about separating C and C++ - that was absent in our previous takes.
[image dde_linux_parts]
A driver is a Genode component. So the outer border of the picture is Genode's
bare-bones C++ API. At the lower end, the API provides access to device
resources such as interrupts and memory-mapped device registers. At the higher
end, the API allows the driver to play the role of a service for other
components through one of Genode's session interfaces.
The lower (blueish) part of the picture is concerned with the runtime
environment needed to make the Linux kernel code feel right at home. The gap
between Genode's API and Linux kernel interfaces is closed in two steps.
First, the so-called *lx_kit* library implements handy mechanisms for building
the meaty parts of the runtime in C++. For example, it provides a user-level
task scheduling model that satisfies the semantic needs of Linux. The lx_kit
is located at _dde_linux/src/include/lx_kit_ and _dde_linux/src/lib/lx_kit/_
Second, the *lx_emul* (short for Linux emulation) code wraps the lx_kit
functionality into C interfaces. The functions of those interfaces are
prefixed with 'lx_emul_' and serve as basic primitives for re-implementing
(parts of) the original Linux kernel-internal ABI. Although the previous
version of DDE Linux already featured the principle lx_kit and lx_emul
fragments, the new design applies the underlying idea much more stringent,
fostering the almost galvanic separation between C and C++ code. In
particular, C++ code never includes any Linux headers. The lx_emul code also
comprises driver-specific dummy implementations of unused kernel functions.
The handy tool at _tool/dde_linux/create_dummies_ automates the creation of
those dummy implementations now. Finally, the lx_emul code drives the startup
of the Linux kernel code by executing initcalls in the correct order. The
reusable building blocks of lx_emul are located at
_dde_linux/src/include/lx_emul/_ and _dde_linux/src/lib/lx_emul/_
When looking from the upper (greenish) end, the *genode_c_api* library is a
thin wrapper around Genode's session interfaces. It enables C code to
implement a Genode service such as block driver or network driver. The
genode_c_api library is located at _os/include/genode_c_api/_ and
_os/src/lib/genode_c_api/_.
The red area contains sole C code, most of which is unmodified Linux kernel
code. It is supplemented with a small *lx_user* part that uses both the
genode_c_api as well as Linux kernel interfaces to connect the unmodified
Linux kernel code with the Genode universe.
We address the second aspect - the tooling - by the growing tool set at
_tool/dde_linux/_. The biggest time saver is the _create_dummies_ tool, which
automates the formerly manual task of implementing dummy functions to quickly
attain a linkable binary. It is complemented with the _extract_initcall_order_
tool, which supplements lx_emul with the information needed to perform all
Linux initialization steps in the exact same order as a Linux kernel would do.
The third aspect - the methodology - is embodied in two source-code
repositories that leverage the new DDE-Linux approach for two distinct ARM
SoCs, namely i.MX8MQ and Allwinner A64.
:Genode support for i.MX8MQ SoC:
[https://github.com/skalk/genode-imx8mq]
:Genode support for Allwinner A64 SoC:
[https://github.com/nfeske/genode-allwinner]
The most pivotal methodological change is the way how we deal with the
Linux-internal API now. In our previous work, we used to mimic the content of
kernel headers by a custom-tailored emulation header _lx_emul.h_ per driver.
Whereas these driver-specific API flavors catered our urge to keep transitive
code complexity at bay, they required significant and boring manual labour.
Now we changed our minds to reusing the original Linux headers, thereby
greatly reducing the amount of repetitive work while reducing the likelihood
for subtle bugs.
Success stories
---------------
Both repositories linked above employ the re-imagined DDE-Linux approach to
resounding success. The i.MX8MQ repository features drivers for framebuffer
output and SD-card access,
[https://genodians.org/skalk/2021-08-02-mnt-reform2-sdcard - targeting the MNT Reform laptop].
The Allwinner repository contains a network driver for the Pine-A64-LTS board
and a new framebuffer driver for the Pinephone. No single line of Linux code
had to be changed.
We found that the development of those driver components took only a fraction
of time compared to our past experiences. The most unnerving aspects of the
driver porting work have simply vanished: Subtle incompatibilities between C
and C++ are ruled out by design now. The hunt for missing initcalls is no
more. No dummy function must be written by hand. The compilation of arbitrary
Linux compilation units works instantly without manual labour.
This - in turn - brings the experimental addition or removal of kernel
subsystems down from hours to seconds, turning the development work into an
exploratory experience.
That said, it is not all roses. Components based on Linux drivers have to
carry substantial Linux-specific bureaucracy along with them. The resulting
components tend to be somewhat obese given their relatively narrow purpose.
E.g., the executable binary of the framebuffer driver for the Pinephone is
1.5 MiB in size, most of which is presumably dead weight.
Transition
----------
Our existing and time-tested Linux-based drivers located in the _dde_linux_
repository have remained untouched by the current release.
We plan to successively update or replace those drivers using the new
approach. Until then, the original components refer to the old approach as
"legacy". E.g., the former implementation of lx_emul has been moved to
_dde_linux/src/include/legacy/lx_emul/_.
Advancing GPU driver stack
##########################
With release 21.08, we take a major leap towards 3D and GPU support on Genode.
This topic has been on the slow burner for a while now and we were happy to be
able to finally revive this topic. On the Mesa front, we conducted an update
to version 21.0.0 (Section [Mesa update]), while adding more features and new
platforms to our
[https://genode.org/documentation/release-notes/17.08 - Intel GPU multiplexer].
On Intel platforms, there exists no hardware distinction between the display
controller and 3D acceleration, as both functions are provided by the GPU.
Other platforms, e.g. ARM based SoCs, often contain a separate display and a
GPU device, making it possible to isolate display configuration within a
separate driver. Therefore, we are glad to report that we found a solution on
how to separate display and 3D acceleration on Intel systems.
Mesa update
-----------
Genode's port of the
[https://www.mesa3d.org - Mesa 3D graphics library] dates back to version
11.2.2 that was released in 2016 while the current version is past 21 by now.
Because of this version gap, we decided to start with a fresh port of Mesa
instead of solely updating from version 11. The more recent version enabled us
to switch from Mesa's DRI drivers (i965) to the
[https://de.wikipedia.org/wiki/Gallium3D - Gallium] version (Iris) for Intel
GPUs.
[https://xdc2018.x.org/slides/optimizing-i965-for-the-future.pdf - Iris]
is Intel's redesigned version of the dated i965 driver that aims to lower CPU
usage and improved performance. It is the only driver that supports Gen 12
(Intel's current Xe GPU architecture) while also removing support for old
Intel generations. As Genode supports Gen 8 (Broadwell) platforms only, we
felt that Iris is the driver of choice for the future.
GPU multiplexer improvements
----------------------------
The GPU multiplexer received stability improvements, new features required by
Mesa's Iris driver, i.e. context isolation and sync objects, and bug fixes
prompted by supporting newer GPU generations. These generations include Gen 9
(Skylake) and Gen 9.5 (Kaby Lake), with more versions to come. Please note
that this line of work is not finished and is as of now in a preliminary state
with ongoing efforts.
The GPU multiplexer as a platform service
-----------------------------------------
As stated at the beginning of this chapter, Intel PC platforms have no
distinction between the display device and the 3D rendering. Both functions
are integrated into the GPU as display engine and render engine. This implies
that Genode's Intel framebuffer/display driver has to share resources with the
GPU multiplexer. The co-location of both drivers in one component, however,
violates Genode's core principle of a minimally-complex trusted computing
base. Whereas the complex display driver should best be a disposable component
([https://fosdem.org/2021/schedule/event/microkernel_pluggable_device_drivers_for_genode/ - FOSDEM talk]),
the GPU driver must ideally be realized as a low-complexity resource
multiplexer.
We eventually found a way to solve this contradiction: On Genode, each driver
requests the hardware resources to program a device from the platform driver
via the platform session. As these resources cannot be shared, we came up with
the idea that the GPU multiplexer requests all GPU resources and itself
provides a platform service for the display driver. It hands out the subset of
resources that are related to display handling and forwards display
interrupts. This approach is completely transparent to Genode's Intel display
driver.
[image gpu_architecture]
System integration of the GPU driver/multiplexer and the framebuffer driver
as distinct components
We already have implemented this solution for Gen 8 and are working on newer
generations.
Future prospects
----------------
In the current state, we are still working on newer Intel (Gen9+) GPU support
and are planning to integrate this line of work into Sculpt release 21.09 with
a small demo scenario (e.g., [https://github.com/glmark2/glmark2 - Glmark2]
that is now available in Genode world).
Additionally, there is ongoing work to support
[https://www.verisilicon.com/en/IPPortfolio/VivanteGPUIP - Vivante] GPUs as
utilized by i.MX SoCs. As of now Mesa's etnaviv driver is included in our
Mesa update and a GPU multiplexer component based on the Linux DRM driver is
available as a preview on
[https://github.com/cnuke/genode/commits/21.08-etnaviv - this] topic branch.
Base framework and OS-level infrastructure
##########################################
Revised cache-maintenance interface
===================================
The base library used to expose a single cache-maintenance function to
user-level components, namely 'cache_coherent'. It is primarily needed to
accommodate self-modifying code, e.g., for JIT compilers, to write back
data-cache lines, and invalidate the corresponding instruction-cache lines.
However, we found that the proper support for cached DMA buffers in Linux
device-driver ports calls for two additional semantic flavours.
One is needed whenever driver code initially writes data to a DMA buffer
before handing over the buffer to the device. Linux driver code usually issues
a 'dma_map_*' call in this case to ensure that data gets written out to memory
and the data cache is invalidated. This scenario is now covered by the new
'cache_clean_invalidate_data' function.
The other flavor is needed to invalidate data-cache lines before reading
device-generated content from a DMA buffer. Linux driver code usually calls a
'dma_unmap_*' function in this case. This case is now covered by the new
'cache_invalidate_data' function.
Both functions are provided for the base-hw and Fiasco.OC kernels on the ARM
architecture.
Improved host file-system access on Genode/Linux
================================================
Genode has included a component for host file-system access on Linux for
years, but the state of the implementation and the feature set limited its
application to mere debugging or development scenarios. This release improves
*lx_fs* in certain areas to permit common use cases and scenarios.
First, the file-system server gets support for the unlinking of files, which
was left out in the past to prevent accidental deletion of files on the host.
The current version includes a robust implementation of the feature, which is
confined to the configured sub-directory.
Further, sessions track client-specific consumption of resources (namely RAM
and capabilities) and also support dynamic resource upgrades. Last, we added
file-watching support to lx_fs, which enables monitoring files for changes
based on the inotify interface of the Linux kernel. The implementation is
prepared to handle bursts of changes by limiting the rate of notifications to
the client.
These improvements were contributed by Pirmin Duss.
New black-hole component
========================
A commonly requested feature for Sculpt OS is that it would be nice to have
the ability to wire up various sessions of a deployed component to a dummy
version of the required service. This way, the user could easily start an
application that would normally require, for example, an audio-out session but
connect it to a "black hole" component that simply drops all audio data. This
would be especially useful if no hardware driver for a specific device is
available on a particular platform, but would also allow for more fine-grained
privacy control.
For this release, we created a first version of the black-hole component,
which provides a dummy implementation of the audio-out session when enabled in
the configuration:
! <config>
! <audio_out/>
! </config>
More session types are intended to be added in future releases.
NIC router
==========
With this release, the NIC router receives an enhancement of its feature for
forwarding DNS configurations via DHCP, a sensible way of dealing with
fragmented IPv4 packets, and some minor cleanups regarding its configuration
interface. The update changes the configuration interface of the NIC router in
a non-compatible way. Hence, systems that integrate the router might require
adaptation. At the end of this section, you can find an overview of how to
adapt systems properly.
The NIC router now interprets the IPv4 flags "More Fragments" and "Fragment
Offset" in order to determine whether an IPv4 packet is fragmented or not.
Fragmented packets are dropped safely while the unfragmented ones are routed
as usual. The decision to drop fragmented packets by default is the result of
a long discussion among users and developers of the NIC router. That
discussion came to the conclusion that the complexity overhead and security
risks of routing fragmented IPv4 outrun its relevance in modern world
networks. Therefore, we assume that for the common user of the router, a
simple rejection of fragmented IPv4 is the better deal.
The consideration of IPv4 fragmentation is accompanied by several ways of
communicating the router's decision to drop fragmented packets. If the config
flag 'verbose_packet_drop' is set, the router prints a message "drop packet
(fragmented IPv4 not supported)" for each dropped fragment to the log. If the
new attribute 'dropped_fragm_ipv4' in the config tag '<report>' is set, the
router will report the number of packets dropped due to fragmentation. Last
but not least, the NIC router can also be instructed to inform the sender of a
dropped IPv4 fragment by sending an ICMP "destination unreachable" reply. Like
the other feedback mechanisms, this is deactivated by default and can be
activated by setting the new config attribute 'icmp_type_3_code_on_fragm_ipv4'.
The attribute must be set to a valid ICMP code number that is then used for
the replies.
The run script 'nic_router_ipv4_fragm' demonstrates the router's behavior
regarding fragmented IPv4.
For many years, the DHCP server of the NIC router is capable of sending DNS
configuration attributes with its replies. At first, this was only a single
DNS server address. With
[https://genode.org/documentation/release-notes/21.02#NIC_router - Genode 21.02],
this has been extended to a list of DNS server addresses. Sending such address
lists has now been made more conforming to the RFCs in that the server will
list them all in one option 6 field instead of adding one option 6 field per
address. Consequently, the DHCP client of the router now also considers only
the first option 6 field of a reply but may parse multiple addresses from it.
Another new feature is that the DHCP client of the router now remembers the
domain name (option 15) of a DHCP reply that leads to an IPv4 configuration.
Analogously, the DHCP server will send a domain name with DHCP replies if such
a name is at hand. As with DNS server addresses, the DHCP server can obtain
the domain name either statically through its configuration (new config tag
'<dns-domain>') or dynamically from the results of a DHCP client of another
domain. The latter is achieved by setting the new config attribute
'dns_config_from' that replaces the former attribute 'dns_server_from'. If
'dns_config_from' is set to the name of another domain, the DHCP server will
use both the DNS server addresses and the DNS domain name of the domain.
DNS domain names that were stored with a dynamic IPv4 configuration in the
router are also reported via the new report tag '<dns-domain>' whenever the
'config' attribute in the config tag '<report>' is set. As with DNS server
addresses, this allows for manual forwarding and filtering through individual
management components (see
[https://genode.org/documentation/release-notes/21.02#NIC_router - Genode 21.02]).
As a delayed adaption to the
[https://genode.org/documentation/release-notes/21.02#Pluggable_network_device_drivers - introduction of the Uplink session]
two Genode releases ago, the term "Uplink", that was used in combination with
the NIC router to refer to NIC sessions that the router requested itself, has
been re-named more accurately to "NIC client". This is meant to prevent
confusion with the new session type and, most notable to users, implies that
the tag '<uplink>' in router configurations got re-named to '<nic-client>'.
How to adjust Genode 21.05 systems to the new NIC router
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* At each occurrence of the '<uplink ...>' tag in a NIC router configuration,
replace the tag name 'uplink' with 'nic-client'. The rest of the tag stays
the same. This does not yield any semantic changes.
* At each occurrence of the 'dns_server_from' attribute in a NIC router
configuration, replace the attribute name with 'dns_config_from'. The
attribute value remains unaltered. Be aware that this will add forwarding of
DNS domain names to your system. Forwarding DNS server addresses but not DNS
domain names is not supported anymore.
RAM framebuffer driver for Qemu
===============================
During graphical application development on ARMv8, it became obvious that
Genode still lacked framebuffer-driver support on Qemu for ARMv8, thus
rendering test execution on real hardware mandatory. In order to speedup test
and development time for graphical applications, we enabled RAM framebuffer
support for the "virt_qemu" board by adding a 'driver_interactive-virt_qemu'
package. The package contains a 'ram_fb_drv' that configures a RAM framebuffer
through Qemu's firmware interface and uses the capture session interface to
provide access to the framebuffer.
To test drive the driver, you can execute any Genode run script that requires
graphical applications. The following example shows how to execute the demo
run script in Qemu:
* In _<genode_dir>/build/arm_v8a/etc/build.conf_ change
! # use time-tested graphics backend
! QEMU_OPT += -display sdl
to
! QEMU_OPT += -device ramfb
* In _<genode_dir>/build/arm_v8a_ execute
! make KERNEL=hw BOARD=virt_qemu run/demo
Sandbox API
===========
When using [https://github.com/nfeske/goa - Goa], we noticed that using the os
API caused binaries to be always linked against 'sandbox.lib.so' because its
symbols were part of the api archive as well. We therefore decided to separate
the sandbox API from the os API by moving the header files to
_repos/os/include/sandbox/_ and providing them in a distinct api archive along
with the library symbols.
Libraries and applications
##########################
Updated and improved VirtualBox
===============================
Our ongoing development efforts with VirtualBox 6.1 extended the
implementation in various aspects. With this release, we updated the version
to 6.1.26 published in July to stay in sync with upstream developments. This
version especially improves the audio back end for the OSS interface and
graphics.
On the integration side, VirtualBox 6 now supports dynamic framebuffer
resolutions and the capslock ROM mode. The latter is important to provide the
user a consistent system-wide capslock state, which is controlled by a global
capslock ROM and virtual KEY_CAPSLOCK events forwarded to guest operating
systems. Per default, a raw mode is used and capslock input events are sent
unfiltered to the guest. For ROM mode, VirtualBox may be configured like
follows.
!<config capslock="rom">
The network-device model in VirtualBox 5 uses the MAC address from the
connected NIC session. We added this behavior also to VirtualBox 6. During the
past months, we also observed significant performance issues with the AHCI
model, which we address in this release. The background is that our port of
VirtualBox 6 limits changes to the original code and execution model to a bare
minimum. This renders updates of the upstream version less expensive, but on
the other hand, uncovers some inherent assumptions about the runtime behavior
(i.e., scheduling of threads) in the original implementation that must be
addressed.
Qt5 and QtWebEngine
===================
In this release, we enabled SSL server certificate validation and support for
multimedia playback in our ports of QtWebEngine and the Falkon web browser.
More specifically, we ported the 'nss' library for the SSL certificate
validation and the 'sndio' library as back end for the audio playback
functionality and enhanced our OSS audio VFS plugin accordingly.
The following screenshot shows an example use case of Falkon as a private
multimedia browser, which stores all session data, like cookies, in RAM only.
In the future, we also want to enable support for multimedia input and,
consequently, private video conferences.
[image falkon_youtube]
Modular integration of LTE modem stack in Sculpt OS
===================================================
In version [https://genode.org/documentation/release-notes/21.02#LTE_modem_stack - 21.02],
we announced the LTE modem support as a prerequisite for using Genode on the
Pinephone. Since most of our development laptops also come with LTE modems or
an extension slot for installing one, we explored ways to augment the Sculpt
scenario with mobile networking on demand, i.e., by the installation of
additional components. The result is documented by means of an
[https://genodians.org/jschlatow/2021-07-21-mobile-network - article on genodians.org].
Webcam improvements using libuvc
================================
With webcam support added by the previous release, we discovered some
complications with devices that implement the UVC spec in version 1.5. We
found one of those devices in a Thinkpad T490s. Since
[https://ken.tossell.net/libuvc/doc - libuvc] did not fully implement this
version of the spec, we added a patch for this. The main issue was the
different size of the video probe and commit control messages. Interestingly,
the problematic device is quite picky in this regard and only responds when
the size was set correctly. In connection with this, we fixed a bug in our
[https://libusb.info - libusb] back end, which caused the size of USB control
messages being wrongly calculated.
Apart from these device-specific issues, the webcam driver now enables auto
exposure in order to adapt to different lighting conditions.
Sndio audio library
===================
To complement the VFS OSS-plugin introduced in release
[https://genode.org/documentation/release-notes/20.11 - 20.11], we ported the
[https://sndio.org - sndio] library to Genode. It contains an OSS back end
that prompted us to broaden the functionality of our VFS plugin to satisfy
the requirements of the library. This is in line with the envisioned plan to
extend the OSS plugin incrementally to cover more use cases.
The sndio framework features a server component besides the library but for
the moment, we focus solely on using sndio in a client context. Here the
component, e.g., cmus and Falkon, uses the library to access the sound device
directly.
Build system and tools
######################
Tool-chain support for RISC-V
=============================
As one might have noticed, Genode's RISC-V tool chain is absent in tool-chain
release
[https://sourceforge.net/projects/genode/files/genode-toolchain/21.05/genode-toolchain-21.05-x86_64.tar.xz/download - 21.05]
because it still had issues at the release time. These issues, namely the
problem of the dynamic linker's self relocation during program startup have
been resolved during this release cycle. The RISC-V tool chain can now be
built manually using Genode's regular 'tool_chain' script:
! <genode-dir>/tool/tool_chain riscv ENABLE_FEATURES="c c++ gdb"
Run tool
========
Genode's custom workflow automation tool called 'run' received the following
enhancements.
To ease the hosting of driver packages outside of Genode's main repository -
an emerging pattern for supporting new SoCs - we replaced the formerly
built-in names of board-specific 'drivers_nic' and 'drivers_interactive' depot
packages by the convention of appending the board name as a suffix, e.g.,
'drivers_nic-pine_a64lts'. Hence, new hardware support can now be added
without touching the run tool.
The ARM fastboot plugin can now be used on 64-bit ARM platforms in addition to
32-bit ARM. Its formerly mandatory parameter '--load-fastboot-device' has
become optional and can be omitted if only one device is present.
A new _image/uboot_fit_ plugin enables the use of U-Boot's new FIT (flattened
image tree) image format (carrying the extension 'itb'), which supersedes the
uImage format. The new format simplifies the booting of a Linux system, which
typically requires not only a kernel image but also a device-tree binary and a
RAM disk. A FIT image combines all ingredients into a single file and adds
some metadata like checksums. Note, however, that booting an _image.itb_,
which doesn't contain a device-tree binary may cause U-Boot's 'bootm' command
to fail. A workaround for this is to execute the individual boot steps
separately, which skips the Linux-specific preparatory steps that depend on
the device-tree binary:
! bootm start
! bootm loados
! bootm go
Removal of deprecated components
################################
In the release notes of version
[https://genode.org/documentation/release-notes/20.11#Retiring_the_monolithic_USB_driver - 20.11],
we announced the retirement of our traditional monolithic USB-driver
component, which used to combine host-controller drivers together with USB
storage, HID, and networking drivers in a single component. With the current
release, we ultimately completed the transition to our multi-component USB
stack and removed the deprecated monolithic USB driver.

View File

@@ -14,121 +14,92 @@ 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 2019
Review of 2020
##############
For the road map 2019, we picked "bridging worlds" as our guiding theme:
(1) Lowering the friction when combining existing software with Genode,
(2) Fostering interoperability with widely used protocols and APIs, and
(3) Making Genode easier to approach and generally more practical.
The overarching theme of our road map for 2020 was "Dwarfing the barrier of
entry", which expressed the ambition to reach a wider audience. On that
account, we identified four promising directions: First, making Sculpt OS
palatable for a wider circle. Second, fostering the public perception of the
high quality of Genode to reinforce the confidence of people who are sceptical
towards novel operating-system technology. Third, lowering the barrier of
entry by providing frictionless tooling. And fourth, publicly presenting use
cases that prove the fitness and flexibility of Genode. These directions
certainly did a good job of motivating the working topics of last year's four
releases
[https://genode.org/documentation/release-notes/20.02 - 20.02],
[https://genode.org/documentation/release-notes/20.05 - 20.05],
[https://genode.org/documentation/release-notes/20.08 - 20.08], and
[https://genode.org/documentation/release-notes/20.11 - 20.11].
With respect to (1), we identified Genode's custom tooling (build
system, run scripts, ports mechanism, depot tools) as a point of
friction. They are arguably powerful and flexible but require a lot of
up-front learning. This is certainly a burden unacceptable for a casual
developer without a black belt in Make and Expect/Tcl. The new
[https://genode.org/documentation/release-notes/19.11#New_tooling_for_bridging_existing_build_systems_with_Genode - Goa]
tool rearranges the existing tools in a way that puts the concerns of casual
developers into focus, allowing for the use of commodity build systems,
eliminating Tcl syntax from the equation, running sub-second test cycles, and
streamlining the packaging of software.
The UI improvements of Sculpt OS in version 20.02 largely eliminated the need
to use the command line as presented
[https://www.youtube.com/watch?v=vmgWgzeKAjU - here].
The second direction - software quality - motivated the steady improvements of
our POSIX runtime, ultimately enabling highly sophisticated workloads like the
Chromium web engine on Genode. Regarding our stated commitment to 64-bit ARM
hardware, in particular supporting the NXP i.MX8 SoC, we covered 64-bit
multi-core virtualization, HDMI, touch input, OLED, networking, LTE, USB,
clock and power management, VirtIO, up to running Sculpt OS on this platform.
On account of (2), we
[https://genode.org/documentation/release-notes/19.05#Broadened_CPU_architecture_support_and_updated_tool_chain - switched to C++17]
by default, fostered the use of
[https://genodians.org/ssumpf/2019-02-27-java-19-02 - Java],
updated Qt5, and put
[https://genode.org/documentation/release-notes/19.11#C_runtime_with_improved_POSIX_compatibility - POSIX]
compatibility into the spotlight. We were eventually able to dissolve the need
for our custom Unix runtime (Noux) because all features of Noux are covered by
our regular libc now.
Our biggest step towards (3) is the [https://genodians.org] website we
started in winter 2019, which gives individual members of our community
an easy way to present thoughts, projects, and experiences.
Complementing Genode's formal documentation, it also conserves practical
tips and tricks that were previously not covered in written form.
When speaking of "bridging worlds", we should not forget to mention the
tremendous effort to bring Sculpt-OS-like workloads to the 64-bit ARM world.
Thanks to the added support for
[https://genode.org/documentation/release-notes/19.08#64-bit_ARM_and_NXP_i.MX8 - multi-core AARCH64],
hardware-based
[https://genode.org/documentation/release-notes/19.11#Virtualization_of_64-bit_ARM_platforms - virtualization],
and network/USB/graphics drivers for the i.MX8 SoC, the flexibility of Sculpt
OS will eventually become available on PC hardware and ARM-based devices
alike.
Over the course of 2019, we admittedly skipped a few topics originally
mentioned on our road map. In particular, the user-visible side of
Sculpt OS received less attention than originally envisioned. We also
deferred several ideas we had in mind about reworking our GUI stack.
Instead, we expanded our work in the areas of storage (block-level APIs,
test infrastructure,
[https://genode.org/documentation/release-notes/19.11#Preliminary_block-device_encrypter - block encryption])
and
[https://genode.org/documentation/release-notes/19.08#Flexible_keyboard_layouts - input processing].
This shift of focus is mostly attributed to the priorities of Genode Labs'
customers who fund our work.
Granted, Genode's audience hasn't increased by a large margin as a direct
result of these efforts. But as illustrated by the fruitful road-map
discussion for 2021 on the
[https://genode.org/community/mailing-lists - mailing list],
our community is more engaged and enthusiastic than ever before.
2020 - Dwarfing the barrier of entry
####################################
2021 - Optimization and Platform diversity
##########################################
Genode as a technology is there. For more than one decade, we walked unfathomed
territory, fought with countless deep rabbit holes, took risky decisions,
tracked back, explored design spaces, developed taste and distaste, pruned
technical debt, and eventually found formulas of success. Today, there are no
(fundamental) unsolved questions. All the puzzle pieces are in place. There
could be no better proof than our daily use of Sculpt OS. The time is right
to make Genode palatable for a wider circle. We identified four actionable
topics to achieve that.
For the initial conquering of 64-bit ARM territory, restraining our focus to
one particular SoC - namely NXP i.MX8 - was a healthy approach. Now it is the
right time to optimize and to branch out the development to further
platforms. The following key aspects of our road map for 2021 reflect that.
:User friendliness of Sculpt OS:
:Pinephone:
By the end of the year, we want be able to use Genode on the
[https://pine64.com/product-category/pinephone/ - Pinephone]
as a feature phone, covering basic web-browsing needs, placing calls, and
SMS.
Until now, Sculpt OS is not exactly friendly towards users who are
unfamiliar with the Unix command-line tools. Since Sculpt is not Unix
based, this is a bit paradoxical. 2020 will give Sculpt OS a friendlier
and discoverable user experience. In this context, we will inevitably
put our attention to Genode's GUI stack.
:Linux-device-driver environment re-imagined:
We are convinced that we have to dramatically reduce the engineering
effort needed to port device drivers from the Linux kernel to Genode. With
many years of driver-porting experience under our belts, we plan to condense
the lessons learned in the form of new tooling and documentation. This, in
turn, will hopefully pave the ground for more and more developers
contributing to Genode's device-driver coverage in the future.
:Perception of high quality:
:Developer experience:
Speaking of new developers, we see Genode's existing tool set as a barrier
because it requires a rather steep learning curve. Hence, this year, we will
have a fresh take on tooling and workflows. The starting point will be the
experimental [https://github.com/nfeske/goa - Goa] tool, which in principle
allows developers to use familiar build systems for Genode development. We
plan to extend Goa to cover more build systems, and shape the tool towards
system-integration tasks and quick compile-test cycles targeting embedded
devices.
Compared to commodity operating systems who stood the test of time,
Genode is a young and largely unproven technology. It understandably calls
for skepticism. All the more we must leave no doubts about our high
quality standards. There must be no room for uncertainty. Hence, during
2020, we will intensify the consolidation and optimization of the framework
and its API, and talk about it.
:Optimization:
Motivated by usage scenarios like the Pinephone, we are eager to tap into
plenty of opportunities for optimization. Based on data gathered by improved
system tracing, we consider interface refinements to improve the batching of
I/O (file-system access, networking), micro-optimizations of hot code paths
(like TLS lookup, parsers, and allocators), as well as structural changes
(like the consolidation of low-level services).
:Enjoyable tooling:
Genode's success at large will depend on developers. As of today, software
development for Genode requires a huge up-front learning curve. This is
fine for people who are already convinced of Genode. But it unacceptable
for casual developers who want to get their toes wet. We should aim for
tooling that allows new developers to keep up their flow and beloved
tools. The recently introduced [https://genodians.org/nfeske/2019-11-25-goa - Goa]
tooling is our first take in this respect. It is certainly too early to call
Goa a success. In order to find out if we are on the right track, we want to
expose Goa to as many problems as possible, primarily by the means of
porting software. Also, things like IDE usage or adapters for a variety of
build systems will certainly move into focus in 2020.
:Convincing use cases:
Use cases can give exemplary proof of the fitness of Genode. We already
took a few baby steps to extend the range of documented use cases beyond
Sculpt OS last year. The boot2java scenenario comes in mind. 2020 will
hopefully see several more illustrations of Genode's versatility.
:GPU support:
Distantly related to optimization, GPU support is an increasingly requested
feature. We already
[https://genode.org/documentation/release-notes/17.08#Hardware-accelerated_graphics_for_Intel_Gen-8_GPUs - wetted our toes]
in the past. But GPU support has not yet become routinely supported in
system scenarios like Sculpt OS. In 2021, we want to change that, making GPU
support a feature that can be relied on. We will primarily address Intel
graphics first but also explore GPUs on ARM-based devices.
Apart from this overall theme, we plan to continue our commitment to the
NXP i.MX SoC family, revisit Genode's low-latency audio support, and
extend the cultivation of Ada/SPARK within (and on top of) Genode.
Milestones for 2020
Milestones for 2021
###################
In the following, we present a rough schedule of the planned work. As usual,
@@ -136,64 +107,65 @@ it is not set in stone. If you are interested in a particular line of work,
please get in touch.
February - Release 20.02
February - Release 21.02
========================
* Consolidation: removal of the Noux runtime
* Library version of the init component
* Updated audio drivers
* Sculpt
* 64-bit ARM (i.MX8)
* Revised administrative user interface
* System image without Unix tools
* Pluggable device drivers (NIC, WLAN, framebuffer, input)
* VirtualBox 6
* Sculpt: basic UI for the consistent block encrypter (CBE)
* 64-bit ARM
* VirtIO block-device support for virtual machines
* Base platform support for the Pine A64 board (kernel base framework)
May - Release 20.05
May - Release 21.05
===================
* Updated "Genode Foundations" book
* Consolidation
* Block-level components (update to Genode's modern block APIs)
* ARM device drivers (introducing the notion of a platform driver)
* Improved STL support (e.g., threading and mutexes)
* Continuous POSIX-compliance testing
* Systematic network-stack stress and performance tests
* Desktop: panel and virtual desktops
* Use case: Genode-based network router
* Goa: broadened support for 3rd-party build systems
* Native tool chain, including Git
* Sculpt
* Interactive device management
* Keyboard-controlled administration
* Support for BSPs maintained outside of Genode's mainline repository
* Annual documentation update, including the "Genode Foundations" book
* GPU support
* MESA update
* Experiments on ARM (e.g., Vivante on i.MX8, or Mali-400 on A64)
* Sculpt OS on Pine A64 (USB, input, framebuffer, SD-card, networking)
* 64-bit ARM
* Platform-driver consolidation between ARM and x86
* PCI-express support for MNT Reform (i.MX8)
* Tool-chain update (e.g., switching to hard-float on ARM)
* Modernized client-side NIC and uplink APIs
* Goa
* Broadened architecture support and testing workflow
* API projects
* Inter-project dependencies
August - Release 20.08
August - Release 21.08
======================
* Revisited GUI-related framework interfaces
* Extended tooling for performance monitoring
* Goa: Qt development workflow
* Desktop
* Native mail client
* Native web browser
* Sculpt
* Configurable CPU resources
* On-screen documentation
* Block encryption via our
[https://genode.org/documentation/release-notes/19.11#Preliminary_block-device_encrypter - consistent block encrypter]
implemented in Ada/SPARK
* USB audio
* Initial version of a kernel implemented in Ada/SPARK
* Linux DDE re-imagined
* Improved tooling
* Exploring Goa-based development workflow
* GPU support
* GPU multiplexer for Intel Gen9 graphics
* Harmonization of GPU driver with Intel framebuffer driver
* Initial version of a custom kernel (Spunky) implemented in Ada/SPARK
* System-level tracing infrastructure for guiding and validating optimizations
* Pinephone
* Touchscreen and display
* Mobile web browser
* Goa
* CMake-based Qt5 applications
* QML-based applications
November - Release 20.11
November - Release 21.11
========================
* Consolidation of capability-space management across kernels
* CPU-load balancing
* Hardware-accelerated graphics on i.MX8 (experimental)
* Reworked audio stack (interfaces, mixing)
* Sculpt: component lifetime management, shutdown protocol
* VFS plugins for lwext4 and FUSE-based file systems
* Pinephone
* Mobile data connectivity (LTE)
* Phone calls (audio)
* SMS
* seL4
* Update to current kernel version, MCS scheduling
* Combining CAmkES with Genode
* SMMU (I/O-MMU for ARM) support for our custom (base-hw) kernel
* Multi-monitor support

View File

@@ -31,33 +31,25 @@ but build upon of each other:
:'nova':
NOVA hypervisor developed at University of Technology Dresden
See [https://genode.org/documentation/platforms/nova]
:'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.
See [https://genode.org/documentation/platforms/foc]
:'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 except in the special case of the Muen separation
kernel.
See [https://genode.org/documentation/platforms/hw] and
[https://genode.org/documentation/platforms/muen]
included in core.
:'okl4':
OKL4 kernel (x86_32 and ARM) developed at Open-Kernel-Labs.
See [https://genode.org/documentation/platforms/okl4]
:'pistachio':
L4ka::Pistachio kernel developed at University of Karlsruhe.
See [https://genode.org/documentation/platforms/pistachio]
:'fiasco':
L4/Fiasco kernel developed at University of Technology Dresden.
See [https://genode.org/documentation/platforms/fiasco]
:'sel4':
seL4 microkernel developed at NICTA/General Dynamics

View File

@@ -1,4 +1 @@
This repository contains the L4/Fiasco-specific implementation of Genode.
For instructions to build and start the Fiasco version of Genode, please
consult the documentation located at 'base-fiasco/doc/fiasco.txt'.

View File

@@ -1 +1 @@
SPECS += fiasco x86_32
SPECS += fiasco

View File

@@ -1 +1 @@
2020-09-16 f9a3892feb099ad542875f5e4a51021dfbbdf982
2021-10-13 05c76f8a5e76e0cc76fd7336c7cf63836ecec35d

View File

@@ -14,7 +14,10 @@
/* core includes */
#include <core_log.h>
namespace Fiasco {
#include <l4/sys/kdebug.h>
}
void Genode::Core_log::out(char const c) { Fiasco::outchar(c); }
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
void Core_log::out(char const c) { Fiasco::outchar(c); }

View File

@@ -1,4 +1,4 @@
LIBS := core-fiasco
CORE_OBJ := core-fiasco.o
CORE_LIB := core-fiasco.a
include $(BASE_DIR)/src/core/target.inc

View File

@@ -17,7 +17,6 @@
/* Genode includes */
#include <base/cache.h>
#include <base/ipc.h>
#include <base/stdint.h>
#include <base/native_capability.h>
#include <util/touch.h>
@@ -26,155 +25,99 @@
/* core includes */
#include <util.h>
#include <mapping.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
namespace Genode { class Ipc_pager; }
class Mapping
{
private:
addr_t _dst_addr;
Fiasco::l4_fpage_t _fpage;
class Genode::Ipc_pager
{
private:
public:
Fiasco::l4_threadid_t _last { }; /* origin of last fault message */
addr_t _pf_addr { 0 }; /* page-fault address */
addr_t _pf_ip { 0 }; /* instruction pointer of faulter */
Mapping _reply_mapping { }; /* page-fault answer */
/**
* Constructor
public:
/**
* Wait for a new page fault received as short message IPC
*/
void wait_for_fault();
/**
* Reply current page-fault and wait for a new one
*
* Send short flex page and wait for next short-message (register)
* IPC -- pagefault
*/
void reply_and_wait_for_fault();
/**
* Request instruction pointer of current page fault
*/
addr_t fault_ip() { return _pf_ip; }
/**
* Request fault address of current page fault
*/
addr_t fault_addr() { return _pf_addr & ~3; }
/**
* Set parameters for next reply
*/
void set_reply_mapping(Mapping m) { _reply_mapping = m; }
/**
* Set destination for next reply
*/
void set_reply_dst(Native_capability pager_object) {
_last.raw = pager_object.local_name(); }
/**
* Answer call without sending a flex-page mapping
*
* This function is used to acknowledge local calls from one of
* core's region-manager sessions.
*/
void acknowledge_wakeup();
/**
* Returns true if the last request was send from a core thread
*/
bool request_from_core()
{
enum { CORE_TASK_ID = 4 };
return _last.id.task == CORE_TASK_ID;
}
/**
* Return badge for faulting thread
*
* As Fiasco has no server-defined badges for page-fault messages, we
* interpret the sender ID as badge.
*/
unsigned long badge() const {
return convert_native_thread_id_to_badge(_last); }
bool write_fault() const { return (_pf_addr & 2); }
bool exec_fault() const { return false; }
/**
* Return true if last fault was an exception
*/
bool exception() const
{
/*
* Reflection of exceptions is not supported on this platform.
*/
Mapping(addr_t dst_addr, addr_t src_addr,
Cache_attribute cacheability, bool,
unsigned l2size, bool rw, bool)
:
_dst_addr(dst_addr),
_fpage(Fiasco::l4_fpage(src_addr, l2size, rw, false))
{
if (cacheability == WRITE_COMBINED)
_fpage.fp.cache = Fiasco::L4_FPAGE_BUFFERABLE;
}
/**
* Construct invalid flexpage
*/
Mapping() : _dst_addr(0), _fpage(Fiasco::l4_fpage(0, 0, 0, 0)) { }
Fiasco::l4_umword_t dst_addr() const { return _dst_addr; }
Fiasco::l4_fpage_t fpage() const { return _fpage; }
/**
* Prepare map operation
*
* On Fiasco, we need to map a page locally to be able to map it to
* another address space.
*/
void prepare_map_operation()
{
addr_t core_local_addr = _fpage.fp.page << 12;
size_t mapping_size = 1 << _fpage.fp.size;
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
if (_fpage.fp.write)
touch_read_write((unsigned char volatile *)(core_local_addr + i));
else
touch_read((unsigned char const volatile *)(core_local_addr + i));
}
}
};
/**
* Special paging server class
*/
class Ipc_pager
{
private:
Fiasco::l4_threadid_t _last { }; /* origin of last fault message */
addr_t _pf_addr { 0 }; /* page-fault address */
addr_t _pf_ip { 0 }; /* instruction pointer of faulter */
Mapping _reply_mapping { }; /* page-fault answer */
public:
/**
* Wait for a new page fault received as short message IPC
*/
void wait_for_fault();
/**
* Reply current page-fault and wait for a new one
*
* Send short flex page and wait for next short-message (register)
* IPC -- pagefault
*/
void reply_and_wait_for_fault();
/**
* Request instruction pointer of current page fault
*/
addr_t fault_ip() { return _pf_ip; }
/**
* Request fault address of current page fault
*/
addr_t fault_addr() { return _pf_addr & ~3; }
/**
* Set parameters for next reply
*/
void set_reply_mapping(Mapping m) { _reply_mapping = m; }
/**
* Set destination for next reply
*/
void set_reply_dst(Native_capability pager_object) {
_last.raw = pager_object.local_name(); }
/**
* Answer call without sending a flex-page mapping
*
* This function is used to acknowledge local calls from one of
* core's region-manager sessions.
*/
void acknowledge_wakeup();
/**
* Returns true if the last request was send from a core thread
*/
bool request_from_core()
{
enum { CORE_TASK_ID = 4 };
return _last.id.task == CORE_TASK_ID;
}
/**
* Return badge for faulting thread
*
* As Fiasco has no server-defined badges for page-fault messages, we
* interpret the sender ID as badge.
*/
unsigned long badge() const {
return convert_native_thread_id_to_badge(_last); }
bool write_fault() const { return (_pf_addr & 2); }
bool exec_fault() const { return false; }
/**
* Return true if last fault was an exception
*/
bool exception() const
{
/*
* Reflection of exceptions is not supported on this platform.
*/
return false;
}
};
}
return false;
}
};
#endif /* _CORE__INCLUDE__IPC_PAGER_H_ */

View File

@@ -18,12 +18,8 @@
#include <platform.h>
#include <util.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/kdebug.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {

View File

@@ -15,9 +15,13 @@
#ifndef _CORE__INCLUDE__PLATFORM_H_
#define _CORE__INCLUDE__PLATFORM_H_
/* Genode includes */
#include <base/allocator_avl.h>
/* base-internal includes */
#include <base/internal/capability_space.h>
/* core includes */
#include <synced_range_allocator.h>
#include <platform_generic.h>
#include <platform_thread.h>
@@ -25,150 +29,149 @@
#include <boot_modules.h>
#include <assertion.h>
namespace Genode { class Platform; }
namespace Genode {
class Platform : public Platform_generic
{
private:
class Genode::Platform : public Platform_generic
{
private:
/*
* Noncopyable
*/
Platform(Platform const &);
Platform &operator = (Platform const &);
/*
* Noncopyable
*/
Platform(Platform const &);
Platform &operator = (Platform const &);
/*
* Shortcut for the type of allocator instances for physical resources
*/
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
/*
* Shortcut for the type of allocator instances for physical resources
*/
typedef Synced_range_allocator<Allocator_avl> Phys_allocator;
char _core_label[1]; /* to satisfy _core_pd */
Platform_pd *_core_pd = nullptr; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Phys_allocator _region_alloc; /* virtual memory allocator for core */
Rom_fs _rom_fs { }; /* ROM file system */
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
char _core_label[1]; /* to satisfy _core_pd */
Platform_pd *_core_pd = nullptr; /* core protection domain object */
Phys_allocator _ram_alloc; /* RAM allocator */
Phys_allocator _io_mem_alloc; /* MMIO allocator */
Phys_allocator _io_port_alloc; /* I/O port allocator */
Phys_allocator _irq_alloc; /* IRQ allocator */
Phys_allocator _region_alloc; /* virtual memory allocator for core */
Rom_fs _rom_fs { }; /* ROM file system */
Rom_module _kip_rom; /* ROM module for Fiasco KIP */
addr_t _vm_start = 0; /* begin of virtual memory */
size_t _vm_size = 0; /* size of virtual memory */
addr_t _vm_start = 0; /* begin of virtual memory */
size_t _vm_size = 0; /* size of virtual memory */
/*
* We do not export any boot module loaded before FIRST_ROM.
*/
enum { FIRST_ROM = 3 };
/*
* We do not export any boot module loaded before FIRST_ROM.
*/
enum { FIRST_ROM = 3 };
/**
* Setup base resources
*
* - Map and provide KIP as ROM module
* - Initializes region allocator
*/
void _setup_basics();
/**
* Setup base resources
*
* - Map and provide KIP as ROM module
* - Initializes region allocator
*/
void _setup_basics();
/**
* Setup RAM, IO_MEM, and region allocators
*/
void _setup_mem_alloc();
/**
* Setup RAM, IO_MEM, and region allocators
*/
void _setup_mem_alloc();
/**
* Setup I/O port space allocator
*/
void _setup_io_port_alloc();
/**
* Setup I/O port space allocator
*/
void _setup_io_port_alloc();
/**
* Setup IRQ allocator
*/
void _setup_irq_alloc();
/**
* Setup IRQ allocator
*/
void _setup_irq_alloc();
/**
* Parse multi-boot information and update ROM database
*/
void _init_rom_modules();
/**
* Parse multi-boot information and update ROM database
*/
void _init_rom_modules();
/**
* Setup pager for core-internal threads
*/
void _setup_core_pager();
/**
* Setup pager for core-internal threads
*/
void _setup_core_pager();
addr_t _rom_module_phys(addr_t virt) { return virt; }
addr_t _rom_module_phys(addr_t virt) { return virt; }
public:
/**
* Pager object representing the pager of core namely sigma0
*/
struct Sigma0 : public Pager_object
{
/**
* Constructor
*/
Sigma0();
int pager(Ipc_pager &) override { /* never called */ return -1; }
};
/**
* Return singleton instance of Sigma0 pager object
*/
static Sigma0 &sigma0();
/**
* Core pager thread that handles core-internal page-faults
*/
struct Core_pager : public Platform_thread, public Pager_object
{
/**
* Constructor
*/
Core_pager(Platform_pd &core_pd);
int pager(Ipc_pager &) override { /* never called */ return -1; }
};
/**
* Return singleton instance of core pager object
*/
Core_pager &core_pager();
public:
/**
* Pager object representing the pager of core namely sigma0
*/
struct Sigma0 : public Pager_object
{
/**
* Constructor
*/
Platform();
Sigma0();
int pager(Ipc_pager &) override { /* never called */ return -1; }
};
/**
* Return singleton instance of Sigma0 pager object
*/
static Sigma0 &sigma0();
/**
* Core pager thread that handles core-internal page-faults
*/
struct Core_pager : public Platform_thread, public Pager_object
{
/**
* Accessor for core pd object
* Constructor
*/
Platform_pd &core_pd()
{
if (_core_pd)
return *_core_pd;
Core_pager(Platform_pd &core_pd);
ASSERT_NEVER_CALLED;
}
int pager(Ipc_pager &) override { /* never called */ return -1; }
};
/**
* Return singleton instance of core pager object
*/
Core_pager &core_pager();
/**
* Constructor
*/
Platform();
/**
* Accessor for core pd object
*/
Platform_pd &core_pd()
{
if (_core_pd)
return *_core_pd;
ASSERT_NEVER_CALLED;
}
/********************************
** Generic platform interface **
********************************/
/********************************
** Generic platform interface **
********************************/
Range_allocator &core_mem_alloc() override { return _ram_alloc; }
Range_allocator &ram_alloc() override { return _ram_alloc; }
Range_allocator &io_mem_alloc() override { return _io_mem_alloc; }
Range_allocator &io_port_alloc() override { return _io_port_alloc; }
Range_allocator &irq_alloc() override { return _irq_alloc; }
Range_allocator &region_alloc() override { return _region_alloc; }
addr_t vm_start() const override { return _vm_start; }
size_t vm_size() const override { return _vm_size; }
Rom_fs &rom_fs() override { return _rom_fs; }
Range_allocator &core_mem_alloc() override { return _ram_alloc; }
Range_allocator &ram_alloc() override { return _ram_alloc; }
Range_allocator &io_mem_alloc() override { return _io_mem_alloc; }
Range_allocator &io_port_alloc() override { return _io_port_alloc; }
Range_allocator &irq_alloc() override { return _irq_alloc; }
Range_allocator &region_alloc() override { return _region_alloc; }
addr_t vm_start() const override { return _vm_start; }
size_t vm_size() const override { return _vm_size; }
Rom_fs &rom_fs() override { return _rom_fs; }
size_t max_caps() const override { return Capability_space::max_caps(); }
size_t max_caps() const override { return Capability_space::max_caps(); }
void wait_for_exit() override;
};
}
void wait_for_exit() override;
};
#endif /* _CORE__INCLUDE__PLATFORM_H_ */

View File

@@ -17,188 +17,193 @@
#ifndef _CORE__INCLUDE__PLATFORM_PD_H_
#define _CORE__INCLUDE__PLATFORM_PD_H_
/* Genode includes */
#include <base/allocator.h>
/* core includes */
#include <platform_thread.h>
#include <address_space.h>
namespace Fiasco {
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
class Platform_thread;
class Platform_pd : public Address_space
{
private:
/*
* Noncopyable
*/
Platform_pd(Platform_pd const &);
Platform_pd &operator = (Platform_pd const &);
enum {
VERSION_BITS = 10,
PD_FIRST = 0x10,
PD_MAX = (1 << 11) - 1, /* leave 0x7ff free for L4_INVALID_ID */
PD_VERSION_MAX = (1 << 10) - 1,
PD_INVALID = -1,
THREAD_MAX = (1 << 7),
};
unsigned _pd_id = 0;
unsigned _version = 0;
Fiasco::l4_taskid_t _l4_task_id { }; /* L4 task ID */
/**********************************************
** Threads of this protection domain object **
**********************************************/
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);
/******************
** PD allocator **
******************/
struct Pd_alloc
{
unsigned reserved : 1;
unsigned free : 1;
unsigned version : VERSION_BITS;
Pd_alloc(bool r, bool f, unsigned v)
: reserved(r), free(f), version(v) { }
Pd_alloc() : reserved(0), free(0), version(0) { }
};
static Pd_alloc *_pds()
{
static Pd_alloc static_pds[PD_MAX];
return static_pds;
}
/**
* Protection-domain creation
*
* The syscall parameter propagates if any L4 kernel function
* should be used. We need the special case for the Core startup.
*/
void _create_pd(bool syscall);
/**
* Protection domain destruction
*
* No special case for Core here - we just never call it.
*/
void _destroy_pd();
/**
* Protection domain allocation
*
* Find free L4 task and use it. We need the special case for Core
* startup.
*/
int _alloc_pd(signed pd_id);
/**
* Protection domain deallocation
*
* No special case for Core here - we just never call it.
*/
void _free_pd();
/***************
** Debugging **
***************/
void _debug_log_pds(void);
void _debug_log_threads(void);
public:
/**
* Constructor
*/
Platform_pd(Allocator &md_alloc, char const *name);
/**
* Constructor used for core's PD
*/
Platform_pd(char const *name, signed pd_id);
/**
* Destructor
*/
~Platform_pd();
/**
* Register quota donation at allocator guard
*/
void upgrade_ram_quota(size_t) { }
/**
* Initialize L4 task facility
*/
static void init();
/**
* Bind thread to protection domain
*
* \return true on success
*/
bool bind_thread(Platform_thread &thread);
/**
* Unbind thread from protection domain
*
* Free the thread's slot and update thread object.
*/
void unbind_thread(Platform_thread &thread);
/**
* Assign parent interface to protection domain
*/
void assign_parent(Native_capability) { }
int pd_id() const { return _pd_id; }
/*****************************
** Address-space interface **
*****************************/
void flush(addr_t, size_t, Core_local_addr) override;
};
class Platform_pd;
}
class Genode::Platform_pd : public Address_space
{
private:
/*
* Noncopyable
*/
Platform_pd(Platform_pd const &);
Platform_pd &operator = (Platform_pd const &);
enum {
VERSION_BITS = 10,
PD_FIRST = 0x10,
PD_MAX = (1 << 11) - 1, /* leave 0x7ff free for L4_INVALID_ID */
PD_VERSION_MAX = (1 << 10) - 1,
PD_INVALID = -1,
THREAD_MAX = (1 << 7),
};
unsigned _pd_id = 0;
unsigned _version = 0;
Fiasco::l4_taskid_t _l4_task_id { }; /* L4 task ID */
/**********************************************
** Threads of this protection domain object **
**********************************************/
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);
/******************
** PD allocator **
******************/
struct Pd_alloc
{
unsigned reserved : 1;
unsigned free : 1;
unsigned version : VERSION_BITS;
Pd_alloc(bool r, bool f, unsigned v)
: reserved(r), free(f), version(v) { }
Pd_alloc() : reserved(0), free(0), version(0) { }
};
static Pd_alloc *_pds()
{
static Pd_alloc static_pds[PD_MAX];
return static_pds;
}
/**
* Protection-domain creation
*
* The syscall parameter propagates if any L4 kernel function
* should be used. We need the special case for the Core startup.
*/
void _create_pd(bool syscall);
/**
* Protection domain destruction
*
* No special case for Core here - we just never call it.
*/
void _destroy_pd();
/**
* Protection domain allocation
*
* Find free L4 task and use it. We need the special case for Core
* startup.
*/
int _alloc_pd(signed pd_id);
/**
* Protection domain deallocation
*
* No special case for Core here - we just never call it.
*/
void _free_pd();
/***************
** Debugging **
***************/
void _debug_log_pds(void);
void _debug_log_threads(void);
public:
/**
* Constructor
*/
Platform_pd(Allocator &md_alloc, char const *name);
/**
* Constructor used for core's PD
*/
Platform_pd(char const *name, signed pd_id);
/**
* Destructor
*/
~Platform_pd();
/**
* Register quota donation at allocator guard
*/
void upgrade_ram_quota(size_t) { }
/**
* Initialize L4 task facility
*/
static void init();
/**
* Bind thread to protection domain
*
* \return true on success
*/
bool bind_thread(Platform_thread &thread);
/**
* Unbind thread from protection domain
*
* Free the thread's slot and update thread object.
*/
void unbind_thread(Platform_thread &thread);
/**
* Assign parent interface to protection domain
*/
void assign_parent(Native_capability) { }
int pd_id() const { return _pd_id; }
/*****************************
** Address-space interface **
*****************************/
void flush(addr_t, size_t, Core_local_addr) override;
};
#endif /* _CORE__INCLUDE__PLATFORM_PD_H_ */

View File

@@ -24,167 +24,169 @@
#include <platform_pd.h>
#include <assertion.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
class Platform_pd;
class Platform_thread : Interface
{
private:
/*
* Noncopyable
*/
Platform_thread(Platform_thread const &);
Platform_thread &operator = (Platform_thread const &);
int _thread_id = THREAD_INVALID; /* plain thread number */
Fiasco::l4_threadid_t _l4_thread_id;
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);
/**
* Constructor used for core-internal threads
*/
Platform_thread(const char *name);
/**
* Destructor
*/
~Platform_thread();
/**
* 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);
/**
* Pause this thread
*/
void pause();
/**
* Enable/disable single stepping
*/
void single_step(bool) { }
/**
* 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();
/**
* 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
*/
Thread_state state();
/**
* Set the executing CPU for this thread
*
* SMP is not supported on L4/Fiasco.
*/
void affinity(Affinity::Location) { }
/**
* Request the affinity of this thread
*/
Affinity::Location affinity() const { return Affinity::Location(); }
/************************
** Accessor functions **
************************/
/**
* Return/set pager
*/
Pager_object &pager() const
{
if (_pager)
return *_pager;
ASSERT_NEVER_CALLED;
}
void pager(Pager_object &pager) { _pager = &pager; }
/**
* Return identification of thread when faulting
*/
unsigned long pager_object_badge() const {
return convert_native_thread_id_to_badge(_l4_thread_id); }
/**
* Set CPU quota of the thread to 'quota'
*/
void quota(size_t) { /* not supported*/ }
/**
* Return execution time consumed by the thread
*/
Trace::Execution_time execution_time() const { return { 0, 0 }; }
/*******************************
** 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; }
};
class Platform_thread;
}
class Genode::Platform_thread : Interface
{
private:
/*
* Noncopyable
*/
Platform_thread(Platform_thread const &);
Platform_thread &operator = (Platform_thread const &);
int _thread_id = THREAD_INVALID; /* plain thread number */
Fiasco::l4_threadid_t _l4_thread_id;
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);
/**
* Constructor used for core-internal threads
*/
Platform_thread(const char *name);
/**
* Destructor
*/
~Platform_thread();
/**
* 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);
/**
* Pause this thread
*/
void pause();
/**
* Enable/disable single stepping
*/
void single_step(bool) { }
/**
* 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();
/**
* 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
*/
Thread_state state();
/**
* Set the executing CPU for this thread
*
* SMP is not supported on L4/Fiasco.
*/
void affinity(Affinity::Location) { }
/**
* Request the affinity of this thread
*/
Affinity::Location affinity() const { return Affinity::Location(); }
/************************
** Accessor functions **
************************/
/**
* Return/set pager
*/
Pager_object &pager() const
{
if (_pager)
return *_pager;
ASSERT_NEVER_CALLED;
}
void pager(Pager_object &pager) { _pager = &pager; }
/**
* Return identification of thread when faulting
*/
unsigned long pager_object_badge() const {
return convert_native_thread_id_to_badge(_l4_thread_id); }
/**
* Set CPU quota of the thread to 'quota'
*/
void quota(size_t) { /* not supported*/ }
/**
* Return execution time consumed by the thread
*/
Trace::Execution_time execution_time() const { return { 0, 0 }; }
/*******************************
** 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; }
};
#endif /* _CORE__INCLUDE__PLATFORM_THREAD_H_ */

View File

@@ -14,11 +14,13 @@
#ifndef _CORE__INCLUDE__RPC_CAP_FACTORY_H_
#define _CORE__INCLUDE__RPC_CAP_FACTORY_H_
/* Genode includes */
#include <base/allocator.h>
#include <base/capability.h>
namespace Genode { class Rpc_cap_factory; }
class Genode::Rpc_cap_factory
{
private:

View File

@@ -25,13 +25,8 @@
#include <base/internal/fiasco_thread_helper.h>
#include <base/internal/page_size.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/ipc.h>
#include <l4/sys/kdebug.h>
#include <l4/sys/ktrace.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {

View File

@@ -16,11 +16,8 @@
#include <util.h>
#include <io_mem_session_component.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sigma0/sigma0.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;

View File

@@ -19,15 +19,12 @@
#include <irq_root.h>
#include <util.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
bool Irq_object::_associate()
{
using namespace Fiasco;
@@ -74,7 +71,9 @@ void Irq_object::_wait_for_irq()
L4_IPC_SHORT_MSG, &dw0, &dw1,
L4_IPC_NEVER, &result);
if (L4_IPC_IS_ERROR(result)) error("Ipc error ", L4_IPC_ERROR(result));
if (L4_IPC_IS_ERROR(result))
error("Ipc error ", L4_IPC_ERROR(result));
} while (L4_IPC_IS_ERROR(result));
}
@@ -106,7 +105,7 @@ void Irq_object::entry()
if (!_sig_cap.valid())
continue;
Genode::Signal_transmitter(_sig_cap).submit(1);
Signal_transmitter(_sig_cap).submit(1);
_sync_ack.block();
}
@@ -115,7 +114,7 @@ void Irq_object::entry()
Irq_object::Irq_object(unsigned irq)
:
Thread_deprecated<4096>("irq"),
Thread(Weight::DEFAULT_WEIGHT, "irq", 4096 /* stack */, Type::NORMAL),
_irq(irq)
{ }
@@ -142,7 +141,7 @@ Irq_session_component::Irq_session_component(Range_allocator &irq_alloc,
Irq_session_component::~Irq_session_component()
{
error("Not yet implemented.");
error(__func__, " - not implemented");
}
@@ -152,13 +151,13 @@ void Irq_session_component::ack_irq()
}
void Irq_session_component::sigh(Genode::Signal_context_capability cap)
void Irq_session_component::sigh(Signal_context_capability cap)
{
_irq_object.sigh(cap);
}
Genode::Irq_session::Info Irq_session_component::info()
Irq_session::Info Irq_session_component::info()
{
/* no MSI support */
return { .type = Info::Type::INVALID, .address = 0, .value = 0 };

View File

@@ -22,22 +22,40 @@
#include <base/internal/native_thread.h>
#include <base/internal/capability_space_tpl.h>
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Fiasco;
/**
* Prepare map operation
*
* On Fiasco, we need to map a page locally to be able to map it to another
* address space.
*/
void Mapping::prepare_map_operation() const
{
addr_t const core_local_addr = src_addr;
size_t const mapping_size = 1UL << size_log2;
for (addr_t i = 0; i < mapping_size; i += L4_PAGESIZE) {
if (writeable)
touch_read_write((unsigned char volatile *)(core_local_addr + i));
else
touch_read((unsigned char const volatile *)(core_local_addr + i));
}
}
/***************
** Ipc_pager **
***************/
void Ipc_pager::wait_for_fault()
{
l4_msgdope_t result;
l4_msgdope_t result;
do {
l4_ipc_wait(&_last,
@@ -53,11 +71,13 @@ void Ipc_pager::wait_for_fault()
void Ipc_pager::reply_and_wait_for_fault()
{
l4_msgdope_t result;
l4_fpage_t const fpage { l4_fpage(_reply_mapping.src_addr,
_reply_mapping.size_log2,
_reply_mapping.writeable, false) };
l4_ipc_reply_and_wait(_last,
L4_IPC_SHORT_FPAGE, _reply_mapping.dst_addr(),
_reply_mapping.fpage().fpage, &_last,
l4_msgdope_t result;
l4_ipc_reply_and_wait(_last, L4_IPC_SHORT_FPAGE,
_reply_mapping.dst_addr, fpage.fpage, &_last,
L4_IPC_SHORT_MSG, &_pf_addr, &_pf_ip,
L4_IPC_SEND_TIMEOUT_0, &result);

View File

@@ -17,12 +17,8 @@
/* base-internal includes */
#include <base/internal/capability_space_tpl.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/kdebug.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;

View File

@@ -16,6 +16,7 @@
#include <base/allocator_avl.h>
#include <base/sleep.h>
#include <util/misc_math.h>
#include <util/xml_generator.h>
/* base-internal includes */
#include <base/internal/crt0.h>
@@ -31,17 +32,11 @@
#include <platform_pd.h>
#include <util.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/ipc.h>
#include <l4/sys/kernel.h>
#include <l4/sys/kip.h>
#include <l4/sigma0/sigma0.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Fiasco;
/***********************************
@@ -54,6 +49,7 @@ static Synced_range_allocator<Allocator_avl> &_core_address_ranges()
return _core_address_ranges;
}
enum { PAGER_STACK_ELEMENTS = 1024 };
static unsigned long _core_pager_stack[PAGER_STACK_ELEMENTS];
static unsigned _core_pager_arg;
@@ -66,8 +62,6 @@ static void _core_pager_loop()
{
unsigned pd_id = _core_pager_arg;
using namespace Fiasco;
l4_threadid_t t;
l4_umword_t dw0, dw1;
l4_msgdope_t r;
@@ -136,7 +130,7 @@ Platform::Sigma0::Sigma0()
0, Affinity::Location(), Session_label(),
Cpu_session::Name("sigma0"))
{
cap(Capability_space::import(Fiasco::sigma0_threadid, Rpc_obj_key()));
cap(Capability_space::import(sigma0_threadid, Rpc_obj_key()));
}
@@ -166,8 +160,6 @@ Platform::Core_pager::Core_pager(Platform_pd &core_pd)
void *sp = (void *)&_core_pager_stack[PAGER_STACK_ELEMENTS - 1];
start((void *)_core_pager_loop, sp);
using namespace Fiasco;
/* pager0 receives pagefaults from me - for NULL pointer detection */
l4_umword_t d;
l4_threadid_t preempter = L4_INVALID_ID;
@@ -236,8 +228,6 @@ static inline void remove_region(Region r, Range_allocator &alloc)
*/
static inline int sigma0_req_region(addr_t *addr, unsigned log2size)
{
using namespace Fiasco;
/* XXX sigma0 always maps pages RW */
l4_umword_t req_fpage = l4_fpage(0, log2size, 0, 0).fpage;
void* rcv_window = L4_IPC_MAPMSG(0, L4_WHOLE_ADDRESS_SPACE);
@@ -246,7 +236,7 @@ static inline int sigma0_req_region(addr_t *addr, unsigned log2size)
l4_msgdope_t result;
l4_msgtag_t tag;
int err = l4_ipc_call_tag(Fiasco::sigma0_threadid,
int err = l4_ipc_call_tag(sigma0_threadid,
L4_IPC_SHORT_MSG, SIGMA0_REQ_FPAGE_ANY, req_fpage,
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
rcv_window, &base, (l4_umword_t *)&rcv_fpage,
@@ -288,8 +278,8 @@ void Platform::_setup_mem_alloc()
if (!err) {
/* XXX do not allocate page0 */
if (addr == 0) {
Fiasco::l4_fpage_unmap(Fiasco::l4_fpage(0, log2_size, 0, 0),
L4_FP_FLUSH_PAGE | L4_FP_ALL_SPACES);
l4_fpage_unmap(l4_fpage(0, log2_size, 0, 0),
L4_FP_FLUSH_PAGE | L4_FP_ALL_SPACES);
continue;
}
@@ -307,14 +297,14 @@ void Platform::_setup_mem_alloc()
}
void Platform::_setup_irq_alloc() {
_irq_alloc.add_range(0, 0x10); }
static Fiasco::l4_kernel_info_t *get_kip()
void Platform::_setup_irq_alloc()
{
using namespace Fiasco;
_irq_alloc.add_range(0, 0x10);
}
static l4_kernel_info_t *get_kip()
{
static l4_kernel_info_t *kip = nullptr;
if (kip) return kip;
@@ -329,7 +319,7 @@ static Fiasco::l4_kernel_info_t *get_kip()
l4_msgdope_t r;
l4_msgtag_t tag;
err = l4_ipc_call_tag(Fiasco::sigma0_threadid,
err = l4_ipc_call_tag(sigma0_threadid,
L4_IPC_SHORT_MSG, SIGMA0_REQ_KIP, 0,
l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0),
fpage, &dw0, &dw1,
@@ -357,10 +347,9 @@ static Fiasco::l4_kernel_info_t *get_kip()
return kip;
}
void Platform::_setup_basics()
{
using namespace Fiasco;
l4_kernel_info_t * kip = get_kip();
/* add KIP as ROM module */
@@ -380,6 +369,7 @@ void Platform::_setup_basics()
break;
}
if (_vm_size == 0)
panic("Virtual memory configuration not found");
@@ -411,7 +401,8 @@ void Platform::_setup_basics()
}
Platform::Platform() :
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()),
@@ -432,7 +423,7 @@ Platform::Platform() :
log(_rom_fs);
Fiasco::l4_threadid_t myself = Fiasco::l4_myself();
l4_threadid_t myself = l4_myself();
Platform_pd::init();
@@ -451,8 +442,8 @@ Platform::Platform() :
_core_pd->bind_thread(core_thread);
/* we never call _core_thread.start(), so set name directly */
Fiasco::fiasco_register_thread_name(core_thread.native_thread_id(),
core_thread.name().string());
fiasco_register_thread_name(core_thread.native_thread_id(),
core_thread.name().string());
/* core log as ROM module */
{
@@ -476,6 +467,29 @@ Platform::Platform() :
init_core_log(Core_log_range { core_local_addr, log_size } );
}
/* export platform specific infos */
{
void * phys_ptr = nullptr;
size_t const size = 1 << get_page_size_log2();
if (ram_alloc().alloc_aligned(size, &phys_ptr,
get_page_size_log2()).ok()) {
addr_t const phys_addr = reinterpret_cast<addr_t>(phys_ptr);
addr_t const core_local_addr = phys_addr;
region_alloc().remove_range(core_local_addr, size);
Genode::Xml_generator xml(reinterpret_cast<char *>(core_local_addr),
size, "platform_info", [&] ()
{
xml.node("kernel", [&] () { xml.attribute("name", "fiasco"); });
});
_rom_fs.insert(new (core_mem_alloc()) Rom_module(phys_addr, size,
"platform_info"));
}
}
}

View File

@@ -25,19 +25,13 @@
#include <util.h>
#include <platform_pd.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/syscalls.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Fiasco;
using namespace Genode;
/**************************
** Static class members **
**************************/
static bool _init = false;
@@ -64,10 +58,10 @@ void Platform_pd::init()
void Platform_pd::_create_pd(bool syscall)
{
l4_threadid_t l4t = l4_myself();
l4t.id.task = _pd_id;
l4t.id.lthread = 0;
l4t.id.version_low = _version;
l4_threadid_t l4t = l4_myself();
l4t.id.task = _pd_id;
l4t.id.lthread = 0;
l4t.id.version_low = _version;
l4_taskid_t nt;
if (syscall)

View File

@@ -25,13 +25,8 @@
/* base-internal includes */
#include <base/internal/capability_space_tpl.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/syscalls.h>
#include <l4/sys/utcb.h>
#include <l4/sys/kdebug.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Fiasco;

View File

@@ -14,13 +14,18 @@
* under the terms of the GNU Affero General Public License version 3.
*/
/* core includes */
#include <ram_dataspace_factory.h>
using namespace Genode;
void Ram_dataspace_factory::_export_ram_ds(Dataspace_component &) { }
void Ram_dataspace_factory::_revoke_ram_ds(Dataspace_component &) { }
void Ram_dataspace_factory::_clear_ds(Dataspace_component &ds)
{
memset((void *)ds.phys_addr(), 0, ds.size());

View File

@@ -11,18 +11,20 @@
* under the terms of the GNU Affero General Public License version 3.
*/
/* base-internal includes */
#include <base/internal/fiasco_thread_helper.h>
#include "platform.h"
#include "util.h"
/* core includes */
#include <platform.h>
#include <util.h>
namespace Fiasco {
#include <l4/sys/ipc.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Fiasco;
void Platform::_setup_io_port_alloc()
{
l4_fpage_t fp;

View File

@@ -14,8 +14,10 @@
#ifndef _INCLUDE__FIASCO__THREAD_HELPER_H_
#define _INCLUDE__FIASCO__THREAD_HELPER_H_
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Fiasco {
#include <l4/sys/types.h>
/**
* Sigma0 thread ID

View File

@@ -22,9 +22,7 @@
#define _INCLUDE__BASE__INTERNAL__LOCK_HELPER_H_
/* L4/Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
}
#include <fiasco/syscall.h>
/**

View File

@@ -17,10 +17,8 @@
/* Genode includes */
#include <base/stdint.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {
@@ -28,6 +26,7 @@ namespace Genode {
struct Native_thread;
}
struct Genode::Native_thread
{
Fiasco::l4_threadid_t l4id;

View File

@@ -14,10 +14,8 @@
#ifndef _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_
#define _INCLUDE__BASE__INTERNAL__RAW_WRITE_STRING_H_
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/kdebug.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {

View File

@@ -14,10 +14,8 @@
#ifndef _INCLUDE__BASE__INTERNAL__RPC_DESTINATION_H_
#define _INCLUDE__BASE__INTERNAL__RPC_DESTINATION_H_
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/types.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
namespace Genode {

View File

@@ -0,0 +1,29 @@
/*
* \brief Collection of L4/Fiasco kernel bindings
* \author Norman Feske
* \date 2020-12-06
*/
/*
* Copyright (C) 2020 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__FIASCO__SYSCALL_H_
#define _INCLUDE__FIASCO__SYSCALL_H_
namespace Fiasco {
#include <l4/sys/types.h>
#include <l4/sys/kdebug.h>
#include <l4/sys/ipc.h>
#include <l4/sys/kernel.h>
#include <l4/sys/kip.h>
#include <l4/sys/utcb.h>
#include <l4/sys/ktrace.h>
#include <l4/sys/syscalls.h>
#include <l4/sigma0/sigma0.h>
}
#endif /* _INCLUDE__FIASCO__SYSCALL_H_ */

View File

@@ -11,6 +11,7 @@
* under the terms of the GNU Affero General Public License version 3.
*/
/* Genode includes */
#include <base/log.h>
/* base-internal includes */

View File

@@ -20,13 +20,11 @@
#include <base/internal/ipc_server.h>
#include <base/internal/capability_space_tpl.h>
/* Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
#include <l4/sys/syscalls.h>
}
/* L4/Fiasco includes */
#include <fiasco/syscall.h>
using namespace Genode;
using namespace Fiasco;
class Msg_header
@@ -34,9 +32,9 @@ class Msg_header
private:
/* kernel-defined message header */
Fiasco::l4_fpage_t rcv_fpage; /* unused */
Fiasco::l4_msgdope_t size_dope;
Fiasco::l4_msgdope_t send_dope;
l4_fpage_t rcv_fpage; /* unused */
l4_msgdope_t size_dope;
l4_msgdope_t send_dope;
public:
@@ -47,15 +45,15 @@ class Msg_header
* arguments. The kernel does not fetch these data words from memory
* but transfers them via the short-IPC registers.
*/
Fiasco::l4_umword_t protocol_word;
Fiasco::l4_umword_t num_caps;
l4_umword_t protocol_word;
l4_umword_t num_caps;
private:
enum { MAX_CAPS_PER_MSG = Msgbuf_base::MAX_CAPS_PER_MSG };
Fiasco::l4_threadid_t _cap_tid [MAX_CAPS_PER_MSG];
unsigned long _cap_local_name [MAX_CAPS_PER_MSG];
l4_threadid_t _cap_tid [MAX_CAPS_PER_MSG];
unsigned long _cap_local_name [MAX_CAPS_PER_MSG];
size_t _num_msg_words(size_t num_data_words) const
{
@@ -65,7 +63,7 @@ class Msg_header
* Account for the transfer of the protocol word, capability count,
* and capability arguments in front of the payload.
*/
return 2 + caps_size/sizeof(Fiasco::l4_umword_t) + num_data_words;
return 2 + caps_size/sizeof(l4_umword_t) + num_data_words;
}
public:
@@ -77,8 +75,6 @@ class Msg_header
*/
void prepare_snd_msg(unsigned long protocol, Msgbuf_base const &snd_msg)
{
using namespace Fiasco;
protocol_word = protocol;
num_caps = min((unsigned)MAX_CAPS_PER_MSG, snd_msg.used_caps());
@@ -109,8 +105,6 @@ class Msg_header
*/
void prepare_rcv_msg(Msgbuf_base const &rcv_msg)
{
using namespace Fiasco;
size_t const rcv_max_words = rcv_msg.capacity()/sizeof(l4_umword_t);
size_dope = L4_IPC_DOPE(_num_msg_words(rcv_max_words), 0);
@@ -124,7 +118,7 @@ class Msg_header
for (unsigned i = 0; i < min((unsigned)MAX_CAPS_PER_MSG, num_caps); i++) {
Rpc_obj_key const rpc_obj_key(_cap_local_name[i]);
bool const cap_valid = !Fiasco::l4_is_invalid_id(_cap_tid[i]);
bool const cap_valid = !l4_is_invalid_id(_cap_tid[i]);
Native_capability cap;
if (cap_valid) {
@@ -147,8 +141,6 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
Msgbuf_base &snd_msg, Msgbuf_base &rcv_msg,
size_t)
{
using namespace Fiasco;
Capability_space::Ipc_cap_data const dst_data =
Capability_space::ipc_cap_data(dst);
@@ -190,8 +182,6 @@ Rpc_exception_code Genode::ipc_call(Native_capability dst,
void Genode::ipc_reply(Native_capability caller, Rpc_exception_code exc,
Msgbuf_base &snd_msg)
{
using namespace Fiasco;
Msg_header &snd_header = snd_msg.header<Msg_header>();
snd_header.prepare_snd_msg(exc.value, snd_msg);
@@ -209,8 +199,6 @@ Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &last_caller,
Msgbuf_base &reply_msg,
Msgbuf_base &request_msg)
{
using namespace Fiasco;
l4_msgdope_t ipc_result;
bool need_to_wait = true;
@@ -276,7 +264,7 @@ Genode::Rpc_request Genode::ipc_reply_wait(Reply_capability const &last_caller,
Ipc_server::Ipc_server()
:
Native_capability(Capability_space::import(Fiasco::l4_myself(), Rpc_obj_key()))
Native_capability(Capability_space::import(l4_myself(), Rpc_obj_key()))
{ }

View File

@@ -17,15 +17,14 @@
#include <cpu/memory_barrier.h>
/* L4/Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
}
#include <fiasco/syscall.h>
using namespace Genode;
Lock::Lock(Lock::State initial)
: _state(UNLOCKED), _owner(nullptr)
:
_state(UNLOCKED), _owner(nullptr)
{
if (initial == LOCKED)
lock();
@@ -45,7 +44,7 @@ void Lock::lock(Applicant &myself)
* XXX: How to notice cancel-blocking signals issued when being outside the
* 'l4_ipc_sleep' system call?
*/
while (!Genode::cmpxchg(&_state, UNLOCKED, LOCKED))
while (!cmpxchg(&_state, UNLOCKED, LOCKED))
Fiasco::l4_ipc_sleep(Fiasco::l4_ipc_timeout(0, 0, 500, 0));
_owner = myself;
@@ -55,6 +54,6 @@ void Lock::lock(Applicant &myself)
void Lock::unlock()
{
_owner = Applicant(nullptr);
Genode::memory_barrier();
memory_barrier();
_state = UNLOCKED;
}

View File

@@ -16,9 +16,7 @@
#include <base/sleep.h>
/* L4/Fiasco includes */
namespace Fiasco {
#include <l4/sys/ipc.h>
}
#include <fiasco/syscall.h>
void Genode::sleep_forever()

View File

@@ -1,9 +1,4 @@
This repository contains the port of Genode to the Fiasco.OC microkernel.
For further information, please refer to the following documents:
:[http://genode.org/community/wiki/GenodeOnFiascoOC - Genode on Fiasco.OC Wiki page]:
This Wiki page contains the information on how to build and use
Genode with Fiasco.OC.
:[http://os.inf.tu-dresden.de/fiasco]:
Official website for the Fiasco.OC microkernel.
:[https://os.inf.tu-dresden.de/fiasco]:
Official website for the Fiasco.OC microkernel

View File

@@ -0,0 +1 @@
BOARD ?= unknown

View File

@@ -1,5 +1 @@
SPECS += foc
ifneq ($(filter x86_%,$(SPECS)),)
SPECS += pci acpi ps2 vesa framebuffer
endif

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