Skip to content

Adding "mm_supv" feature#182

Draft
kuqin12 wants to merge 12 commits intoOpenDevicePartnership:mainfrom
kuqin12:supv_bit
Draft

Adding "mm_supv" feature#182
kuqin12 wants to merge 12 commits intoOpenDevicePartnership:mainfrom
kuqin12:supv_bit

Conversation

@kuqin12
Copy link
Copy Markdown
Contributor

@kuqin12 kuqin12 commented Mar 11, 2026

Description

This change adds the mm_supv feature, which will honor the supervisor mask definition and apply the appropriate supervisor bit in the page table entries (leaf level only).

In addition, this feature also assumes the page table is marked as read only, which means paging protection needs to be disabled when the content is updated.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

This was tested with QEMU Q35 platform + rust supervisor and booted to Windows desktop.

Integration Instructions

For modules that works with supervisor level paging, one needs to build with mm_supv feature flag.

This change adds the special-purpose memory region bit in paging crate.

This bit may be used for specific device drivers or applications.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
The original page table query logic assumed that all parent-level entries
were marked with the most permissive attributes, allowing the leaf entry
to directly reflect the effective attributes during a query.

However, since patina-paging also supports initialization from an
existing page table, this assumption does not always hold. The query
logic must instead accurately model attribute inheritance across the page
table hierarchy.

This change fixes the issue by introducing an additional input parameter
to the internal helper, allowing the query to correctly propagate and
reflect parent attributes.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
This change adds a mm_supv flag to prepare for the usage of supervisor
bit in the page table entries.

Note that supervisor will map the MEMORY_SP bit to be supervisor pages
and otherwise it will be user pages.

Signed-off-by: Kun Qin  <kun.qin@microsoft.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant