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_attr_entry_enum_decode_def_num_check()` 50 - `pldm_bios_table_attr_entry_enum_decode_pv_hdls_check()` 51 - `pldm_bios_table_attr_entry_enum_decode_pv_num_check()` 52 - `pldm_bios_table_attr_entry_enum_encode_check()` 53 - `pldm_bios_table_attr_entry_integer_encode_check()` 54 - `pldm_bios_table_attr_entry_string_decode_def_string_length_check()` 55 - `pldm_bios_table_attr_entry_string_encode_check()` 56 - `pldm_bios_table_attr_value_entry_encode_enum_check()` 57 - `pldm_bios_table_attr_value_entry_encode_string_check()` 58 - `pldm_bios_table_string_entry_decode_string_check()` 59 - `pldm_bios_table_string_entry_encode_check()` 60 - `pldm_entity_association_pdr_add_check()` 61 - `pldm_entity_association_pdr_add_from_node_check()` 62 - `pldm_pdr_add_check()` 63 - `pldm_pdr_add_fru_record_set_check()` 64 65[clang-rename]: https://clang.llvm.org/extra/clang-rename.html 66 67### Removed 68 691. IBM OEM header compatibility symlinks. 70 71 Anyone left using the deprecated paths can migrate using the coccinelle patch 72 at `evolutions/current/oem-ibm-header-compat.cocci`. 73 74### Fixed 75 761. requester: instance-id: Release read lock on conflict 77 78## [0.8.0] - 2024-05-23 79 80### Added 81 821. base: Provide pldm_msg_hdr_correlate_response() 832. transport: af-mctp: Add pldm_transport_af_mctp_bind() 843. oem: ibm: Add chapdata file type support 854. base: Added PLDM_SMBIOS & PLDM_RDE message types 865. oem: meta: Add decode_oem_meta_file_io_req() 876. state-set: Add all state set values to system power state enum as per DSP0249 887. platform: Add alias members to the enum 89 pldm_pdr_repository_chg_event_change_record_event_data_operation. 90 91 enum constants with inconsistent names are deprecated with this change. 92 remove old inconsistent enum members after backward compatibility cleanup is 93 done 94 958. oem-ibm: Alias `pldm_oem_ibm_fru_field_type` members as `PLDM_OEM_IBM_*` 969. oem: ibm: Add Firmware Update Access Key(UAK) as a FRU field type 9710. platform: Add 3 PDR type enum for Redfish Device Enablement per 98 DSP0248_1.2.0 9911. state_set: Add CONNECTED and DISCONNECTED enum for Link State set 10012. entity: Add enum for Network Interface Connectors and Network Ports 101 Connection Types 10213. pdr: Add decode_numeric_effecter_pdr_data() 10314. oem: ibm: Support for the Real SAI entity id 10415. fw_update: Add encode req & decode resp for query_downstream_devices 10516. fw_update: Add encode req & decode resp for query_downstream_identifiers 10617. platform: Add support for GetStateEffecterStates command 107 108### Changed 109 1101. base: Stabilise pldm_msg_hdr_correlate_response() 1112. transport: af-mctp: Stabilise pldm_transport_af_mctp_bind() 1123. libpldm: Fix header use 1134. libpldm: More fixes for header use 1145. pdr: Stabilise pldm_pdr_find_last_in_range() API 1156. pdr: Stabilise pldm_entity_association_pdr_add_from_node_with_record_handle() 1167. oem: meta: stabilise decode_oem_meta_file_io_req() 1178. pdr: pldm_entity_association_tree_copy_root(): Document preconditions 118 119### Deprecated 120 1211. Deprecate `pldm_oem_ibm_fru_field_type` members that that are not prefixed 122 with `PLDM_OEM_IBM_` 123 124### Fixed 125 1261. libpldm: Rationalise the local and installed path of pldm.h 1272. pdr: Assign record_handle in entity_association_pdr_add_children() 1283. msgbuf: Require sensor data enum in pldm_msgbuf_extract_sensor_value() 1294. pdr: Remove redundant constant for minimum numeric sensor PDR length 1305. tests: oem: meta: Fix fileio use of msgbuf 131 132## [0.7.0] - 2023-08-29 133 134### Added 135 1361. state-set: Add new enum for Operational Fault Status enum 137 138### Changed 139 1401. transport: Match specified metadata in pldm_transport_send_recv_msg() 1412. transport: mctp-demux: Drop ABI annotation for internal symbols 1423. transport: Stabilise core transport and implementation APIs 143 144 This stabilisation covers the following headers and functions: 145 146 - libpldm/transport.h 147 148 - pldm_transport_poll() 149 - pldm_transport_send_msg() 150 - pldm_transport_recv_msg() 151 - pldm_transport_send_recv_msg() 152 153 - libpldm/transport/af-mctp.h 154 155 - pldm_transport_af_mctp_init() 156 - pldm_transport_af_mctp_destroy() 157 - pldm_transport_af_mctp_core() 158 - pldm_transport_af_mctp_init_pollfd() 159 - pldm_transport_af_mctp_map_tid() 160 - pldm_transport_af_mctp_unmap_tid() 161 162 - libpldm/transport/mctp-demux.h 163 - pldm_transport_mctp_demux_init() 164 - pldm_transport_mctp_demux_destroy() 165 - pldm_transport_mctp_demux_core() 166 - pldm_transport_mctp_demux_init_pollfd() 167 - pldm_transport_mctp_demux_map_tid() 168 - pldm_transport_mctp_demux_unmap_tid() 169 170### Deprecated 171 1721. All the existing "requester" APIs from `libpldm/pldm.h` (also known as 173 `libpldm/requester/pldm.h`): 174 175 - pldm_open() 176 - pldm_send_recv() 177 - pldm_send() 178 - pldm_recv() 179 - pldm_recv_any() 180 - pldm_close() 181 182 Users should migrate to the newer "transport" APIs instead. 183 184## Fixed 185 1861. tests: Exclude transport tests when build excludes testing ABIs 1872. abi: Capture deprecation of pldm_close() 188 189## [0.6.0] - 2023-08-22 190 191### Changed 192 1931. pdr: Avoid ID overflow in pldm_entity_association_tree_add_entity() 1942. meson: Apply `b_ndebug=if-release` by default 1953. pdr : Stabilize pldm_entity_association_tree_add_entity() 1964. pdr: Stabilise pldm_entity_association_tree_find_with_locality() 1975. pdr: Stabilize pldm_entity_node_get_remote_container_id() 1986. transport: af-mctp: Assign out-params on success in \*\_recv() 1997. transport: Generalise the pldm_transport_recv_msg() API 200 201### Removed 202 2031. pdr: Remove pldm_entity_association_pdr_add() 2042. state-set: Remove enum pldm_state_set_operational_fault_status_values 205 206### Fixed 207 2081. transport: register init_pollfd callback for af-mctp 2092. transport: fix init_pollfd function parameter 2103. transport: Fix doxygen and variables for send and recv functions 2114. transport: af-mctp: Ensure malloc() succeeds in \*\_recv() 212 213## [0.5.0] - 2023-08-09 214 215### Added 216 2171. pdr: Introduce pldm_entity_association_pdr_add_check() 218 219### Changed 220 2211. pdr: Allow record_handle to be NULL for pldm_pdr_add_check() 2222. transport: pldm_transport_poll(): Adjust return value semantics 2233. transport: free un-wanted responses in pldm_transport_send_recv_msg() 224 225### Deprecated 226 2271. state-set: Enum pldm_state_set_operational_fault_status_values 228 229 The enum operational_fault_status is defined with wrong members and will 230 eventually be replaced with the correct members. Any uses of 231 pldm_state_set_operational_fault_status_values members should move to 232 equivalent pldm_state_set_operational_stress_status_values members if needed. 233 2342. platform: Struct field name in fru_record_set PDR 235 236 References to entity_instance_num should be changed to entity_instance 237 2383. platform: Struct field name in numeric sensor value PDR 239 240 References to entity_instance_num should be changed to entity_instance 241 242### Removed 243 2441. bios_table: Remove pldm_bios_table_attr_entry_integer_encode_length() 2452. bios_table: Remove pldm_bios_table_attr_value_entry_encode_enum() 2463. bios_table: Remove pldm_bios_table_attr_value_entry_encode_string() 2474. bios_table: Remove pldm_bios_table_attr_value_entry_encode_integer() 2485. bios_table: Remove pldm_bios_table_append_pad_checksum() 2496. fru: Remove get_fru_record_by_option() 2507. pdr: Make is_present() static 2518. pdr: Remove pldm_pdr_add() 2529. pdr: Remove pldm_pdr_add_fru_record_set() 25310. pdr: Remove pldm_entity_association_pdr_add_from_node() 25411. pdr: Make find_entity_ref_in_tree() static 25512. pdr: Make entity_association_tree_find() static 256 257### Fixed 258 2591. requester: Fix response buffer cast in pldm_send_recv() 2602. pdr: Hoist record handle overflow test to avoid memory leak 2613. transport: Correct comparison in while loop condition 262 263## [0.4.0] - 2023-07-14 264 265### Added 266 2671. bios_table: Introduce pldm_bios_table_append_pad_checksum_check() 2682. fru: Introduce get_fru_record_by_option_check() 2693. pdr: Introduce pldm_entity_association_pdr_add_from_node_check() 2704. pdr: Introduce pldm_pdr_add_check() 2715. pdr: Introduce pldm_pdr_add_fru_record_set_check() 272 273### Changed 274 2751. requester: Mark pldm_close() as LIBPLDM_ABI_TESTING 2762. requester: Expose pldm_close() in header 2773. bios_table: pldm_bios_table_string_entry_encode_check(): Handle overflow 2784. bios_table: pldm_bios_table_iter_create(): Return NULL on failed alloc 2795. bios_table: pldm_bios_table_iter_next(): Invalid entry halts iteration 2806. pdr: pldm_pdr_init(): Return NULL on allocation failure 2817. pdr: pldm_pdr_destroy(): Exit early if repo is NULL 2828. pdr: Document preconditions for trivial accessor functions 283 284 A trivial accessor function is one that exposes properties of an object in a 285 way can't result in an error, beyond passing an invalid argument to the 286 function. For APIs meeting this definition we define a precondition that 287 struct pointers must point to valid objects to avoid polluting the function 288 prototypes. The following APIs now have this precondition explicitly defined: 289 290 - pldm_entity_extract() 291 - pldm_entity_get_parent() 292 - pldm_entity_is_exist_parent() 293 - pldm_entity_is_node_parent() 294 - pldm_is_current_parent_child 295 - pldm_is_empty_entity_assoc_tree() 296 - pldm_pdr_get_record_count() 297 - pldm_pdr_get_record_handle() 298 - pldm_pdr_get_repo_size() 299 - pldm_pdr_record_is_remote() 300 3019. pdr: pldm_entity_node_get_remote_container_id() is a trivial accessor 30210. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Exit early on NULL arguments 30311. pdr: pldm_entity_association_tree_init(): Return NULL on failed alloc 30412. pdr: pldm_entity_association_tree_visit(): Document preconditions 30513. pdr: pldm_entity_association_tree_visit(): Exit early on failure 30614. pdr: pldm_entity_association_tree_destroy(): Exit early on bad argument 30715. pdr: pldm_entity_get_num_children(): Return zero for invalid arguments 30816. pdr: pldm_is_current_parent_child(): Return false for invalid arguments 30917. pdr: pldm_entity_association_pdr_add(): Exit early on bad arguments 31018. pdr: pldm_find_entity_ref_in_tree(): Exit early on bad arguments 31119. pdr: pldm_entity_association_tree_find(): Early exit on bad arguments 31220. pdr: pldm_entity_association_tree_destroy_root(): Exit early on bad arg 31321. pdr: pldm_entity_association_pdr_extract(): Early exit on bad arguments 31422. pdr: pldm_entity_association_pdr_extract(): Assign out params at exit 31523. pdr: pldm_entity_get_num_children(): Don't return invalid values 31624. libpldm: Lift or remove asserts where a subsequent check exists 317 318### Deprecated 319 3201. pldm_bios_table_attr_entry_integer_encode() 321 322 Migrate to pldm_bios_table_attr_entry_integer_encode_check() 323 3242. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_enum() 325 326 Migrate to pldm_bios_table_attr_value_entry_encode_enum_check() 327 3283. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_string() 329 330 Migrate to pldm_bios_table_attr_value_entry_encode_string_check() 331 3324. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_integer() 333 334 Migrate to pldm_bios_table_attr_value_entry_encode_integer_check() 335 3365. pdr: Deprecate is_present() 337 338 There should be no users of this symbol. If you are a user, you should figure 339 out how to stop, or get in touch. This symbol will be marked static the 340 release after deprecation. 341 3426. pdr: Deprecate find_entity_ref_in_tree() 343 344 There should be no users of this symbol. If you are a user, you should figure 345 out how to stop, or get in touch. This symbol will be marked static the 346 release after deprecation. 347 3487. pdr: Deprecate entity_association_tree_find() 349 350 There should be no users of this symbol. If you are a user, you should figure 351 out how to stop, or get in touch. This symbol will be marked static the 352 release after deprecation. 353 3548. bios_table: Stabilise pldm_bios_table_append_pad_checksum_check() 355 356 pldm_bios_table_append_pad_checksum() is deprecated by this change. Users of 357 pldm_bios_table_append_pad_checksum() should migrate to 358 pldm_bios_table_append_pad_checksum_check() 359 3609. fru: Stabilise get_fru_record_by_option_check() 361 362 get_fru_record_by_option() is deprecated by this change. Users of 363 get_fru_record_by_option() should migrate to get_fru_record_by_option_check() 364 36510. pdr: Stabilise pldm_entity_association_pdr_add_from_node_check() 366 367 pldm_entity_association_pdr_add_from_node() is deprecated by this change. 368 Users of pldm_entity_association_pdr_add_from_node() should migrate to 369 pldm_entity_association_pdr_add_from_node_check() 370 37111. pdr: Stabilise pldm_pdr_add_check() 372 373 pldm_pdr_add() is deprecated by this change. Users of pldm_pdr_add() should 374 migrate to pldm_pdr_add_check() 375 37612. pdr: Stabilise pldm_pdr_add_fru_record_set_check() 377 378 pldm_pdr_add_fru_record_set() is deprecated by this change. Users of 379 pldm_pdr_add_fru_record_set() should migrate to 380 pldm_pdr_add_fru_record_set_check() 381 382### Removed 383 3841. bios_table: Remove deprecated APIs sanitized by assert(): 385 386 - pldm_bios_table_string_entry_encode() 387 - pldm_bios_table_string_entry_decode_string() 388 - pldm_bios_table_attr_entry_enum_encode() 389 - pldm_bios_table_attr_entry_enum_decode_pv_num() 390 - pldm_bios_table_attr_entry_enum_decode_def_num() 391 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 392 - pldm_bios_table_attr_entry_string_encode() 393 - pldm_bios_table_attr_entry_string_decode_def_string_length() 394 395### Fixed 396 3971. pdr: Return success for pldm_pdr_find_child_container_id_range_exclude() API 3982. pdr: Rework pldm_pdr_find_container_id_range_exclude() API 3993. transport: mctp-demux: Don't test socket for non-zero value 4004. requester: Return PLDM_REQUESTER_OPEN_FAIL from pldm_open() on error 4015. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Document reality of return 4026. transport: Fix possible NULL ptr deref in pldm_socket_sndbuf_init() 4037. abi: Update to remove pldm_close() from reference dumps 4048. bios_table: Annotate pldm_bios_table_attr_value_entry_encode_integer() 405 406## [0.3.0] - 2023-06-23 407 408### Added 409 4101. Add encode/decode pldmMessagePollEvent data 4112. README: Add a section on working with libpldm 4123. pdr: Introduce remote_container_id and associated APIs 4134. pdr: Add APIs for creating and locating remote PDRs 4145. pdr: Add pldm_pdr_find_last_in_range() 4156. pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle() 4167. pdr: Add pldm_pdr_find_container_id_range_exclude() 417 418### Changed 419 4201. include: Move installed transport.h under libpldm/ 4212. libpldm: Explicit deprecated, stable and testing ABI classes 4223. meson: Reduce strength of oem-ibm requirements from enabled to allowed 423 424 The `oem-ibm` feature is now enabled by the default meson configuration, for 425 CI purposes. `oem-ibm` is still disabled by default in the `libpldm` bitbake 426 recipe: 427 428 <https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/libpldm/libpldm_git.bb#L10> 429 430 To disable `oem-ibm` in your development builds, pass `-Doem-ibm=disabled` 431 when invoking `meson setup` 432 4334. bios_table: Relax pldm_bios_table_string_entry_decode_string_check() 4345. bios_table: Relax pldm_bios_table_attr_entry_enum_decode_pv_hdls_check() 435 436### Deprecated 437 4381. bios_table: Deprecate APIs with arguments sanitized using assert() 439 440 C provides enough foot-guns without us encoding them into library APIs. 441 Specifically, deprecate the following in favour of their `*_check()` variants 442 which ensure assertions won't fail or otherwise invoke UB: 443 444 - pldm_bios_table_string_entry_encode() 445 - pldm_bios_table_string_entry_decode_string() 446 - pldm_bios_table_attr_entry_enum_encode() 447 - pldm_bios_table_attr_entry_enum_decode_pv_num() 448 - pldm_bios_table_attr_entry_enum_decode_def_num() 449 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 450 - pldm_bios_table_attr_entry_string_encode() 451 - pldm_bios_table_attr_entry_string_decode_def_string_length() 452 453### Removed 454 4551. libpldm: Remove the requester-api option 456 457### Fixed 458 4591. requester: Make pldm_open() return existing fd 4602. transport: Prevent sticking in waiting for response 4613. transport: Match on response in pldm_transport_send_recv_msg() 4624. requester: Add check before accessing hdr in pldm_recv() 4635. bios_table: pldm_bios_table_attr_entry_string_info_check() NULL deref 464