Commit Graph

8843 Commits

Author SHA1 Message Date
Norman Feske
d0f4791413 demo: remove use of format strings from mini_c lib
The implementations of snprintf and vsnprintf are not needed for the
loading of png images by the demo applications. So we can avoid the
dependency from the format library hosted in the libports repository.

Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
2c32e9ee18 base: remove util/avl_string.h
The use case is covered by util/dictionary.h now.

Fixes #4780
2023-03-13 14:32:53 +01:00
Sebastian Sumpf
c14007f559 vfs_trace: replace use of Avl_string by Dictionary
issue #4780
2023-03-13 14:32:53 +01:00
Josef Söntgen
ae0e0c118e nvme_drv: add support for host-memory-buffer
This commit introduces support for the HMB feature and will setup the
buffer during start-up. The host-memory-buffer (HMB) feature is mostly
used on NVMe devices that do not make use of an DRAM cache to store its
translation tables amongst other operational data. Not using HMB can
impair the performance on such devices.

The memory is allocated in 2 MiB chunks of DMA-capable memory and its
total size in bytes is configurable via the 'hmb_size' config attribute.
The driver always checks the minimal and preferred size of the HMB and
issues a warning in case it is not enabled via the configuration.
Moreover, if the configured size is less than the minimal amount
required by the device the HMB is not configured at all and a warning
is issued also. If the configured size is more than the preferred size
it will be capped to that amount.

Fixes #4715.
2023-03-13 14:32:53 +01:00
Norman Feske
239d4864e9 loader: support dynamic session upgrades
This patch converts the loader implementation to the 'Session_object'
interface to implement the ability to upgrade the session caps and RAM
after after the session creation. This is needed to accommodate the
change of the Loader::Connection in commit "Remove format strings from
connection types".

Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
c99fb2b69b core: replace use of Avl_string by Dictionary
Issue #4780
2023-03-13 14:32:53 +01:00
Stefan Kalkowski
ec700e88f7 pci_decode: do not handle signals after decoding
Remove signal handler and ACPI report ROM from Main class
to prevent to react on report changes.

Fix genodelabs/genode#4779
2023-03-13 14:32:53 +01:00
Norman Feske
8698e693d5 trace_logger: replace Avl_string by Dictionary
Issue #4780
2023-03-13 14:32:53 +01:00
Norman Feske
d4047e9af7 nic_router: remove stale include of avl_string.h 2023-03-13 14:32:53 +01:00
Norman Feske
d727d18871 base: remove format strings from API
This patch ultimatedly removes format strings from Genode's base API.
Users of the former base/snprintf.h and base/console.h headers may
use the free-standing 'format' library hosted in the ports repository.

Fixes #2064
Fixes #3869
2023-03-13 14:32:53 +01:00
Norman Feske
e9b249b709 Replace use of base/snprintf.h by format library
Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
9ef0f1b6cb libports: freestanding 'format' string library
This little library implements rudimentary format-string support. It is
useful for porting 3rd-party code that ought not depend on a full libc.

Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
50ee8dfaf8 Remove obsolete includes of base/snprint.h
Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
94b8c61e32 libc: remove internal use of base/snprintf.h
Issue #2064
2023-03-13 14:32:52 +01:00
Norman Feske
8b44f49d75 vbox5: remove use of base/snprintf.h
Issue #2064
2023-03-13 14:32:52 +01:00
Norman Feske
36c00cc294 gems: remove use of format strings
Issue #2064
2023-03-13 14:32:52 +01:00
Norman Feske
ecd0066e80 os: remove use of format strings
Issue #2064
2023-03-13 14:32:38 +01:00
Norman Feske
915adcd0dd base: remove internal use of format strings
Issue #2064
2023-03-13 14:32:38 +01:00
Norman Feske
9debad4e91 Remove format strings from connection types
Issue #2064
2023-03-13 14:32:37 +01:00
Norman Feske
fb66e733b5 base: add 'Connection' constructor accepting args
The new 'Connection' constructor accepts the session label, affinity,
and args as constructor arguments. The session arguments are passed as a
'Genode::String'. This allows for side-stepping the need for rendering a
format string passed to 'Env::session'.

Issue #2064
2023-03-13 14:32:37 +01:00
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
Christian Helmuth
ea2584e2fb Fix usb_block.run and add to autopilot.list 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
Norman Feske
2e6dd010ae core: introduce 'Core' namespace
The namespace draws a clear line between the base library and the core
component.

