Skip to content

Update rust-sel4 commit from TS fork to mainline#531

Merged
midnightveil merged 5 commits into
seL4:mainfrom
au-ts:rust_sel4_update_to_main
Jun 29, 2026
Merged

Update rust-sel4 commit from TS fork to mainline#531
midnightveil merged 5 commits into
seL4:mainfrom
au-ts:rust_sel4_update_to_main

Conversation

@dreamliner787-9

@dreamliner787-9 dreamliner787-9 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

This required a few changes to how the spec is packed into the initialiser ELF from seL4/rust-sel4#345.

Do not merge until:

Comment thread tool/microkit/src/elf.rs Outdated
Comment thread tool/microkit/src/elf.rs Outdated
Comment thread tool/microkit/src/elf.rs Outdated
@midnightveil

Copy link
Copy Markdown
Collaborator

rust-seL4 PR has been merged now, so you should be able to update to that commit.

Comment thread tool/microkit/src/elf.rs
execute: bool,
vaddr: u64,
data: ElfSegmentData,
meta_phdr_type_maybe: Option<u32>,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is weird? Why do it like this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's for the caller to say "create an additional program header for this segment with this type in addition to the loadable program header".

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Well, yes. But why this optional argument to creating a segment? It feels weird

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because you don't need to extra phdr in all cases, see the diff to loader.rs for example

Previously, the ELF code treats program headers = segments. While this
worked originally, it broke for cases that requires >= 2 program
headers to refer to the same segment.

Now, when the ELF is parsed, the code will create a 1-1 mapping of
segments to program headers like before. But the allow for additional
program headers to be inserted.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Added `pub fn phdrs_table(&self) -> Vec<(ElfProgramHeader64, usize)>` to
ELF code.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Modified `pub fn add_segment()` to allow for an additional program
header in the ELF to describe the segment with a user defined type
identifier.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
@dreamliner787-9 dreamliner787-9 force-pushed the rust_sel4_update_to_main branch from d9b1e0a to 835f47b Compare June 29, 2026 05:32
@midnightveil

Copy link
Copy Markdown
Collaborator

Object allocation simulator in allocation.rs is updated with the new strategy

Does this need to be done?

@dreamliner787-9

Copy link
Copy Markdown
Contributor Author

Object allocation simulator in allocation.rs is updated with the new strategy

Does this need to be done?

Yes I'm doing it right now

Which also required changes to how the spec is packed into the
intialiser.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Updated all instances of struct member name `type_` to `r#type`.

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
@dreamliner787-9 dreamliner787-9 force-pushed the rust_sel4_update_to_main branch from 835f47b to eeaf7c0 Compare June 29, 2026 05:44
@dreamliner787-9

Copy link
Copy Markdown
Contributor Author

This is ready from my side.

@midnightveil midnightveil merged commit b58bef3 into seL4:main Jun 29, 2026
11 checks passed
@midnightveil midnightveil deleted the rust_sel4_update_to_main branch June 29, 2026 06:53
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