Commit Graph

4470 Commits

Author SHA1 Message Date
Axel Heider
72f50774ec style: fix cmake formatting spec
Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-03-11 19:26:48 +00:00
Ivan Velickovic
70c7caf2f8 Fix USER_TOP config option being unconditional
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-02-29 17:16:56 +11:00
Ivan Velickovic
3740c2902c Fix DDR region for Odroid-C4
The Odroid-C4 is supposed to have 4GB of DDR memory.

According to the SoC manual (S905X3 Revision 02) the
DDR region goes from 0x0 to 0xF57FFFFF in Table 7-1.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-02-28 19:37:24 +01:00
Ivan Velickovic
903cf7c2a5 Fix Odroid-C4 MAX_IRQ setting
The S905X3 manual (Revision 02) specifies the highest IRQ
to be 255 in section 7.10.2 of the manual.

This issue was encountered when trying to use the PCIe
device on the platform which uses IRQs higher than 250.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-02-24 11:40:31 +00:00
Gerwin Klein
9a2bbe30b8 changes: describe VCPU fix
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-02-21 12:03:38 +11:00
Gerwin Klein
d26f1ff4d2 vcpu: guard against NULL ptr dereference
The vcpu is not guaranteed to be associated with a TCB at this point,
so access to vcpuTCB must be guarded.

Fixes #1199

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-02-21 12:03:38 +11:00
Kent McLeod
31ca173e17 elfloader: Replace calls to reset_cntvoff
These calls can now be implemented via binding the /timer driver in the
elfloader's device tree configuration.

Signed-off-by: Kent McLeod <kent@kry10.com>
2024-02-19 10:26:36 +00:00
Axel Heider
a8eebabf58 CI: remove obsolete concurrency setup in job
The concurrency is set for the whole workflow already

Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-02-09 12:59:04 +00:00
Gerwin Klein
1a52833c6f github: disambiguate proof artifact upload
Proof artifact upload had name clashes for different artifacts from the
same job that previously would overwrite each other and with v4 actions
now error. This commit disambiguates the names.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-02-09 11:02:49 +11:00
Nick Spinale
9bac64c6ce libsel4: Eliminate unnamed enums
Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-02-08 15:34:14 +11:00
Nick Spinale
7d3353332a cmake: install object API files under better names
These files cannot be installed under the same names as those in the
source tree because the two named sel4arch.xml conflict. These cannot be
renamed in the source tree because of other projects which expect them
under their current names.

Commit cf80db7ef0 enabled them to be installed them under
non-conflicting names, but those names (sel4.xml, sel4-arch.xml,
sel4-sel4arch.xml) are confusing and too close to the original names.

This commit changes the names they are installed under to be more clear
and descriptive (object-api.xml, object-api-arch.xml,
object-api-sel4-arch.xml).

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-02-08 09:17:54 +11:00
Kent McLeod
76eee24323 cmake: Support multiple overlay files
Allow multiple overlay files to be specified. This supports custom
tooling support to add additional memory reserve regions to a platform.

