Commit Graph

916 Commits

Author SHA1 Message Date
Christian Helmuth
bed084c17c Add missing sources to wireguard
The additional files provide Chacha implementation in case
may_use_simd() returns false because in_interrupt() returns true.

Related to issue #4778, commit "lx_emul: track irq state changes"
2023-03-13 14:32:37 +01:00
Christian Helmuth
9ae4fc2371 dde_linux: explicitly list patch files
Using wildcards for selecting patch files clashes with files from
linux.port.
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
6a7a30ceaa lx_emul: unify udelay implementation
Implement udelay for all architectures within common lx_emul code,
remove driver-specific version.

Always do busy looping in udelay and use cpu_relax()
like the original Linux code. Thereby, we profit from architecture specific
instructions (cpu cool down), and jiffies are updated if irqs are on.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
50541c68ec lx_emul: shadow cpu_relax to update jiffies
There are rare use-cases where cpu_relax is used inside a busy loop
(i2c bus functions), which only will break when the jiffies counter
reaches a specific value.
Because of the cooperative scheduling done in lx_emul, no timer
interrupt will break such a loop. As a workaround, we check for
necessary jiffies updates inside cpu_relax if interrupts are enabled.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
7e2c546d8e lx_emul: update jiffies during schedule
Whenever a new schedule decision is made in the Linux emulation layer,
we try to update the jiffies counter.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
c90b61f571 lx_emul: track irq state changes
To be able to check for interrupts being on or off,
the enabling and disabling is tracked in lx_emul.
When interrupts get received, they have to be turned off.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
eba2c8cf2f lx_emul: set timer irq task to highest priority
If a timer signal got received, first all time updates
have to be done, before other tasks get active.

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
2c1724d7f2 lx_emul: adjust start & stop tick behaviour
Do not start and stop idle ticking within the timer interrupt
routine, but do it around the whole Lx_kit scheduling, which
is always called when Linux code gets active again, either
because of backend signals, interrupts, or timing signals.

This commit implicitly reverts the (incomplete) solution of
issue #4550

Ref genodelabs/genode#4778
2023-03-13 14:32:37 +01:00
Roland Bär
b9b18c92d0 usb_host: deliver UTF-16 strings on request
Linux kernel static functions usb_string_sub() and usb_get_langid() were
made accessible to implement robust string rerieval.

Fixes #4756
Fixes #4757
Fixes #4772
2023-03-13 14:32:37 +01:00
Josef Söntgen
23cc96e661 wifi/pc: add firmware for the Intel AX210 2023-03-13 14:32:37 +01:00
Christian Helmuth
e265cf6d49 depot: update recipe hashes 2023-02-27 08:22:51 +01:00
Sebastian Sumpf
e2c334d6e4 linux: allow more workers when scheduling works
Workers are only summoned by the manager or when there are no workers on
a work queue. In case a work in front of a work queue depends on a work
behind it, a deadlock may occur. To solve this Linux spawns a rescue
worker using timers. Timing of Linux based drivers is currently reworked
and not reliable. Therefore, we increase the number of workers that are
spawned from 1 to 3 per work queue in order to resolve possible
deadlocks.

Fixes #4762
2023-02-27 08:22:50 +01:00
Norman Feske
bdf47785b8 vfs: remove 'file_size' from read/write interfaces
The 'file_size' type denotes the size of files on disk in bytes. On
32-bit architectures it is larger than the size_t, which refers to
in-memory object sizes.

Whereas the use of 'file_size' is appropriate for ftruncate and seek, it
is not a suitable type for the parameters of read/write operations
because those operations refer to in-memory buffers.

This patch replaces the use of 'file_size' by size_t. However, since it
affects all sites where the read/write interface is uses, it takes the
opportunity to replace the C-style (pointer, size) arguments by
'Byte_range_ptr' and 'Const_byte_range_ptr'.

Issue #4706
2023-02-27 08:22:49 +01:00
Christian Helmuth
73f7f8aef6 dde_linux: generalize kmalloc_order() implementation 2023-02-27 08:22:48 +01:00
Sebastian Sumpf
8279038da2 lx_emul: provide _raw_read_lock/unlock functions
Required by i.MX8's gpu driver. '_raw_read_lock' was already present but
not implemented, add it's counter part as well.

