Commit Graph

1437 Commits

Author SHA1 Message Date
Benjamin Lamowski
4fc94deccb base: x86: page table base: make parameters compatible
To make the x86 page table base implementation compatible with the
function signatures used in hw, make the Intel IOMMU specific arguments
optional:

- Make the `flush` parameter default to false.
- Make the `supported_sizes` parameter default to 1GB + 2MB + 4k.

Issue #5217
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
30b39d5fa3 base: generalize the page table allocator and move it to base
The Intel IOMMU page table implementation in the pc platform driver uses
a page table allocator that is adapted from the implementation in the hw
kernel.

Move the allocator to base as a first step to consolidate
implementations, fix an Array constructor and re-add the Allocator
constructor working on addresses instead of tables.

Issue #5217
2024-05-29 09:18:11 +02:00
Benjamin Lamowski
58e9856eb8 base: move page flags interface to base
On hw, `Page_flags` is used throughout architectures. At the same time,
it is used by the Intel IOMMU page table implementation in the pc
platform driver.

Consolidate the definition in base so it is available for all users.

Issue #5217
2024-05-29 09:18:11 +02:00
Johannes Schlatow
c31adb77e7 base: add shared page-table code for x86_64
Issue #5217
2024-05-29 09:18:11 +02:00
Alexander Boettcher
801fe272ca pit: new timer implementation
Issue #5138
2024-05-29 08:37:08 +02:00
Benjamin Lamowski
aad80e81da hw: add support for VMX
Add support for Intel's Virtual Machine Extensions with nested paging.

Fixes #5128
2024-05-29 08:37:08 +02:00
Stefan Kalkowski
f0ec1adcd3 base: add check_tool utility to build system
Fix genodelabs/genode#5213
2024-05-29 08:37:07 +02:00
Sebastian Sumpf
6c9d3326ec ldso: add support for R_<arch>_NONE relocations
We discovered this relocation, which does nothing, in pre-compiled
libraries. It is easy to implement because it has the same
relocation-type number (0) for all supported ABIs.

Also adjust error message from "Unsupported PLT relocation" to
"Unsupported translation table address format" to not confuse the
relocation type with the translation table type.

Fixes #5209
2024-05-08 08:23:39 +02:00
Christian Helmuth
54cf1334e1 Permit shared access to Intel PCH GPIO device
The ported i2c_hid driver contains driver code for the "Intel
Tigerlake/Alderlake PCH pinctrl/GPIO" device. Unfortunately, acpica
driver also accesses the same device on Lid open/close via ACPI AML code
of the DSDT table to read out the state of a GPIO pin connected to the
notebook lid. This would fail as I/O memory is handed out only once and
cannot be shared. The workaround disables the region check for the
specified GPIO I/O memory regions and provides both drivers shared
access to the regions.

This is a preliminary workaround. A general solution should separate the
GPIO driver into a component (e.g., platform driver) that regulates
accesses by i2c_hid and acpica.

Issue #5195
2024-04-25 15:43:02 +02:00
Christian Helmuth
dc0e78cdf8 depot: update recipe hashes 2024-04-12 15:08:01 +02:00
Norman Feske
1866520d6c dde_linux: build initcall_table.c after objects
The added hook 'OBJ_POSTPROC_SRC' gives us a way to post-process object
files for generating supplemental code. By using this hook, the
initcall_table.c generated by import-lx_emul_common.inc gets reliably
executed after all object files are built.

Fixes #5159
2024-04-12 15:00:44 +02:00
Norman Feske
5b4e1d22d9 test/timer: adjust min timer period to 250 us
In the context of #5138, the timer drivers for NOVA and base-hw had been
changed to support timeouts at a precision of 250 us (from formerly 1 ms).
Adjust the test to the new expected lower bound.
2024-04-12 12:57:30 +02:00
Norman Feske
44e0d7003a base: Alarm_registry data structure
This data structure uses an AVL tree to maintain a time-sorted set of
alarm objects. It supports the use of circular clocks of an bit width.

Issue #5138
2024-04-12 12:57:28 +02:00
Norman Feske
3e46cf5664 base: add Xoroshiro PRNG utility to base/internal 2024-04-12 12:57:28 +02:00
Alexander Boettcher
34674ac49f register_set: avoid conversion warnings
for Bitset_2 and Bitset_3 as used by ahci driver

Issue #5134
2024-04-12 12:55:39 +02:00
Christian Helmuth
9c7a303caf depot: update recipe hashes 2024-02-29 11:08:28 +01:00
Christian Prochaska
32e7ec7b9b core: implement 'Vm_session_component::reserve_and_flush()'
Issue #5069
2024-02-28 16:32:23 +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
Martin Stein
ee6f5f3b1b base: remove deprecated driver files
As far as I can tell, these file are not used anymore.

Ref #4081
2024-02-26 08:31:06 +01:00
Norman Feske
41731a2439 Make Session_object::warning const
This allows the use of the label-prefixed log utilities from a const
method of a derived class.
2024-02-26 08:31:03 +01:00
Christian Helmuth
d5188161f5 util/string.h: add Const_byte_range_ptr::contains()
Issue #5078
2023-12-15 14:11:56 +01:00
Norman Feske
c4679e7af6 depot: update recipe hashes 2023-12-13 12:33:05 +01:00
Norman Feske
3aa2119290 core: use 'release' in Trace::Subject destructor
This avoids having two different code paths for destruction and release.
2023-12-13 12:33:05 +01:00
Christian Helmuth
58dba227ce base: number of CPU components per slab block
On some platforms, only two CPU-thread component objects fit into on
page-sized slab block.

