[Feature]: Support MMI handler profile (MMI handler audit) for the Rust MM supervisor

Open
#2,039 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
28/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
embedded-iot

Research direction

Read the user core MmiDatabase and MmDispatcher paths, the supervisor’s PlatformInfo::mmi_handlers() interface, and SmiHandlerProfile.h to understand the profile format. Implement registration tracking and the GET_INFO / GET_DATA_BY_OFFSET response across the user core and supervisor, then verify the existing MmiHandlerProfileAuditTestApp receives the image and handler records; the issue also calls for platform enablement, a regenerated golden copy, and removal of the Ruacana skip.

Written by the indexing model from the issue text.

Description

state:backlog state:needs-triage type:feature-request urgency:medium
Feature Overview
Feature Overview

The C MM supervisor supports the SMI handler profile (gSmiHandlerProfileGuid). At MM Ready To Lock, it records every loaded MM image and every root, GUID and hardware MMI handler, together with the image that owns each handler, the caller address and the registration context. A shell app (MmiHandlerProfileAuditTestApp) reads this database through the supervisor communication channel with GET_INFO / GET_DATA_BY_OFFSET. Test automation compares the result with a per-platform golden copy, so it catches MM images, or MMI entry points per image, being added or removed.

The Rust supervisor and user core don't implement this, so the audit returns no data on Rust supervisor platforms. This requests the Rust counterpart, so the MMI handler audit can be re-enabled.

Urgency

Medium

Are you going to implement the feature request?

I will implement the feature

Do you need maintainer feedback?

Maintainer feedback requested

Anything else?

N/A

Solution Overview
Solution Overview

Add SMI handler profile support across the Rust user core and supervisor, so the existing MmiHandlerProfileAuditTestApp works unchanged:

  • User core (patina_mm_user_core)
    • Record the owning image and caller address for each MMI handler registration in MmiDatabase, matching the handler address against the MmDispatcher image list.
    • Install SMI_HANDLER_PROFILE_PROTOCOL, so SMI child dispatchers (SW, Sx, power/standby button, periodic timer, GPI, IO trap, USB) can report hardware handlers with their contexts through RegisterHandler / UnregisterHandler.
    • At MM Ready To Lock, build a read-only snapshot in the SmiHandlerProfile.h format: 'SCID' image records and 'SCSD' handler-list records.
  • Supervisor (patina_mm_supervisor)
    • Serve gSmiHandlerProfileGuid requests (GET_INFO, GET_DATA_BY_OFFSET) on the supervisor channel. This could be an optional SupervisorMmiHandler that a platform adds through PlatformInfo::mmi_handlers().
    • Validate the comm buffer and the target data buffer, which must lie outside MMRAM with no overflow.
  • Consumers
    • Enable it in the upcoming Patina platform crate (sea_release patina_mm_intel) for DEBUG builds.
    • Regenerate the MmiProfilerGoldenCopy.xml from a Rust supervisor build.
    • Remove the Rust supervisor skip from Ruacana MmiHandlerAudit.ps1.
Alternatives Considered
  • Keep skipping the audit on Rust supervisor builds. This is the current state, but it loses coverage of the MM attack surface.
  • Serve the profile entirely from the supervisor. The supervisor doesn't own the MMI handler database or the dispatcher registrations, which live in the Ring 3 user core, so it would need user core cooperation anyway.
Alternatives Considered

No response

Urgency

Medium

Are you going to implement the feature request?

I will implement the feature

Do you need maintainer feedback?

Maintainer feedback requested

Anything else?

No response

Dominant language
Rust
Stars
568
Forks
63
Avg merge
1d 16h
Merged PRs (30d)
60

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenDevicePartnership/patina

All issues in OpenDevicePartnership/patina

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.