684a9ab0 | 12-Jun-2025 |
Roger G. Coscojuela <roger.gili-coscojuela@sipearl.com> |
platform: Stabilize get event receiver API
Usage of the get event receiver API is demonstrated here:
https://gerrit.openbmc.org/c/openbmc/pldm/+/78997
Change-Id: I63e168bba4db7c908bebf29edb1248c20
platform: Stabilize get event receiver API
Usage of the get event receiver API is demonstrated here:
https://gerrit.openbmc.org/c/openbmc/pldm/+/78997
Change-Id: I63e168bba4db7c908bebf29edb1248c20163d993 Signed-off-by: Roger G. Coscojuela <roger.gili-coscojuela@sipearl.com>
show more ...
|
2613c278 | 11-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: firmware_update: Introduce iterators for parsing firmware packages
The new collection of APIs allows parsing of arbitrary PLDM firmware update packages in a style that is reasonably ergonomic a
dsp: firmware_update: Introduce iterators for parsing firmware packages
The new collection of APIs allows parsing of arbitrary PLDM firmware update packages in a style that is reasonably ergonomic and free of library allocations.
As a rough sketch, use of the API looks as follows:
``` /* Pin the package parsing to format revision 2 */ DEFINE_PLDM_PACKAGE_FORMAT_PIN_FR02H(pin);
struct pldm_package_downstream_device_id_record ddrec; struct pldm_package_component_image_information info; struct pldm_package_firmware_device_id_record fdrec; pldm_package_header_information_pad hdr; struct pldm_package_iter iter; int rc;
...
rc = decode_pldm_firmware_update_package(package, in, &pin, &hdr, &iter); if (rc < 0) { ... }
/* Do something with hdr */
foreach_pldm_package_firmware_device_id_record(iter, fdrec, rc) { struct pldm_descriptor desc;
/* Do something with fdrec */
foreach_pldm_package_firmware_device_id_record_descriptor(iter, fdrec, desc, rc) { /* Do something with desc */ } if (rc) { /* Handle desc decode failure */ } } if (rc) { /* Handle fdrec decode failure */ }
foreach_pldm_package_downstream_device_id_record(iter, ddrec, rc) { struct pldm_descriptor desc;
/* Do something with ddrec */
foreach_pldm_package_downstream_device_id_record_descriptor(iter, ddrec, desc, rc) { /* Do something with desc */ } if (rc) { /* Handle desc decode failure */ } } if (rc) { /* Handle ddrec decode failure */ }
foreach_pldm_package_component_image_information(iter, info, rc) { /* Do something with info */ } if (rc) { /* Handle info decode failure */ } ```
Note that these new APIs intersects with some existing functionality. Where possible, implementations have been unified, however, the existing APIs were inflexible and unergonomic, requiring pointer arithmetic on the part of the caller, and could not safely cater to concepts added in later revisions of the spec. The existing APIs will be deprecated in a later patch.
Further to that, the implementation of the component image information parsing could not be unified in a way that wasn't awkward. The existing API passed raw image offsets back to the caller, where the new API resolves the offsets against the image location in memory, yielding a valid pointer and bounds-checked length (thereby relieving the caller of the pointer arithmetic). Unwinding that back to a raw offset seems tedious at best in the context of other tests for pointer validity, so don't even try.
Change-Id: I53472ca22b4c8aa79a5515b20a72bf8f66ed66e3 Co-developed-by: Rajeev Ranjan <rajeeranjan@nvidia.com> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
bacbbac1 | 11-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: firmware_update: Reimplement decode_firmware_device_id_record_errno()
Do so in terms of the msgbuf APIs for safety, correctness, ergonomics and performance.
decode_firmware_device_id_record()
dsp: firmware_update: Reimplement decode_firmware_device_id_record_errno()
Do so in terms of the msgbuf APIs for safety, correctness, ergonomics and performance.
decode_firmware_device_id_record() is reimplemented in terms of the updated API for decode_firmware_device_id_record_errno(). This provides a common implementation that will be exploited by future changes, while keeping accommodations on the exceptional path.
gitlint-ignore: T1 Change-Id: I80aa5404b5dba34bc1c0319e19b3beffd752048e Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
150b06c1 | 11-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: firmware_update: Reimplement decode_pldm_package_header_info_errno()
Do so in terms of the msgbuf APIs for safety, correctness, ergonomics and performance.
decode_pldm_package_header_info() is
dsp: firmware_update: Reimplement decode_pldm_package_header_info_errno()
Do so in terms of the msgbuf APIs for safety, correctness, ergonomics and performance.
decode_pldm_package_header_info() is re-implemented in terms of the reworked API for decode_pldm_package_header_info_errno(). This gives us a common implementation that will be exploited by future changes, with the accommodations kept on the exceptional path.
gitlint-ignore: T1 Change-Id: Ia57fa007e5896b63e18063704787bbbc3c89f8e2 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
309bbe8f | 19-May-2025 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
base: return valid completion code
According to the PLDM base specification, completion code `0x21` corresponds to `PLDM_ERROR_INVALID_TRANSFER_CONTEXT`. However, the current implementation in `libp
base: return valid completion code
According to the PLDM base specification, completion code `0x21` corresponds to `PLDM_ERROR_INVALID_TRANSFER_CONTEXT`. However, the current implementation in `libpldm` incorrectly maps `0x21` to `PLDM_INVALID_TRANSFER_OPERATION_FLAG`, which is not aligned with the specification.
To maintain consistency with the standard, we should instead use `PLDM_ERROR_UNEXPECTED_TRANSFER_FLAG_OPERATION` (`0x23`) to represent this error condition more accurately. However, since `PLDM_INVALID_TRANSFER_OPERATION_FLAG` is currently in use by `libpldm` clients (such as `pldm`), removing it immediately would introduce compatibility issues. Therefore, we will first migrate client code to use `PLDM_ERROR_UNEXPECTED_TRANSFER_FLAG_OPERATION` (`0x23`) before removing the incorrect definition from `libpldm`.
Change-Id: I7e2130c1f132dc6c8b426dd373b4a8a73507ac22 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
3643e74d | 19-May-2025 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
fw_update: Use fw_update specific completion codes
`PLDM_INVALID_TRANSFER_OPERATION_FLAG` value as stated in base.h `0x21` is incorrect as per the PLDM Base specification. Reduce its usage by levera
fw_update: Use fw_update specific completion codes
`PLDM_INVALID_TRANSFER_OPERATION_FLAG` value as stated in base.h `0x21` is incorrect as per the PLDM Base specification. Reduce its usage by leveraging the FWUP specific completion codes for encode_pass_component_table_req() command.
Change-Id: I679c90326ec4c150888e71f858a3375ee9f5ad29 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
ec19cbcc | 30-May-2025 |
Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com> |
base: decode_set_tid_req() in PLDM base
Add decode API for SetTID request based on DSP0240 1.2.0 Section 9.1.1 Table 8.
Change-Id: I448f76b810bfb5dbf2b84c85db266c32416a181a Signed-off-by: Vishnu Sa
base: decode_set_tid_req() in PLDM base
Add decode API for SetTID request based on DSP0240 1.2.0 Section 9.1.1 Table 8.
Change-Id: I448f76b810bfb5dbf2b84c85db266c32416a181a Signed-off-by: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com> Signed-off-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com> Signed-off-by: Rameshwar Varaganti <rvaragan@qti.qualcomm.com>
show more ...
|
06eadd0e | 26-May-2025 |
Sora Su <baxiche@gmail.com> |
dsp: firmware update: Add encode/decode APIs for DD update
encode/decode command RequestDownstreamDeviceUpdate, based on DSP0267 1.3.0.
Change-Id: I904a7229fe4a440904e6cf95c8e46b5956c3476c Signed-o
dsp: firmware update: Add encode/decode APIs for DD update
encode/decode command RequestDownstreamDeviceUpdate, based on DSP0267 1.3.0.
Change-Id: I904a7229fe4a440904e6cf95c8e46b5956c3476c Signed-off-by: Sora Su <baxiche@gmail.com>
show more ...
|
babd7b1b | 14-Mar-2025 |
Roger G. Coscojuela <roger.gili-coscojuela@sipearl.com> |
dsp: platform: Add encode req & decode resp for GetEventReceiver command
Add encode and decode API for the Get Event Receiver command This command is defined in DSP0248 as a conditional command.
Th
dsp: platform: Add encode req & decode resp for GetEventReceiver command
Add encode and decode API for the Get Event Receiver command This command is defined in DSP0248 as a conditional command.
The GetEventReceiver command is used to verify the values that were set into an Event Generator using the SetEventReceiver command.
Change-Id: I411cc939d00bc69867507fe58911c813d0c1e2ae Signed-off-by: Roger G. Coscojuela <roger.gili-coscojuela@sipearl.com>
show more ...
|
59edcb14 | 26-Feb-2025 |
Pavithra Barithaya <pavithrabarithaya07@gmail.com> |
pdr: Add pldm_entity_association_tree_delete_node() API
This API deletes the specific entity node from the entity association tree. We must handle the parent children and sibling relationship before
pdr: Add pldm_entity_association_tree_delete_node() API
This API deletes the specific entity node from the entity association tree. We must handle the parent children and sibling relationship before we delete the node from the entity association tree.
Change-Id: I326adba8316a15c6af0696cdd9bdf2be7e592452 Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
show more ...
|
f0eee363 | 25-Feb-2025 |
Pavithra Barithaya <pavithrabarithaya07@gmail.com> |
pdr: Add pldm_pdr_delete_by_sensor_id() API
Adds a new libpldm API to delete the PDR record from the PDR repo based on the sensor ID of the PDR. This API is used when a state sensor PDR record needs
pdr: Add pldm_pdr_delete_by_sensor_id() API
Adds a new libpldm API to delete the PDR record from the PDR repo based on the sensor ID of the PDR. This API is used when a state sensor PDR record needs to be deleted based on the sensor ID and return the corresponding record handle deleted.
Change-Id: Ia78c24467f6460fdcf456a31ac851fa7b0c0b385 Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
show more ...
|
48b0f805 | 19-May-2025 |
Vishnu Santhosh <quic_vishsant@quicinc.com> |
platform: encode_get_pdr_repository_info_req() in PLDM platform
Add encode API for GetPDRRepositoryInfo request based on DSP0248 1.3.0 Section 26.1 Table 68.
Change-Id: I61c3d11c1e15eccfd7f96795e50
platform: encode_get_pdr_repository_info_req() in PLDM platform
Add encode API for GetPDRRepositoryInfo request based on DSP0248 1.3.0 Section 26.1 Table 68.
Change-Id: I61c3d11c1e15eccfd7f96795e5098b0e0f2d1423 Signed-off-by: Vishnu Santhosh <quic_vishsant@quicinc.com>
show more ...
|
8cfeb470 | 24-Feb-2025 |
Pavithra Barithaya <pavithrabarithaya07@gmail.com> |
pdr: Add pldm_pdr_delete_by_effecter_id() API
Adds a new libpldm API to delete the PDR record from the PDR repo based on the effecter ID of the PDR. This API is used when a state effecter PDR record
pdr: Add pldm_pdr_delete_by_effecter_id() API
Adds a new libpldm API to delete the PDR record from the PDR repo based on the effecter ID of the PDR. This API is used when a state effecter PDR record needs to be deleted based on the effecter ID and return the corresponding record handle deleted.
Change-Id: I5ff5aee0db7767e07233961afb1aad9c65320e84 Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
show more ...
|
869c287a | 30-Apr-2025 |
Pavithra Barithaya <pavithrabarithaya07@gmail.com> |
pdr: Stabilize pldm_pdr_delete_by_record_handle()
Use of pldm_pdr_delete_by_record_handle() is demonstarted here:
https://gerrit.openbmc.org/c/openbmc/pldm/+/78774
Change-Id: I2e69997557ca3f73ef73
pdr: Stabilize pldm_pdr_delete_by_record_handle()
Use of pldm_pdr_delete_by_record_handle() is demonstarted here:
https://gerrit.openbmc.org/c/openbmc/pldm/+/78774
Change-Id: I2e69997557ca3f73ef739e141d1f48b6efcfdba6 Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
0ba6aa0e | 05-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: firmware_update: Convert internal buffer params to `const void *`
Let's at least exploit C's conveniences and not force any unnecessary casting at the call-sites.
Change-Id: Icded9a47cb8da985f
dsp: firmware_update: Convert internal buffer params to `const void *`
Let's at least exploit C's conveniences and not force any unnecessary casting at the call-sites.
Change-Id: Icded9a47cb8da985f05c640221083f6f9db9f37c Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
a386348c | 05-Apr-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
utils: Rename crc32() to pldm_edac_crc32()
Chip away at transitioning the library API surface to a consistent symbol prefix.
Change-Id: I1abd96407867ddf8390cb9fbba9a8085478f08dd Signed-off-by: Andr
utils: Rename crc32() to pldm_edac_crc32()
Chip away at transitioning the library API surface to a consistent symbol prefix.
Change-Id: I1abd96407867ddf8390cb9fbba9a8085478f08dd Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
59dce78e | 01-Apr-2025 |
Chau Ly <chaul@amperecomputing.com> |
dsp: base: Add encode req & decode resp for NegotiateTransferParameters
Added encode/decode APIs for NegotiateTransferParameters command (0x07) which is defined in DSP0240 Version 1.2.0 section 9.6.
dsp: base: Add encode req & decode resp for NegotiateTransferParameters
Added encode/decode APIs for NegotiateTransferParameters command (0x07) which is defined in DSP0240 Version 1.2.0 section 9.6.
Change-Id: I9920e1c9c9e6d9e5999d568d8d20b4c80a1d8726 Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
58273fb7 | 26-Mar-2025 |
Chau Ly <chaul@amperecomputing.com> |
dsp: file: Add encode req & decode resp for DfHeartbeat command
Added encode/decode APIs for DfHeartbeat command(0x03) which is defined in DSP0242 Version 1.0.0 Section: 9.6.
Change-Id: Icf8ccbb57d
dsp: file: Add encode req & decode resp for DfHeartbeat command
Added encode/decode APIs for DfHeartbeat command(0x03) which is defined in DSP0242 Version 1.0.0 Section: 9.6.
Change-Id: Icf8ccbb57da74182f4fd0cc0cf49a49861abfbc1 Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
7286ca64 | 26-Mar-2025 |
Chau Ly <chaul@amperecomputing.com> |
dsp: file: Add encode req & decode resp for DfClose command
Added encode/decode APIs for DfClose command(0x02) which is defined in DSP0242 Version 1.0.0 Section: 9.3.
Change-Id: Ie4e82781497a0c1251
dsp: file: Add encode req & decode resp for DfClose command
Added encode/decode APIs for DfClose command(0x02) which is defined in DSP0242 Version 1.0.0 Section: 9.3.
Change-Id: Ie4e82781497a0c1251d7e64b83a6f88a99dfad4e Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
cf26f2a3 | 18-Mar-2025 |
Chau Ly <chaul@amperecomputing.com> |
dsp: file: Add encode req & decode resp for DfOpen command
Added encode/decode APIs for DfOpen command(0x01) which is defined in DSP0242 Version 1.0.0 Section: 9.2.
Change-Id: I5a975a7ae2bbd4115898
dsp: file: Add encode req & decode resp for DfOpen command
Added encode/decode APIs for DfOpen command(0x01) which is defined in DSP0242 Version 1.0.0 Section: 9.2.
Change-Id: I5a975a7ae2bbd4115898486984ad96016590b04b Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
ed4ad707 | 12-Mar-2025 |
Chau Ly <chaul@amperecomputing.com> |
platform: Add decode API for File Descriptor PDR
Add decode API to decode File Descriptor PDR raw data to `pldm_file_descriptor_pdr` struct. The referred File Descriptor PDR is based on DSP0248 1.3.
platform: Add decode API for File Descriptor PDR
Add decode API to decode File Descriptor PDR raw data to `pldm_file_descriptor_pdr` struct. The referred File Descriptor PDR is based on DSP0248 1.3.0 Section 28.30 Table 108.
Change-Id: Ifcfae68d8bf6a723cf132b851621b068e2118d0e Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
8836784f | 16-Oct-2024 |
Dung Cao <dung@os.amperecomputing.com> |
dsp: base: Add encode req & decode resp for MultipartReceive command
Added encode/decode APIs for MultipartReceive command(0x09) which is defined in DSP0240 Version 1.2.0 section 9.6.
Change-Id: I5
dsp: base: Add encode req & decode resp for MultipartReceive command
Added encode/decode APIs for MultipartReceive command(0x09) which is defined in DSP0240 Version 1.2.0 section 9.6.
Change-Id: I577997978728cbaa9132e0685cdd85e277427554 Signed-off-by: Dung Cao <dung@os.amperecomputing.com> Signed-off-by: Chau Ly <chaul@amperecomputing.com>
show more ...
|
a1896967 | 03-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
msgbuf: Rework error handling to improve soundness
Design the implementation to uphold the invariant that a non-negative remaining value implies the cursor pointer is valid, and that under other con
msgbuf: Rework error handling to improve soundness
Design the implementation to uphold the invariant that a non-negative remaining value implies the cursor pointer is valid, and that under other conditions error values must be observed by the msgbuf user. The former is tested with assertions in the implementation. The latter is enforced by construction.
With this change, all msgbuf instances for which pldm_msgbuf_init_errno() succeeds must be either completed or discarded by calls to the pldm_msgbuf_complete*() or pldm_msgbuf_discard() APIs respectively.
We then build on the properties that:
- pldm_msgbuf_init_errno() is marked with the warn_unused_result function attribute
- pldm_msgbuf_init_errno() returns errors for invalid buffer configurations
- The complete and discard APIs are marked with the warn_unused_result function attribute
- The complete APIs test for negative remaining values and return an error if encountered.
- The discard API propagates the provided error code
Together these provide the foundation to ensure that buffer access errors are (eventually) detected.
A msgbuf object is always in one of the uninitialized, valid, invalid, or completed states. The states are defined as follows:
- Uninitialized: Undefined values for remaining and cursor
- Valid: cursor points to a valid object, remaining is both non-negative and describes a range contained within the object pointed to by cursor
- Invalid: The value of remaining is negative. The value of cursor is unspecified.
- Completed: the value of remaining is INTMAX_MIN and cursor is NULL
msgbuf instances must always be in the completed state by the time their storage is reclaimed. To enforce this, PLDM_MSGBUF_DEFINE_P() is introduced both to simplify definition of related variables, and to exploit the compiler's 'cleanup' attribute. The cleanup function associated with the msgbuf object asserts that the referenced object is in the completed state.
From there, update the implementations of the msgbuf APIs such that exceeding implementation type limits forces the msgbuf object to the invalid state (in addition to returning an error value) to relieve the caller from testing the result of all API invocations.
Change-Id: I4d78ddc5f567d4148f2f6d8f3e7570e97c316bbb Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
70d21c97 | 04-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
msgbuf: Rename 'destroy' APIs to 'complete'
Change the language to better reflect the intent, with the impending introduction of the ability to 'discard' a msgbuf instance.
Change-Id: Idbb79dcc2587
msgbuf: Rename 'destroy' APIs to 'complete'
Change the language to better reflect the intent, with the impending introduction of the ability to 'discard' a msgbuf instance.
Change-Id: Idbb79dcc2587a8baef67ffd405e0bc77e66fe995 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
53b08675 | 03-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: firmware_update: Initialize msgbuf after argument tests
The msgbuf APIs are being reworked to improve soundness and error reporting. Prior to introducing some new requirements on its users, ens
dsp: firmware_update: Initialize msgbuf after argument tests
The msgbuf APIs are being reworked to improve soundness and error reporting. Prior to introducing some new requirements on its users, ensure its init/destroy sequences have minimal code spans.
This effort surfaced a problem with a test configuration for encode_get_downstream_firmware_parameters_req() which was passing an invalid transfer operation flag. Previously this was masked by a buffer-length validation failure.
Change-Id: I7259ac86d696da425ac9d919e6864dfb238d8996 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|