Commit Graph

3081 Commits

Author SHA1 Message Date
Christian Helmuth
7304a019e7 event_filter: <log motion="true"> attribute
Per default, only key presses and releases are logged. The optional
'motion' attribute (boolean) enables logging of motion and touch events.

Issue #5105
2024-02-26 08:59:09 +01:00
Christian Prochaska
0bc2e240bf monitor: always respond to qXfer:memory-map:read
Fixes #5109
2024-02-26 08:59:08 +01:00
Sebastian Sumpf
240819b708 black_hole: add support for Uplink client
The uplink client simply drops and acknowledges packets it receives.

issue #5104
2024-02-26 08:59:08 +01:00
Martin Stein
1336b0a751 mmio: upper-bounds checks
The classes Genode::Mmio, Genode::Register_set, Genode::Attached_mmio, and
Platform::Device::Mmio now receive a template parameter 'size_t SIZE'. In each
type that derives from one of these classes, it is now statically checked that
the range of each Genode::Register::Register- and
Genode::Register_set::Register_array-deriving sub-type is within [0..SIZE).

That said, SIZE is the minimum size of the memory region provided to the above
mentioned Mmio classes in order to avoid page faults or memory corruption when
accessing the registers and register arrays declared inside.

Note, that the range end of a register array is not the end of the last item
but the end of integer access that is used for accessing the last bit in the
last item.

The constructors of Genode::Mmio, Genode::Attached_mmio, and
Platform::Device::Mmio now receive an argument 'Byte_range_ptr range' that is
expected to be the range of the backing memory region. In each type that derives
from on of these classes, it is now dynamically checked that 'range.num_bytes
>= SIZE', thereby implementing the above mention protection against page faults
and memory corruption.

The rest of the commit adapts the code throughout the Genode Labs repositories
regarding the changes. Note that for that code inside Core, the commits mostly
uses a simplified approach by constructing MMIO objects with range
[base..base+SIZE) and not with a mapping- or specification-related range size.
This should be fixed in the future.

Furthermore, there are types that derive from an MMIO class but don't declare
any registers or register arrays (especially with Platform::Device::Mmio). In
this case SIZE is set to 0. This way, the parameters must be actively corrected
by someone who later wants to add registers or register arrays, plus the places
can be easily found by grep'ing for Mmio<0>.

Fix #4081
2024-02-26 08:59:07 +01:00
Pirmin Duss
55007f5bd9 i2c: bus speed configuration node
I2C EEPROMs of the type at24xxx are really slow (ca. 10 kHZ).

This adds the `bus_speed_khz` attribute to the config of the driver and
adapts the i.MX8 driver to support the feature.

Issue gapfruit#1996
Fixes genodelabs#5090
2024-02-26 08:31:05 +01:00
Norman Feske
0d34988929 test.run: remove obsolete boot-module heuristic
The ROMs of built executables and shared objects are now covered by the
[build_artifacts].

Issue #4860
2024-02-26 08:31:04 +01:00
Christian Helmuth
092e4a001f usb_hid: mode led handling to shadow input-leds.c
The former implementation relied on input drvdata always pointing to
struct hid_device, which is not true for Wacom touch devices (at least).
Now, we implement the input handler for devices providing LEDs
(evbit[EV_LED] set) only and use input_inject_event() to set the LED
states.
2024-02-26 08:31:04 +01:00
Alexander Boettcher
c2cd4102d8 gpu/intel: prepare GPU structures for resume
The commit is a preparation commit for suspend/resume. It prepares the GPU
structures relying on gmadr.cap() (MMIO) to be re-constructible by applying
the with* pattern to context, ring_buffer and ggtt mmio map. It removes
the managed dataspace handling of gmadr subsets to make the with_* pattern
possible.

Issue #5081
2024-02-26 08:31:03 +01:00
Alexander Boettcher
d02f4866ea gpu/intel: make platform resources reconstructible
This commit is a preparation commit for suspend/resume. The commit
refactors the code in order to consolidate all Platform resources into one
instance. All users within the GPU driver should access the resources with
with_* functions, which checks whether the device resource is usable. The
callers are not allowed to store any references to the provided resources.

With this change, it will be possible in follow up commits, to release
the platform device and to re-acquire it and its resources, e.g. mmio, irq,
gmadr.

Issue #5081
2024-02-26 08:31:03 +01:00
Norman Feske
87993a864c input/event.h: axis ids LX, LY, LT, RX, RY, and RT
The axis IDs correspond to 2x analog sticks with 2 axes and 2x triggers.
While being at it, the commit changes the Axis_id type to Axis::Id.

Fixes #3669
2024-02-26 08:31:03 +01:00
Christian Prochaska
602f9b5670 monitor: remove 'flush_thread()' error message
Fixes #5082
2024-02-26 08:31:03 +01:00
Christian Helmuth
4a2319a4d6 os: limit backtrace to stack of current thread
The frame-pointer-based backtrace does not work without enabling
-fno-omit-frame-pointer explicitly and in most cases leads to page
faults because non-pointer stack values are dereferenced during the
walk. The best we can do is to limit the backtrace walk to the stack of
the current thread to prevent page faults unrelated to the system state
without the use of the backtrace utility.

This commit introduces a printable Backtrace class usable in
Genode::log(), Genode::trace(), etc. The class is based on the new
function for_each_return_address(auto const &fn) that walks the stack in
its limits and calls fn() for each discovered return address on the
stack in the new os/include/os/backtrace.h. Archtecture-specific
stack-pointer retrieval and walk loops are implemented in dedicated
os/include/spec/<arch>/os/for_each_return_address.h files. Also, the
well-known Genode::backtrace() function (which logs the return-address
values) is provided for backwards compatibility.

Fixes #5078
2024-02-26 08:31:02 +01:00
Norman Feske
c4679e7af6 depot: update recipe hashes 2023-12-13 12:33:05 +01:00
Norman Feske
77b0e10e88 vfs/ram_file_system: deferred unlink
This patch changes the unlink operation of the ram fs to defer the
destruction of a file until it is no longer referenced by any VFS handle.
When unlinked, the file no longer appears in the directory. But it can
still be opened and accessed.

With this change, a parent process of a Unix-like subsystem becomes able
to pass the content of an unlinked file to a forked child process. This
mechanism is required when using the 'exec' command in Tcl scripts.

Another use case is the 'tmpfile()' function.

Fixes #3577
2023-12-13 12:33:05 +01:00
Norman Feske
cb74956d06 os/run/test.run: build libs listed in <content> 2023-12-13 12:33:05 +01:00
Norman Feske
713659cea5 test-trace: adjust rate of top passing tracepoints
The traced top instance was configured to be active every two seconds
whereas the trace test uses a grace time of only 1.5 seconds before
raising the FOREIGN state of a trace subject as an error.

The state of a trace subject can change only whenever the traced thread
passes a trace point. Hence, with the original configuration, the
release of top as trace subject can take up to two seconds. The patch
reduces the rate to 0.5 seconds to satisfy the expectation of
test-trace.
2023-12-13 12:33:05 +01:00
Christian Helmuth
636f5dda29 nic_router: specify ICMP Destination (host) unreachable
According to RFC 1812 ICMP Destination unreachable (Network unreachable)
does not quite our case of clients directly behind the router.

  If a packet is to be forwarded to a host on a network that is directly
  connected to the router (i.e., the router is the last-hop router) and
  the router has ascertained that there is no path to the destination
  host then the router MUST generate a Destination Unreachable, Code 1
  (Host Unreachable) ICMP message.

Issue #4729
2023-12-13 12:33:05 +01:00
Norman Feske
f57da7e645 trace: remove parent_levels session argument
The argument was originally designated to restrict the reach of the
trace monitor but the idea remained unimplemented. It is now superseded
by the use of the trace-session label as trace-subject filter.

Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
f66ce025d3 Adapt run scripts to trace-subject filtering
Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
bfe88307de core: filter trace subjects by TRACE session label
This patch changes core's TRACE service to expose trace subjects only if
their PD label matches the label of the TRACE monitor. Hence, by default,
a trace monitor can only observe itself and its child components. Only
if the trace monitor's parent rewrites the trace-session's label, the
view of trace monitor can become broader. For example, when rewriting
the trace label to an empty string "", the trace monitor becomes able to
observe the sibling components hosted in the same init instance as the
trace monitor.

To grant a trace session the special privilege of obtaining a global
system view (including the kernel's trace subjects), the top-level init
has to rewrite the session's label to an empty string. At core, this
specific label "init -> " is handled as a special case that discharges
the filtering/namespacing of trace subjects.

Note that the trace-subject label as reported as subject info is now
given relative to the label of the trace session. As a nice side effect
of this change, the pkg/test-trace_logger works now when executed by the
depot_autopilot as well as via the test.run script.

Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
66160e6bd3 os/run/test.run: adapt to changed runtime format
Issue #4922
2023-12-13 12:28:05 +01:00
Norman Feske
e2d1888f52 trace_logger: priority config attr in config.xsd 2023-12-13 12:28:05 +01:00
Christian Prochaska
2aeea45c30 os: build 'lib/ld' in 'monitor_gdb.inc'
Fixes #5068
2023-12-13 12:28:05 +01:00
Christian Helmuth
8baf19022c depot: update recipe hashes 2023-11-30 15:11:36 +01:00
Johannes Schlatow
1f1437747c platform_drv: don't copy Bdf
genodelabs/genode#5002
2023-11-30 14:22:54 +01:00
Johannes Schlatow
3f1e1323f0 pc/platform: enable IOMMU with default mappings
genodelabs/genode#5002
2023-11-30 14:22:54 +01:00
Johannes Schlatow
bc09ff7498 platform_drv: add default DMA mappings interface
genodelabs/genode#5002
2023-11-30 14:21:51 +01:00
Johannes Schlatow
c06b53e52e acpi_drv: add config for ignoring DMAR table
By not evaluating the DMAR table, we disable the IOMMU.

genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
196133c582 platform_drv: use guard pages for DMA buffers
genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
d018cb62f3 platform_drv: guard against Out_of_* exceptions
In the scope of alloc_dma_buffer(), Out_of_* exceptions might be thrown
at different stages. By adding a Guard object, we make sure to rollback
already created objects accordingly.

genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
350a3d9ae4 platform_session: increase RAM and CAP quota
As a consequence of the adding IOMMU support to the platform driver,
additional RAM and CAPs are needed for setting up IO page-table
structures.

genodelabs/genode#5002
2023-11-30 14:20:53 +01:00
Johannes Schlatow
855147a021 pc/platform: add intel IOMMU support
Add DMA remapping support for Intel devices to the platform driver.

genodelabs/genode#5002
2023-11-30 14:20:49 +01:00
Johannes Schlatow
70b1ae3d1b platform: move enable/disable_pci_device
genodelabs/genode#5002
2023-11-30 14:19:45 +01:00
Johannes Schlatow
eefaa07024 base: add irq_type session argument
By adding the `irq_type` argument, one can explicitly specify whether to
use LEGACY, MSI or MSI-X interrupts. We formerly used the
`device_phys_config` to implicitly select MSI, however, with the
addition of IOMMU support to the platform driver there is at least one
instance where we need an MSI for a non-PCI device.

Yet, by adding another session argument to the Irq session, we exceed
the character limit for session args. Since not all arguments are
relevant for LEGACY interrupts resp. MSI, we can split the Irq_connection
constructor to handle the two cases separately and omit unneeded
arguments.

genodelabs/genode#5002
2023-11-28 19:35:16 +01:00
Johannes Schlatow
a80464299a platform_drv: add phys_addr to add_range()
We need the physical address of a DMA range in order to insert it into
the translation table.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
0182e81b51 platform_drv: map actual DMA dataspace size
DMA buffer allocations are always performed as full pages. However, they
got mapped into the IOMMU domain using the requested size, which may not
be a multiple of the page size. This behaviour was introduced as a regression
by #4761 and is corrected by this commit.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
ae7e461452 platform_drv: move IOMMU domain destruction
Destruction of IOMMU domain should happen after the PCI device was
disabled in order to prevent faulty DMA transactions.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
d7b9cd0654 platform_drv: move add_range calls from base class
The virtual add_range()-method must not be called from the base-class
constructor since the derived class is not be fully initialized at
this point.

genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
022762605b pci_decode: add <irq/> to drhd devices
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
7c5b59556a pci_decode: add <iommu> node to devices
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
e816020346 pci_decode: add intel_iommu devices to devices ROM
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Johannes Schlatow
7b99a43c9e acpi_drv: add size attribute to drhd
genodelabs/genode#5002
2023-11-28 19:01:28 +01:00
Norman Feske
1e166c7236 Supplement the build of shared libs where needed
This is a follow-up commit to the adaptation of the run scripts to the
consistent use of [build_artifacts] (issue #4860).

The missing build of libm remained undetected until the recent removal
of implicit shared-library builds (issue #5061).
2023-11-28 14:44:29 +01:00
Norman Feske
2d48e209f4 fb_sdl: fix build on 64-bit ARM Linux 2023-11-28 14:44:29 +01:00
Johannes Schlatow
aa7058a3b4 test-read_only_rom: fix false positive
The test is rendered ineffective by a failed resource request.
2023-11-28 14:44:28 +01:00
Johannes Schlatow
00ede822c6 disable demo and fb_bench for zynq_usrp_e31x
genodelabs/genode#5056
2023-11-28 14:24:26 +01:00
Johannes Schlatow
cd34effd64 run/cpu_bench.run: add timeout for zynq_usrp_e31x
genodelabs/genode#5056
2023-11-28 14:24:26 +01:00
Christian Prochaska
5d9d3bff11 acpi_drv: detach dataspaces in 'Acpi::Memory'
Issue #5046
2023-11-28 14:24:26 +01:00
Christian Prochaska
4ecae91fc3 monitor: use a registry for the memory map
Issue #5046
2023-11-28 14:24:25 +01:00
Christian Prochaska
e309c38263 monitor: prevent overlapping region list entries
Issue #5046
2023-11-28 14:24:25 +01:00