Commit graph

4527 commits

Author SHA1 Message Date
Gerwin Klein
357674fb1d CONTRIBUTORS: add contributors since 12.1.0
Based on the signed-off-by lines in commits since
release tag 12.1.0.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-25 10:40:10 +10:00
Michael McInerney
b93de1fdd5 mcs: use sc_active in isSchedulable
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2024-06-22 18:06:05 +10:00
Michael McInerney
2648df42c4 mcs: rewrite guard in preemptionPoint
This reorders the guard in one of the if statements in preemptionPoint
to first check isIRQPending, since it is the most likely cause of this
guard being true. This also eases verification.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2024-06-20 10:43:31 +01:00
Gerwin Klein
7592bbe46d CHANGES: update RFC links
- Update RFC links to point to the GitHub process.
- Add missing link for RFC-10.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-20 15:40:07 +10:00
Andy Bui
c7bdf1f921 vcpu: only trap WFx instructions from vCPUs
When KernelArmDisableWFIWFETraps is disabled (trapping of WFI/WFE is
enabled), the kernel traps WFx instructions from both native and vCPU
threads. This change makes the code in line with the config description.

In any case, there don't exist many use cases for trapping WFx from
native threads vs vCPU threads. Example: kvm uses this to yield physical
CPU time to other vCPUs instead of busy waiting.

Signed-off-by: Andy Bui <andy.bui2001@gmail.com>
2024-06-20 14:36:32 +10:00
hexcoder
15fa2cf9c2 manual: typos and style/grammar corrections
Co-authored-by: Gerwin Klein <gerwin.klein@proofcraft.systems>

Signed-off-by: hexcoder <heiko@hexco.de>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-17 19:24:20 +10:00
Michael McInerney
c28e52a1ec mcs: refactor refill_unblock_check
This eases verification by having only one call to refill_head
within refill_head_overlapping, and by giving a name to the body
of the loop within refill_unblock_check.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2024-06-17 11:52:26 +10:00
Indan Zupancic
5fd8602bc0 Manual: Document ARM Virtualisation Faults
This resolves issue #1234.

Signed-off-by: Indan Zupancic <indan@nul.nu>
2024-06-17 00:37:00 +01:00
Indan Zupancic
8cbc13d5b8 Manual: Document ARM Virtualisation
This resolves issue #1083.

Signed-off-by: Indan Zupancic <indan@nul.nu>
2024-06-17 00:37:00 +01:00
Indan Zupancic
44af0c5776 Force long enum seL4_VCPUReg
Signed-off-by: Indan Zupancic <indan@nul.nu>
2024-06-17 00:37:00 +01:00
Indan Zupancic
0f676f3b9c Rename seL4_TimeoutMsg to seL4_Timeout_Msg
To make it consistent with the naming of other messages.

Signed-off-by: Indan Zupancic <indan@nul.nu>
2024-06-17 00:37:00 +01:00
Gerwin Klein
1e6b69cdb6 arm tlb: guard TLB lockdown count
lockTLBEntry uses the global tlbLockCount as input without checking
bounds. This is fine, because the function is called at most 2 times per
core, but this is only apparent when checking the entire possible
calling context.

Make this bound obvious locally by doing nothing if the function is
called with values of tlbLockCount of 2 or greater. This is safe,
because TLB lockdown is a performance change only. Also add an assert
for debug mode, becase we want to know if calling context ever changes.

This potential issue was reported by The UK's National Cyber Security
Centre (NCSC).

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-16 16:01:13 +10:00
Gerwin Klein
f03bcab247 arm tlb: only perform TLB lockdown for Cortex A8
The code previously used the same instructions for Cortex A8 and A9,
but the Cortex A8 instructions are undocumented for A9, and A9 provides
a slightly different TLB interface.

As far as we can tell, the instructions were simply ignored by the
supported A8 platforms, so there was no current correctness issue.

Since the instructions had no effect, this commit removes A9 TLB
lockdown support.

This potential issue was discovered and reported by the UK's National
Cyber Security Centre (NCSC).

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-16 16:01:13 +10:00
Gerwin Klein
049580ffed cmake: style fix
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-16 14:31:29 +10:00
Ivan Velickovic
1cca12ba2e Disable KernelRiscvUseClintMtime by default
This configuration option requires access to the CLINT in S-mode
which is not available on newer versions of OpenSBI. Because of
this, it makes more sense to not turn on this option by default
and instead let it be 'opt-in' for those who want the performance
benefit and also have firmware that does not restrict S-mode access
to the CLINT.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-06-16 14:31:29 +10:00
Ivan Velickovic
5135e764a7 Make write-only mapping message consistent
There is a warning when creating a write-only mapping on
AArch32/AArch64.

