Skip to content

Merged PR 16154870: MsvmPkg: Advertise emulated IPMI/SEL BMC to the guest (SMBIOS Type 38 + ACPI IPI0001), gated on PcdIpmiEnabled - #97

Open
Maheer Aeron (maheeraeron) wants to merge 1 commit into
microsoft:mainfrom
maheeraeron:user/maheeraeron/virtio-blk
Open

Merged PR 16154870: MsvmPkg: Advertise emulated IPMI/SEL BMC to the guest (SMBIOS Type 38 + ACPI IPI0001), gated on PcdIpmiEnabled#97
Maheer Aeron (maheeraeron) wants to merge 1 commit into
microsoft:mainfrom
maheeraeron:user/maheeraeron/virtio-blk

Conversation

@maheeraeron

@maheeraeron Maheer Aeron (maheeraeron) commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Advertise the emulated IPMI BMC (implemented in the HCL paravisor, KCS interface at I/O ports 0xCA2/0xCA3) to the guest OS so it can discover and bind to it. Two discovery mechanisms are added, both gated on a new PcdIpmiEnabled that the host sets via UEFI_CONFIG_FLAGS.IpmiEnabled. Default is off (FALSE) — no behavior change unless the host enables IPMI.

The BMC/SEL emulator lives in the LegacyHCL/OpenHCL paravisor; the guest records System Event Log (SEL) entries over KCS, which the host logs for UVM diagnosability. The two guest OSes discover an IPMI BMC differently:

  • Linux (ipmi_si) reads SMBIOS Type 38 (IPMI Device Information).
  • Windows (ipmidrv) binds to an ACPI node ACPI\IPI0001 created from a DSDT namespace device.

Firmware previously advertised neither, so neither guest OS auto-bound its IPMI driver.

  1. SMBIOS Type 38 — emit an IPMI Device Information structure (Interface Type = KCS 0x01, Base Address 0xCA2 I/O space, Spec Rev 2.0) from SmbiosPlatformDxe, gated on PcdIpmiEnabled.
  2. ACPI IPI0001 — add a DSDT device \_SB.IPMI (_HID "IPI0001", _IFT = KCS, _SRV = IPMI 2.0, _CRS = I/O 0xCA20xCA3), conditionally declared via a runtime ICFG flag in the DSDT data blob, mirroring the existing VMBus VCFG pattern.

UEFI_CONFIG_FLAGS.IpmiEnabled (host) → PlatformPei/Config.cPcdSetBoolS(PcdIpmiEnabled) → consumed by SmbiosPlatformDxe (Type 38) and AcpiPlatformDxe (DSDT ICFG).

  • MsvmPkg/Include/BiosInterface.h — add IpmiEnabled : 1 to UEFI_CONFIG_FLAGS.

  • MsvmPkg/MsvmPkg.dec, MsvmPkg/MsvmPkgX64.dsc — declare PcdIpmiEnabled (default FALSE).

  • MsvmPkg/PlatformPei/Config.c, PlatformPei/PlatformPei.inf — map the config flag → PCD (PEI sets it).

  • MsvmPkg/SmbiosPlatformDxe/SmbiosPlatform.c, SmbiosPlatformDxe.infAddIpmiDeviceInformation() (Type 38); consumes PCD.

  • MsvmPkg/AcpiTables/Dsdt.aslICFG field + If(ICFG>0) IPI0001 device block.

  • MsvmPkg/AcpiPlatformDxe/Dsdt.c, AcpiPlatformDxe.inf — populate IpmiEnabled in the DSDT data blob from the PCD.

  • MsvmX64 builds clean (stuart_build).

  • End-to-end on a nested VM with IPMI enabled: guest shows ACPI\IPI0001\0 ("Microsoft Generic IPMI Compliant Device"), ipmidrv Running, Microsoft_IPMI WMI present; SMBIOS scan shows Type 38. Get Device ID and Add SEL Entry succeed over KCS, and SEL entries reach the host ETW provider.

  • With PcdIpmiEnabled=FALSE (default): neither structure is emitted — no behavior change.