issue #4713
2023-02-27 08:22:48 +01:00
Christian Helmuth
de9ea43616 dde_linux: remove custom lx_backtrace (use lx_emul_backtrace) 2023-02-27 08:22:46 +01:00
Josef Söntgen
578a8c9918 wifi/pc: add rtlwifi driver
Due to lacking hardware access the driver was test with one RTL8188EE
based device, namely [10ec:8179] (rev 01), only. As the access to the
PCI config space is restricted the driver loads the non power-saving
FW and the driver port is therefor only tested with that. The
accesses are documented should we choose to support them one way or
another later on.

The 'wifi.run' run script as well as Sculpt served as testing ground
where the driver worked fine so far.

Fixes #4714.
2023-02-27 08:20:45 +01:00
Josef Söntgen
e826095e71 legacy/lx_emul/usb: handle saturated submit queue
Check if we are able to submit the Usb packet before attempting to
allocate it. In case the queue is already full we wait until another
pending packet is freed.

Fixes #4701.
2023-02-27 08:20:45 +01:00
Benjamin Lamowski
faf37b51e7 dde_linux: backport fix for use-after-free reported by GCC 12
On my system, compiling dde_linux fails with `-Werror=use-after-free`.
Backport the fix from mainline to get rid of the issue.

Fixes #4740
2023-02-27 08:20:45 +01:00
Christian Helmuth
25eac6b9e6 depot: update recipe hashes 2023-01-24 12:07:33 +01:00
Tomasz Gajewski
d33139c40a enable ccache for reference Linux kernel
Genode build system allows to easily enable 'ccache' for builds. This
change allows to enable using 'ccache' also for build of reference
Linux kernel used during porting device drivers.

To enable 'ccache' it is enough to pass value of 'CC' variable when
executing Linux build but this build by default depends on time when it
is built which causes 'ccache' misses. To solve this issue additional
flags are passed to make build independent from time, current user and
host on which build is performed.