This patch simply makes the message consistent across all
architectures since the behaviour when creating a write-only
mapping is also consistent across all architectures.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-06-15 17:08:21 +10:00
Gerwin Klein
6e9370a561 ioapic: set IOAPIC_IRQ_LINES to max allowed
Correctly mask the IOAPICVER register to the Maximum Redirection Entry
field to potential avoid spurious higher bits on e.g. AMD processors.

Set IOAPIC_IRQ_LINES to the maximum value this field is allowed to
return (239+1). While our haswell machines report 24 IRQ lines as
expected, the skylake machines report 120.

The only impact should be the size of the ioredtbl_state array.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-14 14:19:24 +10:00
Gerwin Klein
d513db6cb8 github: use default Isabelle version for proofs
Use the Isabelle version set in the verification manifest instead of
overriding to a specific version here. This will automatically update
as the verification repository updates to new Isabelle versions.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-14 09:06:08 +10:00
Damon Lee
f8b289d096 Add new imx8mp-evk platform
This new platform is NXP Semiconductor's Evaluation Kit for the i.MX 8M
Plus Applications Processor. It's from the i.MX 8M family of processors
and is largely similar to the existing i.MX 8M Quad and i.MX 8M Mini
platforms.

Signed-off-by: Damon Lee <damon@kry10.com>
2024-06-12 22:47:34 +10:00
Peter Chubb
ecec5e4afb pc99: only access real IOAPIC registers
IOAPICS can have varying numbers of lines attached. The actual number
can be accessed in the top 16 bits of the version register.

Rather than assuming fixed 24 lines per IRQ, read the actual number and
use that. We still bound that value by 24 and abort initialization if
the bound is not met. As all current IOAPICS have at most 24 IRQ lines,
this will not trigger on current hardware.

Signed-off-by: Peter Chubb <peter.chubb@unsw.edu.au>
2024-06-12 12:18:14 +10:00
Ivan Velickovic
bf2134e6de manual: document write-only pages
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-06-11 22:46:57 +08:00
Gerwin Klein
ddeb18a015 bitfield_gen: properly escape backslash
Replace "\<"" in strings with "\\<". Until recently python did not
complain about this illegal escape sequence, but now it warns.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-05-27 14:34:00 +10:00
Axel Heider
503ad776bc risc-v: improve comments
- mention skipped t1/x6
- mention skipped a0/x10, a1/x11

Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-05-23 15:48:04 +01:00
Michael McInerney
686bba4d2a mcs: more uniformly handle ready and release queue
This introduces library functions for updating the linked lists which
use the tcbSchedNext and tcbSchedPrev pointers of a TCB, and uses these
to perform the updates to the ready queues and the release queue.

In order to accommodate this, ksReleaseQueue is now of type tcb_queue_t.

Co-authored-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2024-05-23 18:04:06 +10:00
Ivan Velickovic
410b464c27 Remove unused Python imports in scripts
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-05-02 10:17:13 +01:00
Ivan Velickovic
67a812009a manual: remove dependency on 'six' Python package
Python2 is no longer supported and hence the dependency
on six is no longer necessary.

According to https://six.readthedocs.io/#six.string_types,
six.string_types is just str in Python3.

According to https://six.readthedocs.io/#six.next in Python2.6
and above, six.next is just next.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-05-02 10:17:13 +01:00
Ben Leslie
4d7fc32a24 Remove python2 support for core build tools
Depedencies on Python2/3 cross support (such as six, past and future)
are removed as only Python3 is supported at this point. Fewer
external deps is a good thing.

Signed-off-by: Ben Leslie <benno@brkawy.com>
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-05-02 02:11:29 +01:00
wucke13
0260fba168 fix: invisible chars due to ANSI escape codes
The prior behavior would emit ANSI escape codes which set the terminal
foreground color to black bold (`[30;1m`), leaving the default
background color. On many terminals configured with a dark color scheme,
this creates black on black characters, i.e. the output is invisible.

This change moves to a better adapted output, where the output is only
marked as bold (`[1m]`), which works well on all color schemes.

Fixes #1243

