Commit Graph

1931 Commits

Author SHA1 Message Date
Norman Feske 4f316cffbc init: update state reports on heartbeat responses
Init's state reports are updated whenever an interesting part of init's
internal state changes (e.g., when sessions are established, or when
children are started/removed). However, until now, a change of a skipped
heartbeat counter was not taken as trigger for state-report updates.

In scenarios where no other intersting event happened, the last reported
state did no reflect the current heartbeat state. In particular, when
the last report was issued during the construction of a new child just
before the child became able to respond to heartbeat requests, the stale
report hinted at heartbeat problems that were just an initialization
artifact. This problem became visible on some Qemu platform where the
child startup takes a long time.

The patch tracks the observed skipped-heartbeat counter and triggers a
report whenever the counter value changes.

Issue #3079
2019-01-07 12:33:55 +01:00
Martin Stein 68f6b9443e test/trace_logger: don't use Trace::timestamp
At least on foc pbxa9, Trace::timestamp gets stuck.
2019-01-07 12:33:55 +01:00
Norman Feske ed7dfddc5d Increase timeout of init test
The increased timeout takes the use of NOVA or seL4 on Qemu into
account.

Issue #3079
2019-01-07 12:33:55 +01:00
Norman Feske 8f1f4f2652 Improve robustness of init test
By adding an additional synchronization point in the form of a matched
log message, this patch makes the timing behavior of the "test changing
provided services" step more deterministic. Without it, the scheduling
of OKL4 and base-hw resulted in a merge of two config updates into one.

Issue #3079
2019-01-07 12:33:55 +01:00
Josef Söntgen 108034b050 packet_stream: packets w/o payload are still valid
Packets whose data is stored within the Packet_descriptor itself
but not as payload, .e.g Usb::Packet_descriptor, are valid packets
after all. So loosen the packet valid check for zero-sized packets
is reasonable.

Fixes #3076.
2019-01-07 12:33:54 +01:00
Norman Feske 03cbd4257f sequence: add 'repeat="yes"' config option
Fixes #3075
2019-01-07 12:33:54 +01:00
Stefan Kalkowski 88b704db19 depot_autopilot: reduce timeouts of test pkgs
Our overall nightly test time greatly decreases when the timeouts for
the single tests are not that over-pessimistic. Using the slowest
platforms as reference, this commit reduces the test timeouts.

Ref #3027
2019-01-07 12:30:40 +01:00
Martin Stein f8a27e6acf pkg/test-init_loop: raise timeout to 150s
At least autopilot qemu x86_64 foc needs more time.
2019-01-07 12:25:46 +01:00
Alexander Boettcher 85b998a4af os: nullpointer check in os/path.h
Issue #3022
2019-01-07 12:25:45 +01:00
Alexander Boettcher 518d157f76 os: avoid null pointer acces in alarm lib
Issue #3022
2019-01-07 12:25:45 +01:00
Alexander Boettcher dbeb1b82a9 os: avoid warning in ethernet.h
issued by clang/llvm static analyzer
2019-01-07 12:25:45 +01:00
Alexander Boettcher aa03c4ce9f os: avoid garbage warnings in app/painter
Issue #3022
2019-01-07 12:25:45 +01:00
Alexander Boettcher 5572430ba5 os: avoid ambiguous warnings for vfs/server
between File_system and Vfs::File_system

Issue #3022
2019-01-07 12:25:45 +01:00
Alexander Boettcher 9bb0e10eec os: avoid warning in platform driver
calling wrong destructor issued by clang/llvm static analyzer

Issue #3022
2019-01-07 12:25:45 +01:00
Martin Stein 858a7823fb init: print label on "no route to service" warning
It can be hard to interpret "no route to service" warnings if Init doesn't
print the session label
2019-01-07 12:25:43 +01:00
Martin Stein 7f959a06f6 depot_autopilot: tune for multi-platform support
Issue #3027
2019-01-07 12:25:43 +01:00
Martin Stein 82ded858aa nic_bridge: fix bug when reading MAC address
For reading the MAC address we try first to read it from the <policy> tag, and
when it is not defined in the <policy> tag, we allocate a MAC. But there was
no handling of the case that there is no appropriate <policy> tag. In this
case we want to create the session with an allocated MAC also.
2019-01-07 12:25:42 +01:00
Ehmry - 9c7d5b2a66 Implement print and min/max for Microseconds and Milliseconds
Ref #3050
2019-01-07 12:25:42 +01:00
Christian Helmuth 11eecdc7bd depot: update recipe hashes 2018-11-29 11:54:31 +01:00
Martin Stein 89020bc3c0 depot_autopilot: move RTC test to autopilot.list 2018-11-29 11:54:30 +01:00
Norman Feske 538c3a6692 init: consider lacking service name attribute
This patch makes init robust against invalid routing rules that lack a
name attribute in the '<service>' node. This situation may occur when
interactively editing routes in Sculpt.
2018-11-29 11:54:30 +01:00
Sebastian Sumpf 48e07d7dff vfs: support files names of with exactly 100 characters
GNU tar does not null terminate or create a long name for file names of
exactly 100 characters.

issue #3060
2018-11-29 11:54:30 +01:00
Norman Feske 98518e39cd drivers_interactive-pc: increase ps2_drv caps
This is needed because the added heartbeat monitoring.
2018-11-29 11:54:29 +01:00
Ehmry - a2bdcc68c2 Throw exception for invalid packets at packet streams
Some application code is dereferencing the pointer returned by
'packet_content' at packet streams without checking that it is valid.
Throw an exception rather than return a null pointer, except for
zero-length packets, which have somewhat implicit invalid content and
that we believe to be properly handled in all current cases.

The client-side of a packet stream cannot take corrective action if the
server-side is sending packets with invalid content, but the servers
that provide packet streams should catch this exception to detect
misbehaving clients.

