Commit Graph

1827 Commits

Author SHA1 Message Date
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
Gerwin Klein 54f557f2b2 refine: invocation label proof updates 2020-02-03 12:56:19 +08:00
Gerwin Klein 0ed60666e3 drefine: invocation label proof updates 2020-02-03 12:56:19 +08:00
Gerwin Klein 73e9503575 ainvs + infoflow: 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
Edward Pierzchalski b257ff60fd asmrefine: clean up SEL4GraphRefine
Consolidates ML setup code, adds some extra output.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 437ae807c2 asmrefine: improve debugging
Splits parts of step 4 of the SimplExport proof process, in order to
expose them to the test theory. Add some instructions on how to use
them.

Tags subgoals so that the user can identify which ones caused the
failure.

Consolidates ML setup code, and demarcates it to let uses ignore it.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 708a62795e asmrefine: arch split CFunDump files
Now that asmrefine targets several arches, it's useful to separate out
any intermediate artefacts by L4V_ARCH. For instance, this lets us use
the same directory to test two arches at once.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 9ba1d498df asmrefine: remove globals_swap ref
Using a shared ref for configuration reduces the understandability of
code. It turns out the contents of the `globals_swap` ref:

1. Was always the same.
2. Was only used in one spot.
3. Could be recreated at that one spot.

So we do that instead.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski 89a53c0818 asmrefine: add field offset rewrite rules.
Currently unused, but these are useful for debugging proofs in SEAR
about struct access updates.
2019-12-19 17:05:10 +11:00
Edward Pierzchalski b1940d750c asmrefine: ML style. 2019-12-19 17:05:10 +11:00
Edward Pierzchalski c3b5f2917a asmrefine: fix debug output
Previously, if a graph refine proof failed it would cause the ML block
defining the debug variable to be discarded; this prevented the user
from investigating the debug output. This change splits the ML block to
avoid the issue.
2019-11-29 13:59:50 +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
Gerwin Klein 821085f7b1 ainvs: move mask_range into Word_Lib 2019-11-15 12:08:20 +11:00
Gerwin Klein c826b33b88 bisim: Bisim session for ARM, X64, RISCV64
ARM_HYP would be possible, but require arch split for hyp-faults.
2019-11-15 12:04:50 +11:00
Gerwin Klein 55aeefdb64 x64: avoid automatic unfolding of handle_vm_fault
(fun -> definition)
2019-11-15 12:04:50 +11:00
Gerwin Klein b820b13d06 riscv: avoid automatic unfolding of handle_vm_fault
(fun -> definition)
2019-11-15 12:04:50 +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
Victor Phan 1db6ae7cf0 riscv: add kdev_base/kdevBase to handle RISCVVSpaceDeviceWindow and update proofs
- Add HiFive.hs to replace Spike.hs, it's the same except for kdevBase
  addition.
- Originally called KDEV_PPTR in the C Code, to be changed to KDEV_BASE
  across all architectures.
- Add RISCVVSpaceDeviceWindow case for valid_uses_2 definition.
2019-11-13 16:27:30 +11:00
Victor Phan c7fb4dcf2b riscv aspec/ainvs: redefine kernel_elf_base to point to be kernelELFBase 2019-11-13 16:08:52 +11:00
Victor Phan 6f94fff163 riscv aspec/ainvs: rename kernel_base to kernel_elf_base 2019-11-13 16:08:42 +11:00
Edward Pierzchalski 44815388e9 asmrefine: blacklist failing functions
These are boot code functions which are failing SEAR for "interesting"
reasons. For expediency we're skipping them in a very visible way.
2019-11-13 11:40:43 +11:00
Victor Phan f8b7f61445 riscv refine: update and close sorries for adding IRQ invocations
irqInvalid is manually requalified into Interrupt_R. If it's defined for all
architectures, then can be requalified instead in the more suitable
spec/machine/MachineExports.thy

Reimplement the following primrecs:
- arch_irq_control_inv_relation
- arch_irq_control_inv_valid'
- irq_control_inv_valid'

Add the following lemmas:
- arch_check_irq_corres
- crunches arch_check_irq, checkIRQ
- arch_check_irq_valid
- arch_check_irq_valid'
- no_fail_setIRQTrigger
- setIRQTrigger_corres
- dmo_setIRQTrigger_invs'
2019-11-12 18:28:40 +11:00
Victor Phan d1f3afc4f2 riscv ainvs: close sorries for adding IRQ invocations
- Add setTrigger lemmas: setIRQTrigger_irq_masks, dmo_setIRQTrigger_invs
  and no_irq_setIRQTrigger
- Modify primrec arch_irq_control_inv_valid_real to include similar
  conditions to its equivalent in ARM, but with the minor chnage of irq !=
  irqInvalid.
2019-11-12 18:28:40 +11:00
Victor Phan 3ef1e6845c riscv refine: update after adding thread id registers to TCB 2019-11-12 18:28:40 +11:00
Victor Phan 0d7c2fff48 riscv ainvs: add support to thread id registers 2019-11-12 18:28:40 +11:00
Victor Phan 26b25838d0 riscv ainvs: close sorry for introducing kernelELFBase 2019-11-12 18:28:40 +11:00
Victor Phan e4d83b313a riscv refine: update for PageMap replacing PageRemap (SELFOUR-161) 2019-11-12 18:28:40 +11:00
Gerwin Klein a5e27933a5 riscv: cleanup; resolve remaining FIXMEs 2019-11-12 18:28:40 +11:00
Gerwin Klein d2584a3692 cleanup: collect word lemmas 2019-11-12 18:28:40 +11:00
Gerwin Klein cbc31e31e1 ainvs+refine: provide def of mask_range in InvariantsPre
(used to be ptr_range in riscv, which is too overloaded)
2019-11-12 18:28:40 +11:00
Gerwin Klein 82bcbdc137 riscv ainvs: prove that example state satisfies invs 2019-11-12 18:28:40 +11:00
Gerwin Klein 090894c990 riscv aspec+ainvs: define a consistent initial page table
Simpler than the real kernel layout, but will show that invariants are
consistent.
2019-11-12 18:28:39 +11:00
Gerwin Klein 9d81f85c38 riscv: force vptr alignment in PTMap decode
Instead of checking for alignment, mask out the bottom bits to force the
vptr stored in the cap into the correct alignment for the level to be mapped.

See also SELFOUR-2162
2019-11-12 18:28:39 +11:00
Gerwin Klein 12f2d82f86 riscv refine: Orphanage sorry-free 2019-11-12 18:28:39 +11:00
Gerwin Klein bda92556d7 riscv refine: sorried Orphanage 2019-11-12 18:28:39 +11:00
Gerwin Klein aae4ea5ad0 riscv refine: add EmptyFail_H 2019-11-12 18:28:39 +11:00
Gerwin Klein 72032d8495 riscv refine: cleanup in Finalise_R 2019-11-12 18:28:39 +11:00
Gerwin Klein d06030a524 riscv refine: cleanup in Syscall_R 2019-11-12 18:28:39 +11:00
Gerwin Klein d28bda221f riscv refine: cleanup in ADT_H 2019-11-12 18:28:39 +11:00
Gerwin Klein bc63e2cadb riscv refine: cleanup in Interrupt_R 2019-11-12 18:28:39 +11:00