Skip to content

Fix incorrect VM Attributes being applied for mapping frames to x86 EPT#321

Open
dreamliner787-9 wants to merge 2 commits intoseL4:mainfrom
au-ts:ept_vmattr_fix
Open

Fix incorrect VM Attributes being applied for mapping frames to x86 EPT#321
dreamliner787-9 wants to merge 2 commits intoseL4:mainfrom
au-ts:ept_vmattr_fix

Conversation

@dreamliner787-9
Copy link
Contributor

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: bool to both vm_attributes() and vm_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

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>
@dreamliner787-9 dreamliner787-9 requested a review from nspin as a code owner March 3, 2026 02:02
@dreamliner787-9 dreamliner787-9 force-pushed the ept_vmattr_fix branch 2 times, most recently from 7db74ae to 8d48382 Compare March 3, 2026 03:06
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>
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