Ref #3059
2018-11-29 11:54:29 +01:00
Ehmry - 447329eaee Chroot: change root to explicit prefix and label sub-dirs
Change the root of a session request into an explicit path and apply the
label-to-path conversion using the "path_prefix" policy attribute. This
is in addition to only applying a root change with a "path" attribute.

Ref #3031
Fix #3056
2018-11-29 11:46:02 +01:00
Johannes Schlatow 74f2954013 packet_stream: improve buffer alignment
The bulk buffer is now 64Byte-aligned so that the allocated
packets get aligned likewise (assumed the packet allocator uses an
appropriately aligned block size). This ensures that each packet
starts at a new cache line on common platforms.

Issue #3053
2018-11-29 11:46:02 +01:00
Johannes Schlatow dc0bfd7008 zynq: zero-copy implementation of nic_drv
- Packet stream buffers are directly passed to DMA.
- Also enables pause frames and checksum offloading.

Issue #3053
2018-11-29 11:46:01 +01:00
Christian Prochaska fd7ab79fe0 vfs: implement 'complete_sync()' in 'Single_file_system'
Fixes #3047
2018-11-27 11:38:13 +01:00
Martin Stein e0b7fb1929 nic_bridge: fixed MAC addresses
Enable configuration of a fixed MAC address for each client.

Fixes #3040
2018-11-27 11:36:35 +01:00
Stefan Kalkowski 36fe50ebad base: unify mp_server and affinity test
* remove outdated cpufreq test for Arndale
* execute new SMP test on hardware not in Qemu in nightly tests

Ref #3041
2018-11-27 11:36:35 +01:00
Norman Feske 19d7a488de init: health monitoring of child components
Fixes #3039
2018-11-27 11:36:34 +01:00
Christian Helmuth 70e7499e48 depot: update recipe hashes 2018-11-16 15:07:53 +01:00
Martin Stein 2d041ac0fc depot_autopilot: evaluate sets of test packages 2018-11-16 15:07:53 +01:00
Martin Stein 146f45f3d4 Archive recipes for autopilot tests 2018-11-16 15:07:53 +01:00
Martin Stein 6a540652fa pkg/test-fs_report: add autopilot events 2018-11-16 15:07:53 +01:00
Martin Stein 21efcf9e45 os/recipes: src/nic_bridge 2018-11-16 15:07:53 +01:00
Norman Feske c60604062c decorator: improve robustness of window restacking
This patch improves the detection of new appearing top-most windows.
Such a window should prompt the decorator to bring the corresponding
nitpicker view(s) to the front of the view stack. The original
implementation relied on hints provided by the layouter (the 'topped'
attribute). With the patch, the decorator tracks the top-most window by
itself, which improves the robustness.

As a second improvement, the patch defers the destruction of windows to
the point when all other window operations are completed. This hides
intermediate states when replacing one window by another in one step,
which is typical for console-like scenarios. Hence, this patch should
eliminate flickering artifacts when switching from one virtual console
to another.

