Commit Graph

2476 Commits

Author SHA1 Message Date
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
82604f2c2b lx_fs: fix build errors with gcc 10
Fixes #4123
2021-05-05 11:35:31 +02:00
Christian Prochaska
d6e9d74038 nitpicker: fix build error with gcc 10
Fixes #4110
2021-05-05 11:35:30 +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
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
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
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
Tomasz Gajewski
f49ec5b171 tool/run: extract function to copy files
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
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
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
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
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
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
Martin Stein
2084404aba nic_router: explain state report in README 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
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
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
73e8d64c34 init/sandbox: avoid repetitive state reports
Fixes #4064
2021-04-20 12:03:03 +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
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
ca50a41d28 depot: update recipe hashes 2021-03-23 11:28:53 +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
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
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
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
8c7d34ff21 rpi_platform_drv: remove placement new operator
Issue #2106
2021-03-12 12:01:38 +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
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
7af276ac81 cpu_balancer: add support to provide PD service
Issue #3837
2021-03-12 12:01:37 +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
Norman Feske
64165d829e depot: update recipe hashes 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
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
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
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
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
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
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
Martin Stein
ef88d05f2b os: api/net archive
Ref #3961
2021-02-23 12:02:43 +01:00
Christian Prochaska
2670ae399b usb_host_drv: improve error handling
Fixes #4005
2021-02-23 12:02:42 +01:00
Martin Stein
a9c4ebc9e9 drivers/nic/mode: exception on malformed values
Ref #3961
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
Martin Stein
691be92046 Don't use the NIC server mode of NIC drivers
Issue #3961
2021-02-23 11:53:41 +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
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
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
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
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
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
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
Alexander Boettcher
14d8627186 platform_drv: avoid using Register in Bdf type
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
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
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
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
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
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
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
Christian Helmuth
f2e0c164c2 depot: update recipe hashes 2020-11-27 09:21:06 +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
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
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
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
Alexander Boettcher
d9cde328cb acpi: support amd iommu detection
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
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
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
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
Alexander Boettcher
11e261ada4 platform_drv(x86): use 32bit writes for MSI-X
Fixes #3927
2020-11-23 12:02:57 +01:00
Christian Helmuth
5be1c793a5 depot: update recipe hashes 2020-10-23 14:16:38 +02:00
Christian Helmuth
bcf1cc6397 Ensure high priority for timer in test.run 2020-10-09 13:37:17 +02:00
Christian Helmuth
91f8281618 depot: update recipe hashes 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
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
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
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
Alexander Boettcher
325e9cb9fa platform_drv(x86): avoid memory leak 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
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
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
Martin Stein
4eb4bd6f96 trace_logger: warn on multiple buffer wraps
Ref #3884
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
Christian Helmuth
c59c266afc depot: update recipe hashes 2020-09-17 14:23:14 +02:00
Christian Helmuth
2eb8c5e21a net: move ascii_to() into Net namespace
The combination of Net::Mac_address and
Genode::ascii_to(Net::Mac_address) required shaky quirks in several
places because GCC is not able to resolve the ascii_to overload if
base/xml_node.h was included to early. The current solution moves the
several ascii_to overloads "closer" to the Net types by putting them
into the Net namespace, where GCC reliably picks them up.

Hence, co-locating the ascii_to() utility with the overload type in the
same scope/namespace is good practice.

This patch removes the now obsolete <nic/xml_node.h> header file.
2020-09-17 10:13:22 +02:00
Alexander Boettcher
f0f8d0e0ca base: add affinity to session creation request
Fixes #3838
2020-09-17 10:13:21 +02:00
Stefan Kalkowski
5913cdae89 os: fix clock settings for i.MX 8M platform_drv
* Fixes faulty algorithm in fractional pll rate calculation
* Enables clocks that are set as reference clock to prevent system freeze
* Enables/disables root clocks of gates implicitely

