Commit Graph

4470 Commits

Author SHA1 Message Date
Gerwin Klein
0328754e11 manual: prevent unnecessary rebuilds
- use a marker file to get a time stamp for when doxygen output was
  last generated. Use that as a file target instead of a phony target
  to avoid rebuilds when there is nothing to do.

- use static pattern rules so that `make` creates files instead of
  giving up when the prerequisite of a pattern rule does not exist yet.

- remove file list duplication (needed because the static pattern
  rules also need to mention these files)

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-27 21:25:48 +11:00
Gerwin Klein
aa89ae064e manual: remove obsolete doxygen options
Remove options that are obsolete in doxygen >= 1.9. We only use default
values here, so everything should keep working as before in doxygen 1.8.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-27 21:25:48 +11:00
Gerwin Klein
5e0b95fecf manual: fix broken links and latex complaints
- fix broken links in the document
- small tweaks to make latex complain less:
  - increase headheight by 2pt
  - give small possible stretch value to parskip for filling pages
  - use \sloppy for TOC to avoid unnecessary overfull hboxes
  - make table placement more explicit (it currently doesn't fit
    where [h] wants to place it, so allow it to go to the top of
    the next page)

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-27 21:25:48 +11:00
Gerwin Klein
86eb4f77f5 Move getActiveIRQ() close to use site (#993)
The computation in mcsPreemptionPoint no longer depends on the irq, so
getActiveIRQ() can be called closer to the actual use site of the irq.

This makes things slightly easier for verification because we don't need
to reason about potential side effects of mcsPreemptionPoint before
the irq value is used.

Closes #472

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-26 08:16:19 +11:00
Gerwin Klein
621a1ddd76 remove unused argument from mcsPreemptionPoint (#992)
The irq argument in mcsPreemptionPoint is unused since the refactor
in d8caaf754d (PR #327).

Fixes #991

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-25 12:10:57 +11:00
Kent McLeod
a7fcda4267 x86,boot: Round normal memory regions to 4k align
Round down intial normal descriptions of memory regions to 4k alignment
which ensures that all physical memory should be able to be turned into
frame objects and mapped into user level for access.

Signed-off-by: Kent McLeod <kent@kry10.com>
2023-03-17 14:11:48 +11:00
Alwin Joshy
f8b2440b38 Implemented the vm fault fastpath on aarch64
This fastpath optimizes the performance of VM faults in
seL4. It is heavily based on the existing seL4_Call
fastpath and includes the addition of fastpathing replies
to faulted threads in the seL4_ReplyRecv fastpath.
Currently only supported only implemented for aarch64.

Signed-off-by: Alwin Joshy <joshyalwin@gmail.com>
2023-03-08 17:58:14 +11:00
Rafal Kolanski
65a1b457a4 make physBase a static inline function
For verification flexible w.r.t kernel placement in physical memory, we
need to relate physBase as a named constant to its abstract equivalent.
Unfortunately, apart from enums, the C programming language does not
have real constants. The C parser follows the C standard and requires
enums constants to be storable as int, meaning without major overhaul
enums are not sufficient for storing word_t-sized memory addresses.

Since the linker scripts can't deal with static inline functions
in the constants they need (KERNEL_ELF_BASE and KERNEL_ELF_PADDR_BASE),
we provide the following preprocessor definitions for the linker
specifically:
* PHYS_BASE_RAW (the numerical value returned by physBase())
* KERNEL_ELF_BASE_RAW
* KERNEL_ELF_PADDR_BASE_RAW

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-03-07 14:29:14 +11:00
Gerwin Klein
8206c80362 CHANGES: upgrade note for seL4_MinSchedContextBits
The seL4_MinSchedContextBits change has a predictable failure mode that
is not easy to debug otherwise.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-06 21:54:08 +11:00
Gerwin Klein
e4f91dbc63 trivial: md style in CHANGES
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-06 21:54:08 +11:00
Gerwin Klein
ecbeacb3ab constants.h: explain seL4_CoreSchedContextBytes
The "excluding extra refills" was confusing. seL4_CoreSchedContextBytes
is the size of sched_context_t + minimum refills, excluding any extra
refills.

We'd write it that way, but sched_context_t is not in scope in this
file.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-06 21:54:08 +11:00
Nick Spinale
9f94eb1462 cmake: mention gen_config.h change in CHANGES
gen_config.h files are now generated at build time rather than configure
time.

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2023-03-06 20:57:47 +11:00
Matthew Brecknell
843b944a31 configs: Use only BV-compatible optimisations
For verified configurations on which we perform binary verification,
ensure that we disable certain whole-program optimisations that are
incompatible with binary verification.

Signed-off-by: Matthew Brecknell <matt@kry10.com>
2023-03-03 20:41:39 +11:00
Matthew Brecknell
b9c5f53bce ci proof: Upload build artifacts
For proof workflow runs on seL4 PRs, upload kernel build artifacts
generated by the aws-proofs action. These can be used to run binary
verification, although we currently still require binary verification to
be manually triggered.

Signed-off-by: Matthew Brecknell <matt@kry10.com>
2023-03-03 17:47:32 +11:00
Ivan-Velickovic
4ddbab772c Include change to MinSchedContextBits in CHANGES
The value changed in bb6a00ffe2.

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2023-03-02 16:43:19 +11:00
Kent McLeod
a90f0101c0 AARCH64_verified: Disable SMMU
Verification target isn't including SMMU at the moment.

Signed-off-by: Kent McLeod <kent@kry10.com>
2023-03-02 14:35:13 +11:00
Kent McLeod
2691ff3dbb smmu: Add missing #ifdef guards
This file's implementation shouldn't be included if CONFIG_ARM_SMMU is
not set.

Signed-off-by: Kent McLeod <kent@kry10.com>
2023-03-02 14:35:13 +11:00
Kent McLeod
6702f3322e ARM_SMMU: Fix configuration handling for SMMU opt
The TX2 is currently the only platform that supports CONFIG_ARM_SMMU and
wants it on by default, however the CMake scripts wouldn't allow it to
be disabled. Now it should work normally:
- When TX2 is set the config is enabled unless it's preconfigured to
  OFF.
- When the platform is changed to not TX2, the SMMU option is turned
  off.

Signed-off-by: Kent McLeod <kent@kry10.com>
2023-03-02 14:35:13 +11:00
Nick Spinale
6d439a4646 cmake: install gen_config.json files
To enable access by external tools outside of CMake.

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2023-03-02 09:31:42 +11:00
Nick Spinale
c642a398ba cmake: provide gen_config.json
gen_config.json provides a language-independent means of accessing the
kernel configuration. Before, gen_config.h was generated directly in
CMake.  Now, gen_config.yaml is generated directly in CMake, and
gen_config.h and gen_config.json are derived from gen_config.yaml.

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2023-03-02 09:31:42 +11:00
Nick Spinale
acba034390 cmake: add missing dependency for autoconf
Declare that autoconf.h depends on each gen_config.h that it references.

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2023-03-02 09:31:42 +11:00
Nick Spinale
db9de2d2f5 cmake: install kernel.dtb and platform_gen.yaml
To enable access by external tools outside of CMake.

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2023-03-01 09:42:58 +11:00
Nick Spinale
cf80db7ef0 cmake: install .pbf and .xml files
To enable access by external tools outside of CMake.

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2023-03-01 09:42:58 +11:00
Nick Spinale
b291e943e5 libsel4: expose .pbf files
To enable access by external tools.

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2023-03-01 09:42:58 +11:00
Chris Guikema
dd41d4de63 riscv: reserve entire device-tree page
On the softcore rocketchip instantiation, rootserver behavior was
inconsistent. Rounding up the device tree size fixes this problem

Signed-off-by: Chris Guikema <chris.guikema@dornerworks.com>
2023-02-22 09:35:14 +11:00
Chris Guikema
3552f94d84 riscv: add 8-byte padding for rocketchip-zcu102
These bytes were removed in commit f8d12311ba, but are needed for the
softcore instantiation that runs on the ZCU102. Without the bytes,
the rootserver can run into errors.

Signed-off-by: Chris Guikema <chris.guikema@dornerworks.com>
2023-02-22 09:35:14 +11:00
Chris Guikema
d11179e3f0 riscv: fix interrupt claim
A QEMU bug caused interrupts that were not immediately claimed to be
left unclaimed. On real hardware, immediately claiming the interrupt
never allows it to be handled. This results in hardware peripherals
not functioning properly.

Co-authored-by: Eric Spidle <eric.spidle@dornerworks.com>

Signed-off-by: Chris Guikema <chris.guikema@dornerworks.com>
2023-02-22 09:35:14 +11:00
Chris Guikema
b99e1ba325 rocketchip-zcu102: use plic0
On the ZCU102 Rocketchip instantiation, the PLIC is available required
to use hardware peripherals like a UART

Signed-off-by: Chris Guikema <chris.guikema@dornerworks.com>
2023-02-22 09:35:14 +11:00
Chris Guikema
bebac7ffe2 rocketchip: differentiate opensbi platform
Signed-off-by: Chris Guikema <chris.guikema@dornerworks.com>
2023-02-22 09:35:14 +11:00
Chris Guikema
86a6beb1d6 rocketchip: add zcu102 platform
Since the rocketchip can be instantiated on a variety of FPGA fabrics,
it makes sense be begin differentiating them. This commit adds a
RocketchipZCU102 sub-platform for the version of the rocketchip that
can run on a ZCU102.

Signed-off-by: Chris Guikema <chris.guikema@dornerworks.com>
2023-02-22 09:35:14 +11:00
Michael McInerney
3ae685ab1c mcs: update AUXUPD comment for verification
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2023-01-31 08:26:30 +11:00
Klim Tsoutsman
d90fada8b3 libsel4: update seL4_NBWait attributes
Currently, building `libsel4` as a static library with `KernelIsMCS`
enabled fails with the following error:

```
static declaration of 'seL4_NBWait' follows non-static declaration
```

This [was mentioned][1] in the original PR that modified exported
functions to use `LIBSEL4_INLINE_FUNC`.

[1]: https://github.com/seL4/seL4/pull/101#issuecomment-442010551

Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
2023-01-17 09:08:07 +11:00
Axel Heider
d14c53974c user proper field from thread context structure
The thread context structure layout is explicitly designed to have the
register context first, as this simplifies saving the user context on
entry in assembly code. On the exit path there is no need to hard-code
this assumption, stick to the semantics and leave details to the
compiler.

Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2023-01-13 10:22:28 +11:00
alwin-joshy
069c937272 Implemented signal fastpath on AARCH64 (#793)
The signal fastpath aims to optimize the
seL4_Signal operation. In this commit, it is
implemented for MCS AARCH64 (SMP and non-SMP).
The fastpath does not include the case where
signaling results in a higher priority thread
being unblocked and made available for
scheduling (on any core). It does not
fastpath the case where the signaled thread
is donated a scheduling context and has its
FPU state saved in the FPU of a core.

Co-authored-by: Shane Kadish <shane.kadish@csiro.au>
Signed-off-by: Alwin Joshy <joshyalwin@gmail.com>
2023-01-10 10:15:39 +11:00
michaelmcinerney
41a1399348 mcs: remove redundant memzero from createObject (#958)
This removes a memzero call from the seL4_SchedContextObject and seL4_ReplyObject cases of createObject. The memory is now cleared via clearMemory within resetUntypedCap

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2023-01-10 08:42:54 +11:00
Seiya Nuta
9d7b1f9474 manual: Fix a typo in threads.tex
Signed-off-by: Seiya Nuta <nuta@seiya.me>
2023-01-08 13:57:52 +11:00
Axel Heider
2493fc1c57 doc: fix typo
Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-12-03 09:04:31 +11:00
Axel Heider
3ff55cdb0f risc-v: limit memory to 2 GiB on RV32
Co-authored-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-12-03 08:21:29 +11:00
Axel Heider
838b9a4331 risc-v/plic: support rv32 targets
Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-12-03 08:21:29 +11:00
Axel Heider
2d7ded68c6 use macro ARRAY_SIZE
Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-11-23 16:26:30 +11:00
Peter S. Housel
8ca4a87c9a Add Quartz64 support
This adds support for the Pine64 Quartz64 and other devices based on
the Rockchip RK3566. The platform support is adapted from the
Rockpro64 code, except that the RK356x has A55 cores, and adjusting
for the fact that the ARM Generic Timer is the only on-chip timer
available.

Signed-off-by: Peter S. Housel <housel@acm.org>
2022-11-21 16:43:20 +11:00
Gerwin Klein
bbafa62d30 github: update to Isabelle2022
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-11-21 15:59:06 +11:00
Gerwin Klein
ab30e1cad6 github: bump action deps to node16 actions
GitHub has deprecated the old node12-based actions.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-11-21 15:59:06 +11:00
Axel Heider
3bb6bc2a60 zynq7000: fix DTS overlay on MCS
Apply changes from commit 0f619780 for MCS also

Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-11-21 09:59:05 +11:00
Axel Heider
548a81a057 riscv: support qemu-riscv-virt platform
Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-11-13 11:53:54 +11:00
Axel Heider
9b4ce51a65 cmake: extend qemu-arm-virt script
- makes setting more generic an allow overriding parameters
- save QEMU parameters in DTS as comment

Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-11-13 11:53:54 +11:00
Axel Heider
1d19d9f576 qemu-arm-virt: add more supported CPUs
Also reject any unknown CPU.

Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-11-13 11:53:54 +11:00
Axel Heider
136e36e553 cmake: use built-in whitespace handling
Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-11-13 11:53:54 +11:00
Gerwin Klein
fa4dfa93e4 github: enable sel4bench hardware test on PR
Like the sel4test hardware runs, a sel4bench run can be requested via
adding a label (`hw-bench`) to any PR.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-11-11 17:08:57 +11:00
Axel Heider
ceae4620aa x86/ia32: use proper variable in debug code
Fix issues from refactoring in commit 27b4411e

Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-11-11 13:52:25 +11:00