Issue #3031
2018-11-16 14:53:26 +01:00
Martin Stein 5bb5a62d37 timeout_types.xsd: allow 0 seconds
The previous range was from 1..X because we only used it for durations. But
with the Depot Autopilot we want to use it also for a timestamp.
2018-11-16 14:37:47 +01:00
Martin Stein f64ec500bf run/rtc: assert spec x86 and !linux 2018-11-16 14:37:20 +01:00
Martin Stein 36932ee129 run/fs_packet: raise test timeout 2018-11-16 14:37:20 +01:00
Martin Stein 0c70a69618 run/dynamic_config_slave: fix cap quota 2018-11-16 14:37:20 +01:00
Martin Stein 0b3351991a run/dynamic_config_loader: fix cap quota 2018-11-16 14:37:20 +01:00
Martin Stein 99d9830968 run/dynamic_config: fix caps attribute 2018-11-16 14:37:20 +01:00
Martin Stein 719848d59a run/trace_logger: remove unnecessary stuff 2018-11-16 14:37:20 +01:00
Martin Stein fff80bfe6c run/terminal_crosslink: fix cap quota 2018-11-16 14:37:20 +01:00
Martin Stein 4e29c1ca40 test/xml_node: move to base 2018-11-16 14:37:19 +01:00
Martin Stein ed1cec2efa test/xml_generator: move to base 2018-11-16 14:37:19 +01:00
Martin Stein 510d7644fa test/weak_ptr: move to os/ as it uses a timer 2018-11-16 14:37:19 +01:00
Martin Stein 0b8ea50589 test/slab: move to os/ as it uses timer driver 2018-11-16 14:37:19 +01:00
Martin Stein ebfd49661e test/init: remove unused _expected_log_message 2018-11-16 14:37:19 +01:00
Stefan Kalkowski fe3f67f712 test: add simple cpu benchmark test (fix #3026) 2018-11-16 14:37:19 +01:00
Alexander Boettcher 17f7147ac1 base: avoid warnings about shift operations
clang:
 warning: The result of the '<<' expression is undefined
2018-11-16 14:37:18 +01:00
Alexander Boettcher 9ee3843f35 timer: fix conversion error in timeout handling
clang complains: comparison is always false due to limited range of data type

Issue #3022
2018-11-16 14:37:18 +01:00
Christian Helmuth 0867da28a2 depot: update recipe hashes 2018-10-29 09:36:23 +01:00
Alexander Boettcher 5446c52c43 base: make Entrypoint placeable on specific cpu
Fixes #3008
2018-10-29 09:36:22 +01:00
Martin Stein fe303f0e46 init/config.xsd: add <service> specification
Fixes #3007
2018-10-29 09:36:21 +01:00
Martin Stein ae55954919 nic_router_flood: reworked to stress/analyze more
Issue #2953
2018-10-29 09:36:21 +01:00
Martin Stein 7b47c8f0c6 net_flood: fix CRC error, make more precise
Issue #2953
2018-10-29 09:36:21 +01:00
Martin Stein 304cb290d9 nic_router: rework quota accounting
* Account all RAM/CAP quota of a session except quota for metadata used in
  core. The latter is considered when asking if a session can afford to make
  an operation but it does not get accounted to always be able to pay back all
  quota when a session closes. The general accounting mechanism is moved from
  atop of the allocators down to the level of RAM/RM session operations.
* report statistics about session objects and quota if <report stats="yes"
  quota="yes"/> is configured. (default is yes if <report> is present)

Issue #2953
2018-10-29 09:36:21 +01:00
Martin Stein bd77bb41df nic_router: improve handling of TCP termination
Like suggested by RFC 2663, reprogram the dissolve timeout of a TCP link
state to 2 times the maximum segment lifetime (by default 1 minute) when
receiving a matching packet with the FIN flag set, or with the ACK flag
set to acknowledge a FIN of the remote side.

Mark a link state as closed (no further reprogramming of the dissolve
timeout) and set the dissolve timeout to 2 times the maximum segment
lifetime when receiving a packet with the RESET flag set.

Issue #2953
2018-10-29 09:36:21 +01:00
Martin Stein 3db7181104 nic_router: limit packets handled per signal
Make it configurable how many packets get handled at a max per signal to
prevent DoS attacks by clients.

Issue #2953
2018-10-29 09:36:21 +01:00
Martin Stein b48c917984 nic_router: allow ld_verbose attribute
Issue #2953
2018-10-29 09:36:21 +01:00
Martin Stein d6c6549354 nic_router: destroy links on insufficient resource
If the NIC router has insufficient CAP or RAM quota for the creation of
a state object for an interface, it tries to destroy a certain amount of
existing state objects of this interface to free resources. Afterwards,
it retries handling the current packet once. If it does fail again, the
router drops the packet.

Issue #2953
2018-10-29 09:36:21 +01:00
Martin Stein 4442c79526 nic_router: "packet alloc" error only when verbose
Issue #2953
2018-10-29 09:36:21 +01:00
Martin Stein 364f69edad Xml_generator: fix and test missing '\0'
Ensure that a '\0' always appears at the end of the ouput of the XML
generator.  Previously, exceptions during the Node(...) constructor
might have prevented this. This commit also extends the xml_generator
test to drive a harder test on exceptions in the Xml_generator.

Issue #2953
2018-10-29 09:36:20 +01:00
Martin Stein 85d589a49c Xml_generator: fix exception handling in Node(...)
When the functor provided to the Node constructor throws an exception,
do revert all changes in reverse order. Previously, the changes made
to the parent node were not considered by the exception handler which
caused unnecessary characters to remain in the out buffer for each
reverted node.

Issue #2953
2018-10-29 09:36:20 +01:00
Christian Helmuth e88081a454 depot: update recipe hashes 2018-10-01 11:25:03 +02:00
Christian Helmuth 5dcf06d208 depot: update recipe hashes 2018-09-13 15:21:26 +02:00
Alexander Boettcher 6a496087ba nitpicker: report focus/hover when owner vanishes
Fixes #2974
2018-09-13 15:21:12 +02:00
Christian Prochaska 9a2af89c4e vfs: use correct enum values in 'Dir_file_system::open_composite_dirs()'
Fixes #2968
2018-09-13 15:21:11 +02:00
Ehmry - 64a63885d1 VFS: line buffer LOG file-system
Buffer data written to log file handles until newline or overflow.

Ref #2467
Ref #2919
2018-09-13 15:21:10 +02:00
Ehmry - 8a9b18e40e Fix for single file VFS servers
The VFS server does not support file-system with one single-file plugin
providing the root. This is because the "leaf_path" is not universally
implemented to handle the path "/". This fix is simply to skip a
"leaf_path" check when opening the path "/".

Ref #2919
2018-09-13 14:54:21 +02:00
Ehmry - fcbe060096 Remove legacy lwIP plugins
Now that the lwIP VFS plugin has become a first class IP stack it is
time to remove the lwIP 1.x library and the associated libc plugins.

Fix #2958
2018-09-05 11:04:22 +02:00
Josef Söntgen 0603481aaa terminal: remove upper character range check
The more constrained upper limit leads to ommitted characters like
umlauts.

Fixes #2957.
2018-09-03 17:07:00 +02:00
Christian Helmuth c2e0d0ae20 depot: update recipe hashes 2018-08-30 09:25:10 +02:00
Stefan Kalkowski b02f483841 dde_linux: usb host controller driver version 4.16 2018-08-30 09:24:45 +02:00
Christian Helmuth 40a84e0c81 input/ps2: poll for mouse-reset results
The PS/2 driver retries to get mouse-reset results for 700 ms, sleeping
after each attempt for 10 ms. So, the driver needs a Timer session now.

Fixes #2713
2018-08-28 17:10:55 +02:00
Ehmry - e0a97d5642 VFS: Send notifications on RAM file rename
Fix #2937
2018-08-28 17:10:54 +02:00
Christian Helmuth ccf6b237bb chargen: keypad asterisk (*) character 2018-08-28 17:10:54 +02:00
Norman Feske 89d0d648ed vfs: fix formatting in fs_file_system.h 2018-08-28 17:10:52 +02:00
Norman Feske 3c1ea3667d vfs server: avoid nesting of packet processing
This patch addresses a situation where _process_packets was called as a
side effect of watch notification (that was processed during an unlink
RPC operation). This scenario (triggered by the fs_query test)
ultimately ended up in a deadlock. Io/watch reponse handlers should
never re-enter the application logic.
2018-08-28 17:10:52 +02:00
Martin Stein 99b8e062d7 */config.xsd: fix session-policy declarations
Issue #2908
2018-08-28 16:48:47 +02:00
Martin Stein d2a36c5958 base: define generic config XSD types globally
The new base/xsd/config.inc defines generic XSD types such as 'Boolean' or
'Session_label'. It can be included in config XSD files by using:

! <xs:include schemaLocation="file://${GENODE_CONFIG_INC}"/>

The string ${GENODE_CONFIG_INC} is replaced by the run tool with the
above mentionened file path.

Issue #2897
2018-08-28 16:48:47 +02:00
Norman Feske ce414a5c5a fs_rom: revert workaround for possible livelock
The change "base: rm first-class support for static binaries" alleviates
the need for the workaround.
2018-08-28 16:48:46 +02:00
Christian Helmuth db376bfddb input/ps2: defer led update on pending events
Issue #2888
2018-08-28 16:48:45 +02:00
Christian Helmuth d909715f1b input/ps2: drop fake right-shift scancodes
Seen on X250

Description from https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html

  The ten grey keys Insert, Home, PgUp, Delete, End, PgDn, Up, Left,
  Down, Right are supposed to function regardless of the state of Shift
  and NumLock keys. But for an old AT keyboard the keypad keys would
  produce digits when Numlock was on or Shift was down. Therefore, in
  order to fool old programs, fake scancodes are sent: when LShift is
  down, and Insert is pressed, e0 aa e0 52 is sent; upon release of
  Insert e0 d2 e0 2a is sent. In other words, a fake LShift-up and fake
  LShift-down are inserted.

Fixes #2888
2018-08-28 16:48:45 +02:00
Ehmry - 39294b8e78 Serve empty dataspace for empty files at cached_fs_rom
Fix #2932
2018-08-28 16:45:25 +02:00
Ehmry - 1cbb299c38 Remove report instrument from cached_fs_rom
The cached_fs_rom report is for monitoring internal behavior and is of
no other use.

Ref #2932
2018-08-28 16:45:25 +02:00
Alexander Boettcher 8a5e762c24 nova: log_core.run adjustments 2018-08-28 16:45:24 +02:00
Ehmry - 007a977cb0 Fix CTRL keys for Workman layout
Fix #2931
2018-08-08 11:29:07 +02:00
Ehmry - 2041f957da Terminal: improved handling of escape sequences
Add additional parsing modes to the sequence decoder to detect and
discard unhandled sequences for ECMA-48, DEC private, and Xterm.

Add new behavior for cursor movement, cursor hiding, character deletion,
and line-wrapping.

Fix #2923
2018-08-08 11:27:41 +02:00
Christian Helmuth f4ea50c6ff depot: update recipe hashes 2018-08-08 10:59:04 +02:00
Ehmry - 08b774e318 VFS: add an error to to the Sync_result enum
Sync errors can be used to indicate failed writes across the File_system
session.

Ref #2920
2018-08-02 14:36:49 +02:00
Josef Söntgen 7002c9680a os: add fs_rom pkg recipe 2018-08-02 14:36:47 +02:00
Alexander Boettcher ed01c57677 platform_drv: add RMRR region before assign pci 2018-08-02 14:36:47 +02:00
Sebastian Sumpf 037a0d6822 usb_drv: add isochronous packet support
Commit extents USB session an driver accordingly.

issue #2910
2018-08-02 14:36:46 +02:00
Ehmry - d00baf8db4 Refactor cached_fs_rom
Refactor the cached_fs_rom server to fix issues with packet congestion,
prevent recursive XML handling, and zero-length file handling.

Ref #2760
2018-08-02 14:36:45 +02:00
Ehmry - 0502836975 Cached_fs_rom: remove all I/O signal blocking
Keep things simple, do not block for any signals.
2018-08-02 14:36:44 +02:00
Ehmry - 7e08bba25c Cached_fs_rom: fix congestion error
When the cached_fs_rom saturates the packet stream of its File_system
session it will call the session request handler recursively as pending
transfers are completed. This is bad because the content of the XML node
currently being processed will change.

The session request handler can no longer be called directly, but the
"schedule" method will submit a signal to the request handler, and
requests will be processed after the current operation has completed.
2018-08-02 14:36:44 +02:00
Christian Prochaska b2f7a6a934 vfs_lxip: look up path in 'leaf_path()'
Fixes #2913
2018-08-02 14:36:43 +02:00
Christian Prochaska e3005266b6 vfs: no 'handle_io_response()' in regular VFS functions
Calling 'handle_io_response()' in a regular VFS function (in contrast to a
post-signal hook) can cause problems if the caller of the VFS function holds
a lock which prevents the io response handler from returning.

With this commit, the user of the VFS becomes responsible for unblocking
threads which might be blocking after a failed 'queue_read()', 'queue_sync()'
or 'write()' call.

Fixes #2896
2018-08-02 14:36:43 +02:00
Ehmry - 59ac5b10c7 Plugin for importing VFS content
This new vfs_import plugin allows a VFS instance to be populated during
construction using a sub-VFS configured in an '<import>' configuration
node. This allows the ram_fs File_system server to be replaced by the
VFS server by reimplementing the ram_fs 'content' feature.  At the
moment the copying of symlinks is not enabled, and the resources
obtained by the import file-system may not be freed after the import is
finished.

Fix #2906
2018-08-02 14:36:42 +02:00
Sid Hussmann 726327d95c audio_mixer: create recipe to deploy from depot
Issue #2907
2018-08-02 14:36:39 +02:00
Ehmry - ca042e4e6e Fix VFS notifications for ram file removal
The ram plugin to the VFS must send notifications to watch handles on
files when they are removed. This brings the VFS server to parity with
the ram_fs server for the sake of notifications.

Move run/fs_report to gems and use the vfs server and the vfs init
plugin in the test.

Ref #2902
2018-08-02 14:36:39 +02:00
Norman Feske 4b46abf813 base: rm first-class support for static binaries
This patch removes the detection of statically linked executables from
the base framework. It thereby fixes the corner cases encountered with
Sculpt when obtaining the binaries of the runtime from the depot_rom
service that is hosted within the runtime.

Statically linked binaries and hybrid Linux/Genode (lx_hybrid) binaries
can still be started by relabeling the ROM-session route of "ld.lib.so"
to the binary name, pretending that the binary is the dynamic linker.
This can be achieved via init's label rewriting mechanism:

  <route>
    <service name="ROM" unscoped_label="ld.lib.so">
      <parent label="test-platform"/> </service>
  </route>

However, as this is quite cryptic and would need to be applied for all
lx_hybrid components, the patch adds a shortcut to init's configuration.
One can simply add the 'ld="no"' attribute to the <start> node of the
corresponding component:

  <start name="test-platform" ld="no"/>

Fixes #2866
2018-08-02 14:36:38 +02:00
Johannes Schlatow c43ed44b17 Add vfs file size detection to ROM modules
When mounting a ROM module with binary="no", the
vfs will detect the 0-termination to calculate the
file size instead of using the dataspace size.

Fixes #2903
2018-08-02 14:36:37 +02:00
Ehmry - b1b83f4d6d Process packets in batches at the VFS server
Process I/O packets in batches. If a batch is processed and there are
still packets pending, send a signal locally to the packet handler and
return to the entrypoint signal dispatcher. This prevents clients from
starving each other, which happens when a client continuously submits
packets at a faster rate than the server can process.

Fix #2900
2018-08-02 14:36:37 +02:00
Ehmry - f3abee631a File_system packet processing test
Test of File_system I/O scheduling. It appears that a client not
submitting I/O packets slower than the VFS server can process will
starve other clients.

Ref #2900
2018-08-02 14:36:36 +02:00
Ehmry - 09bf68e8ad Cached_fs_rom: serve static ROM sessions from a cache
This component is contrasted with the fs_rom server that serves
independent dataspaces to each client. Using a cache was not possible
until the region map session supported the creation of read-only
attachments.

Test at run/read_only_rom.

Ref #1633
Fix #2760
2018-08-02 14:36:35 +02:00
Martin Stein 495490743c nic_router: log ARP decisions when verbose
In verbose mode, some types of ARP packets were handled without any log about
what was done.

Issue #2899
2018-08-02 14:36:35 +02:00
Martin Stein 45347749fe nic_bridge: verbose mode
The verbosity mode of the NIC bridge can be toggled with the verbose attribute
(default value shown):

! <config verbose="no" />

If enabled, the NIC bridge logs sent and received packets as well as the
lifetime of interfaces connected to the bridge.

Issue #2899
2018-08-02 14:36:34 +02:00
Roman Iten 117b932176 init: add "report" element to the config schema
Issue #2897
2018-08-02 14:36:33 +02:00
Christian Helmuth b485caf33c depot: update recipe hashes 2018-07-03 09:40:11 +02:00
Norman Feske e20fe9d402 bomb.run: disable on Pistachio
The test triggers the following assertion in the kernel, which will
remain unfixed as the kernel is no longer developed:

  Assertion queue_state.is_set(queue_state_t::send) failed in file
  .../pistachio/kernel/src/api/v4/tcb.h, line 727

This assertion is presumably similar / related to issue #1495.
2018-07-03 09:39:36 +02:00
Ehmry - c18bee3d5b Input::Binding for non-C++ language bindings
Quietly insert forward declaration of a Input::Binding class, and make
it a friend of Input::Event and Input::Session_client. This is to allow
non-C++ language bindings (Nim) to access private members by providing
their own implementation of the Binding class.

Fix #2889
2018-07-03 09:39:35 +02:00
Norman Feske d068eaa9f7 input_filter.run: no char-repeat test using PIT
The legacy PIT timer driver is too jittery for the character-repeat
test. This patch disables the test for platforms using this device as
user-level time source, which are at the moment OKL4, Pistachio, and
seL4.
2018-07-03 09:39:35 +02:00
Ehmry - e8dc6c84a4 Add missing XML header to vfs/file_system.h
Ref #2870
2018-07-03 09:39:34 +02:00
Christian Prochaska 1d3ec6f0ae Test successive thread creation and destruction
Fixes #2887
2018-07-03 09:39:34 +02:00
Sid Hussmann 9039bd58bd input_filter: add chargen for de_ch keyboard layout
Resolves #2883
2018-07-03 09:39:33 +02:00
Christian Helmuth 8d1d57fbdf Tweak run scripts for sel4 (caps, timeout) 2018-07-03 09:39:32 +02:00
Sebastian Sumpf 10485b0d39 run: rename 'check_installed' to 'installed_command'
Also remove 'requires_installation_of', while also checking sbin
directories in 'have_installed'. The run scripts have been adjusted
accordingly.

Fixes #2853
2018-07-03 09:39:31 +02:00
Norman Feske 365d0bccd5 init.run: prioritize timer over test
The 200-second timeout of the init test triggers on some test platform
(in particular on qemu) while it is overly pessimistic on others.
This patch aims at stabilizing the timing behavior of the test across
the tested kernels/machines.
2018-07-03 09:39:31 +02:00
Norman Feske 3bbeacad20 init: preserve final state of exited children
This is a follow-up patch of "init: avoid too eager child restart". On
each config update of init, init re-applies child-specific configuration
changes. In the case of an already exited child, this re-evaluation
wrongly marked such a child as abandoned because the child's environment
sessions do no longer exist. Abandoning the child, in turn, triggers the
destruction and subseqent restart (because the <start> node of the
configuration still exists). The latter is bad for two reasons.

First, the exit state of the original instance becomes lost. Second, the
restart may have unexpected side effects due to sessions created by the
new instance. I.e., when resizing a partition in sculpt, init would
wrongly restart the gpt-write tool after the tool successfully exited.
This collides with a newly started instance of part_blk/resize2fs, which
now competes with the second gpt-write instance for the exclusive access
of the targeted block device.

The patch prevents init from re-applying configurations to exited
children. The accompanied test case covers the corner case.
2018-07-03 09:39:30 +02:00
Martin Stein 2af9cb7952 nic_router_flood.run: be more flexible
Do not simply wait for the good ping test to finish, but for the other
flood tests to trigger the RAM exhaustion. This makes the test more
robust with slower platforms or a different timing.

Issue #2857
2018-06-29 10:44:59 +02:00
Martin Stein 2733d3fea5 nic_router: verbose_packet_drop attribute
The log messages covered by verbose_packet_drop were previously
configured by the verbose attribute. This isn't the case anymore. Now,
you can configure them as follows:

! <config verbose_packet_drop="no" ... >
!     <domain verbose_packet_drop="no" ... />
! <config/>

The new attribute determines whether to log each packet drop and the
rational behind it. The <config> value affects all domains without a
<domain> local value.

Issue #2857
2018-06-29 10:44:59 +02:00
Martin Stein e139c52262 nic_router: fix verbose_packets attribute
The default value of each <domain> is the <config> value. However, if
a <domain> local value is set, the <config> value doesn't affect this
value at all.

Fixes #2874
2018-06-29 10:44:58 +02:00
Martin Stein 0b8520a208 nic_router: act as ICMP Echo server
The ICMP-Echo-server functionality of the router has the following
configuration attributes (default values shown):

! <config icmp_echo_server="yes">
!    <domain icmp_echo_server="yes" ... />
! </config>

The icmp_echo_server attribute configures whether the router answers ICMP Echo
requests that address the router. The <config> value affects all domains
without a <domain> local value.

Issue #2874
2018-06-29 10:44:58 +02:00
Martin Stein 055862c0eb nic_router: cancel remote ARP on new IP config
When a domain is updated to a new component config, the two criteria for
keeping an ARP waiting state of a remote domain are whether the remote
domain still exists and whether its IP config is still the same. This
means that a domain must also dissolve all of its remote ARP waiting
states if its IP config changes (without an update of the component
config). This wasn't the case until now.

Issue #2840
2018-06-29 10:44:58 +02:00
Martin Stein 9b619e95b2 nic_router: fix log when updating ARP waiters
Give the correct reason why an ARP waiter was dismissed.

Issue #2840
2018-06-29 10:44:58 +02:00
Norman Feske a9adc67421 os: improve robustness of init_loop test 2018-06-29 10:44:57 +02:00
Ehmry - 96112ec66d test/fs_report: delay Report/ROM file removal
Ref #2839
2018-06-29 10:44:56 +02:00
Christian Helmuth 3161daacd7 platform_drv: use Expanding_reporter for pci report
If the number of PCI buses grows (seen with VMware player) the default
report size is exhausted quickly.
2018-06-29 10:44:56 +02:00
Ehmry - 9d8bf1373e Chroot: remove merge policies
The chroot server was conceived to automatically place File_system
sessions into segregated root directories by converting session labels
to paths. If multiple children needed to be grouped under the same path,
a 'merge' policy would truncate the session label before path conversion.
Now that init can rewrite session labels and thus reproduce truncation,
the chroot merge feature is redundant and can be removed.

Fix #2846
2018-06-29 10:44:54 +02:00
Ehmry - 366913c146 ram_fs: unmark modification from nodes that have been synced
Removed the modified mark from handles that have been written to when
they are synced, otherwise a notification would be sent again when the
handle is closed.

Ref #2839
2018-06-29 10:44:54 +02:00
Martin Stein 90fcba79c6 nic_router: non-critical logs only when verbose
* Do not log events that are not critical (deadly) to the NIC router if not
  configured to be verbose,
* Print almost all log lines with a prefix of the domain name they are
  related to,
* And, do not use Genode::error and Genode::warning as they make it hard to
  read the log with the domain name prefixes.

Fixes #2840
2018-06-29 10:44:53 +02:00
Martin Stein 49a3a0e0d0 nic_router: multiple uplinks
Introduce the uplink tag:

! <config>
!    <uplink label="wifi"  domain="uplink">
!    <uplink label="wired" domain="wired_bridge">
!    <uplink               domain="wired_bridge">
! <config/>

For each uplink tag, the NIC router requests a NIC session with the
corresponding label or an empty label if there is no label attribute.
These NIC sessions get attached to the domain that is set in their
uplink tag as soon as the domain appears. This means their lifetime is
not bound to the domain. Uplink NIC sessions can be safely moved from
one domain to another without being closed by reconfiguring the
corresponding domain attribute.

Attention: This may render previously valid NIC router configurations
useless. A domain named "uplink" doesn't automatically request a NIC
session anymore. To fix these configurations, just add

! <uplink domain="uplink"/>

or

! <uplink label="[LABEL]" domain="uplink"/>

as direct subtag of the <config> tag.

Issue #2840
2018-06-29 10:44:53 +02:00
Martin Stein d4f08b5a71 nic_router: get rid of the term "legacy"
The term was used for the old configuration during the handling of a new
configuration but in other places it was already called old_config.

Issue #2840
2018-06-29 10:40:14 +02:00
Martin Stein ff7bc0ac6c nic_router: optimize handling of invalid domains
Dissolve and destroy the invalid domain first before deinitializing all
domains for the next round. This way, the deinitialization is not done twice
for the invalid domain.

Issue #2840
2018-06-29 10:40:14 +02:00
Martin Stein 27155a507f nic_router: fix DHCP-server deinitialization
Due to a bug in the deinitialization of the DHCP server of a domain (the
reference to the destroyed object was not cleared), the NIC router could
end up in a page fault caused by a double-free at the heap. This also fixes
the previously missing dissolving of the "DNS-server-from" relation to a
remote domain.

Issue #2840
2018-06-29 10:40:14 +02:00
Martin Stein 14357b0b44 nic_router_flood.run: test DoS against router
Currently has three clients that continuously create new UDP/TCP/ICMP
connections through the NIC router with NAT to the outer world and they
get never closed.  A fourth client does normal ping through the same
domain to the outer world that must succeed even after the RAM quota of
the other session at the router is exhausted. The test is restricted to
Qemu to not being at risk to flood real networks.

Issue #2857
2018-06-29 10:40:13 +02:00
Christian Helmuth 246bacd9da depot: update recipe hashes 2018-06-13 13:52:12 +02:00
Norman Feske 78d83ebda8 utf8.run: increase timeout, needed for sel4 2018-06-13 13:52:11 +02:00
Ehmry - 8f1eecdc29 fs_rom: read dataspace during session request
Fix #2863
2018-06-13 13:52:11 +02:00
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
Martin Stein 1330c27ac6 ping.run: mark as "not supported" on Linux & FOC
On Linux, we have a tap device as NIC back end but there is no one to
ping to in the subnet of the tap device. On FOC, the tests seem to trigger
a bug in the destruction of components with parent.exit(X); .

Fixes #2848
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
Alexander Boettcher 70028f8445 nova: export kernel messages via memory
Fixes #2207
2018-06-12 12:11:37 +02:00
Christian Helmuth bd86efe5fe depot: update recipe hashes 2018-05-31 14:02:21 +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
Ehmry - 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 87be50c542 os: add Expanding_reporter::generate(Xml_node)
This method allows for the verbatim reporting of an existing XML node.
2018-05-30 13:36:40 +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 6de79ad703 ping_nic_router.run: add nic_bridge behind router
This tests the case that behind a NIC router domain there are not only
directly connected clients of the subnet but also Layer 2 indirections like
a switch or a bridge which might be interesting for example for testing the
NIC routers DHCP server implementation.

Fixes #2837
2018-05-30 13:36:33 +02:00
Martin Stein 0996954abb ping tests: fix for linux and hw + arm
Some platforms need more caps in some components and more time to finish the
test.

Issue #2837
2018-05-30 13:36:33 +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
Martin Stein 342bdaf4a2 net: generic ascii_to for Netaddress template
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
Alexander Boettcher 0ef7e58ef9 platform_drv.inc: support acpi_drv and acpica
Issue #2816
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
Ehmry - 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
Christian Helmuth bba5a61ef9 Don't run ping test on unsupported platforms 2018-05-30 13:36:24 +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 c5f1ac615c Usb::Packet_handler: avoid completion handler recursion
Fixes #2828
2018-05-30 13:36:20 +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
Ehmry - 29c08d4751 Fix types for VFS error printing
Ref #2793
2018-05-30 13:36:14 +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 505d30cc42 Update ping tests
On real hardware, the tests expect an IPv4 subnet such that UDP requests
to 10.0.0.2 port 12345 get answered with an ICMP destination port unreachable.

Issue #2775

support USB NIC

Issue #2788

Set DHCP discover timeout to 1 second because, for some reason, the first
DHCP discover attempt of the NIC router on the PandaBoard times out with the
nightly test infrastructure.

Issue #2788

Adaption to mac-address allocation changes
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
Norman Feske cfe6e0f15b drivers_interactive-pc: increase caps for acpi
This is needed to use the pkg on a Thinkpad x250.
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
Ehmry - 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
Ehmry - e2661c58dc Convert static VFS library to dynamic library
Fix #2759
2018-05-30 12:26:19 +02:00
Christian Helmuth 3b7d6394d7 depot: update recipe hashes 2018-05-03 15:32:01 +02:00
Stefan Kalkowski 68015a6e9d base: remove cortex* compiler flags (fix #2787) 2018-05-03 15:32:01 +02:00
Ehmry - 483d005350 VFS: detect root dir based on config node type
Ref #2782
2018-05-03 15:32:00 +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
Norman Feske 8e0cc44e24 terminal: preserve content during resize
This patch eliminates the flickering of the terminal during resize.
2018-05-03 15:31:59 +02:00
Ehmry - 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 bb17e7cf01 nic_router-nat: ICMP NAPT and DNS info forward
Downlink uses DNS server info from Uplink and routes ICMP to Uplink while
applying NAT to it.

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
Christian Prochaska b8def5a3c2 depot: gpu_session recipe
Fixes #2770
2018-05-03 15:31:20 +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 1f1302e185 terminal: use VFS-based font handling
This patch replaces the terminal's formerly built-in fonts with the new
VFS-based font handling.

To avoid the copying of the terminal's font configuration across run
scripts, this patch adds the new terminal/pkg runtime package, which
includes everything needed for instantiating a terminal: the actual
terminal component, the library dependencies (vfs_ttf, which in turn
depends on the libc), a font (bitstream-vera), and a reasonable default
configuration.

Fixes #2758
2018-05-03 15:31:17 +02:00
Norman Feske 0011dd1623 terminal: remove built-in keyboard layout handling
Fixes #2757
2018-04-19 13:38:34 +02:00
Norman Feske 8bcf540915 os: add Text_painter::Font::height method
Issue #2716
2018-04-19 13:38:33 +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
Norman Feske 0a72b37363 vfs: Simple::env::apply_config 2018-04-19 13:38:33 +02:00
Christian Helmuth 47569458d4 depot: update recipe hashes 2018-04-19 12:39:20 +02:00
Josef Söntgen 505ff0bb11 ping: exit run script on not supported platforms
Fixes #2756.
2018-04-19 12:39:19 +02:00
Norman Feske cb78516bf1 os: add tests to autopilot
Since the autopilot has become able to use the depot, futher tests can
be enabled by default.
2018-04-19 12:38:53 +02:00
Ehmry - 3c07860aad VFS: watch result is ERR_UNACCESSIBLE by default
Ref #2745
2018-04-19 12:38:50 +02:00
Ehmry - 97f50e8e15 VFS: dir fs Opendir must open at least one directory to succeed
Ref #2745
2018-04-19 12:38:50 +02:00
Ehmry - 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
Christian Helmuth d54f95d497 depot: update recipe hashes 2018-04-10 13:03:26 +02:00
Norman Feske 10c9b8a221 sculpt: change DNS server to 1.1.1.1
The previously used nameserver 213.73.91.35 of the CCC seems to be no
longer available.
2018-04-10 13:03:26 +02:00
Martin Stein f9af0e6f0c net: packed attribute for Icmp_packet 2018-04-10 13:03:26 +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 ca1751528d net: utilities for DHCP parameter-request lists
Issue #2738
2018-04-10 11:20:49 +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 fcae056c84 depot: runtime pkg for rom_reporter 2018-04-10 11:20:47 +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 cf32243822 ping_nic_router.run: add icmp_idle_timeout_sec 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 d35d946adf ping_nic_router.run: ICMP through a nic_router
This tests ping with simple IP forwarding, ping with NAPT as well as
forwarding of ICMP "Destination Unreachable" messages through the NIC
router.

Issue #2732
2018-04-10 11:20:44 +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
Norman Feske 97317b0c95 terminal: change term caps from linux to screen
Fixes #2743
2018-04-10 11:20:43 +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
Ehmry - 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
Ehmry - 344d46ce78 Comparision operators for Genode::Path
Ref #1934
2018-04-10 11:11:51 +02:00
Ehmry - 8310a94843 os/path: const 'string' accessor
Ref #2160
2018-04-10 11:11:50 +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 07cd0d5809 vfs: add 'Readonly_value_file_system'
This file system is meant as a building block for pseudo file systems
that host a directory of several small files where each corresponds to
an attribute of the pseudo file system.
2018-04-10 11:09:18 +02:00
Norman Feske 48c5707a0c vfs: relax root_dir argument of 'Dir_file_system'
By letting the 'Dir_file_system' accept an arbitrary 'File_system'
as root directory, we can use the 'Dir_file_system' as a building
block for creating other file-system types.
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
Alexander Boettcher a347be2222 sel4: enable wandboard sd card bench test
Issue #2665
2018-04-10 11:09:16 +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
Martin Stein 930c29a50c nic_router: != operator for IP config
Ref #2670
2018-03-29 15:39:36 +02:00
Martin Stein ec240a64d9 nic_router: != operator for IP address prefix
Ref #2670
2018-03-29 15:39:36 +02:00
Martin Stein 709afcd945 nic_router: overwritable reference wrapper
While references are const and always valid, this wrapper is like a reference
that is only always valid and can be overwritten.

Ref #2670
2018-03-29 15:32:39 +02:00
Martin Stein 119b9f9c2c nic_router: alloc specific bits at bit allocator
Method to allocate specific bits at a Bit_allocator_dynamic

Ref #2670
2018-03-29 15:32:39 +02:00
Martin Stein 03062b83b6 nic_router: alloc specific port at port allocators
Methods to allocate a specific port at Port_allocator and
Port_allocator_guard.

Ref #2670
2018-03-29 15:30:20 +02:00
Martin Stein e0081cfc29 nic_router: safe pointer class for const objects
Const_pointer class that enables the use of the pointer wrapper for
const ojects.

Ref #2670
2018-03-29 15:30:03 +02:00
Martin Stein 5926261e08 nic_router: Avl_tree wrapper with destroy_each
AVL tree wrapper with method to destruct and deallocate each item of the
tree.

Ref #2670
2018-03-29 15:30:03 +02:00
Martin Stein 44dd55a268 nic_router: destroy_each for domain tree
List method to destruct and deallocate each item of a domain tree.

Ref #2670
2018-03-29 15:24:02 +02:00
Martin Stein d5f645ee69 nic_router: destroy_each for list wrapper
List method to destruct and deallocate each item of a list.

Ref #2670
2018-03-29 15:23:31 +02:00
Martin Stein 8fff7df438 nic_router: safe pointers that are valid and const
Add safe pointer constructor that takes a reference as argument to enable the
use of the safe pointer wrapper as const object.

Ref #2670
2018-03-29 15:22:52 +02:00
Martin Stein 2c2037952d nic_router: support interfaces without a domain
Clients can connect at any time to the NIC router. The interfaces (sessions)
get attached to the appropriate domain as soon as it appears. This implies
that interfaces can also be detached from a domain without beeing destructed
when the domain disappears. All user dependent states of an interface such as
the link states, DHCP allocations and ARP information get lost when the
interface gets detached.

Ref #2670
2018-03-29 15:22:34 +02:00
Martin Stein 63de13b50e nic_router: conform domain labeling in log
Adapt domain labeling of packet receive/send messages in log to other domain
specific log messages.

Ref #2670
2018-03-29 15:21:07 +02:00
Martin Stein 2a77976164 nic_router: add verbose_packets per domain
A domain logs its packets if one of the global 'verbose_packets' or its local
'verbose_packets' is switched on.

Ref #2670
2018-03-29 15:20:20 +02:00
Martin Stein bd16f89617 nic_router: add verbose_packets attribute
This separates the decision wether to log the received and sent packets
from the 'verbose' attribute. This information is now only logged if
'verbose_packets' is switched on. If 'verbose' is switched on, only
routing decisions and optional hints are printed.

Ref #2670
2018-03-29 15:20:15 +02:00
Christian Helmuth b07d6eced8 depot: update recipe hashes 2018-03-29 14:59:07 +02:00
Alexander Boettcher bc2a998261 demo: test demo scenario bootup by autopilot 2018-03-29 14:59:06 +02:00
Christian Helmuth 9242b4278c Remove ATAPI from ahci_drv config in test
ATAPI does not work reliably on QEMU and is not tested by the run script
anyway.
2018-03-29 14:59:05 +02:00
Reto Buerki 47724c68c2 platform_drv/x86: Switch to ECAM/MMCONF
Switch port I/O based PCI config space access to memory-mapped IO.  The
base address of the PCI configuration space is acquired by mapping the
ACPI ROM and reading the first <bdf> node. An exception is thrown if the
first <bdf> node is not for PCI domain zero or if multiple <bdf> nodes
exist. This is to reduce complexity and also because multiple PCI
domains are rare.

The PCI configuration space is accessed via I/O mem dataspace which is
created in the platform_drv root and then passed on to the PCI session,
device components and finally to the actual PCI config access instances.

The memory access code is implemented in a way to make it work with Muen
subject monitor (SM) device emulation and also general x86 targets. On
Muen, the simplified device emulation code (which works also for Linux)
always returns 0xffff in EAX to indicate a non-existing device.
Therefore, EAX is enforced in the assembly templates.

Fixes #2547
2018-03-29 14:59:04 +02:00