Commit Graph

963 Commits

Author SHA1 Message Date
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 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 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 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
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 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
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 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
Gerwin Klein 5ee37bd11e refine: replace DomainTime_R by assertion
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-07-02 11:30:56 +08:00
Rafal Kolanski c160f4053d riscv machine: add alternative definition for pptrUserTop
(presents numeral directly without further unfolding)

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 472e65e7ee riscv haskell: FIXMEs now resolved
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 6fd03279df riscv aspec: spec is in sync with C, the returned error is correct
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein f1e8cbab28 design: import new arch function
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 35e7b9676f haskell: arch split maskIrqSignal
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 9de5bb27e4 aspec: factor out arch_mask_irq_signal
On RISC-V we do not call mask_irq.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein fe566628da haskell+design: factor out arch specific IRQ handling
RISC-V has a different machine op invocation for acknowledging IRQs.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Victor Phan 461a798412 aspec: arch split on invokeIRQHandler
The RISCV implementation of invokeIRQHandler calls plic_complete_claim
instead of maskInterrupt. plicCompleteClaim is added as a machine op
and invokeIRQHandler has been arch split for the ACKIrq case.

Signed-off-by: Victor Phan <Victor.Phan@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 06d6620340 riscv haskell: update vmRightsToBits
This was incorrect, but unused in the proofs. Once used, the numbers
turned out to be unrelated to the C.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 100f8ed949 riscv haskell+design: new assertion in lookupPTFromLevel
The corresponding C code (correctly) expects never to be called for a
top-level table.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 6b78e37cec riscv design+haskell: move pt_at assertions to the recursive call
The proof needs to know that there is a page table at the entry
point in the induction for lookupPTSlot. Moving the assertion just
before the recursive call establishes this directly.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein 9bd06da4d7 riscv aspec+haskell: make mapped PTE invalid for insufficient rights
The RISC-V ISA spec does not allow PagePTEs with 000 for rwx rights,
because 000 is used to identify PageTablePTEs. Instead we write
InvalidPTEs, which has the same effect for the user.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein 1dccd9ceaf riscv aspec: update arch API type decoding to new order
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein 7b9249fe2a riscv design: port new asserts into design spec
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein fca56f750b riscv haskell: additional assertions for CRefine
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein 6be8b794ec riscv haskell: sync order with C enum
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein 70ee5750f6 riscv haskell+refine: add assertion to setVMRoot
The assertion is provable from the abstract invariants, and used in
CRefine to conclude that the test wether the vspace root cap is mapped
can be left out.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 3a71e0d6ad riscv haskell: update exceptionMessage to conform to C
Now contains only FaultIP and SP.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 6fc6aeb20c riscv cspec/crefine: update ctcb_size_bits to 9
One bit smaller than X64. Removes FIXME.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 84fd22524b design/haskell spec: arch split for tcbBlockSizeBits
`tcbBlockSizeBits` was previously defined to be `wordSizeCase 9 11`
universally, but this claim does not hold anymore since it takes the
value 10 on RISCV64. Therefore an arch split for `tcbBlockSizeBits` and
affected definitions are made. The constant and its definition needs to
be requalified so that proofs in Refine can access it through the
constant objBits_defs.

Signed-off-by: Victor Phan <Victor.Phan@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski cc367d61b2 riscv aspec+ainvs: update tcb bits to 10
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08: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
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
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
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
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 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
Victor Phan 190d3b402a riscv spec/ainvs: update IRQs to target hifive platform
- Increase IRQ word size from 3 to 6 to match IRQ_CNODE_SLOT_BITS in
  sel4 config.
- Bump maxIRQ up to 54.
- Fix broken inequality proof by changing constant that depended on IRQ
  word size.
2020-03-27 15:50:46 +11:00
Gerwin Klein 75acf19dcd style: pep8 style for python files 2020-03-25 22:42:27 +11:00
Gerwin Klein c68915b92b license: provide documentation under CC-BY-SA-4.0
Datat61 provides all docs under CC-BY-SA-4.0.
2020-03-16 14:19:15 +08:00
Gerwin Klein 86a941e7e7 spdx: review missing copyright & license info
Some files were missing machine-readable copyright info, others were tagged
incorrectly.
2020-03-16 14:19:15 +08:00
Gerwin Klein a5c7c91192 haskell: review copyright in src/SEL4/Kernel/Hypervisor/ 2020-03-13 14:38:47 +08:00
Gerwin Klein a424d55e3e licenses: convert license tags to SPDX 2020-03-13 14:38:24 +08:00
Gerwin Klein 8d12d8e4be licenses: tag .md and document file 2020-03-02 18:52:15 +08:00
Matthew Brecknell 65074bc35d c-kernel: add Makefile targets useful for binary verification
- Add Makefile targets for building ELF binaries and various dumps that
  are used in binary verification.

- Add support for extra CMake command-line arguments. For binary
  verification, this is used to set the optimisation level for the ELF
  targets.

- Add support for the Debian RISC-V toolchain packages, without breaking
  existing users with a manually built RISC-V toolchain.

- Move reusable parts of the C kernel Makefile out to a separate include
  file, with support for configuring the build directory. For binary
  verification, this is used to allow multiple builds at different
  optimisation levels.
2020-02-26 16:22:40 +11:00