Commit Graph

39 Commits

Author SHA1 Message Date
Rafal Kolanski 9288b78694
machine+aspec: add Arch_Kernel_Config_Lemmas
While having a single Kernel_Config_Lemmas was fine for constraining the
number of domains, it does not work for constraining architecture-specific
configuration options/values.

Add an (empty for now) Arch_Kernel_Config_Lemmas theory to every architecture
that imports the generic Kernel_Config_Lemmas. Change all imports of
Kernel_Config_Lemmas to import Arch_Kernel_Config_Lemmas instead.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-03-29 10:04:47 +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
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 a45adef66a all: remove theory import path references
In Isabelle2020, when isabelle jedit is started without a session
context, e.g. `isabelle jedit -l ASpec`, theory imports with path
references cause the isabelle process to hang.

Since sessions now declare directories, Isabelle can find those files
without path reference and we therefore remove all such path references
from import statements. With this, `jedit` and `build` should work with
and without explicit session context as before.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-11-02 10:16:17 +10:00
Gerwin Klein a424d55e3e licenses: convert license tags to SPDX 2020-03-13 14:38:24 +08:00
Gerwin Klein c34840d09b global: isabelle update_cartouches 2019-06-14 11:41:21 +10:00
Gerwin Klein b5cdf4703f globally use session-qualified imports; add Lib session
Session-qualified imports will be required for Isabelle2018 and help clarify
the structure of sessions in the build tree.

This commit mainly adds a new set of sessions for lib/, including a Lib
session that includes most theories in lib/ and a few separate sessions for
parts that have dependencies beyond CParser or are separate AFP sessions.
The group "lib" collects all lib/ sessions.

As a consequence, other theories should use lib/ theories by session name,
not by path, which in turns means spec and proof sessions should also refer
to each other by session name, not path, to avoid duplicate theory errors in
theory merges later.
2018-08-20 09:06:34 +10:00
Gerwin Klein b383b9a187 aspec: move up mask_vm_rights, make arch independent
Strictly speaking vmrights might at some point become architecture dependent,
but all present architectures have precisely the same implementation, and there
are no plans to do anything different in the foreseeable future.
2018-08-06 11:22:50 +10:00
Gerwin Klein 065f4d25cd x64 aspec: resolve vtd_pt_bits; check IOPageTabelCap functions
Currently unused, but will be relevant for VT-d
2018-08-06 11:18:41 +10:00
Gerwin Klein 908787f315 aspec/haskell: clean out resolved FIXMEs 2018-08-06 11:18:41 +10:00
Michael Sproul 0b978bae61 x64: spec: changes for IRQ invocations (VER-879) 2018-07-05 16:23:15 +10:00
Matthew Brecknell f649240cde x64: CR3 and machine op updates for Meltdown 2018-07-05 16:23:15 +10:00
Matthew Brecknell a3de401c09 x64: more abstract specs and invariants for ASIDs 2018-07-05 16:23:15 +10:00
Joel Beeren f728dd25e8 x64: Add IOPortControlCaps to control IO port allocation
The previous implementation of IOPortCaps has problems with revocability
and determining parency etc. This commit adds IOPortControlCaps which
behave identically to IRQControlCaps -- invoking the IOPortControlCap
allows one to create IOPortCaps with the supplied range.

There now exist invariants to show that there is only one
IOPortControlCap and that all IOPortCaps in the system do not overlap.
Furthermore there is a global record of which IO ports have been
allocated to prevent reissuing the same ports.
2018-04-19 05:27:06 +10:00
Gerwin Klein d9c08fc73f aspec/haskell/machine: refactor user_context interface
- remove separate abstract set_/get_register implementation, directly use machine op
 - make interface aware that user_context does not always need to equal
   (register => machine_word)
 - introduce FPU state on x64
2018-03-08 18:41:28 +11:00
Gerwin Klein 1fbcf1d3ea x64 spec: remove unused x64_asid_map 2018-01-11 10:45:01 +11:00
Matthew Brecknell 2f540e802c add constant definitions for bounds on untyped object sizes 2017-12-18 12:58:27 +11:00
Matthew Brecknell 48b3a8b4ca update object and field widths for x64, and remove some magic numbers
In X64 update the following to match the C kernel:
  - TCB size-bits (11).
  - Endpoint size-bits (4).
  - Guard bits (58).
  - Message registers.

For all architectures, replace magic numbers with defined constants in
specifications, and as far as possible in proofs:
  - tcb_bits in abstract spec.
  - tcbBlockSizeBits, cteSizeBits, ntfnSizeBits, epSizeBits in Haskell
    spec, Haskell and C refinement proofs.
2017-10-26 14:05:35 +11:00
Joel Beeren 61a6088654 x64: rename setCurrentCR3 et al to use underscores for abstract spec 2017-04-07 16:05:02 +10:00
Matthew Brecknell f26ba5cebd arch_split: make cte_level_bits_def work with existing proofs
Many generic proofs make use of cte_level_bits_def. Although the
definition is architecture specific, the proofs work for any reasonable
value of cte_level_bits, so it's fine to expose the definition to
generic proofs.
2017-03-29 11:45:13 +11:00
Matthew Brecknell 6f3efc504a arch_split x64 arm: make endpoint_bits and ntfn_bits arch constants 2017-03-27 19:07:42 +11:00
Matthew Brecknell bb92e92f52 arch_split x64 arm: make cte_level_bits an arch constant 2017-03-27 19:07:28 +11:00
Joel Beeren 981e05d5f7 x64: abstract: remove spurious VMPML4E from vm_map_type 2017-03-23 15:34:30 +11:00
Joel Beeren 1a12926724 x64: use generic VMMapType from haskell rather than redefine in abstract 2017-03-21 15:09:37 +11:00
Joel Beeren b35c50c481 x64: spec: update machine functions, invocations, set_vm_root for new
kernel version
2017-01-20 16:18:49 +11:00
Matthew Brecknell a1b5f16ed6 merge x64-split into local branch 2017-01-11 17:22:05 +11:00
Matthew Brecknell 5bdcbe537e fix ARM build after merge
Also:
- move some ARM-specific things out of Tcb_AI
- port changes from ARM to X64, up to beginning of ArchVSpace_AI
2017-01-10 17:09:31 +11:00
Joel Beeren a1ab2d90b1 x64: fix up ArchIPC_AI 2016-12-13 10:17:28 +11:00
Joel Beeren b07d971a08 x64: machine: move word_size_bits definition to MachineTypes.
Furthermore, create generic library of word lemmas that require
the Arch context to prove, but can be proven with the same proof in
all architectures. These lemmas can then be used safely in generic
theory files. This library is in spec/machine/WordExports.thy
2016-11-25 15:30:36 +11:00
Joel Beeren b8048726a6 X64: added dummy VMPML4E to vm_page_entry.
needs to be reviewed
2016-10-19 10:52:46 +11:00
Matthew Brecknell 991dd30173 x64: port device-untyped from ARM 2016-10-10 13:26:40 +11:00
Matthew Brecknell 5880a317f2 x64 invariants: CSpace_AI checking
Includes some changes to the abstract spec:
- replace magic numbers with definitions.
- add missing IOPortCap cases to some definitions.

There is one sorry proof, which I think blast could solve if we
gave it enough time. Will need a more subtle approach.
2016-08-23 07:40:47 +10:00
Matthew Brecknell 5b19e2c284 merge master into x64-split
This resurrects the ARM architecture on the x64-split branch.
It also brings X64 up-to-date with progress on arch_split.
2016-08-09 18:58:37 +10:00
Joel Beeren 9d58764b93 x64: Invariants_AI now processes, removed some arch-specific types 2016-06-01 11:14:43 +10:00
Joel Beeren d4f54686f2 x64: ArchInvariants_AI passes except 1 sorried lemma - valid_arch_objs_alt 2016-06-01 11:14:43 +10:00
Joel Beeren b95f452ad0 x64: progress in ArchInvariants_AI, up to valid_arch_objs_alt 2016-06-01 11:14:43 +10:00
Joel Beeren 21fd88309f x64: up to lemmas in ArchInvariants_AI 2016-06-01 11:12:55 +10:00
Joel Beeren 1bc374fbaa x64 invs: up to vs_refs_pages 2016-06-01 11:12:55 +10:00
Joel Beeren 73b731562c x64: add arch_split'd x64 spec with IOMMU stuff 2016-06-01 11:12:55 +10:00