Commit Graph

1136 Commits

Author SHA1 Message Date
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