1# Changelog 2 3All notable changes to this project will be documented in this file. 4 5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6and this project adheres to 7[Semantic Versioning](https://semver.org/spec/v2.0.0.html). 8 9Change categories: 10 11- Added 12- Changed 13- Deprecated 14- Removed 15- Fixed 16- Security 17 18## [Unreleased] 19 20### Added 21 221. base: Define macros for reserved TIDs 232. pdr: Add pldm_entity_association_pdr_add_contained_entity_to_remote_pdr() 243. pdr: Add pldm_entity_association_pdr_create_new() 254. platform: Define macros for the responded transferflags 265. pdr: Add pldm_pdr_get_terminus_handle() API 276. pdr: Add related decode_entity_auxiliary_names_pdr() APIs 287. fw_update: Add encode req & decode resp for get_downstream_fw_params 29 30### Changed 31 321. pdr: Stabilise related decode_entity_auxiliary_names_pdr() APIs 332. platform: Rework decode/encode_pldm_message_poll_event_data() APIs 343. platform: Stabilise decode_pldm_message_poll_event_data() APIs 35 36### Deprecated 37 381. Rename and deprecate functions with the `_check` suffix 39 40 All library function return values always need to be checked. The `_check` 41 suffix is redundant, so remove it. Migration to the non-deprecated 42 equivalents without the `_check` suffix can be performed using 43 `scripts/ apply-renames` and the [clang-rename][] configurations under 44 `evolutions/` 45 46 The deprecated functions: 47 48 - `get_fru_record_by_option_check()` 49 - `pldm_bios_table_append_pad_checksum_check()` 50 - `pldm_bios_table_attr_entry_enum_decode_def_num_check()` 51 - `pldm_bios_table_attr_entry_enum_decode_pv_hdls_check()` 52 - `pldm_bios_table_attr_entry_enum_decode_pv_num_check()` 53 - `pldm_bios_table_attr_entry_enum_encode_check()` 54 - `pldm_bios_table_attr_entry_integer_encode_check()` 55 - `pldm_bios_table_attr_entry_string_decode_def_string_length_check()` 56 - `pldm_bios_table_attr_entry_string_encode_check()` 57 - `pldm_bios_table_attr_value_entry_encode_enum_check()` 58 - `pldm_bios_table_attr_value_entry_encode_integer_check()` 59 - `pldm_bios_table_attr_value_entry_encode_string_check()` 60 - `pldm_bios_table_string_entry_decode_string_check()` 61 - `pldm_bios_table_string_entry_encode_check()` 62 - `pldm_entity_association_pdr_add_check()` 63 - `pldm_entity_association_pdr_add_from_node_check()` 64 - `pldm_pdr_add_check()` 65 - `pldm_pdr_add_fru_record_set_check()` 66 67[clang-rename]: https://clang.llvm.org/extra/clang-rename.html 68 69### Removed 70 711. IBM OEM header compatibility symlinks. 72 73 Anyone left using the deprecated paths can migrate using the coccinelle patch 74 at `evolutions/current/oem-ibm-header-compat.cocci`. 75 76### Fixed 77 781. requester: instance-id: Release read lock on conflict 79 80## [0.8.0] - 2024-05-23 81 82### Added 83 841. base: Provide pldm_msg_hdr_correlate_response() 852. transport: af-mctp: Add pldm_transport_af_mctp_bind() 863. oem: ibm: Add chapdata file type support 874. base: Added PLDM_SMBIOS & PLDM_RDE message types 885. oem: meta: Add decode_oem_meta_file_io_req() 896. state-set: Add all state set values to system power state enum as per DSP0249 907. platform: Add alias members to the enum 91 pldm_pdr_repository_chg_event_change_record_event_data_operation. 92 93 enum constants with inconsistent names are deprecated with this change. 94 remove old inconsistent enum members after backward compatibility cleanup is 95 done 96 978. oem-ibm: Alias `pldm_oem_ibm_fru_field_type` members as `PLDM_OEM_IBM_*` 989. oem: ibm: Add Firmware Update Access Key(UAK) as a FRU field type 9910. platform: Add 3 PDR type enum for Redfish Device Enablement per 100 DSP0248_1.2.0 10111. state_set: Add CONNECTED and DISCONNECTED enum for Link State set 10212. entity: Add enum for Network Interface Connectors and Network Ports 103 Connection Types 10413. pdr: Add decode_numeric_effecter_pdr_data() 10514. oem: ibm: Support for the Real SAI entity id 10615. fw_update: Add encode req & decode resp for query_downstream_devices 10716. fw_update: Add encode req & decode resp for query_downstream_identifiers 10817. platform: Add support for GetStateEffecterStates command 109 110### Changed 111 1121. base: Stabilise pldm_msg_hdr_correlate_response() 1132. transport: af-mctp: Stabilise pldm_transport_af_mctp_bind() 1143. libpldm: Fix header use 1154. libpldm: More fixes for header use 1165. pdr: Stabilise pldm_pdr_find_last_in_range() API 1176. pdr: Stabilise pldm_entity_association_pdr_add_from_node_with_record_handle() 1187. oem: meta: stabilise decode_oem_meta_file_io_req() 1198. pdr: pldm_entity_association_tree_copy_root(): Document preconditions 120 121### Deprecated 122 1231. Deprecate `pldm_oem_ibm_fru_field_type` members that that are not prefixed 124 with `PLDM_OEM_IBM_` 125 126### Fixed 127 1281. libpldm: Rationalise the local and installed path of pldm.h 1292. pdr: Assign record_handle in entity_association_pdr_add_children() 1303. msgbuf: Require sensor data enum in pldm_msgbuf_extract_sensor_value() 1314. pdr: Remove redundant constant for minimum numeric sensor PDR length 1325. tests: oem: meta: Fix fileio use of msgbuf 133 134## [0.7.0] - 2023-08-29 135 136### Added 137 1381. state-set: Add new enum for Operational Fault Status enum 139 140### Changed 141 1421. transport: Match specified metadata in pldm_transport_send_recv_msg() 1432. transport: mctp-demux: Drop ABI annotation for internal symbols 1443. transport: Stabilise core transport and implementation APIs 145 146 This stabilisation covers the following headers and functions: 147 148 - libpldm/transport.h 149 150 - pldm_transport_poll() 151 - pldm_transport_send_msg() 152 - pldm_transport_recv_msg() 153 - pldm_transport_send_recv_msg() 154 155 - libpldm/transport/af-mctp.h 156 157 - pldm_transport_af_mctp_init() 158 - pldm_transport_af_mctp_destroy() 159 - pldm_transport_af_mctp_core() 160 - pldm_transport_af_mctp_init_pollfd() 161 - pldm_transport_af_mctp_map_tid() 162 - pldm_transport_af_mctp_unmap_tid() 163 164 - libpldm/transport/mctp-demux.h 165 - pldm_transport_mctp_demux_init() 166 - pldm_transport_mctp_demux_destroy() 167 - pldm_transport_mctp_demux_core() 168 - pldm_transport_mctp_demux_init_pollfd() 169 - pldm_transport_mctp_demux_map_tid() 170 - pldm_transport_mctp_demux_unmap_tid() 171 172### Deprecated 173 1741. All the existing "requester" APIs from `libpldm/pldm.h` (also known as 175 `libpldm/requester/pldm.h`): 176 177 - pldm_open() 178 - pldm_send_recv() 179 - pldm_send() 180 - pldm_recv() 181 - pldm_recv_any() 182 - pldm_close() 183 184 Users should migrate to the newer "transport" APIs instead. 185 186## Fixed 187 1881. tests: Exclude transport tests when build excludes testing ABIs 1892. abi: Capture deprecation of pldm_close() 190 191## [0.6.0] - 2023-08-22 192 193### Changed 194 1951. pdr: Avoid ID overflow in pldm_entity_association_tree_add_entity() 1962. meson: Apply `b_ndebug=if-release` by default 1973. pdr : Stabilize pldm_entity_association_tree_add_entity() 1984. pdr: Stabilise pldm_entity_association_tree_find_with_locality() 1995. pdr: Stabilize pldm_entity_node_get_remote_container_id() 2006. transport: af-mctp: Assign out-params on success in \*\_recv() 2017. transport: Generalise the pldm_transport_recv_msg() API 202 203### Removed 204 2051. pdr: Remove pldm_entity_association_pdr_add() 2062. state-set: Remove enum pldm_state_set_operational_fault_status_values 207 208### Fixed 209 2101. transport: register init_pollfd callback for af-mctp 2112. transport: fix init_pollfd function parameter 2123. transport: Fix doxygen and variables for send and recv functions 2134. transport: af-mctp: Ensure malloc() succeeds in \*\_recv() 214 215## [0.5.0] - 2023-08-09 216 217### Added 218 2191. pdr: Introduce pldm_entity_association_pdr_add_check() 220 221### Changed 222 2231. pdr: Allow record_handle to be NULL for pldm_pdr_add_check() 2242. transport: pldm_transport_poll(): Adjust return value semantics 2253. transport: free un-wanted responses in pldm_transport_send_recv_msg() 226 227### Deprecated 228 2291. state-set: Enum pldm_state_set_operational_fault_status_values 230 231 The enum operational_fault_status is defined with wrong members and will 232 eventually be replaced with the correct members. Any uses of 233 pldm_state_set_operational_fault_status_values members should move to 234 equivalent pldm_state_set_operational_stress_status_values members if needed. 235 2362. platform: Struct field name in fru_record_set PDR 237 238 References to entity_instance_num should be changed to entity_instance 239 2403. platform: Struct field name in numeric sensor value PDR 241 242 References to entity_instance_num should be changed to entity_instance 243 244### Removed 245 2461. bios_table: Remove pldm_bios_table_attr_entry_integer_encode_length() 2472. bios_table: Remove pldm_bios_table_attr_value_entry_encode_enum() 2483. bios_table: Remove pldm_bios_table_attr_value_entry_encode_string() 2494. bios_table: Remove pldm_bios_table_attr_value_entry_encode_integer() 2505. bios_table: Remove pldm_bios_table_append_pad_checksum() 2516. fru: Remove get_fru_record_by_option() 2527. pdr: Make is_present() static 2538. pdr: Remove pldm_pdr_add() 2549. pdr: Remove pldm_pdr_add_fru_record_set() 25510. pdr: Remove pldm_entity_association_pdr_add_from_node() 25611. pdr: Make find_entity_ref_in_tree() static 25712. pdr: Make entity_association_tree_find() static 258 259### Fixed 260 2611. requester: Fix response buffer cast in pldm_send_recv() 2622. pdr: Hoist record handle overflow test to avoid memory leak 2633. transport: Correct comparison in while loop condition 264 265## [0.4.0] - 2023-07-14 266 267### Added 268 2691. bios_table: Introduce pldm_bios_table_append_pad_checksum_check() 2702. fru: Introduce get_fru_record_by_option_check() 2713. pdr: Introduce pldm_entity_association_pdr_add_from_node_check() 2724. pdr: Introduce pldm_pdr_add_check() 2735. pdr: Introduce pldm_pdr_add_fru_record_set_check() 274 275### Changed 276 2771. requester: Mark pldm_close() as LIBPLDM_ABI_TESTING 2782. requester: Expose pldm_close() in header 2793. bios_table: pldm_bios_table_string_entry_encode_check(): Handle overflow 2804. bios_table: pldm_bios_table_iter_create(): Return NULL on failed alloc 2815. bios_table: pldm_bios_table_iter_next(): Invalid entry halts iteration 2826. pdr: pldm_pdr_init(): Return NULL on allocation failure 2837. pdr: pldm_pdr_destroy(): Exit early if repo is NULL 2848. pdr: Document preconditions for trivial accessor functions 285 286 A trivial accessor function is one that exposes properties of an object in a 287 way can't result in an error, beyond passing an invalid argument to the 288 function. For APIs meeting this definition we define a precondition that 289 struct pointers must point to valid objects to avoid polluting the function 290 prototypes. The following APIs now have this precondition explicitly defined: 291 292 - pldm_entity_extract() 293 - pldm_entity_get_parent() 294 - pldm_entity_is_exist_parent() 295 - pldm_entity_is_node_parent() 296 - pldm_is_current_parent_child 297 - pldm_is_empty_entity_assoc_tree() 298 - pldm_pdr_get_record_count() 299 - pldm_pdr_get_record_handle() 300 - pldm_pdr_get_repo_size() 301 - pldm_pdr_record_is_remote() 302 3039. pdr: pldm_entity_node_get_remote_container_id() is a trivial accessor 30410. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Exit early on NULL arguments 30511. pdr: pldm_entity_association_tree_init(): Return NULL on failed alloc 30612. pdr: pldm_entity_association_tree_visit(): Document preconditions 30713. pdr: pldm_entity_association_tree_visit(): Exit early on failure 30814. pdr: pldm_entity_association_tree_destroy(): Exit early on bad argument 30915. pdr: pldm_entity_get_num_children(): Return zero for invalid arguments 31016. pdr: pldm_is_current_parent_child(): Return false for invalid arguments 31117. pdr: pldm_entity_association_pdr_add(): Exit early on bad arguments 31218. pdr: pldm_find_entity_ref_in_tree(): Exit early on bad arguments 31319. pdr: pldm_entity_association_tree_find(): Early exit on bad arguments 31420. pdr: pldm_entity_association_tree_destroy_root(): Exit early on bad arg 31521. pdr: pldm_entity_association_pdr_extract(): Early exit on bad arguments 31622. pdr: pldm_entity_association_pdr_extract(): Assign out params at exit 31723. pdr: pldm_entity_get_num_children(): Don't return invalid values 31824. libpldm: Lift or remove asserts where a subsequent check exists 319 320### Deprecated 321 3221. pldm_bios_table_attr_entry_integer_encode() 323 324 Migrate to pldm_bios_table_attr_entry_integer_encode_check() 325 3262. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_enum() 327 328 Migrate to pldm_bios_table_attr_value_entry_encode_enum_check() 329 3303. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_string() 331 332 Migrate to pldm_bios_table_attr_value_entry_encode_string_check() 333 3344. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_integer() 335 336 Migrate to pldm_bios_table_attr_value_entry_encode_integer_check() 337 3385. pdr: Deprecate is_present() 339 340 There should be no users of this symbol. If you are a user, you should figure 341 out how to stop, or get in touch. This symbol will be marked static the 342 release after deprecation. 343 3446. pdr: Deprecate find_entity_ref_in_tree() 345 346 There should be no users of this symbol. If you are a user, you should figure 347 out how to stop, or get in touch. This symbol will be marked static the 348 release after deprecation. 349 3507. pdr: Deprecate entity_association_tree_find() 351 352 There should be no users of this symbol. If you are a user, you should figure 353 out how to stop, or get in touch. This symbol will be marked static the 354 release after deprecation. 355 3568. bios_table: Stabilise pldm_bios_table_append_pad_checksum_check() 357 358 pldm_bios_table_append_pad_checksum() is deprecated by this change. Users of 359 pldm_bios_table_append_pad_checksum() should migrate to 360 pldm_bios_table_append_pad_checksum_check() 361 3629. fru: Stabilise get_fru_record_by_option_check() 363 364 get_fru_record_by_option() is deprecated by this change. Users of 365 get_fru_record_by_option() should migrate to get_fru_record_by_option_check() 366 36710. pdr: Stabilise pldm_entity_association_pdr_add_from_node_check() 368 369 pldm_entity_association_pdr_add_from_node() is deprecated by this change. 370 Users of pldm_entity_association_pdr_add_from_node() should migrate to 371 pldm_entity_association_pdr_add_from_node_check() 372 37311. pdr: Stabilise pldm_pdr_add_check() 374 375 pldm_pdr_add() is deprecated by this change. Users of pldm_pdr_add() should 376 migrate to pldm_pdr_add_check() 377 37812. pdr: Stabilise pldm_pdr_add_fru_record_set_check() 379 380 pldm_pdr_add_fru_record_set() is deprecated by this change. Users of 381 pldm_pdr_add_fru_record_set() should migrate to 382 pldm_pdr_add_fru_record_set_check() 383 384### Removed 385 3861. bios_table: Remove deprecated APIs sanitized by assert(): 387 388 - pldm_bios_table_string_entry_encode() 389 - pldm_bios_table_string_entry_decode_string() 390 - pldm_bios_table_attr_entry_enum_encode() 391 - pldm_bios_table_attr_entry_enum_decode_pv_num() 392 - pldm_bios_table_attr_entry_enum_decode_def_num() 393 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 394 - pldm_bios_table_attr_entry_string_encode() 395 - pldm_bios_table_attr_entry_string_decode_def_string_length() 396 397### Fixed 398 3991. pdr: Return success for pldm_pdr_find_child_container_id_range_exclude() API 4002. pdr: Rework pldm_pdr_find_container_id_range_exclude() API 4013. transport: mctp-demux: Don't test socket for non-zero value 4024. requester: Return PLDM_REQUESTER_OPEN_FAIL from pldm_open() on error 4035. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Document reality of return 4046. transport: Fix possible NULL ptr deref in pldm_socket_sndbuf_init() 4057. abi: Update to remove pldm_close() from reference dumps 4068. bios_table: Annotate pldm_bios_table_attr_value_entry_encode_integer() 407 408## [0.3.0] - 2023-06-23 409 410### Added 411 4121. Add encode/decode pldmMessagePollEvent data 4132. README: Add a section on working with libpldm 4143. pdr: Introduce remote_container_id and associated APIs 4154. pdr: Add APIs for creating and locating remote PDRs 4165. pdr: Add pldm_pdr_find_last_in_range() 4176. pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle() 4187. pdr: Add pldm_pdr_find_container_id_range_exclude() 419 420### Changed 421 4221. include: Move installed transport.h under libpldm/ 4232. libpldm: Explicit deprecated, stable and testing ABI classes 4243. meson: Reduce strength of oem-ibm requirements from enabled to allowed 425 426 The `oem-ibm` feature is now enabled by the default meson configuration, for 427 CI purposes. `oem-ibm` is still disabled by default in the `libpldm` bitbake 428 recipe: 429 430 <https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/libpldm/libpldm_git.bb#L10> 431 432 To disable `oem-ibm` in your development builds, pass `-Doem-ibm=disabled` 433 when invoking `meson setup` 434 4354. bios_table: Relax pldm_bios_table_string_entry_decode_string_check() 4365. bios_table: Relax pldm_bios_table_attr_entry_enum_decode_pv_hdls_check() 437 438### Deprecated 439 4401. bios_table: Deprecate APIs with arguments sanitized using assert() 441 442 C provides enough foot-guns without us encoding them into library APIs. 443 Specifically, deprecate the following in favour of their `*_check()` variants 444 which ensure assertions won't fail or otherwise invoke UB: 445 446 - pldm_bios_table_string_entry_encode() 447 - pldm_bios_table_string_entry_decode_string() 448 - pldm_bios_table_attr_entry_enum_encode() 449 - pldm_bios_table_attr_entry_enum_decode_pv_num() 450 - pldm_bios_table_attr_entry_enum_decode_def_num() 451 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 452 - pldm_bios_table_attr_entry_string_encode() 453 - pldm_bios_table_attr_entry_string_decode_def_string_length() 454 455### Removed 456 4571. libpldm: Remove the requester-api option 458 459### Fixed 460 4611. requester: Make pldm_open() return existing fd 4622. transport: Prevent sticking in waiting for response 4633. transport: Match on response in pldm_transport_send_recv_msg() 4644. requester: Add check before accessing hdr in pldm_recv() 4655. bios_table: pldm_bios_table_attr_entry_string_info_check() NULL deref 466