387b10f6 | 24-Sep-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
platform: fix encode/decode_poll_for_platform_event_message_req
The checking `TransferOperationFlag` and `eventIDToAcknowledge` in `encode/decode_poll_for_platform_event_message_req` APIs is not cor
platform: fix encode/decode_poll_for_platform_event_message_req
The checking `TransferOperationFlag` and `eventIDToAcknowledge` in `encode/decode_poll_for_platform_event_message_req` APIs is not corrected. Update the conditions to follow the section `16.7 PollForPlatformEventMessage command` in DSP0248 V1.3.0.
Change-Id: Ie799d38f4a492b7719c2ff7c14fe83a1f81dc0b1 Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
show more ...
|
d0ba43af | 09-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
clang-tidy: Enable cppcoreguidelines-pro-type-reinterpret-cast
There are ways to avoid reinterpret_cast<>() in many circumstances. For libpldm, often its use can be replaced with placement-new. Enab
clang-tidy: Enable cppcoreguidelines-pro-type-reinterpret-cast
There are ways to avoid reinterpret_cast<>() in many circumstances. For libpldm, often its use can be replaced with placement-new. Enable the lint for reinterpret_cast<>() to prevent its use in future changes. This way we can stay inside the language rather than rely on implementation-defined behavior.
Existing uses of reinterpret_cast<>() are marked NOLINT for now, with the intent that we clean them up over time. The insertion of the NOLINTs was automated with sed.
Change-Id: If6654f774e438de9262fe9f9012c6b574764c326 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
7a3c14ec | 08-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
base: Add size and buffer macros for struct pldm_msg
Give library users a supported way to allocate pldm_msg buffers on the stack.
A demonstration conversion is done in tests/oem/ibm/host.cpp.
Cha
base: Add size and buffer macros for struct pldm_msg
Give library users a supported way to allocate pldm_msg buffers on the stack.
A demonstration conversion is done in tests/oem/ibm/host.cpp.
Change-Id: I71158bd6b062c6e6522dc4a4cdcb089a139cd841 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
ea0bf3a8 | 19-Sep-2024 |
Lora Lin <lora.lin.wiwynn@gmail.com> |
oem: meta: Stabilise decode/encode file IO API
Stabilise decode_oem_meta_file_io_write_req() API Stabilise decode_oem_meta_file_io_read_req() API Stabilise encode_oem_meta_file_io_read_resp() API
S
oem: meta: Stabilise decode/encode file IO API
Stabilise decode_oem_meta_file_io_write_req() API Stabilise decode_oem_meta_file_io_read_req() API Stabilise encode_oem_meta_file_io_read_resp() API
See usage example at: [1] https://gerrit.openbmc.org/c/openbmc/pldm/+/71889/10/oem/meta/libpldmresponder/oem_meta_file_io.cpp#59 [2] https://gerrit.openbmc.org/c/openbmc/pldm/+/71889/10/oem/meta/libpldmresponder/oem_meta_file_io.cpp#89 [3] https://gerrit.openbmc.org/c/openbmc/pldm/+/71889/10/oem/meta/libpldmresponder/oem_meta_file_io.cpp#143
Change-Id: I8bc38e4fad7ad18dc7ab5062fab14cdd11fe9aef Signed-off-by: Lora Lin <lora.lin.wiwynn@gmail.com>
show more ...
|
60582150 | 22-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: pdr: Add pldm_entity_association_tree_copy_root_check()
Allocations cannot be treated as infallible. Ensure that copying the entity association tree signals failure to the caller along with cle
dsp: pdr: Add pldm_entity_association_tree_copy_root_check()
Allocations cannot be treated as infallible. Ensure that copying the entity association tree signals failure to the caller along with cleaning up after itself to avoid leaking memory.
Change-Id: Icfd255b45530e42a6a3a0a3205e665eed53708d1 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
3b5ab929 | 22-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: bios_table: Null check for pldm_bios_table_iter_is_end()
GCC's -fanalyzer identified the following:
``` In file included from ../tests/dsp/bios_table_iter.c:15: ../src/dsp/bios_table.c: In fun
dsp: bios_table: Null check for pldm_bios_table_iter_is_end()
GCC's -fanalyzer identified the following:
``` In file included from ../tests/dsp/bios_table_iter.c:15: ../src/dsp/bios_table.c: In function ‘pldm_bios_table_iter_is_end’: ../src/dsp/bios_table.c:991:17: error: dereference of NULL ‘iter’ [CWE-476] [-Werror=analyzer-null-dereference] 991 | if (iter->table_len - iter->current_pos <= pad_and_check_max) { | ~~~~^~~~~~~~~~~ ```
As a safety measure, return true to indicate the end of the iterator if the iterator is null.
Fixes: 9c76679224cf ("libpldm: Migrate to subproject") Change-Id: I18eec144120054de33eb351f9a80dee936118126 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
8b53ad9d | 15-Jun-2024 |
Varsha Kaverappa <vkaverap@in.ibm.com> |
pdr: Remove PDR record by record set identifier
API to remove a record from a PLDM PDR repository if it is of type FRU record set identifier and if it matches given record set identifier. Record han
pdr: Remove PDR record by record set identifier
API to remove a record from a PLDM PDR repository if it is of type FRU record set identifier and if it matches given record set identifier. Record handle of the PDR where this entity is found is saved and will be required to update PDR repo by removing the entry corresponding to this entity in the PDR table. Also the Node associated with this pldm entity is deleted from PDR tree.
Change-Id: I24606c4d75ff64864f4aa95d8b2341b8911a7ff8 Signed-off-by: Varsha Kaverappa <vkaverap@in.ibm.com>
show more ...
|
b31e4c6c | 25-Jun-2024 |
Varsha Kaverappa <vkaverap@in.ibm.com> |
pdr: Remove contained entity from PDR repo
API to remove a contained entity from an entity association PDR. This API saves record handle of the PLDM PDR record where the contained entity is found. T
pdr: Remove contained entity from PDR repo
API to remove a contained entity from an entity association PDR. This API saves record handle of the PLDM PDR record where the contained entity is found. The record handle we get from this API will be required to update PDR repo by removing the entry corresponding to this entity in the PDR table. Also the Node associated with this pldm entity is deleted from PDR tree. The PLDM PDR record which holds the contained entity to be removed is found with the parent entity properties sent to this API as input.
Tested By: Unit tested by removing entities from PDR repo
Change-Id: I55fb898a0e67d8c9cd95594b4ec6a6a4866c9531 Signed-off-by: Varsha Kaverappa <vkaverap@in.ibm.com>
show more ...
|
7939382f | 07-Aug-2024 |
Varsha Kaverappa <vkaverap@in.ibm.com> |
msgbuf: Allow pldm_msgbuf_span_required to accept NULL
Allow pldm_msgbuf_span_required to accept NULL as an argument so we can use this API to skip past data in the msg buffer which is not required
msgbuf: Allow pldm_msgbuf_span_required to accept NULL
Allow pldm_msgbuf_span_required to accept NULL as an argument so we can use this API to skip past data in the msg buffer which is not required and extract only the relevant data.
Change-Id: I08d233b8efe415732fb7c01c00a9925f04666fe2 Signed-off-by: Varsha Kaverappa <vkaverap@in.ibm.com>
show more ...
|
6476c968 | 26-Jul-2024 |
Lora Lin <lora.lin.wiwynn@gmail.com> |
oem: meta: Add encode_oem_meta_file_io_read_resp()
Add encode_oem_meta_file_io_read_resp function
This function is used to encode the message of reading file IO. Assemble responses to read file IO
oem: meta: Add encode_oem_meta_file_io_read_resp()
Add encode_oem_meta_file_io_read_resp function
This function is used to encode the message of reading file IO. Assemble responses to read file IO messages, but the response content other than the completion code needs to be additionally appended.
Change-Id: Ib030ac9f37fe73b66fb762dcf8b8297bce79836a Signed-off-by: Lora Lin <lora.lin.wiwynn@gmail.com>
show more ...
|
893a08f0 | 16-Jul-2024 |
Lora Lin <lora.lin.wiwynn@gmail.com> |
oem: meta: Add decode_oem_meta_file_io_read_req()
Add decode_oem_meta_file_io_read_req function.
This function is used to decode the message of reading file IO. Need to include read_option (read fi
oem: meta: Add decode_oem_meta_file_io_read_req()
Add decode_oem_meta_file_io_read_req function.
This function is used to decode the message of reading file IO. Need to include read_option (read file attributes or data), length (the length of the read data) and read_info (The information needed to read the file). Take reading file data as an example: read_info needs to contain transferFlag, offset to know the starting position and transfer progress of the read file.
Change-Id: I425476d36e3cd69d2da45beceff1c4a2362640dc Signed-off-by: Lora Lin <lora.lin.wiwynn@gmail.com>
show more ...
|
84213eba | 21-Jul-2024 |
Lora Lin <lora.lin.wiwynn@gmail.com> |
tests: oem: meta: Convert to new API
Switching the test suite after the new API is introduced demonstrates that the existing API behaved as before at the time of merging the change.
Change-Id: I6d7
tests: oem: meta: Convert to new API
Switching the test suite after the new API is introduced demonstrates that the existing API behaved as before at the time of merging the change.
Change-Id: I6d7576bb8e8ad4f28e90b3b5f81e0f063a5496d4 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au> Signed-off-by: Lora Lin <lora.lin.wiwynn@gmail.com>
show more ...
|
f309c48d | 07-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
pdr: Remove pldm_pdr_add_check()
Deprecated prior to v0.9.0.
Change-Id: Ib53d20bfee6365429db56bc2420b2d294d5464b4 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au> |
e984a461 | 07-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
meson: Format build files with `meson format`
Additionally, add the formatting command to `scripts/pre-submit` so it's run by OpenBMC's CI (via `scripts/run-ci`).
Change-Id: Ifb8fc06106b8cfa9155e98
meson: Format build files with `meson format`
Additionally, add the formatting command to `scripts/pre-submit` so it's run by OpenBMC's CI (via `scripts/run-ci`).
Change-Id: Ifb8fc06106b8cfa9155e986528b769a5ca450b4c Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
3559aa1f | 28-Aug-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
platform: Stabilise decode_pldm_platform_cper_event API
See usage example at: [1] https://gerrit.openbmc.org/c/openbmc/pldm/+/63028/86/platform-mc/event_manager.cpp#77
Change-Id: I43c5c807f10ac38ee
platform: Stabilise decode_pldm_platform_cper_event API
See usage example at: [1] https://gerrit.openbmc.org/c/openbmc/pldm/+/63028/86/platform-mc/event_manager.cpp#77
Change-Id: I43c5c807f10ac38ee893e65a9d75fca76312d188 Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
show more ...
|
90bbe6c0 | 01-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
compiler: Provide LIBPLDM_CC_NONNULL{,_ARGS()}
This allows us to elide checks where they're not necessary, and warn people at compile-time when they're doing things they shouldn't.
Note that this c
compiler: Provide LIBPLDM_CC_NONNULL{,_ARGS()}
This allows us to elide checks where they're not necessary, and warn people at compile-time when they're doing things they shouldn't.
Note that this comes with an apparent ABI break. abi-compliance-checker reports:
``` platform.h, libpldm.so.0.8.0 [−] decode_sensor_op_data ( uint8_t const* sensor_data, size_t sensor_data_length, uint8_t* present_op_state, uint8_t* previous_op_state ) Change: The parameter previous_op_state became passed in r8 register instead of rcx. Effect Applications will read the wrong memory block instead of the parameter value. ```
It's unclear to me why. The signature hasn't changed, but how the implementation tests the parameter values has.
Change-Id: Ie8d8bc1641280522532d9b4764bf07c64b1921c8 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
0a1be3cb | 11-Aug-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
msgbuf: Harden pldm_msgbuf_{insert,extract}_array()
Review of some proposed APIs suggested that correct use of the pldm_msgbuf_{insert,extract}_array() helpers was more difficult that it should be.
msgbuf: Harden pldm_msgbuf_{insert,extract}_array()
Review of some proposed APIs suggested that correct use of the pldm_msgbuf_{insert,extract}_array() helpers was more difficult that it should be. In the three-parameter form, it was too tempting to provide the length to extract as parsed out of a PLDM message. The intended use was that the length parameter represented the length of the user-provided data buffer.
Instead, move to a four-parameter form, provide reasonable documentation for how these APIs should be used, fix all the call-sites, and deprecate some existing unsafe APIs.
Change-Id: If58e5574600e80b354f383554283c4eda5d7234c Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
02903038 | 03-Sep-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
platform: Remove `_data` suffix from `cper_event` decode API
Rename `decode_pldm_platform_cper_event_data` to `decode_pldm_platform_cper_event` as the API does not decode the CPER data, it decodes t
platform: Remove `_data` suffix from `cper_event` decode API
Rename `decode_pldm_platform_cper_event_data` to `decode_pldm_platform_cper_event` as the API does not decode the CPER data, it decodes the event message.
Change-Id: I0937f043e4d3836f20733f78ea3f5970da6585d5 Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
show more ...
|
860a43d9 | 22-Aug-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
compiler: Provide LIBPLDM_CC_UNUSED
Ensure that we have __has_attribute available, and then further ensure that the unused attribute is provided. Once satisfied, define LIBPDLM_CC_UNUSED and replace
compiler: Provide LIBPLDM_CC_UNUSED
Ensure that we have __has_attribute available, and then further ensure that the unused attribute is provided. Once satisfied, define LIBPDLM_CC_UNUSED and replace raw use of __attribute__((unused)).
Change-Id: I2433039297d5fdedb8b8d99b30e73e4542d9069f Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
a5d18dc7 | 07-Aug-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
platform: Add decode_pldm_cper_event_data() API
Support decoder for `cperEvent` event class as table `Table 27 - CPEREvent class eventData format` in DSP0248 V1.3.0.
Change-Id: I6165980e0570bbb2115
platform: Add decode_pldm_cper_event_data() API
Support decoder for `cperEvent` event class as table `Table 27 - CPEREvent class eventData format` in DSP0248 V1.3.0.
Change-Id: I6165980e0570bbb21158af9e6adee15894b3bf3a Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
show more ...
|
d8bb75cb | 29-Jun-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: bios_table: Rename pldm_bios_table_append_pad_checksum_check()
Introduce pldm_bios_table_append_pad_checksum(), deprecate pldm_bios_table_append_pad_checksum_check(), add rename configuration a
dsp: bios_table: Rename pldm_bios_table_append_pad_checksum_check()
Introduce pldm_bios_table_append_pad_checksum(), deprecate pldm_bios_table_append_pad_checksum_check(), add rename configuration and apply it.
Change-Id: I77e79f4be6cecbac87b47d2140e1714b519c4e8d Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
504dd17f | 29-Jun-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: bios_table: Rename pldm_bios_table_attr_value_entry_encode_integer_check()
Introduce pldm_bios_table_attr_value_entry_encode_integer(), deprecate pldm_bios_table_attr_value_entry_encode_integer
dsp: bios_table: Rename pldm_bios_table_attr_value_entry_encode_integer_check()
Introduce pldm_bios_table_attr_value_entry_encode_integer(), deprecate pldm_bios_table_attr_value_entry_encode_integer_check(), add rename configuration and apply it.
gitlint-ignore: T1 Change-Id: I7832752518592e69f8d64ac57d2724345b096729 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
1a3983ce | 29-Jun-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: bios_table: Rename pldm_bios_table_attr_value_entry_encode_string_check()
Introduce pldm_bios_table_attr_value_entry_encode_string(), deprecate pldm_bios_table_attr_value_entry_encode_string_ch
dsp: bios_table: Rename pldm_bios_table_attr_value_entry_encode_string_check()
Introduce pldm_bios_table_attr_value_entry_encode_string(), deprecate pldm_bios_table_attr_value_entry_encode_string_check, add rename configuration and apply it.
gitlint-ignore: T1 Change-Id: I7f785aca80a8115bc5e6c60be40ac23ac3e322f1 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
09004d6a | 29-Jun-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: bios_table: Rename pldm_bios_table_attr_value_entry_encode_enum_check()
Introduce pldm_bios_table_attr_value_entry_encode_enum(), deprecate pldm_bios_table_attr_value_entry_encode_enum_check(),
dsp: bios_table: Rename pldm_bios_table_attr_value_entry_encode_enum_check()
Introduce pldm_bios_table_attr_value_entry_encode_enum(), deprecate pldm_bios_table_attr_value_entry_encode_enum_check(), add rename configuration and apply it.
gitlint-ignore: T1 Change-Id: I8fe0da169b9acc919d01ba024503e72fd2792d4e Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
5347e279 | 29-Jun-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: bios_table: Rename pldm_bios_table_attr_entry_integer_encode_check()
Introduce pldm_bios_table_attr_entry_integer_encode(), deprecate pldm_bios_table_attr_entry_integer_encode_check(), add rena
dsp: bios_table: Rename pldm_bios_table_attr_entry_integer_encode_check()
Introduce pldm_bios_table_attr_entry_integer_encode(), deprecate pldm_bios_table_attr_entry_integer_encode_check(), add rename configuration and apply it.
gitlint-ignore: T1 Change-Id: I4ad074babfa33e661cb5b0791cc539453dbd27c7 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|