Commit Graph

2306 Commits

Author SHA1 Message Date
Johannes Schlatow
7a042925fc platform: catch denied IO_MEM-session
In case core denies an IO_MEM session, the platform driver should
survive and hand out an invalid capability instead.

genodelabs/genode#5174
2024-04-12 15:08:01 +02:00
Christian Helmuth
fd5f8c0ee1 fb_sdl: filter key-repeat events (fixes #5172) 2024-04-12 15:08:00 +02:00
Josef Söntgen
b2a68211a4 black_hole: add Play and Record session
This commit introduces support for the Play and Record session to
the black hole component in the most minimal way possible.

Fixes #5157.
2024-04-12 15:08:00 +02:00
Josef Söntgen
ff728eb6ce usb_block: fix 'Request_sense_repsonse' MMIO size
Due to a bug in the original implementation, the size of the MMIO
range covering the 'Request_sense_response' data was set too large
during the MMIO boundary change. This rendered devices that were not
yet ready and required an 'Request_sense' command unusable.

The commit also adapts all other commands where the MMIO size does
not match the expected one.

Fixes #5133.
2024-04-12 15:00:44 +02:00
Alexander Boettcher
d0d9cb6a73 uplink: support batching in client base header
Add support for Uplink drivers to batch requests.

Fixes #5149
2024-04-12 15:00:43 +02:00
Stefan Kalkowski
7ec08af6d9 usb: session renewal & new client API
Replace the USB session API by one that provides a devices ROM only,
which contains information about all USB devices available for this client,
as well as methods to acquire and release a single device.

The acquisition of an USB device returns the capability to a device session
that includes a packet stream buffer to communicate control transfers
in between the client and the USB host controller driver. Moreover,
additional methods to acquire and release an USB interface can be used.

The acquisition of an USB interface returns the capability to an interface
session that includes a packet stream buffer to communicate either
bulk, interrupt, or isochronous transfers in between the client and the
USB host controller driver.

This commit implements the API changes in behalf of the Genode C API's
USB server and client side. Addtionally, it provides Usb::Device,
Usb::Interface, and Usb::Endpoint utilities that can be used by native
C++ clients to use the new API and hide the sophisticated packet stream API.

The adaptations necessary target the following areas:

* lx_emul layer for USB host and client side
* Linux USB host controller driver port for PC
* Linux USB client ports: usb_hid_drv and usb_net_drv, additionally
  reduce the Linux tasks used inside these drivers
* Native usb_block_drv
* black_hole component
* Port of libusb, including smartcard and usb_webcam driver depending on it
* Port of Qemu XHCI model library, including vbox5 & vbox6 depending on it
* Adapt all run-scripts and drivers_interactive recipes to work
  with the new policy rules of the USB host controller driver

Fix genodelabs/genode#5021
2024-04-12 12:57:30 +02:00
Christian Prochaska
7ae7b8481a monitor: send a notification when an inferior vanished
Fixes #5139
2024-04-12 12:57:28 +02:00
Norman Feske
913196e2dc record_play_mixer: smoothen time-window allocation
This patch modifies the mixer's time window allocation by modelling the
drift of the period length over time. This yields a much better
stability of the detected sample rates in the presence of jitter.

Issue #5132
2024-04-12 12:57:28 +02:00
Christian Prochaska
3dbe398252 test-monitor: increase buffer size
Issue #5137
2024-04-12 12:57:28 +02:00
Christian Prochaska
d1a750c528 monitor: make maximum GDB response size configurable
Fixes #5137
2024-04-12 12:57:28 +02:00
Christian Prochaska
011a521968 os: make 'terminal_crosslink' buffer size configurable
Fixes #5135
2024-04-12 12:57:27 +02:00
Alexander Boettcher
32cb245cb8 ahci: enable conversion error checking
Fixes #5134
2024-04-12 12:55:39 +02:00
Christian Helmuth
706e341d3a trace_logger: read 'buffer' as Number_of_bytes 2024-03-04 15:50:03 +01:00
Christian Prochaska
ea51f1ffda monitor: limit the 'm' command response size
Fixes #5119
2024-02-28 16:31:46 +01:00
Christian Prochaska
aa6f99b0a4 monitor: report all stopped threads on '?' command
Fixes #5120
2024-02-28 16:31:46 +01:00
Alexander Boettcher
12df9bf450 gpu/intel: make aperture configurable
Fixes #5124
2024-02-28 16:31:46 +01:00
Alexander Boettcher
77f5ef3bcd nvme: release device before suspend
- monitor system ROM changes
- stop processing of new Jobs before suspend
- destruct platform device before suspend, but keep platform DMA buffers
- re-construct platform device and reinit resources (mmio, irq) on resume
- re-start block job scheduling on resume

Fixes #5101
2024-02-28 16:31:46 +01:00
Alexander Boettcher
9d15735bc6 ahci: release device before suspend
- monitor system ROM changes
- stop processing of new Jobs before suspend
- destruct platform device before suspend, but keep platform DMA buffers
- re-construct platform device and reinit resources (mmio, irq) on resume
- re-start block job scheduling on resume

Issue #5101
2024-02-28 16:31:46 +01:00
Alexander Boettcher
cde4d4aee0 ahci: refactor code for suspend/resume
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 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.

Issue #5101
2024-02-28 16:31:46 +01:00
Alexander Boettcher
bf6c484c13 gpu/intel: use with(fn, fn_error) pattern
Issue #5081
2024-02-28 16:31:45 +01:00
Alexander Boettcher
0684101ff0 gpu/intel: release device before suspend
- monitor system ROM changes
- stop processing of new Jobs before suspend
- destruct platform device before suspend, but keep platform DMA buffers
- re-construct platform device and reinit resources (mmio, irq) on resume
- re-start GPU job scheduling on resume

Fixes #5081
2024-02-28 16:31:45 +01:00
Norman Feske
07669ac991 os: record-and-play session interfaces and mixer
- New session interfaces:
  - os/include/play_session   (for audio playing   / mic-input driver)
  - os/include/record_session (for audio recording / audio-output driver)
- Mixer at os/src/record_play_mixer providing both play and record services
- Simple waveform player at os/src/app/waveform_player
- Simple audio-signal capturing component at os/src/app/record_rom
- Simple oscilloscpe at gems/src/app/rom_osci (using record_rom)
- Simple test-audio_play for playing raw stereo f32 data

The _gems/run/waveform_player.run_ script illustrates the use of the new
components and interfaces.

Issue #5097
2024-02-28 16:31:45 +01:00
Christian Prochaska
080d3b6b63 vfs: support watch handlers on application signal level
Fixes #4092
2024-02-26 08:59:10 +01:00
Christian Prochaska
7651c94bf5 os: add test for 'Genode::Path'
Issue #5106
2024-02-26 08:59:10 +01:00
Sebastian Sumpf
f86cd6899c ahci: add port count vs. ports implemented check
Check if controllers port count matches number of ports found in the
port implemented register. In case counts don't match print a diagnostic
message for debugging purposes.

issue #4081
2024-02-26 08:59:09 +01:00
Christian Helmuth
a0e0000108 genode_c_api/event: absolute-motion events
Absolute motion events are generated by "tablet" devices, e.g., Qemu
usb-tablet and IP-KVM appliances like PiKVM.

Issue #5105
2024-02-26 08:59:09 +01:00
Christian Helmuth
5f2691a65b event_filter: transformation of motion coordinates
The <transform> filter configurably transforms touch and absolute-motion event
coordinates by a sequence of translation (move), scaling, rotation, and flipping
primitives in sub-nodes.

Issue #5105
2024-02-26 08:59:09 +01:00
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
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
Christian Prochaska
602f9b5670 monitor: remove 'flush_thread()' error message
Fixes #5082
2024-02-26 08:31:03 +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
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
e2d1888f52 trace_logger: priority config attr in config.xsd 2023-12-13 12:28:05 +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
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
2d48e209f4 fb_sdl: fix build on 64-bit ARM Linux 2023-11-28 14:44:29 +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
Norman Feske
0f686a774d list_model.h: retire 'update_list_model_from_xml'
This transition vehicle to the modern interface has now been replaced by
the new 'List_model::update_from_xml' method.

Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
b7b74e62a0 platform driver: don't copy list-model elements
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
50d0a1b8f9 vmm: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
672b03f553 pci_decode: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Norman Feske
df71cecc66 drivers/platform: use modern list-model interface
Issue #4317
2023-11-28 14:24:24 +01:00
Stefan Thöni
1895931918 pci_decode: parsing TPM2 table
issue gapfruit#1938

Fixes genodelabs/genode#5042
2023-11-28 14:24:24 +01:00
Alice Domage
132e027c69 os/include/net: add support for the DNS protocol
Issue genodelabs/genode#5003
2023-11-28 14:24:23 +01:00
Alexander Boettcher
58a420511c nic_router: show offered IPs
If verbose_domain_state is enabled, the server logs detailed information
about the DHCP offer.
2023-11-28 14:24:23 +01:00
Johannes Schlatow
392ed76344 nvme_drv: arch-specific Dma_buffer allocation
Different cacheability properties should be applied dependent on the
target architecture.

genodelabs/genode#5000
2023-11-28 14:24:23 +01:00
Johannes Schlatow
25ad0ad530 nvme_drv: remove unused Dma_allocator
genodelabs/genode#5000
2023-11-28 14:24:23 +01:00
Johannes Schlatow
0cf2b1be89 gpu/intel: use CACHED dma buffers
On x86, DMA buffers are actually always mapped as cached. We should
therefore actually ask for a cached buffer in order to avoid confusion.

genodelabs/genode#5000
2023-10-26 15:29:39 +02:00
Christian Helmuth
e88e3680aa genode_c_api: remove global-static constructors
The execution of global-static constructors in Genode is optional for
native components or determined in the libc for libc components. By
convention, we avoid static constructors wherever possible but in rare
cases the component can tweak the point when constructors are executed
and initialize an environment beforehand. The wifi_drv applies this
pattern for the uplink initialization, but is a libc component on the
other hand, and, thus, statics in the Genode C API for uplink are
constructed later by the libc. So, the prior initialization is reverted,
i.e. the signal-handler capability becomes invalid.

This addresses a regression exposed by the following commit.

  drivers/wifi: perform multi-staged construction

Related to #3509
Fixes #5024
2023-10-25 08:58:53 +02:00
Christian Prochaska
aea90dc7da hw: fix vmm_arm test on arm_v8a
Fixes #4975 regression
2023-10-04 13:22:08 +02:00
Christian Prochaska
7731e02a20 monitor: remove terminal write busy loop
Fixes #5011
2023-10-04 13:22:07 +02:00
Benjamin Lamowski
558a00138c vmm: rename State to Vcpu_state for clarity
Rename locally extended VCPU state from State to Vcpu_state for clarity.
The local namespace only adds two accessor methods, which does not
justify a local generic name.

Ref #4968
2023-10-04 13:22:07 +02:00
Benjamin Lamowski
0e49149a46 base-hw: rename Vm_state to Vcpu_state
Make naming across architectures coherent by renaming Vm_state to
Vcpu_state, to reflect that it contains the state of a Vcpu and not that
of an entire VM.

Ref #4968
2023-10-04 13:22:07 +02:00
Christian Prochaska
149a0183ec monitor: fix 'vCont?' command response
Fixes #5010
2023-10-04 13:22:07 +02:00
Alexander Boettcher
916bd88e5e base: extend PD session by system_control_cap
Per Affinity::Location a system control cap can be requested. The capability
provides an RPC interface to request and set Cpu_state, as provided by the
former Pd::managing_system(Cpu_state) method. Invocation of those system
control capabilities then *can* (see below) be executed on the desired CPU
as described by Affinity::Location.

The system control cap will be invalid for kernels that don't support
system_control/managing_system functionality at all.

The system control cap will be ever by the same, e.g. ignoring the
Affinity::Location parameter, if the used kernel doesn't support or doesn't
require the feature to execute the system control per CPU.

The commit is a preparation step to add guarded and selective x86 MSR
access per CPU.

Fixes #5009
2023-10-04 13:22:07 +02:00
Christian Prochaska
d77cb2b1fc monitor: add 'qXfer:memory-map:read' command`
Fixes #5004
2023-10-04 13:22:06 +02:00
Robin Eklind
d3d822cd9d fb_sdl: refactor to only construct window once
In SDL2, support has been added for multiple windows.

As such, prior to this commit, invoking _sdl_screen.construct
would create a new window each time the original window was
resized.

To avoid this, refactor to only construct the window once, and
upon resize events, reconstruct the SDL_Surface and SDL_Texture
of Sdl_screen to the new window dimensions.

Issue identified by @chelmuth in https://github.com/genodelabs/genode/pull/4993#issuecomment-1729530634

Fixes #4993
2023-10-04 13:22:05 +02:00
Robin Eklind
3e68b07db0 fb_sdl: fix handling SDL_WINDOWEVENT_RESIZED
Issue #4993
2023-10-04 13:22:05 +02:00
Robin Eklind
9799adda79 fb_sdl: update to use sdl2
Following the official migration guide of SDL [1], the
fb_sdl framebuffer driver was update from SDL1 to SDL2.

The sdl2 port in world/src/lib/sdl2 is used.

Since SDL1 is in maintenance mode [2], support for other
display servers than X11 will never be implemented. In
particular, support for Wayland is missing from SDL1.

Fortunately, a port of sdl2 is maintained in genode-world.

As SDL2 is actively developed, it will provide support for
modern hardware architectures, and has mature support for
Wayland [3].

[1]: https://wiki.libsdl.org/SDL2/MigrationGuide
[2]: https://wiki.debian.org/Wayland#SDL1_.28unsupported.29
[3]: https://wiki.debian.org/Wayland#SDL2_.28supported_since_2.0.2.2B-.29

Issue #4993
2023-10-04 13:22:05 +02:00
Benjamin Lamowski
5abd2dddb8 tz_vmm: port to new VMM library API
Ref #4968
2023-10-04 13:22:05 +02:00
Christian Helmuth
12fc9a0fbb trace_logger: log priority of trace subject
Optionally log thread priority with

  <config priority="yes" ...> ... </config>

The commit also applies a cleanup of format calculations.
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
cfab4e74a9 vmm: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Benjamin Lamowski
7e79128c03 vmm_x86: port to new VMM library API
Ref #4968
2023-10-04 13:22:04 +02:00
Norman Feske
458206b11a monitor: apply affinity to monitored children
Fixes #4996
2023-09-29 12:17:45 +02:00
Sebastian Sumpf
f9e70b0300 genode_c_api/event: add wheel events
issue #4958
2023-09-29 12:15:06 +02:00
Sebastian Sumpf
c5a55e5af4 genode_c_api/usb_client: API USB clients
Through this API C-code can connect to an USB service.

issue #4958
2023-09-29 12:15:06 +02:00
Johannes Schlatow
119f679278 fs_report: handle WRITE_ERR_WOULD_BLOCK
A WRITE_ERR_WOULD_BLOCK may occur when large reports are written to a file
system because this fills up the submit queue of the packet-stream interface.

Fixes genodelabs/genode#4988
2023-09-29 12:15:05 +02:00
Christian Prochaska
8a279855ff cleanup file permissions
Fixes #4983
2023-08-23 13:46:37 +02:00
Christian Prochaska
7000fb8642 monitor: add more debugging features
Fixes #4977
2023-08-23 13:46:37 +02:00
Christian Prochaska
48e6468df1 os: support UART drivers in board-specific repositories
Fixes #4973
2023-08-21 08:12:01 +02:00
Alexander Boettcher
c88e6bb81d gpu/intel: fix disable invocation in fw_disable
Erroneous enable was used
2023-08-21 08:12:01 +02:00
Martin Stein
9a94fbb1ec ping: align dhcp client more with nic_router again
The DHCP client implementations of Ping originally is a copy of the NIC router
implementation adapted for Ping. The two versions diverged further over the
years. This issue should be solved by should merging them into a centralized
implementation. However, this commit treats only a recent issue with the
nic_uplink.run test on pbxa9 qemu but does this by re-aligning the two
implementations partially. The final merge should be done in a separate commit.

Ref #4966
2023-08-21 08:12:01 +02:00
Martin Stein
c23491ef3c nic_uplink: connect a Nic to an Uplink session
* Adds a new component server/nic_uplink that forwards packets unmodified
  between one Uplink session at one side and potentially multiple Nic sessions
  at the other side.
* Adds a new run script nic_uplink.run that does a basic test with multiple
  Nic clients on this component and adds it to the autopilot list.
* Adds a new depot recipe src/nic_uplink for this component.
* Adds a new depot recipe pkg/pc_nic for deploying the pc_nic_driver together
  with a nic_uplink server. This allows for raw access to the network connected
  to the Nic of the system in contrast to the commonly used routed and NAT'd
  access via NIC router. That said, it enables the use of network protocols
  not yet supported by the NIC router at the cost of less protection.

Ref #4966
2023-08-21 08:12:00 +02:00
Martin Stein
4c4962b306 nic_router: clean-up session creation with class
Introduces a new class that does the clean-up if some exception is
thrown while creating the session. This reduces redundancy and overall
lines of code.

Ref #4966
2023-08-21 08:11:37 +02:00
Norman Feske
5ca6dd10f8 monitor: forward priority session argument
This change allows a monitored VBox instance to specify a distinct
(lower) priority to the VM session to ensure that the VMM is always
prioritized higher than the VCPUs. This is important because host
I/O at the VMM should always be able to preempt a busy guest.

Issue #4917
2023-07-14 12:06:32 +02:00
Martin Stein
647631af09 test/timeout: revert use of memory barriers
The memory barriers where introduced with commit "test-timeout: fix build
errors with -std=gnu++20" presumably in order to prevent GCC optimization from
removing the empty for loops the test is using because using a volatile index
variable was no longer an option.

However, the memory barriers seem to have a negative effect on the measurements
performed with the affected loops. The commit caused the timeout test to fail
at least on imx53_qsb.

This commit fixes the issue by using a simple empty for loop without volatiles
or memory barriers but protected inside a function that is compiled with
optimization disabled.

Ref #4959
2023-07-14 12:06:32 +02:00
Norman Feske
3af5a0ca4e monitor: intercept VM session
This is needed to translate the thread capability argument of
'Vm_session::create_vcpu'.

Issue #4917
2023-07-14 12:06:32 +02:00
Norman Feske
8463f4910a nitpicker: improve activity reporting
Nitpicker's hover and focus reports contain an 'active' attribute, which
can be inspected for the detection of user activity, e.g., as trigger
for a screensaver or for dynamic clipboard policies.

When using the 'Event' session, the reporting code updated the reports
only on incoming events. This patch adds the periodic reporting as used
when using the old 'Input' session.

Issue #4950
2023-07-14 12:06:32 +02:00
Josef Söntgen
70c57a3be3 pci_decode: calculate 64bit BAR size
Issue #4949.
2023-07-14 12:06:32 +02:00
Christian Prochaska
02209e5455 monitor: add memory write support
Fixes #4947
2023-07-14 12:06:32 +02:00
Stefan Kalkowski
13e0710d20 os: remove i.MX GPIO drivers
Ref genodelabs/genode#4945
2023-07-14 12:06:31 +02:00
Christian Prochaska
5a2d4c3437 monitor: apply 'wx' policy
Fixes #4943
2023-07-14 12:06:31 +02:00
Josef Söntgen
1d82a049bf nvme: address conversion warnings
This commit removes the CC_CXX_WARN_STRICT_CONVERSION suppressor
and address the resulting warnings.

Fixes #4935.
2023-07-14 12:06:31 +02:00
Christian Prochaska
59ce64b638 monitor: handle Monitored_thread case in kill_thread()
Fixes #4934
2023-07-14 12:06:31 +02:00
Christian Helmuth
2232b33b8e pci_decode: limit bus parsing to subordinate buses
While this approach still scans "holes" in the bus range, it stops
scanning at the maximum subordinate bus number reachable from the base
PCI bus at the host bridge. Startup under Qemu no longer takes about 12
seconds for scanning 256 buses.
2023-07-14 12:06:31 +02:00
Stefan Kalkowski
098bc66fc9 usb genode_c_api: reduce config report updates
Prevent unnecessarty config report updates, if a new USB device gets reported.

Fix genodelabs/genode#4929
2023-07-14 12:01:19 +02:00
Martin Stein
434a4db637 lib/net: no color coding in packet print methods 2023-07-14 12:01:18 +02:00
Martin Stein
bf18ffbbdd lib/net: enable strict warnings
Enables strict warnings in the net lib and fixes all related compile errors.

Fixes #4924
2023-07-14 12:01:18 +02:00
Christian Helmuth
98cbfa3561 genode_c_api: MAC address reporter utility
Issue #4918
2023-06-16 11:24:26 +02:00
Norman Feske
6a57683e52 New debug monitor
The new monitor component at os/src/monitor is the designated successor
of the gdb_monitor. This initial version, however, implements only the
subset needed to inspect the memory of the monitored component(s).

In contrast to the gdb_monitor, the new component supports the monitoring
of multiple components, leveraging the sandbox API. It can therefore be
used as a drop-in replacement for the init component. Like the gdb_monitor,
the new monitor speaks the GDB protocol over Genode's terminal session.
But the protocol implementation does not re-use any gdbserver code,
sidestepping the complexities of POSIX.

There exist two run scripts illustrating the new component. The
os/run/monitor.run script exercises memory inspection via the 'm' command
by letting a test program monitor itself. The os/run/monitor_gdb.run
script allows for the interactive use of GDB to interact with monitored
components.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
65f65073e6 sandbox: allow supplemental config nodes
Let the sandbox library disregard all unknown config sub nodes so that
supplemental information - like the monitor policy configuration - is
not interpreted as a misconfiguration ("unknown config element type ...").

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
add6dbac4e sandbox: add Pd_intrinsics::start_initial_thread
This hook allows for intercepting the creation of initial threads
whenever a new child is started.

Issue #4917
2023-06-16 11:24:26 +02:00
Norman Feske
f2153f9b2f sandbox: allow for customized PD access
By default, the sandbox uses the Env::pd() as reference PD session of
the sandbox children.

However, to accomodate use cases where the interplay of the reference
PD session and the child's address space needs to be intercepted, this
patch adds a constructor that takes an interface for the controlled
access of PD intrinsics as argument.

Issue #4917
2023-06-16 11:24:26 +02:00
Sebastian Sumpf
e3c2fdf414 gpu/intel: enable GPU reset for GEN(8)/9/12
* add semaphore command to ring in order to be able to stop ring
  execution before reset (Wa KabyLake)
* implement reset sequence as done by the Linux driver
* reset ring and cancel job of vgpu causing hang
* lower watchdog timeout 1000ms -> 200ms
* improve scheduling of vgpus so progress after reset is made
* improve the generation chaos a little
* tested on Skylake, Kaby Lake, Tiger Lake

issue #4916
2023-06-16 11:24:26 +02:00
Christian Helmuth
d6f65901f9 Add trace policy binary to BUILD_ARTIFACTS 2023-05-30 17:00:01 +02:00
Stefan Kalkowski
5253d4ddd7 platform_drv: dissolve shared irq session
Fix genodelabs/genode#4912
2023-05-30 16:32:22 +02:00
Josef Söntgen
0e82322605 pci_decode: force GSI for ath9k device
As noted in 'wifi/pc: add ath9k driver' it appears the tested device
only works with GSIs.

Issue #4861.
2023-05-30 12:03:33 +02:00
Johannes Schlatow
b558cd18d4 platform_drv: make Device_pd a Io_mmu::Domain
By transforming the Device_pd into an Io_mmu::Domain, we implement an
IOMMU device that uses the kernel API for controlling the IOMMU. This
device gets special treatment and is used by default for every device
that has no <io_mmu/> child.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
9b5944b90c platform_drv: use IOMMU devices
Every session component manages a registry of Io_mmu::Domain objects
that it creates on demand depending on the acquired devices (i.e. the
IOMMU devices referenced by the acquired devices). Via the domain
objects, a session component adds/removes the address ranges of the
allocated DMA buffers. Additionally, domain objects provide an interface
for enabling/disabling pci devices.

Domain objects get destroyed with the corresponding control device.
Moreover, on devices/policy ROM updates, domain objects of control
devices that are not referenced by any acquired device anymore get destroyed.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
d3357b4c53 platform_drv: propagate IOMMU devices to session
genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
b2e4f95f27 platform_drv: add <io_mmu> to devices ROM
This allows referencing an arbitrary number of IOMMU devices within a
<devices> node, e.g.:

<device>
  <io_mmu name="foobar"/>
</device>

The specified name is supposed to refer to an existing device in the
devices ROM. The platform driver automatically acquires known IOMMU
devices whenever they become available so that the device object can be
looked up from the platform-driver-owned devices.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
f2e63bdd64 platform_drv: add IOMMU devices to common
With this change, platform-specific code is able to define factories that
acquire IOMMU devices to be used by the platform driver.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
f98466430f platform_drv: don't restrict ownership to session
This is a prerequisite for letting the platform driver acquire control devices.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Johannes Schlatow
3520492f09 platform_drv: fix update_policy()
The method did not handle device changes properly. When a new policy
does not contain an owned device any more, we must consider this device
as changed and release it.  Moreover, the warning messages were interchanged.

genodelabs/genode#4761
2023-05-30 12:03:32 +02:00
Christian Helmuth
f8bcb1999e lan9118: fix build errors with -std=gnu++20
Issue #4827
2023-05-30 12:03:31 +02:00
Christian Helmuth
c35714dc81 genode_c_api: fix build errors with -std=gnu++20
Issue #4827
2023-05-30 12:03:31 +02:00
Christian Helmuth
f5477dc53b part_block: fix build errors with -std=gnu++20
Fixes #4876
2023-05-30 12:03:31 +02:00
Christian Prochaska
c3b53bc2ec test-timeout: fix build errors with -std=gnu++20
Fixes #4899
2023-05-30 12:03:31 +02:00
Christian Prochaska
49f835db86 test-slab: fix build error with -std=gnu++20
Fixes #4893
2023-05-30 12:03:31 +02:00
Christian Prochaska
7f170e492e mixer: fix build errors with -std=gnu++20
Fixes #4889
2023-05-30 12:03:30 +02:00
Christian Prochaska
c4810c5db4 virtio_pci_nic: fix build errors with -std=gnu++20
Fixes #4888
2023-05-30 12:03:30 +02:00
Christian Helmuth
058990de48 pc/uart: fix build errors with -std=gnu++20
Fixes #4885
2023-05-30 12:03:30 +02:00
Christian Prochaska
b696439a67 intel_gpu_drv: fix build errors with -std=gnu++20
Fixes #4883
2023-05-30 12:03:30 +02:00
Christian Prochaska
74734b7dd9 vfs_tap: fix build errors with -std=gnu++20
Fixes #4882
2023-05-30 12:03:30 +02:00
Sebastian Sumpf
ae19ab0cff gpu/intel: remove vgpus from schedule before destruction
When a GPU session is destroyed, remove vgpu of session from scheduling
and as possible active vgpu. Otherwise, page faults might occur in case
already destroyed vgpu object is referenced during interrupt handling.

fixes #4881
2023-05-30 12:03:29 +02:00
Christian Helmuth
37d1855907 lx_fs: fix build errors with GCC 12
/data/genode/repos/os/src/server/lx_fs/directory.h: In member function ‘virtual Genode::size_t Lx_fs::Directory::read(char*, Genode::size_t, File_system::seek_off_t)’:
/data/genode/repos/os/src/server/lx_fs/directory.h:224:53: error: ‘dent’ may be used uninitialized [-Werror=maybe-uninitialized]
  224 |                                 .type  = type(dent->d_type),
      |                                               ~~~~~~^~~~~~
/data/genode/repos/os/src/server/lx_fs/directory.h:197:40: note: ‘dent’ was declared here
  197 |                         struct dirent *dent;
      |                                        ^~~~

Issue genodelabs/genode#4827
2023-05-30 12:03:28 +02:00
Christian Helmuth
d0578700bc test-cache: fix build errors with GCC 12
error: ‘void operator delete(void*, Genode::Deallocator&)’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]

Issue #4827
Fixes #4848
2023-05-30 12:03:27 +02:00
Norman Feske
8c9ca0e7a9 nitpicker: fix gcc build error
An early version of nitpicker used a pointer as 'owner' with the null
pointer representing nitpicker's built-in views, which are nowadays
represented by 'Main::_global_view_ower'. The null-pointer check is a
left-over from the earlier days.

Fixes #4847
2023-05-30 12:03:27 +02:00
Norman Feske
a2832995d0 Remove long unused kdb_uart_drv for fiasco and foc
Removed in the context of issue #4860.
2023-05-30 12:03:26 +02:00
Norman Feske
f119d9ee8b base: use [build_artifacts] in run scripts
The patch also removes a few legacies along the way, unifies the coding
style, and cuts back superfluous comments.

Issue #4860
2023-05-30 12:03:26 +02:00
Alexander Boettcher
2a0e45d0f7 log_core: limit buffer to max log string
Fixes #4853
2023-05-30 12:03:26 +02:00
Christian Helmuth
d9643b61af acpi_drv: count only memory allocated by new()
Fixes #4844
2023-05-30 12:03:26 +02:00
Christian Prochaska
901cbf0af3 sd_card_drv: fix build errors with gcc 12
Fixes #4851
2023-05-30 12:03:26 +02:00
Christian Prochaska
b96004fd71 nvme_drv: fix build errors with gcc 12
Fixes #4845
2023-05-30 12:03:26 +02:00
Christian Prochaska
c2aacfa9c4 vfs: fix build error with gcc 12
Fixes #4839
2023-05-30 12:03:25 +02:00
Josef Söntgen
bcc454aa89 drivers/usb_block: treat SYNC as barrier
The commit implements the SYNC and TRIM as successful NOP, while
the former is handled as an barrier to all other out-standing
requests.

Fixes #4825.
2023-05-08 15:55:34 +02:00
Josef Söntgen
280724e6b5 nvme_drv: read proper FLBAS value
Bit 0:3 indicate which of the (up to) 16 supported LBA formats is
used for this namespace. Instead of only looking at those bits the
driver looked at the complete 0:7 bits. Those, however, also include
information on how metadata may be transferred. That leads to using
the wrong index for reading the LBA format.

Fixes #4832.
2023-05-08 15:53:13 +02:00