Commit Graph

10316 Commits

Author SHA1 Message Date
Martin Stein
1111472af7 nic_router: make Ipv4_config a class
The fact that the IPv4 config was a struct with all data members public was a
mere leftover of an early state of the NIC router. Today, the router
implementation style is to avoid structs and public data members wherever
possible.

This commit slightly changes the behavior of the router regarding log output.
The router used to print malformed IPv4 configurations to the log only if
the 'verbose' config flag was set using this style:

! [my_domain] malformed dynamic IP config: interface 10.0.2.1/24 ...

Now, malformed IPv4 configurations are only printed if the
'verbose_domain_state' config flag is set (like with any IP4v configuration
states) using this style:

! [my_domain] dynamic IP config: malformed (interface 10.0.2.1/24 ...)

Fixes #4242
2021-08-18 15:06:12 +02:00
Martin Stein
9e6f7988c2 nic_router: list dns servers in one dhcp option 6
The NIC router DHCP server used to add an extra option 6 field to DHCP replies
for each DNS server address. This conflicts with RFC #2132 section 3.8 which
states that the addresses should be listed within one option 6 field without
delimiter. The discrepancy is fixed by this commit.

Ref #4242
2021-08-18 15:06:12 +02:00
Johannes Schlatow
80c1459e79 fs_query: catch File::Truncated_during_read
Fixes genodelabs/genode#4241
2021-08-18 15:06:12 +02:00
Johannes Schlatow
0840cfe834 vfs_trace: report correct size for value files
File size must be the same as the number of bytes that can be read from
the file. Otherwise, this will trigger a `Truncated_during_read`
exception.

Fixes genodelabs/genode#4240
2021-08-18 15:06:12 +02:00
Martin Stein
e648e7255a nic_router: optional icmp type 3 on fragm. ipv4
Via a new configuration attribute, the user can decide whether the router
should answer dropped fragmented IPv4 with an ICMP "destination unreachable"
packet and, if so, which value the ICMP code field of this packet should have.
The default is that the router doesn't send such responses (silently dropping
fragmented IPv4). The behavior is tested by the 'nic_router_ipv4_fragm' test.

Fixes #4236
2021-08-18 15:06:12 +02:00
Martin Stein
06a4608f4a nic_router: report dropped fragmented IPv4
If the new attribute 'dropped_fragm_ipv4' of the <report> tag in the NIC router
config is set "yes", the router will report the number of packets that were
dropped per interface respectively domain because fragmented IPv4 is not
supported. The default is not to report the counter. The behavior is tested by
the 'nic_router_ipv4_fragm' test.

Ref #4236
2021-08-18 15:06:12 +02:00
Martin Stein
619474bc90 nic_router: drop fragmented IPv4
The NIC router used to ignore the IPv4 header fields "More fragments" and
"Fragment offset" completely. Therefore higher-level protocols of fragmented
IPv4 were interpreted wrong because each fragment was considered a self-
standing packet, expecting, for instance UDP/TCP headers somewhere inside of
the UDP/TCP data field. Normally, such packets were dropped as soon as the
UDP/TCP checksum check failed because of the misinterpretation. However,
it was also possible for fragmented IPv4 to pass the router although normally
only partially.

IPv4 fragmentation support in the router would introduce some potential
security risks and is presumably not an easy endeavor. So, for now, we settled
on not supporting IPv4 fragmentation. With this commit, the router simply drops
all fragmented IPv4. This is reflected to the log for each fragment as "drop
packet (fragmented IPv4 not supported)" when 'verbose_packet_drop="yes"' is
configured.

The new test 'run/nic_router_ipv4_fragm' is an automated test for this
behavior. The test is added to the autopilot list.

Ref #4236
2021-08-18 15:06:12 +02:00
Martin Stein
b0e558f486 net/icmp: cast from integer to 'Code' enum
Add a function to the header for doing this cast.

Ref #4236
2021-08-18 15:06:12 +02:00
Christian Prochaska
d7a27c448d qt5: implement 'CancelableSyncSocket::Shutdown()'
Fixes #4239
2021-08-18 15:06:12 +02:00
Martin Stein
626b2f9cf2 run/libc_vfs_fs_fat: add to autopilot
Excludes board 'virt_qemu' from the test as we don't have block device drivers
for this board.

