Commit Graph

575 Commits

Author SHA1 Message Date
Stefan Kalkowski
13fb51eecf hw: remove implicit SoC-specific include path
Fix #3336
2019-05-16 13:11:02 +02:00
Stefan Kalkowski
c767f6ccf1 os: explicit cache policy in Nic::Session_component
To enable the use of uncached DMA buffers as RX and TX communication
buffers in between driver (service) and client, introduce a cache
attribute in the constructor of Nic::Session_component

Ref #3291
2019-05-06 16:15:26 +02:00
Martin Stein
181c78d482 timeout: use uint64_t for all plain time values
This enforces the use of unsigned 64-bit values for time in the duration type,
the timeout framework, the timer session, the userland timer-drivers, and the
alarm framework on all platforms. The commit also adapts the code that uses
these tools accross all basic repositories (base, base-*, os. gems, libports,
ports, dde_*) to use unsigned 64-bit values for time as well as far as this
does not imply profound modifications.

Fixes #3208
2019-05-06 16:15:26 +02:00
Norman Feske
e5f27b44b5 block_session: turn 'Connection' into template
As a preparatory step for introducing the new block-client API, we have
to turn the 'Block::Connection' into a class template. The template
argument will be used to tie an application-defined job type to the
block connection.

Issue #3283
2019-05-06 16:15:25 +02:00
Stefan Kalkowski
7a45867841 vmm_arm: support for i.MX7 Dual SABRE board
Fix #3285
2019-05-06 16:15:25 +02:00
Norman Feske
593e971121 block_session: SYNC and TRIM as async operations
This patch removes the blocking Block::Session::sync RPC function and
adds the asynchronous operations SYNC and TRIM to the block session's
packet-stream interface.

Even though the patch adjusts all block components to the interface
change, the components keep the former blocking handling of sync
internally for now because of the design of the 'Block::Driver'
interface. This old interface is not worth changing. We should instead
migrate the block servers step by step to the new
'Block::Request_stream' API.

Fixes #3274
2019-05-06 16:15:24 +02:00
Stefan Kalkowski
0a470e66f2 vmm_arm: uart device model needs to take all chars
When receiving a terminal signal, the uart device model has to
take all characters out of the stream. Otherwise, characters
might never arrive at the VM. This was not recognized before,
because it was used with a quite slow UART only, which obviously
never achieved to send more characters at once.

Ref #3278
2019-05-06 16:15:24 +02:00
Norman Feske
bbe3ee8dc5 block_session: server-defined payload alignment
This patch replaces the formerly fixed 2 KiB data alignment within the
packet-stream buffer by a server-defined alignment. This has two
benefits.

First, when using block servers that provide small block sizes like 512
bytes, we avoid fragmenting the packet-stream buffer, which occurs when
aligning 512-byte requests at 2 KiB boundaries. This reduces meta data
costs for the packet-stream allocator and also allows fitting more
requests into the buffer.

Second, block drivers with alignment constraints dictated by the
hardware can now pass those constraints to the client, thereby easing
the use of zero-copy DMA directly into the packet stream.

The alignment is determined by the Block::Session_client at construction
time and applied by the Block::Session_client::alloc_packet method.
Block-session clients should always use this method, not the 'alloc_packet'
method of the packet stream (tx source) directly. The latter merely
applies a default alignment of 2 KiB.

At the server side, the alignment is automatically checked by
block/component.h (old API) and block/request_stream.h (new API).

Issue #3274
2019-05-03 13:53:12 +02:00
Norman Feske
2208220c12 block session: remove Block::Session::Operations
This patch modernizes the 'Block::Session::info' interface. Instead of
using out parameters, the 'init' RPC function returns a compound 'Info'
object now. The rather complicated 'Operations' struct is replaced by
a 'writeable' attribute in the 'Info' object.

Fixes #3275
2019-05-03 13:53:12 +02:00
a635873568 VFS: Replace global response handlers with local handlers
Replace the I/O response handler that is passed to the VFS at
construction with an object that is dynamically attached to handles.
This object shall also accept read-ready notifications, and plugins are
encouraged to keep handles awaiting ready-ready notifications separate
from handles that await I/O progress.

Replace the use of handle lists in plugins with handle queues, this
makes the code easier to understand and the ordering of notifications to
the application more explicit.

These changes replace the use of the Post_signal_hook from all VFS
plugins, applications must assume that read-ready and I/O notifications
occur during I/O signal dispatch and use an Io_progress_handler at its
entrypoints to defer response until after signal dispatching.

Fix #3257
2019-04-09 12:30:34 +02:00
Alexander Boettcher
ca32c11f4f nitpicker: send mode change on domain update
Fixes #3259
2019-04-01 19:33:52 +02:00
Stefan Kalkowski
8f28f884ee hw: name vm_state header explicitely
Ref #3251
2019-04-01 19:33:49 +02:00
Martin Stein
bcc049ceeb nic_router: manipulate port-forwarding port
The new configuration attributes <tcp-forward to_port="123" /> and
<udp-forward to_port="123" /> enable manipulating the destination port of
port-forwarded packets.

Fixes #3237
2019-04-01 19:33:48 +02:00
Martin Stein
3a59f11708 nic_router/nic_bridge: free MAC addresses
Free a MAC address of a session as soon as the session gets destructed.
Adds also according tests to the autopilot list.

