Commit Graph

4186 Commits

Author SHA1 Message Date
Gerwin Klein fb5a6a67a5 SepDSpec: new syntax for syntax specs in Isabelle2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein a253f7d1eb cspec: additional session directories
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 33e6400f8a aspec: include doc build in ASpec again
Isabelle2020 doesn't allow sharing session directories between the document
session and non-document session. Instead of duplicating things, this commit
pulls the document build back into the ASpec session, but changes the build
such that the git revision is read directly from LaTeX, removing the
superfluous re-build for every git revision change (even when no relevant spec
file changed).

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 76dce46565 camkes: ROOT updates
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein d9ff25ffce lib: update for 2020 Monad_Syntax
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 508e19d0ff lib: Isabelle2020 concurrency session
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 59140d268d lib/sep_algebra: Isabelle2020 ROOT update
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein cf7ce9598a ainvs: session update for Isabelle2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 91cc9d8521 tools/asmrefine: update to Isabelle2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 78717650f6 autocorres: do not store images of test sessions
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 82e116ef6c autocorres: update to Isabelle2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 18428256f0 c-parser: update to Isabelle2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein f15fbf1e4b gen_isabelle_root: add option for session dirs
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 3076f7ffcf spec: ROOT file structure
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 2e8cf15b2d lib + proof: Isabelle2020 Method.NO_CONTEXT_TACTIC rename
Method.NO_CONTEXT_TACTIC -> NO_CONTEXT_TACTIC

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 408bf41351 lib: Isabelle2020 update
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 600836ec7f word_lib: re-sync with AFP; fix broken document
Also switched on document generation so we don't miss these in the future.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein adc22ae58f c-parser: sync Simpl with AFP-2020
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein 9b2836ef53 word_lib: sync from AFP
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Gerwin Klein e7fb36b7e2 ROOT files: file reorg for new ROOT requirements
Isabelle2020 requires each session to declare it own set of directories that
may not overlap with other session's directories. This commit reorganises
files to comply with that requirement.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-10-27 15:52:31 +10:00
Miki Tanaka 0b9c186eb0 armhyp/x64/riscv64 refine: remove interrupt/irq from p_monad
- fix armhyp/x64/riscv64 Refine for the above change

Signed-off-by: Miki Tanaka <miki.tanaka@data61.csiro.au>
2020-10-25 13:15:00 +11:00
Miki Tanaka b4893afd0b drefine, infoflow: remove interrupt/irq from p_monad
- fix DRefine, InfoFlow, InfoFlowC for the above change

Signed-off-by: Miki Tanaka <miki.tanaka@data61.csiro.au>
2020-10-25 13:15:00 +11:00
Miki Tanaka 0359fb1da0 arm refine: remove interrupt/irq from p_monad
- fix ARM refine proofs for the above change
- use dc instead of intr

Signed-off-by: Miki Tanaka <miki.tanaka@data61.csiro.au>
2020-10-25 13:15:00 +11:00
Miki Tanaka caf09bd3db aspec+ainvs: remove interrupt/irq from p_monad
- preemption in C is not associated to an irq
- updating aspec to reflect this so that we can have irq-independent
  preemptions (needed in MCS)

- proof fix for the above: remove intr

Signed-off-by: Miki Tanaka <miki.tanaka@data61.csiro.au>
2020-10-25 13:15:00 +11:00
Matthew Brecknell 9cf8de9b95 regression: use `python3` for tests-xml-correct
PEP 394 expects that Python 3 installations provide a `python3` command,
but does not require a `python` command. Some distributions (including
Debian) are no longer providing a `python` command, but do provide
`python3`.

In this change, the `python3` interpreter is invoked via the existing
`#!` line in the `testspec.py` script.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-10-21 11:57:30 +11:00
Matthew Brecknell 98e122935c clib: add a `hoarep_rewrite` method
This is like `ccorres_rewrite`, but for `hoarep`, and uses the same
infrastructure.

The interaction between the `simpl_rewrite` locale and the
`simpl_rewrite` method was confusing, and didn't work well with multiple
interpretations. We replace the locale with a simple anonymous context
block. Since that puts more things in the global namespace, we rename
many of them. The `simpl_rewrite` method is now parameterised by a `hom`
fact which determines the predicate under which we are rewriting.

This also includes a slight generalisation of `exec_eq_is_valid_eq`,
which allows a similar generalisation of `hoarep_rewrite`.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-09-13 12:11:58 +10:00
Gerwin Klein cb7d3250df haskell: deal with existing "~/.stack"
Bring happiness to both bamboo and github: create ~/.stack, but don't
fail if it's there.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-09-10 16:18:12 +08:00
Gerwin Klein 5cb5efbb97 tests: give more time to AInvs session
The github CI runners are low on memory and might just get
through with a bit more time for ARM_HYP.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-09-10 16:09:38 +08:00
Gerwin Klein b8881bbf9b github: add more test sessions for master branch
These are not complete yet, but should be manageable by
github CI runners.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-09-10 16:09:38 +08:00
Gerwin Klein 5857efd15f github: cache ~/.stack contents
It'd be nice to check for actual *.cabal changes, but the cache
action doesn't have access to the repo checkout yet.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-09-10 16:09:38 +08:00
Gerwin Klein 894bf95473 haskell: force create ~/.stack
stack refuses to create it when ~/ is owned by a different user,
such as on github CI

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-09-10 16:09:38 +08:00
Gerwin Klein e26ffb8c14 github: add remaining MCS tests
This manually adds the HaskellKernel compile test, ASpecDoc, and
tests-xml-correct sessions, which together with the existing tests make
up the entire current MCS test suite apart from "Licenses" which is
already covered by other github CI.

This is a bit ad-hoc, ideally there should be a default "rest" session
to capture tests that will be added in the future. This will need a bit
of restructure in the CI action itself, though, so is postponed for now.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-09-10 16:09:38 +08:00
Matthew Brecknell 64a597d574 asmrefine: support small array index types
This adds support for indexing into user contexts when `register_t` is
smaller than a word type, e.g. `uint8_t`.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-09-09 21:33:35 +10:00
Matthew Brecknell 91abdb5720 lib: add upcast_less_unat_less
Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-09-09 21:33:35 +10:00
Matthew Brecknell 0ba5b52d59 asmrefine: add `heap_update` identity rule
This allows SimplExportAndRefine to handle some new heap update patterns
arising in MCS.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-09-07 14:10:04 +10:00
Edward Pierzchalski 0bea82f481 asmrefine: skip `init_freemem`
`init_freemem` isn't verified (and therefore is low-priority for
translation validation). It also takes several hours to show refinement,
much longer than any other function. Until we need to validate it, we
should skip it to improve regression times.

Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-09-04 22:07:17 +10:00
Edward Pierzchalski 87de976c9b asmrefine: (fixup) use `debug_config` in tests
Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-09-04 22:07:17 +10:00
Edward Pierzchalski 074689730f asmrefine: add timeouts for debugging
Also cleans up some of the debug config setup and makes result reporting
more useful.

Signed-off-by: Edward Pierzchalski <ed.pierzchalski@data61.csiro.au>
2020-09-04 22:07:17 +10:00
Matthew Brecknell b77f83c57b riscv: rename sbadaddr -> stval
Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-08-26 15:24:06 +10:00
Matthew Brecknell 6f23d50ea9 c-parser: avoid cleaning `umm_heap/ARM_HYP`
Initially the `Makefile` copied `umm_heap/ARM_HYP` from `umm_heap/ARM`,
and deleted `umm_heap/ARM_HYP` during `make clean`. However, the
contents of `umm_heap/ARM_HYP` have since been committed, so this is no
longer appropriate.

Reported-by: Michael Norrish <Michael.Norrish@data61.csiro.au>
Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-08-26 14:58:15 +10:00
Matthew Brecknell ea1be49908 crefine: make C state relation non-empty
We believe this commit fixes the issue described in the previous commit.
It also reverts that commit, since the proofs that the C state relation
is empty no longer work.

As the previous commit demonstrated, it is important to demonstrate the
non-triviality of properties. In this case, we should exhibit a witness
of the non-emptiness of the C state relation. We have not yet done that.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-08-19 16:15:05 +10:00
Matthew Brecknell 0f0cfc9dc8 crefine: prove that the C state relation is empty
As currently defined, the C state relation is empty, and consequently,
`ccorres` is trivially true for any pair of functions. This means that,
in a very technical sense, our C refinement proofs are meaningless.

The state relation is empty because several conjuncts in
`cstate_relation` form a contradiction:
- Two conjuncts claim that `intStateIRQNode_array_Ptr` points to a heap
  object within the set of addresses `kernel_data_refs`.
- Another implies that all heap objects are within `domain`.
- Another claims that `kernel_data_refs = -domain`, forming the
  contradiction.

This commit proves the contradiction, and also proves that `ccorres` is
trivially true for any pair of functions.

Fortunately, we never made any essential use of this contradiction, and
so the issue can be fixed fairly easily. The issue seems to have arisen
out of a conflation of two different concepts:
- `kernel_data_refs` is introduced in the intermediate specification,
  and is intended to be the set of addresses containing global heap
  objects that are not covered by capabilities.
- `domain` was introduced for binary verification, and was intended to
  be the set of all addresses that may be used for heap objects.

The easiest fix seems to be to expand the meaning of `kernel_data_refs`
to include all addresses that are not covered by capabilities. If we
assert that `kernel_data_refs = -domain`, then this does not allow for
heap objects that are not covered by capabilities. If instead, we make a
weaker assertion that `-domain <= kernel_data_refs`, we can have heap
objects that are not covered by capabilities, such as the one pointed to
by `intStateIRQNode_array_Ptr`.

This fix will be performed in a subsequent commit.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-08-19 16:15:05 +10:00
Gerwin Klein 2845f9904e github: also test Refine session
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-08-10 15:48:34 +08:00
Gerwin Klein 7ba6422142 github: run on all PRs, and on push to {master, rt}
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-08-10 15:48:34 +08:00
Gerwin Klein 9f6b6c243e github: cache Isabelle images
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-08-10 15:48:34 +08:00
Gerwin Klein 963a3cca75 github: use standardised seL4 actions
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-08-10 15:48:34 +08:00
Gerwin Klein 9c837e81d0 github: PR checks on AInvs for rt branch
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-08-10 15:48:34 +08:00
Gerwin Klein b0d01265ef trivial: fix broken links
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-08-10 15:48:34 +08:00
Matthew Brecknell d5170f121c regression: explain why `CKernel` depends on `design-spec`
The reason `CKernel` depends on `design-spec` is quite obscure, so we
add a comment to relevant `Makefile`s to help us avoid wasting time
trying to remove the dependency.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-08-10 13:45:35 +10:00
Matthew Brecknell 16f87e04fe regression: use python3 for mk_umm_types
I previously updated the `#!` in `mk_umm_types.py` to use `python3`, but
forgot to remove the explicit `python` call from `kernel.mk`.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2020-08-10 13:45:35 +10:00