When SMP is enabled, the sscratch register is used to
contain the per-core kernel stack instead of the current
running thread. We get the current running thread from the
top of the kernel stack.
- Remove Remap function from seL4 API for arm, x86, riscv and the
respective invocation implementation.
- Update Map as replacement for Remap
- Update manual
This allows a change of rights if the frame being mapped is already
mapped in at the given vaddr. To map a page to a different address,
unmap it first.
Co-authored-by: Hesham Almatary <hesham.almatary@data61.csiro.au>
Co-authored-by: Anna Lyons <Anna.Lyons@data61.csiro.au>
Co-authored-by: Victor Phan <Victor.Phan@data61.csiro.au>
Co-authored-by: Kent McLeod <Kent.Mcleod@data61.csiro.au>
The ia32 kernel is supposed to pass through type 1 memory that is
outside of the kernel window as device untyped. In a previous refactor
this memory stopped getting created as untypeds. This behaviour is fixed
by pre-clamping the memory before being given to the free region list.
Prior to this commit the kernel would always trigger a full reschedule
on setPriority. This change allows the kernel to attempt a direct
switch, avoiding invoking the scheduler.
- Move location of setPriority call to after any cap deletion
This makes the proof easier as setPriority now changes
ksSchedulerAction, which is required to be ResumeCurrentThread or
ChooseNewThread by the cap delete functions.
- Update to attempt direct switch on set prio.
Without FORCE being added to `set` in declare_seL4_arch for
KernelSel4Arch, the set command doesn't seem to persist as the variable
must be already initialised in some cases. In this part of the script
processing, a platform has already been selected and is setting its seL4
arch and so using FORCE seems appropriate anyway.
This register is visible to software executing at EL0 but not writeable.
Storing it in the VCPU context required custom save/restore handling as
it had to be explicitly handled when switching from a VCPU thread to a
non-VCPU thread so that it didn't become a channel. It is possible to
now update this register via seL4_TCB_WriteRegisters for software
executing at EL0.
This also fixes a potential bug where if a vcpu-thread is switched for a
non-vcpu-thread and then switched to a different vcpu-thread the
original vcpu-thread's copy of this register will get set to 0.
Reserved IRQ reporting would print on every received reserved IRQ. This
feature is supposed to report spurious interrupts, yet most cases
reserved IRQs are not spurious. We change the printing to only print if
the reserved IRQ was unhandled. The intention is to allow more app
configurations to leave this feature enabled in development builds.
These configs are also used by x86 files and this fixes an configuration
race condition where projects try set KernelIOMMU after platform
settings are configured and so KernelIOMMU doesn't result in a correct
value.
There are platforms/archs that don't support the Kernel Hardware Debug
API and they can now advertise that by setting
KernelHardwareDebugAPIUnsupported.
Instead of exporting the generic timer and counter access to userland in
one go, this commit splits it up into two different operations which
require two different build flags to be turned on. This is because the
timers expose a storage channel and allow threads to corrupt the
registers for each other.
Also move the config options to a better location and have them
depend on a more suitable config flag.
- allow the compare register to be set by user level (for both
virtual and physical timer.
- allow the generic timer to be exported to EL1 as well when running
seL4 as a hypervisor
This adds support for importing this project via `find_package(seL4)` if
the project exists in the CMAKE_MODULE_PATH.
sel4_import_kernel adds the kernel project to the current build
directory.
sel4_import_libsel4 adds libsel4 to the current build directory
sel4_configure_platform_settings imports seL4Config.cmake which
configures kernel configuration and toolchain settings for the target
platform.
This prevents accidental declaration of properties or configurations
that are for the incorrect architecture selected. This was previously
required as the variables KernelWordSize and KernelArch were defined in
each arch specific cmake.config file. Now that they are defined in
advance it is possible to exclude the other imports.
This directory-scoped varible is now used by config_option,
config_choice and config_string to set a created CMake cache variable as
advanced or not. An advanced variable is hidden by default in the CMake
configuration editors. Setting SEL4_CONFIG_DEFAULT_ADVANCED to ON will
cause variables to be advanced and not show up in the cache. Projects
can set this to limit the amount of options presented in the
config editor. Any cache variable can have this overridden by calling
mark_as_advanced(CLEAR config_name)
This leverages #!/usr/bin/env -S cmake -P to invoke a cmake
configuration file as a script that configures and builds a kernel in
the current directory with the configuration that was invoked. It is a
quick way for producing a kernel.elf or kernel_all_pp.c input file to
verification for a particular config.
The toolchain file given to CMake is required to be immutable after
first build configuration. CMake caches certain build flags based on
this assumption. We now throw an error if the platform configuration
changes in a way that changes this toolchain file.
If CMAKE_TOOLCHAIN_FILE is unset in seL4Config.cmake then generate one
that selects the correct toolchain based on configured kernel arch
settings.
This means that initialising a build goes from:
`cmake -DCMAKE_TOOLCHAIN_FILE=gcc.cmake -DAARCH32=ON -G Ninja -C
../configs/ARM_verified.cmake ..`
to:
`cmake -G Ninja -C ../configs/ARM_verified.cmake ..`
gcc.cmake is modified to be used as an input to configure_file.
@KernelArch@ and other @@ arguments will be replaced with the
configuration settings. The file will still work if passed directly to
cmake via -DCMAKE_TOOLCHAIN_FILE=gcc.cmake without being templated.
On aarch64 physBase is the constant that points to the bottom of
physical memory (RAM).
Prior to this change the kernel window was mapped directly to physBase,
which is usually not a 0 paddr. As a consequence the kernel could not
access any memory below physBase.
This change fixes this issue by mapping the start of the kernel window
to 0 in the physical address space.
- add new constant PADDR_LOAD, the location of the kernel image in the
physical address space.
- add new constant PADDR_BASE, the start of the physical address space
(0).
- add new constant KERNEL_ELF_BASE, the location of the kernel image in
kernel virtual memory.
A consequence of this change is that on aarch64, the kernelBase constant
now points to the start of the kernel window in virtual memory, but
*not* to the start of the kernel image as these are now different.
Prior to this commit this check would fail on ARMv8.2 and greater, as
having a bit set after this version does not imply that FPU/SIMD is not
supported.
For ARMv8.2 and above the values of the AdvSIMD/FP bits in
ID_AA64PFR0_EL1 are as follows:
- 0b1111 means FPU/SIMD is not supported.
- 0b0000 means FPU/SIMD is supported except for half-precision floating
point arithmetic.
- 0b0001 means FPU/SIMD is supported including half-precision floating
point arithmetic.
In the pip namespace, 'pyaml' is "pretty-yaml", a YAML generator (but
not a YAML parser); 'pyyaml' (accessed with "import yaml"), a.k.a.
"PyYAML", is the YAML serialiser and reader we actually use.
Bump the minor version number per semantic versioning rules. (One could
argue that we are "removing" pyaml (pretty-yaml) from our interface and
therefore a major version bump is required, but we weren't _actually_
using that module so I would argue that the introduction of 'pyyaml' is
the visible change.)
Thanks to Japheth Lim for identifying this issue.
The `shoehorn` tool in tools/seL4 (the sel4_tools repository) requires
this.
Bump minor version number per semantic versioning rules (interface
extension). (0.3.1 instead of 0.3.0 because 0.3.0 saw the light of day
with an incorrect dependency on `libarchive` instead of `libarchive-c`.)
This reverts commit a14264336c.
There are (at least) 3 namespaces relevant to Python module names:
Debian package names, PyPI module names, and the name of a module used
by actual Python language imports. That's one more than my brain could
handle. I wanted "libarchive-c" in setup.py instead of "libarchive".
Make sure that when the kernel boots a scheduling control cap is created
and that the initial thread and idle thread are scheduled using correct
systemt time.
mcs requires an additional 2 registers for performing system calls to
pass information regarding the reply capability and the destination of a
nbsend/recv.
If the time is being read in 32-bit mode it is read in two operations
between which the time can change. If the time causes the low bits to
roll over to 0 and the high bits to increment between reading the low
and high bits an incorrect time will be returned.
A check is added to ensure that an accurate time is returned.
The `shoehorn` tool in the tools/seL4 (the sel4_tools repository) will
require this in a future commit.
Bump minor version number per semantic versioning rules (interface
extension).