Commit Graph

614 Commits

Author SHA1 Message Date
Joel Beeren 3a9818b070 x64: crefine: added CSpace_RAB_C.thy 2018-07-05 16:23:14 +10:00
Joel Beeren 3c3ce87df0 x64: crefine: added DetWP.thy 2018-07-05 16:23:14 +10:00
Joel Beeren 5982952444 x64: crefine: added StoreWord_C 2018-07-05 16:23:14 +10:00
Joel Beeren c69b10e2d4 x64: crefine: VSpace_C sorried
There are probably lots of lemmas missing but this will allow people to
move forward beyond VSpace_C to other files.

Many sorries are dependent on C changes still in the pipeline
2018-07-05 16:23:14 +10:00
Joel Beeren 3fb61f92a6 x64: crefine: interim commit of VSpace_C 2018-07-05 16:23:14 +10:00
Joel Beeren 55b5f165b7 x64: crefine: added getFaultAddr_ccorres to machine assumptions 2018-07-05 16:23:14 +10:00
Joel Beeren 72b1edaf96 x64: crefine: add CSpace_C to Refine_C for regression testing 2018-07-05 16:23:14 +10:00
Joel Beeren bf25de6b5b x64: crefine: added CSpace_C with sorries 2018-07-05 16:23:14 +10:00
Joel Beeren 5909835331 x64: crefine: adjust cl_valid_cap for irq_handler caps 2018-07-05 16:23:14 +10:00
Joel Beeren 0326c2a956 x64: crefine: add frame_cap condition to cl_valid_cap
On x64, there are only 3 possible page sizes, so it is no longer
possible to deduce that a page size is well-formed from just the
bitfield struct (previously there were 4 page sizes for a 2-bit field).
2018-07-05 16:23:14 +10:00
Joel Beeren 1069cb70f2 x64: crefine: fix default case in vmrights_to_H 2018-07-05 16:23:14 +10:00
Joel Beeren f24785cb8b x64: crefine: add neglected IOPortCap case to a few lemmas 2018-07-05 16:23:14 +10:00
Joel Beeren c80d51bf2a x64: crefine: added Machine_C 2018-07-05 16:23:14 +10:00
Joel Beeren a5aae07229 x64 crefine: added CSpaceAcc_C 2018-07-05 16:23:14 +10:00
Corey Lewis c71fa27e14 Whitespace and typos 2018-07-03 13:42:23 +10:00
Corey Lewis 571ef6d0ca crefine+drefine+access+infoflow: update proofs for SetTLSBase (VER-807) 2018-07-03 13:42:22 +10:00
Rafal Kolanski 15d6b62040 arm: address setCurrentPD mismatch between abstract/haskell/C
ARM setCurrentPD was recently refactored as part of multi-VM support for
ARM_HYP. The Haskell was updated correctly, and the C was not.
Unfortunately, setCurrentPD was manually redefined in MachineOps.thy for
ARM hiding the change, making the C look correct when it wasn't.

We scrap the second definition of setCurrentPD, load it from the Haskell,
and have an abstract set_current_pd that's a bit simpler to refine down
from.

The proofs are updated for the above change and the update to the C
setCurrentPD that was breaking on KZM.
2018-06-22 11:59:30 +10:00
Rafal Kolanski 4a3d7a958c arm-hyp: update proofs for SELFOUR-584: running multiple VMs on ARM
As requested by verification, hypervisor registers are now an
enumeration-indexed array rather than individual fields. This cleans up
some of the proof. Additionally, we sweep some non-complexity under the
machine op rug: vcpu_hw_write/read_reg_ccorres is as deep as we go,
rather than specifying every operation and proving that
vcpu_hw_write seL4_VCPUReg_REG calls set_REG for every REG

I took this opportunity to clean up some arm-hyp definitions and proofs,
so some whitespace cleanup got tangled in.
2018-06-15 18:48:47 +10:00
Joel Beeren 5cff1d47ac crefine: fix finaliseCap proof for 1ul shift change 2018-04-27 07:12:09 +10:00
Joel Beeren 25125763bd arm-hyp: ioportcontrol: fixes after adding IOPortControlCaps to x64 2018-04-19 05:27:06 +10:00
Joel Beeren 1634608453 arm: ioportcontrol: Fixes after adding IOPortControlCaps to x64 2018-04-19 05:27:06 +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
Thibaut Perami 4c7ca8c076 arm+arm_hyp crefine: Split TLB functions to local and local+remote functions 2018-04-19 11:12:27 +10:00
Gerwin Klein cf601cb3c6 refine+crefine: update proofs for range check change 2018-04-11 08:05:46 +10:00
Rafal Kolanski 31290e2d92 arm-hyp crefine: update proofs for ARMv7 refactor 2018-04-06 14:24:47 +10:00
Corey Lewis 2d0baab462 Proof update for crunch changes 2018-04-04 14:13:55 +10:00
Gerwin Klein 9b0441e288 arm + arm_hyp: crefine for ctcb_offset C AUXUPD 2018-03-26 14:37:22 +11:00
Gerwin Klein 62bee91f12 cspec/crefine: make ctcb_offset available to AUXUPD 2018-03-26 14:37:22 +11:00
Thomas Sewell 0f38e20094 Many proof repairs. 2018-03-16 14:57:51 +11:00
Japheth Lim bea2e09c04 crefine: further update for C-parser change to avoid complex call lvals (JIRA VER-881) 2018-03-14 17:58:43 +11:00
Gerwin Klein 44bd2788cd arm-hyp crefine: proof update for user_context refactor 2018-03-08 18:41:28 +11:00
Gerwin Klein 4eb4ddf53f ARM crefine: proof update for user_context refactor 2018-03-08 18:41:28 +11:00
Gerwin Klein 21bbc51d9b x64 crefine: proof update for user_context refactor 2018-03-08 18:41:28 +11:00
Japheth Lim d7ec3eb986 crefine: update for C-parser change to avoid complex call lvals (JIRA VER-881) 2018-02-28 11:22:53 +11:00
Michael Sproul f0795805d1 SELFOUR-1016: fix confused deputy problem when setting priorities 2018-02-26 11:19:43 +11:00
Joel Beeren 4601f2a1ab Genericise deletion actions that occur after empty_slot
This patch adds a generic "post_cap_deletion" step that is called by
finalise_slot. Previous to this, the only caps which had actions
required at this stage were IRQHandlerCaps -- it was required that the
IRQ bitmap be updated after the cap itself was removed (as the
invariants state that for any existing IRQHandlerCap, the corresponding
bit in the IRQ bitmap must be set).

