Commit Graph

1193 Commits

Author SHA1 Message Date
Norman Feske
6491ba0589 init: avoid too eager child restart
This patch weakens the aggressive restart of a child with incomplete
environment sessions. The restart check is performed each time
the init configuration changes. In sculpt, this is not a rare special
case anymore but a frequent case when using the depot_rom as provider
for environment ROM sessions. In particular when starting a chain of
inter-depending children, the sculpt-manager quickly generates a
sequence of configurations with successively added start nodes.
2018-06-13 13:52:10 +02:00
Norman Feske
648539a513 init: don't report abandoned children
This is a fixup of "base: fix destruction of async env sessions".
2018-06-13 13:50:35 +02:00
Alexander Boettcher
ef482513c4 base: reset unfinished xml nodes in xml_generator
Fixes #2855
2018-06-13 13:50:35 +02:00
Norman Feske
d4c22654e1 init test: reduce RAM demand of app/dummy
The addition of the 'Cap_consumer' feature to app/dummy increased the
static RAM demand of the component to a point where 1 MiB no longer
suffices on sel4 (on this kernel, the base library uses a larger amount
of statically allocated data compared to the others). The tweaks enable
init.run and init_loop.run to work on sel4 on x86-64.
2018-06-12 12:11:51 +02:00
Christian Prochaska
d1524ba0b8 usb_block_drv: don't select alternate interface setting
Selecting an alternate interface setting, even if it is the same as the
current one, apparently makes the INQUIRY command fail with USB devices
like 'SanDisk Ultra Fit' (0781:5583) and 'Corsair Flash Voyager'
(1b1c:1a03) when the USB block driver is restarted.

Fixes #2860
2018-06-12 12:11:51 +02:00
Norman Feske
37be984d34 fs_rom: workaround for possible livelock
Thanks to Alexander Boettcher for investigating!
2018-06-12 12:11:50 +02:00
Martin Stein
bf055e2cb4 nic_router: fix uncaught interface RAM exhaustion
* Catch Quota_guard exceptions wherever we do 'new (_alloc)' in Interface
  and in case drop the packet that caused the exception
* Modify Interface::handle_config_2 to not use the guarded allocator of the
  NIC session quota as we cannot handle a RAM exhaustion well at this point
  in time. Instead use a Constructible member in Interface so that a needed
  RAM adds up to the calculation in the create_session implementation where
  an exhaustion is handled via a service denial.

Issue #2857
2018-06-12 12:11:50 +02:00
Martin Stein
97ea513122 nic_router: fix pure virtual call in ~Interface()
The interface destructor called pure virtual methods at least when
cancelling ARP- waiting states. The implementations were made by the
deriving classes Session_component respectively Uplink. This led to an
abort of the NIC router as the destruction of the derived class was
already done. A similar problem already occured in the past during the
construction of Interface and was back then solved by introducing a
separate init() method. This commit, however, solved the problem by
making Interface a member of the other classes. Therefore, the init()
method could be removed again. Furthermore, the interface polica could be
moved from Session_component_base to Session_component. The commit also
had to generalize the way the link state of an interface is determined.

Fixes #2856
2018-06-12 12:11:49 +02:00
Norman Feske
b96f0fa2df init: defer immediate restart of abandoned child
While a child is abandoned, we must limit the start of anothers with
the same name. Otherwise - of the child has startup problems - a number
of abandoned children with the same name may queue up. This becomes a
problem whenever the child destruction depends on an asynchronous
service that provides an env session for the children. If the service is
unable to keep up with the session requests (both create and close),
the queue of abandoned children becomes unbounded. Limiting the child
creation rate to one abandoned child per name mitigates this problem.
2018-06-12 12:11:47 +02:00
Norman Feske
6ab259d642 init: update state report on new/killed children
This patch reduces the latency of state reports when children are
removed or added, thereby, accellerating the feedback loop between a
management component and init during the staged startup or removal of
inter-dependent components.
2018-06-12 12:11:47 +02:00
Norman Feske
7088e4faaa os: add init_loop test
This test monitors the RAM quota of a dynamic init and a server hosted
within the dynamic init in the presence of a repeatedly created and
destructed client.
2018-06-12 12:11:46 +02:00
Martin Stein
4630c4b9ff nic_router: fix domain invalidation during init
Previously we were doing the initialization once over all domains,
remembered which of them became invalid and destroyed those afterwards.
This isn't sufficient. As soon as one domain becomes invalid we have to
dissolve/destroy this one, deinitialize all other domains again (as they
could contain references to the invalid domain) and retry to initialize
them from the beginning. We proceed with this until we have one run
without a domain becoming invalid. Then we can be sure that the last
initialization run did not create references to any invalid domain.

Issue #2840
2018-06-12 12:11:45 +02:00
Martin Stein
410652d42a nic_router: invalidate domains with same name
If two domains have the same name, invalidate (dissolve, destroy) them both.

Issue #2840
2018-06-12 12:11:45 +02:00
Martin Stein
8004d8757f nic_router: generic Avl_string_tree
The generic helper Avl_string_tree of the NIC router is currently only
used for finding domains via their names, but in the future it can be
used for finding uplinks by their labels also. Additionally, it enables
us to throw an exception when inserting two elements with the same
identifier.

Issue #2840
2018-06-12 12:11:44 +02:00
Martin Stein
bf1428be18 nic_router: simplify routing rule classes
* Get rid of the base classes Rule and Leaf_rule,
* Make log output about initiated or invalid routing rules conform to the rest
  of the router log, and
* Ensure that each type of routing rule when being invalid invalidates its
  whole domain.

