Fix incorrect VM Attributes being applied for mapping frames to x86 EPT#321
Open
dreamliner787-9 wants to merge 2 commits intoseL4:mainfrom
Open
Fix incorrect VM Attributes being applied for mapping frames to x86 EPT#321dreamliner787-9 wants to merge 2 commits intoseL4:mainfrom
dreamliner787-9 wants to merge 2 commits intoseL4:mainfrom
Conversation
Necessary for rust-sel4 to build with [1] applied to seL4. However, this patch does not need [1] to be merged for everything to work since seL4_X86_EPT_VMAttributes has always existed. [1]: seL4/seL4#1577 Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
7db74ae to
8d48382
Compare
x86 EPT support was added to the capDL Initializer in [1], but I've made a mistake of not using EPT VM Attributes when mapping frames to EPT. Since the encoding of EPT and ordinary page table VM Attributes are different. Mapping a frame to EPT as "cached" in the spec would translate to mapping it as uncached. [1] seL4#305 Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
8d48382 to
2f4ce9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #317
x86 EPT support was added to the capDL Initializer in [1], but I've made a mistake of not using EPT VM Attributes when mapping frames to EPT. Since the encoding of EPT and ordinary page table VM Attributes are different. Mapping a frame to EPT as "cached" in the spec would translate to mapping it as uncached.
The fix was implemented by adding another parameter
is_x86_ept: boolto bothvm_attributes()andvm_attributes_from_whether_cached_and_exec(). I'm not sure whether this is the best approach as it seems a bit hacky. A another approach would be to define this information in the Frame cap spec object. But then you would have two places that encode this information as the cap would be mapped to an EPT.[1] #305