Skip to content

tool: create IPC buffer in the tool, not the ELF#532

Open
midnightveil wants to merge 2 commits into
seL4:mainfrom
au-ts:julia/ipc-buffer-patched
Open

tool: create IPC buffer in the tool, not the ELF#532
midnightveil wants to merge 2 commits into
seL4:mainfrom
au-ts:julia/ipc-buffer-patched

Conversation

@midnightveil

@midnightveil midnightveil commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

This removes the need for the linker script to define the IPC buffer.

Fixes: #451.

@midnightveil midnightveil force-pushed the julia/ipc-buffer-patched branch from ea57cbf to 3555000 Compare June 19, 2026 07:13
@midnightveil midnightveil marked this pull request as ready for review June 19, 2026 07:13
@midnightveil

midnightveil commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator Author

OK, figured out the issue: seL4/seL4#1693. Annoyingly this complicates things, but oh well.

@midnightveil midnightveil force-pushed the julia/ipc-buffer-patched branch from 3555000 to ff31b38 Compare June 19, 2026 07:15
Comment thread libmicrokit/src/main.c Outdated
Comment thread libmicrokit/src/main.c Outdated
Comment thread tool/microkit/src/sel4.rs Outdated

@dreamliner787-9 dreamliner787-9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A couple of small things from me but other than that looks good.

Comment thread tool/microkit/src/capdl/builder.rs Outdated
Comment thread tool/microkit/src/capdl/builder.rs Outdated
Comment thread tool/microkit/src/capdl/builder.rs Outdated
Comment thread monitor/src/main.c
Comment on lines +32 to +39
// Workaround: https://github.com/seL4/seL4/issues/1693
#if seL4_UserTop == 0x00ffffffffff || seL4_UserTop == 0x0fffffffffff || seL4_UserTop == 0x7fffffffffff
#define user_top_aligned (seL4_UserTop + 1)
#elif (seL4_UserTop & ((1ULL << seL4_PageBits) - 1)) != 0
#error "Expects seL4_UserTop to be aligned"
#else
#define user_top_aligned (seL4_UserTop)
#endif

@dreamliner787-9 dreamliner787-9 Jun 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggestion: can we fix this in the kernel first? I dislike having workarounds like this, because then we have to go back and fix it later.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It depends on proof updates to seL4, as the values are used inside seL4 implementation.

I suppose @lsf37 can comment if it would be possible to fix seL4/seL4#1693 before the next release.


We could do something hacky where we export a different value than what seL4 uses in the code, and so we make userspace consistent whilst leaving the checks the same. I don't suppose the semantics extraction is clever enough to do constant folding, would it?

e.g. if we changed a seL4_UserTop that is 0x800000000 to 0x7fffffffffff and then made the check inside the vspace map functions do (>= (seL4_UserTop + 1)). Whether it's smart enough to constant fold and not affect the proofs?

But I don't know if it's worth doing that as opposed to just fixing it... (it's surely just changing < to <= in a few places?).

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.

The semantics extraction does not do constant folding as such, but a lot of the times it is done implicitly in the proofs, so it would be possible to be lucky on that one.

I currently don't have it on the list for the release, because I wanted to focus on bugs, but it would not be hard to add once we have decided what to do. The tricky part is social: technically this changes the API and is a breaking change. I don't really want to write an entire RFC for this, but a few more opinions would be good.

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.

But I don't know if it's worth doing that as opposed to just fixing it... (it's surely just changing < to <= in a few places?).

In the code, yes. In the proofs it's slightly more than that, because one version needs a proof of absence of overflow and the other does not. It's small, but it's not automatic.

@midnightveil midnightveil force-pushed the julia/ipc-buffer-patched branch from ff31b38 to 38d5f9c Compare June 22, 2026 06:40
This removes the need for the linker script to define the
IPC buffer.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
Turns out the SDF parser does check for overlap with the stack,
so we don't need to duplicate this here, only doing ELF.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
@midnightveil midnightveil force-pushed the julia/ipc-buffer-patched branch from 38d5f9c to 871ee7f Compare June 22, 2026 06:42
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.

Can we remove the need for the linker script to declare '__sel4_ipc_buffer_obj'?

3 participants