…uest (SMBIOS Type 38 + ACPI IPI0001), gated on PcdIpmiEnabled

Advertise the emulated IPMI BMC (implemented in the HCL paravisor, KCS interface at
I/O ports `0xCA2`/`0xCA3`) to the guest OS so it can discover and bind to it. Two
discovery mechanisms are added, both gated on a new `PcdIpmiEnabled` that the host sets
via `UEFI_CONFIG_FLAGS.IpmiEnabled`. Default is **off** (`FALSE`) — no behavior change
unless the host enables IPMI.

📄 **Architecture:** [Arch: IPMI/SEL LegacyHCL](https://microsoft.sharepoint.com/:fl:/s/a363cb82-c5cc-491f-a46b-8212ce6d7288/IQCescwvmOvSSYU11NT9Z3eOAf-MEoE8Z3HiB0yscIXPNr8?e=cNj8KF)

> Paired with the [**OS Repo Legacy HCL** PR](https://microsoft.visualstudio.com/OS/_git/os.2020/pullrequest/15989323).
> Please review the two draft PRs together..

The BMC/SEL emulator lives in the LegacyHCL/OpenHCL paravisor; the guest records System
Event Log (SEL) entries over KCS, which the host logs for UVM diagnosability. The two
guest OSes discover an IPMI BMC differently:
- **Linux** (`ipmi_si`) reads **SMBIOS Type 38** (IPMI Device Information).
- **Windows** (`ipmidrv`) binds to an **ACPI** node `ACPI\IPI0001` created from a DSDT
  namespace device.

Firmware previously advertised neither, so neither guest OS auto-bound its IPMI driver.

1. **SMBIOS Type 38** — emit an IPMI Device Information structure (Interface Type = KCS
   `0x01`, Base Address `0xCA2` I/O space, Spec Rev 2.0) from `SmbiosPlatformDxe`, gated
   on `PcdIpmiEnabled`.
2. **ACPI IPI0001** — add a DSDT device `\_SB.IPMI` (`_HID "IPI0001"`, `_IFT` = KCS,
   `_SRV` = IPMI 2.0, `_CRS` = I/O `0xCA2`–`0xCA3`), conditionally declared via a runtime
   `ICFG` flag in the DSDT data blob, mirroring the existing VMBus `VCFG` pattern.

`UEFI_CONFIG_FLAGS.IpmiEnabled` (host) → `PlatformPei/Config.c` →
`PcdSetBoolS(PcdIpmiEnabled)` → consumed by `SmbiosPlatformDxe` (Type 38) and
`AcpiPlatformDxe` (DSDT `ICFG`).

- `MsvmPkg/Include/BiosInterface.h` — add `IpmiEnabled : 1` to `UEFI_CONFIG_FLAGS`.
- `MsvmPkg/MsvmPkg.dec`, `MsvmPkg/MsvmPkgX64.dsc` — declare `PcdIpmiEnabled` (default `FALSE`).
- `MsvmPkg/PlatformPei/Config.c`, `PlatformPei/PlatformPei.inf` — map the config flag → PCD (PEI sets it).
- `MsvmPkg/SmbiosPlatformDxe/SmbiosPlatform.c`, `SmbiosPlatformDxe.inf` — `AddIpmiDeviceInformation()` (Type 38); consumes PCD.
- `MsvmPkg/AcpiTables/Dsdt.asl` — `ICFG` field + `If(ICFG>0)` IPI0001 device block.
- `MsvmPkg/AcpiPlatformDxe/Dsdt.c`, `AcpiPlatformDxe.inf` — populate `IpmiEnabled` in the DSDT data blob from the PCD.

- `MsvmX64` builds clean (`stuart_build`).
- End-to-end on a nested VM with IPMI enabled: guest shows `ACPI\IPI0001\0` ("Microsoft
  Generic IPMI Compliant Device"), `ipmidrv` Running, `Microsoft_IPMI` WMI present; SMBIOS
  scan shows Type 38. Get Device ID and Add SEL Entry succeed over KCS, and SEL entries
  reach the host ETW provider.
- With `PcdIpmiEnabled=FALSE` (default): neither structure is emitted — no behavior change.
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