Fix #3876
2020-09-17 10:13:21 +02:00
Norman Feske
f5dc71ed35 os: remove obsolete single_session_service.h 2020-09-17 10:13:20 +02:00
Norman Feske
3031fd2a7d os/vfs.h: const 'Directory' arg for 'Watch_handler'
The watch mechanism should not require a reference to a mutable
directory.
2020-09-09 16:57:34 +02:00
Norman Feske
7de2b040f8 vfs: deliver ACKs after config change
This is needed to enable VFS plugins to notify VFS clients about file
changes that depend on the plugin configuration, E.g., whenever the vfs_ttf
plugin responds to a font-size change, it generates a watch notification
for the glyphs file. Since the change is independent from I/O, we need
to manually call 'handle_io_progress'.
2020-09-09 16:57:34 +02:00
Norman Feske
0af969543d nitpicker: preserve alpha channel during resize
This patch reduces flickering artifacts that appear during the
resizing of clients that use an alpha channel.

Issue #3812
2020-09-09 16:57:34 +02:00
Josef Söntgen
9e97393e3a os: check path for dataspace in ROM VFS plugin
Fixes #3879.
2020-09-09 16:57:34 +02:00
Norman Feske
328a4fa644 nitpicker: update hovering on view-stack changes
With the change of nitpicker to the event session interface, the
formerly periodic hovering updates moved to the - now sporadic - input
processing. This has the unfortunate side effect that hovering changes
caused by non-user-input, in particular view-stack changes issued by the
GUI clients that change the view under the current pointer position,
would no longer be reported immediately but only after receiving the
next incoming input event.

This patch reworks the hover handling such that potential hovering
changes due to view-stack operations are evaluated immediately by
those operations, covering the update of the hover report and the
generation of artificial enter/motion events.

Issue #3812
2020-09-09 16:57:34 +02:00
Norman Feske
17a6318ad6 vfs: process all acks in each iteration
This patch solves a corner case where one long-active job (e.g.,
read-ready request) stays at the beginning of the '_active_jobs' queue
without an ack. In this case, the '_try_acknowledge_jobs' method would
wrongly stop processing the subsequent acknowledgements. In practice,
this can lead to a delayed sending of acknowledgements until new I/O or
client requests occur. In particular, Vim in Sculpt's inspect window
sometimes did not immediately respond to key presses during tab
completion. Here, the read-ready request of the terminal prevented the
acknowledgement for read of directory entry from being delivered until
the next key was pressed.

Fixes #3873
2020-09-09 16:57:34 +02:00
Christian Helmuth
0977574372 vfs/rtc: return timestamp size on stat() 2020-09-01 16:48:50 +02:00
Alexander Boettcher
99bdfbe36f trace: don't account argument_buffer 2x
The quota for the argument buffer is already accounted by using the
Attached_ram_dataspace _argument_buffer, which uses the Constraint_ram_allocator
_ram, which uses the Ram_quota_guard from the Session_object. Running on
Sculpt with more than 1000 Subject_info objects/trace IDs the memory
waste become noticeable.
2020-09-01 16:48:29 +02:00
Christian Helmuth
c649307720 depot: update recipe hashes 2020-08-28 08:29:12 +02:00
Norman Feske
b9a21ee3ae nitpicker: updated README 2020-08-28 08:28:13 +02:00
Norman Feske
bbfda019df vfs/terminal: minor const improvement
Issue #3860
2020-08-25 12:03:31 +02:00
Norman Feske
7d0cb9620b depot: update recipe hashes 2020-08-25 11:50:41 +02:00
Stefan Kalkowski
73d3698e2f os: add new platform driver for Raspberry Pi
Fix #3864
2020-08-25 11:50:12 +02:00
Stefan Kalkowski
5f5ad41ad3 hw: unify irq enumeration for Raspberri Pi
By now, the enumeration of peripheral interrupts on Raspberry Pi 1 was
different in between base-hw kernel and Fiasco.OC. Therefore, hacks were
needed in every driver to request the correct interrupt number dependent
on the kernel. Before reproducing the same in the platform driver for rpi,
we can more easily use the same enumeration with base-hw.