It is declared at the new core-local header <types.h>, which is expected
to be included by all code of the core component. It is thereby a
natural place for kernel-agnostic general types like commonly used C++
utilities.

Fixes #4777
2023-03-13 14:32:37 +01:00
Josef Söntgen
487aad6db1 wifi: allow driver dump in error case
This commit implements dummies that would otherwise trigger a
'generated dummy' call that stops the driver.
2023-03-01 16:30:00 +01:00
Alexander Boettcher
98fa0a1ad2 wifi: don't use kzalloc directly
Avoid using wrong pointer when calling free_page() which causes
otherwise memory corruption.
2023-03-01 16:29:53 +01:00
Stefan Kalkowski
caef7d642a usb_block: enable WARN_STRICT_CONVERSION switch
Implicitely fixes problems with USB devices having more than 4G blocks.
Formerly the 16-Cmd LBA requests were silently casted to 32-bit.

Fix genodelabs/genode#4771
2023-03-01 16:28:55 +01:00
Christian Helmuth
e265cf6d49 depot: update recipe hashes 2023-02-27 08:22:51 +01:00
Roland Bär
470f07d462 Some documentation tweaks/cleanups
Fixes #4773
2023-02-27 08:22:50 +01:00
Christian Helmuth
a4d45921c6 Document event handling in acpi_event 2023-02-27 08:22:50 +01:00
Josef Söntgen
8145ff6303 qemu-usb: only copy data when packet succeeded
In case the packet is erronous the value of 'actual_size' can be
invalid and using it may lead to a page-fault due to out-of-bounce
access.

With this commit access is only performed on successful packets.

Fixes #4763.
2023-02-27 08:22:50 +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
Alexander Boettcher
df27cc87b5 hw/x86: add suspend kernel syscall
using the ACPI mechanism. The syscall can be triggered solely via core's
RPC managing_system call.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
30c6feb86e hw/x86: re-init devices on resume
Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
1ea6708d84 hw/x86: prepare ACPI resume entry
Set wakeup pointer in FADT/FACS tables and prepare/place ACPI resume code
at application processors (AP) 16-bit entry. Exclude memory used for AP resume
from RAM range to avoid usage by Genode core in allocators.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
faf54244c4 hw/x86: keep cpu id after resume
The CPUs are woken all at once and up to now the IDs are assigned depending
on the arrival order, which is unfortunate for the resume case. Keep track
of once assigned IDs for CPUs, so that on resume the very same CPU id is given.
The APIC id is guaranteed to be fixed per CPU on suspend, but unfortunately
not dense packed.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
32b1aa605a hw/x86: add ACPI tables for resume
The ACPI table FACS and FADT are required to support ACPI suspend/resume. The
commits add the lookup of the ACPI table in bootstrap and the general usage
of the ACPI registers via the MMIO framework.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
dc1996d289 hw/x86: add interrupt controller re-init support
Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
1da71afbf3 hw: add Serial re-init/resume support
Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
5587476b4e hw: add Timer re-init/resume support
Add explicit init() to Timer infrastructure to re-initialize the hardware
based on the parameters given during constructing time of the timer object.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
1b5bfec8f9 hw: add CPU re-init/resume support
On resume the CPU state must be re-initialized, since all CPUs have been
potentially off (depending on sleep form) and lost state. Handle the halt
and suspend state explicitly by an extra Job implementation which can be
executed without holding the global kernel lock.

Issue #4669
2023-02-27 08:22:50 +01:00
Alexander Boettcher
a20a26b41b hw: add IPI type to flush and stop CPUs
as preparation before powering off the CPU

Issue #4669
2023-02-27 08:22:50 +01:00
Stefan Kalkowski
80453236c4 hw: don't depend on ARMv8 HCR, CPTR EL2 reg values
Instead of re-using the register values found in HCR_EL2 and CPTR_EL2
and setting single bits within them, define the complete content to
prevent inconsistent hardware/hypervisor state.

Ref genodelabs/genode#4759
2023-02-27 08:22:49 +01:00
Stefan Kalkowski
c5b9cabd89 vmm: enable effective C++ error switch
Several explicit casts could not be avoided yet, due to the missing
differentiation in between virtual and physical addresses that leads
to casting problems when using 32-bit ARM, and because the MMIO
register framework does not allow to return narrowed types of bitfields.

Apart from that, this commit fixes a switch-case fallthrough error in
Mmio_register::write.