Signed-off-by: wucke13 <wucke13@gmail.com>
2024-04-28 10:26:11 +10:00
Axel Heider
a58480425c make SMP conditional check more general
Check for CONFIG_ENABLE_SMP_SUPPORT instead of checking for the
number in CONFIG_MAX_NUM_NODES. This allows enabling SMP support
with just one node also.

Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-04-11 09:20:00 +01:00
Axel Heider
8c82535e50 fix rust stub generation script
- fix: brackets in check
- fix: use CONFIG_ENABLE_SMP_SUPPORT
- conditions for CONFIG_MAX_NUM_NODES have been removed

Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-04-11 09:06:00 +01:00
Axel Heider
f461e0fa17 cmake: remove obsolete variable
This should not have been added in commit ad4ea6cd. And since
commit c642a398 this is handled by a python script anyway.

Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-04-10 21:13:15 +01:00
Axel Heider
87112d8afb libsel4: remove obsolete --cfile and --word-size
The word size can be derived from --arch

Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-04-09 21:02:20 +01:00
Axel Heider
3714cde1e8 fix style issues
Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-04-09 21:02:20 +01:00
Axel Heider
05d0f06620 fix type, add missing 'extern' keyword
Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-04-09 19:55:34 +01:00
Krishnan Winter
90bd5575b2 aarch64: Rename armKSGlobalLogPDE
Renamed armKSGlobalLogPDE to
armKSGlobalLogPTE inline with RFC-10.

Signed-off-by: Krishnan Winter <krishnanwinter1@gmail.com>
2024-04-09 09:35:54 +01:00
Krishnan Winter
21ef06782a aarch64: Correct PT lvl macro
Fixed GET_KPT_INDEX macro to use the correct
PT level macro.

Signed-off-by: Krishnan Winter <krishnanwinter1@gmail.com>
2024-04-09 09:35:54 +01:00
Krishnan Winter
9dbc708821 aarch64: Fixed kernel log buffer
Replaced deprecated macros in statedata.c to get the page table index,
and replaced function in vspace.c to create a new page
table entry for
aarch64/


Signed-off-by: Krishnan Winter <krishnanwinter1@gmail.com>
2024-04-09 09:35:54 +01:00
Axel Heider
daf0afad71 trivial/cmake: fix typo in description
Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-04-08 15:50:34 +01:00
Axel Heider
62d9ef8228 cmake: fix style issues
Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-04-08 15:50:34 +01:00
Axel Heider
600ea414e0 trivial/cmake: add missing bracket in comment
Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-04-08 15:50:34 +01:00
Craig McLaughlin
ed5e7c8e56 boot: Fix root cnode size compile-time assert
The check was not enforcing the minimum radix intended by 5fac9e8 and
still allowed a radix of 4 to be specified.

Signed-off-by: Craig McLaughlin <thecraigmclaughlin@gmail.com>
2024-04-06 10:46:40 +01:00
Krishnan Winter
21d699828d Fix macro to access overflow node
Previously accessing the ccnt_num_overflows
value using the NODE_STATE macro. In SMP
configurations, this looks for this value
in the system node state, however, it
resides in the cpu arch node state. This should
therefore be accessed using the ARCH_NODE_STATE.

Signed-off-by: Krishnan Winter <krishnanwinter1@gmail.com>
2024-03-27 10:57:45 +00:00
Axel Heider
4d7cde075b CI: cancel older concurrent PR runs
Act on PRs only, not on upstreaming.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-03-26 20:56:54 +01:00
Gerwin Klein
4079d4c8b4 github: add AARCH64 C proof session
CRefine is now available for AARCH64 in l4v.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-03-25 17:40:37 +00:00
Axel Heider
271f6cc903 risc-v: make trap_entry a function
Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-03-23 08:48:42 +11:00
Axel Heider
ff422899fc trivial: remove superfluous empty line
Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-03-23 08:48:42 +11:00
Birgit Brecknell
0d799c3706 fix autoref whitespace errors
Signed-off-by: Birgit Brecknell <bbrcknl@gmail.com>
2024-03-22 09:02:23 +00:00
Birgit Brecknell
43690234f1 fix white spaces in <docref> tags
Signed-off-by: Birgit Brecknell <bbrcknl@gmail.com>
2024-03-22 09:02:23 +00:00
Birgit Brecknell
31e82e81da wrap docref references in <docref> tag
Signed-off-by: Birgit Brecknell <bbrcknl@gmail.com>
2024-03-22 09:02:23 +00:00
Birgit Brecknell
f6656e2c78 Add a glossary to the manual
Add a glossary with seL4-specific terms and their
definitions.
Remove chapter number from bibliography
Tweak Makefile for glossary

Signed-off-by: Birgit Brecknell <bbrcknl@gmail.com>
2024-03-20 14:54:06 +11:00