Signed-off-by: Kent McLeod <kent@kry10.com>
2024-02-06 21:52:31 +11:00
Axel Heider
245c07fa2e QEMU/arm: select CPU from architecture
Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-02-06 08:48:19 +11:00
Axel Heider
b770e2d71e CMake, QEMU/arm: fix parser usage
- ${ARGN} was missing
- fail for unknown flags

Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-02-06 08:48:19 +11:00
Rafal Kolanski
c9989664e3 AArch64: mark isFpuEnable as DONT_TRANSLATE
Current verification model does not include lazy FPU switching, i.e. it
acts as if this function always returns true, so no FPU faults could be
produced. In order to guard against deriving a contradiction, we don't
allow the C parser to translate it.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2024-02-02 09:14:07 +11:00
Axel Heider
91ec17c5bf CI: cancel older concurrent PR runs
Remove the space in the workflow name to ensure there are no side
effects when using it as an identifier.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-01-31 10:25:00 +11:00
Axel Heider
eda441ebe7 CI: the seL4/machine_queue repo is public now
Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-01-30 12:26:50 +00:00
Gerwin Klein
64b1282acc aarch64/vspace: type of counter in ASIDPoolAssign
As in the other architectures, avoid unnecessary casts for the loop
counter by making it a word_t.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-30 09:22:41 +11:00
Gerwin Klein
fa28409d55 github: bump GitHub actions to node20
GitHub has updated the LTS node.js version from 16 to 20 and is
starting to show warnings for node16 actions.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-29 10:11:25 +11:00
Gerwin Klein
241d8d12c7 aarch64/vspace: fix error reporting in decode
seL4_InvalidCapability expects invalidCapNumber to be set.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-26 08:52:01 +11:00
Nick Spinale
9ec543ce5a cmake: propagate CROSS_COMPILER_PREFIX
Mark CROSS_COMPILER_PREFIX as meaningful to gcc.cmake, so that it is
propagated for all cases where gcc.cmake used.

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-01-25 13:28:23 +11:00
Gerwin Klein
5df6964782 aarch64/vspace: test for page type directly
Test the PTE directly for being of page type and avoid ptr access to
ease verification in unmapPage.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-25 07:32:42 +11:00
Alwin Joshy
6baeeaef21 hw debug api: fix single stepping on ARMv7
The implementation of single-stepping on ARMv7 relies on instruction
mismatch breakpoints. The implementation sets one of the breakpoint
value registers (BVR) to NULL and configures the corresponding
breakpoint control register (BCR) to generate a debug exception for
instructions that are at any other virtual address. This is incorrect
as it means that when single-stepping is enabled, no progress will
ever be made by the thread, as every instruction will mismatch with
NULL and result in the generation of a debug exception.

This commit resolves this issue by setting the BVR to the LR of the
thread at the moment single stepping is configured. Then, when the
thread is permitted to execute again, the instruction pointed to by
the LR will be executed, but any other instruction will result in a
debug exception. It also changes the debug exception hander to
update the BVR to the new LR when a single-stepping execption occurs
so that we can step over multiple instructions before sending a debug
fault to the appropriate fault handler thread.

Signed-off-by: Alwin Joshy <joshyalwin@gmail.com>
2024-01-23 10:34:39 +00:00
Gerwin Klein
cc3205ea48 aarch64/vspace: simplify check for page PTE
- directly test for page PTE types instead of testing for invalid etc.

- remove unnecessary condition `resolve_ret.ptBitsLeft > PAGE_BITS`
  (always true).

- reduce bitfield accesses via pointers to make verification easier.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-22 14:58:49 +11:00
Gerwin Klein
7f4662a791 Revert "aarch64/vspace: allow flushing larger .."
This reverts commit 494dd2dd96.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-22 14:58:49 +11:00
Gerwin Klein
494dd2dd96 aarch64/vspace: allow flushing larger pages
- The failure condition `resolve_ret.ptBitsLeft > PAGE_BITS` prevented
  larger page sizes from being flushed in VSpaceRoot invocations.

  Instead of testing for number of bits left to resolve, simply check
  the PTE whether it is a page or not.

- reduce bitfield accesses via pointers to make verification a bit
  easier.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-22 11:29:04 +11:00
Birg
0a0739074d manual: add bibliography to toc
Signed-off-by: Birg <bbrcknl@github.com>
2024-01-22 10:09:11 +11:00
bbrcknl
cbf25791b7 make method names consistent (#1144)
* make method names consistent; delete duplicates

Signed-off-by: Birg <bbrcknl@github.com>
2024-01-19 14:25:02 +11:00
Gerwin Klein
95cfd473e6 aarch64/vspace: adjust type for verification
Bring the type of `i` into line with what the other architectures do
in this function. This makes it easier to re-use those proofs.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-19 08:50:27 +11:00
Gerwin Klein
0398d34ad0 aarch64/vspace: avoid unnecessary casts
Type invLabel consistently as word_t, not sometimes as unsigned int.
This makes verification easier because it avoids unnecessary casts.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-16 12:39:13 +11:00
Gerwin Klein
2b29446484 aarch64/vspace: add performASIDControl annotations
Type and ghost state annotations for verification.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-16 10:55:41 +11:00
Gerwin Klein
5d1f3bc3ce tqma8xqp1gb: fix MAX_IRQ setting
The highest defined interrupt in the data sheet is 543 - 32 = 511.
This is important, because the code expects all IRQ numbers to fit into
9 bits (which 511 does, but 512 would not).

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-16 10:55:41 +11:00
Gerwin Klein
4a2f8e7a81 aarch64 structures: constrain irq_w field width
The rest of the code uses 9-bit irq width. Keep in sync here to ease
verification.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-16 10:55:41 +11:00
Gerwin Klein
2dec06fc4f aarch64: add verification retype annotations
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-16 10:55:41 +11:00
Gerwin Klein
836c180f0d aarch64: verification tweaks for getMapRefForASID
Refactor getMapRefForASID for verification into separate parts, because
the returned pointer doesn't exist as a concept in the executable spec.
Also avoid ptr_set functions to simplify heap reasoning.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-01-16 10:55:41 +11:00
Axel Heider
73553606f1 CI: update deploy workflow also
This is missing in commit e6fbbbb0

Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-01-13 10:17:31 +11:00
Axel Heider
e6fbbbb065 CI: do simulation and HW build with LLVM on RISCV
Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-01-12 07:50:50 +11:00
Axel Heider
454245febd CI: build standalone kernel for RISCV64 with LLVM
Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-01-12 07:50:50 +11:00
Axel Heider
ed613d7d49 python: remove unused template parameter
Since commit cf8be663 this is no longer needed.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2024-01-02 10:55:45 +11:00
Cindy Liu
498fd84a55 use raise warining in version check
Signed-off-by: Cindy Liu <hcindyl@google.com>
2023-12-28 06:05:07 +07:00
Cindy Liu
807a42e91e Move the version check just before the usage
Signed-off-by: Cindy Liu <hcindyl@google.com>
2023-12-28 06:05:07 +07:00
Cindy Liu
04dc9675f3 Replace deprecated pkg_resources usage
Use importlib.metadata to check the jinja2 version

Signed-off-by: Cindy Liu <hcindyl@google.com>
2023-12-28 06:05:07 +07:00
Gerwin Klein
7bad3610f1 github: upload kernel.elf build artifact
The kernel.elf file is occasionally more useful for debugging than the
final board image.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-12-12 08:12:10 +01:00
Birg
9a532efc15 change CPTR to CPtr
Signed-off-by: Birg <bbrcknl@github.com>
2023-12-06 10:41:28 +00:00
Rafal Kolanski
d92c49ab9b arm hyp: avoid implicit downcast to local vars
lr_num is assigned to from word_t, so should also be word_t rather than
unsigned int.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-12-06 03:23:49 +11:00
Rafal Kolanski
55aee64707 arm hyp: gic_vcpu_num_list_regs should be word_t
On AArch64, if this is int, we encounter a situation where we can't
prove equivalence with the abstract spec without an extra invariant that
the number of these registers isn't zero (to satisfy 32<->64 bit casts).
Sticking with word size will make sense on both 32 and 64 bit.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-12-06 03:23:49 +11:00
Rafal Kolanski
66e5c79d06 Arm 64-bit: do not use unsigned int for arg length
Arch_decodeInvocation takes a word_t length and then passes it to
functions that take an unsigned int length. This was OK on 32-bit where
these types are the same, but on 64-bit this is a downcast without a
range check. It isn't clear why this doesn't trip a compiler warning.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-12-06 03:23:49 +11:00
Birg
391bfb15f8 update some manual todos
Signed-off-by: Birg <bbrcknl@github.com>
2023-11-29 10:21:32 +00:00
Axel Heider
94c5a0b53a cmake: show DTS name in error message
Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-11-27 14:24:55 +00:00
Axel Heider
b59fa0ed20 riscv: use MAX_IRQ instead of PLIC_MAX_NUM_INT
Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-11-24 09:57:46 +00:00