Commit Graph

866 Commits

Author SHA1 Message Date
Gerwin Klein e7f6e97c6b cleanup: remove stray diagnostic commands and comments
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 81117dc587 riscv cleanup: remove stray diagnostic commands
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 9a51fc110c riscv crefine: rename isBlocked to isStopped
This brings the proof in sync with seL4 d5d54a0d5596e7a708

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 35d513c0e4 arm crefine: proof updates for new arch split functions
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 232b23e314 x64 crefine: proof updates for new arch split functions
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein d567d52b17 arm_hyp crefine: proof updates for new arch split functions
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 9ddc7c93c2 riscv crefine: cleared last sorry
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 2e2d4c279d riscv crefine: clear last sorry in Interrupt_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 877c667877 riscv crefine: Arch_C sorry-free
Completed decodeRISCVFrameInvocation_ccorres, synced with C changes and
cleaned up a little.

Signed-off-by: Rafal Kolanski <rafal.kolanski@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 b7e9f610d9 riscv crefine: prove decodeRISCVMMUInvocation_ccorres
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein bf753fc564 riscv crefine: clear last sorry in Finalise_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski e8f9a341d8 riscv crefine: clear 3 sorries from Arch_C
Notably, decodeRISCVPageTableInvocation_ccorres is done.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 75e82bc006 riscv crefine: prove Arch_decodeIRQControlInvocation_ccorres
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein d8b64d4eb2 riscv crefine: prove decodeIRQControlInvocation_ccorres
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein d7fb06cac1 riscv crefine: prove Arch_finaliseCap_ccorres
Also modifies cap_to_H_PTCap to include capPTMappedAddress

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein aadf599ae5 riscv crefine: remove 1 sorry from Interrupt_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein b17b03befc riscv crefine: clear remaining sorry in Ipc_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein e8ad7ddb72 riscv crefine: clear last sorry in Delete_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 4bc86adab1 riscv crefine: clear final sorry in Arch_C
This includes a slight tweak to the state relation for global PTs.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein fe21162804 riscv crefine: clear all sorries in VSpace_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 6eff34f312 riscv crefine: restrict abstract pools in casid_pool_relation
Since on RISCV64 we do not have restrictions on arch objects in
valid_obj', for the state relation to form a function from abstract to
concrete, we need to restrict the domains of the abstract asid pools.
Further we also need to ensure ASID 0 is not used in any of them, as
that is a sentinel value for "no ASID".

This is analogous to the restriction placed by valid_obj' on ASIDs on
X64, except occurring in the state relation rather than an invariant.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 0a397f626e riscv crefine: reduce sorries in ADT_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 5f1fd9aa64 riscv crefine: clear sorries from Refine_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 2eeaae4017 riscv crefine: fix fault_to_H for VMFault
Arguments were backwards for some reason.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 39be004a1a riscv crefine: sorry Refine_C
No examination of failing proofs this time. All CRefine files are now
present and accounted for.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 4bae495aa4 riscv crefine: sorried, very preliminary ADT_C
Broken bits blindly sorried or commented out with FIXME RISCV.
carch_state_to_H is currently wrong as valid_arch_state' is
insufficient to accurately describe global page tables.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 3775796809 riscv crefine: Init_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 1b92a83c01 riscv crefine: Syscall_C with a sorry needing spec update
On RISCV, we do not mask the interrupt on IRQSignal in handleInterrupt.
Spec currently masks this, so we provide the sorried intended spec
definition of handleInterrupt for the time being.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 6b3ae48b96 riscv crefine: Schedule_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 073db1c960 riscv crefine: Tcb_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski f9c1082a8b riscv crefine: Arch_C: update for C changes
Make a bit more progress after merging fixes for decode/invoke model
violation, and missing page table cap type check.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Rafal Kolanski 9b1291556e riscv crefine: sorry Arch_C
There are sorries waiting on C updates, a few large sorries, and several
chunks of commented-out X64 proofs that may need to be adapted to
address the other sorries.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein a29822c44e riscv crefine: proof update for potential InvalidPTE mapping
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein ae3358cc2f riscv crefine: prove lookupPTSlot_corres
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein 9d00b566d7 riscv crefine: adjust cpte_relation for new pte invariant
cpte_relation now encodes that PagePTEs can't have 000 rwx rights.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:10 +08:00
Gerwin Klein bdea44614d riscv crefine: clear Invoke_C sorries
Use the previous Haskell changes and asserts to clear the remaining
sorries in Invoke_C.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein 42c505c94a riscv crefine: adjust proofs to new api-object order
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski e650f39de3 riscv crefine: update for C setIRQTrigger changes
Update machine op assumption and remove Arch_invokeIRQControl_ccorres sorry.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 0ee70f00a5 riscv crefine: clear 3 sorries in Invoke_C
Resolved via C changes.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 461fca472d riscv crefine: sorried Invoke_C
Two big ones where crefine machinery leads us astray, and a few small
ones waiting on a spec update on api object enums.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein 917ccdf284 riscv crefine: reduce sorries in VSpace_C and Retype_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein 8871074809 riscv crefine: another long/demunged name in Machine_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 8659e32058 riscv crefine: Recycle_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 64d049f140 riscv crefine: update IsolatedThreadAction for new setVMRoot assertion
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 877aee385c riscv crefine: sorried Interrupt_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 2e16aae27f riscv crefine: Retype_C with sorried copyGlobalMappings
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 04b781a79a riscv crefine: sorried Delete_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski e9e562c33d riscv crefine: introduce registers_count type abbrev
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski adf175bc1b riscv crefine: update for C user exception message change
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein 6ca33d54e7 riscv crefine: reduce by one sorry in Finalise_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein a02357e09e riscv crefine: machine op parameter name changed
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein eeabaff06e riscv refine: reduce sorries in Finalise_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 5e886c171f riscv crefine: sorried Ipc_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 85e1fffe83 riscv crefine: IsolatedThreadAction
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 97f292cab9 riscv crefine: sorried Finalise_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski c38fed430f riscv crefine: IpcCancel_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 67eaeab106 riscv crefine: SyscallArgs_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 040e54c9e6 riscv crefine: StoreWord_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein 4e93309925 riscv crefine: reduce warnings in VSpace_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein d3e42da647 riscv crefine: clear 4 sorries in VSpace_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein f275c2c4c1 riscv crefine: clear sorries in Detype_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein 61abd075c2 riscv crefine: clear remaining CSpace_C sorry
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein fc4f83a128 riscv crefine: clear CSpace_C sorries up to kernel change
cap_get_capIsPhysical needs a C code change for its default case.

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein cdd468fa77 riscv crefine: clear sorry in TcbQueue_C
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Gerwin Klein c5918e8479 riscv crefine: close sorry in PSpace
Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski e4ce4f8945 riscv crefine: sorry VSpace_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 3a2bfe5a93 riscv crefine: sync frame PTE rights with C updates
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 7bec00882e riscv crefine: sorry Detype_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski df89db9550 riscv crefine: sorry TcbQueue_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 9c5b7fbff6 riscv crefine: sorry PSpace_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 0d582877a1 riscv crefine: StateRelation_C: adjust register_from_H
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski bc7b66e788 riscv crefine: TcbAcc_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 9a86c195ed riscv crefine: add valid_untyped' to ArchMove_C
Opted to use old form of statement and adjust proof, as CRefine proofs
are not aware of mask_range and a cleanup of that sort would take too
long at this time.

Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 533dd333ac riscv crefine: more ArchMove_C lemmas from X64
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski df2c0c30c1 riscv crefine: CSpace_All
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski dd0d36fbe1 riscv crefine: sorry CSpace_RAB_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
Rafal Kolanski 11d988137b riscv crefine: sorried CSpace_C
Signed-off-by: Rafal Kolanski <rafal.kolanski@data61.csiro.au>
2020-06-08 20:41:09 +08:00
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 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 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
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
Victor Phan 046a1358f6 crefine: remove lemmas moved into ArchMove_C/Move_C and fix proofs
Signed-off-by: Victor Phan <Victor.Phan@data61.csiro.au>
2020-03-20 13:42:48 +11:00
Victor Phan 70fe3fa943 crefine: arch split for Move theory files and move in lemmas
crefine/[ARCH]/Move.thy is replaced with crefine/Move_C.thy
(arch-generic), and crefine/[ARCH]/ArchMove_C.thy (arch-specific).
The only CRefine theory file that imports ArchMove_C is CLevityCatch,
and ArchMove_C imports Move_C which imports "Refine.Refine".

Lemmas found by looking through "FIXME: Move" comments have been added
to either Move_C or ArchMove_C depending on whether it is arch-generic
or arch-specific respectively.

Signed-off-by: Victor Phan <Victor.Phan@data61.csiro.au>
2020-03-20 13:42:43 +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 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
Victor Phan 966734c69b Collect abstract lemmas in Refine
Create ArchMove_R.thy for transporting arch specific lemmas (and generic
lemmas that are used somewhat specifically by one architecture) to theory
files before Refine.

Create Move_R.thy as an arch generic Refine theory file for transporting
generic lemmas to theory files before Refine.

Also delete some lemmas that have existed earlier already or are not
needed.

Rename Move.thy in CRefine to Move_C.thy for consistency.
2020-02-21 11:49:25 +11:00
Rafal Kolanski f9ea44ef89 arm-hyp: update spec+proofs for multi-VM support
Highlights:
- new reserved IRQ and associated handler: VPPIEvent
- VPPI events are virtual interrupts we can forward to VMs; currently there is
  only one event: virtual timer interrupt
- VGICMaintenance and VPPIEvent can both receive late interrupts from hardware,
  which are now discarded instead of being delivered to current thread
- given only one possible VPPI event, simplifier tends to mop up more than it
  should, making some proofs fragile w.r.t. adding a new VPPI event
- the order of some lemmas/specs needed shuffling, as now VCPU code needs some
  interrupt code, which uses VCPU code
2020-02-19 10:52:07 +11:00
Zoltan Kocsis 788b4bd180 refactored irq_t structure (VER-1159) 2020-02-05 17:58:45 +11:00
Zoltan Kocsis 72064236cd word-lib: strengthen ucast_less_ucast 2020-02-05 17:50:45 +11:00
Victor Phan f2d1f5ada7 refine/crefine: convert crunch with multiple constants into crunches 2020-02-03 16:29:19 +11:00
Victor Phan 285c47f622 cleanup for crunch_ignore in refine and crefine for all arches
Several constants are are added to the top level crunch_ignore statement in
Bits_R.thy, then removed from individual crunch statements across Refine and
CRefine.
2020-02-03 16:29:18 +11:00
Gerwin Klein 430f2c525b crefine: invocation label proof updates 2020-02-03 12:56:19 +08:00
Victor Phan ff6c0d8a0a Move vcpu_switch into Arch_switchToThread and update proofs
Currently the vcpu_switch function is called in the setVMRoot function
after possible early returns. In order to make sure the vcpu is
always switched, the call is moved into Arch_switchToThread before the
call to setVMRoot.
2020-01-20 16:53:32 +11:00
Victor Phan b9c285400d remove diminished (VER-1158)
diminished takes two caps and asserts that one is equal to the other
except that one may have fewer rights. We remove this definition and all
references to it, replacing diminished with equality.
2019-11-16 01:03:36 +11:00
Gerwin Klein 1970ed0ce0 word_lib internal + crefine: remove duplicate lemma 2019-11-15 12:08:22 +11:00
Gerwin Klein c390ba7404 proofs: adjustments for word_lib changes 2019-11-15 12:08:22 +11:00
Victor Phan 9fda73732a x64 crefine: update for seL4 bugfix [GITHUB PR 107]
Always invalidate TLB during unmapPage.
2019-11-14 18:05:24 +11:00
Gerwin Klein d2584a3692 cleanup: collect word lemmas 2019-11-12 18:28:40 +11:00
Victor Phan 67bba7edc3 lib, x64 crefine: remove word lemma unat_ucast_8_64
unat_ucast_8_64 states that upcasting an 8 word to a 64 word does not
changes its value. We have a generic lemma for this which can be
specialised to this lemma: unat_ucast_up_simp[where 'a=8 and 'b=64,
simplified].
2019-10-30 19:09:39 +11:00
Corey Lewis 9846cd42bb proof: update for crunch changes 2019-10-14 17:23:41 +11:00
Corey Lewis dd48e0d899 proof: update for wp changes
Updated 'wp_once' to 'wp (once)' and removed several stray uses of 'wp_trace'.
2019-10-14 17:12:18 +11:00
Victor Phan a6024fb377 x64 refine/crefine: remove vmsz_aligned' 2019-10-10 11:27:31 +11:00
Victor Phan de09728b6c x64 crefine: update for PageMap replacing PageRemap (SELFOUR-161) 2019-10-10 11:27:20 +11:00
Victor Phan dbc4df6c1d arm-hyp crefine: update for PageMap replacing PageRemap (SELFOUR-161) 2019-10-10 11:27:17 +11:00
Victor Phan d1637c06ce arm crefine: update for PageMap replacing PageRemap (SELFOUR-161) 2019-10-10 11:27:14 +11:00
MiladKetabi acbc08b836 clean-ups done during proof update for the jira issue SELFOUR-1187: seL4 setPriority should attempt a direct schedule 2019-10-06 18:31:19 +11:00
MiladKetabi d934d25269 proof update for SELFOUR-1187: seL4 setPriority should attempt a direct schedule
Prior to this commit the kernel would always trigger a full reschedule
on setPriority. This change allows the kernel to attempt a direct
switch, avoiding invoking the scheduler.
2019-10-06 18:31:19 +11:00
Japheth Lim 50b0f66a58 X64 CRefine: minor fixes for MCS kernel merge
The previous commit only updated ARM and ARM_HYP; this updates X64.
2019-08-23 15:43:25 +10:00
Japheth Lim da2081631b CRefine: minor fixes for MCS kernel merge
We need to make small adjustments because the kernel will see minor
changes to variable initialisation, even in the non-MCS build.
2019-08-22 11:22:29 +10:00
Edward Pierzchalski 9852fcccd2 crefine: disambiguate record fields.
When the bitfield generator switches to python 3, the dicts we use to
track data won't be iterated deterministically. These changes
disambiguate (some) record literals and accessors so that they aren't
sensitive to the definition order.
2019-07-25 11:58:12 +10:00
Amirreza Zarrabi 4f93ebe608 refine, crefine: update after adding thread id registers to TCB for SELFOUR-1524 2019-06-28 11:48:24 +10:00
Matthew Brecknell b3c4a56e01 crefine: type-qualify overloaded C struct constructor names
Changes in the C boot code mean that `tcb_C` and `asid_pool_C` are now
overloaded in the Isabelle C specification: They are constructors for
the respective C structs, and also accessors for fields of an unrelated
struct (`root_server_mem_t`). Consequently, we need to be more explicit
when naming the constructors.
2019-06-20 11:05:27 +10:00
Gerwin Klein c34840d09b global: isabelle update_cartouches 2019-06-14 11:41:21 +10:00
Gerwin Klein 2e6bf613e2 crefine: c-parser cleanup fallout 2019-06-14 11:41:20 +10:00
Michael McInerney c13432b0c4 misc updates for Isabelle2019 2019-06-14 11:41:20 +10:00
Michael McInerney 32a3ebba1c crefine: update for Isabelle2019 2019-06-13 16:22:33 +10:00
Michael McInerney 4463e9750e SELFOUR-1198: update proofs for correct restart PC
Fixes a case where a thread can go from Running->Inactive->Restart and
use a restart PC that is out of date. An out of date restart PC occurs
when a thread was transitioned to running after being in a blocked
state, but was never scheduled and so did not execute the traps code
that updates the restart PC.

This also renames relevant register names for consistency across
architectures (FaultIP and NextIP).
2019-06-13 11:43:50 +10:00
Matthew Brecknell 9f94d3ccb3 crefine: update for renamed NextIP and FaultIP registers
The ARM C kernels have renamed the LR_svc and FaultInstruction registers
to NextIP and FaultIP respectively, for consistency with x86 kernels. A
patch for a similar renaming in the abstract and Haskell specifications
is forthcoming.
2019-05-29 16:52:59 +10:00
Matthew Brecknell b8557d3862 crefine cleanup: remove redundant Kernel_C_reg_simps 2019-05-29 16:52:59 +10:00
Edward Pierzchalski 2035f444a0 refine: Remove unused lemmas. 2019-05-28 10:00:10 +10:00
Matthew Brecknell 175c612f3f crefine: use mangled names in memzero and memset
This is required by a C kernel patch (to refactor some boot code) which
caused the Isabelle C parser to mangle the names of some local
variables.
2019-05-15 14:49:20 +10:00
Matthew Brecknell 503f7ce7de crefine: update proofs for statically allocated IRQ node
Previously, the C kernel maintained a global pointer to the IRQ node.
This pointer was only initialised during boot, when the actual IRQ node
was dynamically allocated from untyped memory.

The C kernel now includes a statically allocated IRQ node, which is just
a suitably sized array of CTEs. This commit updates the proofs to verify
this change to the C kernel.
2019-05-03 13:52:52 +10:00
Matthew Brecknell 206ee07c58 crefine: add abbreviations for global page table addresses 2019-05-03 13:52:52 +10:00
Matthew Brecknell f47f1c6446 cleanup: move pt_Ptr etc up to Wellformed_C 2019-05-03 13:52:52 +10:00
Matthew Brecknell 009c0c98b5 cleanup: remove some redundant uses of if_1_0_0 2019-05-03 13:52:52 +10:00
Matthew Brecknell 17b0aca539 cleanup: remove duplicate cap_get_tag_isCap_ArchObject2 lemmas 2019-05-03 13:52:52 +10:00
Matthew Brecknell f1901beee0 cleanup: remove duplicates of invs'_invs_no_cicd 2019-05-03 13:52:52 +10:00
Matthew Brecknell eedf3d8fa2 cleanup: remove duplicates of objBitsKO_gt_0 2019-05-03 13:52:52 +10:00
Amirreza Zarrabi 51cfddab32 crefine: update for increased capIRQ field bits on 64-bit platforms (VER-1047) 2019-03-25 07:47:45 +11:00
Edward Pierzchalski 7cea1ad1b4 lib: don't extend core signatures.
Just because we *can* extend the core SML `List` signature, that doesn't
mean we *should*. It's a neat trick, but it makes it harder to find uses
of the new modules, and obfuscates definitions for very little gain.
2019-03-07 15:29:13 +11:00
Edward Pierzchalski e039ecc6a1 crefine: shorten long c-parser names.
Previously, tactics like `ctac` and `csymbr` would use definition names
to produce new bound variables. Now that the C parser always emits long
name *definitions* and short name *aliases*, we adjust these tactics to
try and shorten any new names they produce.
2019-03-07 13:34:32 +11:00
Matthew Brecknell 8272f79c0f arm-hyp crefine: remove named interrupt identifiers
Recent changes to the C kernel mean that various structures and
constants are generated from DTS files. In particular, verification now
sees interrupt identifiers as integer literals instead of defined
constants.
2019-01-30 17:13:03 +11:00
Rafal Kolanski 4ee84d6348 x64 crefine: update for GrantReply (SELFOUR-6) 2018-12-10 20:01:38 +11:00
Rafal Kolanski 0d292f48dd arm-hyp crefine: update for GrantReply (SELFOUR-6) 2018-12-10 20:01:38 +11:00
Rafal Kolanski a34e0fc6f8 arm crefine: update for GrantReply (SELFOUR-6) 2018-12-10 20:01:37 +11:00
Edward Pierzchalski 3d49538f2f arm crefine: mark some lemmas as FIXME.
There are some good simp set candidates as well as ones that should be
moved.
2018-11-21 17:12:23 +11:00
Edward Pierzchalski 17f3263d5e arm crefine: remove some unused lemmas.
Add some comments on unused lemmas that we want to move or keep.
2018-11-21 17:12:23 +11:00
Edward Pierzchalski d8552fa97d crefine: arm-hyp: add word lemma FIXMEs
Various potential improvements that became apparent during the word
lemma move.
2018-10-10 14:15:01 +11:00
Edward Pierzchalski c4dc578bc3 Fix up proofs after word lemma moves 2018-10-10 14:15:01 +11:00
Edward Pierzchalski d75740201c Remove pure word lemmas from proof/*
Removes redundant lemmas after moving them up to Word_Lib.
2018-10-10 14:15:00 +11:00
Mitchell Buckley 331a0ee1c2 Minor adjustments to the patch for selfour-1491.
There were some sloppy last-minute changes that were not properly tested
and managed to evade testing. These contained a single logical omission
and a few typographic mistakes.
2018-09-21 10:09:49 +10:00
Mitchell Buckley 8173a37c2d Updated specs and proofs for SELFOUR-1491: control IRQ triggering on ARM. 2018-09-19 16:18:09 +10:00
Ilya Yanok 0044c57e14 lib: change runErrorT to runExceptT to match Haskell code 2018-09-04 14:59:45 +10:00
Gerwin Klein 0619a4694d Isabelle2018 x64: CRefine 2018-08-20 09:06:37 +10:00
Gerwin Klein ba38cc0f16 Isabelle2018 arm-hyp: CRefine 2018-08-20 09:06:37 +10:00
Gerwin Klein 934ba36fd1 lib/clib: move DetWPLib from CLib to Lib
Doesn't have any C dependencies.
2018-08-20 09:06:37 +10:00
Gerwin Klein 6ac17c3243 Isabelle2018: use session ident in @theory antiquotes 2018-08-20 09:06:37 +10:00
Gerwin Klein a1d1b69776 Isabelle2018 arm: CRefine 2018-08-20 09:06:37 +10:00
Gerwin Klein 6b9d9d24dd Isabelle2018: new "op x" syntax; now is "(x)"
(result of "isabelle update_op -m <dir>")
2018-08-20 09:06:35 +10:00
Gerwin Klein 011e08458e Isabelle2018: new comment syntax
(result of "isabelle update_comments <dirs>")
2018-08-20 09:06:35 +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
Michael Sproul 2151a57c51 x64: crefine: move two lemmas up to CSpaceAcc_C 2018-08-17 15:41:12 +10:00
Michael Sproul 4ddf8ec2e4 x64: crefine: remove needless `unwrap_or` def 2018-08-17 15:41:12 +10:00
Gerwin Klein 5ae7cc23b1 aspec: msg_align_bits and related are arch independent
While the numerical value is arch dependent, the definition and symbolic value
are not. This commit factors out the symbolic computation and only unfolds the
numeric value in the architecture dependent spec.
2018-08-06 11:22:51 +10:00
Thomas Sewell 26049db669 Repair proofs for wpsimp/crunch changes.
A handle of fiddly proofs change slightly. A common offender involves
tcb_cap_cases, which should be unfolded with the ran_tcb_cap_cases
rule where possible rather than with tcb_cap_cases_def.
2018-08-03 18:25:30 +10:00
Rafal Kolanski 9e0551f56a arm-hyp: update proofs for TPIDRUR[OW]/TLS_BASE preservation
TPIDRUR[OW] registers removed from VCPU registers. Their saving now
lives in arch_c_entry_hook, which is before verified code is hit.

Relevant for verification, TPIDRURO is already handled as TLS_BASE
register, and TPIDRURW (holds IPC buffer) is saved/restored as part of
normal thread register save/restore.
2018-07-12 23:38:58 +10:00
Michael Sproul e11abb6011 x64: crefine: prove isIOPortRangeFree_spec 2018-07-05 17:07:58 +10:00
Matthew Brecknell 80693df8e2 x64 crefine: add mask_eq_ucast_shiftl 2018-07-05 17:07:58 +10:00
Matthew Brecknell 3231ee17bf x64 crefine: prove 'return false' case of isIOPortRangeFree_spec postcondition 2018-07-05 17:07:58 +10:00
Matthew Brecknell aabf8ded2e x64 crefine: progress on isIOPortRangeFree_spec postcondition 2018-07-05 17:07:58 +10:00
Joel Beeren 7eb8e01443 x64: crefine: proved word_highbits_bounded_highbits_eq
Contributed by: Michael Sproul <michael.sproul@data61.csiro.au>
2018-07-05 17:07:57 +10:00
Joel Beeren da05f4f72e x64: crefine: cleared vcg precondition sorry in isIOPortRangeFree_spec, modulo small word lemma 2018-07-05 17:07:57 +10:00
Matthew Brecknell b9c3279779 x64 crefine: prove mask_le_mono
Contributed by: Thomas Sewell <Thomas.Sewell@data61.csiro.au>
2018-07-05 17:07:57 +10:00
Matthew Brecknell 7a951cad95 x64 crefine: prove invariant preservation for isIOPortRangeFree_spec 2018-07-05 17:07:49 +10:00
Michael Sproul 7af93e5bc1 x64: crefine: prove word_minus_1_shiftr 2018-07-05 16:23:15 +10:00
Joel Beeren 07b60ec185 x64: crefine: progress on sorries in isIOPortRangeFree_spec 2018-07-05 16:23:15 +10:00
Matthew Brecknell f0a8621434 x64 crefine: prove isIOPortRangeFree_ccorres in Arch_C (WIP) 2018-07-05 16:23:15 +10:00
Gerwin Klein 91b55bc74b x64 crefine: progress on spec and inv for isIOPortRangeFree 2018-07-05 16:23:15 +10:00
Matthew Brecknell 74e74571ca x64 crefine: prove setIOPortMask_ccorres in CSpace_C 2018-07-05 16:23:15 +10:00
Michael Sproul 72e3dcc8e2 x64: crefine: prove decodeX64MMUInvocation_ccorres
Required adding a case to cl_valid_cap to encode the relationship between a
PML4Cap's IsMapped bit and its MappedASID.
2018-07-05 16:23:15 +10:00
Joel Beeren 5ce7ed478f x64: crefine: add SetTLSBase invocation to x64 CRefine 2018-07-05 16:23:15 +10:00
Joel Beeren 2558a7c6e5 x64: crefine: update decodeX64FrameInvocation to not mask with PPTR_USER_TOP 2018-07-05 16:23:15 +10:00
Joel Beeren 89df98ec14 x64: fix inadvertently broken lemma in CSpace_C 2018-07-05 16:23:15 +10:00
Joel Beeren 417e6b8bc1 arm-hyp: crefine: fix up eisr_calc proof for strengthened ccorres_rewrite 2018-07-05 16:23:15 +10:00
Joel Beeren 584c6e9d26 x64: crefine: prove decodeX64FrameInvocation_ccorres 2018-07-05 16:23:15 +10:00
Joel Beeren 5ed7bb16be x64: fix up definition of performPageInvocation for unmapping pages 2018-07-05 16:23:15 +10:00
Matthew Brecknell 700060b642 x64 crefine: prove Arch_decodeInvocation_ccorres in Arch_C 2018-07-05 16:23:15 +10:00
Matthew Brecknell 047f96c711 x64 crefine: prove kernel_mappings conditions in Retype_C 2018-07-05 16:23:15 +10:00
Matthew Brecknell 3686d79677 x64 crefine: prove createObjects_asidpool_ccorres in Arch_C
In x64, asid_map_C is now a bitfield union type, whereas in ARM,
the ASID pool contains plain pointers. This means that proving
ccorres for the x64 ASID pool placeNewObject operation requires
some additional unfolding of C type information.
2018-07-05 16:23:15 +10:00
Matthew Brecknell c390013909 x64 crefine: prove several lemmas in Retype_C
To prove that retyping a TCB establishes the state relation for TCBs,
it is necessary to prove that the C FPU null state is always equal to
the Haskell FPU null state. This commit therefore includes some
machinery for maintaining the state relation for the FPU null state,
and repairs many proofs.
2018-07-05 16:23:15 +10:00
Michael Sproul 26b218e4bd x64: crefine: clear sorries for decode PT/PD/PDPT 2018-07-05 16:23:15 +10:00
Joel Beeren 0bad7af88b x64: crefine: actually clear last ioport_table_C sorry 2018-07-05 16:23:15 +10:00
Joel Beeren 1dea36ed6f x64: crefine: add some tag disjunctions for ioport_table_C to SR_Lemmas_C 2018-07-05 16:23:15 +10:00
Joel Beeren bcd21f27bf x64: crefine: clear final two sorries from ioport_bitmap_relation fallout 2018-07-05 16:23:15 +10:00
Joel Beeren d6a620ec5d x64: crefine: move setIOPortMask_ccorres to CSpace_C, finish freeIOPortRange_ccorres 2018-07-05 16:23:15 +10:00
Joel Beeren 3c65b91512 x64: crefine: finished invokeX86PortControl_ccorres and decodeIOPortControlInvocation_ccorres 2018-07-05 16:23:15 +10:00
Joel Beeren d487d1fc6a x64: crefine: added ioport bitmap to StateRelation_C 2018-07-05 16:23:15 +10:00
Joel Beeren 95cdaa8ad7 x64: crefine: cleared sorry in decodeIOPortInvocation_ccorres 2018-07-05 16:23:15 +10:00