Skip to content

Conversation

babayet2
Copy link
Contributor

@babayet2 babayet2 commented Oct 2, 2025

Discussed w/ @chris-oo, this PR updates the page table builder in the loader to be no_std, and to accept a generic buffer for its working memory

The goal is to prepare the library to be used within the openhcl_boot shim, which is a no_std environment. The generic buffer change allows the loader code to continue using a vectors for its working memory, whereas the boot shim will be providing its working buffer as ArrayVec stashed in the global section

@babayet2 babayet2 requested review from a team as code owners October 2, 2025 06:49
@chris-oo chris-oo self-assigned this Oct 2, 2025
@babayet2
Copy link
Contributor Author

babayet2 commented Oct 9, 2025

@chris-oo pushed a new version without the big trait and generics, where we just allocate space up front

LMK if it's looking good in principle, let me know, it will need to be fixed up for ARM

Copy link
Member

@chris-oo chris-oo left a comment

Choose a reason for hiding this comment

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

getting closer

/// linkage_gpa represents the GPA at which the linked PML4E should be linked.
pub fn build_page_tables_64(
pub fn build_page_tables_64<'a>(
page_table_gpa: u64,
Copy link
Member

Choose a reason for hiding this comment

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

at this point with so many arguments i wonder should we use a Builder pattern instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pushed, what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's cleaner - are you going to delete the old function as well? We shouldn't have both APIs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's possible you could be looking at an old revision, otherwise I'm missing your point here

build_page_tables_64 was removed, that interface doesn't exist anymore. is there other dead code I left in?

@babayet2
Copy link
Contributor Author

hey Chris could you kick off a CI run for me? I recall there are build issues on arm, but I'm not seeing them when I build for aarch64 locally

/// linkage_gpa represents the GPA at which the linked PML4E should be linked.
pub fn build_page_tables_64(
pub fn build_page_tables_64<'a>(
page_table_gpa: u64,
Copy link
Member

Choose a reason for hiding this comment

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

I think it's cleaner - are you going to delete the old function as well? We shouldn't have both APIs.

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