Commit Graph

4789 Commits

Author SHA1 Message Date
Gerwin Klein d3ecd0e451 aarch64 lib: add 64 bit word setup
This is equal to the setup for RISCV64 and X64.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-02-03 16:13:45 +11:00
Gerwin Klein 04626b0a88 cspec: enable preprocess test for AArch64
This commit adds compiler prefixes for AArch64 so that the preprocess
test finds the right cross compilers for this architecture.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-02-03 13:41:06 +11:00
Gerwin Klein c4fe1abb3d github: provide auth tokens
These allow the test to run on private repos. If set to empty, they
have no effect.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-02-02 09:25:58 +11:00
Gerwin Klein a4c80a6887 github: use PR number to distinguish pull requests
${{github.ref}} will resolve to the base branch of the PR, not the
PR branch, so it is not useful for distinguishing PRs. The pull request
number will do the job.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-02-01 14:49:38 +11:00
Gerwin Klein d831ddea67 github: run AWS proofs only on most recent push
By default GitHub spawns a new test for each push event. To avoid
hitting the maximum number of AWS instances too quickly, we run the PR
and master proof tests only on the most recent push since the last test
finished.

The concurrency exclusion is per git ref, i.e. separate PRs and
separate branches still run tests concurrently.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-01-11 18:20:45 +11:00
Gerwin Klein 24c0c5c390 spec+proof: use generated config constants
This includes replacing previous ASpec names for such constants with
the names used in Haskell/ExecSpec to avoid duplication. This also
makes some of the proofs slightly more generic.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-12-23 14:54:13 +11:00
Gerwin Klein 8929a6d729 machine+C: generate Kernel_Config.thy from C
This script takes the gen_config.h file CMake produces for each kernel
configuration, parses it, and emits corresponding Isabelle definitions
into Kernel_Config.thy in spec/machine/$L4V_ARCH/

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-12-23 14:54:13 +11:00
Gerwin Klein 3b616f535a cspec: separately generate C config headers
This is in preparation for later turning these config headers into
Isabelle definitions.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-12-23 14:54:13 +11:00
Rafal Kolanski 73911da72d infoflow refine: make proofs independent of number of domains
The InfoFlow proof itself does not care about the number of domains, and
that assumption was removed in another commit.
The specific example in the information flow refinement requires two
domains (one "high" and one "low") to be of any interest. Since it
cannot be instantiated with only one domain, the example theorems in
Example_Valid_StateH now assume that `1 <= maxDomain`.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2021-12-22 23:50:22 +11:00
Rafal Kolanski b57a755e40 crefine: make proofs independent of number of domains
For CRefine, this process is much more complex than for Refine and up,
as the C code both has its own definitions `maxDom` and `numDomains`,
but they are not defined in terms of each other, only numbers.
Similarly, array size types and their corresponding ArrayGuard bounds
checks refer to specific numbers, making a fullproof abstraction impossible.

A reasonably constrained interface to numDomains/maxDomain/maxDom in
Wellformed_C provides a sufficient abstraction to allow the proofs to be
independent of the number of domains (constrained to <= 256). Using the
value_type command allows more abstraction techniques, such as linking
the size of the scheduler queues back to numDomains*numPriorities,
without stating what the numbers are. Finally, for getting past the
ArrayGuard bounds checks, we do leak some information in the form of
`explicit` lemmas. These are the least safe, but short of augmenting the
C parser to re-wrap array sizes into equivalent constants/types, they
constitute a limited risk. Nonetheless, `explicit` lemmas should be used
as sparingly as possible.

Refinement to C proceeds by pretending we don't know the number of
domains, and whenever a control flow decision is made based on
`numDomains > 1`, we follow both branches, as we did for Refine. We also
attempt to avoid clever rewrites such as `(x < 1) = (x = 0)` which mess
up bounds checks into a domain-size array when `numDomains = 1`.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2021-12-22 23:50:22 +11:00
Rafal Kolanski b8fc709d21 refine+orphanage: update proofs to never unfold numDomains
Proofs now don't care about numDomains, except for a small interface in
Invariants_H. The interface is currently by convention only, and has no
enforcement capabilities.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2021-12-22 23:50:22 +11:00
Rafal Kolanski 8052df4ac6 infoflow: remove dependency on domains > 1
The proofs work without knowing the number of domains, including with
only a single domain.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2021-12-22 23:50:22 +11:00
Rafal Kolanski d91afcb5c1 ainvs: update proofs to never unfold numDomains
Make proofs work with any number of domains that fits in the domain type
(at this time an 8-bit word).

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2021-12-22 23:50:22 +11:00
Rafal Kolanski ec79dc3330 aspec+design+haskell: extract numDomains into Kernel_Config
Introduce Kernel_Config theory for storage of non-architecture-specific
seL4 configuration variables that are shared by the abstract and design
specs.

