Commit Graph

1378 Commits

Author SHA1 Message Date
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
Thomas Sewell 86731939f2 SELFOUR-444: CRefine proof for preemptible retype. 2016-11-02 11:19:09 +11:00
Thomas Sewell dcd7fd8c17 SELFOUR-444: Refine proof with ghost invariant. 2016-11-02 11:19:09 +11:00
Thomas Sewell 9e7fb1daf0 SELFOUR-444: Structure of crefine.
Figured out how to pass the necessary assumptions about the region
being zeroed through the createNewObjects loop and resolve at
invokeUntyped_Retype. Still WIP.
2016-11-02 11:19:09 +11:00
Thomas Sewell 74adb7a283 SELFOUR-444: Avoid unnecessary cache clears.
Adjust both specs and propagate the changes.
2016-11-02 11:19:09 +11:00
Thomas Sewell edddf623ec ProveGraphRefine: Handle power operations w/sign.
Support some more kinds of power operations in the C code when
proving the export to Simpl is OK.
2016-11-02 11:19:09 +11:00
Thomas Sewell 0128e3b66d Handle another operation in SimplExport.
Handle pointer comparison operations in SimplExport.
2016-11-02 11:19:09 +11:00
Thomas Sewell 7ebefa69ab SELFOUR-444: Work on untyped zero invariant.
The invariant just proves that the ghost field is up to date.
2016-11-02 11:19:09 +11:00
Thomas Sewell 6ad456ca03 SELFOUR-444: Adjust Haskell, new ghost data.
The new ghost data is saved in the design spec when Untyped caps
are modified and will be used by CRefine.
2016-11-02 11:19:09 +11:00
Thomas Sewell a96346e308 SELFOUR-444: Finished InfoFlow and DRefine. 2016-11-02 11:19:09 +11:00
Thomas Sewell 69f7be9917 SELFOUR-444: Initial updates to capDL spec. 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
Thomas Sewell d765a64b81 SELFOUR-444: Haskell implementation, begin refine.
First attempt at a haskell implementation of preemptible retyping
and the refinement proof to abstract.
2016-11-02 11:19:08 +11:00
Thomas Sewell 63888fa98d SELFOUR-444: AInvs proven for preemptible retype. 2016-11-02 11:19:08 +11:00
Thomas Sewell f32e2ca0f5 SELFOUR-444: Abstract implementation.
Abstract implementation of preemptible retyping.
2016-11-02 11:19:08 +11:00
Thomas Sewell b430709191 AddUpdSimps: An addition to Lib.
This is a work-in-progress tool for producing simp rules for functions on a
record that don't look at all the record's state. For instance, given a record
with fields a, b, c, and a function "f x = a x + b x", the tool should
automatically prove that "f (c_update f x) = f x".
2016-11-02 11:17:32 +11:00
Rafal Kolanski 00c5402b1a trivial: CRefine: handle SKIP introduced by SMP_COND_STATEMENT(); 2016-10-19 20:24:17 +11:00
Rafal Kolanski af40ad80e9 Verification support for PR #406: lazy VCPU switching for arm-hyp 2016-10-17 15:21:40 +11:00
Matthew Brecknell 0212696e60 VER-643: make regression compatible with psutil 4.1.0+
At version 4.1.0, the Python psutil package changed the way it reports
CPU times for processes. This commit ensures that regression tests are
compatible with both old and new psutil APIs.
2016-10-07 09:23:20 +11:00
Thomas Sewell 9a28e3c777 Fix a bug with strengthen rules.
Adding optional tracing makes the bug clear; the subgoals of the
rules are attacked in the opposite order, so congruence-style rules
which introduce extra assumptions would have the (schematic)
assumptions unified out of order. Fixed.
2016-10-06 15:37:09 +11:00
Thomas Sewell 4b7965505f Fixes to WPC for multiple resolution.
WPC was written somewhat conservatively to raise exceptions if
something surprising happens. One surprising thing is multiple
higher-order resolution candidates, caused by such things as
a previous precondition of the form "?P x y None None". This isn't
really a problem, so a slight tweak should suppress the exception.
2016-10-05 12:11:43 +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
Joel Beeren b352769016 SELFOUR-276: Prove refinement to Haskell for MCP
Also includes fixes to specs and invariants, and initial progress
towards C refinement.

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
Sophie Taylor 20539620f9 SELFOUR-276: Add MCP to specs and invariants
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
Matthew Brecknell 31f47e477e clib: ccorres_rewrite rules for trivial guards and conditionals 2016-10-05 02:43:41 +11:00
Matthew Brecknell 92148ce8e7 Word_Lib: lemmas comparing different word sizes 2016-10-05 02:43:41 +11:00