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 ...
|
1a4eed93 | 21-Mar-2025 |
Chau Ly <chaul@amperecomputing.com> |
msgbuf: Add pldm_msgbuf_extract_uint*_to_size APIs
Add pldm_msgbuf_extract_uint8_to_size(), pldm_msgbuf_extract_uint16_to_size() and pldm_msgbuf_extract_uint32_to_size() APIs to msgbuf API list. The
msgbuf: Add pldm_msgbuf_extract_uint*_to_size APIs
Add pldm_msgbuf_extract_uint8_to_size(), pldm_msgbuf_extract_uint16_to_size() and pldm_msgbuf_extract_uint32_to_size() APIs to msgbuf API list. These are the extractors which extract uint8_t/uint16_t/uint32_t to the size_t destination. We mostly use size_t as the type to hold object size, but extracting data to a size_t variable has not been properly supported. These new APIs can bypass this limitation.
Example:
Extract from buffer the length of a variable length data represented by `variable_field` struct, which has a field of size_t to represent length.
Change-Id: I89f2600602bacf39f1f915a3496231dcc63fd6aa 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 ...
|
63b5a66f | 04-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
msgbuf: Return -EOVERFLOW where relevant in pldm_msgbuf_consumed()
-EBADMSG seems less appropriate for access patterns known to exceed buffer limits.
Change-Id: I3051323cad0ec126c0fe5073902fcc50f8f
msgbuf: Return -EOVERFLOW where relevant in pldm_msgbuf_consumed()
-EBADMSG seems less appropriate for access patterns known to exceed buffer limits.
Change-Id: I3051323cad0ec126c0fe5073902fcc50f8ff18a0 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 ...
|
7e68f341 | 03-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
msgbuf: Modernize pldm_msgbuf_skip() implementation
The implementation of the other msgbuf APIs follows a pattern that helps static analysis. Make the implementation of pldm_msgbuf_skip() consistent
msgbuf: Modernize pldm_msgbuf_skip() implementation
The implementation of the other msgbuf APIs follows a pattern that helps static analysis. Make the implementation of pldm_msgbuf_skip() consistent, even if it wasn't yet causing dramas.
Change-Id: I5f0486d935935962130a20f3a6564587183fefff Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
2b42f7f4 | 03-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
msgbuf: Relax requirements on pointer out-parameters
The span and peek msgbuf APIs tended to require that the value of the 'cursor' out-parameter was set to NULL at the point of the call. This is a
msgbuf: Relax requirements on pointer out-parameters
The span and peek msgbuf APIs tended to require that the value of the 'cursor' out-parameter was set to NULL at the point of the call. This is a pedantic restriction that's unnecessary for msgbuf or any other internal APIs. The pattern was copied from the public APIs, where in some cases the struct types were publicly declared but not publicly defined in order to hide implementation details, but the APIs were designed to allow for future changes exposing the struct definitions so the objects could be stack-allocated.
Change-Id: I8c96b8b4b3515c2a9719e9df8b2f068d753dbba6 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
704e4d56 | 03-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
msgbuf: Warn on unused result for init and destroy APIs
Ensure as best we can that there are barriers to progress if errors occur.
Change-Id: I0b48c551dc5ba54cbd2b46a9540f75051a59afdf Signed-off-by
msgbuf: Warn on unused result for init and destroy APIs
Ensure as best we can that there are barriers to progress if errors occur.
Change-Id: I0b48c551dc5ba54cbd2b46a9540f75051a59afdf Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
7d87f8dc | 04-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
meson: Use doxygen to build documentation
Doxyfile.in contains a roughly-default setup, only building HTML documentation based on the library headers and source files.
This gets a start on fixing i
meson: Use doxygen to build documentation
Doxyfile.in contains a roughly-default setup, only building HTML documentation based on the library headers and source files.
This gets a start on fixing issues highlighted by warnings over time.
Change-Id: Iaffc601c40a4131d069c52a5b49c60dfd066a15b 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 ...
|
93b071be | 21-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
docs: changes: Add The Power of Ten to influences
Not necessarily meant to be strictly followed, but is good food for thought.
Change-Id: Ia716b46a17eff702ed5e2014b98b296cadb3c045 Signed-off-by: An
docs: changes: Add The Power of Ten to influences
Not necessarily meant to be strictly followed, but is good food for thought.
Change-Id: Ia716b46a17eff702ed5e2014b98b296cadb3c045 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
1bfd0346 | 21-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
docs: changes: Add Jessica Paquette to influences
Change-Id: I27aed14115b37a059f96731a569d0ed19115b23c Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au> |
eba23b93 | 21-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
docs: changes: Add The C programming language website
A handy entry-point for C and related tooling.
Replace the link to the C17 draft as the standards and drafts are (currently) linked from the fr
docs: changes: Add The C programming language website
A handy entry-point for C and related tooling.
Replace the link to the C17 draft as the standards and drafts are (currently) linked from the front page.
Change-Id: I7747f44491e9bec974ee0f7a07fb9dfa438757e1 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
5192e2e2 | 26-Feb-2025 |
Pavithra Barithaya <pavithrabarithaya07@gmail.com> |
pdr: Add pldm_pdr_delete_by_record_handle() API
Adds a new libpldm API to delete the PDR record from the PDR repo based on the record handle of the PDR record.
Change-Id: I44f5568aa024660f7d370d9a2
pdr: Add pldm_pdr_delete_by_record_handle() API
Adds a new libpldm API to delete the PDR record from the PDR repo based on the record handle of the PDR record.
Change-Id: I44f5568aa024660f7d370d9a2c6b3f9286d96ed8 Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
show more ...
|
9c57ef5d | 10-Mar-2025 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
requester: Add null check in pldm_instance_id_free
pldm_instance_id_free() function does not check for a valid ctx object before dereferencing it. Hence it could cause crash when its clients pass a
requester: Add null check in pldm_instance_id_free
pldm_instance_id_free() function does not check for a valid ctx object before dereferencing it. Hence it could cause crash when its clients pass a null pointer by accident.
Change-Id: I4f06127eef16d2ab147e4c5a73a47850d7f5e546 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
6c7ee4f4 | 17-Mar-2025 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
requester: Add null check in pldm_instance_id_alloc
pldm_instance_id_alloc() function does not check for a valid ctx object before dereferencing it. Hence it could cause crash when its clients pass
requester: Add null check in pldm_instance_id_alloc
pldm_instance_id_alloc() function does not check for a valid ctx object before dereferencing it. Hence it could cause crash when its clients pass a null pointer by accident.
Change-Id: I340aa8171cd397f5af772a9cc6d4f80c8263a089 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
bc40dd5a | 02-Aug-2024 |
Archana Kakani <archana.kakani@ibm.com> |
pdr: Fix for Entity Association PDR looping
While normalizing the Entity association PDR, record handle is passed to the library function. Considering PDR contains logical and physical contained ent
pdr: Fix for Entity Association PDR looping
While normalizing the Entity association PDR, record handle is passed to the library function. Considering PDR contains logical and physical contained entities, two pdrs with same record handle are created.
To fix the issue, we are propagating the recently used record handle from the pldm_pdr_add to entity_association_pdr_add. Then incrementing the record handle before creating next PDR.
gitlint-ignore: B1, UC1 Fixes: 25ddbccfae0e ("pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle()") Change-Id: Ifaa5694cabe7ad38d8881f0b7be0a79d9d3e06c0 Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
show more ...
|
d94bf00a | 10-Mar-2025 |
Roger G. Coscojuela <roger.gili-coscojuela@sipearl.com> |
base: Define the minimum request bytes for SetTID command
PLDM Base specification defines in DSP0240 the optional command SetTID Add the minimum required size for sending this command
Change-Id: Ib
base: Define the minimum request bytes for SetTID command
PLDM Base specification defines in DSP0240 the optional command SetTID Add the minimum required size for sending this command
Change-Id: Ibea4e72a090088166f1584145bfca5a7489b1920 Signed-off-by: Roger G. Coscojuela <roger.gili-coscojuela@sipearl.com>
show more ...
|
eba16206 | 12-Mar-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
scripts: pre-submit: Force GCC for -fanalyzer
openbmc-build-scripts' unit-test.py currently[1] modifies its own environment to exploit clang. It seems like a pretty dicey approach (modify the enviro
scripts: pre-submit: Force GCC for -fanalyzer
openbmc-build-scripts' unit-test.py currently[1] modifies its own environment to exploit clang. It seems like a pretty dicey approach (modify the environment passed to the subprocess instead?), for now work around it by forcing use of GCC for the pre-submit script.
[1]: https://github.com/openbmc/openbmc-build-scripts/blob/966d67da385aef095d19b20fd778fcb88fa7be7b/scripts/unit-test.py#L1064-L1065
Change-Id: Ia6259eb949c2bab7fd30b49fc5c2d69af4f6470d Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
779e9dbd | 20-Feb-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
dsp: firmware_update: Wrap static errno variants of package APIs
Begin the process of migrating package parsing APIs away from using PLDM protocol completion codes for signaling errors.
For now kee
dsp: firmware_update: Wrap static errno variants of package APIs
Begin the process of migrating package parsing APIs away from using PLDM protocol completion codes for signaling errors.
For now keep the new symbols internal. They will eventually be exposed and the current stable APIs deprecated.
Change-Id: Ieb67c43ebb0782b9da530c52de99b59edca4a648 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
248b5abe | 20-Feb-2025 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
api: Translate -EBADMSG as PLDM_ERROR_INVALID_DATA
For some historical reason it was previously mapped to PLDM_ERROR_INVALID_LENGTH. -EBADMSG typically means the provided information is inconsistent
api: Translate -EBADMSG as PLDM_ERROR_INVALID_DATA
For some historical reason it was previously mapped to PLDM_ERROR_INVALID_LENGTH. -EBADMSG typically means the provided information is inconsistent in some way rather than improperly bounded, so fix that now.
Change-Id: Ie0fe2c6f9742387f951d5abe81f12f9f7b7aff24 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|