Fix genodelabs/genode#4770
2023-02-27 08:22:49 +01:00
Stefan Kalkowski
adc594a7e6 os: remove conversion warnings/errors from virtio
The read_config and write_config functions in the generic virtio
headers used by all drivers lead to compiler warnings resp. errors
if effective-c++ switch is enabled. Moreover, the functions require
to define the access width as parameter. We can better turn them
into template functions using the value type to read resp. write to
derive the access width.

Ref genodelabs/genode#4344
2023-02-27 08:22:49 +01:00
Alexander Boettcher
ac69189e23 nova: support to re-enable IOMMU after ACPI resume
Issue #4669
2023-02-27 08:22:49 +01:00
Norman Feske
b044520344 Add missing includes of base/exception.h
This header used to be included implicitly by base/blocking.h, which
does no longer exist.

Issue #4768
2023-02-27 08:22:49 +01:00
Norman Feske
78b85339b0 vfs: buffer XML in <inline> file system
The use of 'Buffered_xml' removes the risk of the XML node's underlying
data to change during a component-config update.

Related to #4285
2023-02-27 08:22:49 +01:00
Norman Feske
6d25ffc70b Remove base/lock_guard.h
For Genode API users, the 'Mutex::Guard' is the way to go.
Special lock implementations can bring their own 'Guard' utilities.

Fixes #4769
2023-02-27 08:22:49 +01:00
Norman Feske
356506a67a base: remove base/blocking.h
This patch removes the obsolete exception type 'Blocking_canceled'.

Issue #4768
2023-02-27 08:22:49 +01:00
Norman Feske
32f9d1fceb os: remove server/input_event_bridge
This component was solely used during the transition of the
input-session to the event-session interface.

Fixes #4767
2023-02-27 08:22:49 +01:00
Norman Feske
b0e52ba7d4 util/misc_math.h: remove abs function
Fixes #4766
2023-02-27 08:22:49 +01:00
Norman Feske
e09941f310 Remove base/debug.h
Fixes #4765
2023-02-27 08:22:49 +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
Josef Söntgen
6e1517ca3c libdrm/lima: introduce disjunct contexts
Prior to this change the libdrm Lima implementation supported the
creation of multiple contexts where each context, however, was
treated as the same client like it was done in the Lima driver
itself.

With this commit each context becomes its own client while the
main context always performs all buffer object related allocation
and the other context import each needed BO before submitting.

Fixes #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
89f99df44d libdrm/lima: check buffer id in WAIT
Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
66fedecf34 libdrm/lima: handle unknown buffer ids gracefully
Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
46fc41ba50 libdrm/lima: rename Syncobj_space
Align the naming with the 'Gpu_context_space'.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
909b25db57 libdrm/lima: refactor session and context handling
Merge 'Gpu_session' and 'Gpu_context' and create the main session
as context.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
da32849ac2 libdrm/lima: move sync fd handling into DRM object
Converting from the sync-fd to the actual handle is internal
implementation detail.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
401da72a86 libdrm/lima: remove try-catch from ioctl call
Remove the exception handling as at this point all exceptions should
have been handled internally already.

Issue #4760.
2023-02-27 08:22:49 +01:00
Josef Söntgen
b8d8ff6d4d libdrm/lima: use sync-fd range beyond libc's reach
Sync file-descriptors a purely virtual and are not known by the libc and
should be only accessed by 'drm_poll'. To prevent accidental access move
them to range never used by the libc fd allocator.

Issue #4760.
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
c0e98f4481 base: fix conversion errors of smp timeout test
The cpu affinity index is an int no unsigned long within the interface
definition.

