Commit Graph

1403 Commits

Author SHA1 Message Date
Matthew Brecknell 0b039a0735 Isabelle2016-1: syntax: use semantic markup instead of "header" 2017-01-05 14:22:24 +11:00
Matthew Brecknell 86bd63e42b Isabelle2016-1: work around a find_theorems incompatibility
The new find_theorems tries to inspect rule_prems, which previously
raised an exception within Rule_By_Method. This just makes rule_prems
an empty dynamic fact.
2017-01-05 14:22:06 +11:00
Matthew Brecknell f8b1c7d5ae Isabelle2016-1: update Simpl 2017-01-05 14:21:12 +11:00
Matthew Brecknell 1a590fbbb2 Isabelle2016-1: update Word_Lib
Word_Lib now looks more like the current AFP entry, though there are
still some local modifications.
2017-01-05 14:21:06 +11:00
Matthew Brecknell 5b11be92e8 invariants: move bexEI to a generic theory 2016-12-13 22:10:31 +11:00
Matthew Brecknell c25817b553 trivial: remove some redundant uses of split_if rule 2016-12-13 22:10:31 +11:00
Matthew Brecknell 4905a589bf trivial: remove some uses of find_theorems 2016-12-13 22:10:31 +11:00
Alejandro Gomez-Londono 858bff7a7f Munge Test: adding --underscore_idents flag to c-parser
tags: [NO_PROOF]
2016-12-13 14:57:28 +11:00
Thomas Sewell 77d86cfc5f GraphRefine + CRefine: handle slightly more cases.
New testfile for graph-refine export with new handling code. Also
some slight tweaks to some CRefine proofs that will be needed to
remove DONT_TRANSLATE markers from certain key places in the seL4
code. These proofs are also compatible with previous seL4.
2016-12-08 16:12:17 +11:00
Thomas Sewell 5a367ea7e5 Standalone C parser: scan for unhandled ASM.
Adds an additional analysis option to the external C parser. This
will report about any asm statements that were encountered and could
not be properly handled.

[NO_PROOF]
2016-12-06 16:01:23 +11:00
Thomas Sewell cc4b4102b7 Add a facility for ignoring complex asm.
To restore some previous functionality, add a mechanism by which an __asm__
statement too complex to be translated can still be ignored (handled as an
empty statement). A demo file does this for a wrapper around "nop".

Also use this facility to support legacy camkes-glue proofs which assume
that the software interrupt operator "swi" doesn't break anything.
2016-12-01 17:08:00 +11:00
Thomas Sewell 422347cd89 CRefine adjustments for ASM translation.
With analysis of ASM statements included, some previous modifies
proofs get weakened. This has in particular consequences for proofs
about a cache clean done during retype. Make a weak assumption here
(bytes which actually have a type are unchanged), and strengthen some
logic to fit with this.
2016-12-01 17:08:00 +11:00
Thomas Sewell 8e7c55c1a5 Handling of AsmStmt in c-parser, more tests.
The C-parser contains a full parser for __asm__ syntax but
up until now hasn't done anything with it. Instead we export
some semantics. It's unspecified exactly what these semantics
are but they are parametrised with the __asm__ semantics that
went in to them, so the translation validation has something
to reason about.

Tweak modifies proofs as a result, and add some more test files.
2016-12-01 17:07:54 +11:00
Joel Beeren dad2f51026 crefine: add ccorres_rewrite to remove unnecessary SKIPs in Interrupt_C 2016-11-29 10:42:59 +11:00
Joel Beeren b3e6e4f2e5 l4v: add jEdit autosave files to .gitignore
[NO_PROOF]
2016-11-25 14:42:21 +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
Alejandro Gomez-Londono 9a166de8bc CRefine: Updating crefine for tcb_arch reserved_irq and arch_fault changes
* The majority of changes involved rephrasing references to tcb_context
  for the equivalente (arch_tcb_context_get o tcb_arch) (the same
  applies for set operations)

* Mayor refactoring of setMRs and handleFaultReply C functions both of
  which introduced new function calls when dealing with UserException
  and SyscallException faults

* handleFaultReply' (definition) was modified to include less redundant
  code

* handleFaultReply' (lemma) was completely refactored to use the
  monadicrewrite framework for "easier" and simpler proofs

* IsolatedThreadAction framework striped from Fastpath_C into new
  standalone file

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:56 +11:00
Alejandro Gomez-Londono 879ac30249 Lib: Addition of auxiliary lemmas in basic theories to better support CRefine
* Generalized version of bind_inv_inv_comm for easier swapping inside
  the nondet monad

* New ccorres_symb_exec_r_known_rv

* New zip_take lemmas for handling `take n (zip x y)` situations

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:56 +11:00
Alejandro Gomez-Londono b4fe96ee67 CSpec: New import locations
types.bf and shared_types.bf were merged and moved to 32/mode/api,
imports in KernelInc_C.thy were updated accordingly

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:55 +11:00
Alejandro Gomez-Londono 5fcb3c3197 Refine: Updating refine for tcb_arch reserved_irq and arch_fault changes
* Changes to StateRelation.thy, most notably the addition of
  arch_tcb_relation and arch_fault_map to acount for the new
  arch_tcb and arch_fault types

