Commit Graph

4186 Commits

Author SHA1 Message Date
Rafal Kolanski d6706a5e03 riscv crefine: CSpaceAcc_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski d2f648ef10 riscv crefine: Machine_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski fdd5408c7e riscv crefine: SR_Lemmas_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski ac771e5958 riscv crefine: set up state relation
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski a2ea423e76 crefine: valid_untyped' lemma is not generic
Move it to ArchMove_C for each architecture except RISCV64. On RISCV64
the definitions of obj_range has changed to use mask_range and hence the
lemma statement would look different.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-04 23:29:52 +10:00
Rafal Kolanski 8f7b838b72 riscv crefine: update to Move_C/ArchMove_C includes
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-04 23:29:52 +10:00
Gerwin Klein d8165c0c3e riscv crefine: spdx license headers
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-04 23:29:48 +10:00
Rafal Kolanski d7243fe80c riscv crefine: Move.thy -> Move_C.thy
Reflect change for other platforms.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-04 23:28:58 +10:00
Gerwin Klein 3f80b582ee riscv crefine: add AutoCorresTest stub (empty)
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-04 23:28:58 +10:00
Gerwin Klein e6f27344e9 run_tests: enable RISCV64 CRefine test
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-04 23:28:52 +10:00
Gerwin Klein 991790150d riscv crefine: skeleton + CtoCRefine
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-04 23:28:32 +10:00
Gerwin Klein d0dade06f4 riscv crefine: set up CBaseRefine
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-04 23:14:54 +10:00
Rafal Kolanski c4f6572aff arm+arm-hyp: move TPIDRURO from vcpu to tcb context
Update specs and proofs for ARM platforms to contain TPIDRURO in the
TCB user context rather than treating it as a VCPU register, following
change in C.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-05-15 13:14:24 +10:00
Gerwin Klein 96d0470629 haskell: remove check-newlines test
This was used to make sure the LaTeX document from literate Haskell builds.
Since this document is retired, we don't need the check any more.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-05-14 13:36:11 +08:00
Edward Pierzchalski 7c6b2af816 refine: comments for pspace_storable
We keep on forgetting what the parameters to loadObject and storeObject
mean, and why we have pspace_storable in the first place. Hopefully
these comments mean having to re-remember fewer things.

Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-05-13 11:54:15 +08:00
Edward Pierzchalski bd4392d132 lib: add ML_goal command
Sometimes we want to prove a fact, but the fact is painful or
error-prone to type out manually. In these cases, we'd like to construct
the goal fact using ML and then immediately enter a proof block.

Previously, we could achieve something like this through careful use of
`Thm.trivial` and `schematic_goal`, but this would clutter up the ML
namespace and wouln't handle meta conjuncts (`&&&`). The new `ML_goal`
command addresses both of these issues.

Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-05-13 11:53:50 +08:00
Edward Pierzchalski b153cb9571 lib: add some list utilities
Adds `unfold` for constructing a list from a generating function, and
adds `range` for constructing a range of numbers.

Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-05-13 11:53:35 +08:00
Gerwin Klein b7525f8d43 misc: make memusage.py not crash on MacOS for newer psutil versions
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-05-12 16:58:46 +08:00
Gerwin Klein 71e7f87614 haskell/refine/crefine: rename isBlocked to isStopped
sync with corresponding change in C

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-05-06 15:49:02 +10:00
Gerwin Klein 2574ea6bc0 refine: remove duplicate update rule
makes use of the actual warning in add_upd_simps that was hidden in the
noise before.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-05-04 17:03:09 +08:00
Gerwin Klein 77067c2462 lib AddUpdSimps: cleanup + remove old debugging code
The command produced warnings as debug output.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-05-04 17:02:58 +08:00
Gerwin Klein 3aa849daea lib: remove infix warning
The (=) syntax is Isabelle, not ML, and was updated accidentally.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-05-04 16:08:51 +08:00
Edward Pierzchalski 55d9f5741f c-parser: include alias info in mungedb
Changes the mungedb to also indicate whether a given munged name has an
alias.

In the Distant Past, the C parser emitted long and short names, and the
mungedb output recorded those names. When definitions were reordered in
a C file, different C variables might get the short name; this could
break proofs, but the mungedb output would indicate the change ahead of
time.

