Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit page table static to be updated #4792

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Conversation

jul-sh
Copy link
Contributor

@jul-sh jul-sh commented Feb 12, 2024

No description provided.

@jul-sh jul-sh force-pushed the pt-swap branch 2 times, most recently from 3b00f0d to 06b1acd Compare February 12, 2024 14:44
Comment on lines +281 to +286
/// Replaces the current pagetable with the parameter, returning the old
/// pagetable if there was one. Does not issue the instructions update the
/// page table on the CPU level.
pub fn replace(&mut self, new_pt: RootPageTable) -> Option<RootPageTable> {
self.inner.replace(new_pt)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't used yet, but will be in the future

@@ -267,3 +267,35 @@ impl Translator for RootPageTable {
self.inner.translate_physical_frame(frame)
}
}

/// Wrapper struct that holds the current page table is there one.
pub struct CurrentPageTable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: perhaps emphasize the fact that this is the current root page table in the name (e.g. CurrentRootPageTable)

inner: Option<RootPageTable>,
}

impl CurrentPageTable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't seem to add much over just using Option<RootPageTable, apart from changing the names of some functions. Do you plan on adding more functionality to this wrapper in future?

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 would expect it to later on update the pagetable on the CPU level upon updating.

The other difference is that it cannot be set back to None.

@jul-sh jul-sh merged commit 70dc7e7 into project-oak:main Feb 12, 2024
15 of 17 checks passed
@jul-sh jul-sh deleted the pt-swap branch February 12, 2024 17:13
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