1*f167b6d2SEd Tanous# CPER records - CPER 2*f167b6d2SEd Tanous 3*f167b6d2SEd TanousAuthor: Ed Tanous - edtanous 4*f167b6d2SEd Tanous 5*f167b6d2SEd TanousCreated: 5-22-2024 6*f167b6d2SEd Tanous 7*f167b6d2SEd Tanous## Problem Description 8*f167b6d2SEd Tanous 9*f167b6d2SEd TanousServer CPUs expose a managability interface refered to as CPER records. A user 10*f167b6d2SEd Tanousoutside of the BMC would like to read these records in a decoded state, rather 11*f167b6d2SEd Tanousthan as a raw package. 12*f167b6d2SEd Tanous 13*f167b6d2SEd Tanous## Background and References 14*f167b6d2SEd Tanous 15*f167b6d2SEd TanousCPER stands for Common Platform Error Record and is defined as an industry 16*f167b6d2SEd Tanousstandard in the [UEFI Specification][uefi_spec], with CPU ISA specific 17*f167b6d2SEd Tanousdefinitions for aarch64, x64, Itanium, and IA32. Within this document there are 18*f167b6d2SEd Tanousseveral architecture definitions for BMC, including section C.2.2 RAS IPMI 19*f167b6d2SEd TanousMessage Format, and IPMI based RAS Event Receiver. 20*f167b6d2SEd Tanous 21*f167b6d2SEd TanousIn Redfish specification drop 2021.3, Redfish added support for CPER records 22*f167b6d2SEd Tanousinto the [LogEntry resource][logentry]. These expose a section by section 23*f167b6d2SEd Tanousdecoded CPER instance. In addition to Redfish, there is a proposed DMTF 24*f167b6d2SEd Tanousinterface for sending CPER log events to the BMC using [MCTP/PLDM][cperevent], 25*f167b6d2SEd Tanouswhich is proposed to be added in a future version of DMTF [DSP0248]. 26*f167b6d2SEd Tanous 27*f167b6d2SEd TanousARM has developed a reference library for decoding CPER records that does not 28*f167b6d2SEd Tanoushave a contribution mechanism, releases, or maintenance, and they have made 29*f167b6d2SEd Tanous[clear][cper_examples] that they would like OpenBMC to be the long-term 30*f167b6d2SEd Tanouscustodian of this library. 31*f167b6d2SEd Tanous 32*f167b6d2SEd TanousThis library hosts the meson-dev branch, which was added for the purpose of this 33*f167b6d2SEd Tanousdesign, and passes the OpenBMC CI tests currently. This is the proposed branch 34*f167b6d2SEd Tanousthat will be pushed to openbmc/libcper, if approved. 35*f167b6d2SEd Tanous 36*f167b6d2SEd Tanous## Requirements 37*f167b6d2SEd Tanous 38*f167b6d2SEd Tanous- A BMC should be able to decode binary CPER records originated from a CPER 39*f167b6d2SEd Tanous compatible CPU. 40*f167b6d2SEd Tanous 41*f167b6d2SEd Tanous- BMC should be able to recieve and decode CPER records from a CPU per the [CPER 42*f167b6d2SEd Tanous specification][arm_sbmr]. 43*f167b6d2SEd Tanous 44*f167b6d2SEd Tanous- A BIOS/EDK2 build should be able to share decoding code with OpenBMC, to the 45*f167b6d2SEd Tanous end that added records do not require manual effort to implement in each 46*f167b6d2SEd Tanous codebase. 47*f167b6d2SEd Tanous 48*f167b6d2SEd Tanous- A CPU vendor should be able to add support for CPER extensions that OpenBMC 49*f167b6d2SEd Tanous will now be able to decode, without impacting users of other vendors, as 50*f167b6d2SEd Tanous promised in the CPER specification. 51*f167b6d2SEd Tanous 52*f167b6d2SEd Tanous- CPER decoder should allow decoding of multiple CPU complexes. 53*f167b6d2SEd Tanous 54*f167b6d2SEd Tanous## Proposed Design 55*f167b6d2SEd Tanous 56*f167b6d2SEd TanousWhile this design fits into a much more elaborate design alluded to in the 57*f167b6d2SEd Tanousaformentioned ARM document, this document only requests the first step, creating 58*f167b6d2SEd Tanousa shared library implementation within the OpenBMC organization that can be 59*f167b6d2SEd Tanousbuilt upon over time, but might not implement the complete implementation at 60*f167b6d2SEd Tanousthis time. It is expected that the ubiquity of CPER records in the BMC ecosystem 61*f167b6d2SEd Tanousjustifies the creation of the repository, even if the initial implementation 62*f167b6d2SEd Tanousmight not meet all design goals for all contributors, having a common 63*f167b6d2SEd Tanouscontribution model, CI testing, and license is beneficial as a whole. 64*f167b6d2SEd Tanous 65*f167b6d2SEd TanousFuture design docs (or amendments to this design) will iterate on implementing 66*f167b6d2SEd Tanousmore of the design referenced in this [CPER specification][arm_sbmr], for common 67*f167b6d2SEd TanousARM platforms, but getting the custody transferred for the libcper repo, getting 68*f167b6d2SEd Tanousthe quality up to standards is the initial goal of this design. 69*f167b6d2SEd Tanous 70*f167b6d2SEd Tanous## Alternatives Considered 71*f167b6d2SEd Tanous 72*f167b6d2SEd TanousRewrite libcper decoding from a new design point. While this is certainly 73*f167b6d2SEd Tanouspossible given the small size of the libcper repo as it exists today, it would 74*f167b6d2SEd Tanousbifurcate already existing implementations of the decode. 75*f167b6d2SEd Tanous 76*f167b6d2SEd Tanous## Impacts 77*f167b6d2SEd Tanous 78*f167b6d2SEd TanousNew repo will be created within the organization. New recipe will be added to 79*f167b6d2SEd TanousOpenBMC. 80*f167b6d2SEd Tanous 81*f167b6d2SEd Tanous### Organizational 82*f167b6d2SEd Tanous 83*f167b6d2SEd Tanous- Does this repository require a new repository? Yes 84*f167b6d2SEd Tanous- Who will be the initial maintainer(s) of this repository? Ed Tanous 85*f167b6d2SEd Tanous- Which repositories are expected to be modified to execute this design? 86*f167b6d2SEd Tanous 87*f167b6d2SEd Tanous - openbmc/openbmc 88*f167b6d2SEd Tanous - openbmc/libcper 89*f167b6d2SEd Tanous 90*f167b6d2SEd Tanous#### Potentionally in the future 91*f167b6d2SEd Tanous 92*f167b6d2SEd Tanous- openbmc/phosphor-debug-collector 93*f167b6d2SEd Tanous- openbmc/bmcweb 94*f167b6d2SEd Tanous- openbmc/phosphor-logging 95*f167b6d2SEd Tanous 96*f167b6d2SEd Tanous## Testing 97*f167b6d2SEd Tanous 98*f167b6d2SEd TanousUnit tests are already present in the repo to verify basic functionality. 99*f167b6d2SEd TanousCPU-model specific error generators will be used to simulate the full path, once 100*f167b6d2SEd Tanousdesign is complete. 101*f167b6d2SEd Tanous 102*f167b6d2SEd Tanous[arm_sbmr]: https://developer.arm.com/documentation/den0069/latest/ 103*f167b6d2SEd Tanous[uefi_spec]: https://uefi.org/specifications 104*f167b6d2SEd Tanous[logentry]: 105*f167b6d2SEd Tanous https://github.com/DMTF/Redfish-Publications/blob/5b217908b5378b24e4f390c063427d7a707cd308/csdl/LogEntry_v1.xml#L1403 106*f167b6d2SEd Tanous[cperevent]: 107*f167b6d2SEd Tanous https://www.dmtf.org/sites/default/files/PMCI_CPEREvent_Proposal_v3.pdf 108*f167b6d2SEd Tanous[DSP0248]: https://www.dmtf.org/dsp/DSP0248 109*f167b6d2SEd Tanous[cper_examples]: 110*f167b6d2SEd Tanous https://gitlab.arm.com/server_management/libcper/-/blob/b8b687c2e05846afd37b60222a0b4253acda81fd/README.md#usage-examples 111