Issue #4718
2023-01-24 12:07:32 +01:00
Norman Feske
25e4bcefbf vfs: remove 'Io_response_handler' interface
The old 'Io_response_handler::io_progress_response' interface has been
replaced by the 'Vfs::Env::User::wakeup_vfs_user' (issue #4697). The
remaining 'read_ready_response' method is now hosted in the
appropriately named 'Read_ready_response_handler'.

Issue #4706
2023-01-24 12:07:30 +01:00
Stefan Kalkowski
767632e1af dde_linux: remove leftovers of legacy fec_nic_drv
Some relicts in `repos/dde_linux/lib`.

Ref #4651
2023-01-24 12:07:30 +01:00
Christian Helmuth
b59ec55d50 lx_emul: provide irqsave/restore write-lock functions 2023-01-24 12:07:29 +01:00
Christian Helmuth
6d14f5442e lx_emul: provide more pci functions
- pci_dev_present() based on devices on bus
- pci_request_regions() as dummy
- pci_release_regions() as dummy
2023-01-24 12:07:29 +01:00
Norman Feske
ca0d3757cc vfs: make 'File_io_service::read_ready' const
... and replace pointer argument to const reference.

Issue #4706
2023-01-24 12:07:29 +01:00
Norman Feske
ff2176a586 vfs,libc: support write fds in select
By adding a 'write_ready' interface following the lines of the existing
'read_ready', VFS plugins become able to propagate the (de-)saturation
of I/O buffers to the VFS user. This information is important when using
a non-blocking file descriptor for writing into a TCP socket. Once the
application observes EAGAIN, it expects a subsequent 'select' call to
return as soon as new I/O buffer space becomes available.

Before this patch, the select call would always return under this
condition, causing an unnecessarily busy write loop.

Issue #4697
2023-01-24 12:07:28 +01:00
Christian Helmuth
772f89e77f linux.port: xhci patch to fix "unknown event type 37"
Issue #4678
2023-01-24 12:07:27 +01:00
Christian Helmuth
b033b30f95 depot: update recipe hashes 2022-11-29 12:32:49 +01:00
Christian Helmuth
5ff8e7cadf lx_emul: use usb_unlink_urb() in timeout handler
Replace usb_kill_urb() by usb_unlink_urb() in the timeout handler for
control URBs, as usb_kill_urb() may block and is not allowed to be
called in IRQ/bottom half contexts.

Fixes #4681
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
f6825eea5f pci_decode: increase default ram quota
To circumvent problems of the page-table entries getting short on sel4,
increase the RAM quota for this component in all run-scripts.

Fix #4686
2022-11-29 12:29:57 +01:00
Christian Helmuth
c58d799f16 depot: update recipe hashes 2022-11-17 08:00:37 +01:00
Christian Helmuth
25d7970b6f depot: fix README of pkg/usb_modem_drv 2022-11-17 08:00:37 +01:00
Benjamin Lamowski
0e9a49d1cf wifi/pc: add firmware for the Intel AX211
Lenovo Thinkpads with 12th gen Intel i7 CPUs such as the X1 Nano G2 may
contain such a wifi card.

Issue #4663
2022-11-17 08:00:37 +01:00
Benjamin Lamowski
e46a7dd6f5 dde_linux: fix Intel Intel AX211 wifi without MSI-X
Lack of MSI-X support in DDE Linux causes a timeout when the Intel AX211
tries to call back into the driver while loading the PNVM file while
interrupts are still disabled.

With the patch picked up from QubesOS the card works on an X1 Nano G2:
5fcfe0f19e

Issue #4663
2022-11-17 08:00:37 +01:00
Benjamin Lamowski
04efe88044 wifi/pc: add support for loading PNVM files
Intel wifi cards in the AX210 family need additional PNVM firmware to
function properly. Enable the bundling and loading of *.pnvm files.

Issue #4663
2022-11-17 08:00:37 +01:00
Stefan Kalkowski
3082950e74 usb_session: align USB packet allocation correctly
To prevent caching side-effects of USB DMA memory taken from the packet stream
all allocations of USB packets need to be on separated cachelines at least.

Fix genodelabs/genode#4655
2022-11-17 08:00:35 +01:00
Josef Söntgen
b03059b933 dde_linux: allow GPIO state access
To complement the GPIO support allow for setting and reading input
pins. So far this is needed by drivers that attempt to perform I2C
bit-banging via GPIO pins.

Fixes #4624.
2022-11-17 08:00:35 +01:00
Josef Söntgen
85f98d7038 dde_linux: provide __phys_to_pfn for arm64
This macro is needed by the 'pinephone_camera_drv' driver port.

Fixes #4625.
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
f0315b2715 dde_linux: remove legacy fec_nic_drv
Ref genodelabs/genode#4651
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
018c562447 lx_emul: refine configurations & memory attributes
Ref genodelabs/genode#4651
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
9482355c47 lx_emul: allow different irqchip declarations
To enable other irqchip declarations beyond the lx_emul generic code base,
make the ARM specific initialization routine public.

Ref genodelabs/genode#4651
2022-11-17 08:00:34 +01:00
Christian Helmuth
5a06a9dec1 lx_emul: provide pci_try_set_mwi() 2022-11-17 08:00:34 +01:00
Christian Helmuth
d5577421f8 wireguard: create dir before generating asm file
Prevents errors like follows.

  /bin/bash: arch/arm64/crypto/poly1305-core.S: No such file or directory
  make[4]: *** [.../genode/repos/dde_linux/lib/mk/spec/arm_64/wireguard_lx_inc_dirs.mk:17: arch/arm64/crypto/poly1305-core.S] Error 1
2022-11-17 08:00:34 +01:00
Sebastian Sumpf
cd08cd54a4 usb_block_drv: allow for using UAS devices via BOT
Reintroduce:

USB Attached SCSI devices might expose a bulk-only interface
as fall-back at interface 0 and alternate setting 0. This commit
allows for probing all alternate settings of the active interface
to be able to use such devices.

The configuration was extended so that in case the device interface
is known beforehand the driver can be configured accordingly.

Additionally:

Perform configuration reset upon sessions close in order to bring USB
device to a well defined state.

fixes #4494
2022-11-17 08:00:34 +01:00
Christian Helmuth
847266d027 depot: update recipe hashes 2022-10-12 14:31:50 +02:00
Norman Feske
80e2cea4aa dde_linux: enable Intel Alderlake graphics
With this patch, the Intel framebuffer driver works on the Framework
Gen12 laptop.

Fixes #4627
2022-10-12 12:09:35 +02:00
Josef Söntgen
427bd93921 wifi/pc: add FW image for new so devices
The Framework laptop with the 12the Generation CPU contains such a
device.

Fixes #4626.
2022-10-12 12:09:35 +02:00
Christian Helmuth
ee19426f4d lx_emul: validate endpoint for isochronous URB
Thanks to Andreas for the patch.
2022-10-12 12:09:35 +02:00
Stefan Kalkowski
fa124dd340 lx_kit: do not close/re-open IRQ session
Instead of dynamically close/open IRQ session whenever an IRQ
gots masked/unmasked, track the state internally and resp.
deliver an interrupt delayed.
2022-10-12 12:09:35 +02:00