Ref #3864
2020-08-25 11:50:12 +02:00
Stefan Kalkowski
7ba31d4447 os: disable initialization of i.MX8MQ platform_drv
This is a temporary workaround to not harm drivers, which aren't
converted yet to request all device resources including power and
clocks from this new platform driver.

Ref #3863
2020-08-25 11:50:12 +02:00
Stefan Kalkowski
224f5907b2 os: add platform driver for i.MX 8M Quad SoC
The new platform driver supports clock and power-domain settings per device.
IOMUX constroller settings are not part of the driver yet.

Fix #3863
2020-08-25 11:50:12 +02:00
Stefan Kalkowski
06edc0d52b base: extend PD session with managing_system call
Introduce the managing_system privilege for components like the
platform_driver to allow it to call system management functionality
that is reserved by kernel or special firmware, e.g., ARM Trusted Firmware.

The former RAM resource configuration attribute `constrain_phys`,
which enabled to constrain the region of physical RAM to be used,
gets replaced by the new, broader managing_system configuration
attribute of a `start` node. It gets enforced by the sandbox library.

Ref #3816
2020-08-25 11:50:11 +02:00
Josef Söntgen
d21bc8268b vfs: add raw option to terminal plugin
When the 'raw' attribute is set to 'yes' the terminal VFS plugin will
ignore control characters. This in necessary for terminal connections
that transport data that contain such characters as part of message.

Fixes #3860.
2020-08-25 11:50:11 +02:00
Norman Feske
8b556a9435 usb_block: fix upper block-number range check
The driver wrongly rejected a block request for the very last block of
the device, which prevented part_block from successfully parsing the
partition table (when attempting to access the GPT backup).

Fixes #3861
2020-08-25 11:50:11 +02:00
Norman Feske
1e7c94759d part_block: spelling fix 2020-08-25 11:50:11 +02:00
Norman Feske
f8f8b665c3 vfs: don't accept new job before old job is acked
Fixes #3859
2020-08-25 11:50:11 +02:00
Norman Feske
c7d9b2ca92 nitpicker: fix mode change for requested fb
This is a follow-up commit to "nitpicker: make framebuffer and input
optional". It restores the dynamic mode-change support when using
'request_framebuffer="yes"' as needed in scenarios where multiple
nitpicker instances are used in a cascaded way. E.g., Sculpt's
Leitzentrale. The previous version missed to reconstruct the
'_fb_screen' on mode changes.

Issue #3812
2020-08-25 11:50:10 +02:00
Norman Feske
1aed881313 Remove drivers/gpio/spec directory
Issue #2190
2020-08-25 11:50:09 +02:00
Norman Feske
3c78265e66 Remove drivers/framebuffer/spec directory
Thanks to the unification of build directories, the sub directories
(rpi, sdl, imx53) do not depend on SPEC values.

Issue #2190
2020-08-25 11:50:09 +02:00
Norman Feske
fcb21732e0 Move drivers/input/spec/ps2 to drivers/ps2
This simplifies the directory structure.

Issue #2190
2020-08-25 11:50:09 +02:00
Norman Feske
db0e86fa41 Remove drivers/input/dummy pseudo driver
With the transition from the input-session to the event-session
interface, the use case for this component has vanished.

Issue #3827
2020-08-25 11:50:09 +02:00
Norman Feske
2e22498e5a nitpicker: no framebuffer and input by default
This patch prevents nitpicker from requesting a framebuffer and input
session by default because the regular use of nitpicker relies on the
capture-session and event-session interfaces by now.

For supporting the nested use of nitpicker via the gui_fb component, it
is still possible to enable the traditional behavior by explicitely
setting the 'request_input' and 'request_framebuffer' config attributes
to "yes".

