Patina Management Mode (MM) Component Crate
Patina MM provides Management Mode (MM) integration for Patina-based firmware. It focuses on safe MM communication, deterministic MMI handling, and platform hooks that enable Patina components to interact with existing MM handlers without relying on C implementations.
Capabilities
- Produces the
MmCommunicationservice for dispatching requests to MM handlers through validated communicate buffers. - Defines the
SwMmiTriggerservice to raise software MM interrupts using platform-configured ports. - Supports optional
PlatformMmControlhooks so platforms can run preparatory MM initialization before MM communication becomes available. - Maintains page-aligned communicate buffers with explicit recipient tracking and length verification to detect corruption before and after MM execution.
- Emits focused log output to the
mm_commandsw_mmitargets. Information is detailed to aid in common debug like inspecting buffer setup, interrupt triggering details, and MM handler response.
Components and services
- MmCommunicator component: Consumes locked MM configuration, registers the
MmCommunicationservice, and coordinates MM execution through a swappable executor abstraction that enables in-depth host-based testing. - SwMmiManager component: Consumes the same configuration, registers the
SwMmiTriggerservice, and optionally invokesPlatformMmControlbefore exposing MM interrupt capabilities. - PlatformMmControl service (optional): Lets platforms implement platform-specific logic to prepare for MM interrupts.
Configuration
The crate defines MmCommunicationConfiguration as the shared configuration structure. Platforms populate it with:
- ACPI base information so the trigger service can manipulate ACPI fixed hardware registers.
- Command and data port definitions using typed
MmiPortwrappers (SMI or SMC). - A list of
CommunicateBufferentries that remain page-aligned, zeroed, and tracked by identifier for MM message exchange.
The configuration enforces buffer validation, including alignment, bounds checking, and consistency between tracked metadata and buffer contents.
Integration guidance
- Register
MmCommunicationConfigurationto set platform-specific MM parameters. - Add
SwMmiManagerso the software MMI trigger service can be produced for other Patina components to consume. - Add
MmCommunicatorto expose theMmCommunicationservice to other Patina components. - Provide a
PlatformMmControlimplementation when the platform needs to clear or program hardware state before MM interrupts are triggered.