Skip to content

P1 (aarch64): complete the S1A step over every decode arm and the non-decode kernel functions - #152

Merged
losfair merged 1 commit into
losfair:mainfrom
CommaBot:pr/a64-p1-complete
Dec 4, 2026
Merged

losfair merged 1 commit into
losfair:mainfrom
CommaBot:pr/a64-p1-complete

Conversation

@CommaBot

@CommaBot CommaBot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR extends #151's AArch64 P1 S1A step syscall.decode_invocation.s1aStepR2K. With it, the S1a invariant (S1aR2, S1aKtUt, S1aHiK) is re-established by every AArch64 decode arm and by the kernel functions outside decode, and it holds at boot with platform premises only.

  • All decode arms: syscall.decode_invocation.s1aStepR2All, over DecArmS1aAll = DecArmS1aH ∨ DecArmS1aC. The new arms are:
    • the rejected and unknown-label arms: direct HighVSpace, IoPortControl / IoPort / TdxControl, and unknown TCB / SC / VCPU labels;
    • TCB WriteFPU, SetTimer, BindNotification, Resume, and Write/CopyRegisters;
    • CNode CancelBadgedSends;
    • SchedContext Bind and YieldTo;
    • SchedControl ConfigureFlags;
    • Reply.
  • Boot:
    • SymL at w0 and w1 (S1aCBootSym).
    • DelIn at w0 and w1 (S1aBootDel0/1), under a new [P] BootCanon: boot objects lie in the kernel window. bootCanon_ex shows it holds together with BootLay / BootLay1.
    • w1K_bundleOf therefore depends only on [P] facts.
  • Non-decode kernel functions, each re-establishing the S1a step:
    • faults and timeouts;
    • check_budget and check_budget_restart, end_timeslice, charge_budget;
    • yield;
    • receive (handle_recv);
    • interrupts, VCPU complete_run / VGIC maintenance / vPPI;
    • reply_error / reply_success;
    • the MCS preemption point.
  • Entry invariant in P1 terms: S1aStepEnt / s1aStepEntAll gives SysL, HeapOK, BXI, OSOK, UserOK, VsTy and ksw on the fixed-heap arms.

Boundaries (also stated in README and DESIGN §9)

  • Frame DeriveSubframe is not covered. FrameOK / FrObj require an exact-size object at each frame base, and SysL.sub_false shows that a Large frame and a Small subframe at the same base cannot both satisfy SysL. A containment generalisation of FrObj is future work.
  • S1aStepEnt does not cover Untyped Retype or MakePool-create. UserOK over the new heap would need the user words placed off the source untyped region, and no such fact exists yet.
  • Entry wrappers are composed at the entry level, not here. These are budget_ok / handle_fault / finish, the arch interrupt and VCPU entries, set_tls_base_self, and the debug syscalls.
  • Named premises:
    • SchedControl's [J] case facts hScC: cpu ∈ Cs and the SC cap size;
    • the [J] recvOK notification-state fact;
    • [J] RunVcpuInv;
    • the [P] facts listed in each module docstring.

Statements

  • Every statement already on main is unchanged, including s1aStepR2K.
  • No visibility changes.
  • 42 new files under proofs/Fl4ProofsA64/P1/, plus root imports, README and DESIGN.

Verification

Final gate, on this exact commit:

  • Fl4ProofsA64 root build: 0 errors, 0 sorry.
  • Axiom audit: 54,321 constants, all within propext, Classical.choice, Quot.sound.
  • The diff contains no sorry / admit / native_decide / bv_decide / axiom.

An independent review raised documentation and docstring fixes only, with no soundness issue. The fixes are included, and a re-check approved them.

🤖 Generated with Claude Code

…-decode kernel functions

Extends losfair#151's s1aStepR2K:

- syscall.decode_invocation.s1aStepR2All: the S1a step (S1aR2, S1aKtUt,
  S1aHiK) over every AArch64 decode arm (DecArmS1aAll), adding the rejected
  and unknown-label arms, TCB WriteFPU / SetTimer / BindNotification / Resume /
  Write/CopyRegisters, CNode CancelBadgedSends, SchedContext Bind / YieldTo,
  SchedControl ConfigureFlags and Reply. Frame DeriveSubframe stays open
  (FrObj exact size, SysL.sub_false).
- Boot: SymL at w0/w1 and DelIn at w0/w1 under a new [P] BootCanon (boot
  objects in the kernel window, witness bootCanon_ex), so w1K_bundleOf is
  unconditional.
- Non-decode kernel functions: faults and timeouts, budget checks, yield,
  receive, interrupts and VCPU exits, reply_error / reply_success, the MCS
  preemption point, each re-establishing the S1a step.
- S1aStepEnt / s1aStepEntAll: the entry-invariant fields in P1 terms on the
  fixed-heap arms (Retype and MakePool-create open).

Entry wrappers are composed at the entry level. Every statement already on
main is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@losfair
losfair merged commit b00afc3 into losfair:main Dec 4, 2026
1 check failed
CommaBot added a commit to CommaBot/FL4 that referenced this pull request Dec 4, 2026
…/a64-p3-entry

DESIGN.md keeps both bullets (the A64 delete-hook [S] scope and the x86 Stage 3 notes); the A64 root keeps both import sets.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CommaBot added a commit to CommaBot/FL4 that referenced this pull request Dec 4, 2026
…losfair#153); only the root import list conflicted

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants