Skip to content

Extract kernel object sizes from headers#456

Merged
Ivan-Velickovic merged 2 commits intomainfrom
object_sizes_from_kernel
Mar 30, 2026
Merged

Extract kernel object sizes from headers#456
Ivan-Velickovic merged 2 commits intomainfrom
object_sizes_from_kernel

Conversation

@Ivan-Velickovic
Copy link
Copy Markdown
Collaborator

See commit messages for details.

Addresses #378, but ideally this would be an output of the kernel build itself since it is useful outside of Microkit.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
@Ivan-Velickovic Ivan-Velickovic force-pushed the object_sizes_from_kernel branch 2 times, most recently from 6aa3fc8 to 7ee449d Compare March 27, 2026 03:44
Many of these constants are architecture-dependent, but also slightly
differ depending on how the kernel is configured.

Rather than reproducing all the special combinations of kernel
configurations that affect object size in the tool itself, just read
from the source of truth.

This should prevent bugs such as
7323d07.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
@Ivan-Velickovic Ivan-Velickovic force-pushed the object_sizes_from_kernel branch from 7ee449d to 113fc40 Compare March 27, 2026 03:51
@Indanz
Copy link
Copy Markdown

Indanz commented Mar 27, 2026

These sizes are exported as defines in libsel4/sel4_arch_include/*/sel4/sel4_arch/constants.h, but not in a usable format. Feel free to open a PR in seL4 to export this information properly instead of adding hacks like this.

Copy link
Copy Markdown
Contributor

@midnightveil midnightveil left a comment

Choose a reason for hiding this comment

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

I hate having to do this but it seems fine.

@Ivan-Velickovic Ivan-Velickovic merged commit b7f841e into main Mar 30, 2026
10 of 11 checks passed
@Ivan-Velickovic Ivan-Velickovic deleted the object_sizes_from_kernel branch March 30, 2026 04:13
@lsf37
Copy link
Copy Markdown
Member

lsf37 commented Mar 30, 2026

When/if someone is working on exporting these nicely from the seL4 build, please let me know. These would be nice to import into the verification as well.

@Ivan-Velickovic
Copy link
Copy Markdown
Collaborator Author

@Indanz I agree that is a hack.

@lsf37, I've opened seL4/seL4#1632. I can give it a go once I get feedback from people on how it should work.

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.

4 participants