Searched hist:cd1c49636bb948b024fc307d647891371a280155 (Results 1 – 2 of 2) sorted by relevance
/openbmc/phosphor-host-ipmid/include/dbus-sdr/ |
H A D | storagecommands.hpp | diff cd1c49636bb948b024fc307d647891371a280155 Wed Sep 22 14:58:08 CDT 2021 Johnathan Mantey <johnathanx.mantey@intel.com> 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>
|
/openbmc/phosphor-host-ipmid/dbus-sdr/ |
H A D | storagecommands.cpp | diff cd1c49636bb948b024fc307d647891371a280155 Wed Sep 22 14:58:08 CDT 2021 Johnathan Mantey <johnathanx.mantey@intel.com> 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>
|