Ref genodelabs/genode#4344
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
e6c64290fa libpng_static: silent strncpy warnings
Ref genodelabs/genode#4344
2023-02-27 08:22:48 +01:00
Norman Feske
b88951345f depot: recipe for pkg/stdin2out 2023-02-27 08:22:48 +01:00
Norman Feske
07e3e09652 util/string.h: add 'Const_byte_range_ptr'
The new 'Const_byte_range_ptr' type is suitable as argument type that
refers to a read-only byte buffer, e.g., the source buffer of a write
operation.
2023-02-27 08:22:48 +01:00
Christian Helmuth
73f7f8aef6 dde_linux: generalize kmalloc_order() implementation 2023-02-27 08:22:48 +01:00
Sebastian Sumpf
0a8ac9fe4d gpu/intel: don't copy sesion cap for onwership check
We determine the owner of a Vram object by the session cap of the
session that created the object. We should not copy this cap to other
places because this increases reference counting, that can become very
large with many objects. Therefore, we pass a wrapper 'Owner' object
containing the cap by reference.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
34b2a83b84 gpu_session: add notes to interface
Describe differences for Intel and Lima (Mali) based GPUs.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
f1bc791c22 gpu_session: rename Gpu::Virtual_address:va
rename 'va' into 'value' to stay consistent with other types.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
d10c7c31a4 black_hole: adjust to VRAM GPU session interface
issue #4713
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
Sebastian Sumpf
56e7e2ad53 libdrm/lima+etnaviv: adjust to VRAM GPU session interface
Keep buffer abstraction by mapping one buffer to one VRAM object.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
47f1eaac2a gpu/intel: add VRAM support
Remove buffer abstraction and replace it by VRAM objects.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
f72cb2b69b ibdrm/iris: add VRAM support
Allocate 16MB or larger chunks and implement buffer abstraction for Iris
which possible share VRAM.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
23b87929f5 libdrm/iris: remove unsused functions
* 'map_buffer', GTT mappings are currently not used by Iris
* 'set_tiling', tiling is currently not used by Iris because there are
  no GTT mappings

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
3260c86d15 gpu_session: VRAM interface
Change the abstraction from buffers to video RAM (VRAM). The notion of
buffers can be provided at the client side (e.g., Mesa) and multiple
buffers can be there be associated to one VRAM area, thus saving
resources (meta data overhead) when allocating many buffers. A VRAM area
can also be mapped to one single buffer as before for clients or drivers
that do not take advantage of this feature.

issue #4713
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
13453e3c68 hw: activate strict conversion checking in kernel
Fix genodelabs/genode#4753
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
da0dbd901c base: fix conversion error in Bitset_2::get()
Ref genodelabs/genode#4753
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
0212f94809 hw: eliminate -DNR_OF_CPUS, use constant instead
Fix genodelabs/genode#4752
2023-02-27 08:22:48 +01:00
Norman Feske
1d5fc3ef60 sculpt/depot: remove depot user trimpim
Fixes #4754
2023-02-27 08:22:47 +01:00
Norman Feske
c10904967b core: improve coding-style consistency 2023-02-27 08:22:47 +01:00
Martin Stein
5bdc88bf57 base-hw scheduler: sanitize access to invalid head
Issue #4755
2023-02-27 08:22:47 +01:00
Alexander Boettcher
c8cf33a251 sel4: flush vm pages on out of index pressure
re-create semantic as done before commit

"core: kernel-agnostic 'Mapping' type"

Issue #4751
2023-02-27 08:22:47 +01:00
Alexander Boettcher
d089e80906 sel4: handle non pagefault exceptions
by checking for it in core, submitting a signal (if registered) and not
replying instantly. Before this commit, an exception (a non page fault)
caused and endless "unknown exception" loop between originator and core.

This was handled before commit "core: kernel-agnostic 'Mapping' type" by
throwing an exception, which was with that commit not working anymore.

Fixes #4751
2023-02-27 08:22:47 +01:00
Sebastian Sumpf
79d389d812 base/ld: only assign .dynamic to the PT_DYNAMIC segment
Segment assignment stays valid for all sections following .dynamic,
which implies that .got and co also end up in the PT_DYNAMIC segment.
This is not intended.  Therefore, we move the .dynamic section before
bss and assign bss to the rw PT_LOAD segment only.

fixes #4750
2023-02-27 08:22:47 +01:00
Norman Feske
62af32270b depot: remove empty config from pkg/nano3d
This allows for routing the nano3d config to a ROM services like
dynamic rom.
2023-02-27 08:22:47 +01:00
Norman Feske
291beb1145 depot: recipe for pkg/dynamic_rom 2023-02-27 08:22:47 +01:00
Norman Feske
dbf02ac3c1 depot: add runtime pkg for cpu_load_display 2023-02-27 08:22:47 +01:00
Norman Feske
6e20ffb990 gems: simple oscilloscope for audio input 2023-02-27 08:22:47 +01:00
Norman Feske
fa167bcdc4 gems: screenshot trigger for virtual print button
The screenshot trigger displays a little red dot at the upper-left
corner of the screen. When touched or clicked-on, it generates an
artificial key-press-release sequence for the print key and disappears
for one second. In this time, a separate screenshot component can handle
the print key by capturing the screen without the red dot appearing in
the saved picture.
2023-02-27 08:22:47 +01:00
Norman Feske
d26770eb40 gems/gui_buffer.h: grammar fix in comment 2023-02-27 08:22:47 +01:00