Skip to content

Initial implementation of supervisor - #1385

Merged
kuqin12 merged 8 commits into
OpenDevicePartnership:feature/supvfrom
kuqin12:supv_init
Jul 18, 2026
Merged

kuqin12 merged 8 commits into
OpenDevicePartnership:feature/supvfrom
kuqin12:supv_init

Conversation

@kuqin12

@kuqin12 kuqin12 commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

This is the initial implementation of MM supervisor and user core in Rust.

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

How This Was Tested

This was tested on QEMU Q35 platform and booted to OS desktop as well as passed supervisor test app.

Integration Instructions

The integration guide is listed in: https://github.com/kuqin12/mu_feature_mm_supv/blob/personal/kuqin/supv_init/SeaPkg/Docs/PlatformIntegration/PlatformIntegrationSteps.md#integraion-guide-for-rust-based-supervisor. Because it provides the implementation of MM supervisor init module.

@patina-automation

patina-automation Bot commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor

QEMU Validation Failed

QEMU validation did not complete successfully or did not shutdown as expected.

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

⚠️ Build Failure Detected

The Setup and Build patina-dxe-core-qemu step failed in the following job(s):

  • Run Patina QEMU Validation / Validate QEMU - Q35 (Linux)
  • Run Patina QEMU Validation / Validate QEMU Q35 (Windows)
  • Run Patina QEMU Validation / Validate QEMU - ArmVirt (Linux)

Build logs are available in the workflow run artifacts:

Download the log artifacts from the workflow run to review the build output and
determine whether the error is expected.

Is this expected? If the PR introduces breaking changes to patina that
require a corresponding update to patina-dxe-core-qemu,
the build failure is expected.

Contact a repo admin or PR reviewer to override the Patina QEMU PR Validation status check.

Job Results

Job Result
Gather Incoming PR Metadata ✅
Run Patina QEMU Validation / Post In-Progress Notification ✅
Run Patina QEMU Validation / Preflight Checks ✅
Run Patina QEMU Validation / Get Constants / Get Repository Constants ✅
Run Patina QEMU Validation / Validate QEMU - Q35 (Linux) ❌
Run Patina QEMU Validation / Validate QEMU Q35 (Windows) ❌
Run Patina QEMU Validation / Validate QEMU - ArmVirt (Linux) ❌
Run Patina QEMU Validation / Emit PR Metadata ✅

Error Details

qemu-validation-logs-Linux-Q35/q35-linux.log (10 error/warning sections)
warning: patch `patina_mm_cpu v22.2.1 (/__w/patina/patina/components/patina_mm_cpu)` was not used in the crate graph

warning: patch `patina_mm_supervisor v22.2.1 (/__w/patina/patina/patina_mm_supervisor)` was not used in the crate graph

warning: patch `patina_mm_user_core v22.2.1 (/__w/patina/patina/patina_mm_user_core)` was not used in the crate graph
help: Check that the patched package version and available features are compatible

warning: patch `patina_mm_cpu v22.2.1 (/__w/patina/patina/components/patina_mm_cpu)` was not used in the crate graph

warning: patch `patina_mm_supervisor v22.2.1 (/__w/patina/patina/patina_mm_supervisor)` was not used in the crate graph

warning: patch `patina_mm_user_core v22.2.1 (/__w/patina/patina/patina_mm_user_core)` was not used in the crate graph
help: Check that the patched package version and available features are compatible

error[E0559]: variant `Uart16550::Io` has no field named `base`
  --> bin/q35_dxe_core.rs:58:21
   |
58 |     Uart16550::Io { base: 0x402 },
   |                     ^^^^ field does not exist
   |
  ::: /__w/patina/patina/sdk/patina/src/serial/uart/uart_16550.rs:21:5
   |
21 |     Io(IoSerialPort),
   |     -- `Uart16550::Io` defined here
   |
help: `Uart16550::Io` is a tuple variant, use the appropriate syntax
   |
58 -     Uart16550::Io { base: 0x402 },
58 +     Uart16550::Io(/* uart_16550::port::SerialPort */),
   |


error[E0559]: variant `Uart16550::Io` has no field named `base`
  --> bin/q35_dxe_core.rs:68:58
   |
68 |     patina_debugger::PatinaDebugger::new(Uart16550::Io { base: 0x3F8 })
   |                                                          ^^^^ field does not exist
   |
  ::: /__w/patina/patina/sdk/patina/src/serial/uart/uart_16550.rs:21:5
   |
21 |     Io(IoSerialPort),
   |     -- `Uart16550::Io` defined here
   |
help: `Uart16550::Io` is a tuple variant, use the appropriate syntax
   |
68 -     patina_debugger::PatinaDebugger::new(Uart16550::Io { base: 0x3F8 })
68 +     patina_debugger::PatinaDebugger::new(Uart16550::Io(/* uart_16550::port::SerialPort */))
   |

For more information about this error, try `rustc --explain E0559`.

error: could not compile `qemu_dxe_core` (bin "qemu_q35_dxe_core") due to 2 previous errors

[cargo-make] ERROR - Error while running duckscript: Source: Unknown Line: 113 - Error while executing command, exit code: 101
qemu-validation-logs-Windows-Q35/q35-windows.log (10 error/warning sections)
warning: patch `patina_mm_cpu v22.2.1 (D:\a\patina\patina\components\patina_mm_cpu)` was not used in the crate graph

warning: patch `patina_mm_supervisor v22.2.1 (D:\a\patina\patina\patina_mm_supervisor)` was not used in the crate graph

warning: patch `patina_mm_user_core v22.2.1 (D:\a\patina\patina\patina_mm_user_core)` was not used in the crate graph
help: Check that the patched package version and available features are compatible

warning: patch `patina_mm_cpu v22.2.1 (D:\a\patina\patina\components\patina_mm_cpu)` was not used in the crate graph

warning: patch `patina_mm_supervisor v22.2.1 (D:\a\patina\patina\patina_mm_supervisor)` was not used in the crate graph

warning: patch `patina_mm_user_core v22.2.1 (D:\a\patina\patina\patina_mm_user_core)` was not used in the crate graph
help: Check that the patched package version and available features are compatible

error[E0559]: variant `Uart16550::Io` has no field named `base`
  --> bin\q35_dxe_core.rs:58:21
   |
58 |     Uart16550::Io { base: 0x402 },
   |                     ^^^^ field does not exist
   |
  ::: D:\a\patina\patina\sdk\patina\src\serial\uart\uart_16550.rs:21:5
   |
21 |     Io(IoSerialPort),
   |     -- `Uart16550::Io` defined here
   |
help: `Uart16550::Io` is a tuple variant, use the appropriate syntax
   |
58 -     Uart16550::Io { base: 0x402 },
58 +     Uart16550::Io(/* uart_16550::port::SerialPort */),
   |


error[E0559]: variant `Uart16550::Io` has no field named `base`
  --> bin\q35_dxe_core.rs:68:58
   |
68 |     patina_debugger::PatinaDebugger::new(Uart16550::Io { base: 0x3F8 })
   |                                                          ^^^^ field does not exist
   |
  ::: D:\a\patina\patina\sdk\patina\src\serial\uart\uart_16550.rs:21:5
   |
21 |     Io(IoSerialPort),
   |     -- `Uart16550::Io` defined here
   |
help: `Uart16550::Io` is a tuple variant, use the appropriate syntax
   |
68 -     patina_debugger::PatinaDebugger::new(Uart16550::Io { base: 0x3F8 })
68 +     patina_debugger::PatinaDebugger::new(Uart16550::Io(/* uart_16550::port::SerialPort */))
   |

For more information about this error, try `rustc --explain E0559`.

error: could not compile `qemu_dxe_core` (bin "qemu_q35_dxe_core") due to 2 previous errors

[cargo-make] ERROR - Error while running duckscript: Source: Unknown Line: 113 - Error while executing command, exit code: 101
qemu-validation-logs-Linux-ArmVirt/armvirt-linux.log (10 error/warning sections)
warning: patch `patina_mm_cpu v22.2.1 (/__w/patina/patina/components/patina_mm_cpu)` was not used in the crate graph

warning: patch `patina_mm_supervisor v22.2.1 (/__w/patina/patina/patina_mm_supervisor)` was not used in the crate graph

warning: patch `patina_mm_user_core v22.2.1 (/__w/patina/patina/patina_mm_user_core)` was not used in the crate graph
help: Check that the patched package version and available features are compatible

warning: patch `patina_mm_cpu v22.2.1 (/__w/patina/patina/components/patina_mm_cpu)` was not used in the crate graph

warning: patch `patina_mm_supervisor v22.2.1 (/__w/patina/patina/patina_mm_supervisor)` was not used in the crate graph

warning: patch `patina_mm_user_core v22.2.1 (/__w/patina/patina/patina_mm_user_core)` was not used in the crate graph
help: Check that the patched package version and available features are compatible

error[E0559]: variant `Uart16550::Io` has no field named `base`
  --> bin/q35_dxe_core.rs:58:21
   |
58 |     Uart16550::Io { base: 0x402 },
   |                     ^^^^ field does not exist
   |
  ::: /__w/patina/patina/sdk/patina/src/serial/uart/uart_16550.rs:21:5
   |
21 |     Io(IoSerialPort),
   |     -- `Uart16550::Io` defined here
   |
help: `Uart16550::Io` is a tuple variant, use the appropriate syntax
   |
58 -     Uart16550::Io { base: 0x402 },
58 +     Uart16550::Io(/* uart_16550::port::SerialPort */),
   |


error[E0559]: variant `Uart16550::Io` has no field named `base`
  --> bin/q35_dxe_core.rs:68:58
   |
68 |     patina_debugger::PatinaDebugger::new(Uart16550::Io { base: 0x3F8 })
   |                                                          ^^^^ field does not exist
   |
  ::: /__w/patina/patina/sdk/patina/src/serial/uart/uart_16550.rs:21:5
   |
21 |     Io(IoSerialPort),
   |     -- `Uart16550::Io` defined here
   |
help: `Uart16550::Io` is a tuple variant, use the appropriate syntax
   |
68 -     patina_debugger::PatinaDebugger::new(Uart16550::Io { base: 0x3F8 })
68 +     patina_debugger::PatinaDebugger::new(Uart16550::Io(/* uart_16550::port::SerialPort */))
   |

For more information about this error, try `rustc --explain E0559`.

error: could not compile `qemu_dxe_core` (bin "qemu_q35_dxe_core") due to 2 previous errors

[cargo-make] ERROR - Error while running duckscript: Source: Unknown Line: 113 - Error while executing command, exit code: 101

Dependencies

Repository Ref
patina 4647501
patina-dxe-core-qemu 423b4ab
patina-fw-patcher 4c7f2e0
patina-qemu firmware v4.0.3
patina-qemu build script a2d247e

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

@github-actions github-actions Bot added the impact:security Has a security impact label Mar 11, 2026
@kuqin12
kuqin12 marked this pull request as draft March 11, 2026 00:33
@kuqin12
kuqin12 changed the base branch from main to feature/supv March 11, 2026 01:15

@Javagedes Javagedes 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.

I'm very concerned about the number of global statics in your implementation. I understand it may actually be necessary to be able to perform our SEA validation on the supervisor.

We need to consolidate the statics if possible. If we cannot (due to SEA validation requirements), then we need to make trait abstractions around each of the different statics so that at runtime they all link up, but for testing you can use mockall to mock the different statics. e.g. something like:

static MY_STATIC: SomeStatic = SomeStatic::new();

trait MyTrait {
    fn interface_fn1();
    fn interface_fn2();
}

impl MyTrait for SomeStatic {
    fn interface_fn1() { MY_STATIC.interface_fn1() }
    fn interface_fn2() { MY_STATIC.interface_fn2() }
}

This will allow us to use mockall with the trait to do proper mocking.

Comment thread patina_mm_user_core/src/protocol_db.rs Resolved
Comment thread sdk/patina/src/timer/mod.rs Resolved
@kuqin12
kuqin12 force-pushed the supv_init branch 2 times, most recently from 8a5c38f to c0baea8 Compare March 16, 2026 21:52
Comment thread patina_mm_supervisor_core/src/lib.rs Resolved
Comment thread patina_mm_supervisor_core/src/lib.rs Resolved
Comment thread patina_mm_supervisor_core/src/lib.rs Resolved
Comment thread patina_mm_supervisor_core/src/lib.rs Resolved
Comment thread patina_mm_user_core/src/lib.rs Resolved
Comment thread patina_mm_user_core/src/lib.rs Resolved
Comment thread patina_mm_user_core/src/protocol_db.rs Resolved
Comment thread sdk/patina/src/timer/mod.rs Resolved
Comment thread components/patina_mm_policy/Cargo.toml Resolved
Comment thread patina_mm_supervisor_core/src/lib.rs Resolved
Comment thread patina_mm_user_core/src/lib.rs Resolved
Comment thread patina_mm_supervisor/src/mm_mem.rs Resolved
Comment thread patina_mm_user_core/src/lib.rs Resolved
@kuqin12
kuqin12 force-pushed the supv_init branch 6 times, most recently from 027814b to 221a7a5 Compare April 15, 2026 09:21
@kuqin12

kuqin12 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

Binary level PR: OpenDevicePartnership/patina-dxe-core-qemu#162

@kuqin12
kuqin12 force-pushed the supv_init branch 4 times, most recently from 85c905c to 910a2e5 Compare June 24, 2026 09:26
@codecov

codecov Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

@kuqin12
kuqin12 force-pushed the supv_init branch 7 times, most recently from d3a06ea to e2422b8 Compare July 1, 2026 05:55
@kuqin12
kuqin12 force-pushed the supv_init branch 5 times, most recently from 835d150 to 70755dd Compare July 17, 2026 19:46
kuqin12 and others added 3 commits July 17, 2026 15:31
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
@kuqin12
kuqin12 marked this pull request as ready for review July 17, 2026 22:39
kuqin12 and others added 5 commits July 17, 2026 17:09
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
Co-authored-by: Vineel Kovvuri[MSFT] <vineelko@microsoft.com>
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
@kuqin12
kuqin12 merged commit c93395e into OpenDevicePartnership:feature/supv Jul 18, 2026
9 of 11 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants