Skip to content

arch-split Ipc_R#993

Open
Xaphiosis wants to merge 7 commits into
masterfrom
arch-split
Open

arch-split Ipc_R#993
Xaphiosis wants to merge 7 commits into
masterfrom
arch-split

Conversation

@Xaphiosis
Copy link
Copy Markdown
Member

🦆🦆🦆 In the process of doing Ipc_R, I discovered that TcbAcc_R could be improved, so there is an extra commit with that improvement in this PR before the Ipc_R arch-splitting starts. Again, please review commit-by-commit.

Instructions:

In real life, I did the usual addition of Ipc_R, hierarchy update, arch-split and then update. However, since the arch-split part first splits AARCH64, then takes the AARCH64 version of Ipc_R and only fixes what broke, we ended up with a small(er) diff there (again).

Please review commit-by commit with the following notes (some inconsistency with squash/wip/fake comments on the PR-only commits):

  • [squash] PR: copy AARCH64 version into ..._R - same as last time: stop ..._R looking like a wall of green (no need to review)
  • refine: arch-split ..._R (AARCH64 ONLY)` - this is the main bulk of the arch-split, dealing with AARCH64, as well as updates
  • [squash] copy AARCH64 Arch..._R to other arches - wipes the body (not the header!) of other arches' Arch..._R with a copy of the AARCH64 version with AARCH64 appropriately substituted - (mostly pointless to review)
  • `[squash][fake] refine: arch-split ..._R (other arches) - result of fixing up the ArchSchedule_R of other architectures - shows diff to AARCH64

Reminder: DO NOT MERGE squashed version if it still says aarch64 refine: arch-split or AARCH64

Stats: 76 files changed, 3313 insertions(+), 20017 deletions(-)
Total: 16704 lines removed

Xaphiosis added 7 commits May 13, 2026 06:08
Allows copyMRs_corres and getMRs_corres to become generic.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
In preparation for arch-split.
Create Ipc_R.thy and update import hierarchy.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Decreases diff during PR review.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
To reduce diff during PR review.

Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
Signed-off-by: Rafal Kolanski <rafal.kolanski@proofcraft.systems>
@Xaphiosis Xaphiosis requested review from corlewis and lsf37 May 12, 2026 20:14
@Xaphiosis Xaphiosis added the arch-split splitting proofs into generic and architecture dependent label May 12, 2026
Comment thread proof/refine/TcbAcc_R.thy
Comment on lines +13 to +16
(* FIXME arch-split: move up *)
arch_requalify_consts pageBitsForSize

arch_requalify_facts mab_pb (* FIXME arch-split: from ArchTcbAcc_AI *)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these FIXMEs that you want to resolve as part of this round or leave for later?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to leave these for a second pass, as it involves diving into AInvs, including figuring out where the Machine_AI exports are, and having a clearer head to maybe improve something over there.

There's a FIXME a bit below this that says "review for sanity", which I'd appreciate an opinion on. I'm not sure if I captured the right idea.

shows
"corres (=) (tcb_at t and pspace_aligned and pspace_distinct and case_option \<top> in_user_frame buf)
(case_option \<top> valid_ipc_buffer_ptr' buf)
(set_mrs t buf mrs) (setMRs t buf mrs')"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why is setMRs_corres the only one out of the MRs family that had to stay in the arch file? The definition of setMRs doesn't seem to do anything more arch-specific than getMRs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, is it because its proof refers to user_fpu_state on architectures that have it? Fair enough then, probably not worth trying to abstract that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that kept popping up, but even ignoring that it kept throwing up an update to the TCB arch state for which I was unable produce a nice interface.

Comment thread proof/refine/CSpace_R.thy
Comment on lines +3294 to +3295
(* FIXME: poor name, eliminate as wp argument *)
lemma lookup_cap_valid'[wp]:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a moment to work out what you meant with the second part of this FIXME, and I'm not sure I would have without the context of this being added to wp. Possible reword?

(* FIXME: change name, eliminate existing uses as argument to wp method *)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, much better, I'll take your version.

Comment thread proof/refine/Ipc_R.thy
Comment on lines +58 to +62
(* FIXME arch-split: move, review for sanity *)
lemma no_fail_zipWithM_x:
assumes P: "\<And>x y. no_fail P (f x y)"
assumes inv: "\<And>x y. f x y \<lbrace>P\<rbrace>"
shows "no_fail P (zipWithM_x f xs ys)"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable to me. If you really want to though, you could strengthen it to be more like no_fail_mapM_wp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-split splitting proofs into generic and architecture dependent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants