Commit Graph

2816 Commits

Author SHA1 Message Date
Norman Feske
bb904b9166 vfs: propagate I/O activity via 'wakeup_vfs_user'
This commit supplements the various I/O signal handlers of the VFS
plugins with calls of the new 'Vfs::Env::User::wakeup_vfs_user'
interface, which will subsequently replace the old 'Io_progress_handler'
(issue #4697).

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
9a2c03d2c6 vfs: remove Read_result::READ_ERR_INTERRUPT
The error condition was too vague and thereby remained unused in
practice.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
ba78cf72ae vfs: remove Read_result::READ_ERR_AGAIN
The condition is covered by READ_ERR_WOULD_BLOCK.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
1aba073e32 vfs: remove File_io_service::General_error
Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
a1fb51e050 vfs: remove File_io_service::register_read_ready
Issue #4706
2023-01-24 12:07:30 +01:00
Christian Prochaska
0c465fbb4d trace session: fix double quota accounting
Fixes #4707.
2023-01-24 12:07:29 +01:00
Norman Feske
0fefee804c vfs: remove File_io_service::ioctl interface
This interface has been obsoleted by the use of pseudo files,
implemented in the context of issue #3519.

Issue #4706
2023-01-24 12:07:29 +01:00
Norman Feske
ca0d3757cc vfs: make 'File_io_service::read_ready' const
... and replace pointer argument to const reference.

Issue #4706
2023-01-24 12:07:29 +01:00
Martin Stein
1b1a9ca95c nic_router: fix bad connection states on IP change
When a domain receives a new dynamic router IP address and that domain has
active connection states (TCP/UDP/ICMP) from another domain with NAT applied,
the connection states used to stay active while becoming obsolete. They
become obsolete because their identification and their packet processor
use the old routers IP address due to NAT.

One consequence was that connections became dysfunctional when the server
domain received a new dynamic router IP address. Request packets were still
routed from client to server, but when entering the server, their source IP
address was the outdated router address. Consequently, the server responses
used the outdated address as destination and the router dropped the responses
because it did not know this address anymore.

This commit fixes the problem by letting a domain destroy all its connection
states that were initiated from within other domains whenever it detaches from
its current IP configuration.

Strictly speaking, it is not necessary to destroy all connection states, only
those that the domain applies NAT to. However, the Genode AVL tree is not built
for removing a selection of nodes and trying to do it anyways is complicated.
So, for now, we simply destroy all connection states.

Note that the other way around was handled correctly already. When a domain
detaches from its IP config, all interfaces of that domain destroy all the
connection states they created (towards other domains).

Fixes #4696
2023-01-24 12:07:29 +01:00
Martin Stein
7a7cac57d9 nic_router: futile ip config updates on dhcp renew
If the IP config does not change on updates to the router IP config of a domain
change (a common case on DHCP RENEW), prevent detaching from the old config and
attaching to the new one. Because this would not only create unnecessary CPU
overhead but also force all clients at all interfaces that are listening to
this config (via config attribute 'dns_config_from') to restart their
networking (re-do DHCP).

Ref #4696
2023-01-24 12:07:29 +01:00
Norman Feske
e5272b65a1 vfs: remove unused Fs_file_system::_read method 2023-01-24 12:07:29 +01:00
Josef Söntgen
aed3b6c6be Add test-audio_out pkg recipe 2023-01-24 12:07:29 +01:00
Josef Söntgen
14d0b72f52 black_hole: add report session support 2023-01-24 12:07:28 +01:00
Josef Söntgen
03165c96cc Add cpu_burner pkg recipe 2023-01-24 12:07:28 +01:00
Josef Söntgen
a96c7ebd8d cpu_burner: only use timer when not 100 perecent 2023-01-24 12:07:28 +01:00
Josef Söntgen
916d45b450 os: add top pkg recipe 2023-01-24 12:07:28 +01:00
Norman Feske
ff2176a586 vfs,libc: support write fds in select
By adding a 'write_ready' interface following the lines of the existing
'read_ready', VFS plugins become able to propagate the (de-)saturation
of I/O buffers to the VFS user. This information is important when using
a non-blocking file descriptor for writing into a TCP socket. Once the
application observes EAGAIN, it expects a subsequent 'select' call to
return as soon as new I/O buffer space becomes available.

Before this patch, the select call would always return under this
condition, causing an unnecessarily busy write loop.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
5ad98f2b7c vfs,libc: introduce Vfs::Env::User interface
The new interface is meant to replace the 'Vfs::Io_response_handler'.
In contrast to the 'Io_response_handler', which had to be called
on a 'Vfs_handle', the new interface does not require any specific
'Vfs_handle'. It is merely meant to prompt the VFS user (like the libc)
to re-attempt stalled I/O operations but it does not provide any
immediate hint, about which of the handles have become ready for
reading/writing.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
cf87b0fadb vfs: simplify File_io_service::write return values
This patch removes the 'Insufficient_buffer' exception by returning the
WRITE_ERR_WOULD_BLOCK result value instead. It also eliminates the
superfluous WRITE_ERR_AGAIN and WRITE_ERR_INTERRUPT codes.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
8a9974b6f9 vfs/lwip: deferred wakeup of NIC server
This patch fosters the batching of network packets transferred by the
lwIP stack over the NIC connection. It replaces the eager submission of
the packet-stream's data-flow signals by explicit wakeup notifications.

The commit also increases the NIC session's buffer size from 128 to 1024
packets.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
5fdacae88b vfs: remove obsolete mutexes
...and tighten constness in adjacent code parts.

The VFS-internal synchronization via mutexes is no longer needed because
the access to the VFS is serialized by the VFS client, i.e., the libc.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
7d8d4f4532 vfs,libc: deferred wakeup of remote peers
This patch facilitates the batching of I/O operations in the VFS library
by replacing the implicit wakeup of remote peer (via the traditional
packet-stream interface like 'submit_packet') by explicit wakeup
signalling.

The wakeup signalling is triggered not before the VFS user settles down.
E.g., for libc-based applications, this is the case if the libc goes
idle, waiting for external I/O.
In the case of a busy writer to a non-blocking file descriptor or socket
(e.g., lighttpd), the remote peers are woken up once a write operation
yields an out-count of 0.

The deferring of wakeup signals is accommodated by the new 'Remote_io'
mechanism (vfs/remote_io.h) that is designated to be used by all VFS
plugins that interact with asynchronous Genode services for I/O.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
6edede0db9 server/vfs: facilitate batching of requests
By replacing the calls of 'acknowledge_packet' and 'get_packet' with
'try_ack_packet' and 'try_get_packet', we avoid the implicit triggering
of data-flow signals. Instead, the VFS server now relies on explicit
calls of the packet stream's 'wakeup' interface.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
a15c894385 file_system_session: increase TX_QUEUE_SIZE to 32
The change of the queue size from 16 to 32 has negligible costs (4 KiB
instead of 2 KiB for the packet-stream queues) while facilitating the
batching of many small consecutive write operations.

Issue #4697
2023-01-24 12:07:27 +01:00
Christian Helmuth
b033b30f95 depot: update recipe hashes 2022-11-29 12:32:49 +01:00
Stefan Kalkowski
5cff81fc29 usb c_api: prevent exception on full ack queue
Count more accurately how much packets are in flied, and whether
new packets can be handled. Moreover, catch potential exceptions
whenever acknowledging a packet, and warn about the lost acknowledgement.

Fix genodelabs/genode#4678
2022-11-29 12:29:57 +01:00
Alexander Boettcher
a91467f3a8 platform_drv: support enforced 1:1 DMA mapping
Follow up commit of

"platfrom_drv: map DMA memory non-natural when iommu is present"

Issue #4665
2022-11-29 12:29:57 +01:00
Johannes Schlatow
132906c925 platform_drv: update ROM in device_by_type()
This is required for scenarios in which a device appears at a later
point in time. If the ROM is not updated, the device_by_type() method may
operate on an outdated dataspace and never find the device it is waiting for.
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
f6825eea5f pci_decode: increase default ram quota
To circumvent problems of the page-table entries getting short on sel4,
increase the RAM quota for this component in all run-scripts.

Fix #4686
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
10aa5ebf03 pci_decode: report devices from ACPI info
Although we do not have the full ACPI information parsed yet, to
announce non-PCI devices derived from the ACPI tables, the device
description of the assumed devices is now integral-part of pci_decode.
Formerly, the information was gained separatedly as boot-module, whereby
we lost synchronization in between ACPI/PCI parsing, BIOS handover, and
PS/2 emulation code already acting.
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
9e61fb90c5 Remove legacy platform_drv, API, and platform.inc
Fix genodelabs/genode#4671
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
de083efcf2 os: remove platform_drv.inc from run-scripts
* block_tester.run: use Linux only
* vfs_block: was not dependent on platform_drv anyway

Ref genodelabs/genode#4671
2022-11-29 12:29:56 +01:00
Stefan Kalkowski
3274270951 os: remove audio_out_click run-script
Almost a duplicate of repos/dde_bsd/run/audio_out.run

Ref genodelabs/genode#4671
2022-11-29 12:29:56 +01:00
Stefan Kalkowski
7ebe09fbf7 pci_decode: limit PCI config space mappings
Map only one PCI bus at once when parsing the PCI buses.

Fix genodelabs/genode#4686
2022-11-17 17:22:58 +01:00
Alexander Boettcher
790e81349f mixer.run: adjust to new platform driver
Issue #4656
2022-11-17 14:48:26 +01:00
Josef Söntgen
4bacba431b nvme_drv: do not mask interrupts
During interrupt handling the driver masked and cleared interrupts as
recommended in the spec to prevent spurious or unnecessary interrupts
from occurring.

Due to the way the current implementation operates new Block requests
got submitted while handling completions for already finished ones.
Since interrupts where masked at this point the controller did not
generate interrupts when the newly submitted requests got completed.

As the mask/clear optimization is apparently not strictly needed and
according to the spec undefined when using MSI-X it is removed.

Fixes #4684
2022-11-17 14:45:57 +01:00
Christian Helmuth
c58d799f16 depot: update recipe hashes 2022-11-17 08:00:37 +01:00
Stefan Kalkowski
b78b543011 vmm: make ARM VMM configureable
This commit enables users of the VMM to define CPU type and count, RAM size,
kernel and initrd ROM names, GIC version, and Virtio devices to be used.
Derived from the configuration values a flattened device-tree blob (DTB) is
generated and transfered to the VM.

Fix genodelabs/genode#4670
2022-11-17 08:00:37 +01:00
Sebastian Sumpf
77fc2f1e86 platfrom_drv: map DMA memory non-natural when iommu is present
Consume '<iommu/>' tag from 'devices' report. In case an IOMMU is
present map physical memory to arbitrary locations within IO page table
range 1K-4G. This way every device PD has access to ~4GB of DMA space.

issue #4665
2022-11-17 08:00:37 +01:00
Sebastian Sumpf
2aa01e309c gpu/intel: GEN12+
* clock frequency
* topology
* exec lists
* IRQ handling
* improved resource management

issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
f76f5db2fa drivers: use DMA buffer more consistent
Replace 'alloc_dma_buffer' by 'Dma_buffer'

issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
ff6b2bffdc ahci: use Dma_buffer instead of 'alloc_dma_buffer'
issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
22460525a0 platform_session/dma_buffer: remove 'retry_with_upgrade'
'retry_with_upgrade' is called by 'platform_session/connection.h' ->
'alloc_dma_buffer' already.

issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
1b66b1bd7c platform_drv: check quota before dma allocations (taken from legacy)
'_env_ram' allocations can lead to
'Expanding_pd_session_client::try_alloc' quota upgrades, which in turn
may lead to a resource request by the platform driver. Therefore, we
check the available quota within the platform driver before allocations.
This is not an optimal solution.

issue #4667

related issue #3767
2022-11-17 08:00:36 +01:00
Stefan Kalkowski
7cb0986c1f rtc_drv: extend src package to dummy driver 2022-11-17 08:00:36 +01:00
Stefan Kalkowski
bc5663f1a3 os: remove obsolete i.MX framebuffer session
Ref genodelabs/genode#4661
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
3082950e74 usb_session: align USB packet allocation correctly
To prevent caching side-effects of USB DMA memory taken from the packet stream
all allocations of USB packets need to be on separated cachelines at least.

Fix genodelabs/genode#4655
2022-11-17 08:00:35 +01:00
Norman Feske
49b4b8597d os/pin_driver: support for time-multiplexed in/out
This patch equips the pin-driver framework with support for the
time-multiplexed operation of a pin as output or input. This is needed
when implementing I2C communication via a bit-banging driver.

To operate pin in both directions, a driver obtains both a pin-state and
a pin-control session for the same pin. The pin-state session can be
used to sense the current pin state. The control session allows the
client to set the pin to high or low (using the 'state' method), or to
set it to high-impedance via the 'yield' method. Once switched to
high-impedance, the pin can be used as input.

Issue genodelabs/genode-allwinner#10
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
11a6117da6 genode_c_api: add config update to block interface
Ref genodelabs/genode#4653
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
01e1e4e5b9 platform_drv: add "leave_operational" attribute
If a device should not be reset, powered off, and its clocks
shall stay untouched when it gets released, the leave_operational
attribute can be set to true in the device node of the related
device inside the devices ROM delivered to the platform driver.
This is useful for drivers, which only enable and initialize
their device, and can be closed afterwards.

Ref genodelabs/genode#4654
2022-11-17 08:00:35 +01:00