Now, the C parser emits long names for every C variable, but it also
emits a short abbreviation to replicate the behaviour of the C parser in
the Distant Past. However, the mungedb only displayed *definitions*, not
*abbreviations*, so if the variable abbreviated by a short name changed
then the mungedb wouldn't pick up on the change.

This commit changes the output to include an "alias status", indicating
whether the short C name has been exported as an alias for the indicated
Isabelle name. It also adds a test to confirm that the mungedb output
tracks aliasing correctly.

Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-05-03 10:22:36 +10:00
Brian Huffman 3c3514fe99 c-parser: Faster automation for proving packed_type class instances.
Co-authored-by: Simon Winwood <simonjwinwood@gmail.com>

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-25 11:22:56 +10:00
Brian Huffman 2ae97d8b38 c-parser: Remove unused assumptions from field_lookup rules.
This gives a significant speedup to the install_C_file command
when it generates field_lookup lemmas for struct types.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-25 11:22:56 +10:00
Gerwin Klein 0aafe8bf80 autocorres: pull out SPDX tag
Turns out the reuse tool will get confused by the addition SPDX tag
in the file, even though it is not in a comment. This commit pulls
out the tag such that string matching will not trigger on it.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-24 11:27:03 +08:00
Matthew Brecknell 1c4c9a8153 c-kernel: remove Makefile dependency on seL4/.git
This allows some git operations (e.g. fetch) without requiring a
c-kernel rebuild.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-04-23 23:37:59 +10:00
Victor Phan 51ff27cce6 lib: remove eq_restrict_map_None from the simp set
Hotfix for a7ed68e75d, which moved some lemmas from X64 Move_C.thy into
Lib. `eq_restrict_map_None` being in the simp set caused several
breakages across other arches.

Signed-off-by: Victor Phan <Victor.Phan@data61.csiro.au>
2020-04-23 11:40:38 +10:00
Matthew Brecknell 306fe017c3 autocorres: more specific Makefile pattern rule
A rule to generate `%.thy` from `%.c` was previously too general, such
that it could fire for `%.thy` files that were not intended to be
generated, overwriting existing `%.thy` files.

This recently became an intermittent problem, when several `%.c` files
were updated to comply with style checks. Depending on how an `l4v`
checkout was updated, this sometimes made those `%.c` files newer than
the corresponding `%.thy` files.

This commit converts the implicit pattern rule into a static pattern
rule that applies to exactly those `%.thy` files that are intended to be
generated.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-04-23 09:51:33 +10:00
Amirreza Zarrabi 3bb212bb75 run_tests.py: fix for python3
The decode method is only valid for bytes in python3

Signed-off-by: Amirreza Zarrabi <amrzar@gmail.com>
2020-04-21 15:53:44 +10:00
Victor Phan a7ed68e75d x64 crefine/lib: move word lemmas out of Move_C into Word_Lemmas_64_Internal
Signed-off-by: Victor Phan <Victor.Phan@data61.csiro.au>
2020-04-21 14:42:22 +10:00
Gerwin Klein c53cb66869 github: use sha for head reference in gitlint
The branch name of the pull request doesn't necessarily exist in the
origin repo if the pull request is from a fork. Using the hash directly
should be more reliable.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-20 12:06:13 +08:00
Gerwin Klein 106cd6d41b github: gitlint workflow now more general
Now contains gitlint and whitespace check. Renamed accordingly.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-20 11:48:17 +08:00
Gerwin Klein 0af1b8b912 github: check for trailing whitespace and conflict markers
The check runs `git diff --check $base_ref`, which has non-zero
error code if either trailing whitespace or conflict markers are
present.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-20 11:48:02 +08:00
Gerwin Klein 1dc30da470 Run style check from within checked repository
This is to make sure that the .stylefilter file is applied.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-19 13:53:59 +08:00
Gerwin Klein 092b1207f7 run astyle on all C files in the repository
Leaves parse tests and generated files unchanged, and provides a style
filter for these.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-19 13:50:17 +08:00
Gerwin Klein 1d46f2aafd github: don't attempt to follow into isabelle repo
When the license check runs, the `l4v` repo is not necessarily
in the full `repo` context, i.e. the `isabelle` link is dangling.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-19 12:48:43 +08:00
Gerwin Klein 616aba4820 add gitlint configuration file
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-19 11:28:45 +08:00
Gerwin Klein a5e6138361 github: CI actions for simple checks
This commit adds github workflow actions for a few simple checks from
the main regression test suite to give instant automatic feedback on
github pull requests. Specifically, it adds the following checks:

  - sel4_tools style
  - sel4_tools shell scripts
  - gitlint
  - `reuse` SPDX license check

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-19 11:28:26 +08:00
Matthew Brecknell ab55009486 licenses: ignore tools/autocorres/tests/ROOT
This file is generated during AutoCorresTest, so we can ignore it for
the Licenses check. This avoids spurious failures of the Licenses check,
when run after AutoCorresTest.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-04-18 08:03:35 +10:00
Matthew Brecknell d8364c952d c-kernel: avoid unnecessary rebuilds due to `__pycache__` directories
Previously, we would rebuild the kernel if any file in the `seL4`
repository changed since previous `cmake` setup. Since the kernel build
after the `cmake` setup generates `__pycache__` directories in the
`seL4` tree, this would cause some unnecessary rebuilds.

This commit explicitly excludes `__pycache__` directories from the set
of files considered to be dependencies of the kernel build.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-04-17 10:27:30 +10:00
Matthew Fernandez 18c9f361ab misc: support marginal comments in Vim syntax
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-14 13:16:49 +08:00
Gerwin Klein 7e30711edf c-parser: AUXUPD modifies the heap
Previously AUXUPD did not contribute to modifies proofs, and the only
reason this worked was that there usually is some heap assignment
somewhere else in the function if there is an AUXUPD. This commit adds
a modifies clause for the heap if a function has an AUXUPD.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-10 17:53:29 +08:00
Gerwin Klein c148267df7 contributing: link and contact info for TSC
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-06 20:45:15 +08:00
Gerwin Klein c07c499c17 contributing: switch to DCO
The seL4 foundation requires a developer certificate of origin instead of
a contributor license agreement.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-06 20:43:59 +08:00
Gerwin Klein 79e668ab40 Provide a link to the seL4 code of conduct
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-04-02 00:07:22 +11:00
Matthew Brecknell 78f1808264 design: remove redundant `design-spec` test
This effectively reverts commit 2fec23d646, which was a previous attempt
at fixing a race condition in the design spec generation, which turned
out to be ineffective. Since the `design-spec` test had the same effect
as the `haskell-translator` test on which it depended, it was redundant,
and can be removed.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-04-01 14:31:36 +11:00
Matthew Brecknell 00330af209 design: more precise Makefile dependencies
Previously the Makefile rule for generating the design spec depended on
all Haskell source files in `spec/haskell`. This unintentionally
included files generated by the Haskell kernel build in
`spec/haskell/dist`. This meant that for `run_tests` builds in which the
Haskell kernel test completes *after* the initial generation of the
design spec, subsequent Makefile jobs which depend on the design spec
could cause re-runs of the design spec. Furthermore, if `run_tests` runs
several such jobs concurrently, race conditions in concurrent runs of
the design spec could cause errors.

Since the design spec does not make use of the generated Haskell source
in `spec/haskell/dist`, this commit restricts the design spec
dependencies to Haskell source files in `spec/haskell/src`.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-04-01 14:31:36 +11:00
Matthew Brecknell cf48906b26 regression: force use of python3
Python 2 has passed its sunset date, and many distributions are
withdrawing support for Python 2.

PEP 394 recommends distributions always install versioned interpreter
commands (e.g. `python3`), but does not make a recommendation about
whether or not an unversioned command (`python`) should exist, or what
version it should run.

It therefore seems advisable to explicitly run scripts using the
`python3` command, for scripts that are compatible with Python 3.

Here, we do this for Python scripts used by `run_tests`. For this to
work, some scripts have been updated in ways that will break Python 2
compatibility. But for some other scripts which were already compatible
with both Python 2 and 3, we have not yet removed Python 2
compatibility. There are also miscellaneous scripts that are not used by
`run_tests`, and these have not yet been updated to Python 3.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-04-01 14:31:36 +11:00
Gerwin Klein c725ebd7e8 Update license information and move to LICENSE.md
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-03-31 10:08:14 +08:00