Repository navigation
P3 (x86): one refinement theorem over the nine VM entries (VM Stage 3) - #153
Merged
Merged
Conversation
`VEAnyX.outerS3` covers native syscalls, VMEnter on VMX and SVM, ordinary unknown and trapped syscalls, host interrupts, user exceptions, VM faults, and stalled and unstalled VCPU exits. Each entry takes the joint VM state `VEAnyX` and the event's premises `S3Pre`, and returns a related extended-spec outcome at `VEAnyX`. The syscall case (`VmEptState.kernel_entryS3`) proves the dispatcher, invocation, receive, yield and finish arms that Stage 2 took as premises. The extended spec's FrameBatch is parameterized by the cap deletion it uses, and the VM-aware step uses `capDeleteVF`. A concrete state with a running guest and its VCPU satisfies `VEAnyX` and `S3Pre` for a SchedControl and an Untyped invocation, and `outerS3` applies there up to premises on opaque spec constants. Open: the post does not re-establish `S3Pre`, no `VEAnyX` state is produced from boot, and the other events' `S3Pre` have no witness. Premises are listed in DESIGN.md section 9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
x86 VM Stage 3 of the P3 refinement. 251 files (194 added, 57 modified), +91,384 / −529, all under
proofs/exceptREADME.mdandDESIGN.md. Nocrates/or AArch64 changes.What is proved
VEAnyX.outerS3(P3/VmEntryS3Outer) is one theorem over the nine concrete x86 core entries (S3Ev):Each entry starts from the joint VM state
VEAnyXand that event's premisesS3Pre, returns a related extended-spec outcome (S3Ev.Out), and ends inVEAnyXagain, so the joint state chainsVEAnyX→VEAnyX.The syscall case (
VmEptState.kernel_entryS3) proves the native-capability dispatcher cases, the invocation, receive and yield arms and the finish, which Stage 2 (VmEptState.kernel_entry) took as premises (KEntryArmsV,VDispNativeAt,EventFinishVE,VcpuExitFinishVE). The Stage 2 theorems are kept.Premises
[J] facts about the entry's spec state
VEAnyX.StartS3:SInvXV(the native carried bundle withoutNativeScopeS), current thread not idle,SpecIoPorts,SpecUtZ,DevRangeS,GpmOutV,UtInv'',RV,IdleVtS.SInvXVis an entry [J] premise, asSInvXwas before. It has no preservation theorem yet.S3Faultand the scheduler, domain, FPU-owner, idle and clock facts of each event (seeS3Pre).[P] platform and hardware
outerS3(arch interface, agreement, timer, interrupt and store laws, includingFpuImplDet,FpuWriteDet,StoreExt).numDomains = 1.virtualizationcode agrees with the spec'svirtKind;retypeFanOutLimit = 256;resetChunkBits = 16.StartS3.air(ArchIrqRelat each dispatch pair) and the hardware arguments of each event.[S] scope
SelectedCoreScopefor the invoked cap on the executing core: a SchedControl cap must name that core; an Untyped cap is covered only on core 0.Assembly, hardware guest execution and the capture of the VCPU image and vector stay at the trusted boundary.
Non-vacuity
JBootQ.VWit.witness_schedControlandwitness_untyped(P3/VmWitS3) give a concrete store, arch and spec state satisfyingVEAnyX ∧ S3Pre: arunningVMguest with its VCPU, forSysCallon a SchedControl cap andSysNBSendWaiton an Untyped cap.w_dispatch), and the invoked cap's core restriction is exercised at it (w_core_exercised), so the quantified fieldsairandcoreare not vacuous.outer_schedControlandouter_untyped(P3/VmWitOuter) instantiateouterS3at the witness with every platform argument about the arch and store discharged.Fl4Specconstants:OpaqueWK(one domain,maxTicksToUs, kernel WCET and timer unit, period bound,setDeadlineImpldeterminism, a port-read value),virtKind = .vmx ∨ .svm,retypeFanOutLimit,resetChunkBits,FpuImplDet,FpuWriteDet.What remains open
S3Prepreservation across entries, so no run of several entries is proved.VEAnyXstate is produced from boot.S3Pre.Merged-statement audit (against
mainat03ec12c9a)A header check and a full-text definition-body check over the 54 modified
.leanfiles. The remaining differences are:performFrameBatch,fbRun,fbEntryandfbDeletebecome instances of new…Withversions parameterized by the cap deletion.fl4PerformInvocationV/fl4PerformInvocationVFnow route FrameBatch tocapDeleteV/capDeleteVF, andPerformSubstincludes that route. Native behaviour is unchanged.performEptInvocation. ThetableUnmapandframeUnmaparms no longer use an earlyreturninside thematch; the skippedsetCapis now explicit.PORTING.mdrecords the rule.privateremoved fromVmEptState.vcpuEnterJ,vmEnterEventGuardandVmEptState.faultIPEntry; statements unchanged.vkeyFandNewOKfromVmCnodeVtxtoDeriveVt; text unchanged.The scripts also flag
DomPostA,IoCPost,domLabelOf,fbRun_supX,fbRun_subX,fk_fbRunandik_fbRun. These are parsing artefacts: their text or statements are identical when compared directly.Gate on the exact commit
On
3f052080d, afkprover:lake build: 10881 jobs, 0 errors, 0sorry(seeded from an earlier Lake cache of the same line; 361 s, peak singleleanRSS 5.2 GB). Source hashes checked before and after the build.propext,Classical.choice,Quot.sound.No
sorry,admit,native_decide,bv_decideor newaxiom.🤖 Generated with Claude Code