Commit graph

4555 commits

Author SHA1 Message Date
Gerwin Klein
0b4f14f8ae caveats: more Intel caveats
- missing MSI remapping feature
- clarifications on timing/micro-architectural attacks
- clarifications on Rowhammer

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-07-01 15:30:49 +10:00
Gerwin Klein
1aa42bec1d caveats: improve vspace reuse; tweak multikernel
- tweak SMP/multikernel text to make clear that SMP is not deprecated
- rephrase old VSpace reuse section hopefully be clearer

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-07-01 15:30:49 +10:00
Gerwin Klein
5c1d58c17e caveats: add MCS WCET and cache ops
- MCS WCET settings are just defaults without much basis
- stale page cap data also allows cache ops to proceed

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-07-01 15:30:49 +10:00
Gerwin Klein
f64c7b659d caveats: add tested platforms for SMP combinations
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-07-01 15:30:49 +10:00
Gerwin Klein
54040e84b3 caveats: rework correctness, add SMP, more MCS
- rework implementation correctness section, give
  more information, add roadmap items
- expand MCS section, add roadmap
- add SMP section + combinations

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-07-01 15:30:49 +10:00
Gerwin Klein
16003dfb6b caveats: consolidate into a single md file
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-07-01 15:30:49 +10:00
Gerwin Klein
e5d01aa3f2 vspace: check for stale mapping on all flush types
Frame caps should be checked for stale mapping info before authorising
any operation on them. In this particular case, the mapping may have
become invalid.

See also #1281

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-07-01 13:56:06 +10:00
Gerwin Klein
79cee3563f CHANGES: document dc ivac issue
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-30 21:35:29 +10:00
Gerwin Klein
dd3fe96db4 aarch64: check if page is writeable for DC IVAC
When performing data cache invalidate by virtual address, the mapping
must have write permissions, otherwise a fault will be generated by the
hardware. Therefore, when the kernel performs this operation during
cache maintenance invocations it must first check that the mapping has
write rights in the decode phase of the operation.

Co-authored-by: Kent McLeod <kent@kry10.com>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-30 21:35:29 +10:00
Indan Zupancic
cae4662a45 manual: params don't have errors
Signed-off-by: Indan Zupancic <indan@nul.nu>
2024-06-30 21:14:32 +10:00
Indan Zupancic
74b4768a59 manual: fix contact link
Signed-off-by: Indan Zupancic <indan@nul.nu>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-30 21:14:32 +10:00
Gerwin Klein
a1d8660218 trivial: update style
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-30 18:28:12 +10:00
Nick Spinale
a3f6be3c7c libsel4: add links in place of renamed XML files
This commit's parent renames the interface XML files.

The symlinks added in this commit serve to ease the transition to the
new names for downstream projects.

These links are added:

- include/interfaces/{sel4.xml -> object-api.xml}
- arch_include/*/interfaces/{sel4arch.xml -> object-api-arch.xml}
- sel4_arch_include/*/interfaces/{
    sel4arch.xml -> object-api-sel4-arch.xml
  }

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-30 18:28:12 +10:00
Nick Spinale
58fac368f3 trivial: Fix XML style
Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-30 18:28:12 +10:00
Nick Spinale
dbd6efc507 libsel4: rename interface XML files
Before, some object API XML files conflicted when the include,
arch_include, and sel4_arch_include directories were combined:

- include/interfaces/sel4.xml
- arch_include/*/interfaces/sel4arch.xml
- sel4_arch_include/*/interfaces/sel4arch.xml

This commit renames them to:

- include/interfaces/object-api.xml
- arch_include/*/interfaces/object-api-arch.xml
- sel4_arch_include/*/interfaces/object-api-sel4-arch.xml

Now, when the include, arch_include, and sel4_arch_include directories
are combined, we are left with:

- interfaces/object-api.xml
- interfaces/object-api-arch.xml
- interfaces/object-api-sel4-arch.xml

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-30 18:28:12 +10:00
Gerwin Klein
9a22e40b46 config.py: update comment to reflect kernel assert
The ELF loader may well be satisfied with a smaller alignment, but the
compile time assert in the kernel requires super section alignment for
physBase.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-30 12:45:37 +10:00
Gerwin Klein
c7822a1c1c config.py: fix SUPERSECTION_BITS for arm_hyp
This addresses #1186

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-30 12:45:37 +10:00
Nick Spinale
10bb153967 arm: add missing seL4_VPPIEvent_Length constants
Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-27 12:50:40 -04:00
Gerwin Klein
95fdffe4f2 CHANGES: update link to previous releases
The URL on the doc site has changed.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-27 10:26:46 -04:00
Ivan Velickovic
cbfeb8988a CHANGES: minor style/spelling fixes
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-06-27 10:26:46 -04:00
Gerwin Klein
91415f0461 CHANGES: remove broken link
The page no longer exists on the doc site, and the site does not
actually have more info, because the change log is generated from here.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-27 10:26:46 -04:00
Gerwin Klein
4a7d636767 CHANGES: add missing new platforms
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-27 10:26:46 -04:00
Gerwin Klein
47f82647a4 CHANGES: improve spelling and code quotes
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-27 10:26:46 -04:00
Gerwin Klein
3ec68b21ea CHANGES: add sections to upcoming releases
Only moves text, no content changes apart from section headers.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-27 10:26:46 -04:00
Gerwin Klein
254c1b0093 changes: improve markdown compliance
Improve markdown compliance to make sure the change log gets rendered
correctly on website and GitHub.

- use markdown headings for old releases
- make headings markdown-spec consistent so that editors can fold
  sections/releases
- use:
  - level-2 heading for release version
  - level-3 heading for main changes/upgrade notes etc
    (= one level down from before)
  - increase levels of rest accordingly
- consistent list indent (unbreaks rendering)
- use markdown <URLs> over bare URLs
- no content changes apart from one typo

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-27 10:26:46 -04:00
Gerwin Klein
50f682775a CHANGES: rename to CHANGES.md
This enables GitHub to render the content in a more readable way.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-27 10:26:46 -04:00
Ivan Velickovic
1aa9ff8511 manual: list all faults and fix style
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-06-26 20:10:53 +10:00
milicat
d3d4cc6023 Fix macro to get irq idx from irqt
Signed-off-by: milicat <milicat@foxmail.com>
2024-06-25 22:18:54 +10:00
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