By genericising this, we add the capacity for new, arch-specific post
cap deletion actions to occur in the future.
2018-02-23 09:12:55 +11:00
Matthew Brecknell 6e74fa1ae3 arm/arm-hyp crefine: update proofs for new ccorres_rewrite 2018-02-18 13:05:41 +11:00
Joel Beeren 3d225cde69 VER-910: add msgLabelBits to haskell
message_info structs have 20 bit labels. On 32-bit systems, the label
does not need to be masked as there are no extra padding bits in the
struct, but this is not true for 64-bit systems. As a result, the
haskell needs to mask msgLabelBits (=20) when extracting the label in
messageInfoFromWord.
2018-02-07 10:36:59 +11:00
Matthew Fernandez d675e253ba fix broken README links 2018-01-29 13:24:35 +11:00
Matthew Brecknell eabbd86327 x64: remove references to x64KSCurrentCR3, following Meltdown mitigation
Changes to the C kernel to mitigate the Meltdown vulnerability have
removed x64KSCurrentCR3, and replaced it with other state. As a
temporary fix, this commit removes references to x64KSCurrentCR3 from
the C state relation to keep existing proofs working.

For x64 verification, this ultimately needs to be replaced with a
relation on the new state that has been added, and the specs updated
accordingly.
2018-01-22 16:28:33 +11:00
Michael Sproul 995b88cefa SELFOUR-707: schedule highest priority thread on setPriority 2018-01-19 16:08:11 +11:00
Matthew Brecknell 2f540e802c add constant definitions for bounds on untyped object sizes 2017-12-18 12:58:27 +11:00
Joel Beeren af2b7c7792 VER-825: Change representation of SchedulerAction_ChooseNewThread from ~0 to 1
This change was a result of the constant "(tcb_t*)~0" being defined as
0x00000000FFFFFFFF on x86-64 (0 is implicitly a 32-bit integer) rather
than 0xFFFFFFFFFFFFFFFF as expected.
2017-12-13 12:13:36 +11:00
Joel Beeren a5a5edc832 VER-849: abstractly declare a threads registers have changed
This removes an ifdef present in invokeTCB_(Copy|Write)Registers, and
adds the function Arch_postModifyRegisters which does nothing on any
arch except x86-64.
2017-12-13 12:13:36 +11:00
Rafal Kolanski 2f28bfeaec x64: revise scheduler / fastpath / scheduler bitmaps (SELFOUR-242)
Apply "invert-fastpath" changes to x64 (ainvs, refine, partial crefine).
See main commit for arm for more context.
2017-11-27 22:05:46 +11:00
Rafal Kolanski 7b36283c70 arm-hyp: revise scheduler / fastpath / scheduler bitmaps (SELFOUR-242)
Apply "invert-fastpath" changes to arm-hyp (ainvs, refine, crefine).
See main commit for arm for more context.
2017-11-27 22:05:46 +11:00
Rafal Kolanski 3a22487cf3 arm: revise scheduler / fastpath / scheduler bitmaps (SELFOUR-242)
Colloquially known as "invert-fastpath".

Update verification efforts on ARM for the following seL4 changes:
- scheduling decisions done in possibleSwitchTo are moved to the
  scheduler
  - possibleSwitchTo only checks whether the candidate is valid for a
    fast switch, not its priority, accepting possible candidates
    immmediately as a switch-to scheduler action
  - the scheduler checks the candidate against the current thread and
    against the bitmaps before making a decision
  - attemptSwitchTo and switchIfRequiredTo are gone
  - scheduler is now more complicated, and numerous proofs related to it
    are rewritten from scratch
- fast path now checks ready queues via the scheduler bitmaps
- L2 scheduler bitmap order reversed for better cache locality

Many iterations between the kernel and verification teams were needed
to get this right.
2017-11-27 22:05:34 +11:00
Matthew Brecknell a2dd6d1777 autocorres-crefine: update CRefine proofs for AutoCorres 2017-11-22 15:37:36 +11:00
Matthew Brecknell 079d5dec23 autocorres-crefine: make AutoCorres tools available in CRefine 2017-11-22 12:18:16 +11:00
Matthew Brecknell 40f83c5637 autocorres-crefine: add tools for moving between ccorres and corres
This commit adds a method `ac_init`, which converts a ccorres goal into
a corres goal. It also adds an attribute `ac`, which converts a ccorres
fact into a corres fact, in a form suitable for solving goals produced
by `ac_init`.
2017-11-22 10:59:57 +11:00
Matthew Brecknell bd44bab6c6 autocorres-crefine: update for Isabelle2016-1 2017-11-22 10:59:57 +11:00
Matthew Brecknell f66d6278b2 Isabelle2017: update CRefine (X64) 2017-10-30 12:23:26 +11:00
Matthew Brecknell 78341b24ef Isabelle2017: update CRefine (ARM_HYP) for RC0 2017-10-30 12:23:26 +11:00
Alejandro Gomez-Londono 7da301cfc3 Isabelle2017: update CRefine (ARM) for RC0 2017-10-30 12:23:26 +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
Pang Luo 6b9912c47a manually adjust non-obvious cases of tab to space replacement 2017-10-20 14:22:36 +11:00
Matthew Brecknell 184d6b70b7 remove most tab characters 2017-10-20 14:22:36 +11:00
Matthew Brecknell b8fc532b4e reject all invalid IRQ inputs to IRQ control syscall
This updates the proofs for a change in the C code. The IRQ control
syscall now returns an error whenever the IRQ parameter is not a valid
IRQ value. Previously, the syscall threw away some higher-order bits
before checking for IRQ validity.

Incidentally, the C now only uses the name `irq` for variables of type
`irq_t`, and `irq_w` for variables of type `word_t`. This avoids trouble
with c-parser name mangling.
2017-10-05 07:59:02 +11:00
Joel Beeren c93ed2e629 x64: crefine: add TcbAcc_C to Refine_C for testing 2017-09-26 11:27:33 +10:00
Joel Beeren 1d103daf46 x64: crefine: add TcbAcc_C 2017-09-26 11:27:33 +10:00
Joel Beeren 87e169a78f x64: crefine: adjust register_from_H to use 32 word as per C code 2017-09-21 16:05:35 +10:00
Matthew Brecknell 3744c71a48 crefine autocorres: update c-kernel import paths for new kernel build system 2017-09-21 13:23:38 +10:00
Adrian Danis 8273ca818d cspec: Remove redundancy in build rules and theory files for c-kernel builds
Removes files that were duplicated in cspec/$L4V_ARCH directories to exist directly in
the cspec directory and contain $L4V_ARCH switches where needed. This allows for a single
Makefile for building the C kernel and the KernelInc_C theory, which is different between
architectures, to still exist per L4V_ARCH.

As the build location of the C kernel, and the resulting kernel_all.c_pp artifact, is
moved this change needs to be reflected in all the theory files that refer to it.
2017-09-21 13:23:04 +10:00
Gerwin Klein 00bff34f07 arm-hyp crefine: bitfield generator proof updates 2017-09-20 22:03:04 +10:00
Gerwin Klein 564359b13e arm crefine: proof updates for bitfield generator changes
The name mangling of "v" changes in a few places, and mask_def is
occasionally needed where it wasn't before.
2017-09-20 22:03:04 +10:00
Joel Beeren 15076ecda6 x64 crefine: adjust Refine_C to also use PSpace_C for testing 2017-09-19 12:34:35 +10:00
Joel Beeren ec5716d04b x64 crefine: added PSpace_C 2017-09-19 12:22:13 +10:00
Joel Beeren 4d47d6540a x64 crefine: added Ctac_lemmas_C 2017-09-19 12:21:58 +10:00
Joel Beeren 7e915e39bd x64: adjusted abbreviation in ArchAcc_AI to restore global name-clash counter to be consistent between architectures.
A private abbreviation in an anonymous context incidentally incremented
the global counter Variable.max_idxof which is used to avoid
name-collisions in lemmas.

For some reason (not obvious) the abbreviation in question was
incrementing the counter, and because it
was only in an X64 file, this resulted in X64 and the other
architectures getting out of sync. This was file previously, but became
a problem when processing the generic file lib/clib/Corres_C.

This commit adjusts the abbreviation to not increment the counter, and
fixes Refine and SR_lemmas_C to account for this change.
2017-09-19 12:07:02 +10:00
Joel Beeren 7c54fc69dd x64: change Refine_C to point to TcbQueue_C for regression testing 2017-09-14 14:51:58 +10:00
Joel Beeren ae707eb153 x64: crefine: added TcbQueue_C 2017-09-14 14:51:58 +10:00
Joel Beeren 1160bb053c x64: crefine: SR_Lemmas_C first attempt 2017-09-14 14:50:14 +10:00
Joel Beeren 0c117b7738 x64: crefine: StateRelation_C first attempt 2017-09-14 14:50:14 +10:00
Joel Beeren 7bbf6be54f x64: crefine: Added Wellformed_C
Currently one sorried lemma due to inconsistencies in maxDomain
definition, which needs follow up with the kernel team.
2017-09-14 14:50:14 +10:00
Joel Beeren d0782b89f8 x64: crefine: added CLevityCatch 2017-09-14 14:50:14 +10:00
Joel Beeren 15704dbc08 x64: crefine: add Move_C 2017-09-14 14:50:14 +10:00
Joel Beeren 92f5d14c0b x64: crefine: add Include_C 2017-09-13 16:44:53 +10:00
Joel Beeren 8032234af9 crefine: integrate all architectures 2017-08-09 17:02:50 +10:00
Matthew Brecknell 3871575834 x64: add crefine stubs to keep theory_imports happy 2017-08-09 17:02:49 +10:00
Matthew Brecknell e66b3f44d0 trivial: remove a tab character 2017-07-31 11:05:44 +10:00
Matthew Brecknell 238e8b307e x64: merge master 2017-07-21 11:27:12 +10:00
Alejandro Gomez-Londono 796887d9b1 Removes all trailing whitespaces 2017-07-12 15:13:51 +10:00
Joel Beeren 81064fdb55 idle-thread-pd: run idle thread with the global PD all the time.
This avoids the multicore scenario of the idle thread running in the
address space that has been deleted by a thread running on another core.
2017-07-11 11:29:34 +10:00
Miki Tanaka 5a82068c34 crefine: resolve a small issue in design spec coming from haskell translator inflexibility
- a case-statement in decodeARMMMUInvocation has an if-statement with a conjunction of three conditions, but they are translated in different orders between arm and arm-hyp and currently the crefine proofs depend on those orders.
- this fix is not a fundumental solution, but, given how reliable the haskell translator is, not sure how much effort we should be putting in here
2017-07-03 10:31:34 +10:00
Miki Tanaka 41fe1a0845 update proofs for SELFOUR-30/291 "Reschedule on self-modification"
- SELFOUR-30 Reschedule when changing own IPC buffer
Previously if you invoked the TCB of the current thread and
changed the IPC buffer frame this would not immediately take
affect, as the kernels view of the current IPC buffer is
updated in Arch_switchToThread. This change forces Arch_switchToThread
to get called, even if we would switch back to the original
thread.

- SELFOUR-291 Reschedule when changing own registers
Previously if you wrote to TCB of the current thread and
changed the TLS_BASE this would not immediately take
affect, as the kernel only updates this register in
Arch_switchToThread. This change forces Arch_switchToThread
to get called, even if we would switch back to the original
thread.
2017-06-26 15:52:35 +10:00
Matthew Brecknell 2f4b822da9 x64: configure arch-specific array types 2017-06-22 17:24:53 +10:00
Joel Beeren 392d055e99 SELFOUR-748: rename tlb invalidation functions 2017-06-20 14:05:45 +10:00
Alejandro Gomez-Londono d44ab4082a arm crefine: Refactors createMappingEntries_valid_pde_slots'2 due to new definitions 2017-06-19 14:32:45 +10:00
Alejandro Gomez-Londono 1950b051a5 arm crefine: Refactors Arch_finaliseCap_ccorres for new if-body 2017-06-19 14:32:45 +10:00
Alejandro Gomez-Londono 284cb43f7b arm crefine: Updates clearMemory_setObject_PTE_ccorres to use pteBits 2017-06-19 14:32:45 +10:00
Alejandro Gomez-Londono 4c1d294a75 arm crefine: Updates {getActiveIRQ,isIRQPending}_ccorres with new argument 2017-06-19 14:32:45 +10:00
Alejandro Gomez-Londono 17776ce6d3 arm crefine: Refactors proofs for new definitions (pteBits, pdeBits, etc) 2017-06-19 14:32:45 +10:00
Pang Luo a4e9ffa403 arm-hyp: refactor tpidrurwRegister and fix corresponding proofs
See VER-717
2017-06-19 14:32:43 +10:00
Joel Beeren 1f4b9e686a arm-hyp: rename archTCBSanitise, arch_tcb_sanitise_condition, Arch_hasVCPU to be more appropriate 2017-06-19 14:32:43 +10:00
Gerwin Klein 8076ba136a arm-hyp crefine: adjust Syscall_C for wpsimp getting further 2017-06-19 14:32:43 +10:00
Rafal Kolanski 1869bfd574 arm-hyp crefine: vgicMaintenance ccorres; CRefine sorry-free 2017-06-19 14:32:43 +10:00
Miki Tanaka 6176e4ab60 arm-hyp crefine: Ipc_C sorry-free 2017-06-19 14:32:42 +10:00
Rafal Kolanski af1b6d50e7 arm-hyp crefine: Fastpath_C sorry-free 2017-06-19 14:32:42 +10:00
Rafal Kolanski a559cca656 arm-hyp crefine: weaken preconditions on vcpu_switch
Requiring MDB validity (contained in valid_pspace') was too strong for
fastpath proofs.
2017-06-19 14:32:42 +10:00
Rafal Kolanski 1adc307094 arm-hyp crefine: remove unused lemma with conflicting name 2017-06-19 14:32:42 +10:00
Rafal Kolanski 705b86f25b arm-hyp crefine: fix monadic rewrite proof in Ipc_C 2017-06-19 14:32:42 +10:00
Rafal Kolanski a0cb855dc9 arm-hyp crefine: VSpace_C sorry-free, vcpu_(save|restore)_ccorres done 2017-06-19 14:32:42 +10:00
Matthew Brecknell f29099d490 arm-hyp crefine: prove ccorres for vcpu_init during VCPU retype 2017-06-19 14:32:42 +10:00
Gerwin Klein 242296a350 arm-hyp crefine: Arch_C sorry-free 2017-06-19 14:32:42 +10:00
Alejandro Gomez-Londono 396039a730 arm-hyp crefine: fixes get_gic_vcpu_ctrl_lr machine op + others
* others: fix arg name in get_gic_vcpu_ctrl_eisr0
    get_gic_vcpu_ctrl_eisr1 and get_gic_vcpu_ctrl_misr
2017-06-19 14:32:42 +10:00
Rafal Kolanski f24fe6ac7d arm-hyp crefine: remove references to FIXME in Arch_C
Specs got updated, FIXME lemmas removed, but the references were not
updated until now.
2017-06-19 14:32:42 +10:00
Gerwin Klein a36043fec1 arm-hyp crefine: update IsolatedThreadActions for vcpuSave change 2017-06-19 14:32:41 +10:00
Miki Tanaka 08bd86042a arm-hyp crefine: reflect spec changes for makeVIRQ and decodeVCPUInjectIRQ 2017-06-19 14:32:41 +10:00
Rafal Kolanski 2ed26c2c00 arm-hyp crefine: finish proof of invokeVCPUInjectIRQ_ccorres
Possible now that virq_t is storable.
2017-06-19 14:32:41 +10:00
Rafal Kolanski 1d72a3e389 arm-hyp crefine: put virq_C in twoToSix_packed class
Somewhere automation has failed, resulting in virq_C not being in a size
class, hence arrays not being in packed_type. Therefore typ_heap_simps
would not work since strictly speaking there was no indication the
object could be stored in memory.

This caused hours of suffering for all concerned.
2017-06-19 14:32:40 +10:00
Rafal Kolanski 6266d327f8 arm-hyp: isolate evil vgicLR update cmap_relation lemma
see: vcpu_vgic_lr_update_cmap_relation

This is hard, might take a while.
2017-06-19 14:32:40 +10:00
Rafal Kolanski a4b8684232 arm-hyp crefine: virq_virq_pending_EN_new_spec (incl 1 sorry)
makeVIRQ is sadly wrong, new spec is sorried, waiting for upstream
update to conform
2017-06-19 14:32:40 +10:00
Rafal Kolanski db2e052295 arm-hyp crefine: (invoke|decode)VCPUInjectIRQ_ccorres (incl. 3 sorries)
Sorried:
  - definition waiting on upstream change (decodeVCPUInjectIRQ_def)
  - hard word proof in progress
  - stuckage on typ_heap_simps not firing
2017-06-19 14:32:40 +10:00
Rafal Kolanski d4edba3e07 arm-hyp crefine: setMR_as_setRegister_ccorres
usually when we call setMR directly, we mean to only set one,
which will fit in actual registers
2017-06-19 14:32:40 +10:00
Rafal Kolanski ef93982d2f arm-hyp crefine: convenience lemmas and augmentations
- add proper ccorres_pre_gets_armKSGICVCPUNumListRegs_ksArchState
  - many of the other ccorres_pre_gets* lemmas are TOO WEAK to use safely!
- shiftr_and_eq_shiftl (proof by Matthew Brecknell)
2017-06-19 14:32:40 +10:00
Rafal Kolanski a5c9384df5 clib: ccorres_grab_asm
like ccorres_gen_asm, but when your last conjunct is K (...)
2017-06-19 14:32:40 +10:00
Joel Beeren 7969414919 arm-hyp crefine: fix some sorries in Ipc_C, fixed proofs broken by sanitiseRegister change 2017-06-19 14:32:40 +10:00
Gerwin Klein e33d4d3145 arm-hyp crefine: widen VSpace_C sorry for spec changes 2017-06-19 14:32:40 +10:00
Gerwin Klein 3a7d75e554 arm-hyp crefine: adapt to spec changes 2017-06-19 14:32:40 +10:00
Gerwin Klein 35a24ecf4e arm-hyp crefine: repair setVMRoot lemma
Only the 2 loop sorries now left in VSpace_C
2017-06-19 14:32:39 +10:00
Gerwin Klein 1cb83b6351 arm-hyp crefine: close 1 sorry in VSpace_C 2017-06-19 14:32:39 +10:00
Gerwin Klein 85efb9d922 arm-hyp crefine: update state relation for new vgic fault message 2017-06-19 14:32:39 +10:00
Gerwin Klein c63ba94746 arm-hyp crefine: close 1 sorry in VSpace_C 2017-06-19 14:32:39 +10:00
Miki Tanaka 11d7a7ab62 arm-hyp crefine: change names of vcpu ccorres rules, vpcuDisable_ccorres -> vcpu_disable_ccorres, etc.
similarly for vcpu_save, vcpu_enable, and vcpu_restore
2017-06-19 14:32:39 +10:00
Miki Tanaka 082295491e arm-hyp crefine: vcpu_disable_ccorres done 2017-06-19 14:32:39 +10:00
Alejandro Gomez-Londono 57c20b69b4 arm-hyp crefine: Finalise_C sorry free 2017-06-19 14:32:39 +10:00
Joel Beeren e1c3e764f8 arm-hyp crefine: narrowed down sorries in Ipc_C to specific subgoals 2017-06-19 14:32:39 +10:00
Joel Beeren 220fa70586 arm-hyp crefine: cleared sorries in Tcb_C 2017-06-19 14:32:38 +10:00
Joel Beeren 0c40f5bbb6 arm-hyp crefine: cleared 3 sorries in Tcb_C 2017-06-19 14:32:38 +10:00
Rafal Kolanski 87ac6d5508 arm-hyp crefine: decodeVCPUSetTCB_ccorres
+ perform
2017-06-19 14:32:38 +10:00
Gerwin Klein 2d4f1158cd arm-hyp crefine: reduce Retype_C to 1 sorry 2017-06-19 14:32:38 +10:00
Gerwin Klein f27921bccb arm-hyp crefine: Schedule_C sorry-free 2017-06-19 14:32:38 +10:00
Gerwin Klein c81c652f00 arm-hyp crefine: (minor) reduce Syscall to vgicMaintenance sorry 2017-06-19 14:32:38 +10:00
Rafal Kolanski 7769026872 arm-hyp crefine: decodeVCPUWriteReg_ccorres
+ perform
2017-06-19 14:32:38 +10:00
Gerwin Klein b82014766a arm-hyp refine: fix resolveVAddr breakage 2017-06-19 14:32:38 +10:00
Gerwin Klein 0afd65ea55 arm-hyp crefine: close resolveVAddr sorry 2017-06-19 14:32:38 +10:00
Gerwin Klein 85053b2580 arm-hyp refine: new vs_valid_duplicates
The Haskell invariant now describes the page mappings necessary for LargePage
and SuperSection. Updates to refine/* to repair the corresponding fallout.

This commit moves some of the largePagePTEOffset et al lemmas from CRefine up
into Refine.

A small number of small but fiddly word lemmas are currently still sorried.
2017-06-19 14:32:38 +10:00
Rafal Kolanski f09ba20de5 arm-hyp crefine: decodeVCPUReadReg_ccorres
Integrated into decodeVCPUInvocation.
2017-06-19 14:32:38 +10:00
Rafal Kolanski 29b20dc71a arm-hyp crefine: add extended wp rules for readVCPUReg to Move 2017-06-19 14:32:37 +10:00
Rafal Kolanski daea169e14 arm-hyp crefine: invokeVCPUReadReg_ccorres
Significantly complicated, needing multiple updates from kernel team to get
the reply mechanism right.
2017-06-19 14:32:37 +10:00
Alejandro Gomez-Londono 11a709caa4 arm-hyp crefine: associateVCPUTCB_ccorres + dissociateVCPUTCB_ccorres + others
* sanitiseSetRegister_ccorres
  * vcpuInvalidateActive_ccorres
  * armHSCurVCPU_update_active_false_ccorres
  * + Other auxiliary lemmas
2017-06-19 14:32:37 +10:00
Rafal Kolanski daa4e579e4 arm-hyp crefine: writeVCPUReg_ccorres 2017-06-19 14:32:37 +10:00
Rafal Kolanski 2ef0ba91db arm-hyp crefine: fix arg name for vcpu reg machine ops
Was value_', should have been val_'.
2017-06-19 14:32:37 +10:00
Rafal Kolanski 25b178e4bd arm-hyp crefine: solve_rf_sr_vcpu_update method
Solves goals of the following shape (rf_sr on fields of VCPUs):
   ⟦ (σ, σ') ∈ rf_sr; ko_at' vcpu vcpuptr σ ⟧
    ⟹ (σ⦇ksPSpace := ksPSpace σ(vcpuptr ↦ KOArch (KOVCPU (f vcpu)))⦈,
       globals_update
        (t_hrs_'_update (hrs_mem_update (heap_update (Ptr &(vcpu_Ptr vcpuptr→[''some_field''])) val)))
        σ')
      ∈ rf_sr

I was not able to generalise this more. A rule would be better, but I don't
know how to bind one to the textual field lookup.

It's also slow, 10s per invocation, but at least it works.
2017-06-19 14:32:37 +10:00
Rafal Kolanski d0eedd118b arm-hyp crefine: sorry resolveVAddr_ccorres due to C changes 2017-06-19 14:32:37 +10:00
Rafal Kolanski cb06acba7b arm-hyp crefine: readVCPUReg_ccorres 2017-06-19 14:32:37 +10:00
Rafal Kolanski 57c3c70437 arm-hyp crefine: add cvcpu_relation_regs_def
expands cvcpu_relation into relations of VCPU registers
2017-06-19 14:32:37 +10:00
Rafal Kolanski cce2e0805e arm-hyp crefine: add rewrites for C versions of vcpureg comparisons
see: vcpureg_eq_use_types

Transforms (of_nat (fromEnum reg) = scast seL4_VCPUReg_SCTLR)
      into (reg = VCPURegSCTLR)
letting you do cases on reg. There are no cases for seL4_VCPUReg*.

Inspired by invocation_eq_use_types
2017-06-19 14:32:37 +10:00
Rafal Kolanski 40057dff26 arm-hyp crefine: trivial generalisation in IpcCancel_C
[] -> hs in setThreadState_ccorres
2017-06-19 14:32:37 +10:00
Miki Tanaka 903417e288 arm-hyp crefine: some progress in VSpace_C 2017-06-19 14:32:37 +10:00
Miki Tanaka e35dcc6b97 arm-hyp crefine: fix return types (get_gic_vcpu_ctrl_vmcr, get_gic_vcpu_ctrl_apr) 2017-06-19 14:32:37 +10:00
Miki Tanaka 0af76b3242 arm-hyp crefine: update VSpace_R for new vcpu_disable (still with sorries) 2017-06-19 14:32:37 +10:00
Rafal Kolanski 188e0ddfc0 arm-hyp crefine: skeleton for decodeARMVCPUInvocation_ccorres
Needs 4 VCPU-related ccorres rules and final precondition proof.
2017-06-19 14:32:37 +10:00
Rafal Kolanski b46dbe8001 arm-hyp crefine: Arch_decodeInvocation_ccorres + decodeARMMMUInvocation_ccorres
Repurposed nearly all of old Arch_decodeInvocation_ccorres into
decodeARMMMUInvocation_ccorres.
Educated guess at a stub for decodeARMVCPUInvocation_ccorres.
2017-06-19 14:32:37 +10:00
Rafal Kolanski 16946993c6 arm-hyp crefine: resolveVAddr_ccorres
Added valid_objs' to preconditions due to weakness of cpte_relation
w.r.t. large page base pointer alignment.
2017-06-19 14:32:36 +10:00
Rafal Kolanski fa5bb8e4f4 arm-hyp crefine: createSafeMappingEntries_PTE_ccorres, some cleanup 2017-06-19 14:32:36 +10:00
Rafal Kolanski cff16ccf1e arm-hyp crefine: decodeARMPageDirectoryInvocation_ccorres 2017-06-19 14:32:36 +10:00
Rafal Kolanski 56f411c85d arm-hyp crefine: widen sorry in Arch_C
Some accidental intermediate work got in at some point. Oops.
2017-06-19 14:32:36 +10:00
Rafal Kolanski e7ce103775 arm-hyp crefine: widen sorry in VSpace_C due to C changes 2017-06-19 14:32:36 +10:00
Rafal Kolanski c172938247 arm-hyp crefine: finish decodeARMFrameInvocation_ccorres 2017-06-19 14:32:36 +10:00
Rafal Kolanski 5db67853cf arm-hyp crefine: drop armParityEnabled from vm_attribs_relation
Attribute does not exist in abstract spec, is nailed to False in
Haskell. In C it naturally gets mapped across in vmAttributesFromWord,
passed around everywhere, at which point the attribute is ignored
anyway.
2017-06-19 14:32:36 +10:00
Alejandro Gomez-Londono d32b359fb9 arm-hyp crefine: Progress in Finalise_C
* dissociateVCPUTCB_ccorres is almost done
2017-06-19 14:32:36 +10:00
Gerwin Klein d39c2fdacc arm_hyp crefine: Refine_C sorry-free 2017-06-19 14:32:36 +10:00
Rafal Kolanski 8b8a185e44 arm-hyp crefine: sorry Arch_C again due to mapPTE/PDE bug in C
Remap for large pages was correct in C, but hard to verify. Map however was
wrong (i.e. unchanged from ARM).
Abstract/haskell are same as ARM for both, hence they are being fixed.
2017-06-19 14:32:36 +10:00
Miki Tanaka 2000a66309 arm-hyp crefine: assume vcpu_switch_ccorres 2017-06-19 14:32:36 +10:00
Miki Tanaka 54159d54d1 arm-hyp crefine: add ccorres_gen_asm2_state and vcpu_at_c_guard, etc. 2017-06-19 14:32:36 +10:00
Gerwin Klein caf223fd1f arm-hyp crefine: remove vcpu_relation sorries in Ipc 2017-06-19 14:32:36 +10:00
Gerwin Klein 72fd725558 arm-hyp crefine: IpcCancel sorry-free 2017-06-19 14:32:36 +10:00
Gerwin Klein 2e7bda77fa arm-hyp crefine: Recycle_C sorry-free 2017-06-19 14:32:36 +10:00
Gerwin Klein 91e253d7a5 arm-hyp crefine: remove vcpu_relation sorries in IpcCancel 2017-06-19 14:32:36 +10:00
Rafal Kolanski ab068c3573 arm-hyp crefine: Arch_C: decodeARMPageTableInvocation_ccorres 2017-06-19 14:32:36 +10:00
Gerwin Klein 239aed5e8c arm-hyp crefine: IsolatedThreadAction sorry-free 2017-06-19 14:32:36 +10:00
Rafal Kolanski ff6d019f42 arm-hyp crefine: reduce sorries in Arch_C
Several non-trivial problems remain.
2017-06-19 14:32:36 +10:00
Alejandro Gomez-Londono 466620755d arm-hyp crefine: Adding setObject_ccorres rules for updating vcpuTCB and tcbVCPU
* New archThreadSet_tcbVCPU_Basic_ccorres for updating the
    associated vcpu inside a tcb

  * New setObject_vcpuTCB_Basic_ccorres for updating the
    associated tcb inside a vcpu
2017-06-19 14:32:36 +10:00
Miki Tanaka a08bfb1afc arm-hyp crefine: add move_c_guard_vcpu and vcpu_at_rf_sr 2017-06-19 14:32:35 +10:00
Miki Tanaka b4b290de04 arm-hyp crefine: add ccorres lemmas for armHSCurVCPU_update (curv, active, and both) 2017-06-19 14:32:35 +10:00
Miki Tanaka d4f698f260 arm-hyp crefine: fix return type in get_gic_vcpu_ctrl_hcr_ccorres 2017-06-19 14:32:35 +10:00
Gerwin Klein 51d8fa0073 arm-hyp crefine: one sorry left in IsolatedThreadAction 2017-06-19 14:32:35 +10:00
Gerwin Klein 544d46ccbd arm-hyp crefine: ADT_C sorry-free 2017-06-19 14:32:35 +10:00
Gerwin Klein 46269c73c5 arm-hyp crefine: reduce ADT_C sorries; vmRights/HAP injectivity solved 2017-06-19 14:32:35 +10:00
Gerwin Klein d286fdaaf8 arm-hyp crefine: more concurrency 2017-06-19 14:32:35 +10:00
Gerwin Klein 71ed9aee39 arm-hyp crefine: closed unmapPage sorry in VSpace_C 2017-06-19 14:32:35 +10:00
Alejandro Gomez-Londono 9d8f5326f5 arm-hyp crefine: add ccorres_pre rules for vcpu/tcb
getObject for vcpu and tcb, getCurVCPU
2017-06-19 14:32:35 +10:00
Rafal Kolanski 84f63763e0 arm-hyp crefine: sorry Refine_C
This is the top level file of crefine and last file of this sorrying run.

The new handleInterrupt (due to the new getActiveIRQ flag) has more specific
requirements about the current thread's state and queued status, which
are sorried, but probably true.

Some interesting questions about ctac/cinit/csymbr resulted in sorries
that look obviously true, but any attempt at touching them results in
exeception TERM despite many attempts.
2017-06-19 14:32:35 +10:00
Rafal Kolanski ffb76f063c arm-hyp crefine: update and sorry ADT_C
There is a non-trivial issue with the pde/pte state relations no longer
being injective, due to HAPFromVMRights not being injective.

handleHypervisorEvent_C updated in both locations (no idea why two),
generating some interesting questions about cinit/ctac usage.

setArchTCB_C becomes setTCBContext_C because we only set the context on
entry into the kernel, not the VCPU pointer.
2017-06-19 14:32:35 +10:00
Alejandro Gomez-Londono 402f824950 arm-hyp crefine: use option_to_ctcb_ptr in cvcpu_relation
* cvcpu_relation now uses option_to_ctcb_ptr instead of
    option_to_ptr since tcb pointers are special.
2017-06-19 14:32:35 +10:00
Rafal Kolanski 3b0d72a5df arm-hyp crefine: update and sorry Fastpath_C
Don't have vcpuSwitch ccorres yet, plus one likely trivial refine-related
sorry.
2017-06-19 14:32:34 +10:00
Rafal Kolanski b1269759d8 arm-hyp crefine: strengthen cur_vcpu_relation in state relation
Require that having Some vcpuptr on the haskell side implies that ptr is
not NULL on the C side. Required for injectivity.
2017-06-19 14:32:34 +10:00
Rafal Kolanski c7b11988d4 arm-hyp crefine: update Syscall_C 2017-06-19 14:32:34 +10:00
Rafal Kolanski 2906a7dfec arm-hyp crefine: trivial: rename after refine changes 2017-06-19 14:32:34 +10:00
Rafal Kolanski cca9619dd6 arm-hyp crefine: Interrupt_C maxIRQ adjustment 2017-06-19 14:32:34 +10:00
Alejandro Gomez-Londono 0ee00e6d5f arm-hyp crefine: Move.thy fixes 2017-06-19 14:32:34 +10:00
Rafal Kolanski 4628d6e8d6 arm-hyp crefine: sorry Schedule_C (missing vcpuSwitch ccorres) 2017-06-19 14:32:34 +10:00
Rafal Kolanski 3b447a9635 arm-hyp crefine: add refine wp sorries to Move.thy
For someone else to prove.
2017-06-19 14:32:34 +10:00
Rafal Kolanski ff76eebb0f arm-hyp crefine: naively sorried Tcb_C 2017-06-19 14:32:34 +10:00
Rafal Kolanski 7263d28c0d arm-hyp crefine: clean up and sorry Ipc_C
4 interesting sorries
12 easy sorried cases for handling a vcpu case relation
2017-06-19 14:32:34 +10:00
Rafal Kolanski a4ae2ad87b arm-hyp crefine: add VCPUFault/VGICMaint. to state relation 2017-06-19 14:32:34 +10:00
Rafal Kolanski b0466d15f1 arm-hyp crefine: sorry Invoke_C and IsolatedThreadAction 2017-06-19 14:32:34 +10:00
Rafal Kolanski 1f31473a7a arm-hyp crefine: trivial: move some lemmas up for better visibility 2017-06-19 14:32:34 +10:00
Rafal Kolanski c29fda3075 arm-hyp crefine: update prepareThreadDelete_ccorres
Adds dissociateVCPUTCB_ccorres that should be fine, but is sorried.

Demonstrates how to get out of stateful tcb->tcbArch.tcbVCPU
conditional.
2017-06-19 14:32:34 +10:00
Rafal Kolanski de5369c94d arm-hyp crefine: sorry Finalise_C Recycle_C Arch_C
Fixed the easy lemmas, but Arch_C has lots of issues outstanding.
2017-06-19 14:32:34 +10:00
Rafal Kolanski a7ec8d5a2d arm-hyp crefine: add simp dels to DetWP (includes Include_C) 2017-06-19 14:32:34 +10:00
Rafal Kolanski 2a24f167b2 arm-hyp crefine: archThreadGet ccores_pre + convenience functions 2017-06-19 14:32:34 +10:00
Rafal Kolanski ec8d7e797e arm-hyp crefine: move "Move.thy" up in the hierarchy 2017-06-19 14:32:34 +10:00
Rafal Kolanski b8ea5e9099 arm-hyp crefine: kick more *Bits_eq from simpset, use (machine|table)_bits_defs
Introduce machine_bits_defs to catch even more items,
e.g. vcpu_bits and vcpuBits

Clean up all current uses of p[td]e?_bits in favour of Haskell
equivalent names and table_bits_defs simplification.

Drop p[td]eBits_eq and vcpuBits_eq from simpset.
2017-06-19 14:32:33 +10:00
Rafal Kolanski f5624aace9 arm-hyp crefine: IpcCancel_C trivially sorried 2017-06-19 14:32:33 +10:00
Rafal Kolanski 1b79220406 arm-hyp crefine: Retype_C down to 3 sorries re Arch_createObject
The C code for Arch_createObject needs updates to the ghost annotations
before further proof can proceed.
2017-06-19 14:32:33 +10:00
Rafal Kolanski a1b6c0afae arm-hyp crefine: kick p(t|d)Bits_eq from simpset, use table_bits_defs
CRefine is a theory of refinement from Haskell spec to C.
Let's avoid having to change tons of p(t|d)Bits lemmas to refer to some
abstract spec constants for no reason.

e.g. if you have a: "P ptBits" and want to prove "P 12" "simp add: a"
will NOT work, as the simplifier does not do that level of
simplification of rules supplied to it.
2017-06-19 14:32:33 +10:00
Rafal Kolanski e8b522e5fe arm-hyp crefine: strengthen cache flush assumptions in VSpace
In hyp mode we don't share an address space with our users, so we flush
by kernel MVA instead. We need to also know that there isn't an overflow
after the ptrFromPAddr translation from physical to kernel virtual.
2017-06-19 14:32:33 +10:00
Rafal Kolanski 3400ebd00d arm-hyp crefine: Detype_C sorry-free for now 2017-06-19 14:32:33 +10:00
Rafal Kolanski e207697178 arm-hyp crefine: progress on VSpace_C, sorried 2017-06-19 14:32:33 +10:00
Rafal Kolanski 17949975b2 arm-hyp crefine: TcbAcc_C sorry-free 2017-06-19 14:32:33 +10:00
Rafal Kolanski 065baa1952 arm-hyp crefine: misc lemmas about option/ptr/0 2017-06-19 14:32:33 +10:00
Rafal Kolanski 68797449c7 arm-hyp crefine: TcbQueue_C sorry-free 2017-06-19 14:32:33 +10:00
Rafal Kolanski 68ce0e9dee arm-hyp crefine: PSpace_C sorry-free 2017-06-19 14:32:33 +10:00
Rafal Kolanski 6252b0b5b8 arm-hyp crefine: convenience defs p(t|d)(_b|B)its_def' 2017-06-19 14:32:33 +10:00
Rafal Kolanski dd62b49ee4 arm crefine: seL4-specific ctac lemmas now in Ctac_lemmas_C 2017-06-19 14:32:33 +10:00
Rafal Kolanski 11fa19c987 arm-hyp crefine: seL4-specific ctac lemmas now in Ctac_lemmas_C 2017-06-19 14:32:33 +10:00
Rafal Kolanski f581b3ea7f arm-hyp crefine: CSpace_C sorry-free 2017-06-19 14:32:33 +10:00
Rafal Kolanski 247601ecd8 arm-hyp crefine: Machine_C cache proofs done 2017-06-19 14:32:33 +10:00
Rafal Kolanski 96bd0536bf arm-hyp crefine: wholesale change of pde and pde array sizes
pte_C[256] -> pte_C[512]
pde_C[4096] -> pde_C[2048]
2017-06-19 14:32:33 +10:00
Rafal Kolanski c8529de532 arm-hyp crefine: update SR_Lemmas for VCPU and global state 2017-06-19 14:32:33 +10:00
Rafal Kolanski fc13ffe455 arm-hyp crefine: StateRelation: VCPU relations
cvcpu_relation for VCPU objects in memory
cur_vcpu_relation for armHSCurVCPU
2017-06-19 14:32:32 +10:00
Rafal Kolanski 3c4c5f3181 arm-hyp crefine: Wellformed_C deals with VCPUs 2017-06-19 14:32:32 +10:00
Rafal Kolanski cc073635ff arm-hyp crefine: update cpte/cpde relations; StateRelation_C processes 2017-06-19 14:32:32 +10:00
Rafal Kolanski a07a9b76c9 arm-hyp crefine: update ARM*. with ARM_HYP*. qualification
Found three quantification flavours styles: ARM. ARM_A. ARM_H.

Via find|sed on entire folder.
2017-06-19 14:32:32 +10:00
Rafal Kolanski 46bab6dcf3 arm-hyp crefine: preliminary machine op ccorres assumptions
Assume correspondence between machine ops declared in MachineOps.thy and
their C equivalents.
2017-06-19 14:32:32 +10:00
Rafal Kolanski 526c9af393 arm-hyp crefine: copy from ARM 2017-06-19 14:32:32 +10:00
Pang Luo da28d94974 VER-717: refactor tpidrurwRegister and fix corresponding proof 2017-05-05 15:17:41 +10:00
Joel Beeren 71e2db88a4 arm: refactor sanitise_register to take a bool instead of a kernel_object
This simplified the sanitise_register logic in CRefine for arm-hyp.
2017-05-03 21:51:57 +10:00
Rafal Kolanski 87a3d9592d cspec/crefine: readme: document significance of L4V_ARCH
tags: [NO_PROOF]
2017-03-31 16:13:42 +11:00
Rafal Kolanski c41c7a97ca update references from/to moved crefine, parametrise over L4V_ARCH 2017-03-31 16:13:41 +11:00
Rafal Kolanski f00bd94abe crefine: move crefine/* into crefine/ARM/* 2017-03-31 16:13:41 +11:00
Matthew Brecknell a381e4fc2f crefine: fix proofs after adding ccorres_rewrite to cinit 2017-03-26 07:41:46 +11:00
Miki Tanaka 7ad3ef3b3e wp: update the proofs for the new wp/wpc/wpsimp 2017-03-16 19:39:11 +11:00
Rafal Kolanski 5ece85b8d2 crefine: ARM verification support for "Disable active VCPU when switching to the idle thread" 2017-03-06 16:15:27 +11:00
Gerwin Klein a94f5d0e69 crefine: tcb argument for sanitiseRegister 2017-03-06 14:42:46 +11:00
Miki Tanaka fec4f5172a CRefine: updates for Hypervisor stub 2017-02-22 15:26:50 +11:00
Miki Tanaka 9b09efd1f8 CRefine fix for prepareThreadDelete 2017-02-20 09:23:56 +11:00
Joel Beeren 2b96c9b3a3 CRefine: add trivial lemma for Arch_finaliseInterrupt 2017-02-16 16:25:57 +11:00
Gerwin Klein 520921351a provide TCB argument for sanitiseRegister
Other platforms such as arm-hyp will need to look into additional TCB state
such as VCPU in sanitiseRegister. This commit provides the scaffolding for
that.
2017-02-12 12:54:42 +11:00
Rafal Kolanski 7657681fca move refine/* to refine/ARM/*, parametrise over $L4V_ARCH 2017-01-30 12:22:22 +11:00
Rafal Kolanski 6594aa2f9a crefine: ARM support hypervisor-enhanced sanitiseRegister
On ARM with hypervisor extensions (arm-hyp), sanitiseRegister needs vcpu
data from the arch TCB component, thus adding an extra parameter.

This is a quick fix based around normal ARM not using that parameter,
and hence does not provide enough to get the proofs through on arm-hyp.

To do it properly requires additional work around the sanitiseRegister
call-site, which needs unwrapping it from asUser and zipWithM.
2017-01-30 11:37:23 +11:00
Joel Beeren 3dafec7d46 backport changes to ARM proofs from X64 work in progress
- replace ARM-specific constants and types with aliases which can be
  instantiated separately for each architecture.
- expand lib with lemmas used in X64 proofs.
- simplify some proofs.

Also-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2017-01-27 08:31:07 +11:00
Gerwin Klein 47119bf43e wp_cleanup: update proofs for new wp behaviour
The things that usually go wrong:
  - wp fall through: add +, e.g.
      apply (wp select_wp) -> apply (wp select_wp)+

  - precondition: you can remove most hoare_pre, but wpc still needs it, and
    sometimes the wp instance relies on being able to fit a rule to the
    current non-schematic precondition. In that case, use "including no_pre"
    to switch off the automatic hoare_pre application.

  - very rarely there is a schematic postcondition that interferes with the
    new trivial cleanup rules, because the rest of the script assumes some
    specific state afterwards (shouldn't happen in a reasonable proof, but
    not all proofs are reasonable..). In that case, (wp_once ...)+ should
    emulate the old behaviour precisely.
2017-01-13 14:04:15 +01:00
Matthew Brecknell b5158e31bc Isabelle2016-1: fix proofs involving UNION
SUPREMUM changed from a definition to an abbreviation.

A number of proofs that previously used blast, fastforce or auto to
solve goals involving UNION, now either fail or loop. This commit
includes various ad-hoc workarounds.
2017-01-05 14:27:33 +11:00
Matthew Brecknell bd94f7907e Isabelle2016-1: fix miscellaneous proofs 2017-01-05 14:27:30 +11:00
Matthew Brecknell 08d8a8f2fa Isabelle2016-1: replace 'unfolded' attr with 'simplified' where the former now loops 2017-01-05 14:27:04 +11:00
Matthew Brecknell a84ac9c411 Isabelle2016-1: remove references to empty 'assms'
Isabelle now only creates a local fact named 'assms' when there is a
non-zero number of structured assumptions.
2017-01-05 14:26:47 +11:00
Matthew Brecknell aadc5125ba Isabelle2016-1: follow Isabelle's choice of meta-forall bindings
Fix some proofs that were broken because Isabelle chose different
names for meta-forall-bound variables.
2017-01-05 14:25:18 +11:00