Fixes #2470
2019-04-01 19:33:48 +02:00
800b4e44b1 Reduce Vfs::Vfs_handle::Context to empty struct type
The "Vfs::Vfs_handle" type should not contain any public members that
can be initialized by the VFS internally and by the application, so
remove inheritance from the "Genode::list::Element" class. The VFS
plugins must instead use lists of "Vfs::Vfs_handle" sub-classes, the
lifetime of which are always managed by the plugin.

Ref #3036
2019-04-01 19:33:47 +02:00
Norman Feske
4f99224255 ram_fs: increase max file size on 64 bit to 8 GiB
Fixes #2315
2019-03-18 15:57:00 +01:00
Norman Feske
91197804ac nitpicker: fix destroy with invalid handle
This patch reworks the 'Session_component::destroy' to cope become
robust against a client-provided invalid view handle. The code did not
consider that 'Handle_registry::has_handle' may throw.

Thanks to Alexander Boettcher for reporting and the initial fix.

Fixes #3232
2019-03-18 15:56:59 +01:00
Josef Söntgen
8ccfe4361c part_block: properly indent code
Issue #3223.
2019-03-18 15:56:58 +01:00
Josef Söntgen
cb2ebd0bf7 part_block: fix handling of chained EBR's
Fixes #3223.
2019-03-18 15:56:58 +01:00
57fd4e9148 Add Io_progress_handler to Entrypoint interface
The "schedule_post_signal_hook" method of the Genode::Entrypoint class
is problematic because the signal hook can be scheduled and replaced
multiple times during the signal dispatch cycle. Add an alternative to
this method with "register_io_progress_handler" and the "Post_signal_
hook" class with "Io_progress_handler". The difference being an
"Io_progress_handler" may be registered once during the lifetime of an
entrypoint to prevent arbitrary libraries from replacing a pending hook.

The "register_io_progress_handler" remains as a deprecated API, and is
now invoked for every I/O signal received and only for I/O signals
rather than for any signal.

Ref #3132
2019-03-18 15:56:22 +01:00
Norman Feske
c51508a47c lx_fs: return host inode value for dir entries
With this patch, bash running in noux becomes able to list the content
of directories (via 'echo *') hosted in lx_fs.
2019-02-28 11:34:06 +01:00
Johannes Schlatow
d9043057a2 lx_fs: implement move()
Fixes #3176
2019-02-26 14:47:02 +01:00
Johannes Schlatow
65a662f5b3 lx_fs: close file on destruction
Fixes #3177
2019-02-26 14:47:02 +01:00
ffeb8e2af0 Chargen description of French keyboard
Add an input_filter character description file for the French AZERTY
keyboard layout and include it with Sculpt.

Fix #3149
2019-02-26 14:42:55 +01:00
Norman Feske
3d6f4979c3 tz_vmm: remove use of deprecated APIs
Issue #1987
2019-02-19 11:12:12 +01:00
Norman Feske
b3727a9b46 Add missing override annotations
Issue #3159
2019-02-19 11:12:11 +01:00
Martin Stein
10b6b88b01 nic_bridge: simplified session request handling
1) A session request gets denied if there is no matching session policy.
   (The <defaul-policy/> tag can be used for the former default behavior)
2) A session request gets denied if the MAC address is given through the
   matching policy but this address cannot be allocated.
3) A session request gets denied if the MAC address is not given through the
   matching policy and it is also not possible to allocate one.

Issue #3040
2019-02-19 11:12:11 +01:00
Alexander Boettcher
0c24e1efdc vm_session: extensions
- support to create multiple vCPUs
- support to implement Vm_session methods client side within base library
- adjust muen specific virtualbox4 version to compile/link

Issue #3111
2019-02-19 11:08:17 +01:00
253d6b0b92 Runtime package of clipboard service
Fix #3150
2019-02-19 10:50:51 +01:00
4f88b664e2 Improve VFS server session quota management
Move the allocation of the session packet buffer into a subclass that is
constructed before the File_system RPC object. This allows the buffer
allocation to be wrapped in a constructor/destructor class and clearly
accounted for.

Fix #3134
2019-01-30 13:54:54 +01:00
Norman Feske
6b94e65a95 os: avoid using deprecated APIs
Issue #1987
Issue #3125
2019-01-30 13:49:54 +01:00
Norman Feske
81fb10daaa Consistently name block components
This patch replaces abbreviations like "blk", "cli", and "srv" by their
full forms "block", "client", and "server".

Fixes #1258
2019-01-14 12:34:39 +01:00
Norman Feske
bf62d6b896 Move timer from os to base repository
Since the timer and timeout handling is part of the base library (the
dynamic linker), it belongs to the base repository.

Besides moving the timer and its related infrastructure (alarm, timeout
libs, tests) to the base repository, this patch also moves the timer
from the 'drivers' subdirectory directly to 'src' and disamibuates the
timer's build locations for the various kernels. Otherwise the different
timer implementations could interfere with each other when using one
build directory with multiple kernels.

Note that this patch changes the include paths for the former os/timer,
os/alarm.h, os/duration.h, and os/timed_semaphore.h to base/.

Issue #3101
2019-01-14 12:33:57 +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
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
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
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
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
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
Alexander Boettcher
6a496087ba nitpicker: report focus/hover when owner vanishes
Fixes #2974
2018-09-13 15:21:12 +02:00
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
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
Christian Helmuth
ccf6b237bb chargen: keypad asterisk (*) character 2018-08-28 17:10:54 +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