Ref #4220
2021-08-18 15:06:12 +02:00
Martin Stein
2533d7b4b6 vfs/fatfs: cleanup implementation
- remove redundant file system factory

- remove dead code block

  The code was guarded by preprocessor directives checking whether the
  contrib code define "_USE_MKFS" is 1. As "_USE_MKFS" is not set one
  for our port of FAT, the code was never executed and can be removed.

- remove uneffective config attributes

  Apparently, the former XML attributes to the plugin 'drive' and
  'codepage' had no effect. I tested them in a scenario with the VFS
  block server on a disk-image boot-module as back end. Regardless of
  the 'drive' value, the block session label was always "0". Regardless
  of the 'codepage' value, the FAT on the disk image succeeded to mount
  when not using '--codepage' for 'mkfs.fat' and failed to mount when
  using '--codepage' to specify a supported but foreign codepage for
  'mkfs.fat' (e.g. "720").

Ref #4220
2021-08-18 15:06:12 +02:00
Martin Stein
60c8369718 lib/fatfs: get rid of global static constructors
There was one global static constructor:

! namespace Fatfs { static Constructible<Platform> _platform; }

This caused applications that used the lib or the <fatfs> VFS plugin to end up
in an uncaught exception due to Genode::Component complaining that method
'construct' returned without executing pending static constructors if they
didn't call Genode::Env::exec_static_constructors().

As the use of Genode::Env::exec_static_constructors() is discouraged in Genode,
this commit rather moves the '_platform' object to the scope of the
initializing function and introduces a global static pointer to the object that
gets set by the initializing function. Although this prevents the exception, it
is, technically speaking even worse than the former solution as the new pointer
isn't checked for validity in contrast to the 'Constructible' object.

However, so far, I don't see a clean solution to this problem without the need
for Genode::Env::exec_static_constructors().

Fixes #4220
2021-08-18 15:06:12 +02:00
Christian Helmuth
b59e2ba677 microcode_intel: archive moved to GitHub finally
As version 20180807a is not provided on GitHub, I updated the port to
the most recent release 20210608.

Issue #2762
2021-08-18 15:06:12 +02:00
Sebastian Sumpf
c3e8c22a6d sculpt: integrate intel_gpu_drv
* the GPU multiplexer now offers the platform service to the Intel
  framebuffer driver (driver_manager)
* ajdusted drivers_managed-pc to hand out resources to the GPU driver
* adjust quotas

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
2fe70f111b intel_fb_drv: Aperture exhaustion and display IRQ patch
* display an error in case the aperture is too small for all
  framebuffers
* handle display engine IRQs only

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
1727de30b7 gpu/intel: free DMA, clear ggtt
* free DMA caps in case platform client's session is closed
* clear GGTT of platform client upon session close

issue #4233
2021-08-18 15:06:11 +02:00
Sebastian Sumpf
6c003a13d2 gpu/intel: add platform service for display handling
The platform services is intented to be used by dde_linux's intel_fb_drv
in order to initlialize displays.

* implement and announce platform session
* limit accessible GTT and aperture of client to 64 MB
* forward display engine IRQs to platform client
* move all PCI resources to 'Igd::Resources' class in order to make them
  accessible by the platform service and the GPU driver
* fix fence register allocation for id zero (return true)

issue #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
11192b18e6 gpu/intel: dump status context register bits
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
fe867765a8 gpu/intel: support multiple exec buffer per client
required for mesa-21

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
ffc89f3edf gpu/intel: let guard page handling up to client
For mesa-21 the client takes care and manages
the virtual address space of the vGPU by itself and the intel/gpu driver
can't add silently a guard page anymore. Move the patch to the drm/ioctl
of the former mesa version.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
067b7d7c67 gpu/intel: deny virtual address above 1 << 48
commit avoids memory corruption in the ppgtt page insertion code

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Josef Söntgen
4b653fbac1 gpu/intel: handle double insertion in PPGTT
As the PPGTT is populated by the client, the client has to account for
guard pages and so forth.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Josef Söntgen
7dc997c8e6 gpu/intel: handle CSB correctly
As it turns out reading both dwords as qword results in mirrored
values, DDTT.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
5d6ea5ef22 gpu/intel: allocate vcpu/engine as part of session
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
a721933771 gpu/intel: move context/ring handling into objects
Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
c949e5c90d gpu/intel: remove allocator_guard
Issue #3759 #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
243a9ec3ca gpu/intel: free up context/memory ring
_unmap_dataspace_ggtt requires the cap of Ggtt::Mapping (ring_map, ctx_map)
in order to find the right metadata and to free up the ggtt entries. Also the
pte range is removed already if the metadata was found.

Issue #4148 #4233
2021-08-18 15:06:11 +02:00
Alexander Boettcher
b3147050cc gpu/intel: add support to report finished batches
- extend gpu multiplexer to report last completed execution buffer
- on client side lookup finished buffers and disable busy state

issue #4233
2021-08-18 15:06:11 +02:00
Martin Stein
f8953de7ac nic_router: replace term "uplink" with "NIC client"
BREAKS CONFIG COMPATIBILITY:
This commit changes the configuration interface of the NIC router in a way that
may break systems that use the component without proper adjustment!

HOW TO ADJUST:
At each occurrence of the '<uplink ...>' tag in a NIC router configuration
replace the tag name 'uplink' with 'nic-client'. The rest of the tag stays the
same.

The term "uplink" for network interfaces in the router that have a NIC session
client as back end was introduced in a time when Uplink sessions didn't yet
exist. Now, they do and, although both an uplink and an Uplink session
normally describe a network session between router and network device driver,
they are based on two different service types (NIC and Uplink). This can easily
cause confusion when integrating the router (the <uplink> is not related to
Uplink sessions) or trying to understand its functioning (an 'Uplink' object
has nothing to do with the Uplink service).

Therefore, this commit introduces the more specific term "NIC client" for an
interface that is based on a NIC session requested by the router. This doesn't
imply any semantic changes at the NIC router. However, the commit also brings a
broader update of the router's README and removes the term "downlink" that was
used only in documentation to refer to interfaces backed by a NIC session
provided by the router. The term was only associated with this meaning because
it is the natural counterpart to an uplink. This isn't appropriate anymore as
the terms for interface types have moved to a more technical level.

The commit adjusts all scenarios in the basic Genode repositories properly.

Fixes #4238
2021-08-18 15:06:11 +02:00
Christian Helmuth
fce525f122 depot: update recipe hashes 2021-07-28 11:27:05 +02:00
Martin Stein
2afae7e7c1 nic_router: uncaught exc. on handling link state
An interface that received a signal for a link-state change accessed its
domain reference without assuming that it could not be attached to a domain
at that moment. This caused the NIC router to crash with an uncaught exception
of type 'Net::Pointer<Net::Domain>::Invalid'. The commit adds a catch
directive for this exception resulting in the handler doing nothing if not
attached to any domain.

Fixes #4222
2021-07-28 11:27:05 +02:00
Martin Stein
d06773b957 run/tz_vmm: remove usb_armory support
The test script failed during preparation of the on-target execution for
USB Armory with the following error:

! can't read "tz_vmm_block_irq": no such variable

Presumably, the script wasn't run anymore since the introduction of the
'tz_vmm_block_irq' variable for i.MX53 QSB. As we do not have infrastructure
for automated testing of the USB Armory and there seems to be not much
interest in using Genode on this platform, this commit simply removes the
support from the script.
2021-07-28 11:27:05 +02:00
Martin Stein
c8a8cbd7be run/tz_vmm: fix deprecated use of board specs
Filtering boards in a run script by specs isn't the right way anymore (the
specs do not exist anymore). Nowadays, we have to use [have_board] instead.

Ref #4229
2021-07-28 11:27:05 +02:00
Martin Stein
00e8e363d8 run/tz_vmm: fix broken network test
For unknown reasons, the former 'wget genode.org' call, that was meant to test
network in the Trustzone guest on imx53_qsb_tz, didn't succeed anymore although
the same call succeeded on my Sculpt VM Linux. However, 'ping 1.1.1.1' still
works, so, the script now uses this as test for networking instead.

Fixes #4229
2021-07-28 11:27:05 +02:00
Martin Stein
8bc861ca71 nic_router: do not re-use ARP request as reply
So far, in order to create an ARP reply, the NIC router merely created a copy
of the corresponding ARP request and modified only those values that differ.
This approach has the disadvantage of re-using bad parameters from a broken
request. The specific use-case that made this visible was an early version of
the Pine board network driver that used to forward ARP requests with a greater
size than required. The ARP replies of the router re-used this size and
confused other network nodes with that. In general, the NIC router should
rely on the data of incoming packets the least possible. Therefore, with this
commit, the router creates a new ARP reply from scratch and uses only those
values required from the corresponding ARP request.

Fixes #4235
2021-07-28 11:27:04 +02:00
Martin Stein
9384e075cb ipv4: get rid of C++ bitsets, add DF/MF flags
The former declaration of the IPv4 packet did not only use the questionable
tool of implementation-defined C++ bitsets but also lacked access to flags
"don't fragment" (DF) and "more fragments" (MF). This commit replaces the
C++ bitsets by using the register framework and introduces accessors for the
missing flags.

Ref #4236
2021-07-28 11:27:04 +02:00
rolandbaer
52011ec034 smbios_decoder: fix timer error message
added timer to run file to fix error message.

Fixes #4237
2021-07-28 11:27:04 +02:00
Alexander Boettcher
908d581a8c qemu-usb/webcam: reset delay packet state
on feature reset initiated by guest

Issue #4078
2021-07-28 11:27:04 +02:00
Johannes Schlatow
b38ec9f238 usb_webcam: correctly enable auto exposure mode
genodelabs/genode#4231
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
9334ec09e2 sculpt: route non-usb block sessions to 'drivers' 2021-07-28 11:27:04 +02:00
Johannes Schlatow
1bfc828826 libuvc: add UVC 1.50 support
genodelabs/genode#4231
2021-07-28 11:27:04 +02:00
Johannes Schlatow
b51b9e1ef3 libusb: fix size of control messages
Fixes genodelabs/genode#4230
2021-07-28 11:27:04 +02:00
Norman Feske
3d36291d7f run/load/fastboot: support 64-bit ARM
This patch lifts the limitation for 32-bit ARM platforms and makes the
parameter --load-fastboot-device optional. If only one device is
present, it can be omitted.

Fixes #4232
2021-07-28 11:27:04 +02:00
Johannes Schlatow
2afb7c5567 nic_router: fix Tcp_packet header fields
data_offset and NS flag were incorrectly read due to missing endianess
conversion. Also fix name of CWR flag.

Fixes genodelabs/genode#4227

genodelabs/genode#4227
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
ee045a68cc os: introduce C-API to Genode services
This commit introduces a C-API to the Uplink session, as well as to
serve as a Block service. It can be used by drivers ported from
C-only projects, like the Linux kernel, or BSD kernels for instance.

Fix #4226
2021-07-28 11:27:04 +02:00
Stefan Kalkowski
1a526e73a3 dde_linux: introduce new lx_emul/lx_kit library
The re-newed approach currently supports ARM 64-bit only.
It depends on the Platform API of the ARM architecture.
It tries to meet the original semantic of the Linux kernel
functions as far as possible. To achieve this, device drivers
using this library should reference the original Linux kernel
headers at foremost. Only the headers in `src/include/lx_emul/shadow`
have to shadow clone the original ones.

Fix #4225
2021-07-28 11:27:04 +02:00
Johannes Schlatow
1aba330ae6 dde_linux: fix packet size calc. of Nic drivers
skb_push() already increases the skb->len by ETH_HLEN, hence adding
ETH_HLEN to the packet_size is redundant.

A too large packet size becomes a problem for large MTUs. With a maximum
MTU of 1500, adding ETH_HLEN twice will lead to a packet size of 1528.
Since this is larger than what we expect for good-old Ethernet (max. 1522),
some clients (e.g. the e1000 model in vbox5) may drop these packets.

Fixes genodelabs/genode#4228
2021-07-28 11:27:04 +02:00
Christian Helmuth
119d72ad94 fetchurl: User-Agent header and HTTP response code
I discovered thinkbroadband.com requires the User-Agent header field and
rejects requests missing it with HTTP response code 403 "access to the
requested resource is forbidden". Now, fetchurl always adds the
User-Agent header fetchurl/LIBCURL_VERSION.

Also the error message now contains the HTTP response code.
2021-07-28 11:25:21 +02:00
Stefan Kalkowski
b16bb82f8b dde_linux: mark lx_emul and lx_kit as legacy
* Move headers in src/include into legacy sub-directory
* Move src/lx_kit to src/lib/legacy/

Fix #4223
2021-07-28 11:25:21 +02:00
Stefan Kalkowski
f939b9ffb5 base-hw: print addr as hex value in cache warning
Ref #4207
2021-07-28 11:25:21 +02:00