8c43abb7 | 01-Oct-2024 |
Gilbert Chen <gilbertc@nvidia.com> |
dsp: platform: Fix decode_set_event_receiver_req()
Per DSP0248 V1.3.0 table13, the heartbeatTimer field shall be omitted from the request data if eventMessageGlobalEnable is not set to enableAsyncKe
dsp: platform: Fix decode_set_event_receiver_req()
Per DSP0248 V1.3.0 table13, the heartbeatTimer field shall be omitted from the request data if eventMessageGlobalEnable is not set to enableAsyncKeepAlive.
gitlint-ignore: B1, UC1 Fixes: 66c7723adbdc ("msgbuf: Enable pldm_msgbuf_extract() into packed members") Fixes: 9667f5823930 ("platform: pldm_msgbuf for decode_set_event_receiver_req()") Fixes: 6ef2aa90a793 ("platform: Test invalid heartbeat conditions after assignment") Fixes: 9c76679224cf ("libpldm: Migrate to subproject") Change-Id: Ia2a0c71a1f37a0fd32670b9b66b051e18fb73dbe Signed-off-by: Gilbert Chen <gilbertc@nvidia.com>
show more ...
|
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 ...
|
74c9a546 | 13-Sep-2024 |
Archana Kakani <archana.kakani@ibm.com> |
pdr: Improve error propagation
Enhance error propagation in pldm_entity_association_pdr_add_from_node_with_record_handle(). Instead of always returning 0, the function now returns the result from en
pdr: Improve error propagation
Enhance error propagation in pldm_entity_association_pdr_add_from_node_with_record_handle(). Instead of always returning 0, the function now returns the result from entity_association_pdr_add to accurately reflect success/failure.
gitlint-ignore: B1, UC1 Fixes: [25ddbccfae0e ("pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle()") Change-Id: I4d3711e096b2a90c62a600be89a16b47e6b20f79 Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
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 ...
|
05507773 | 22-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: pdr: Open-code next_container_id() at its callsite
There was only one invocation. Open-code the implementation so its easier to understand the assertion should never fire.
Change-Id: I8963c3e1
dsp: pdr: Open-code next_container_id() at its callsite
There was only one invocation. Open-code the implementation so its easier to understand the assertion should never fire.
Change-Id: I8963c3e15afa85f8bc5457b6cd94a272f408b48a Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
890d37a3 | 22-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: pdr: Apply LIBPLDM_CC_NONNULL to reduce assert()s
The PDR API implementations are in a bit of a state. Reduce the use of asserts to highlight the more egregious ones.
Again adjusting some asse
dsp: pdr: Apply LIBPLDM_CC_NONNULL to reduce assert()s
The PDR API implementations are in a bit of a state. Reduce the use of asserts to highlight the more egregious ones.
Again adjusting some assert behavior has impacted the ABI as measured by abi-compliance-checker. pldm_pdr_find_record() and pldm_pdr_get_next_record() are both affected, with changes to the registers assigned for parameter-passing.
Change-Id: I7797217dac76afcf7a9df7519d9d2aa394d3b5dd 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 ...
|
5c49f162 | 22-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
meson: Ban variable length arrays
Caller-controlled sizes for variable length arrays are bad for the reasons outlined in the SEI CERT C Coding Standard[1]
Enable -Wvla to prevent future use.
[1]:
meson: Ban variable length arrays
Caller-controlled sizes for variable length arrays are bad for the reasons outlined in the SEI CERT C Coding Standard[1]
Enable -Wvla to prevent future use.
[1]: https://wiki.sei.cmu.edu/confluence/display/c/MEM05-C.+Avoid+large+stack+allocations
Change-Id: Id587bd1432255cff11b419cb5a7f454fc64e2054 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 ...
|
0f5be28f | 21-Jul-2024 |
Lora Lin <lora.lin.wiwynn@gmail.com> |
oem: meta: Add decode_oem_meta_file_io_write_req()
Add decode_oem_meta_file_io_write_req function. Deprecate decode_oem_meta_file_io_req function.
The difference between functions decode_oem_meta_f
oem: meta: Add decode_oem_meta_file_io_write_req()
Add decode_oem_meta_file_io_write_req function. Deprecate decode_oem_meta_file_io_req function.
The difference between functions decode_oem_meta_file_io_req and decode_oem_meta_file_io_write_req:
- decode_oem_meta_file_io_write_req: - return 0 on success and return a negative errno value on failure. - input parameters is structure. - add req_length parameter to check whether the total length of the request is buffer overflow. - decode_oem_meta_file_io_req: - return PLDM_SUCCESS on success and return another PLDM completion code on failure. - input parameters is passing individual pointers.
Change-Id: Iae3c7f24128bc25c5af6951f34fdc6d8a7b90381 Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> Signed-off-by: Lora Lin <lora.lin.wiwynn@gmail.com> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
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 ...
|
cb569bc5 | 01-Sep-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
compiler: Provide LIBPLDM_CC_ALWAYS_INLINE
Using it through the code-base reduces some of the source noise, and gives us a way to control the definition going forward.
Change-Id: I27e76cbae5c45f0ef
compiler: Provide LIBPLDM_CC_ALWAYS_INLINE
Using it through the code-base reduces some of the source noise, and gives us a way to control the definition going forward.
Change-Id: I27e76cbae5c45f0efd64b01fb9a8b243a6c8e65d 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 ...
|