Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions proofs/Fl4SpecA64/PORTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -793,3 +793,20 @@ Resolved in generation 5 (Architect's rulings of generation 4):
`State` unchanged except the VMID cache (`armAsidMap`, `armVmidTable`,
`armNextVmid`) inside `archState`, and leaves
`machineState.underlyingMemory` unchanged.

### Machine-checked `l4v` equivalence (`Fl4SpecEquivA64`)

The standalone machine-checked equivalence suite in
`proofs/Fl4SpecEquivA64/` (`proofs/Fl4SpecEquivA64/REPORT.md`) proves
single-step equivalence (conditional on `CallKernelSafe`) between
`Fl4SpecA64` and upstream Isabelle `l4v` AArch64 MCS `ASpec`
(`seL4/l4v@f44de69e`) modulo the six documented `PORTING.md` deltas
above plus one `init_kheap` high-IRQ difference:

- **`init_kheap` high IRQ CNodes (`Init.lean`)**: because `irqBits` is
widened from upstream `l4v`'s `9` (`BitVec 9`, 512 IRQs) to `13`
(`BitVec 13`, 8,192 IRQs), `Fl4SpecA64.initKheap` populates `8,192`
empty IRQ-node CNodes (`0..8191`) where upstream `l4v` `Init_A.init_kheap`
populates `512` (`0..511`), introducing `7,680` extra empty CNodes at
`512 ≤ irq < 8192` (machine-checked as `L4vRefA64.Equiv.Init.initKheap_delta_high_irqs`;
see `proofs/Fl4SpecEquivA64/REPORT.md` §4 for the full divergence inventory).
1,378 changes: 1,378 additions & 0 deletions proofs/Fl4SpecEquivA64/L4vRefA64/Equiv/Arch.lean

Large diffs are not rendered by default.

338 changes: 338 additions & 0 deletions proofs/Fl4SpecEquivA64/L4vRefA64/Equiv/ArchStructs.lean

Large diffs are not rendered by default.

759 changes: 759 additions & 0 deletions proofs/Fl4SpecEquivA64/L4vRefA64/Equiv/ArchVCPU.lean

Large diffs are not rendered by default.

1,149 changes: 1,149 additions & 0 deletions proofs/Fl4SpecEquivA64/L4vRefA64/Equiv/ArchVSpace.lean

Large diffs are not rendered by default.

2,922 changes: 2,922 additions & 0 deletions proofs/Fl4SpecEquivA64/L4vRefA64/Equiv/CSpace.lean

Large diffs are not rendered by default.

877 changes: 877 additions & 0 deletions proofs/Fl4SpecEquivA64/L4vRefA64/Equiv/CSpaceAcc.lean

Large diffs are not rendered by default.

3,279 changes: 3,279 additions & 0 deletions proofs/Fl4SpecEquivA64/L4vRefA64/Equiv/Decode.lean

Large diffs are not rendered by default.

752 changes: 752 additions & 0 deletions proofs/Fl4SpecEquivA64/L4vRefA64/Equiv/Deterministic.lean

Large diffs are not rendered by default.

391 changes: 391 additions & 0 deletions proofs/Fl4SpecEquivA64/L4vRefA64/Equiv/Init.lean

Large diffs are not rendered by default.

469 changes: 469 additions & 0 deletions proofs/Fl4SpecEquivA64/L4vRefA64/Equiv/Interrupt.lean

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions proofs/Fl4SpecEquivA64/L4vRefA64/Equiv/Invocations.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/-
Equivalence proofs for `Fl4SpecA64/Invocations.lean` directly against unmodified
`L4vRefA64.Spec.{ArchInvocation_A, Invocations_A}`.
-/
import L4vRefA64.Equiv.Structures

namespace L4vRefA64.Equiv.Invocations

open L4vRefA64.Prim
open L4vRefA64.Spec
open L4vRefA64.Rel
open Fl4SpecA64
open Classical

noncomputable section

theorem ptInvCap_eq (i : ArchInvocation_A.page_table_invocation) :
(embPageTableInv i).ptInvCap = embArchCap i.pt_inv_cap := by
cases i <;> rfl

theorem ptInvCslot_eq (i : ArchInvocation_A.page_table_invocation) :
(embPageTableInv i).ptInvCslot = i.pt_inv_cslot := by
cases i <;> rfl

theorem pgInvCap_eq (i : ArchInvocation_A.page_invocation)
(h : match i with | .PageMap .. | .PageUnmap .. => True | _ => False) :
(embPageInv i).pgInvCap = embArchCap i.pg_inv_cap := by
cases i <;> first | rfl | cases h

theorem pgInvCslot_eq (i : ArchInvocation_A.page_invocation) :
(embPageInv i).pgInvCslot = i.pg_inv_cslot := by
cases i <;> rfl

theorem pgInvEntries_eq (i : ArchInvocation_A.page_invocation)
(h : match i with | .PageMap .. => True | _ => False) :
(embPageInv i).pgInvEntries =
(embPTE i.pg_inv_entries.1, i.pg_inv_entries.2.1, i.pg_inv_entries.2.2) := by
cases i with
| PageMap c s e => rcases e with ⟨p, r, l⟩; rfl
| _ => cases h

theorem vcpuInvVcpu_eq (i : ArchInvocation_A.vcpu_invocation) :
(embVcpuInv i).vcpuInvVcpu = i.vcpu_inv_vcpu := by
cases i <;> rfl

theorem archDefaultExtraRegisters_eq :
Fl4SpecA64.ArchDefaultExtraRegisters =
embArchCopyRegSets ArchInvocation_A.ArchDefaultExtraRegisters := rfl

theorem tcTarget_eq (i : Invocations_A.tcb_invocation) :
(embTcbInv i).tcTarget = i.tc_target := by
cases i <;> rfl

theorem tcSlot_eq (i : Invocations_A.tcb_invocation) :
(embTcbInv i).tcSlot = i.tc_slot := by
cases i <;> rfl

theorem tcNewFaultHandler_eq (i : Invocations_A.tcb_invocation)
(h : match i with | .ThreadControlCaps .. | .ThreadControlSched .. => True | _ => False) :
(embTcbInv i).tcNewFaultHandler =
i.tc_new_fault_handler.map (fun (c, s) => (embCap c, s)) := by
cases i <;> first | rfl | cases h

theorem tcNewTimeoutHandler_eq (i : Invocations_A.tcb_invocation)
(h : match i with | .ThreadControlCaps .. => True | _ => False) :
(embTcbInv i).tcNewTimeoutHandler =
i.tc_new_timeout_handler.map (fun (c, s) => (embCap c, s)) := by
cases i <;> first | rfl | cases h

theorem tcNewCroot_eq (i : Invocations_A.tcb_invocation)
(h : match i with | .ThreadControlCaps .. => True | _ => False) :
(embTcbInv i).tcNewCroot =
i.tc_new_croot.map (fun (c, s) => (embCap c, s)) := by
cases i <;> first | rfl | cases h

theorem tcNewVroot_eq (i : Invocations_A.tcb_invocation)
(h : match i with | .ThreadControlCaps .. => True | _ => False) :
(embTcbInv i).tcNewVroot =
i.tc_new_vroot.map (fun (c, s) => (embCap c, s)) := by
cases i <;> first | rfl | cases h

theorem tcNewBuffer_eq (i : Invocations_A.tcb_invocation)
(h : match i with | .ThreadControlCaps .. => True | _ => False) :
(embTcbInv i).tcNewBuffer =
i.tc_new_buffer.map (fun (v, o) => (v, o.map (fun (c, s) => (embCap c, s)))) := by
cases i <;> first | rfl | cases h

theorem tcNewMcpriority_eq (i : Invocations_A.tcb_invocation) :
(embTcbInv i).tcNewMcpriority = i.tc_new_mcpriority := by
cases i <;> rfl

theorem tcNewPriority_eq (i : Invocations_A.tcb_invocation) :
(embTcbInv i).tcNewPriority = i.tc_new_priority := by
cases i <;> rfl

theorem tcNewSc_eq (i : Invocations_A.tcb_invocation) :
(embTcbInv i).tcNewSc = i.tc_new_sc := by
cases i <;> rfl

theorem domThread_eq (i : Invocations_A.domain_invocation) :
(embDomainInv i).domThread = i.dom_thread := by
cases i <;> rfl

theorem domDomain_eq (i : Invocations_A.domain_invocation) :
(embDomainInv i).domDomain = i.dom_domain := by
cases i <;> rfl

theorem domIndex_eq (i : Invocations_A.domain_invocation) :
(embDomainInv i).domIndex = i.dom_index := by
cases i <;> rfl

theorem domDuration_eq (i : Invocations_A.domain_invocation) :
(embDomainInv i).domDuration = i.dom_duration := by
cases i <;> rfl

end
end L4vRefA64.Equiv.Invocations
Loading