Commit Graph

7427 Commits

Author SHA1 Message Date
Sebastian Sumpf
38d731bd79 libports: Add Mesa-21.0.0 support
* Switch mesa support from DRI to gallium
  Supported drivers are
    - softpipe (Sebstian Sumpf)
    - iris for Intel GPUs (Alexander Boetcher)
    - etnaviv for Vivante GPUs (Josef Söntgen)

* Mesa's generated files are placed into 'contrib/mesa-<hash>/generated'
  and are cloned per default from a separate Git repo in order to avoid
  hash updates upon package build. In case you need to generate files
  yourself use
  ! prepare_port mesa GENERATE_FILES=1

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
9041567f14 libports: Remove Mesa-11.2.2
issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
b6ec4bdf05 libc/stdcxx ABI: symbols for Mesa-21.0.0
issue #4254
2021-08-30 15:00:38 +02:00
Josef Söntgen
dd90424129 libports: libdrm-2.4.105 update
Support for iris and etnvaviv

* entaviv:
  - libdrm on FreeBSD is not prepared for !PCI (and libc our is missing
    <sys/pciio.h>
  - missing <sys/types.h> include in xf86drmMode.c
  - etnaviv relies on linux header files - dummy in $(INC_DIR)
  - IOCTL FreeBSD ↔ Linux have swapped IO/OUT bit
  - O_CLOEXEC differs between FreeBSD ↔ Linux

issue #4254
2021-08-30 15:00:38 +02:00
Sebastian Sumpf
c26c50e59b libports: remove libdrm 2.4.21
issue #4254
2021-08-30 15:00:38 +02:00
Josef Söntgen
ac9e0947fd libc: add HM_REALMEM sysctl
Used by Mesa in the Gallium etnaviv driver.

issue #4254
2021-08-30 15:00:37 +02:00
Josef Söntgen
fb4d357b59 libc: pull in sys/pciio.h
This header is needed by recent versions of libdrm that feature
FreeBSD support.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
7a4626861e gpu/intel: add w/a for gen9 kabylake a0-b0 stepping
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
bac7381be3 gpu/intel: adjust submit batch to linux 5.13 handling
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
6b1f1794c4 gpu/intel: add gen9 forcewake support
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
eab92f8d6f gpu/intel: add clock gating for kabylake
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
ee283c0d12 gpu/intel: dump more in error case
- show hardware read tail & head pointer of ring buffer

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
c5d8a43418 gpu/intel: sanity check tail pointer alignment
According to spec the tail pointer points to the next qword instructions
which will be used by the software.

p 1354, Doc Ref # IHD-OS-BDW-Vol 2c-11.15

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
cc2363d421 gpu/intel: report slice, subslice, eu via gpu info
used by libdrm & mesa-21 clients

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
b287c4888a gpu/intel: update context inhibit setup
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
66ac2dc635 gpu/intel: avoid one-by-off in ring buffer
during wrap.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
6c7bcdd32e gpu/intel: add gen9 w/a for submit batch
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
b2440a72c3 gpu/intel: add more debug registers
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
8a285a7bee gpu/intel: add more debug registers
issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
c9809fde67 gpu/intel: remove unused superpage scratch code
Superpages (2M, 1G) are not supported by now, but partially copied over code
from base-hw was around. Remove unused register definitions and remove
non-working super page code do avoid confusion.

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
de8327c11a gpu/intel: add more supported chips
support for Gen > 8

+ determine platform, revision and stepping

issue #4254
2021-08-30 15:00:37 +02:00
Alexander Boettcher
0aa17661cc gpu/intel: avoid overlapping ggtt range allocation
Size argument of ggtt free range check is ignored, which leads to
overlapping allocations inside, which leads to unavailable IO-MEM exceptions
thrown by core.

issue #4254
2021-08-30 15:00:37 +02:00
Norman Feske
040628894c build: introduce GLOBAL_DEPS variable
The new varible can be used to trigger the rebuild of the entire target
whenever any of the listed files changes.

Fixes #4255
2021-08-30 15:00:37 +02:00
Johannes Schlatow
b5dd1dd01b trace: consolidate Trace_buffer implementations
Both, trace_logger and vfs_trace had their own trace_buffer.h. This
commit consolidates the existing implementations and provides the
resulting trace_buffer.h at 'include/trace/'. It thereby becomes part of
the trace api archive.

genodelabs/genode#4244
2021-08-30 15:00:37 +02:00
Johannes Schlatow
ffbd26d63f depot: add trace policy api
genodelabs/genode#4244
2021-08-30 15:00:36 +02:00
Johannes Schlatow
1416b2258f Trace_buffer: do not reprocess last read entry
genodelabs/genode#4244
2021-08-30 15:00:36 +02:00
Norman Feske
436d946300 recipes/api/genode_c_api: add src/lib/genode_c_api
The source codes are needed to use the API because they are statically
linked.
2021-08-30 15:00:36 +02:00
Norman Feske
324ad33736 lx_emul: prevent clk_disable_unused
Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
2cb4157211 lx_emul: support IRQCHIP_DECLARE initcalls
Similar to CLK_OF_DECLARE, this patch extends lx_emul with ability to
extend the __irqchip_of_table with secondary interrupt controllers.

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
c95af254f4 lx_emul: sanitize size 0 for __kmalloc
Driver code such as mfd-core.c may pass 0 as argument n to kcalloc,
which eventually results in an allocation size 0.

  res = kcalloc(cell->num_resources, sizeof(*res), GFP_KERNEL);

Since 'res' is checked against NULL for success, kmalloc must not return
a NULL pointer in this case. The patch works around this issue by
forcing an allocation size of 1 byte in this case.

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
29032caf40 lx_emul: support CLK_OF_DECLARE initcall mechanism
Clock providers such as drivers/clk/sunxi-ng/ccu-sun8i-r.c don't use
regular init calls but declare their init functions via CLK_OF_DECLARE,
which fill the __clk_of_table. Linux populates the table statically by
using special sections declared in the linker script. In contrast, we
populate the table by expanding the macro to global constructor
functions.

The __clk_of_table is then processed by the call of of_clk_init(NULL).

Issue #4253
2021-08-30 15:00:36 +02:00
Norman Feske
36af114d78 lx_emul: enhance krealloc implementation
Issue #4253
2021-08-30 15:00:36 +02:00
Christian Prochaska
149bd999f3 vfs_oss: support more commands for VirtualBox 6 and sndio
Fixes #4252
2021-08-30 15:00:36 +02:00
Christian Helmuth
a6fb61dbf2 vbox6: support dynamic framebuffer resolution
Issue #4031
2021-08-30 15:00:36 +02:00
Christian Helmuth
c54473abea vbox6: update to version 6.1.26
Issue #4031
2021-08-30 15:00:35 +02:00
Christian Helmuth
611e93a5f2 vbox6: kick AHCI asynchronous IO thread
Issue #4031
2021-08-30 15:00:35 +02:00
Christian Helmuth
d6bde82894 vbox6: add libyuv to pkg recipe
Issue #4031
2021-08-30 15:00:35 +02:00
Johannes Schlatow
88b3880c77 base: fix shift overflow error in Bitfield::mask()
Fixes genodelabs/genode#4249
2021-08-30 15:00:35 +02:00
Christian Helmuth
7618c9410a depot: update recipe hashes 2021-08-18 15:06:12 +02:00
Johannes Schlatow
5e284bfb35 trace: disable tracing when owner disappears
* Disable trace source and release ownership on subject destruction.
* Note, since the policy module is also destroyed on descruction of the
  session component, the traced component must not access the policy
  module when acknowledging the disabled state (else: page fault).

Fixes genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Johannes Schlatow
81d939f947 test-trace: test destruction of trace subjects
If the trace subjects are not properly destructed when the TRACE client
disappears, enabled sources will be owned by a non-existing client.
In other words, when a TRACE client disappears all sources owned by the
client must be disabled.

genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Johannes Schlatow
9898341d4a depot_autopilot: fix ineffective test-trace
test-trace always passed, although tracing was never enabled because the
trace subject was not within the first 32 subjects.

* increase number of queried subjects
* output error if trace subject was not found

genodelabs/genode#4247
2021-08-18 15:06:12 +02:00
Martin Stein
812fdec27c nic_router: propagate dns domain name via dhcp
With this commit, the NIC router DHCP client reads out the first DNS domain
name (DHCP option 15) if any from a DHCP reply that generates an IPv4 config
for a domain and stores the name together with the IPv4 config for that domain.
DNS domain names are reported via the new report tag '<dns-domain>' if the
'config' attribute in the config tag '<report>' is set.

Furthermore, the NIC router DHCP server becomes able to obtain a DNS domain
name from another domain that has a DHCP client dynamically (given the config
attribute 'dns_config_from' is set and no static DNS config is given) or
statically from its configuration (new config tag '<dns-domain>') and propagate
this name with DHCP replies (DHCP option 15).

The 'nic_router_dhcp_*' tests are adapted to test the new feautures.

The commit also gets rid of some mirrored files in
'test/nic_router_dhcp/manager'.

Fixes #4246
2021-08-18 15:06:12 +02:00
Martin Stein
fa64aae7f8 nic_router: config attribute 'dns_config_from'
WARNING: 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 'dns_server_from' attribute in a NIC router
configuration replace the attribute name with 'dns_config_from'. The attribute
value remains unaltered.

DETAILED DESCRIPTION

The new attribute name 'dns_config_from' reflects that also other aspects of
the DNS configuration of the denominated domain are used by the DHCP server
that holds the attribute. This commit is a preparation for forwarding also the
domain name (DHCP option 15) with the mechanism behind the attribute.

Ref #4246
2021-08-18 15:06:12 +02:00
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
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
Norman Feske
6de19e4a9b tool_chain_auto.run: exercise 'ln -s'
as a regression test for issue #4219.
2021-07-28 11:25:21 +02:00
Norman Feske
5138aeba80 libc: fix nested monitor call in 'symlink'
The symlink implementation wrongly constructed a 'Sync' object within
the context of a monitor call. The 'Sync' constructor indirectly
depended on libc I/O for obtaining the current time, ultimately
resulting in a nested attempt of a monitor call. This could be
reproduced via the base.run script:

  $ cd /home
  $ ln -s a b

The 'ln' command resulted in the following log message:

  [init -> /bin/bash -> 7] Error: deadlock ahead, mutex=0x10ff8c70, return ip=0x500583a7

The patch fixes the problem by splitting the single monitor call into
two monitor calls and moving the construction of the 'Sync' object
in-between both monitor calls, thereby executing the constructor at the
libc application level.

Fixes #4219
2021-07-28 11:25:21 +02:00
Sebastian Sumpf
4d4cc4fd02 libm: use libm from libc and remove openlibm
- enable libm for x86/arm
- update ieee754 to slightly changed output
- remove openlibm from port

fixes #4213
2021-07-28 11:25:21 +02:00
Sebastian Sumpf
4b10aa94ec base-hw: save/restore fpcr register for ARM_V8
The floating-point (fpcr) control register is user land accessible and
controls, for example, rounding mode.

fixes #3723 and related to #4213
2021-07-28 11:25:20 +02:00
Martin Stein
688379d1ed sel4: fix segmentation fault with CCACHE=yes
Building the elfloader in kernel-sel4.inc has a problem with Genodes CCACHE
make variable. When issuing ...

! ./tool/depot/create mstein/bin/*/base-sel4-* CCACHE=yes

..., building the elfloader used to consume all memory of the host system and
then run into a segmentation fault:

! make[6]: *** [elfloader/elfloader.o] Segmentation fault (core dumped)

This is because the other build system invokes the CCACHE variable as a command
in front of the compiler command. If CCACHE is set to 'yes', the 'yes' command
is called and produces an endless output into some output file. The problem
can be fixed by locally re-setting the CCACHE variable for the
'make ... elfloader' command to 'ccache' (Genode CCACHE==yes) or '' (Genode
CCACHE!=yes).

Fixes #4212
2021-07-28 11:25:20 +02:00
Martin Stein
388e2a0e6d fec nic driver: fix compiler warnings
Fixes #4178
2021-07-28 11:24:55 +02:00
Christian Prochaska
a856bfb4ab qt5: implement 'SyncSocket' with pipes on Genode
Fixes #4208
2021-07-28 11:24:55 +02:00
Christian Prochaska
3824c0ca5f qt5: ignore 'fcntl(F_SETLK)' error in sqlite3 implementation
Fixes #4194
2021-07-28 11:24:55 +02:00
Martin Stein
2d017ad7b7 nic_router: guard against exception in free_ip
Adds try-catch-statement with diagnostic errors in Dhcp_server::free_ip in
order to guard against exceptions from the underlying bit allocator. These
exceptions should never happen given that the router is programmed correctly
and always feeds Dhcp_server::free_ip with sane arguments (which it should).
However, should this not be the case, we can assume that the failed IP freeing
indicates that the IP isn't allocated anyway and it's fine to continue using
the router. Furthermore, IP allocations are a mere client service and not
relevant for the integrity or safety of the router.

Ref #4200
2021-06-25 11:57:28 +02:00
Martin Stein
be644098d7 nic_router: fix exc. in Interface::handle_config_3
When Interface::handle_config_3 (third step of applying a new configuration to
interfaces) tried to detach the interface from the current IP config because
the old and new IP config differed, it did so using the new domain. The former
steps of the reconfiguration already installed the new domain reference at the
interface. Therefore, also the DHCP server of the new domain was used. This,
however caused uncaught exceptions because detaching from an IP config
includes dissolving all DHCP allocations. This dissolving of DHCP allocations
now operated on a DHCP server (the one of the new domain) that wasn't related
to the allocations and, in the worst case, caused an uncaught exception
because the IPs were out of its range.

That said, this commit ensures that detaching an interface from an IP config
is always done on the domain from which the IP config originated. Normally,
this is the domain the interface is attached to. But in the case of
Interface::handle_config_3, it is another - the former domain the interface
was attached to.

The commit also adapts the nic_router_dhcp_* tests in a way that they
reconfigure the router in a way that would trigger the uncaught exception
without the fix.

Fixes #4200
2021-06-25 11:57:24 +02:00
Sebastian Sumpf
fd9bc43be1 ldso: Fix RISC-V support with 21.05 tool chain
- force inlining of more functions
- force -O2 for RISC-V (even if -O0 is set globally)
- intialize cxx guard after self relocation

issue #4094
2021-06-25 11:56:22 +02:00
Christian Helmuth
ece33d37f8 depot: update recipe hashes 2021-06-25 11:46:37 +02:00
Stefan Kalkowski
e7067050be base: extend cache maintainance functionality
Introduce two new cache maintainance functions:
* cache_clean_invalidate_data
* cache_invalidate_data
used to flush or invalidate data-cache lines.

Both functions are typically empty, accept for the ARM architecture.
The commit provides implementations for the base-hw kernel, and Fiasco.OC.

Fixes #4207
2021-06-25 11:43:41 +02:00
Johannes Schlatow
b83c8f35c6 depot: ffi for x86_32
genodelabs/genode#4201
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
a242bfce48 libports: ffi for x86_32
- Required by glib

issue #4201
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
19a7997734 qemu-usb: consume device report during controller construction
Initially parse the USB devices report after the signal handler is
registered, do not rely on a signal to be triggered (issue #1788).

Fixes #4206
2021-06-25 11:43:41 +02:00
Sebastian Sumpf
a58473dece autopilot: add usb_hid_reconnect run script
- Adjust script to run on Qemu x86 only

fixes #4205
2021-06-25 11:43:41 +02:00
Christian Helmuth
cd25dc4e6a dde_bsd: prevent ‘nonnull’ argument warning
The implementation conflicted with the implicit declaration of bzero:

.../repos/dde_bsd/src/lib/audio/mem.cc: In function ‘void bzero(void*, size_t)’:
.../repos/dde_bsd/src/lib/audio/mem.cc:377:2: warning: ‘nonnull’ argument ‘b’ compared to NULL [-Wnonnull-compare]
2021-06-25 11:41:46 +02:00
Christian Helmuth
c585e008b1 acpica: prevent recursive 'memset()' calls with gcc 10
Thanks to Peter for the patch.

Issue #4125
2021-06-25 11:41:45 +02:00
Norman Feske
5b85bd9602 mk: make LD_SCRIPT_DYN customizable
This way, a target.mk becomes able to override the default linker
script, e.g., for adding custom symbols.
2021-06-25 11:41:45 +02:00
Martin Stein
0dc7084b0f wifi_drv: fix compile warnings with gcc 10
Fixes #4202
2021-06-25 11:41:45 +02:00
Martin Stein
16c4aacf34 vfs/dir_fs: allow opening empty dirs
Adapts Dir_file_system::open_composite_dirs in a way that it returns "success"
when the leaf node of the path is an empty directory but "lookup failed", as
usual, if one of the other directories on the way to the leaf node is empty.

I couldn't find a technical reason why we used to return "lookup failed" when
only the leaf node was empty.

The commit also adds a test for en empty root directory and empty
sub-directories to the fs_query run script.

Fixes #4198
2021-06-25 11:41:45 +02:00
Martin Stein
6bfdddd0b5 fs_query: gracefully deal with missing directories
The fs_query component used to exit with an uncaught exception if a queried
directory didn't exist. Now, fs_query will catch this event and simply skip the
affected query, thereby indicating to the user the inexistence of the
queried directory.

Ref #4032
2021-06-25 11:41:45 +02:00
Johannes Schlatow
026b117a63 separate sandbox api from os
genodelabs/genode#4191
2021-06-25 11:41:45 +02:00
Johannes Schlatow
7346defc26 usb_modem_drv: remove nic_server mode
genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
dff1df0b49 usb_modem: do not fail on netif_stop_queue
genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
2c87c68a5d depot: add ffi api and src archives
Fixes genodelabs/genode#4201
2021-06-25 11:41:45 +02:00
Johannes Schlatow
52a4293bbc depot: add usb_modem_drv archives
genodelabs/genode#4201
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
ff57bf617b usb_webcam: webcam run script
Run script for quickly testing webcams in Qemu or on target.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
818f1682ee qemu-usb: flush EP improve isochronous handling
- Patch the XHCI model in order to handle frame wrapping correctly. For
  this adjust 'mfindex_kick' to the correct period (same, before, or after
  'mfindex').

- Flush EP when it is stopped, this causes all pending packets for the EP
  to be acked. Correct counting of packets in flight.

- Add BEI patch by Josef.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
eabda8907f usb_host: add support to flush EP transfers
This causes all pending transfers of a EP to be canceled and in turn to
be acked by the raw session.

issue #4196
2021-06-25 11:41:44 +02:00
Alexander Boettcher
4aa99fd1a9 qemu-usb: reduce cpu load by webcam model
if no new frame is available for capturing

Fixes #4078 #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
ff452619e3 vbox5-nova-capture: Set camera to 640x480@30fps
Default to 30fps

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
19a5fee70b depot_deploy: add <capture> session announcement
Announce Capture session if node is present in runtime.

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
c66a196f76 usb_webcam: package recipes
- API packages for: libusb, libuvc, and libyuv
- Source packages for: API packages + USB webcam app
- Meta package for USB webcam
- Raw package for USB webcam configuration

issue #4196
2021-06-25 11:41:44 +02:00
Sebastian Sumpf
9165c7601d libyuv: make shared object
- Adjust port to Genode expected layout
- Make shared library
- Adjust dependent infrastructure to change

issue #4196
2021-06-25 11:41:44 +02:00
Martin Stein
ff128df131 dde_linux/fec: fix unsynchronized TX DMA write
Unfortunately, our current implementation of 'wmb()' doesn't seem to do what we
want it to do. On base-hw + imx6q_sabrelite, the write of bdp->cbd_sc seems to
get re-ordered after the write to txq->bd.reg_desc_active in the transmission
path of the contrib code. Due to this, the transmission of the packet is only
triggered the next time a packet is sent. However, we only quick-fix it by
enforcing the execution of the write with a volatile global read as we will
soon update the FEC NIC port with a new DDE approach anyway.

Fixes #4010
2021-06-25 11:41:44 +02:00
Christian Prochaska
747d01e854 qt5: adapt QtWebEngine contrib code for use of nss
Fixes #4192
2021-06-25 11:41:44 +02:00
Christian Helmuth
331844c979 vbox6: support capslock="rom" mode
In ROM mode the global CapsLock state is controlled by the capslock ROM
by virtual KEY_CAPSLOCK events.

Guests are easily confused by spurious KEY_CAPSLOCK input events in
caps="rom" mode. These spurious events may reach the VMM if KEY_CAPSLOCK
is not pressed as first key in a combination and, therefore, is not
filtered as global key. We filter KEY_CAPSLOCK in ROM mode in the VMM
explicitly, but let it pass in non-ROM mode.

Per default RAW mode is used and CapsLock key events are sent unfiltered
to the guest.
2021-06-25 11:41:44 +02:00
Christian Helmuth
434d007dc1 stdcxx: some missing symbols for basic_string
Revealed with -O0 when linking test/lx_fs_notify/file_writer.

Issue #4070
2021-06-25 11:41:44 +02:00
Pirmin Duss
7db6f457d4 lx_fs: enable watch
Enable watching files via the inotify interface of the Linux Kernel.

Delivery of watches to components is staggered in order to prevent an
overflow of the ACK queue in cases when a lot of changes are made to the
file system from the Linux side.

Fixes #4070
2021-06-25 11:41:44 +02:00
Christian Helmuth
37f1873f2e vbox5: drop KEY_CAPSLOCK events on capslock="rom"
Guests are easily confused by spurious KEY_CAPSLOCK input events in
caps="rom" mode. These spurious events may reach the VMM if KEY_CAPSLOCK
is not pressed as first key in a combination and, therefore, is not
filtered as global key. Now, we filter KEY_CAPSLOCK in ROM mode in the
VMM explicitly, but let it pass in non-ROM mode.

Fixes #4087
2021-06-25 11:41:43 +02:00
Christian Helmuth
002037ce15 vbox6: support MAC address overwrite 2021-06-25 11:41:43 +02:00
Christian Helmuth
2a1a47b598 vbox6: update to version 6.1.22 2021-06-25 11:41:43 +02:00
Alexander Boettcher
ab31de0f6a libc_integration: reduce rounds for x86_32
autopilot mode. The test machine is less powerful as the x86_64 one.

Issue #3967
2021-06-25 11:41:43 +02:00
Pirmin Duss
a37ff1d985 lx_fs: enable session quota upgrades
Issue #4070
2021-06-25 11:41:43 +02:00
Pirmin Duss
4053e1628b lx_fs: support for unlink
This is based on the work of @ehmry and @sidhussmann.

Issue #4070
2021-06-25 11:41:43 +02:00
Alexander Boettcher
27004e1fd5 usb: remove monolithic usb driver
+ adjust README files

Fixes #4173
2021-06-25 11:41:43 +02:00
Johannes Schlatow
b09e69a444 ports: change bashrc path
genodelabs/genode#4163
2021-06-04 11:29:04 +02:00
Christian Prochaska
60eec251e0 qt5: increase stack size of QtWebEngine render thread
Fixes #4168
2021-06-02 10:36:01 +02:00
Stefan Kalkowski
336350fe60 sculpt: enable support for MNT Reform2 2021-06-01 15:53:48 +02:00
Stefan Kalkowski
8408bf6ac0 fec_nic_drv: remove nic_server mode
Issue #4133
2021-06-01 15:51:22 +02:00
Alexander Boettcher
73d87073af vbox5/6: avoid negative timeouts in xhci model
Fixes #4184
2021-05-31 15:36:53 +02:00
Sebastian Sumpf
cf2527269f qemu-usb: allocate host devices after webcam
Because qemu-usb allocated host devices after 'USB_HOST_DEVICE' in the
object array and 'USB_WEBCAM' is loacated after 'USB_HOST_DEVICE' the
webcam model can overwrite an already allocated pass-through device. As
a solution add the 'USB_FIRST_FREE' to make it clear from where host
devices can be allocated. Also increase the number of supported host
devices to eight.

fixes #4182
2021-05-31 15:19:46 +02:00
Christian Prochaska
520b69ef0d libports: update expat port
Fixes #4183
2021-05-31 15:19:44 +02:00
Christian Helmuth
1d52bd017d depot: update recipe hashes 2021-05-28 14:16:46 +02:00
Josef Söntgen
e06f3bba27 drivers_managed-imx8q_evk: fix hdmi device node
By now the 'compatible' name is set via the 'type' attribute.

Fixes #4181.
2021-05-28 14:16:46 +02:00