Commit Graph

2306 Commits

Author SHA1 Message Date
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
Christian Helmuth
091db48843 vfs_block: warn only once if sync is not supported
Issue #4825
Issue #4820
2023-04-27 14:24:29 +02:00
Sebastian Sumpf
8f0a191c2a gpu/intel: comment for read execlist status
Adds a comment to the exec list status loop.

issue #4820
2023-04-26 16:23:13 +02:00
Alexander Boettcher
bdbfa532cd platform/x86: improve DMA memory alignment
If the DMA memory allocation alignment is unfortunate (not natural size
aligned), the IOMMU (AMD/INTEL) may not use larger(super) pages with effects
on the page table walk frequency and TLB caching.

Issue #4820
2023-04-26 16:22:16 +02:00
Alexander Boettcher
98a31bbfdb platform/x86: exclude special range from device_pd
Issue #4820
2023-04-26 16:12:52 +02:00
Sebastian Sumpf
bd58bd8279 gpu/intel: read execlist status multiple times (GEN < 12)
Before scheduling we check if the execlist is empty. When many clients
are present, the bits might not be cleared by hardware yet. Before the
watchdog timer would trigger, because we scheduled nothing. Now we try
serval times, even if this fails, we still schedule because in the worst
case only a preemption would happen.

issue #4820
2023-04-26 11:58:15 +02:00
Christian Helmuth
5cb06b5f1c platform_drv: document PCI device naming after BDF
Issue #4812
2023-04-26 11:58:14 +02:00
Norman Feske
a5eb198549 sandbox/init: report exit state immediately
This patch promotes the event of an exiting child to become immediately
reported, reducing delays for management components that watch the exit
status of children.

Fixes #4814
2023-04-26 11:58:14 +02:00
Christian Helmuth
684388e737 trace_logger: log scheduling-context execution time
Optionally log scheduling-context execution time in addition to the
thread-context. This may be relevant on kernel platforms that do not
schedule threads on their own CPU share only but implement some kind of
donation scheme, for example, NOVA.

Usage

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

Fixes #4805
2023-04-17 14:48:30 +02:00
Christian Helmuth
3c45f5c7ab usb: support 32 in-flight packets
- move metadata specific to isochronous transfers from the descriptor
  into the content of USB-session packets
- restore support for 32 in-flight packets in the USB C API

Fixes #4749
2023-04-17 14:48:23 +02:00
Christian Helmuth
217d59ce68 usb: use buffer type in C API
Also, some reasonable sanity checks of client-passed parameters were
added and for-int loops replaced by for-range loops where applicable.

Issue #4749
2023-04-17 14:48:23 +02:00
Josef Söntgen
25c8c0f9e9 nvme_drv: fix wrong identify length 2023-04-17 14:48:22 +02:00
Christian Helmuth
34db8f5360 Fix single-client handling in some block providers 2023-04-17 14:48:22 +02:00
Christian Helmuth
927d71ad59 part_block: modernize implementation
Fixes #4790
2023-04-17 14:48:22 +02:00
Christian Helmuth
082d1780cf nvme_drv: reduce state-change intervals
- probe changes of CSTS.RDY every 20 ms
- check admin-queue completion every 50 ms
2023-04-17 14:48:22 +02:00
Josef Söntgen
f7b910b298 part_block: split reporting from parsing
Previously the 'partitions' report was implicitly generated after
parsing the partition-table by accessing the referenced reporter
object.

Now the report is explicitly created by calling the 'generate_report'
member function. At this point we no longer have access to all
required information so the 'Partition' class was extended to
accommodate for the data needed by MBR as well as GPT reports.

Fixes #4786.
2023-04-17 14:48:22 +02:00
Sebastian Sumpf
40333a8ee2 gpu/intel: use _owner.cap during session destruction
'cap()' will return invalid capability within session destructor, therefore Vram
objects that belong to the session will not be destroyed, leading to danling
references later on. Use '_owner.cap' of session instead.
2023-03-15 17:05:35 +01:00
Stefan Kalkowski
61454178c0 vmm: support mode change in virtio gpu
Fix genodelabs/genode#4783
2023-03-13 17:01:32 +01:00
Stefan Kalkowski
cb3b6c4b88 vmm: distinguish virtio interrupts
VirtIO device models can assert interrupts to notify about
buffer and configuration changes. By now, we could only assert
buffer notification interrupts, but no configuration changes.
The latter is needed, e.g. to notify about GPU mode changes.

Ref genodelabs/genode#4783
2023-03-13 17:01:32 +01:00
Christian Helmuth
b609411e76 part_block: add partition type to log message 2023-03-13 14:32:53 +01:00
Josef Söntgen
9b9d1f4e12 part_block: use expanding reporter
Depending on the number of partitions the current fixed size of 4096
bytes might not be sufficient for the resulting partitions report.
The use of the expanding reporter allows for accomodating large reports
while still keeping the resource usage down for the common case of
few partitions (with potentially short names).

Fixes #4782.
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
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
50ee8dfaf8 Remove obsolete includes of base/snprint.h
Issue #2064
2023-03-13 14:32:53 +01:00
Norman Feske
ecd0066e80 os: remove 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
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
Roland Bär
470f07d462 Some documentation tweaks/cleanups
Fixes #4773
2023-02-27 08:22:50 +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
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
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
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
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
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
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
Norman Feske
7ada79b5ca Don't use deprecated Readonly_file::read variants
Issue #4745
2023-02-27 08:22:46 +01:00
Josef Söntgen
25d0dc19d5 nvme_drv: provide get/set feature command
These admin commands are used to configure features of the NVMe device.

Issue #4715.
2023-02-27 08:20:45 +01:00
Josef Söntgen
00a6d1306c nvme_drv: allow for accessing admin cmd results
Up to now it was only checked if an issued admin command was processed
in a timely fashion. Otherwise it has been treated as failed.
However, the completion-queue entry was not examined and the caller was
not able to access the entry itself. Depending on the command, checking
the completion-queue entry might be necessary, e.g. GET/SET_FEATURE.

Issue #4715.
2023-02-27 08:20:45 +01:00
Josef Söntgen
9f9bed7aa8 nvme_drv: move PRP list helper construction
Since the 'Platform::Device' constructor will defer the creation until
the content of the devices ROM is valid performing the PRP list helper
creation afterwards should be done with valid IOMMU information.

Issue #4715.
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
bfa90ab3e8 vmm: make initramfs an optional feature
Fix genodelabs/genode#4723
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
80687e702c vmm: implement VirtIO input model
Fix genodelabs/genode#4698
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
85c8bd7d7e vmm: implement VirtIO GPU model
Ref genodelabs/genode#4698
2023-02-27 08:20:45 +01:00
Stefan Kalkowski
f2188bd397 vmm: silent several VirtIO config accesses
Ref genodelabs/genode#4698
2023-01-24 12:21:21 +01:00
Christian Helmuth
2353082bda pci_decode: report ACPI SCI IRQ in acpi device
Issue #4679
2023-01-24 12:14:23 +01:00
Christian Helmuth
53c2cff331 acpi: report ACPI tables and SCI IRQ
Issue #4679
2023-01-24 12:10:17 +01:00
Alexander Boettcher
dca71dbad9 pci_decode: add acpi device
Use it as point to defer clients (e.g. ACPI-CA) until platform driver could
claim all resources.

Issue #4679
2023-01-24 12:09:16 +01:00
Martin Stein
eba22b7551 nic_router: rework updating of TCP/UDP links
* Update links from forward rules only with forward rules and links from
  transport-routing rules only with transport-routing rules. Besides raising
  the performance of the code, this also fixes a former bug that allowed
  forward-rule links to falsely stay active because of a transport-routing
  rule that matched the client destination ip and port.

* Don't use good-case exceptions for updating TCP/UDP links on re-configuration
  of the router.

* Make conditions when to dismiss a forward rule easier to read.
  * Introduces != operator to the public Port class in the net library.

* Fix unnecessary log message that a link was dismissed when only a potentially
  matching forward rule turned out to be not matching.

* Apply Genode coding style to if statements with a single body statement.

Fix #4728
2023-01-24 12:07:31 +01:00
Martin Stein
845694bc44 nic_router: fix updating UDP/TCP links
This fixes a bug that was introduced by this earlier commit:

"nic_router: find forward rules w/o exceptions"

The NIC router used to falsely dissolve TCP/UDP connection states when
reconfiguring although the connection states were still legal according to the
new config. The reason was that the above mention commit nested lambdas but
missed to return from the last nesting level when having found a configuration
that legitimates the connection state.

Ref #4728
2023-01-24 12:07:31 +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
Norman Feske
bb904b9166 vfs: propagate I/O activity via 'wakeup_vfs_user'
This commit supplements the various I/O signal handlers of the VFS
plugins with calls of the new 'Vfs::Env::User::wakeup_vfs_user'
interface, which will subsequently replace the old 'Io_progress_handler'
(issue #4697).

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
9a2c03d2c6 vfs: remove Read_result::READ_ERR_INTERRUPT
The error condition was too vague and thereby remained unused in
practice.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
ba78cf72ae vfs: remove Read_result::READ_ERR_AGAIN
The condition is covered by READ_ERR_WOULD_BLOCK.

Issue #4706
2023-01-24 12:07:30 +01:00
Christian Prochaska
0c465fbb4d trace session: fix double quota accounting
Fixes #4707.
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
Martin Stein
1b1a9ca95c nic_router: fix bad connection states on IP change
When a domain receives a new dynamic router IP address and that domain has
active connection states (TCP/UDP/ICMP) from another domain with NAT applied,
the connection states used to stay active while becoming obsolete. They
become obsolete because their identification and their packet processor
use the old routers IP address due to NAT.

One consequence was that connections became dysfunctional when the server
domain received a new dynamic router IP address. Request packets were still
routed from client to server, but when entering the server, their source IP
address was the outdated router address. Consequently, the server responses
used the outdated address as destination and the router dropped the responses
because it did not know this address anymore.

This commit fixes the problem by letting a domain destroy all its connection
states that were initiated from within other domains whenever it detaches from
its current IP configuration.

Strictly speaking, it is not necessary to destroy all connection states, only
those that the domain applies NAT to. However, the Genode AVL tree is not built
for removing a selection of nodes and trying to do it anyways is complicated.
So, for now, we simply destroy all connection states.

Note that the other way around was handled correctly already. When a domain
detaches from its IP config, all interfaces of that domain destroy all the
connection states they created (towards other domains).

Fixes #4696
2023-01-24 12:07:29 +01:00
Martin Stein
7a7cac57d9 nic_router: futile ip config updates on dhcp renew
If the IP config does not change on updates to the router IP config of a domain
change (a common case on DHCP RENEW), prevent detaching from the old config and
attaching to the new one. Because this would not only create unnecessary CPU
overhead but also force all clients at all interfaces that are listening to
this config (via config attribute 'dns_config_from') to restart their
networking (re-do DHCP).

Ref #4696
2023-01-24 12:07:29 +01:00
Norman Feske
e5272b65a1 vfs: remove unused Fs_file_system::_read method 2023-01-24 12:07:29 +01:00
Josef Söntgen
14d0b72f52 black_hole: add report session support 2023-01-24 12:07:28 +01:00
Josef Söntgen
a96c7ebd8d cpu_burner: only use timer when not 100 perecent 2023-01-24 12:07:28 +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
Norman Feske
cf87b0fadb vfs: simplify File_io_service::write return values
This patch removes the 'Insufficient_buffer' exception by returning the
WRITE_ERR_WOULD_BLOCK result value instead. It also eliminates the
superfluous WRITE_ERR_AGAIN and WRITE_ERR_INTERRUPT codes.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
8a9974b6f9 vfs/lwip: deferred wakeup of NIC server
This patch fosters the batching of network packets transferred by the
lwIP stack over the NIC connection. It replaces the eager submission of
the packet-stream's data-flow signals by explicit wakeup notifications.

The commit also increases the NIC session's buffer size from 128 to 1024
packets.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
5fdacae88b vfs: remove obsolete mutexes
...and tighten constness in adjacent code parts.

The VFS-internal synchronization via mutexes is no longer needed because
the access to the VFS is serialized by the VFS client, i.e., the libc.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
7d8d4f4532 vfs,libc: deferred wakeup of remote peers
This patch facilitates the batching of I/O operations in the VFS library
by replacing the implicit wakeup of remote peer (via the traditional
packet-stream interface like 'submit_packet') by explicit wakeup
signalling.

The wakeup signalling is triggered not before the VFS user settles down.
E.g., for libc-based applications, this is the case if the libc goes
idle, waiting for external I/O.
In the case of a busy writer to a non-blocking file descriptor or socket
(e.g., lighttpd), the remote peers are woken up once a write operation
yields an out-count of 0.

The deferring of wakeup signals is accommodated by the new 'Remote_io'
mechanism (vfs/remote_io.h) that is designated to be used by all VFS
plugins that interact with asynchronous Genode services for I/O.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
6edede0db9 server/vfs: facilitate batching of requests
By replacing the calls of 'acknowledge_packet' and 'get_packet' with
'try_ack_packet' and 'try_get_packet', we avoid the implicit triggering
of data-flow signals. Instead, the VFS server now relies on explicit
calls of the packet stream's 'wakeup' interface.

Issue #4697
2023-01-24 12:07:27 +01:00
Stefan Kalkowski
5cff81fc29 usb c_api: prevent exception on full ack queue
Count more accurately how much packets are in flied, and whether
new packets can be handled. Moreover, catch potential exceptions
whenever acknowledging a packet, and warn about the lost acknowledgement.

Fix genodelabs/genode#4678
2022-11-29 12:29:57 +01:00
Alexander Boettcher
a91467f3a8 platform_drv: support enforced 1:1 DMA mapping
Follow up commit of

"platfrom_drv: map DMA memory non-natural when iommu is present"

Issue #4665
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
10aa5ebf03 pci_decode: report devices from ACPI info
Although we do not have the full ACPI information parsed yet, to
announce non-PCI devices derived from the ACPI tables, the device
description of the assumed devices is now integral-part of pci_decode.
Formerly, the information was gained separatedly as boot-module, whereby
we lost synchronization in between ACPI/PCI parsing, BIOS handover, and
PS/2 emulation code already acting.
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
9e61fb90c5 Remove legacy platform_drv, API, and platform.inc
Fix genodelabs/genode#4671
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
7ebe09fbf7 pci_decode: limit PCI config space mappings
Map only one PCI bus at once when parsing the PCI buses.

Fix genodelabs/genode#4686
2022-11-17 17:22:58 +01:00
Josef Söntgen
4bacba431b nvme_drv: do not mask interrupts
During interrupt handling the driver masked and cleared interrupts as
recommended in the spec to prevent spurious or unnecessary interrupts
from occurring.

Due to the way the current implementation operates new Block requests
got submitted while handling completions for already finished ones.
Since interrupts where masked at this point the controller did not
generate interrupts when the newly submitted requests got completed.

As the mask/clear optimization is apparently not strictly needed and
according to the spec undefined when using MSI-X it is removed.

Fixes #4684
2022-11-17 14:45:57 +01:00
Stefan Kalkowski
b78b543011 vmm: make ARM VMM configureable
This commit enables users of the VMM to define CPU type and count, RAM size,
kernel and initrd ROM names, GIC version, and Virtio devices to be used.
Derived from the configuration values a flattened device-tree blob (DTB) is
generated and transfered to the VM.

Fix genodelabs/genode#4670
2022-11-17 08:00:37 +01:00
Sebastian Sumpf
77fc2f1e86 platfrom_drv: map DMA memory non-natural when iommu is present
Consume '<iommu/>' tag from 'devices' report. In case an IOMMU is
present map physical memory to arbitrary locations within IO page table
range 1K-4G. This way every device PD has access to ~4GB of DMA space.

issue #4665
2022-11-17 08:00:37 +01:00
Sebastian Sumpf
2aa01e309c gpu/intel: GEN12+
* clock frequency
* topology
* exec lists
* IRQ handling
* improved resource management

issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
f76f5db2fa drivers: use DMA buffer more consistent
Replace 'alloc_dma_buffer' by 'Dma_buffer'

issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
ff6b2bffdc ahci: use Dma_buffer instead of 'alloc_dma_buffer'
issue #4667
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
1b66b1bd7c platform_drv: check quota before dma allocations (taken from legacy)
'_env_ram' allocations can lead to
'Expanding_pd_session_client::try_alloc' quota upgrades, which in turn
may lead to a resource request by the platform driver. Therefore, we
check the available quota within the platform driver before allocations.
This is not an optimal solution.

issue #4667

related issue #3767
2022-11-17 08:00:36 +01:00
Stefan Kalkowski
11a6117da6 genode_c_api: add config update to block interface
Ref genodelabs/genode#4653
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
01e1e4e5b9 platform_drv: add "leave_operational" attribute
If a device should not be reset, powered off, and its clocks
shall stay untouched when it gets released, the leave_operational
attribute can be set to true in the device node of the related
device inside the devices ROM delivered to the platform driver.
This is useful for drivers, which only enable and initialize
their device, and can be closed afterwards.

Ref genodelabs/genode#4654
2022-11-17 08:00:35 +01:00
Johannes Schlatow
b2189ae88b vfs/log: block indefinitely on read access
With this change, the log file system mimics the behaviour of
/dev/stdin.

Fixes #4649
2022-11-17 08:00:34 +01:00
Christian Helmuth
9467d4cb0b pci_decode: initial device-report buffer of 32K
This prevents multiple generation attempts with undersized buffers on
recent hardware, which needs at least 12K.
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
Norman Feske
c0fddd0a14 nitpicker: drop double press/release events
Fixes #4639
2022-11-17 08:00:34 +01:00
Christian Helmuth
c086eb088d vmm_x86: guest code page in separate asm file
Implement the guest code in dedicated assembler source file, assemble
and link the binary to vmm_x86. The resulting guest-code binary
populates one page that is mapped to host the reset vector of the guest.

This approach simplifies future guest code adaption resp. extension,
e.g., to test rdmsr/wrmsr exiting.

Fixes #4638
2022-11-17 08:00:34 +01:00
Martin Stein
e052dc282b Revert "nic_router: incremental L4 checksum updates"
This reverts commit 9a37ccfe29 except for the
new declarations in public headers (in order to not change any APIs again).

We revert the commit as we found that there are corner cases in which it
produces a bad UDP checksum. The bad UDP checksum was observed via Wireshark at
a TFTP server in a Sculpt 22.10 Debian 11 VM on the first request of fetching a
file with the TFTP client of the uboot on our iMX8 test board.

Ref #4636
2022-10-13 12:35:27 +02:00
Josef Söntgen
a420670217 pci_decode: disable MSI on HDAUDIO cards
According to OpenBSD's azalia driver some AMD HDAudio devices do not
play nice with MSIs although the capability is set. At least the
0x1457 device was tested and worked using GSIs only.

genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Stefan Kalkowski
bc1e231775 platform_drv: implement PCI powering and reset
Ref genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Alexander Boettcher
3e8ffe179b pci_decode: check sys_rom on boot
If the ROM is already available, no signal will wakeup the pci_decode app on
sigh registration.

 genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Martin Stein
c83f307b62 nic_router: consider DHCP client optimization
Some DHCP clients (Debian VM in Sculpt) persistently store the last lease they
obtained and try to directly DHCP REQUEST it on a new startup whithout doing
DHCP DISCOVER beforehand. In case the NIC router doesn't know about the lease
anymore (timeout, new router instance), the router used to just ignore the DHCP
REQUEST. This led to significant delays in the network startup of the client
(delayed retries until give-up and DHCP DISCOVER). With this commit, the router
answers such packets with a DHCP NAK instead, causing the client to directly
switch to DHCP DISCOVER.

Fixes #4634
2022-10-12 12:09:37 +02:00
Sebastian Sumpf
7f0c89f378 pci_decode: enable all bridges
set I/O port, MMIO, and bus master to enabled for bridges where
disabled.

issue #4578
2022-10-12 12:09:37 +02:00
Stefan Kalkowski
ba97415ef9 pci_decode: prefer MSI over MSI-x
Ref genodelabs/genode#4578
2022-10-12 12:09:36 +02:00
Norman Feske
eb6a745a18 platform: add Guard utils for Clock/Reset/Power
These utilities simplify the control of clocks, resets, and power
domains from within the platform driver.

This is needed when driving a low-level device directly from the
platform driver, for example for driving the mbox mechanism to access
the system-control processor of the PinePhone.
2022-10-12 12:09:36 +02:00
Stefan Kalkowski
3841ee1d51 platform_drv: implement MSI-x support
Ref genodelabs/genode#4578
2022-10-12 12:09:36 +02:00
Josef Söntgen
a78a7e1f67 platform_drv: disable no snoop for ATI/AMD HDA
Implemented as depicted in the OpenBSD driver, register description
found in 'AMD SB700/710/750 Register Reference Guide'
(43009_sb7xx_rrg_pub_1.00.pdf).

Issue #4629.
2022-10-12 12:09:36 +02:00
Stefan Kalkowski
243c819257 pci_decode: use MSI enumerator as function value
Instead of using a global value to enumerate the MSIs, use a function argument
instead. Whenever the process of PCI device reporting gets started again,
due to an initially too small report buffer, the MSI enumeration value is reset
again. Formerly, we wasted MSI numbers.

Ref genodelabs/genode#4628
2022-10-12 12:09:35 +02:00
Christian Helmuth
08f1f94fcb pci_decode: IRQ reporting for MSI/MSI-X only devices
Don't skip IRQ reporting if legacy IRQ/GSIs are not supported as the
device may support MSI/MSI-X exclusively.

The commit also enables reserved_memory reporting of devices without
IRQs.

Ref genodelabs/genode#4578
2022-10-12 12:09:35 +02:00