Commit Graph

95 Commits

Author SHA1 Message Date
Joel Beeren 1634608453 arm: ioportcontrol: Fixes after adding IOPortControlCaps to x64 2018-04-19 05:27:06 +10:00
Corey Lewis 2d0baab462 Proof update for crunch changes 2018-04-04 14:13:55 +10: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
Gerwin Klein 84633ccb7f ARM access: proof update for user_context refactor 2018-03-08 18:41:28 +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 2f540e802c add constant definitions for bounds on untyped object sizes 2017-12-18 12:58:27 +11:00
Miki Tanaka 2a1beffac1 arm: update for simple_ko getter/setter 2017-12-14 18:02:48 +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 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 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
Alejandro Gomez-Londono 796887d9b1 Removes all trailing whitespaces 2017-07-12 15:13:51 +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
Joel Beeren 392d055e99 SELFOUR-748: rename tlb invalidation functions 2017-06-20 14:05:45 +10:00
Alejandro Gomez-Londono a2a1522bae arm access: updates for the backport from arm-hyp 2017-06-19 14:32:45 +10:00
Miki Tanaka b17a329365 arm access: ARM Access now builds on arm-hyp 2017-06-19 14:32:44 +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
Gerwin Klein f86763afbc lib: new invariant syntax "f {|P|}"
Precedence chosen between bind and equality such that
f >>= g {P} = foo {Q} works as expected.
2017-03-17 11:13:41 +11:00
Matthew Brecknell 6ce6c97397 arch_split: DetSchedDomainTime_AI, DetSchedSchedule_AI for ARM 2017-03-09 12:10:44 +11:00
Miki Tanaka b2f2034bbc Bisim / Access / InfoFlow: updates for Hypervisor stub 2017-02-22 15:26:49 +11:00
Miki Tanaka d7026b5bad Access and InfoFlow fix for prepare_thread_delete 2017-02-20 09:23:55 +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 511c6b2d3a Isabelle2016-1: rename free variables to avoid capture 2017-01-05 14:24:36 +11:00
Matthew Brecknell 7d0425dd3e Isabelle2016-1: fix proofs using lemmas now removed
Some lemmas that were specific instances of more general lemmas have
been removed from the library. In most cases, broken references could
simply be replaced with the more general fact.
2017-01-05 14:23:11 +11:00
Matthew Brecknell 41d4aa4f1d Isabelle2016-1: update references to renamed constants and facts 2017-01-05 14:23:05 +11:00
Alejandro Gomez-Londono 1289f7bc6e Updating remaining proofs for tcb_arch reserved_irq and arch_fault changes
* tcb_context rephrasing to (tcb_context o tcb_arch) and respectively
  for set operations

* unfolding of reserved_irq for trivially solving most lemmas

* Changes to the inductive definition of integrity_obj to account for
  tcb_arch and tcb_context new location

* Changes to the tcb examples in ExampleSystem to include tcb_arch

* Rephrasing of domain_sep_inv to accommodate the ReservedIRQ case

* Mostly rephrasing  of tcb_context to (some form of) (tcb_context o tcb_arch)

* Trivial unfolding of handle_reserved_irq for hoare rules

* Examples in Example_Valid_State.thy were updated

* Nothing remarkable, mostly rephrasing of tcb_context and ReservedIRQ
  handling

* Fun fact, some proofs are now shorter

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:51:07 +11:00
Xin,Gao d7450607a8 SELFOUR-553: rebase and fix styles and comments 2016-11-21 20:47:15 +11:00
Miki Tanaka a2d707d17e SELFOUR-553: update rpidrurw in TCBConfigure for simpler Infoflow proofs. 2016-11-18 16:27:26 +11:00
Joel Beeren 2553371a14 SELFOUR-64: Remove general Recycle operation
This removes the RecycleCap CNodeInvocation, whilst
retaining recycle behaviour for Endpoints -- now renamed
CNodeCancelBadgedSends.
2016-11-18 14:11:12 +11:00
Rafal Kolanski ff7ca60df7 ADT: add kernel entry/exit constraints on domain time left
These changes to the automatons are required by:
  SELFOUR-242: invert bitfield scheduler and optimise fast path

Details:

When we enter the kernel, the domain time left (ksDomainTime) is never zero.
If we entered on a timer interrupt, we may decrement it to zero before the
scheduler runs. If we do so, we set the scheduler state to choose_new_thread.

When choosing a new thread, the scheduler switches to a new domain if the
present one is required, and sets the new domain time left from domain_list
(ksDomSchedule).

When entering the kernel on a non-interrupt event, we never touch the domain
time left, which trivially preserves the new constraints.

To prove these, we had to ban a transition from kernel entry to kernel being
preempted when handling an interrupt event in InfoFlow. This is fine, as by
design handling interrupts is not meant to be preempted by interrupts.
2016-11-11 06:01:30 +11:00
Thomas Sewell a96346e308 SELFOUR-444: Finished InfoFlow and DRefine. 2016-11-02 11:19:09 +11:00
Thomas Sewell 411af12ee9 SELFOUR-444: Logic generalised; Access finished.
Tweak AInvs proof for Untyped to be more reusable, finish integrity
proofs.
2016-11-02 11:19:08 +11:00
Matthew Brecknell a3714e8190 SELFOUR-276: Finish proofs for maximum controlled priority (MCP)
To finish the proof of refinement to C, the specification for checkPrio
needed strengthening: the checkPrio spec now takes a machine word
argument. In the spec, priorities are still stored as 8-bit quantities,
however. Once the spec was strenthened, it was possible to remove some
redundant checks and mask operations from the C code.

A thread's maximum controlled priority (MCP) determines the maximum
thread priority or MCP it can assign to another thread (or itself).
2016-10-05 02:43:41 +11:00
Xin,Gao 8d4a8eb238 SELFOUR-421: fix coding style 2016-09-22 19:23:28 +10:00
Xin,Gao 113315d9a6 SELFOUR-421: merge and fix up to ArmConfidentiality proof 2016-09-22 19:21:56 +10:00
Xin,Gao 252ce8df4c SELFOUR-421: infoflow and infoflow_c builds 2016-09-22 19:11:37 +10:00
Xin,Gao 328846ee1a SELFOUR-421: crefine builds 2016-09-22 19:11:37 +10:00
Matthew Brecknell 1013e959c1 arch_split: give some vspace concepts more generic names
In particular rename "pd" to "vspace", when the pd represents
an address space.
2016-08-03 14:46:48 +10:00
Miki Tanaka eb7f7b1564 arch-split: Tcb_AI.thy done 2016-07-07 13:57:16 +10:00
Matthew Brecknell d50e43d717 arch_split: invariants: split CNodeInv_AI [VER-573] 2016-07-04 11:56:53 +10:00
Matthew Brecknell 3e90041831 arch_split: access: fixup locale introduction rule 2016-05-31 15:05:24 +10:00
Gerwin Klein 322f1023f5 word_lib: adjust theory dependencies 2016-05-16 21:11:40 +10:00
Daniel Matichuk 9ceed1eb12 arch_split: fix proofs after removing shadow and unqualify commands and adding fix for crunch. Checks up to DPolicy. 2016-05-04 15:14:41 +10:00
Matthew Brecknell 86f495d4f3 arch_split: DPolicy checking 2016-05-01 10:19:09 +10:00
Matthew Brecknell 0c3a12771d arch_split: merge master 2016-04-28 14:36:43 +10:00
Matthew Brecknell 0e5ffd1ea0 arch_split: requalify abstract theories 2016-04-27 18:46:16 +10:00
Matthew Brecknell 67ba864d2f arch_split: InfoFlow checking 2016-04-24 15:44:40 +10:00
Matthew Brecknell 14f7570147 arch_split: Access checking 2016-04-22 11:58:59 +10:00