Issue #3812
2020-08-25 11:50:09 +02:00
Norman Feske
264f695373 Remove transitionary input_event_client component
With the transition of the input servers to event clients completed,
this helper component is no longer needed.

Issue #3845
Issue #3827
2020-08-25 11:50:09 +02:00
Norman Feske
a2381c7e4c Turn USB HID drivers into event-session clients
Issue #3845
2020-08-25 11:50:09 +02:00
Norman Feske
974118acec Turn PS/2 driver into event-session client
Issue #3845
2020-08-25 11:49:45 +02:00
Norman Feske
78047b5bd8 Rename fb_boot_drv to boot_fb_drv
to be consistent with the naming of the other drivers.
2020-08-25 11:49:43 +02:00
Norman Feske
9662d89cfb Replace input filter with event filter
This commit applies the transition from the "Input" session to the "Event"
session to the event-filtering mechansim. The functionality of the
input_filter is now provided by the event_filter. The event filter
requests only one "Event" session as destination for the filter result,
which is usually routed to the nitpicker GUI server. It provides an
"Event" service to which any number of event sources can connect.

The configuration of the filter chain remains almost the same. Only the
declaration of the <input> nodes is no longer needed. Instead, the
configuration must specify <policy> nodes, which define the mapping of
"Event" clients (event sources) to the inputs used in the filter chain.

The patch adjusts all uses of the nitpicker GUI server accordingly such
that the event filter reports events to nitpicker's event service
instead of having nitpicker request an "Input" session. This dissolves
the dependency of nitpicker from input drivers.

Issue #3827
2020-08-25 11:49:43 +02:00
Norman Feske
bc5b161260 os: event_dump server for printing events
This component takes over the role of the test-input component.

Issue #3827
2020-08-25 11:49:43 +02:00
Norman Feske
c502e1d095 input_filter: prepare for refactorization
This patch brings the input filter into a shape that is easier to
re-mold into an event filter, reversing the client/server roles of
the component.

* The 'Sink &destination' is no longer passed as constructor argument
  to the individual filters but passed as argument to the 'generate'
  method. This way, the final destination does not need to exist at
  the construction time of the filter chain but can be created on
  the fly (clearing the way for using 'Event::Client::with_batch').

* A new 'Source::Filter' interface with the 'apply' method aids the
  cascading of filters during 'generate'. The modules now implement
  the 'Source::Filter::filter_event' interface instead of the
  'Source::Sink::submit_event' interface.

* Since the 'Sink &destination' is no longer a member of the filter
  modules, character-repeat events can no longer be emitted in an
  ad-hoc way. Instead, the character-repeat mechanism now invokes
  a new 'Trigger::trigger_generate' hook that prompts the execution
  of the regular 'generate' mechanism by the main program.

This patch is supposed to leave the semantics of the input filter
unchanged (validated by the input_filter.run script).

Issue #3827
2020-08-25 11:49:43 +02:00
Norman Feske
6c4ce86a34 event_session: make Session_client::Batch abstract
This way, there can exist multiple implementations of the interface such
as event filters.

Issue #3812
2020-08-25 11:49:43 +02:00
Norman Feske
7bac1ec7e5 Adapter for connecting input and event servers
This is an intermediate helper component for the transition of input
servers into event clients. It works analogously to the
input_event_bridge but it connects servers instead of clients.
In particular, it can act as glue between a traditional input driver
that provides an input service and the event filter that provides an
event service. Thanks to this component, each driver can be migrated to
the event-client interface individually.

Issue #3827
2020-08-25 11:49:43 +02:00
Norman Feske
7932c76d85 nitpicker: add event service
Issue #3812
2020-08-25 11:49:43 +02:00
Christian Helmuth
420ed91480 linux_nic_drv: stop receiver thread on congested queue
Otherwise, the thread spins on and drops packets.
2020-08-25 11:49:42 +02:00
Alexander Boettcher
d1be1281bc os: use whole memory in Packet_allocator 2020-08-25 11:42:36 +02:00
Christian Helmuth
5122917d62 os: declare Path::max_len() const 2020-07-30 08:49:23 +02:00
Alexander Boettcher
3639a1af80 acpi_drv: avoid out-of-bound access to FADT table
Fixes #3829
2020-07-30 08:49:23 +02:00
Norman Feske
bfd94d64ba pbxa9_drivers: add blit api
This is a follow-up fix of "Turn framebuffer drivers into capture
clients".

Fixes #3813
2020-07-30 08:49:23 +02:00
Piotr Tworek
d8539af412 platform_session: Add missing include.
The code uses Genode::Attached_dataspace but fails to include header
defining this type.

Fixes #3824
2020-07-30 08:49:23 +02:00
Norman Feske
cd7a6fc9fe pkg/drivers_interactive-muen: use capture session
This is follow-up commit to "Turn framebuffer drivers into capture
client".

Issue #3813
2020-07-30 08:49:23 +02:00
Alexander Boettcher
41380ff769 base: remove Cancelable_lock
- base/cancelable_lock.h becomes base/lock.h
- all members become private within base/lock.h
- solely Mutex and Blockade are friends to use base/lock.h

Fixes #3819
2020-07-30 08:49:23 +02:00
Norman Feske
de795b1a6e depot: update recipe hashes 2020-07-13 11:33:53 +02:00
Norman Feske
c81af531a3 Turn framebuffer drivers into capture clients
This patch replaces the use of the "Framebuffer" session interface by
the new "Capture" session interface in all framebuffer drivers. Thanks
to this change, those drivers have become mere clients of the nitpicker
GUI server now, and are no longer critical for the liveliness of the GUI
server.

The patch touches the following areas:

- The actual driver components. The new versions of all drivers have
  been tested on the respective hardware. Generally, the drivers
  have become simpler.

- The drivers_interactive packages for various boards. The drivers
  subsystem no longer provides a "Framebuffer" service but needs a
  valid route to the "Capture" service provided by nitpicker.

- The driver manager of Sculpt OS.

- This patch changes the role of the test-framebuffer component from a
  framebuffer client to a capture server so that drivers (capture clients)
  can be directly connected to the test component without the nitpicker
  server.

- Framebuffer driver no longer support the unbuffered mode.

- The fb_bench.run script is no longer very meaningful because it
  interplays solely with nitpicker, not with the driver directly.

- All run scripts for graphical scenarios and the related depot
  archives got adapted to the change.

Fixes #3813
2020-07-13 11:33:15 +02:00
Norman Feske
6743669ab8 nitpicker: report no mode smaller than 1x1 pixels
Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
320387db89 nitpicker: improve GUI client resize handling
This patch replaces meta-data allocation during the resize handling by a
new 'Resizeable_texture' type that has all meta data preallocated.
It also replaces the use of pointer return values with the
'Resizeable_texture::with_texture' method.

Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
4cad1a87df nitpicker: make framebuffer and input optional
Nitpicker used to unconditionally request a framebuffer and input
session. With the transition to the new capture/event session
interfaces, this built-in policy does no longer suffice.

This patch introduces the attributes 'request_framebuffer="yes"' and
'request_input="yes"' (with the default values shown) to nitpicker's
<config> node. If setting those attributes to "no", nitpicker won't
request a "Framebuffer" and "Input" session respectively.

Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
22cb6dded7 nitpicker: add capture service
Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
537b317273 nitpicker: handle failed try_alloc_texture
Fixes #3782
2020-07-13 11:33:14 +02:00
Norman Feske
795a817a33 nitpicker: remove dirty_rect state from view stack
In the presence of potentially multiple output back ends, this
dirty_rect state must be maintained individually per back end. Instead
of storing the dirty_rect as view-stack member, the view stack now calls
a new 'Damage::mark_as_damaged' interface, which allows nitpicker to
propagate this information to multiple back ends. Unfortunately, the
patch must remove the per-view dirty_rect state.

Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
067a7ad7e9 nitpicker: internal cleanup
This patch simplifies the internal naming of the nitpicker GUI server as
a preparatory step for adding support for the capture session interface.

Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
3863de9589 Input-event-bridging service
The sole purpose of this service is the migration path from the use of
input session interface to the event session interface.