Issue #3834
2023-12-13 12:32:19 +01:00
Christian Helmuth
0046edf761 base: statically check for reasonable Tslab block size
Per default Tslab checks that 8 slabs incl. overhead fit into one block.
If this is not desired the template parameter 'MIN_SLABS_PER_BLOCK' can
be used to control the minimum number of blocks.

Fixes #3834
2023-12-13 12:32:19 +01:00
Christian Prochaska
9a049789de core: mark implicitly detached regions as reserved
Fixes #5069
2023-12-13 12:32:19 +01:00
Norman Feske
f57da7e645 trace: remove parent_levels session argument
The argument was originally designated to restrict the reach of the
trace monitor but the idea remained unimplemented. It is now superseded
by the use of the trace-session label as trace-subject filter.

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

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

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

Issue #847
2023-12-13 12:28:52 +01:00
Norman Feske
4e4b95bfe3 core: remove support for "unlabeled" LOG sessions
Fixes #5054
2023-12-01 11:01:29 +01:00
Norman Feske
4685ba394e mk: .lib.so and .abi.so depend on linker scripts
Fixes #3978
2023-12-01 09:49:31 +01:00
Norman Feske
5734ea736c mk: remove unused LIB_SO_DEPS variable
Spotted during our work on issue #5061.
2023-12-01 09:45:47 +01:00
Christian Helmuth
8baf19022c depot: update recipe hashes 2023-11-30 15:11:36 +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
Norman Feske
5ae0dab6c5 mk: remove implicit build of shared libraries
This patch removes the implicit build of all shared libraries a target
depends on. Targets only depend on the respective ABIs instead. This
alleviates the need to locally build complex shared libraries (think of
Qt) when developing applications. Instead, application developers can
use binary depot archives.

The implementation splits the mk/lib.mk file into three files:
- mk/a.mk   for building one static library (.lib.a)
- mk/so.mk  for building one shared object  (.lib.so)
- mk/abi.mk for building one ABI stub       (.abi.so)

Furthermore, the commit moves messages and the collection of build
artifacts to var/libdeps, triggers the build of kernel-specific
ld-<kernel>.lib.so, and prunes the lib-dependency tree at ABIs.

Fixes #5061
2023-11-28 14:44:29 +01:00
Christian Prochaska
e9f3101105 base: restore the session phase in `Parent_service'
Issue #5055
2023-11-28 14:24:26 +01:00
Norman Feske
d7ee460704 list_model.h: rename 'apply_first' to 'with_first'
Issue #4317
2023-11-28 14:24:24 +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
b9b2a7de34 Simplify 'List_model'
This patch replaces the original policy-based 'update_from_xml' by a new
method that takes three functors for creating, destroying, and updating
elements as arguments. XML nodes are associated with their corresponding
internal data models by annotating the element type with the
'type_matches' class function and the 'matches' method.

The patch also improves safety by enforcing that list-model elements can
never be copied.

Fixes #4317
2023-11-28 14:24:24 +01:00
Christian Prochaska
b41df1fb7a mk: create separate debug info files
Commit also adapts Qt5 libraries.

Issue #5015
2023-11-28 14:24:24 +01:00
Roman Iten
0d344de496 base: extend constness of Genode::Token
Fixes #5039
2023-11-28 14:24:24 +01:00
Tomasz Gajewski
002eb6f649 lib/timout: fix interpolation optimization
Issue #4960
2023-11-28 14:24:23 +01:00
Johannes Schlatow
b7855cc517 base: remove overriden try_alloc default argument
`Expandind_pd_session_client::try_alloc` is an overriden virtual method
of `Ram_allocator::try_alloc`. The latter specifies the default Cache
argument as CACHED. The overriden method should either do the same or
not even specify a default argument at all.

genodelabs/genode#5000
2023-11-28 14:24:23 +01:00
Christian Helmuth
b634549722 depot: update recipe hashes 2023-10-25 14:01:40 +02:00
Norman Feske
87b7dfed5d xml_node: skip whitespace in differs_from
The 'Xml_node::differs_from' method takes the constructor arguments
(addr, size) for a byte-wise comparison whereas 'with_raw_node'
restricts the byte range to the actual XML tags. In cases where
the XML start tag is preceeded by whitespace, both ranges can differ.

Since the 'differs_from' method is meant for comparing actual XML
nodes - not any whitespace around them - whitespace should be ignored
on both operands.

Issue #5029
2023-10-25 08:58:53 +02:00
Christian Prochaska
c4677042e1 ldso: load posix.lib.so first
Fixes #5027
2023-10-25 08:58:53 +02:00
Alexander Boettcher
e36170c997 nova: add guarded access to MSRs
via Genode Pd::system_control interface

Issue #5009
2023-10-25 08:58:52 +02:00
Christian Helmuth
07c4b92335 depot: update recipe hashes 2023-10-04 13:22:08 +02:00
Christian Prochaska
aea90dc7da hw: fix vmm_arm test on arm_v8a
Fixes #4975 regression
2023-10-04 13:22:08 +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