Issue #2840
2018-06-12 12:11:44 +02:00
Norman Feske
950b270e74 init: support dynamic cap-quota adjustment
This patch makes init's dynamic quota balancing mechanism available for
capability quotas.

Fixes #2852
2018-06-12 12:11:42 +02:00
Norman Feske
d2bd8f70f6 input_filter: fix condition for delayed press
The condition was too rigid. In the case where no motion occurred in
between the press and release events of the magic button, the delayed
press event would not be delivered. This - in turn - confused other
components (like nitpicker) down the input chain.
2018-06-12 12:11:41 +02:00
Alexander Boettcher
5ca30b0318 platform_drv: disable PCI DMA class specific
for such classes where it should be safe and where we have seen issues.
Disabling in general bus master DMA causes on some machines hard hangs, e.g.
because the USB handover protocol was violated.

Fixes #2835
2018-06-12 12:11:40 +02:00
Norman Feske
7791937e84 init: reduce report latency for resource requests
In contrast to most information of init's state reports, which can be
monitored at a relatively low rate (like 2 seconds in Sculpt's runtime),
resource requests call for an immediate response by the consumer of the
report. Otherwise the requesting child stays unnecessarily blocked until
the next rate-limited state report is due. This patch adds a fast lane
for such low-latency state updates to init.
2018-06-12 12:11:38 +02:00
Josef Söntgen
9760210c77 fs_rom: revert notification changes 2018-05-31 13:51:23 +02:00
Martin Stein
a3905fcf87 nic_router: do not leak packets on link down/up
Do not send nor buffer packets at interfaces with link state "down". This
prevents that packets that were routed to one network (allowed to see them),
due to a sudden link down/up, are leaked to another network that is not
allowed to see them.
2018-05-31 12:28:15 +02:00
Martin Stein
1306892fbf nic_router: fix interface update on missing domain
When updating an interface in the NIC router to a new configuration and
the domain name of the interface has not changed but the domain
disappeared, the NIC router did not detach from the old domain correctly
which led to broken remnants of interface state objects (like connection
states).

Adapt the nic_router_uplinks run script to work with the fix.
2018-05-31 12:28:15 +02:00
Christian Helmuth
e2559a822b server/fs_report: don't truncate file initially
fs_report truncated the report file on construction of the report
session to mimic an "empty report". This prevented existing use cases
where the initial state was already written to the file system by other
means.

I doubt that use cases exist where the inital empty-report mimic is
needed and (if I'm wrong) there is still the race of the consumer
reading the file just before the report session is constructed.
Reporters that want to enforce an empty initial report should send it
explicitly.
2018-05-31 12:28:15 +02:00
1af6bd1454 Fs_rom: send signals on file removal
Clients may wish to act on missing files. In any case the fs_rom
needs to reopen a watch handle when a file is deleted, and this
sort of change to the internal state machine is propelled by
client RPC requests.

Fix #2839
2018-05-31 12:28:12 +02:00
Norman Feske
fc6e3c6b09 nitpicker: report boot-time motion activity 2018-05-30 13:36:40 +02:00
Norman Feske
b541379037 nitpicker: option to report display information
The new 'displays' report contains information about the used
framebuffer backend. It is issued when nitpicker has successfully passed
all initialization, in particular the connection to the framebuffer
driver. Hence, it can be taken as an indicator of whether the framebuffer
is available or not (e.g., caused by a faulty driver).
2018-05-30 13:36:40 +02:00
Martin Stein
22a69efafa nic_router: report DNS server 2018-05-30 13:36:40 +02:00
Martin Stein
3cac7e878d nic_router: invalid rules render domain invalid 2018-05-30 13:36:39 +02:00
Martin Stein
0592ac56c9 nic_router: handle invalid DHCP server 2018-05-30 13:36:39 +02:00
Martin Stein
49dc2b264f nic_router: point to point IP config 2018-05-30 13:36:39 +02:00
Martin Stein
44d97986a2 nic_router: attribute report.config_triggers 2018-05-30 13:36:39 +02:00
Martin Stein
c32c584f65 nic_router: fix uncaught exception on re-configure 2018-05-30 13:36:38 +02:00
Martin Stein
4802d22527 nic_router: reset uplink IP on link state change 2018-05-30 13:36:38 +02:00
Martin Stein
fe21ab48e0 nic_router: fix link-state for uplink interface 2018-05-30 13:36:37 +02:00
Martin Stein
19816bcd31 nic_router: when freeing a link log it beforehand
So, it can be located more easily when something goes wrong while
freeing a link.

Fixes #2815
2018-05-30 13:36:36 +02:00
Martin Stein
734d174f33 net: get rid of unused mac_from_string method
Issue #2815
2018-05-30 13:36:36 +02:00
Martin Stein
cea22866a8 config.xsd: adapt Boolean type to ascii_to(bool)
Harmonize the set of allowed values with the implementation of ascii_to for
bool.

Issue #2815
2018-05-30 13:36:35 +02:00
Martin Stein
ba348b73e2 nic_router: re-use dynamic IPv4 config if possible
When re-configuring the NIC router, determine for each domain if at least one
interface stays with the domain. If a domain fullfills this and has a
dynamic IP config (received via a DHCP client), keep the IP config.

To achieve this, the following changes have been made to the existing NIC
router code:

* Split-up Interface::handle_config into three steps:

  1) Determine for each interface if its domain can keep its IP config or
     or if it has to mark it invalid. This must be done before (re-)attaching
     any interface because during "attach" several decisions are made based on
     the validity of the IP config of corresponding the domain.
     (E.g. whether to participate in sending DHCP DISCOVERs {IP config
     invalid} or whether to participate in sending pending ARP REQUESTs
     {IP config valid} ).

  2) Detach, attach, or re-attach each interface according to the
     configuration. This must be done before re-considering the temporary
     state objects of each interface because the latter might have effects
     on the interfaces of remote domains which must then be in place already.

  3) Re-consider temporary state objects of each interface. (E.g. transport
     layer connection states)