Issue #3812
2020-07-13 11:33:14 +02:00
Norman Feske
443d3c98dd Event session interface
Issue #3812
2020-07-13 11:33:13 +02:00
Norman Feske
602def9bdd Simple example for using a capture connection
Issue #3812
2020-07-13 11:33:13 +02:00
Norman Feske
3d1d1b439d Capture session interface
Issue #3812
2020-07-13 11:33:13 +02:00
Alexander Boettcher
c4a8c6798b top: react on too small trace argument buffer size
Issue #3811
2020-07-13 11:33:13 +02:00
Alexander Boettcher
21e48a8e12 trace: extend for_each_subject_infos return value
Fixes #3811
2020-07-13 11:33:13 +02:00
Norman Feske
a7d170adda os: add blit/painter.h
This utility eases the application of the 'blit' function when using the
'Texture' and 'Surface' types.
2020-07-13 11:33:13 +02:00
Christian Helmuth
ed4594c76b Fix success/failure detection in cpu_bench testsuite
Issue #3785
2020-07-13 11:33:12 +02:00
Christian Helmuth
e163055f6a ram fs: Release node mutex on unlink
This is needed if an open file is unlinked.

Fixes #3800
2020-07-13 11:33:12 +02:00
Norman Feske
35c3acdf05 depot: update recipe hashes 2020-07-03 11:13:59 +02:00
Alexander Boettcher
103236fdca nitpicker: fix memory accounting during realloc
Fixes #3794
2020-07-03 11:11:24 +02:00
Norman Feske
4450b37ff5 depot: update recipe hashes 2020-06-29 14:25:28 +02:00
Stefan Kalkowski
1cfb1af56e os: automate cpu_bench testsuite
* Differentiate in between different architectures with assembler routines
  for correct measures
* Automate first step measuring of 10G bogomips across different hardware

Fix #3785
2020-06-29 14:25:27 +02:00
Norman Feske
ef741ef80d Change pixel format to 32 bits per pixel
Until now, Genode's framebuffer session interface was based on the
RGB565 pixel format. This patch changes the pixel format to 32-bit
XRGB where the X part is ignored. It adapts all graphical applications
and device drivers accordingly.

The patch also adjusts the users of the drivers_interactive packages,
assigning 64 MiB RAM and 1500 caps to the drivers subsystem, which is
sufficient for covering high resolutions at 32 bits per pixel and to
accommodate multi-component USB HID input stacks.

Fixes #3784
2020-06-29 14:22:29 +02:00
Josef Söntgen
6d945e6a61 os: remove rom_block server component
This component is superceeded by vfs_block.

Issue #3781.
2020-06-29 14:22:28 +02:00
Josef Söntgen
6fc7ed55cf Replace 'rom_block' with 'vfs_block'
Issue #3781.
2020-06-29 14:22:28 +02:00
Josef Söntgen
8b590e2330 os: remove ram_block server component
This component is superceeded by vfs_block.

Issue #3781.
2020-06-29 14:22:28 +02:00
Josef Söntgen
ec711b008e Replace 'ram_block' with 'vfs_block'
Issue #3781.
2020-06-29 14:22:28 +02:00
Josef Söntgen
be55f080e4 os: add test-vfs_block pkg recipe
Issue #3781.
2020-06-22 09:50:51 +02:00
Josef Söntgen
e1aab829ca os: Block session server backed by VFS library
The 'vfs_block' component will give access to a VFS file through a
Block session. For more detailed information please look at its
README.

(On a technical note, the server currently only allows for one
active session and has only one pending back end request but can
easily be extended in the future.)

Fixes #3781.
2020-06-22 09:50:51 +02:00
Josef Söntgen
e56dd15a4b vfs: extend <zero> fs to limit amount of zeros
Setting the 'size' attribute will restrict a reader to consume
0s up to the specified amount per VFS handle. The attribute is
parsed as 'Number_of_bytes', which will limit the amount to the
maximum of the addressable memory on the platform.

This addition comes in handy when needing to provide a synthetic
empty file with a fixed size.

Issue #3781.
2020-06-22 09:50:51 +02:00
Josef Söntgen
103ae9df4a block_tester: limit batching in sequential test
So far the condition whether to spawn a new job or not depended on
the amount of data already processed. This could lead to spawning
more jobs than necessary if batching is used and in return could
result in creating invalid requests in case the tested block session
is not large enough.

In addition to checking the amount of data the test now stores the
number of the last block and checks if the current request is in
range. This properly limits the total amount of requests.

Issue #3781.
2020-06-22 09:50:51 +02:00
Josef Söntgen
b5f0c07eb3 os: add block_tester src recipe
Issue #3781.
2020-06-22 09:50:51 +02:00
Norman Feske
eb3a81a874 depot: update recipe hashes 2020-06-22 09:39:41 +02:00
Martin Stein
1e96510815 server/vfs: set seek offset before executing write
The seek offset has to be updated on partial writes according to the
current write position. Otherwise writes will override the content
at the initial offset.

Fixes #3780.
2020-06-22 09:39:40 +02:00
Norman Feske
f63713694c api/blit: package arch-specific optimizations
The blit API archive missed the CPU-architecture-specific variants of
the blit library such that all depot binaries worked with the generic
(slow) fallback implementation. This patch adds the missing pieces to
the blit API archive.
2020-06-22 09:39:40 +02:00
Norman Feske
48b4891f6e Rename nit_fb to gui_fb
Issue #3778
2020-06-22 09:39:40 +02:00
Norman Feske
5d40c0c1ce Rename 'Nitpicker' namespace to 'Gui'
Issue #3778
2020-06-22 09:39:40 +02:00
Norman Feske
98f39c698f Rename "Nitpicker" service name to "Gui"
Issue #3778
2020-06-22 09:39:39 +02:00
Norman Feske
c6eda9bd80 Rename include/nitpicker_session to gui_session
This patch also renames the depot api archive accordingly.

Issue #3778
2020-06-22 09:39:39 +02:00
Josef Söntgen
e8fec3eed6 terminal_log: remove session size check
The amount of RAM required by the session object is already accounted
for by the Root_component.

Fixes #3776.
2020-06-22 09:39:38 +02:00
Emery Hemingway
dc8b4eeb40 cached_fs_rom: diagnosis of delivered ROM sessions
To enable logging of ROM session deliveries, set the "diag" on
session routes:

<route>
  <service name="ROM" label_prefix="/bin/">
    <child name="cached_fs_rom" diag="yes"/>
  </service>
  …
<route>

Fix #3772
2020-06-22 09:39:38 +02:00
Christian Helmuth
6006051fb9 depot: update recipe hashes 2020-05-27 11:56:47 +02:00
Stefan Kalkowski
70acd4b2d5 os: pl050, pl11x, lan9118 use ARM platform driver
Make the framebuffer driver for pl11x chipsets,
the ps2 input driver for pl050, and the lan9116 NIC driver independent from
the pbxa9 board by using the newly introduced common ARM platform driver API.

Ref #3299
2020-05-27 11:56:46 +02:00
Stefan Kalkowski
1a80f166c5 os: introduce common platform driver for ARM
Ref #3299
2020-05-27 11:56:46 +02:00