Commit Graph

1358 Commits

Author SHA1 Message Date
Joel Beeren ff95aec20f x64: crefine: added Interrupt_C 2018-07-05 16:23:14 +10:00
Joel Beeren 1fc3536aff x64: crefine: added Schedule_C 2018-07-05 16:23:14 +10:00
Joel Beeren 5ccbe6061d x64: crefine: added Tcb_C 2018-07-05 16:23:14 +10:00
Joel Beeren 1079673d34 x64: crefine: adjust value_abbreviation in Delete_C 2018-07-05 16:23:14 +10:00
Joel Beeren fa38926ac3 x64: crefine: update for isabelle-2017 2018-07-05 16:23:14 +10:00
Joel Beeren c9633be900 x64: crefine: added Delete_C 2018-07-05 16:23:14 +10:00
Joel Beeren 05ace54dd4 x64: crefine: update sorries for C changes
changes include:
    * zombie bit numbers changing
    * object sizes abstracted
2018-07-05 16:23:14 +10:00
Joel Beeren b5d5b973f6 x64: crefine: added Ipc_C 2018-07-05 16:23:14 +10:00
Joel Beeren 24bc43a65a x64: crefine: added IsolatedThreadAction.thy 2018-07-05 16:23:14 +10:00
Joel Beeren f4e33ad6c6 x64: crefine: minor tweaks in VSpace_C 2018-07-05 16:23:14 +10:00
Joel Beeren 4668abb6b7 x64: crefine: added Finalise_C 2018-07-05 16:23:14 +10:00
Joel Beeren bb4cdf564b x64: crefine: added Detype_C 2018-07-05 16:23:14 +10:00
Joel Beeren 0bad4a3918 x64: crefine: add CSpace_All.thy 2018-07-05 16:23:14 +10:00
Joel Beeren 767b2612be x64: crefine: added IpcCancel_C 2018-07-05 16:23:14 +10:00
Joel Beeren a07380a7fc x64: crefine: added SyscallArgs_C 2018-07-05 16:23:14 +10:00
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
Maksym Bortin 9d315cda20 ainvs+refine: update proofs for SetTLSBase (VER-807) 2018-07-03 13:42:19 +10:00
Gerwin Klein a93dafb21c proofs: record tests.xml dependencies for SepTacticsExamples 2018-06-27 10:06:48 +02:00
Corey Lewis 967a091cf6 ainvs: Remove unnecessary crunches and whitespace 2018-06-27 11:48:56 +10:00
Corey Lewis 97c24b95c9 ainvs: Add itcb_arch to the itcb projection
This allows us to more easily show that arch specific tcb fields are
preserved by many functions of the spec. For ARM_HYP we add a
projection for the tcb_vcpu field.
2018-06-27 11:48:56 +10:00
Corey Lewis d77d31a77c lib: Refactor crunch so that it can be used for both the nondet monad and the trace monad 2018-06-26 14:45:28 +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
Corey Lewis c686d6e776 lib: Make Crunch more effective at applying supplied rules 2018-06-08 15:48:32 +10:00
Corey Lewis 70212ec799 dpolicy: add a comment summarising the result in proof/access-control/Dpolicy.thy 2018-05-08 10:19:02 +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
Joel Beeren 02e5096534 x64: VER-917: correct VSpace invocations to update map_type, and add invariants to check that maptype and mapped addresses correspond for PageCaps 2018-04-19 05:27:05 +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 9813f6a09f arm-hyp haskell+refine: reorder arch invocation labels to match C 2018-04-07 00:02:51 +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 e3774a8813 asmrefine: ctcb_offset AUXUPD 2018-03-26 14:37:22 +11: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
Thomas Sewell 652cbb966e Initial proof updates for combinator changes. 2018-03-16 14:53:22 +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 53996e94d9 arm-hyp refine: proof update for user_context refactor 2018-03-08 18:41:28 +11:00
Gerwin Klein 830f407d7f arm-hyp ainvs: proof update for user_context refactor 2018-03-08 18:41:28 +11:00
Gerwin Klein 3f7d6e1ce9 ARM infoflow: proof update for user_context refactor 2018-03-08 18:41:28 +11:00
Gerwin Klein 84633ccb7f ARM access: proof update for user_context refactor 2018-03-08 18:41:28 +11:00
Gerwin Klein 51190d18d1 ARM bisim: proof update for user_context refactor 2018-03-08 18:41:28 +11:00
Gerwin Klein b0cac3ec77 ARM drefine: 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 2d9de5b9a6 ARM refine: proof update for user_context refactor 2018-03-08 18:41:28 +11:00
Gerwin Klein 8601dce656 ARM ainvs: 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
Gerwin Klein 72c4123d10 x64 refine: proof update for user_context refactor 2018-03-08 18:41:28 +11:00
Gerwin Klein b29e9c9fd3 x64 ainvs: proof update for user_context refactor 2018-03-08 18:41:28 +11:00
Gerwin Klein 79cea8452f retire out-of-date effort calculation 2018-03-08 08:32:42 +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
Miki Tanaka 9fb7c5cf4d arm_hyp ainvs: fix a typo 2018-01-30 12:00:25 +11:00
Miki Tanaka 4efe5392f7 arm ainvs: fix a typo 2018-01-30 12:00:21 +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
Gerwin Klein 7c0e7970d6 x64 refine: proof update for ASIDMap removal 2018-01-11 18:48:37 +11:00
Gerwin Klein 3bc1cb7f71 x64: update ainvs for asid_map removal 2018-01-11 18:48:37 +11:00
Matthew Brecknell 2f540e802c add constant definitions for bounds on untyped object sizes 2017-12-18 12:58:27 +11:00
Matthew Brecknell a1b60083e8 x64 ainvs: add some lemmas about canonical addresses 2017-12-18 12:57:55 +11:00
Miki Tanaka dcca6d496f x64 ainvs/refine: simple_ko setter/getter 2017-12-14 18:03:41 +11:00
Miki Tanaka 6eb2cb74ad arm-hyp: simple_ko setter/getter 2017-12-14 18:03:31 +11:00
Miki Tanaka 2a1beffac1 arm: update for simple_ko getter/setter 2017-12-14 18:02:48 +11:00
Miki Tanaka b37bc04463 arm ainvs: wp rules for simple_ko setter/getter 2017-12-14 18:02:44 +11:00
Miki Tanaka 3841b6e8ba arm : add AEndpoint and ANTFN a_type simplification
in addition to the a_type ATCB simplification, the following two are now in the simpset:
  "a_type (Endpoint x) = AEndpoint"
  "a_type (Notification v) = ANTFN"
2017-12-14 07:17: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 ffc0640869 VER-853: put arch_check_irq into the Arch locale, and update x64 to match C 2017-12-13 12:13:36 +11:00
Joel Beeren 0c9d7269d4 x64: miscellaneous constant updates (VER-845, VER-852)
Updated syscallMessage register list, maxIRQ to match C code
2017-12-13 12:13:36 +11:00
Joel Beeren b01b341b3c x64: adjust definition of Arch.switchToIdleThread (VER-848) 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
Rafal Kolanski f641d70b6d infoflow: add InfoFlow_Image_Toplevel
It's really tiring figuring out whether we loaded all of the right
InfoFlow theory files in jEdit. This file lists what "the theories for
InfoFlow" are and should be loaded instead.

ROOT file adjusted to target it instead of a bunch of files, some of
which already include some of the others.
2017-11-27 21:00:14 +11:00
Matthew Brecknell a2dd6d1777 autocorres-crefine: update CRefine proofs for AutoCorres 2017-11-22 15:37:36 +11:00
Matthew Brecknell 70de40bcdd autocorres-crefine: add AutoCorresCRefine image 2017-11-22 12:18:16 +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
Gerwin Klein 68ae97454e lib: more modifiers for wpsimp (wp_del, simp_del) 2017-11-03 08:09:29 +11:00
Thomas Sewell 8753c05b20 Expand eval_bool; add a method word_eqI_solve.
A number of proofs begin with word_eqI followed by some similar steps,
suggesting a 'word_eqI_solve' proof method, which is implemented here.

Many of these steps are standard, however a tricky part is that constants of
type 'nat' which encode a particular number of bits must often be unfolded.
This was done by expanding the eval_bool machinery to add eval_int_nat, which
tries to evaluate ints and nats.