* Re-work IP-config setter in a way that it works as follows:

  1) If the old IP config is valid, let all local interfaces as well as remote
     interfaces that depend on the IP config of the domain detach from the old
     IP config.

  2) Overwrite with new IP config

  3) If the new IP config is valid, let all local interfaces as well as remote
     interfaces that depend on the IP config of the domain attach to the new
     IP config.

Issue #2815
2018-05-30 13:36:34 +02:00
Martin Stein
ed69c11b01 nic_router: label attribute for uplink domain
The new attribute config.domain.label has effect only at the uplink
domain-tag. It determines which label the NIC router shall use when
requesting the NIC session for the uplink domain. If value of this
attribute changes at the uplink domain-tag, the NIC router closes and
re-requests the NIC session of the uplink with the new label.

Issue #2815
2018-05-30 13:36:34 +02:00
Martin Stein
1cfcab536c nic_router: Ipv4_config::print method
Issue #2815
2018-05-30 13:36:34 +02:00
Martin Stein
75ff599a91 ping: shorter retry timeouts in DHCP client
Set DHCP-DISCOVER retry timeout and DHCP-REQUEST retry timeout from 10
seconds to 2 seconds. This prevents problems with tests where the NIC
driver comes up slowly and the first packets of the DHCP client get
dropped.

Issue #2837
2018-05-30 13:36:33 +02:00
Martin Stein
0d5ed994e2 nic_router: fix dst and client MAC in DHCP replies
The Ethernet destination MAC address of a DHCP reply is not the same as the
DHCP client MAC address. The DHCP server of the NIC router did not take care
of this by now.

Issue #2837
2018-05-30 13:36:33 +02:00
Martin Stein
cee0c86c3c nic_bridge: fix reading of 'mac' attribute
Read as full MAC address and not as decimal uint8_t.

Issue #2837
2018-05-30 13:36:32 +02:00
Christian Prochaska
230ed1de37 usb_block_drv: make device reset optional
Fixes #2836
2018-05-30 13:36:31 +02:00
Norman Feske
7b6b3a4535 base: fix destruction of async env sessions
When an environment session is provided by a async service such as a
sibling component, the session metadata must be preserved until end of
the lifetime of the session at the server has been acknowledged by the
server. Since the session meta data of env sessions are always part of
the 'Child' object, the destruction of this object must be deferred
until this point.
2018-05-30 13:36:30 +02:00
6d5393dd31 Simplify fs_rom internals
Merge the 'Packet_handle' into the 'Rom_root' and use an Id_space to
match File_system handles to session objects rather than a list. This
avoids the need to override 'Root_component::_destroy_session'.

Fix #2833
2018-05-30 13:36:29 +02:00
Norman Feske
0c26f33819 init: keep running even when RAM is exhausted
When exhausted of RAM quota while starting children, init used to throw
an uncaught 'Out_of_ram' exception as this condition was considered
fatal. However, this behavior is undesired when init is used in a highly
dynamic yet long-running fashion like sculpt's runtime subsystem. This
change keeps init running despite the error condition, giving the user
the chance to relieve the resource pressure.
2018-05-30 13:36:28 +02:00
Alexander Boettcher
e6d20aba93 base: support to attach RAM dataspaces readonly
Fixes #1633
2018-05-30 13:36:27 +02:00
Norman Feske
d3626bd84f nitpicker: fix transparency artifacts
The 'View_stack::draw_rec' method limited the redraw to parts of the
view that were explicitly marked as dirty. This does not produce the
desired result when stacking multiple transparent views. Here, the
background views must be drawn regardless of whether they are marked as
dirty or not.
2018-05-30 13:36:23 +02:00
Christian Prochaska
c6e4f5914e usb_block_drv: release packet after device reset
Fixes #2827
2018-05-30 13:36:20 +02:00
Christian Prochaska
68ec33b0d3 usb_block_drv: use 10-byte SCSI commands by default
Fixes #2826
2018-05-30 13:36:20 +02:00
Christian Prochaska
5ac56be748 usb_block_drv: set inquiry response length to 36 bytes
Fixes #2825
2018-05-30 13:36:20 +02:00
Christian Prochaska
cecd461f38 usb_block_drv: look up endpoints at runtime
Fixes #2824
2018-05-30 13:36:19 +02:00
Christian Prochaska
106a5f1d4d usb_block_drv: calculate block count correctly
Fixes #2823
2018-05-30 13:36:19 +02:00
Martin Stein
3d480ec947 nic_router: fix config update of ICMP links
Previously, the update of ICMP links on a new router configuration lead to an
uncaught exception.

Issue #2795
2018-05-30 13:36:19 +02:00
Alexander Boettcher
501d82b99f platform_drv: skip assign device if iommu missing
Avoid red messages in the log on machines with no IOMMU, which recurring
confuse people.

Issue #2801
2018-05-30 13:36:18 +02:00
Christian Helmuth
8f102264d3 server/fs_report: open/close file for each write
The file may also be changed by other components, so a open-close cycle
for write() is more robust. For example, Vim removes the original file
and recreates with the new content.
2018-05-30 13:36:17 +02:00
Norman Feske
7d55adf01c nit_fb: defer mode change to client response
The '_active_mode' must not be changed at any time except when the
client asks for the 'Framebuffer::mode'. Otherwise, the dimensions of
dataspace used by the client is not always consistent with the mode
information as gathered by the client.
2018-05-30 13:36:15 +02:00
Christian Helmuth
cb3556877d pointer: show default pointer on empty shape report 2018-05-30 13:36:15 +02:00
Christian Prochaska
2b75445ac1 usb_block_drv: keep driver instance between sessions
Fixes #2813
2018-05-30 13:36:13 +02:00
Martin Stein
2d229a2b72 ping: support UDP
Ping via specific UDP port instead of ICMP Echo with the two new configuration
attributes 'protocol' and 'dst_port'.

Issue #2775
2018-05-30 13:36:12 +02:00
Martin Stein
d93fda594a ping: dynamic IP configuration
Use DHCP to obtain and maintain an IP configuration if no static
configuration is given.

Issue #2775
2018-05-30 13:36:12 +02:00
Martin Stein
ce57319e4b nic_router: bind uplink session lifetime to domain
Normally, the NIC sessions are independent from the domain tags.
However, by now the uplink session, in contrast to the sessions of the
other domains, is still not a server but a client. This means that only
the NIC router itself can decide when to open and close uplink sessions
and how many. Thus, with this commit, we break with the pattern that
session lifetime is independent from domains by letting the NIC router
create the uplink session when the uplink domain appears and close the
session when the domain disappears.

Fixes #2795
2018-05-30 13:36:12 +02:00
Martin Stein
7085640f05 nic_router: remove 'mac_first' attribute
Since the router MAC is allocated like the donwlink MACs it can't happen
anymore that these MACs clash, for instance due to nested routers. Thus,
the range of the MAC allocators of nested routers must not be exclusive
anymore which deprecates the 'mac_first' configuration attribute.

Issue #2795
2018-05-30 13:36:12 +02:00
Martin Stein
e83f095fd2 nic_router: downlinks use own router MAC address
Allocate a virtual MAC address at runtime that is used as router
Ethernet-identity for all downlink domains. This makes the downlink
domains independent from the uplink session.

Issue #2795
2018-05-30 13:36:11 +02:00
Martin Stein
41dbad13e4 nic_router/nic_bridge: re-work Mac_allocator
The old MAC allocator had several drawbacks:

* the address base was a public static that could and must have been written
  directly from outside the class
* the in-use-flag array was based on unsigned values consuming 4 bytes each
  for only one bit of information
* it was a public header that we actually don't want to expose to all
  components but only to the few networking components
* it used the not-so-safe bit notation for integer members of GCC

The new version fixes all these drawbacks.

Issue #2795
2018-05-30 13:36:11 +02:00
Martin Stein
980f3e9c5c net: use Size_guard for packet-data accessors
Instead of handing over the maximum available size to the packet data
accessors, hand over a size guard that keeps track of the packets
boundaries.

This commit also moves the size-guard utilitiy header of Ping and NIC
Router to the include/net directory making it a part of the net library.
It applies the new approach to all net-lib users in the basic repositories.

Ping looses its configurability regarding the ICMP data size as this would
require an additional method in the size guard which would be used only by
Ping.

The size guard was also re-worked to fit the fact that a packet can
bring a tail as well as a header (Ethernet).

Issue #2788
2018-05-30 13:36:11 +02:00
Josef Söntgen
7f285bb074 part_blk: add reporting of expandable GPT entries
Issue #2803.
2018-05-30 13:36:10 +02:00
Josef Söntgen
45743ce884 part_blk: probe whole disk if no valid MBR found
Report the whole disk as partition 0 and probe file system. The
partitions type is set to 'disk'.

Issue #2803.
2018-05-30 13:36:10 +02:00
Josef Söntgen
90360674ed part_blk: report block size 2018-05-30 13:36:10 +02:00
Josef Söntgen
40a0fe9349 part_blk: add minimal file system probing
For now it is enough to differentiate the most commonly used file
system on Genode, e.g. Ext2 for the Genode partition and FAT32 for
(U)EFI partitions.

Issue #2803.
2018-05-30 13:36:09 +02:00
Josef Söntgen
9f8369c01e part_blk: change behaviour regarding GPT usage
The component will now always try to parse the MBR as well as the GPT
(in this order). It will bail out if both are considered valid, using
GPT/MBR hybrid tables is not supported.

Fixes #2803.
2018-05-30 13:36:09 +02:00
Alexander Boettcher
0de62717f9 x86: detect root bridge properly
Beforehand the root bridge was expected to be at 0:0.0.

Fixes #2801
2018-05-30 13:36:07 +02:00
Sebastian Sumpf
abe76e0d93 vfs rom: return 0555 file permissions
issue #2791
2018-05-30 13:36:06 +02:00
e005d966b4 Ram_fs: immediate directory notifications
Do not mark and defer notification for directories when a file is
created or removed, mark and immediately queue a notification.

Fix #2808
2018-05-30 12:26:19 +02:00
e2661c58dc Convert static VFS library to dynamic library
Fix #2759
2018-05-30 12:26:19 +02:00
Stefan Kalkowski
68015a6e9d base: remove cortex* compiler flags (fix #2787) 2018-05-03 15:32:01 +02:00
Norman Feske
b748c4186d nitpicker: deliver pointer pos on hover change
This way, a client is able to respond to the initial movement into the
view area.
2018-05-03 15:32:00 +02:00
0b980073c1 VFS: close handles via handle method
The using pattern 'handle->close' is less error prone than attempting
'handle->ds().close(handle)' or 'fs.close(handle)'.

Ref #2782
2018-05-03 15:31:57 +02:00
Martin Stein
11a297b557 net: consider tail of Ethernet frame
The Ethernet payload may be followed by padding of variable length and
the FCS (Frame Check Sequence). Thus, we should consider the value
"Ethernet-frame size minus Ethernet-header size" to be only the maximum
size of the encapsulated IP packet. But until now, we considered it to
be also the actual size of the encapsulated IP packet. This commit fixes
the problem for all affected components of the Genode base-repository.

Fixes #2775
2018-05-03 15:31:57 +02:00
Martin Stein
841d583678 net: implement Udp_packet::checksum_error
For checking the checksum of a UDP packet.

Issue #2775
2018-05-03 15:31:56 +02:00
Martin Stein
6b55790e73 net: use generic internet checksum
This reduces the redundant implementations of checksum calculation to
one generic implementation, makes the checksum interface conform over
all protocols, and brings performance optimizations. For instance,
the checksum is now calculated directly in big endian which saves us
most of the previously done byte-re-ordering.

Issue #2775
2018-05-03 15:31:56 +02:00
Martin Stein
836df90f6b nic_router: fix typo in Nat_rule::print
Issue #2775
2018-05-03 15:31:56 +02:00
Martin Stein
7adc7bc01a nic_router: more descriptive errors in DHCP server
Instead of telling the user merely that his/her DHCP server config
is invalid, tell him/her why exactly it is invalid.

Issue #2751
2018-05-03 15:31:55 +02:00
Johannes Schlatow
48aa50b97c test/trace_logger: fully automate test
Issue #2735

Co-authored-by: Martin Stein <martin.stein@genode-labs.com>
2018-05-03 15:31:55 +02:00
Johannes Schlatow
b47bf81b73 trace_logger: be aware of trace-buffer wraps
Issue #2735

Co-authored-by: Martin Stein <martin.stein@genode-labs.com>
2018-05-03 15:31:55 +02:00
Martin Stein
373134c4e7 net: safer access to packet data
Replace packet method 'T *data' by the new methods 'T &reinterpret_data'
for parsing or modifying existing sub-protocol packets and 'T
&construct_at_data' for composing a new sub-protocol packet. This has
the advantage that, when composing a new packet, the default constructor
that zero-fills the packet is always called first.

Fixes #2751
2018-05-03 15:31:54 +02:00
Norman Feske
afcad2a968 os: new Input::Event representation
This commit changes the 'Input::Event' type to be more safe and to
deliver symbolic character information along with press events.

Issue #2761
Fixes #2786
2018-05-03 15:31:25 +02:00
Martin Stein
5ef56395f0 test/timeout: raise polling round time
On the Raspberry PI, the 2 seconds of round time in the polling test
were not sufficient to reach the goal of at least 1000 successful polls.
Thus, the commit sets the round time to 2.5 seconds which doesn't hurt to
much but allows the RPI to just make it.

Fixes #2779
2018-05-03 15:31:21 +02:00
Norman Feske
6389434222 input_filter: rm input selection in output node
This patch largely reverts the feature of selecting parts of input nodes
from within the output node (as originally introduced by commit
7263cae5a18b4f1f2293d031f9bafcf05ba51146). The selection of content
should be consistently performed by input nodes instead. The principle
ability of copying input nodes verbatim into the output stays available.

Issue #2691
2018-05-03 15:31:19 +02:00
Norman Feske
afadbbbb04 rom_filter: add attribute matching for input nodes
The new 'attribute' and 'value' attributes of input nodes
can be used to select input sub nodes that match the presence and value
of the specified attribute.

Issue #2691
2018-05-03 15:31:18 +02:00
Boris Mulder
4b4760ce8e rom_filter: initially try to parse input ROM
Issue #2691
2018-05-03 15:31:18 +02:00
Norman Feske
0011dd1623 terminal: remove built-in keyboard layout handling
Fixes #2757
2018-04-19 13:38:34 +02:00
Norman Feske
6a12a6b4ba vfs: reduce ROM-update rate Rom_file_system::stat
The 'stat' method is called for all paths, not just the specific file
system node of the ROM module. The ROM update is needed only in the
latter case.

Otherwise, when always updating the ROM on stat, stat calls on the VFS
become very expensive in the presence of a mounted ROM module if the ROM
is obtained from fs_rom (which re-watches the file and all its
individual path elements whenever the 'update' RPC function is called).
2018-04-19 13:38:33 +02:00
82a683eccc VFS: construct file-systems using Vfs::Env object
Reduce the size and forward compatibility of VFS file-system
constructors by passing an object holding accessors for 'Genode::Env',
'Genode::Allocator', response handlers, and the root file-system.

Fix #2742
2018-04-19 12:38:27 +02:00
Stefan Kalkowski
7949c194e9 gpio_drv: mask IRQ until it is acknowledged
When working with GPIO interrupts on i.MX6SX for Ethernet PHYs
it became obvious that the GPIO driver repeatedly receives interrupts
for the same event, because it acknowledges the interrupt before a
client has handled the event.

Ref #2750
2018-04-19 12:38:24 +02:00
Stefan Kalkowski
f653be1ebc gpio_drv: add support for i.MX6
Fix #2750
2018-04-19 12:38:24 +02:00
Josef Söntgen
04516a0d39 nvme_drv: add driver for NVMe storage devices
This driver component provides support for using consumer NVMe storage
devices, i.e. it omits name space managment and will always use the
first name space, on Genode. For now it defaults to a reasonable low
configuration:

  -    1 I/O queue (completion/submission tuple)
  -  128 entries in the I/O queue
  - 4096 as the only I/O transaction memory page size

Fixes #2747.
2018-04-19 12:38:22 +02:00
Josef Söntgen
372e426ec7 platform_drv: recognize PCIe NVMe controller
Issue #2747.
2018-04-10 13:56:22 +02:00
Josef Söntgen
ce93e47e89 os: add Block session tester component
Issue #2747.
2018-04-10 13:56:04 +02:00
Martin Stein
fa59dc0a5b nic_router: use DHCP parameter request list
Send a list of the expected options with the DHCP DISCOVER and REQUEST
when acting as DHCP client.

Fixes #2738
2018-04-10 13:03:19 +02:00
Martin Stein
77e968a5e3 nic_dump: add config XML schema file
Issue #2738
2018-04-10 11:20:49 +02:00
Martin Stein
d6e1c462cc nic_dump: default attribute
The 'default' attribute is useful to change the default value for those
protocol attributes that are not explicitely set in the configuration of
the component.

Issue #2738
2018-04-10 11:20:49 +02:00
Martin Stein
ed13a0a262 nic_dump: make protocols configurable
Each supported protocol now has an attribute with the name of the protocol in
the config tag. Each of these attributes accepts one of four possible values:

* no      - do not print out this protocol
* name    - print only the protocol name
* default - print a short summary of the most important header values
* all     - print all available header values

Example:

! <config eth="name"
!         arp="all"
!         ipv4="default"
!         dhcp="no"
!         icmp="all"
!         udp="no"
!         tcp="default"
!         ... />

Corresponding output example:

! ETH IPV4 10.0.2.212 > 10.0.2.55   time 7158 ms (Δ 11 ms)
! ETH IPV4 10.0.2.55 > 10.0.2.201  TCP 80 > 49154 flags ' time 6976 ms (Δ 5 ms)
! ETH ARP hw 1 prot 2048 hwsz 6 protsz 4 op 1 srcmac 02:02:02:02:02:01 srcip 10.0.2.212 dstmac 00:00:00:00:00:00 dstip 10.0.2.55 time 7074 ms (Δ 98 ms)

Issue #2738
2018-04-10 11:20:49 +02:00
Norman Feske
14180d60be nitpicker: center initial pointer position 2018-04-10 11:20:48 +02:00
Norman Feske
9d233b73a3 nitpicker: improve 'Session::focus' handling
Nitpicker's 'Session:focus' call used to trigger a one-off focus change
at call time. This focus change did not pass the same code paths as a
focus change triggered by a "focus" ROM update, which led to
inconsistencies.

This patch changes the implementation of 'Session::focus' such that the
relationship of the caller and the focused session is preserved after
call time. Whenever the calling session is focused in the future, the
specified session will receive the focus instead. So 'Session::focus'
represents no longer a single operation but propagates the information
about the inter-session relationship. This information is taken into
account whenever the focus is evaluated regardless of how the change is
triggered.

This makes the focus handling in scenarios like the window manager more
robust.

Issue #2746
2018-04-10 11:20:47 +02:00
Norman Feske
23696760c3 fb_sdl: drop spurious motion events without motion
Relative motion events with a motion vector of (0,0) should not exists.
They cause jittery movements of nitpicker's pointer position. This
patch filters out such events.
2018-04-10 11:20:47 +02:00
Martin Stein
0bd73e440d nic_router: do DHCP requests without source IP
Issue #2738
2018-04-10 11:20:47 +02:00
Martin Stein
db3250f6ee nic_dump: adapt to new README scheme 2018-04-10 11:20:46 +02:00
Martin Stein
d67484bb87 trace_logger/README: add examples subsection 2018-04-10 11:20:46 +02:00
Martin Stein
4aa7057e68 trace_logger: adapt to new README scheme 2018-04-10 11:20:46 +02:00
Martin Stein
f68a719f4c ping/README: add examples subsection 2018-04-10 11:20:46 +02:00
Martin Stein
0fc3202160 ping: adapt to new README scheme 2018-04-10 11:20:45 +02:00
Martin Stein
b70fa7b0c1 nic_router: adapt to new README scheme 2018-04-10 11:20:45 +02:00
Martin Stein
38e50a5b4f nic_router/README: adapt to new ICMP features 2018-04-10 11:20:45 +02:00
Martin Stein
ce9a0cbc19 nic_router/config.xsd: add icmp_idle_timeout_sec 2018-04-10 11:20:45 +02:00
Martin Stein
6edf9ccf5a net: get rid of static constructors 2018-04-10 11:20:44 +02:00
Martin Stein
84a3fbd239 app/ping: perform ICMP Echo to another IP host
The 'ping' component continuously sends ICMP Echo requests to a given IP host
and waits for the corresponding ICMP Echo replies. For each successfull ICMP
Echo handshake it prints a short statistic. By now, it can be used only with a
static IP configuration. The size of the ICMP data field can be configured. It
gets filled with the letters of the alphabet ('a' to 'z') repeatedly.

Issue #2732
2018-04-10 11:20:44 +02:00
Christian Helmuth
92edcb17e5 Warn on redundant call to exec_static_constructors() 2018-04-10 11:20:43 +02:00
Martin Stein
b3791fabc2 test/timeout: test locks in handlers
Originally, the timeout framework caused deadlocks when acquiring the same
lock from different timeout handlers. This use case is now tested in the
timeout test.

Fixes #2704
2018-04-10 11:20:43 +02:00
Martin Stein
f681f9e844 test/timeout: fix typo
Issue #2704
2018-04-10 11:20:43 +02:00
Martin Stein
93a0c66589 timeout: do not handle timeouts while scheduling
To handle all pending timeouts in the context of scheduling a timeout
was only necessary because the Timeout framework once made use of the
Alarm framework. The method Alarm_scheduler::schedule_absolute took an
absolute deadline as argument and we couldn't change this beause the
Alarm framework was also used without the Timeout framework. We had to
calculate this absolute deadline with the now time of the Timeout
framework but the Alarm framework has its own now time that is always a
bit behind the one of the Timeout framework. This lead to bad decisisons
when finding the right position for the new timeout. Now, we can call
schedule_absolute with a relative duration and thereby fix the problem.

When we schedule an absolute timeout without considering the small time
difference, the end-time for the timeout that is calculated using the
local time value is also smaller than the expected end-time. This can
also lead to directly triggering timeouts that should have triggered
with a certain delay.

As it is not trivial to update the local time value while scheduling a
timeout _without_ calling other timeout handlers, we simply raise the
duration of the new timeout by the age of the local time value.

Issue #2704
2018-04-10 11:18:18 +02:00
Martin Stein
f152e3e9d0 timeout: dequeue all pending alarms before reschedule
This fixes the problem that large timeouts, when rescheduled, are interpreted
to be from the last now_period instead of, what would be right, the next
now_period. This occured if there were multiple pending alarms at the head of
the queue and the reschedule of the first one was done with the other outdated
deadlines still in place.

Issue #2704
2018-04-10 11:11:55 +02:00
Martin Stein
bfb96536da timeout: _setup_alarm calculates deadline itself
Instead of taking the absolute deadline of a timeout as argument from
outside (where it is calculated with a freshly requested now time), we
now take a relative duration as argument and calculate the deadline with
the scheduler-internal now time (which can be a little bit outdated).
This enables us to schedule timeouts without updating the internal now time
and thereby handle all pending timeouts.

Issue #2704
2018-04-10 11:11:55 +02:00
Martin Stein
38dbd59d8a timeout: become independent of the Alarm framework
Integrate the code of the Alarm framework directly into the Timeout
framework.  The former Alarm-framework methods are all private to the
corresponding classes of the Timeout framework and get prefixed with
'_alarm__'. The latter avoids name clashes and makes it easier to
simplify the code later.

Issue #2704
2018-04-10 11:11:54 +02:00
Martin Stein
8c7bbdecdf nic_router: conform log in Domain
In the domain class there were several places where output was generated
not conforming to the typical output format of the router ("[domain]
event: parameters").

Issue #2670
2018-04-10 11:11:54 +02:00
Martin Stein
87eb23f562 nic_router: fix uncaught Domain_tree::No_match
When having an interface that yet is not attached to a domain, then a new
configuration comes in and the interface receives a domain name (via the
policy tag) but the corresponding domain doesn't exist, an exception
Domain_tree::No_match is thrown but was not caught and handled until now.

Issue #2670
2018-04-10 11:11:54 +02:00
Martin Stein
54b10b1b38 nic_router: forward ICMP dst unreachable messages
This follows the guidelines in RFC 5508 to enable forwarding of ICMP
"Destination Unreachable" that correspond to an existing link state in
the NIC router. It also serves as blueprint for forwarding ICMP error
messages in general (They are merely not enabled because we don't test
them).

Issue #2732
2018-04-10 11:11:54 +02:00
Martin Stein
6a988749a1 nic_router: print packet info before sending it
By now, the 'verbose packets' output when sending packets was printed after
finish sending the packet. This makes following the packet flow harder if you
have multiple components that print such information.

Issue #2732
2018-04-10 11:11:54 +02:00
Martin Stein
168407a40a nic_router: config attribute 'mac_first'
The mac_first attribute tells the MAC-address allocator of the router
from which MAC address to start allocating. This is useful, for
instance, if you have nested nic_routers. In this case, identical
MAC-allocator settings have led to name clashes in the past, so, you
want to be able to configure them differently.

Issue #2732
2018-04-10 11:11:53 +02:00
Martin Stein
7b3343c2dc nic_router: NAPT for ICMP echo messages
This follows the guidelines in RFC 5508 to enable ICMP echo through a NAPT
channel of the NIC router. It serves also as blueprint for ICMP queries in
general (they are merely not enabled because we don't test them by now).

Issue #2732
2018-04-10 11:11:53 +02:00
Martin Stein
d2adce7ba6 nic_router: fix bug in Link::handle_config
We updated UDP link states with the wrong idle-timeout value.

Issue #2732
2018-04-10 11:11:53 +02:00
Martin Stein
8981d3baf5 nic_router: conform log in Interface::_handle_eth
Prefix "Drop Packet" messages always with "[<DOMAIN>]".

Issue #2732
2018-04-10 11:11:53 +02:00
Martin Stein
9b936dd120 nic_router: packet verbose at detached interfaces
The 'verbose packets' output previously was not generated for Interfaces
without a domain. But this is desirable as the router nonetheless
receives packets at such interfaces. This is now fixed and such output
is simply prefixed with a "[?]" denoting that the interface has no
domain.

Issue #2732
2018-04-10 11:11:53 +02:00
Martin Stein
98617432c3 nic_router: send ICMP error on unroutable packet
Send an ICMP "Destination Network Unreachable" as response to packets that
are not routable by the NIC router.

Issue #2732
2018-04-10 11:11:52 +02:00
Martin Stein
4dc8f6dca4 nic_router: fix missing IPv4.ECN initialization
We missed to zero-out the ECN field in IPv4 packets. We don't use the ECN
field but there might be old data left in the packet RAM allocated by the
NIC packet streams. If we don't zero-out ECN it might leak old data.

Issue #2732
2018-04-10 11:11:52 +02:00
Martin Stein
009330ab4c nic_dump: support ICMP
Print out common header information of the Internet Control Message
Protocol.

Issue #2732
2018-04-10 11:11:52 +02:00
Martin Stein
365bd347a6 net: ICMP protocol
Packet format and common utilities for the Internet Control Message
Protocol.

Issue #2732
2018-04-10 11:11:52 +02:00
9c6b720ec1 Notification support for the VFS library
Add a new 'Vfs_watch_handle' type to the VFS interface. This handle type
will pass a handle context up through the I/O handler to the application
when a notification event occurs.

Watch support implemented for RAM and File_system plugins, all other
file-systems return WATCH_ERR_STATIC by default.

Test at run/fs_rom_update_ram and run/fs_rom_update_fs.

Fix #1934
2018-04-10 11:11:51 +02:00
Norman Feske
3778558608 os: reworked nitpicker_gfx/text_painter.h
This patch improves the `Text_painter` utility that is commonly used by
native Genode components to render text:

- Support for subpixel positioning
- Generic interface for accessing font data
- Basic UTF-8 support

Since the change decouples the font format from the 'Text_painter' and
changes the API to use the sub-pixel accurate 'Text_painter::Position'
type, all users of the utility require an adaptation.

Fixes #2716
2018-04-10 11:09:18 +02:00
Norman Feske
b0b92e4ee2 vfs: pass root directory to plugins
This patch enables the use of the VFS from VFS plugins by passing a
reference of the root directory to the constructors of file-system
instances. Since it changes the signature of 'Vfs::Dir_file_system',
any code that uses the VFS directly requires an adaptation.

Fixes #2701
2018-04-10 11:09:17 +02:00
Martin Stein
e213b9046d nic_router: inform clients on DNS server change
If the remote DNS server address value of a DHCP server changes, the affected
interfaces do a link down/up to inform all DHCP clients that they should
re-request their DHCP info.

Issue #2730
2018-04-10 11:06:00 +02:00
Martin Stein
4bee38ea62 nic_router: DHCP server considers dns_server_from
The dns_server_from attribute of the dhcp-server tag has effect only if
the dns_server attribute of the same tag is not set. If this is the
case, the dns_server_from attribute states the domain from whose IP
config to take the DNS server address. This is useful, for instance, if
the stated domain receives the address of a local DNS server via DHCP.
Whenever the IP config of the stated domain becomes invalid, the DHCP
server switches to a mode where it drops all requests unanswered until
the IP config becomes valid again.

Issue #2730
2018-04-10 11:06:00 +02:00
Martin Stein
fec53690d7 nic_router: get DNS server from dynamic IP config
If available, read and remember DNS server address from DHCP replies per
domain.

Issue #2730
2018-03-29 16:13:22 +02:00
Martin Stein
04c3ae56ed nic_router: read DHCP-server config only once
Until now, the DHCP server of a domain was re-constructed each time the
IP config changed. This is not necessary as a domain that acts as DHCP
server must have a static IP config as it would be senseless to act as
DHCP server and client at the same time. Now, a configured DHCP server
is constructed only when the Domain gets constructed and stays alive
until the domain gets destructed. Furthermore, we now throw Domain::Invalid
if there is no static IP config plus a DHCP server configured. However, by
now, this exception is not caught as it is not trivial to destruct the
domain at this point.

Issue #2730
2018-03-29 16:12:05 +02:00
Martin Stein
7d50219902 nic_router: add missing 'override' declarations
Issue #2730
2018-03-29 16:10:13 +02:00
Martin Stein
b344f2bc39 nic_router: fix pure virtual call in Interface
The Interface constructor previously tried to attach to a domain.  This
might include sending a DHCP request to get the domain a valid IP config.
But in order to achieve this, the constructor used a pure virtual method
of Interface which crashes due to the unfinished vtable. To fix this bug,
the attach attempt was moved to a new Interface::init method.

Issue #2730
2018-03-29 16:09:52 +02:00
Martin Stein
1044c2fcab nic_router: simplify the pointer utility
Instead of Pointer<T>::set use assignment operator with implicit constructor
from T-reference. Instead of Pointer<T>::unset use assignment operator with
Pointer<T>(). Instead of Pointer<T>::deref provide () operator.

Issue #2730
2018-03-29 16:03:28 +02:00
Martin Stein
92a30e0953 nic_router: handle configuration changes
The router reacts as follows to a configuration change:

1) Construct new internal configuration representation (the old one stays
   in place to be able to do comparisons in the following steps)
2) Iterate through all user-dependent objects (interfaces, link states, ARP
   information, DHCP information) and re-check which remain valid with the
   new configuration and which must be dismissed.
3) Adapt the objects that remain valid to the new configuration (re-write
   references) and remove or detach the dismissed objects.
4) Do a link state DOWN at each interface and a link state UP at each
   interface that remains attached to a domain.
5) Replace the old internal configuration representation with the new one

This way, the router keeps as much user dependent states as possible
while going through a configuration change. Thus, overwriting the old
configuration with an exact copy of itself is (almost) transparent to
clients of the router. Almost, because there are things the router must
do on every configuration handling, like re-scheduling the expiration
timeouts of links.

Ref #2670
2018-03-29 15:39:44 +02:00
Martin Stein
4e8453b7bf nic_router: destroy list items during for_each
The for_each method of the List wrapper remembers the next list item
before calling the functor on the current one, so, the current one can
be destroyed during the functor.

Ref #2670
2018-03-29 15:39:44 +02:00