Commit Graph

980 Commits

Author SHA1 Message Date
Christian Helmuth
583f2d6a36 depot: update recipe hashes 2023-05-30 12:13:34 +02:00
Benjamin Lamowski
e882ca748d base-hw: virt: implement support for SVM
Ref #4826
2023-05-30 12:13:34 +02:00
Benjamin Lamowski
1e3836f8b5 base-hw: pass generic Vm_data structure to the kernel object
This enables passing additional data structures to the kernel on x86.

Ref #4826
2023-05-30 12:13:34 +02:00
Benjamin Lamowski
312b638220 base-hw: export Intel TSC platform information
Export TSC invariant and the frequency reported on Intel processors.
Currently lacks TSC calibration and reports a fixed frequency on AMD.

Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
c75b07e0fd base-hw: SVM: allow execute on NPT mappings
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
cb69c59fa3 base-hw: implement VMCB data structure for AMD SVM
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
fa6e819f9a base-hw: x86: use Vcpu_state as Vm_state
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
0a819d5e19 base-hw: add MSR and CPUID registers for AMD SVM
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
e11ed069bf base-hw: fix x86 CPUID register width
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
7477f99d05 base-hw: x86: detect CPU Vendor and SVM support
Ref #4826
2023-05-30 12:13:33 +02:00
Benjamin Lamowski
6ca7119267 base-hw: copy virtualization structure for x86_64
Ref #4826
2023-05-30 12:13:33 +02:00
Stefan Kalkowski
0aef0959d5 hw: catch all cache lines for mis-aligned addresses
Fix genodelabs/genode#4905
2023-05-30 12:03:33 +02:00
Stefan Kalkowski
90690d96d4 hw: fix build errors with -std=gnu++20
Fix genodelabs/genode#4894
2023-05-30 12:03:31 +02:00
Stefan Kalkowski
5e0a9052d2 hw: prevent alignment faults in bootstrap
Either enable strict-alignment or disable FPU code generation by gcc
regarding bootstrap code, which cannot handle alignment faults during
initialization properly.

Ref genodelabs/genode#4827
2023-05-30 12:03:28 +02:00
Norman Feske
71bda7db24 Move cpu_quota.run from os to base-hw repository
This test works only on the base-hw kernel after all.
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
Christian Prochaska
b29db99f1c hw: fix build error with gcc 12
Fixes #4831
2023-05-08 15:55:35 +02:00
Christian Helmuth
e9a497abe4 depot: update recipe hashes 2023-04-26 11:58:16 +02:00
Christian Helmuth
b5f79756b3 depot: update recipe hashes 2023-04-17 14:48:30 +02:00
Norman Feske
61926ebc07 base: introduce platform_init function
The new 'init_platform' function performs the platform-specific
component-local low-level initialization. It allows for the
differentiation between core and regular components as well as
kernel-dependent peculiarities.

This patch introduces a consistent notion of a 'Platform'. Within core,
the 'Platform' contains the kernel-specific initialization. Outside
core, the platform sets up the interplay with the parent component. In
all cases, the platform is constructed while running on the initial
stack.

Issue #4784
2023-03-15 17:05:01 +01:00
Christian Helmuth
73771669f1 depot: update recipe hashes 2023-03-13 14:32:54 +01:00
Norman Feske
c99fb2b69b core: replace use of Avl_string by Dictionary
Issue #4780
2023-03-13 14:32:53 +01:00
Norman Feske
d727d18871 base: remove format strings from API
This patch ultimatedly removes format strings from Genode's base API.
Users of the former base/snprintf.h and base/console.h headers may
use the free-standing 'format' library hosted in the ports repository.

Fixes #2064
Fixes #3869
2023-03-13 14:32:53 +01:00
Norman Feske
9debad4e91 Remove format strings from connection types
Issue #2064
2023-03-13 14:32:37 +01:00
Norman Feske
2e6dd010ae core: introduce 'Core' namespace
The namespace draws a clear line between the base library and the core
component.

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

Fixes #4777
2023-03-13 14:32:37 +01:00
Christian Helmuth
e265cf6d49 depot: update recipe hashes 2023-02-27 08:22:51 +01:00
Alexander Boettcher
df27cc87b5 hw/x86: add suspend kernel syscall
using the ACPI mechanism. The syscall can be triggered solely via core's
RPC managing_system call.

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

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

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

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

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

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

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

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

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

Issue #4768
2023-02-27 08:22:49 +01:00
Stefan Kalkowski
13453e3c68 hw: activate strict conversion checking in kernel
Fix genodelabs/genode#4753
2023-02-27 08:22:48 +01:00
Stefan Kalkowski
0212f94809 hw: eliminate -DNR_OF_CPUS, use constant instead
Fix genodelabs/genode#4752
2023-02-27 08:22:48 +01:00
Martin Stein
5bdc88bf57 base-hw scheduler: sanitize access to invalid head
Issue #4755
2023-02-27 08:22:47 +01:00
Johannes Schlatow
4d0cb175da base-hw: use global timer on Cortex A9
genodelabs/genode#4360
2023-02-27 08:20:45 +01:00
Christian Helmuth
25eac6b9e6 depot: update recipe hashes 2023-01-24 12:07:33 +01:00
Benjamin Lamowski
641fadb3e9 base-hw: remove memory hole in bootstrap page table
Tests on qemu would fail when started with RAM sizes from 1025MiB to
2048MiB, because the the mapping hole in the page table from 1GiB to
2GiB would interfere with qemu's mapping addresses for ACPI.

Identity-map the complete first 4GiB of memory to catch all early
memory accesses during bootstrap.

Fixes #4724.
2023-01-24 12:07:31 +01:00
Norman Feske
0e311845bf base-hw: don't show ROM modules at boot time
On complex scenarios like Sculpt on the phone, this change noticeably
reduces the boot time.

Issue #4705
2023-01-24 12:07:31 +01:00
Martin Stein
68afbbc0f0 base-hw scheduler test: print method
Adds befriended test-local wrappers for the classes Cpu_share and Cpu_scheduler
and adds a print method to the scheduler wrapper that prints the internal state
of the scheduler to the given output. Cpu_shares are referenced in the output
via a the IDs that the test uses to organize them. I.e., this corresponds to
how the CPU shares are named when calling the atomic steps the test is made of.

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
f60a004cff base-hw scheduler test: rename test.cc main.cc
Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
20fea7fdd2 base-hw scheduler test: adapt to new behavior
This adapts the test to the changes that were applied to the scheduling scheme
by the following commits:

* base-hw scheduler: optimize quota depletion events
* base-hw scheduler: fix bug on removing head
* base-hw scheduler: fix ready method
* base-hw: optimize & cleanup scheduler

Part of that is that the test used to check whether the act of setting a share
ready outdates the head or not. However, with the current version of the
scheduler, this check is not possible anymore. We can merely check whether the
head is outdated after setting the share ready. So, among other adaptions, this
commit adapts the expectations of the test to the new semantics of the check.

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00
Martin Stein
615dd377dd base-hw scheduler test: clean up
* Get rid of preprocessor macros.
* Introduce Main as class.
* Exit with -1 instead of endless loops on errors.
* Don't try to deal with error conditions, just print a message and exit
  with -1.
* Only one operation per line.

Ref #4151
Ref #4710
2023-01-24 12:07:31 +01:00