9e16b18b | 30-Sep-2024 |
Thu Nguyen <thu@os.amperecomputing.com> |
platform: Fix checking `eventIDToAcknowledge`
As DSP0248 V1.3.0, `Figure 22 - Switching from asynchronous eventing to poll for an event with large data` when the `tranferFlag` of `PollForPlatformEve
platform: Fix checking `eventIDToAcknowledge`
As DSP0248 V1.3.0, `Figure 22 - Switching from asynchronous eventing to poll for an event with large data` when the `tranferFlag` of `PollForPlatformEventMessage` is `AcknowledgementOnly` the `eventIDToAcknowledge` will be 0xffff.
But the contents in lines #1678 to #1681 of the same specs details ``` 1678 0x0000 shall be returned to indicate the terminus event queue is empty. The PLDM Event Receiver shall 1679 acknowledge reception of the event by issuing the command again with the eventIDToAcknowledge set 1680 to the previously retrieved eventID (from the PLDM terminus). The PLDM terminus shall remove the 1681 acknowledged event message from its internal FIFO upon reception of the acknowledgment ```
When the `tranferFlag` is `AcknowledgementOnly` the `eventIDToAcknowledge` should be `the previously retrieved eventID (from the PLDM terminus)` which is not 0x0000 and 0xffff. Because `The PLDM terminus shall remove the acknowledged event message` so the contents in lines #1678 to #1681 are correct.
Update the failure condition in `pldm_platform_poll_for_platform_event_message_validate` helper function to follow the contents in lines #1678 to #1681. The helper will return error when `tranferFlag` is `AcknowledgementOnly` and `eventIDToAcknowledge` is 0xffff or 0x0000 (which can't be a real previous event ID from terminus).
gitlint-ignore: B1, UC1 Fixes: 387b10f6cd37 ("platform: fix encode/decode_poll_for_platform_event_message_req") Change-Id: Icf84494dbe2c43fba8ae2ec72e7197e8dd4abf3e Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
show more ...
|
b43a7787 | 26-Sep-2024 |
John Chung <john.chung@arm.com> |
platform: Support PLDM_CPER_EVENT in encode_platform_event_message_req()
DSP0248 v1.3.0 add CPEREvent for PLDM Event Types as Table 11 and add it in `encode_platform_event_message_req` func.
Change
platform: Support PLDM_CPER_EVENT in encode_platform_event_message_req()
DSP0248 v1.3.0 add CPEREvent for PLDM Event Types as Table 11 and add it in `encode_platform_event_message_req` func.
Change-Id: I94e73938694ce8367489244b75c7e8e0a6d1d8ee Signed-off-by: John Chung <john.chung@arm.com> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
e5f12538 | 30-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
msgbuf: Improve type-specific ergonomics to match generic macros
Don't require that a pointer be passed. Rather, take the pointer inside the type-safe macro definition, and perform the void cast to
msgbuf: Improve type-specific ergonomics to match generic macros
Don't require that a pointer be passed. Rather, take the pointer inside the type-safe macro definition, and perform the void cast to avoid the alignment warning.
Change-Id: I5fbfc4a95591d2640595107e6f5fcae44a95950f Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
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 ...
|
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 ...
|
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 ...
|
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 ...
|
c668ffce | 25-Jun-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: bios_table: Rename pldm_bios_table_attr_entry_string_decode_def_string_length_check()
Introduce pldm_bios_table_attr_entry_string_decode_def_string_length(), deprecate pldm_bios_table_attr_entr
dsp: bios_table: Rename pldm_bios_table_attr_entry_string_decode_def_string_length_check()
Introduce pldm_bios_table_attr_entry_string_decode_def_string_length(), deprecate pldm_bios_table_attr_entry_string_decode_def_string_length_check(), add the rename configuration and apply it.
As a consequence clang-tidy detected the following, though it's unclear why it was not detected previously:
``` clang-tidy-17 -export-fixes /tmp/tmpf4lalo2j/tmpkiyu1sgy.yaml -p=/home/andrew/src/openbmc.org/openbmc/libpldm/origin/build1qcxy8ww -quiet /home/andrew/src/openbmc.org/openbmc/libpldm/origin/src/dsp/bios_table.c ../src/dsp/bios_table.c:460:2: error: Null pointer passed to 2nd parameter expecting 'nonnull' [clang-analyzer-core.NonNullParamChecker,-warnings-as-errors] 460 | memcpy(buffer, fields->def_string, length); | ^ ~~~~~~~~~~~~~~~~~~ ../src/dsp/bios_table.c:457:11: note: Assuming the condition is true 457 | length = length < (size - 1) ? length : (size - 1); | ^~~~~~~~~~~~~~~~~~~ ../src/dsp/bios_table.c:457:11: note: '?' condition is true ../src/dsp/bios_table.c:460:2: note: Null pointer passed to 2nd parameter expecting 'nonnull' 460 | memcpy(buffer, fields->def_string, length); | ^ ~~~~~~~~~~~~~~~~~~ ```
gitlint-ignore: T1, B1 Change-Id: Ic390e00f520cb3d5e479604b34939cefd09e9448 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
f6be4933 | 25-Jun-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: bios_table: Rename pldm_bios_table_attr_entry_string_encode_check()
Introduce pldm_bios_table_attr_entry_string_encode(), deprecate pldm_bios_table_attr_entry_string_encode_check(), add the ren
dsp: bios_table: Rename pldm_bios_table_attr_entry_string_encode_check()
Introduce pldm_bios_table_attr_entry_string_encode(), deprecate pldm_bios_table_attr_entry_string_encode_check(), add the rename configuration and apply it.
Change-Id: I7c2b70784dd91757723857ca9544d9462937a8a7 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
82b4d3b4 | 25-Jun-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: bios_table: Rename pldm_bios_table_attr_entry_enum_decode_pv_hdls_check()
Introduce pldm_bios_table_attr_entry_enum_decode_pv_hdls(), deprecate pldm_bios_table_attr_entry_enum_decode_pv_hdls_ch
dsp: bios_table: Rename pldm_bios_table_attr_entry_enum_decode_pv_hdls_check()
Introduce pldm_bios_table_attr_entry_enum_decode_pv_hdls(), deprecate pldm_bios_table_attr_entry_enum_decode_pv_hdls_check(), add the rename configuration and apply it.
gitlint-ignore: T1 Change-Id: I29b4d24ce0bbb92ff0491c2abae4b512d4374e74 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
46673f4a | 25-Jun-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: bios_table: Rename pldm_bios_table_attr_entry_enum_decode_def_num_check()
Introduce pldm_bios_table_attr_entry_enum_decode_def_num(), deprecate pldm_bios_table_attr_entry_enum_decode_def_num_ch
dsp: bios_table: Rename pldm_bios_table_attr_entry_enum_decode_def_num_check()
Introduce pldm_bios_table_attr_entry_enum_decode_def_num(), deprecate pldm_bios_table_attr_entry_enum_decode_def_num_check(), add the rename configuration and apply it.
gitlint-ignore: T1 Change-Id: Ia0eec8050e39f2ee45c350386af32bd5c37135c5 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|