Testing eval_int_nat revealed the need to improve the code generator setup
somewhat. The Arch locale contains many of the relevant constants, and they are
given global names via requalify_const, but the code generator doesn't know
about them. Some tweaks make them available. I *think* this is safe for
arch_split, as long as the proofs that derive from them are true in each
architecture.
2017-11-01 17:30:46 +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 d48c211ac9 Isabelle2017: update DRefine (ARM) for RC0 2017-10-30 12:23:26 +11:00
Matthew Brecknell 3cb118fe02 Isabelle2017: update Refine for RC0 2017-10-30 12:23:26 +11:00
Alejandro Gomez-Londono 8f5bf9b1ae Isabelle2017: updates InfoFlow for RC0
* Rename zmod_eq_dvd_iff -> mod_eq_dvd_iff
2017-10-30 12:23:26 +11:00
Matthew Brecknell 4f68967bfc Isabelle2017: update AInvs for RC0
* word_eqI is no longer rule_format.

  * Updated Isabelle/ML Thm.join_proofs to Thm.consolidate.

  * Updated suffix_refl to suffix_order.order.refl.

  * Removed some lines of proofs, thanks to improved simplifier.
2017-10-30 12:23:26 +11:00
Matthew Brecknell 0102ef172a Isabelle2017: remove String_Compare
This was a workaround for an Isabelle2016-1 performace regression, and
is no longer required.
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
Miki Tanaka 9bdb47e114 reintroduce Orphanage test (for ARM only)
- Orphanage files in the ARM_HYP and X64 directories are not tested at the moment
- once we finish proving them, we will remove the restriction to ARM
2017-10-24 13:49:21 +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 ef9a9302dd remove trailing \r characters 2017-10-20 14:22:36 +11:00
Matthew Brecknell 184d6b70b7 remove most tab characters 2017-10-20 14:22:36 +11:00
Thomas Sewell 2c0820c175 Improve arch-split for BCorres2_AI changes. 2017-10-10 11:02:19 +11:00
Thomas Sewell 6529c7dd42 Repair schedule_bcorres.
This was broken a long while back because arch_switch_to_idle_thread
might sometimes be skipped in the implementation if the idle thread
was previously scheduled. Putting the same behaviour in the most
abstract (unit) specification is pretty easy, and it's not clear why
it wasn't done earlier.
2017-10-10 11:02:19 +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
Adrian Danis 100e738f21 ckernel: Use correct dependencies when building CKernel
Theory files used in the CKernel build refer to files that are generated by the
haskell translater by the design-spec target. This commit changes the dependencies
in the Makefile to reflect that
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
Matthew Brecknell 85a20c08a5 theory_imports: depend on c-kernel instead of CParser
The theory_imports regression test requires bitfield-generated theory
files. Previously, the theory_imports regression test depended on
CParser, and explicitly invoked "make" to ensure bitfield-generated
theories were present. However, these theories can also be generated by
the CKernel regression test. This meant that it was non-deterministic
whether bitfield-generated theories were generated during the
theory_imports regression test or the CKernel regression test.

This change adds a c-kernel regression test which generates the relevant
theories for the current L4V_ARCH, and makes both theory_imports and
CKernel depend on c-kernel. This ensures that those theories are always
generated during the c-kernel test, and should therefore make run_tests
timing results for the CKernel image more consistent.

