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
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 newPcdIpmiEnabledthat the host sets viaUEFI_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:
ipmi_si) reads SMBIOS Type 38 (IPMI Device Information).ipmidrv) binds to an ACPI nodeACPI\IPI0001created from a DSDT namespace device.Firmware previously advertised neither, so neither guest OS auto-bound its IPMI driver.
0x01, Base Address0xCA2I/O space, Spec Rev 2.0) fromSmbiosPlatformDxe, gated onPcdIpmiEnabled.\_SB.IPMI(_HID "IPI0001",_IFT= KCS,_SRV= IPMI 2.0,_CRS= I/O0xCA2–0xCA3), conditionally declared via a runtimeICFGflag in the DSDT data blob, mirroring the existing VMBusVCFGpattern.UEFI_CONFIG_FLAGS.IpmiEnabled(host) →PlatformPei/Config.c→PcdSetBoolS(PcdIpmiEnabled)→ consumed bySmbiosPlatformDxe(Type 38) andAcpiPlatformDxe(DSDTICFG).MsvmPkg/Include/BiosInterface.h— addIpmiEnabled : 1toUEFI_CONFIG_FLAGS.MsvmPkg/MsvmPkg.dec,MsvmPkg/MsvmPkgX64.dsc— declarePcdIpmiEnabled(defaultFALSE).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—ICFGfield +If(ICFG>0)IPI0001 device block.MsvmPkg/AcpiPlatformDxe/Dsdt.c,AcpiPlatformDxe.inf— populateIpmiEnabledin the DSDT data blob from the PCD.MsvmX64builds clean (stuart_build).End-to-end on a nested VM with IPMI enabled: guest shows
ACPI\IPI0001\0("Microsoft Generic IPMI Compliant Device"),ipmidrvRunning,Microsoft_IPMIWMI 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.