commit | cd1c49636bb948b024fc307d647891371a280155 | [log] [tgz] |
---|---|---|
author | Johnathan Mantey <johnathanx.mantey@intel.com> | Wed Sep 22 12:58:08 2021 -0700 |
committer | Willy Tu <wltu@google.com> | Tue Mar 15 23:24:24 2022 +0000 |
tree | 38a7656dd4ce8abd8977c6b5e6a3a9e51919194b | |
parent | 5295cefb5fc27e274af92d4ecad56e7e0d6b4e88 [diff] |
Guarantee SDR Type12 byte alignment matches the IPMI spec The Type12 structure used a uint24_t to assign storage for 3 reserved bytes in the Type12 SDR definition. This turned out to be an issue as the compiler promoted the uint24_t to a uint32_t, which added one additional byte to the structure. This in turn pushed the trailing bytes out of alignment. The defintion has been changed to use an explicit uint8_t array that is three bytes in size. This defines the structure in a way that guarantees the size of the record is correct. The structure has also had a constructor added to it to eliminate code duplication, and to reduce the likelihood of errors caused by manual calculation of values. Tested: Issued 'ipmitool sdr dump /tmp/sdrs.bin' Performed a hex dump on the binary data and reviewed the Type12 records. Confirmed all fields were correctly assigned, including the inclusion of only 3 reserved bytes. Ported From: https://gerrit.openbmc-project.xyz/c/openbmc/intel-ipmi-oem/+/47117 Change-Id: I3fef5a1fe67877e5a6cf6e7928c5f15599bfb6f6 Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com> Signed-off-by: Willy Tu <wltu@google.com>
To build this package, do the following steps:
1. ./bootstrap.sh 2. ./configure ${CONFIGURE_FLAGS} 3. make
To clean the repository run ./bootstrap.sh clean
.