Unfortunately, the check_theory_imports script does not have an easy way
to restrict itself to theories for the current L4V_ARCH, so the script
still needs to invoke "make c-kernel" for architectures other than the
current L4V_ARCH.
2017-09-12 14:47:24 +10:00
Miki Tanaka 71d1d4143b x64 ainvs: rename wellformed_arch_obj to arch_valid_obj 2017-08-18 10:04:01 +10:00
Miki Tanaka 55d50c7ba9 arm/arm_hyp ainvs: rename wellformed_arch_obj to arch_valid_obj 2017-08-18 09:49:11 +10:00
Miki Tanaka 07e9bfa417 remove_valid_arch_objs: updates for X64 2017-08-18 09:44:00 +10:00
Miki Tanaka 6d8e917087 Remove valid_arch_objs
now that we have valid_vspace_objs to express validiy of
vspace objects, we do not need valid_arch_objs: we have
valid_objs to state the validity of non-vspace arch objects.
2017-08-17 22:44:23 +10:00
Thomas Sewell dbd888ad3e asmrefine: add one README.md, update another.
Better documentation of what's in the proof/asmrefine and
tools/asmrefine directories.
2017-08-16 18:15:21 +10:00
Matthew Brecknell 8c549b6764 x64: remove all trailing whitespace 2017-08-11 14:19:39 +10:00
Joel Beeren f05bc45d59 misc: clean up before merging x64 2017-08-11 11:49:18 +10:00
Joel Beeren 82863978bd Merge branch 'master' into x64 2017-08-09 17:10:06 +10:00
Joel Beeren c0528e44f9 arm: drefine: update for word_size_bits changes 2017-08-09 17:02:50 +10:00
Joel Beeren 8032234af9 crefine: integrate all architectures 2017-08-09 17:02:50 +10:00
Joel Beeren 42401684b0 refine: integrate all architectures 2017-08-09 17:02:49 +10:00
Matthew Brecknell 3871575834 x64: add crefine stubs to keep theory_imports happy 2017-08-09 17:02:49 +10:00
Matthew Brecknell 254fb01de1 x64: remove special cases for x64 from proof/Makefile 2017-08-09 17:02:49 +10:00
Matthew Brecknell 3bbc1d0cb9 regression: remove redundant RefineOnly image
This was previously used to exclude Orphanage from the X64 regression.
Now that the Refine image excludes Orphange, RefineOnly is no longer
needed.
2017-08-09 17:02:49 +10:00
Matthew Brecknell 2f70a304da ainvs: integrate all architectures 2017-08-09 16:57:39 +10:00
Joel Beeren 0685280906 misc: remove redundant skip_proofs flag for BaseRefine in proof/ROOT 2017-08-09 11:28:10 +10:00
Joel Beeren 2ce1bf3a25 misc: remove unnecessary theories from proof/ROOT 2017-08-08 16:13:38 +10:00
Joel Beeren d9afe3f45c run_tests: Adjust environment flags for build
*** ALERT: ANYONE USING SKIP_REFINE_PROOFS SHOULD CHANGE TO
SKIP_DUPLICATED_PROOFS IN ~/.isabelle/etc/settings!!! ***

Previously SKIP_REFINE_PROOFS was being used to skip duplicated Refine
and AInvs proofs when building CBaseRefine and InfoFlowC. This
conflicted with adding an option to actually skip building Refine proofs
(for example when trying to quickly build DBaseRefine).

After this change, we have the following SKIP_PROOFS flags:
    * SKIP_AINVS_PROOFS: used to skip AInvs proofs (for example when
      building Refine)
    * SKIP_REFINE_PROOFS: used to skip Refine proofs (for example when
      building DBaseRefine)
    * SKIP_DUPLICATED_PROOFS: used to skip the rebuild of AInvs and
      Refine when building forked images such as CBaseRefine and
      InfoFlowC

In addition, the QUICK_AND_DIRTY flag for AInvs has been changed:
        INVS_QUICK_AND_DIRTY -> AINVS_QUICK_AND_DIRTY
2017-08-08 16:11:20 +10:00
Joel Beeren 965a77215f misc: add dependency for design spec to DBaseRefine, DRefine
tags: [NO_PROOF]
2017-08-08 12:22:00 +10:00
Joel Beeren d1482e4ffa misc: added skip proofs option for Refine
tags: [NO_PROOF]
2017-08-08 12:19:43 +10:00
Matthew Brecknell e66b3f44d0 trivial: remove a tab character 2017-07-31 11:05:44 +10:00
Matthew Brecknell 149ef38252 trivial: remove a tab character
tags: [NO_PROOF]
2017-07-27 10:09:52 +10:00
Matthew Brecknell 238e8b307e x64: merge master 2017-07-21 11:27:12 +10:00
Daniel Matichuk d38a19f1bb fix ARM_HYP Refine for newest corres method after ARM_HYP rebase
VER-737
2017-07-18 12:19:48 -06:00
Daniel Matichuk c72bece06f fix ARM Refine for newest corres method after ARM_HYP rebase
VER-737
2017-07-18 12:19:27 -06:00
Daniel Matichuk 2d2f2a1e1d fix refine proofs for improved corres_pre
minor fix - verification condition no longer
generated mid-proof

VER-737
2017-07-17 13:09:46 -06:00
Daniel Matichuk 8c7163457a remove explicit use of corres_rv rules
This is now handled by the corres method

VER-737
2017-07-17 13:09:46 -06:00
Daniel Matichuk 206be43920 use correswp and correct corres_rv rules 2017-07-17 13:09:46 -06:00
Daniel Matichuk fa6112378d cleanup refine for latest corres_method
Some fallout from protecting return-value relations

VER-737
2017-07-17 13:09:08 -06:00
Daniel Matichuk 8d454f1deb use new lift_corres_args attribute to abstract function args
This avoids manually rewriting the lemma statements, but puts
the rules in the more general form
2017-07-17 13:08:19 -06:00
Daniel Matichuk 2bc620c670 addressing protect_r -> corres_protect rename 2017-07-17 13:08:19 -06:00
Daniel Matichuk ad82c6c751 workaround for bad bug in dcorres
This line invokes "wp" with a schematic postcondition, which makes
this proof very unstable when new wp rules are added.
2017-07-17 13:06:55 -06:00
Daniel Matichuk 196e2e2e0a fix corres proofs for corres method
Fixing the fact that ex_abs is slightly rephrased

VER-737
2017-07-17 13:06:55 -06:00
Daniel Matichuk 9ab936e815 fix refine after changes to corres_method 2017-07-17 12:54:08 -06: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
Thomas Sewell 971c6782e5 Support extra specs, ctzl, clzl in SimplExport.
This patch permits the user to supply additional specs for functions
whose bodies were not imported (DONT_TRANSLATE or not present in parsed
C source). Those specs are exported by SimplExport.

The existing apparatus can import builtin functions like ctzl/clzl in C
sources by admitting them without bodies (DONT_TRANSLATE) and giving
them axiomatic Hoare triples (FNSPEC).

Translation validation then requires export of useful semantics. The user
can supply a made-up body, and show that it is a refinement of the body
that the parser created (derived from the FNSPEC and MODIFIES clauses).
The body must export out the graph language correctly. For ctzl/clzl etc
this is easy.
2017-07-05 15:27:38 +10:00
Matthew Brecknell 5cb2fb81f8 x64 regression: extend cspec timeouts 2017-07-04 18:13:03 +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
Matthew Brecknell ce748b7522 x64: create arch-specific CKernel 2017-06-22 17:24:53 +10:00
Matthew Brecknell 546ad8652e regression: add dependency between haskell-translator and CKernel
tags: [NO_PROOF]
2017-06-22 11:43:40 +10:00
Joel Beeren 392d055e99 SELFOUR-748: rename tlb invalidation functions 2017-06-20 14:05:45 +10:00
Alejandro Gomez-Londono 492d6c1817 arm infoflow: Fix argument of getActiveIRQ in check_active_irq_if
* This is trivial/irrelevant since getActiveIRQ ignores its argument
    in ARM, but it makes a bit more sense to have it being this way,
    and it is consistent with the equivalent function in InfoFlowC.
2017-06-19 14:32:45 +10:00
Alejandro Gomez-Londono 8bac9cc586 arm infoflowc: Refactors proofs for new definitions (pteBits, pdeBits, etc) 2017-06-19 14:32:45 +10:00
Alejandro Gomez-Londono a8258ae6a3 arm infoflowc: Updates for the new argument of getActiveIRQ 2017-06-19 14:32: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
Miki Tanaka bd1a600cfb arm DRefine: updates for backports from arm-hyp 2017-06-19 14:32:45 +10:00
Alejandro Gomez-Londono a2a1522bae arm access: updates for the backport from arm-hyp 2017-06-19 14:32:45 +10:00
Alejandro Gomez-Londono 2d20221396 arm refine: updates for the backport from arm-hyp completed 2017-06-19 14:32:44 +10:00
Joel Beeren 7d4a7b5f64 arm ainvs: clear sorry in ArchAcc_AI 2017-06-19 14:32:44 +10:00
Alejandro Gomez-Londono fb9de60cfe arm ainvs: Update for create_mapping_entries changes 2017-06-19 14:32:44 +10:00
Alejandro Gomez-Londono b76709967b arm refine: Updating theories for ainvs changes 2017-06-19 14:32:44 +10:00