Commit Graph

4722 Commits

Author SHA1 Message Date
julia
b153154382 cmake: remove reference to old BI_CAP_DYN_START
This was removed in 2016 289bf92bf0.
Additionally, 5fac9e8198 removed the
section of the comment regarding having enough room for all the
untyped caps; because otherwise "enough space for 12 caps" is
somewhat uninteresting (most of the cspace is taken up by untypeds).

Signed-off-by: julia <git.ts@trainwit.ch>
2025-07-23 16:46:36 +10:00
Gerwin Klein
946a412727 CHANGES: update releases link
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-23 10:18:04 +10:00
Gerwin Klein
de5b553c7a README: update links for new docsite structure
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-23 10:18:04 +10:00
Gerwin Klein
c9d81228bd python-deps: bump cmake-format and autopep8
As decided at the most recent TSC meeting, bump cmake format to the
latest version. This will change/break style in many of the existing
cmake files, but pinning pyyaml to < 6 is not a long-term option.

Also bump patch version of autopep8, which should not lead to style
changes.

Bump overall sel4-deps version because the cmake-format change is
incompatible. Version 0.6.0 was not published because of the pyyaml
pinning/downgrade.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-22 12:42:33 +01:00
June Andronick
acbe30b507 change link to Resources ot setup page
Signed-off-by: June Andronick <june.andronick@proofcraft.systems>
2025-07-15 09:07:29 +10:00
Gerwin Klein
f44f103c26 parse_doxygen_xml: non-breaking space for types
Use non-breaking space for types in markdown tables to avoid line breaks

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-15 08:20:45 +10:00
Gerwin Klein
d815b87ce5 parse_doxygen_xml: minor typos and python lints
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-15 08:20:45 +10:00
Gerwin Klein
dc66e46a62 parse_doxygen_xml: properly escape string literals
More recent Python versions complain, and they are not wrong.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-15 08:20:45 +10:00
Gerwin Klein
c8ee042688 manual/README.md: include API doc generation
Migrate documentation of the API docs generation process here from the
docsite where it is too much out of view. Here it is closer to where it
is needed an more likely to get updated when things change.

Compared to the docsite version, this has applied:

- standard wrap column
- markdown lints
- adjusted headings
- `object-api-sel4-arch.xml` etc renames
- include RISC-V in structure

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-08 08:56:41 +10:00
Gerwin Klein
eb147cf006 bitfield_gen: remove manual table of contents
Remove manual table of contents for rendering on the docsite, which will
provide an automatic TOC.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 11:11:53 +01:00
Gerwin Klein
606a1ea1c3 am335x,omap3,bcm2836: SGI unsupported
SGI is currently only supported on GIC platforms.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:50:47 +10:00
Gerwin Klein
ae75fc3566 gen_invocations: handle undefined values
When evaluating XML condition expressions, properly treat undefined
values as undefined, not as False. Otherwise, the negation of an
undefined value may make an entire expression true and incorrectly
label some methods as MCS methods.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:50:47 +10:00
Gerwin Klein
538cdfd362 arm: verification tweaks for SGI API
- introduce arch interface for IRQControlCap dependencies as well as for
  isMDBParentOf (Arch_isIRQControlDescendant, Arch_isMDBParentOf). This
  mirrors the corresponding interface in the proofs and Haskell and
  avoids #ifdef proliferation in generic code.
- Arch_isIRQControlDescendant is currently only used for SGISignalCaps
- Arch_isMDBParentOf is used for SGISignalCaps and SMCCaps
- fix argument checking in Arch_decodeIRQControlInvocation (+ style
  tweak)
- Arch_sameObjectAs must return false for SGISignalCaps to align with
  finality definition of caps, i.e. SGISignalCaps are always final. This
  has no behaviour change, because finality doesn't matter for behaviour
  for SGISignalCaps, but we require for the proofs that the concept of
  finality aligns with the spec.
