Skip to content

[Rebase & FF] Patina: Rust based MM Supervisor and User Core - #1875

Merged
vineelko merged 9 commits into
OpenDevicePartnership:mainfrom
vineelko:users/vineelko/feature_supv_to_main
Nov 19, 2026
Merged

vineelko merged 9 commits into
OpenDevicePartnership:mainfrom
vineelko:users/vineelko/feature_supv_to_main

Conversation

@vineelko

@vineelko vineelko commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

[feature/supv] patina: sdk: Add MM services and the supervisor ABI
[feature/supv] patina: core: patina_internal_cpu: save state support for supv
patina: Add MemoryRange for checked address ranges
[feature/supv] patina_mm_supervisor: Add the MM supervisor core
[feature/supv] patina_mm_supervisor: Add unit tests across the crate
[feature/supv] patina_mm_user_core: Add the MM user core
[feature/supv] patina_mm_user_core: Improve unit test coverage
[feature/supv] patina: component: Add a MM CPU component at mm user level
[feature/supv] docs: Add the MM supervisor and user core documentation

RFC: https://github.com/OpenDevicePartnership/patina/blob/main/docs/src/rfc/text/0026-mm-supv.md


[feature/supv] patina: sdk: Add MM services and the supervisor ABI

Add the MmServices trait to the patina SDK. The trait is the safe Rust
interface to the PI EFI_MM_SYSTEM_TABLE services. It covers pool and
page allocation, MMI handler registration, protocol install
notifications, and handle lookup. Every method returns a Result instead
of a raw status.

A core such as patina_mm_user_core implements MmServices and registers
that implementation with StandardMmServices. The EfiMmSystemTable
function pointers then forward each C call into the registered
implementation. Rust callers use the trait directly and never dispatch
through the shared table. Components reach the same implementation
through MmServiceProvider, which resolves during parameter setup.

Also add the management_mode::supervisor module. It holds what the two
halves of the MM core must agree on before either one exists: the
module GUIDs for the supervisor core, the user core and the init
module, the UserCommandType values the supervisor passes when it calls
into Ring 3, the SyscallIndex values Ring 3 passes back, and
raw_syscall. Neither half can own this, so it lives in the SDK.


[feature/supv] patina: core: patina_internal_cpu: save state support for supv

Add a save_state module to patina_internal_cpu. It defines the
MmSaveStateRegister values from the PI specification and the vendor
register maps that give the offset and width of each register inside the
SMRAM save state area.

The MM supervisor needs these offsets to serve save state reads on behalf
of Ring 3 code. The layout differs between Intel and AMD, so each vendor
map lives in its own file, intel.rs and amd.rs.

Both maps are always compiled so each one is type checked and unit tested
in every build, including the --all-features build that CI uses for
clippy, coverage, and docs. The active map is chosen by the
save_state_intel and save_state_amd features. Intel is the default when
both features or neither feature is enabled.


patina: Add MemoryRange for checked address ranges

Add MemoryRange to the base module and export it, with MemoryRangeError,
from the crate root. A MemoryRange is a [base, base + size) range whose
size is never zero and whose end always fits in a u64. The constructors
(new, from_inclusive, from_pages and TryFrom for Rust ranges) return an
error instead of building a range that breaks these rules.

Code that handles address ranges as (base, size) pairs repeats the same
overflow, overlap and containment checks, often with checked_add at each
call site. With these rules held by the type, a range that wraps the
address space or has no size cannot reach that code.

The type provides containment, overlap, intersection, union, alignment
checks, extension and iteration by step. collapse returns the range that
covers a list of ranges, and coalesce does the same but fails when the
ranges leave a gap. find_overlap returns the first overlapping pair in a
list, and coverage reports whether a list covers a range fully, partly,
or not at all. MemoryRangeError converts to EfiError::InvalidParameter.


[feature/supv] patina_mm_supervisor: Add the MM supervisor core

Add patina_mm_supervisor, the Ring 0 half of the standalone MM core. It
runs on x86-64 and replaces the C MM supervisor in MmSupervisorPkg. The
entry shim starts at efi_main and jumps to rust_main, which the
platform binary supplies.

The BSP performs the one time initialization and then serves incoming
MMI requests. It arms the syscall entry path and the call gate, builds
the page tables and the memory policy, programs the SMRRs to protect
MMRAM from accesses outside MM, and demotes execution to Ring 3 before
it calls the user core. APs wait in a holding pen and poll a mailbox
for work from the BSP.

The crate does not allocate from a heap.


[feature/supv] patina_mm_supervisor: Add unit tests across the crate

Add unit tests that run on the host for most modules in the crate: HOB
validation, the page and paging allocators, the policy gate, the
syscall dispatcher, the call gate, the supervisor request handlers,
save state, SMRR, the mailbox and the semaphore. A new test_support
module holds the shared fixtures, and mm_policy gains a builder for
synthetic policy buffers.


[feature/supv] patina_mm_user_core: Add the MM user core

Add patina_mm_user_core, the Ring 3 half of the standalone MM core. It
performs the same work as the C StandaloneMmCore. It walks the HOB list
to find MM drivers, evaluates their dependency expressions, dispatches
them, and routes MMI requests to the registered handlers.

The supervisor calls the entry point with one of three commands.
StartUserCore runs the one time setup and the first dispatch pass.
UserRequest parses a communication buffer and invokes the matching MMI
handler. UserApProcedure runs a procedure on behalf of an AP.

The crate implements the MmServices trait from the SDK and publishes an
EfiMmSystemTable for C drivers. It keeps its own protocol database and
configuration table, and serves small allocations from a pool that
requests pages from the supervisor by syscall. Ring 3 has no direct
access to supervisor resources, so every privileged operation goes
through the syscall interface. A component dispatcher lets a platform
register native Patina components next to the C drivers.


[feature/supv] patina_mm_user_core: Improve unit test coverage

| Filename                                                                    | Function Coverage | Line Coverage     | Region Coverage   |
| --------------------------------------------------------------------------- | ----------------- | ----------------- | ----------------- |
| patina_mm_user_core\src\component_dispatcher.rs                             | 100.00% (19/19)   | 100.00% (83/83)   | 95.80% (137/143)  |
| patina_mm_user_core\src\config_table.rs                                     | 100.00% (7/7)     | 100.00% (69/69)   | 98.72% (77/78)    |
| patina_mm_user_core\src\core_handlers.rs                                    | 100.00% (10/10)   | 94.74% (90/95)    | 92.04% (104/113)  |
| patina_mm_user_core\src\lib.rs                                              | 100.00% (19/19)   | 86.18% (187/217)  | 85.25% (289/339)  |
| patina_mm_user_core\src\mm_dispatcher.rs                                    | 100.00% (9/9)     | 93.33% (140/150)  | 89.26% (216/242)  |
| patina_mm_user_core\src\mm_mem.rs                                           | 100.00% (8/8)     | 100.00% (45/45)   | 100.00% (68/68)   |
| patina_mm_user_core\src\mm_services.rs                                      | 100.00% (34/34)   | 99.47% (378/380)  | 98.85% (431/436)  |
| patina_mm_user_core\src\mmi.rs                                              | 100.00% (17/17)   | 99.41% (169/170)  | 96.40% (214/222)  |
| patina_mm_user_core\src\pool_allocator.rs                                   | 100.00% (9/9)     | 100.00% (90/90)   | 99.38% (160/161)  |
| patina_mm_user_core\src\protocol_db.rs                                      | 100.00% (29/29)   | 100.00% (153/153) | 100.00% (248/248) |

[feature/supv] patina: component: Add a MM CPU component at mm user level

Add patina_mm_cpu, a component that produces the PI EFI_MM_CPU_PROTOCOL
inside the MM user core. The protocol lets MM drivers read the
architecture standard registers of a CPU save state, including the fields
that describe the I/O instruction that caused a software MMI.

The save state lives in SMRAM that only the supervisor can read, so Ring
3 cannot reach it. ReadSaveState forwards each read to the supervisor
through the save state syscall, and the supervisor applies the save state
policy before it returns a value.

This replaces the C MmSupervisedCpu driver in MmSupervisorPkg. A platform
registers the component through its MmComponentInfo implementation.


[feature/supv] docs: Add the MM supervisor and user core documentation

Add a Patina MM Subsystems part to the book. It explains how
patina_mm_supervisor and patina_mm_user_core work, from the first MMI to
the services that MM drivers call, so a reader can follow the design
without reading the code first.

The part has eight pages:

  • Theory and Operation: actors, cores and rings, the MMRAM map, the
    trust model, the crate map and the global state of each core
  • Initialization and Initialization Validation: the first MMI on the
    BSP and the APs, and every check made on what MM Init hands over
  • Privilege Boundary: demotion to Ring 3, the call gate, the syscalls,
    failure handling and Ring 0 access to user pages
  • MMI Handling: the rendezvous, the communication buffers, supervisor
    and user requests, and AP procedures
  • Memory Management: MMRAM and the SMRRs, the page allocator, the page
    table, page ownership and unblocked memory
  • Security Policy: the policy blob, the runtime gate, the memory policy
    and the boundary audit
  • User Core: the MM System Table, the protocol and MMI handler
    databases, component and driver dispatch, and the save state

A new integration page, Patina MM Supervisor Requirements, lists what a
platform must provide: processor support, MMRAM layout, MM Init state,
HOBs, the security policy file, MM driver rules and the requests from
outside MM, followed by the known limitations. The figures are SVG files
in docs/src/media, drawn in one style with numbered steps. Every
statement was checked against the code.


Coauthored-off-by: Kun Qin kun.qin@microsoft.com
Coauthored-off-by: Vineel Kovvuri[MSFT] vineelko@microsoft.com

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

How This Was Tested

Validated on internal hardware platforms.

Integration Instructions

Consumed in SEA repository to produce Supervisor, User Core, SEA rule sets and related binaries.
Note: Patina v24.4.1 is the last release before merging this PR.

@patina-automation

patina-automation Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ QEMU Validation Passed

All QEMU validation jobs completed successfully.

Note: Q35 is only built on Windows hosts (QEMU boot is disabled due to a QEMU vfat issue).

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/44638544883

Boot Time to EFI Shell

Platform Elapsed
ArmVirt (Linux Host) 22.2s
Q35 (Linux Host) 40.5s

Dependencies

Repository Ref
patina 641ec14
patina-dxe-core-qemu 422e50e
patina-fw-patcher 820b0ae
patina-qemu firmware v4.1.5
patina-qemu build script 09bcae2

Binary Size Report

Platform Commit Δ Debug Δ Release Δ Debug
(LZMA)
Δ Release
(LZMA)
Q35 (x86_64) Base:f7a3971
PR:641ec14
 
1.21 MB
1.21 MB
Δ 0.00 B
971.00 KB
968.00 KB
Δ -3.00 KB
468.80 KB
469.08 KB
Δ +288.00 B
382.50 KB
381.73 KB
Δ -792.00 B
ArmVirt (aarch64) Base:f7a3971
PR:641ec14
 
1.10 MB
1.10 MB
Δ -512.00 B
893.50 KB
893.50 KB
Δ 0.00 B
382.19 KB
382.01 KB
Δ -182.00 B
315.09 KB
314.96 KB
Δ -135.00 B

Compressed sizes use LZMA-alone format at preset 6 (xz --format=lzma -6).

Shared QEMU integration: 422e50e.

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@github-actions github-actions Bot added impact:breaking-change Requires integration attention impact:security Has a security impact impact:testing Affects testing type:documentation Improvements or additions to documentation labels Oct 13, 2026
@cfernald

cfernald commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

@vineelko, could we get some patina book docs for this PR? We will need it eventually anyways, and it would be good to get an understanding of the architecture before reviewing

edit: noticed the README.md files after posting, but would still be good to get this for the patina book.

@vineelko

Copy link
Copy Markdown
Contributor Author

@vineelko, could we get some patina book docs for this PR? We will need it eventually anyways, and it would be good to get an understanding of the architecture before reviewing

edit: noticed the README.md files after posting, but would still be good to get this for the patina book.

Sure Chris, will include it.

@vineelko
vineelko force-pushed the users/vineelko/feature_supv_to_main branch from 515c48e to 6bb3601 Compare October 13, 2026 19:50
@vineelko vineelko changed the title [Rebase & FF] Patina: Rust based MM Supervisor and User Core [Draft] [Rebase & FF] Patina: Rust based MM Supervisor and User Core Oct 13, 2026
@vineelko

Copy link
Copy Markdown
Contributor Author

Renaming this PR as draft until some more dust is settled. Please hold off on reviewing it.

@os-d os-d left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Leaving current set of comments in response to the comment to wait for the dust to settle :)

@vineelko
vineelko force-pushed the users/vineelko/feature_supv_to_main branch 2 times, most recently from 59d1a2a to 36656d1 Compare October 17, 2026 00:40
@vineelko

Copy link
Copy Markdown
Contributor Author

Addressed most of the previous comments, fixed the alloc feature build failure, and consolidated the changes into above 7 commits. I did look into Stacked PRs, but the workflow seemed a bit more complicated, so I decided to continue in the current PR :-).

I haven't gotten to the documentation yet, but I'll add it next. Overall, the PR is now up for review.

@vineelko vineelko changed the title [Draft] [Rebase & FF] Patina: Rust based MM Supervisor and User Core [Rebase & FF] Patina: Rust based MM Supervisor and User Core Oct 17, 2026
@vineelko
vineelko force-pushed the users/vineelko/feature_supv_to_main branch from 36656d1 to b42ed51 Compare October 17, 2026 08:18
Comment thread sdk/patina/src/base/guid/constants.rs Resolved
Comment thread sdk/patina/src/base/guid/constants.rs Resolved
Comment thread sdk/patina/src/base/guid/constants.rs Resolved
Comment thread core/patina_internal_cpu/README.md Resolved
@vineelko
vineelko force-pushed the users/vineelko/feature_supv_to_main branch from b42ed51 to c92f2c0 Compare October 20, 2026 22:23
Comment thread patina_mm_supervisor/src/hob/lookup.rs Resolved
@vineelko
vineelko force-pushed the users/vineelko/feature_supv_to_main branch 2 times, most recently from b39911c to 577872b Compare October 22, 2026 04:41
Comment thread patina_mm_user_core/src/mm_services.rs Resolved
@vineelko
vineelko force-pushed the users/vineelko/feature_supv_to_main branch 3 times, most recently from 0466373 to 5e85591 Compare November 19, 2026 08:51

@cfernald cfernald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Because I'm late to the party, I've avoiding leaving any non-blocking or stylistic comments. Looks good!

@makubacki

Copy link
Copy Markdown
Collaborator

@vineelko, before merging, could you consider the following simple changes to address some final coverage gaps?

  • intrinsics.rs: Likely disable coverage in cpuid_version_info: read_msr, write_msr, is_bsp, cpuid_version_info
  • component.rs: Likely disable coverage in entry_point
  • entry.rs: Please check coverage of entry_point and entry_point_internal

@vineelko
vineelko force-pushed the users/vineelko/feature_supv_to_main branch 2 times, most recently from 766afbc to 07cc6ff Compare November 19, 2026 19:35
@vineelko vineelko added this to the MM Supervisor Prerequisites milestone Nov 19, 2026
@vineelko vineelko added this to Patina Nov 19, 2026
@vineelko
vineelko force-pushed the users/vineelko/feature_supv_to_main branch from 07cc6ff to 57fde8a Compare November 19, 2026 22:45
@vineelko
vineelko enabled auto-merge (rebase) November 19, 2026 22:46
@vineelko
vineelko disabled auto-merge November 19, 2026 22:48
makubacki pushed a commit that referenced this pull request Nov 19, 2026
This is the patch release before merging the Rust MM Supervisor changes.
#1875

Co-authored-by: patina-automation[bot] <patina@microsoft.com>
kuqin12 and others added 9 commits November 19, 2026 15:20
Add the MmServices trait to the patina SDK. The trait is the safe Rust
interface to the PI EFI_MM_SYSTEM_TABLE services. It covers pool and
page allocation, MMI handler registration, protocol install
notifications, and handle lookup. Every method returns a Result instead
of a raw status.

A core such as patina_mm_user_core implements MmServices and registers
that implementation with StandardMmServices. The EfiMmSystemTable
function pointers then forward each C call into the registered
implementation. Rust callers use the trait directly and never dispatch
through the shared table. Components reach the same implementation
through MmServiceProvider, which resolves during parameter setup.

Also add the management_mode::supervisor module. It holds what the two
halves of the MM core must agree on before either one exists: the
module GUIDs for the supervisor core, the user core and the init
module, the UserCommandType values the supervisor passes when it calls
into Ring 3, the SyscallIndex values Ring 3 passes back, and
raw_syscall. Neither half can own this, so it lives in the SDK.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
…for supv

Add a save_state module to patina_internal_cpu. It defines the
MmSaveStateRegister values from the PI specification and the vendor
register maps that give the offset and width of each register inside the
SMRAM save state area.

The MM supervisor needs these offsets to serve save state reads on behalf
of Ring 3 code. The layout differs between Intel and AMD, so each vendor
map lives in its own file, intel.rs and amd.rs.

Both maps are always compiled so each one is type checked and unit tested
in every build, including the --all-features build that CI uses for
clippy, coverage, and docs. The active map is chosen by the
save_state_intel and save_state_amd features. Intel is the default when
both features or neither feature is enabled.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Add MemoryRange to the base module and export it, with MemoryRangeError,
from the crate root. A MemoryRange is a [base, base + size) range whose
size is never zero and whose end always fits in a u64. The constructors
(new, from_inclusive, from_pages and TryFrom for Rust ranges) return an
error instead of building a range that breaks these rules.

Code that handles address ranges as (base, size) pairs repeats the same
overflow, overlap and containment checks, often with checked_add at each
call site. With these rules held by the type, a range that wraps the
address space or has no size cannot reach that code.

The type provides containment, overlap, intersection, union, alignment
checks, extension and iteration by step. collapse returns the range that
covers a list of ranges, and coalesce does the same but fails when the
ranges leave a gap. find_overlap returns the first overlapping pair in a
list, and coverage reports whether a list covers a range fully, partly,
or not at all. MemoryRangeError converts to EfiError::InvalidParameter.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Add patina_mm_supervisor, the Ring 0 half of the standalone MM core. It
runs on x86-64 and replaces the C MM supervisor in MmSupervisorPkg. The
entry shim starts at efi_main and jumps to rust_main, which the
platform binary supplies.

The BSP performs the one time initialization and then serves incoming
MMI requests. It arms the syscall entry path and the call gate, builds
the page tables and the memory policy, programs the SMRRs to protect
MMRAM from accesses outside MM, and demotes execution to Ring 3 before
it calls the user core. APs wait in a holding pen and poll a mailbox
for work from the BSP.

The crate does not allocate from a heap.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Add unit tests that run on the host for most modules in the crate: HOB
validation, the page and paging allocators, the policy gate, the
syscall dispatcher, the call gate, the supervisor request handlers,
save state, SMRR, the mailbox and the semaphore. A new test_support
module holds the shared fixtures, and mm_policy gains a builder for
synthetic policy buffers.

Signed-off-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Co-authored-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Add patina_mm_user_core, the Ring 3 half of the standalone MM core. It
performs the same work as the C StandaloneMmCore. It walks the HOB list
to find MM drivers, evaluates their dependency expressions, dispatches
them, and routes MMI requests to the registered handlers.

The supervisor calls the entry point with one of three commands.
StartUserCore runs the one time setup and the first dispatch pass.
UserRequest parses a communication buffer and invokes the matching MMI
handler. UserApProcedure runs a procedure on behalf of an AP.

The crate implements the MmServices trait from the SDK and publishes an
EfiMmSystemTable for C drivers. It keeps its own protocol database and
configuration table, and serves small allocations from a pool that
requests pages from the supervisor by syscall. Ring 3 has no direct
access to supervisor resources, so every privileged operation goes
through the syscall interface. A component dispatcher lets a platform
register native Patina components next to the C drivers.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
```
| Filename                                                                    | Function Coverage | Line Coverage     | Region Coverage   |
| --------------------------------------------------------------------------- | ----------------- | ----------------- | ----------------- |
| patina_mm_user_core\src\component_dispatcher.rs                             | 100.00% (19/19)   | 100.00% (83/83)   | 95.80% (137/143)  |
| patina_mm_user_core\src\config_table.rs                                     | 100.00% (7/7)     | 100.00% (69/69)   | 98.72% (77/78)    |
| patina_mm_user_core\src\core_handlers.rs                                    | 100.00% (10/10)   | 94.74% (90/95)    | 92.04% (104/113)  |
| patina_mm_user_core\src\lib.rs                                              | 100.00% (19/19)   | 86.18% (187/217)  | 85.25% (289/339)  |
| patina_mm_user_core\src\mm_dispatcher.rs                                    | 100.00% (9/9)     | 93.33% (140/150)  | 89.26% (216/242)  |
| patina_mm_user_core\src\mm_mem.rs                                           | 100.00% (8/8)     | 100.00% (45/45)   | 100.00% (68/68)   |
| patina_mm_user_core\src\mm_services.rs                                      | 100.00% (34/34)   | 99.47% (378/380)  | 98.85% (431/436)  |
| patina_mm_user_core\src\mmi.rs                                              | 100.00% (17/17)   | 99.41% (169/170)  | 96.40% (214/222)  |
| patina_mm_user_core\src\pool_allocator.rs                                   | 100.00% (9/9)     | 100.00% (90/90)   | 99.38% (160/161)  |
| patina_mm_user_core\src\protocol_db.rs                                      | 100.00% (29/29)   | 100.00% (153/153) | 100.00% (248/248) |
```

Signed-off-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Co-authored-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
…evel

Add patina_mm_cpu, a component that produces the PI EFI_MM_CPU_PROTOCOL
inside the MM user core. The protocol lets MM drivers read the
architecture standard registers of a CPU save state, including the fields
that describe the I/O instruction that caused a software MMI.

The save state lives in SMRAM that only the supervisor can read, so Ring
3 cannot reach it. ReadSaveState forwards each read to the supervisor
through the save state syscall, and the supervisor applies the save state
policy before it returns a value.

This replaces the C MmSupervisedCpu driver in MmSupervisorPkg. A platform
registers the component through its MmComponentInfo implementation.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Add a Patina MM Subsystems part to the book. It explains how
patina_mm_supervisor and patina_mm_user_core work, from the first MMI to
the services that MM drivers call, so a reader can follow the design
without reading the code first.

The part has eight pages:

- Theory and Operation: actors, cores and rings, the MMRAM map, the
  trust model, the crate map and the global state of each core
- Initialization and Initialization Validation: the first MMI on the
  BSP and the APs, and every check made on what MM Init hands over
- Privilege Boundary: demotion to Ring 3, the call gate, the syscalls,
  failure handling and Ring 0 access to user pages
- MMI Handling: the rendezvous, the communication buffers, supervisor
  and user requests, and AP procedures
- Memory Management: MMRAM and the SMRRs, the page allocator, the page
  table, page ownership and unblocked memory
- Security Policy: the policy blob, the runtime gate, the memory policy
  and the boundary audit
- User Core: the MM System Table, the protocol and MMI handler
  databases, component and driver dispatch, and the save state

A new integration page, Patina MM Supervisor Requirements, lists what a
platform must provide: processor support, MMRAM layout, MM Init state,
HOBs, the security policy file, MM driver rules and the requests from
outside MM, followed by the known limitations. The figures are SVG files
in docs/src/media, drawn in one style with numbered steps. Every
statement was checked against the code.

Signed-off-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Co-authored-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
@vineelko
vineelko force-pushed the users/vineelko/feature_supv_to_main branch from 57fde8a to 641ec14 Compare November 19, 2026 23:21
@vineelko
vineelko merged commit 5adda3c into OpenDevicePartnership:main Nov 19, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Patina Nov 19, 2026
@makubacki makubacki added semver:minor Pull requests that should increment the release minor version and removed impact:breaking-change Requires integration attention labels Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:security Has a security impact impact:testing Affects testing semver:minor Pull requests that should increment the release minor version type:documentation Improvements or additions to documentation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants