Commit Graph

2469 Commits

Author SHA1 Message Date
Gerwin Klein 865facfde9
aarch64 refine: first pass through Ipc_R
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-26 18:04:44 +10:00
Rafal Kolanski 4dfb6f8ad3
aarch64 refine: first pass through Finalise_R
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:44 +10:00
Gerwin Klein be22c7bfcc
aarch64 refine: set up Untyped_R from RISCV64, add hyp/vcpu
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-26 18:04:44 +10:00
Gerwin Klein 0a7eaece00
aarch64 refine: copy over Invocations_R from RISCV64
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-26 18:04:44 +10:00
Gerwin Klein f4c12a6d85
aarch64 refine: remove kernel_mappings in Retype/Detype
These do not exist on AARCH64

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-26 18:04:43 +10:00
Gerwin Klein 5601abc530
aarch64 refine: fill in VSpaceObject cases in Retype_R
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-26 18:04:43 +10:00
Rafal Kolanski a4536a17ce
aarch64 refine: first pass through Detype_R
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:43 +10:00
Rafal Kolanski e508693534
aarch64 refine: first pass through Retype_R
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:43 +10:00
Rafal Kolanski 3a77d097c4
aarch64 refine: first pass through IpcCancel_R
needed some changes to Schedule_R and VSpace_R

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:43 +10:00
Rafal Kolanski 044a97ed1a
aarch64 refine: first run through Schedule_R
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:42 +10:00
Rafal Kolanski 904056868d
aarch64 refine: add state_hyp_refs_of' to valid_state'
Somehow we missed this on the first pass. Adjusted existing proofs.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:42 +10:00
Rafal Kolanski a79e06f419
aarch64 refine: first run through VSpace_R
This required a lot of adaptation from ARM_HYP, rearranging, and fixing.
The VCPU lemmas are mostly now constrained to one area, making it
theoretically possible to make a VCPU theory in the future.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:42 +10:00
Gerwin Klein 0f11a7a52a
aarch64 refine: progress in ArchAcc
Co-authored-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-26 18:04:42 +10:00
Rafal Kolanski 97ebd07298
aarch64 refine: start on VSpace_R
Up to and including handleVMFault_corres which needed a major overhaul.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:42 +10:00
Rafal Kolanski 059afc8743
aarch64 refine: add InterruptAcc_R
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:41 +10:00
Rafal Kolanski cb03631312
aarch64 refine: add TcbAcc_R and ArchMove_R
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:41 +10:00
Rafal Kolanski 2b543da5f3
aarch64 refine: add CSpace_R
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:41 +10:00
Rafal Kolanski 18d76ef54b
aarch64 refine: add vcpuBits_def to objBits_defs
The way we handle vcpuBits on AARCH64 is different to ARM_HYP.
This seems the most logical place to put vcpuBits_def to aid automation.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:41 +10:00
Rafal Kolanski a93a62641d
aarch64 refine: copy RAB_FN from RISCV64
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:41 +10:00
Rafal Kolanski e0114eef06
aarch64 refine: add CSpace_I and CSpace1_R
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-26 18:04:41 +10:00
Gerwin Klein 3b5a983362
aarch64 refine: first pass through ArchAcc_R
Co-authored-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-26 18:04:40 +10:00
Gerwin Klein b42665460d
aarch64 refine: use ptTranslationBits for indices
Co-authored-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-25 19:34:18 +10:00
Gerwin Klein 38a65fd453
aarch64 refine: adjust KHeap_R from RISCV64
Add VCPU/hyp lemmas from ARM_HYP, fix and update failing lemmas. Leave
1 sorry on pspace_canonical, which might not be needed for AARCH64.

Co-authored-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-25 19:34:17 +10:00
Gerwin Klein b882216086
aarch64 refine: copy Machine_R from RISCV64
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-25 19:34:17 +10:00
Gerwin Klein 555bff6f6c
aarch64 refine: copy SubMonad_R from RISCV64
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-25 19:34:17 +10:00
Gerwin Klein 7cdb85fad1
aarch64 refine: copy EmptyFail from RISCV64
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-25 19:34:17 +10:00
Gerwin Klein bf3929b9d5
aarch64 refine: adjust Bits_R from RISCV64
Add VCPU/hyp material from ARM_HYP, fix up broken lemmas.

Co-authored-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-25 19:34:17 +10:00
Gerwin Klein 61bce83518
aarch64 refine: copy Corres.thy from RISCV64
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-25 19:34:17 +10:00
Gerwin Klein 55a01f1829
aarch64 refine: complete StateRelation
Co-authored-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-25 19:34:16 +10:00
Gerwin Klein 0b0b3b32d5
aarch64 refine: iteration on Invariants_H
Co-authored-by: Rafal Kolanski <rafal.kolanski@proofcraft.system>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-25 19:34:16 +10:00
Gerwin Klein 44fc3ec8d5
aarch64 refine: copy LevityCatch from RISCV64
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-25 19:34:16 +10:00
Gerwin Klein 96851e8b34
aarch64 ainvs: fix typo
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-25 19:34:16 +10:00
Rafal Kolanski 1404b9c0d0
aarch64 refine: add StateRelation
Only text replacement of RISCV64->AARCH64 for now.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-25 19:34:15 +10:00
Rafal Kolanski 01575f20d5
aarch64 refine: copy InvariantUpdates_H from RISCV64
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-25 19:34:15 +10:00
Rafal Kolanski 148355479f
aarch64 refine: first attempt at Invariants_H
Quite a few issues remain, notably validity of ASID maps and
relationship to ASID table is missing from valid_arch_state'

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-05-25 19:34:15 +10:00
Michael McInerney ca589b635c c-parser: add dom_lift_t_heap_update and lemmas for proj_d
Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2023-05-01 15:16:22 +09:30
Michael McInerney ac5fe5bd59 refine: add obj_range'_disjoint
This also moves several lemmas required for obj_range'_disjoint
to Invariants_H

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2023-05-01 10:52:50 +09:30
Corey Lewis b8714328cb word_lib+crefine: add and_one_neq_simps and adjust proofs
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2023-04-18 13:23:42 +10:00
Corey Lewis 68e33858e2 crefine: simp rules for true and false
These rules allow the simplifier to solve almost all existing goals that
involve the C constants true and false, without unfolding their
definitions.

Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2023-04-18 13:23:42 +10:00
Corey Lewis ba241aac64 riscv+x64 crefine: remove unused lemma
Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2023-04-18 13:23:42 +10:00
Gerwin Klein 83ddb4def9
aarch64 ainvs: remove unused physBase lemmas (#625)
The condition `pptrBase < kernelELFBase` is not required on AArch64 in
hyp mode and was left over from the initial RISC-V setup.

Since this check does fail for some platforms (where physBase = 0 and
consequently pptrBase = kernelELFBase) we remove it here.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-04-05 13:50:33 +10:00
Gerwin Klein 0cf64b5498
READMEs: use run_tests consistently in READMEs (#622)
Avoid mixing `isabelle`, `make`, and `run_tests` invocations.
Standardise on `run_tests` and mention `L4V_ARCH` each time to
indicate that you can and should set `L4V_ARCH`.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-30 13:59:18 +11:00
Corey Lewis fc7a113286
riscv infoflow: physBase abstraction
- Distinguish between virtual and physical address for the shared page
  in the example state.

- Reuse lemmas from ArchKernelInit to solve address translation proofs.

Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2023-03-29 11:05:27 +11:00
Gerwin Klein 5fc1c13613
riscv machine+ainvs: physBase abstraction
Move physBase into Arch_Kernel_Config_Lemmas, and move basic lemmas
about kernel constants that do not directly unfold physBase into
ArchInvariants_AI.

Because Arch_Kernel_Config_Lemmas does not have all names available
yet, some of the lemmas are folded and shadowed later in
ArchInvariants_AI.

Also refactor translate_address_kernel_elf_window to have two helper
lemmas that can be used in infoflow.

Co-authored-by: Corey Lewis <corey.lewis@proofcraft.systems>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-29 11:05:27 +11:00
Gerwin Klein 662245c8cb
riscv machine+design+crefine: explicitly set pptrTop
Factor out pptrTop from the definition in kernelELFBase and define it
as a constant as on other platforms. Shadows the equivalent definition
in Haskell.

Also remove incorrect comment -- the term was not PADDR_TOP, but
PPTR_TOP in C.

Co-authored-by: Corey Lewis <corey.lewis@proofcraft.systems>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-29 11:05:26 +11:00
Gerwin Klein 6d7b540963
aarch64 machine+ainvs: physBase abstraction
Remove the only unfolding of Kernel_Config.physBase_def in
ArchKernelInit by removing an unused lemma. Move the remaining
unfolding in ArchAInvariants to Kernel_Config_Lemmas.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-29 11:05:26 +11:00
Corey Lewis 7514d9ee69
arm access+infoflow: physBase abstraction
The example valid state is changed to correctly use both the virtual
and physical address of the shared page, instead of just the virtual
address.

Signed-off-by: Corey Lewis <corey.lewis@proofcraft.systems>
2023-03-29 11:05:26 +11:00
Rafal Kolanski 0fc9a0542c
arm+arm-hyp machine+ainvs+refine+crefine: physBase abstraction
physBase is reduced to be unfolded only in Arch_Kernel_Config_Lemmas.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
2023-03-29 11:05:25 +11:00
Michael McInerney 27d838af86 lib+proof: rename bind_assoc_reverse to bind_assoc_return_reverse
This also improves the style of this lemma

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2023-03-27 10:34:03 +10:30
Michael McInerney 3981e9a60e lib+ainvs: make monadic_rewrite available in AInvs session
This also reduces the imports of MonadicRewrite

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2023-03-21 18:22:34 +10:30