- simplify checks for IRQControlCap in sameObjectAs: sameObjectAs can
  never be true for IRQControlCap.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:50:47 +10:00
Kent McLeod
34725d060b arm: Add new APIs for generating SGIs
Allow SGIs to be generated from non-SMP kernels.

Signed-off-by: Kent McLeod <kent@kry10.com>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-07-07 08:50:47 +10:00
Indan Zupancic
bcf5ab7924 ARM, GICv3: Fix GICD_CTLR_ARE_NS
See issue #1489.

Signed-off-by: Indan Zupancic <indan@nul.nu>
2025-07-03 13:16:35 +01:00
Krishnan Winter
6dbe58ef0c Fix VGIC and VPPI maintenance handling
Fix a bug in VGIC Maintenance/VPPI logic that allowed a thread to be
simultaneously BlockedOnReply and in the release queue.

Co-authored-by: Alwin Joshy <joshyalwin@gmail.com>
Signed-off-by: Krishnan Winter <krishnanwinter1@gmail.com>
2025-06-24 10:26:04 +01:00
Gerwin Klein
dec87e641a github: main l4v now on Isabelle2025
set ts-2025 for master branch l4v and leave on ts-2024 for MCS until MCS
is updated to Isabelle2025 as well.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-13 11:29:05 +01:00
Michael McInerney
2417e0fc69 mcs: refactor doReplyTransfer and setMRs_fault
To ease verification.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2025-06-13 15:01:14 +10:00
julia
120951221c cleanup: use rootSlot to give a name to excapref0
Non-functional change. This will probably affect verification,
so definitely not expecting this to be merged anytime soon.

But it was very weird we had this rootSlot argument mark as UNUSED,
and it took me a bit to realise exactly what excaprefs[0] was
supposed to be.

Signed-off-by: julia <git.ts@trainwit.ch>
2025-06-10 18:39:47 +10:00
Gerwin Klein
ab5192f81a github: point proof tests to Isabelle ts-2024
We're currently using AWS Arm VMs, and vanilla Isabelle2024 ships a Z3
version that does not work on Arm. Using the ts-2024 branch fixes this
until we have upgraded everything to Isabelle2025.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-07 10:55:12 +02:00
Michael McInerney
ad32c2769f mcs: fix error handling for SetTimeoutEndpoint
This fixes the error message in decodeSetTimeoutEndpoint
and correctly updates current_syscall_error.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2025-06-04 17:58:16 +02:00
Alwin Joshy
4ec62c89d5 TCB_SetSchedParams: Simplify bind/unbind check
We no longer need to check this as the previous commit changed
decodeSetSchedParams to only pass the thread_control_sched_update_sc
flag if these conditions are true.

Signed-off-by: Alwin Joshy <joshyalwin@gmail.com>
2025-06-04 17:34:22 +02:00
Alwin Joshy
3108ea86d1 TCB_SetSchedParams: Change to match API reference
The implementation of TCB_SetSchedParams did not follow the API
reference, as it would fail if:

a. The TCB already had a scheduling context, even if this was the same
   as the one being passed in.
b. The scheduling context was bound to a TCB, even if this was the TCB
   that was invoked.

Signed-off-by: Alwin Joshy <joshyalwin@gmail.com>
2025-06-04 17:34:22 +02:00
Gerwin Klein
2ad02a0076 remove unnecessary cast
prio_t is defined as word_t which is unsigned long on all platforms.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-04 15:54:45 +02:00
Gerwin Klein
90dafb2e71 yieldTo: respect kernel reply protocol
Before:

- invokeSchedContext_Consumed and invokeSchedContext_YieldTo clobber
  the message info field in the reply from kernel, which results in a
  length 0 message.

- invokeSchedContext_Consumed and invokeSchedContext_YieldTo may crash
  the kernel for read-only IPC buffers

- invokeSchedContext_Consumed and invokeSchedContext_YieldTo generate
  a reply from kernel for syscalls that should not generate replies

- completeYieldTo does not set the badge register, which will contain
  whatever that previous syscall returned and not correctly indicate
  success/failure.

- completeYieldTo sets registers of the current thread, combined with
  IPC buffer message registers of potentially another thread.

Instead:

- pass the thread to setConsumed instead of the IPC buffer, so we can
  write to the correct registers

- look up the IPC buffer again and check for write authority

- follow the kernel reply protocol, which includes only generating a
  message for `call`. This means, we need to pass the flag through from
  higher-level decode functions.

- set thread state to Running if a reply message from the kernel was
  created, leave on Restart for default empty success message.

- set the badge register

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-06-04 15:54:45 +02:00
Ivan-Velickovic
b7d67a9389 Detect 'aarch64-elf-' toolchain
Already registered for RISC-V so makes sense to do the same for
ARM.

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-05-26 06:01:48 +02:00
Seph Gentle
5e6f7c2bda Fix QEMU regex to work for version 10 (#1463)
Fixes #1462

Signed-off-by: Seph Gentle <me@josephg.com>
2025-05-23 11:04:21 +10:00
Ivan-Velickovic
be8e649de0 Fix minimum CMake version in eswin config
I originally made the config before
6f2fe4626d so this patch gets rid
of the warning for the eswin config.cmake.

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-05-23 09:34:25 +10:00
julia
349745c53b cleanup: remove obselete pageType and asidMax
Signed-off-by: julia <git.ts@trainwit.ch>
2025-05-02 12:39:23 +01:00
Gerwin Klein
c03cad0894 Update links after seL4 website re-org
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-04-29 17:17:49 +10:00
Fennelfoxxo
6a74aba245 CMake: Use output file diffing from config_gen.py
Take advantage of the new --skip-unchanged option added to the
config_gen.py header generator to skip regenerating unchanged header
files which forced a rebuild of the entire project whenever CMake was
reconfigured.

Signed-off-by: James Martin <fennelfoxxo@gmail.com>
2025-04-27 11:33:45 +10:00
Fennelfoxxo
e8094340a3 Build: Add output file diffing to config_gen.py
Currently, whenever CMake is reconfigured, config_gen.py will always
regenerate the output config header and json, forcing a timestamp
update and a rebuild. This change adds a --skip-unchanged option which
skips writing to the output file if the write would not change the
file's contents. The default is off to avoid breaking builds that rely
on the existing behavior of always overwriting.

Signed-off-by: James Martin <fennelfoxxo@gmail.com>
2025-04-27 11:33:45 +10:00
Fennelfoxxo
162a38e865 Build: Allow optional output in config_gen.py
Previously, config_gen.py required the generated header and json to be
either written to a file or sent to stdout. This meant that there was
no way to avoid writing to a file, as the header and json data would be
merged into the same stdout stream. This change makes it so that the
header or json generation can be suppressed entirely by omitting the
corresponding --write-c or --write-json options.

Signed-off-by: James Martin <fennelfoxxo@gmail.com>
2025-04-27 11:33:45 +10:00
Gerwin Klein
1acde069a5 README: remove outdated pages
These are going to be removed in the website reorg.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-04-27 10:57:10 +10:00
julia
eca86cff19 treewide: typo fixes
Signed-off-by: julia <git.ts@trainwit.ch>
2025-04-14 12:05:16 +10:00
Michael McInerney
fd14374e9d mcs: refactor reply functions to ease verification
The outermost if statement can be removed in reply_pop
because reply_pop is called only in reply_remove, which
includes an explicit check for this condition.

The new inline function setThreadStateBlockedOnReply is
used within reply_push.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2025-04-04 15:21:43 +11:00
Ivan-Velickovic
58f0e87355 Add support for SiFive Premier P550 platform
The SiFive Premier P550 [1] is a new development board from SiFive
that is based on the ESWIN EIC7700X SoC.

The platform is interesting to the seL4 community as it implements
the RISC-V hypervisor extension meaning we now have real hardware to
evaluate RISC-V hypervisor changes to seL4. It also implements the
Sscofpmf extension and so we'll be able to get more experiment with
proper profiling on RISC-V.

Unfortunately, it seems we still do not have proper ASID suppor
according to [2].

The board comes in two configurations, 16GB and 32GB of memory.
This adds support for the 16GB model.

The DTS comes from SiFive's fork of Linux [3].
No modifications were made, any extra things are in the overlay.

[1]: https://www.sifive.com/boards/hifive-premier-p550
[2]: https://forums.sifive.com/t/asid-vmid-support-in-p550-eic7700x/6887
[3]: https://github.com/sifive/riscv-linux/tree/dev/kernel/hifive-premier-p550

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-04-02 13:51:53 +11:00
Ivan-Velickovic
e633fc7480 Add 'sifive,plic-1.0.0' to PLIC compatible list
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-04-02 13:51:53 +11:00
Gerwin Klein
38e889da3b github: deploy mcs verification manifest
Deploy the MCS verification manifest for versions that have no MCS
preprocess differences. These may be different from non-MCS preprocess
outcomes, and since the MCS verification is on a branch, we can deploy
it separately.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-04-02 08:58:31 +11:00
Gerwin Klein
29803c51ca configs: mark Ultra96v2 as supported by the proofs
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-04-01 09:57:28 +11:00
Gerwin Klein
6d8b1eaeec utils: wrap config_set for verification
Wrap config_set macro in a static inline function so that verification
automation does not simplify away dead code branches based on it, but
the compiler still does.

In most parts of the proofs we want to pretend that we don't know the
config value yet and consider both options. This makes the proofs more
independent on the config value that is selected.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2025-03-28 10:53:48 +11:00
Ivan-Velickovic
f7b95a9756 Add missing userError for VSpace invocation
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-03-27 16:28:08 +11:00
Michael McInerney
019e4b608f mcs: small changes to ease verification
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2025-03-21 16:48:00 +11:00
Michael McInerney
52725dd5b4 mcs: rephrase invokeSchedControl_ConfigureFlags
This eases verification by using a local variable
which remains unchanged during execution of the
function.

This also makes use of the function sc_active.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2025-03-19 17:26:11 +11:00
Ryan Barry
9fe04a250b aarch32/vcpu: save and restore CNTKCTL
Save and restore the CNTKCTL register alongside other virtual timer
registers when switching VCPUs.

Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2025-03-18 10:55:48 +11:00
Ivan-Velickovic
53ed1bef7b tools: fix kernel physBase alignment on AArch64
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-03-13 19:01:05 +11:00
Ryan Barry
f02bc94db8 arm: add vcpu save/restore reg range constants
This introduces two new constants to the vcpu reg enum, with the goal of
unifying reg range saves/restores and making explicit which registers
are affected.

Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2025-03-13 09:46:12 +11:00
Ryan Barry
8e18a0b558 aarch64: avoid saving CPACR to a disabled VCPU
seL4_VCPUReg_CPACR was sometimes saved to an inactive current VCPU,
overwriting the previous value and erroneously enabling FPU access.

Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2025-03-13 09:46:12 +11:00
Ryan Barry
119a189c39 aarch64: remove redundant FPU ifdefs
In aarch64 kernel configurations, it is not possible to configure the
FPU to be disabled. This makes certain ifdefs redundant.

Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2025-03-13 09:46:12 +11:00
julia
d047ce8d75 statedata: only define tlbLockCount when needed
Moves it to the arm-specific arch data.

Adds an extra CONFIG_HAS_ARM_TLB_LOCK that defaults to ON when the
architecture is ARM_CORTEX_A8.

Again, variable was noticed in the objdump of a RISC-V build, despite
only being used for a specific ARM CortexA8 platform.

Signed-off-by: julia <git.ts@trainwit.ch>
2025-03-12 13:36:10 +11:00