Remove `num_domains`, in lieu of `numDomains` that is now defined only
in `Kernel_Config.thy`. The definition is hidden and must be referred to
as Kernel_Config.numDomains_def when avoiding unfolding is not possible.

Include required properties of `numDomains` as lemmas.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2021-12-22 23:50:22 +11:00
Gerwin Klein 78007a4179 lib: add value_type command
The `value_type` top-level command allows evaluating a term down to a
natural number, and using that number to define an enumerated type, as
well as (optionally) a constant definition.

Co-authored-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-12-22 23:50:22 +11:00
Gerwin Klein f33b02f3d0 docs: use archive link for locale docs
This link is stable over Isabelle releases and can be updated once
the repo switches over to the next release.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-12-21 16:28:29 +11:00
Gerwin Klein ce67a725f7 cspec: more compiler options
The new docker containers that upgraded to gcc-10 use a different
version of the gcc Arm toolchain (`arm-linux-gnueabi`).

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-12-09 11:07:22 +11:00
Gerwin Klein 46a1d2509a crefine: update for PR seL4/seL4#321
The aim of the PR was readability, but it actually also brings the
C more in line with the spec.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-12-06 16:44:39 +11:00
Gerwin Klein 614e24ee10 riscv machine: use address size consistently
In the rest of the proofs we use machine_word to refer to addresses.
This commit brings the machine definitions in line with that.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-12-03 17:06:37 +11:00
Ryan Barry 72ab7cc180 various: resolve some new fixmes
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry d619052b02 run_tests: enable RISCV64 InfoFlow tests
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 0c2767b197 riscv infoflow refine: add Example_Valid_StateH
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 60e8d4ff17 riscv infoflow: add Example_Valid_State
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 9f1d259f87 infoflow refine + refine: add refinement proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 1b1814c9b1 arm infoflow: update proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 82fd48d769 riscv infoflow: add Noninterference proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 1ec4ee4183 riscv infoflow: add ADT proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry d17d2e3079 riscv infoflow: add UserOp proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 66c5f72a14 riscv infoflow: add Scheduler proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry b55aa6a20a riscv infoflow: add Syscall proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 21a0525e59 riscv infoflow: add PasUpdates proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry ec046f56b7 riscv infoflow: add Tcb proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry f0bb85e7ab riscv infoflow: add Decode proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 78884cdb2b riscv infoflow: add Ipc proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 87b9ad2d0f riscv infoflow: add Interrupt proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry e59ff2683f riscv infoflow: add Finalise proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 528efc681d riscv infoflow: add Arch proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry c707434eb5 riscv infoflow: add Retype proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry ee5185fcf1 riscv infoflow: add CNode proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry b4f3049261 riscv infoflow: add FinalCaps proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry bba0760e47 riscv infoflow: add InfoFlow spec changes + proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry 0d4f451011 riscv infoflow + design: add IRQMasks proofs
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Ryan Barry edb555382b access: strengthen integrity_asids on RISCV64
Signed-off-by: Ryan Barry <ryan.barry@unsw.edu.au>
2021-11-12 09:39:16 +11:00
Corey Lewis f28ce0b310 lib: notify if crunch generates side-conditions
Signed-off-by: Corey Lewis <corey.lewis@unsw.edu.au>
2021-11-10 16:39:23 +11:00
Gerwin Klein 141d2f4b67 docs: fix typo
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-11-03 15:11:39 +11:00
Gerwin Klein 80a2ba76c6 docs: apply markdown lint
Rewrap and adjust list indent in conventions.md

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-11-03 15:11:39 +11:00
Gerwin Klein 715501a969 docs: variable and parameter name conventions
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-11-03 15:11:39 +11:00
Gerwin Klein ab358b835d autocorres: update release.py to python3
Apparently, we still did releases with python2 in the past. This commit
updates the script to work cleanly with python3 and with both of Linux
and Darwin.

For the latter, untarring and executing a downloaded tarball is not
easily supported on MacOS, so instead of the tarball, we take a path to
the already unpacked Isabelle release.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-31 13:41:58 +11:00
Gerwin Klein 78033ab5e4 docs: bump Isabelle version in setup instructions
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-31 13:41:58 +11:00
Gerwin Klein 2cf262f2b0 autocorres: release notes for autocorres-1.8
Includes some minor documentation updates.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-31 13:41:58 +11:00