* On ADT_H ArchFault_Map and ArchTcbMap were added to account for
  (yet again) the new arch_tcb and arch_fault types

* Also irq_state_map and IRQStateMap were extended to support the new
  IRQReserved

* Everything else was mostly unfolding stuff and
  (tcb_arch -> tcb_context) rearrangement

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:55 +11:00
Alejandro Gomez-Londono ab6b9baebb ExecSpec: Changes to the haskell to better reflect ASpec
* atcbContextGet and atcbContextSet where added (just as in ASpec)

* asUser is now defined in terms of atcbContext{Get,Set}

* arch_tcb is now correctly imported as a datatype not as a type
  synonym

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:55 +11:00
Alejandro Gomez-Londono f9c7c855d0 Haskell: Changes to the haskell to better reflect ASpec
* atcbContextGet and atcbContextSet where added (just as in ASpec)

* asUser is now defined in terms of atcbContext{Get,Set}

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:55 +11:00
Alejandro Gomez-Londono 601dd20546 AInvs: Updating arch-specific theories for tcb_arch reserved_irq and arch_fault
* Rephrasing of all the lemmas that used to refer to tcb_context as
  a direct value on tcb.

* Providing arch-specific lemmas about handle_arch_fault_reply and
  make_arch_fault_msg to deal with handle_fault_reply and make_fault_msg
  new arch-specific cases.

* Trivial but arch-specific proofs about reserved_irq

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:55 +11:00
Alejandro Gomez-Londono e747996cc6 AInvs: Updating generic theories for tcb_arch reserved_irq and arch_fault
* Rephrasing of all the lemmas that used to refer to tcb_context as
  a direct value on tcb.

* Providing arch-specific lemmas about handle_arch_fault_reply and
  make_arch_fault_msg to deal with handle_fault_reply and make_fault_msg
  new arch-specific cases.

* Trivial but arch-specific proofs about reserved_irq

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:55 +11:00
Miki Tanaka 99bcebda87 ASpec: arch-specific faults + VMFault -> ArchFault + ReservedIRQ
* fixing name space for arch_tcb and tcb_context

* arch_fault added

* changing name space for arch_tcb

  - as_user, set_mrs, get_mrs, copyRegsToArea, and copyRegsToArea are
    moved to the ARM_HYP directory.  This breaks the proofs in
    refinement, etc., mostly in tcb related files.

* removed a duplicate range check definition

* fixes ARM for arch_tcb

* adding arch_thread_get/set

* add ReserveIRQ

  - initInterruptController is not added yet.

* add arch_fault

  - arch_fault and related functions are added.

* arch-parametrising arch-specific extra registers

  - ArchDefaultExtraRegisters is the common interface that refers to the
    arch-specific data (ARMNoExtraRegisters for ARM/ARM_HYP)

* Adding accesors for tcb_context

  - Despite the fact that tcb_context has an arch-specific definition,
    it is reasonable to assume that some form of tcb_context will be
    available in any architecture, thus the need for accesors to handle
    updates.

* as_user updated to use tcb_context accesors

* set_mrs and get_mrs updated to use tcb_context accesors

  - Several function on ArchTcb_A and ArchTcbAcc_A (both theories where
    removed) can be defined in a general context by using the
    tcb_context accesors

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:49 +11:00
Miki Tanaka 6dad6a1c75 ExecSpec: arch-specific faults + VMFault -> ArchFault + ReservedIRQ
* skeletons, adding new constructs (arch_tcb, arch_fault)

* adjusting skeletons for ReserveIRQ + small change in haskell (ARM)

  Changes in: spec/haskell/src/SEL4/Object/Interrupt/ARM.lhs:37:21
  Due to "Defined but not used: ‘irq’"

* arch-splitting faults in skeletons (ARM)

* fix arch_tcb and asUser namespace issues in skeletons (ARM)

* checking in current generated files

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:42 +11:00
Rafal Kolanski c92baf746d Haskell: arch-specific faults + split VMFault -> ArchFault + ReservedIRQ
Hypervisor extensions add extra fault types which are entirely
arch-specific. While the concept of a VM fault exists on all platforms,
these faults are also arch-specific.

This change adds an ArchFault datatype and constructor to the generic
Faults and Failures, and moves VMFault into ArchFault for the ARM
platform.

NOTE: fault indices have changed (generic goes before arch) as per
  the changes needed for SELFOUR-413, which is the seL4 C equivalent of
  this commit.

* add arch faults and failures to SEL4.cabal

* introduce and handle IRQReserved

  On ARM this does nothing, but on other platforms reserved IRQs are
  actually used.

* split TCB into ArchTCB (userContext)

* changing ArchFault to make haskell-translator to work

  tags: [VER-623][SELFOUR-413]
2016-11-25 13:05:15 +11:00
Rafal Kolanski 61e77e62cd trivial: skip jEdit .*.marks files in license check
When you right-click in the gutter to create a mark in the document,
jEdit creates a .filename.marks file which was confusing the license
check.
2016-11-22 14:31:09 +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
Miki Tanaka f8f88c6952 SELFOUR-553: Change Spec according to C code and fix ASpec and AInvs 2016-11-18 16:19:14 +11:00
Miki Tanaka 9769f73888 changed callKernel to conditionally call hooks 2016-11-18 16:19:14 +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
Joel Beeren 1c640cf28e Merge pull request #122 in SEL4/l4v from infoflowcbase to master
* commit '19b68527300486a472036df8920a3eced2ff1847':
  Regression: removing unnecessary dependencies
  l4v: Add intermediate image for InfoFlowC.
2016-11-16 23:13:38 +00:00
Rafal Kolanski 72349f81fd Revert SELFOUR-242: invert bitfield scheduler and optimise fast path
This reverts:
- a67b443ca5
    "SELFOUR-242: update goal number based indentation in Fastpath_C"
- f704cf0404
    "SELFOUR-242: invert bitfield scheduler and optimise fast path"

Verification confirmed functional correctness and refinement of the
system in this case. However, guarantees on thread scheduling and
fairness are not modeled in the current verification. Once this issue is
addressed, SELFOUR-242 will be re-examined.
2016-11-16 14:02:50 +11:00
Alejandro Gomez-Londono 19b6852730 Regression: removing unnecessary dependencies
Currently every image (heap?) is build in top of one (JUST ONE) ancestor image,
so there is no reason for any image-related test to depend on
more than 1 image-related test, granted no external things are being
build as a result of any dependency.
2016-11-16 13:59:20 +11:00
Joel Beeren eb5badce92 l4v: Add intermediate image for InfoFlowC.
This allows one to skip the Access, InfoFlow proofs
when building InfoFlowC, hopefully allowing faster
turn arounds when doing maintenance.
2016-11-16 09:12:18 +11:00
Rafal Kolanski 4262cc231a asmrefine: teach div and sdiv handling to graph refine tactic 2016-11-15 12:11:01 +11:00
Rafal Kolanski a67b443ca5 SELFOUR-242: update goal number based indentation in Fastpath_C
I'm keeping this separate as it changes a lot of whitespace that
SELFOUR-242 touches only indirectly by influencing the number of
subgoals.

A few small cleanups got thrown in.
2016-11-15 12:11:01 +11:00
Rafal Kolanski f704cf0404 SELFOUR-242: invert bitfield scheduler and optimise fast path
* Reverse the level 2 of the bitmap scheduler to move the highest priority
  threads' level 2 entries into the same cache line as the level 1.
* Use the bitfield scheduler to make the fast path a more common occurrence.
* Change possibleSwitchTo to not invoke scheduler when the fast path would not
  invoke it either (using implicit assumptions about the current thread being
  the highest priority schedulable thread)
2016-11-15 09:20:31 +11:00
Ramana Kumar c1c636a24f Simplify obj_bits to not check well_formed_cnode_n 2016-11-11 16:24:37 +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
Rafal Kolanski d735f9aca1 trivial: CRefine: remove unused lemma
Was shadowing one I added to clib.
2016-11-08 23:11:34 +11:00
Rafal Kolanski bd0a8900e5 clib: do not use split_if in spec_refine 2016-11-08 23:10:01 +11:00
Rafal Kolanski d5c288157e clib: more semantic equivalence rules for Seq/Cond combinations 2016-11-08 23:06:46 +11:00
Rafal Kolanski ced137cc37 clib: ccorres vcg versions of symb_exec_r rules
Analogous to the _UNIV versions, they are:
ccorres_symb_exec_r_rv_abstract: you know some property about the return
  value you want to exploit
ccorres_symb_exec_r_known_rv: you know exactly how the return value
  can be generated from the Haskell side (e.g. using from_bool, ucast)

As discussed in the past, the _UNIV versions can be dangerous as they
expect a trivial postcondition of the subsequent SIMPL statement.
2016-11-08 23:06:16 +11:00
Thomas Sewell 68e22b2d14 Slightly reduce run_tests.py CPU usage.
The watch_kill_switch loop was pretty busy, adding a simple
timeout reduces CPU consumption.

The CPU consumption of run_tests.py is still higher than I'd expect
to just update a terminal, but I don't know where to investigate
further.
2016-11-02 11:19:10 +11:00
Xin,Gao 3b679b0ce3 SELFOUR-444: fix DSpecProofs and SysInit 2016-11-02 11:19:10 +11:00
Thomas Sewell 0fa247199b SELFOUR-444: Repair InfoFlow. 2016-11-02 11:19:10 +11:00
Thomas Sewell f1d546db85 SELFOUR-444: Fix for rebase. 2016-11-02 11:19:10 +11:00