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_string_decode_def_string_length_check()` 54 - `pldm_bios_table_attr_entry_string_encode_check()` 55 - `pldm_bios_table_string_entry_decode_string_check()` 56 - `pldm_bios_table_string_entry_encode_check()` 57 - `pldm_entity_association_pdr_add_check()` 58 - `pldm_entity_association_pdr_add_from_node_check()` 59 - `pldm_pdr_add_check()` 60 - `pldm_pdr_add_fru_record_set_check()` 61 62[clang-rename]: https://clang.llvm.org/extra/clang-rename.html 63 64### Removed 65 661. IBM OEM header compatibility symlinks. 67 68 Anyone left using the deprecated paths can migrate using the coccinelle patch 69 at `evolutions/current/oem-ibm-header-compat.cocci`. 70 71### Fixed 72 731. requester: instance-id: Release read lock on conflict 74 75## [0.8.0] - 2024-05-23 76 77### Added 78 791. base: Provide pldm_msg_hdr_correlate_response() 802. transport: af-mctp: Add pldm_transport_af_mctp_bind() 813. oem: ibm: Add chapdata file type support 824. base: Added PLDM_SMBIOS & PLDM_RDE message types 835. oem: meta: Add decode_oem_meta_file_io_req() 846. state-set: Add all state set values to system power state enum as per DSP0249 857. platform: Add alias members to the enum 86 pldm_pdr_repository_chg_event_change_record_event_data_operation. 87 88 enum constants with inconsistent names are deprecated with this change. 89 remove old inconsistent enum members after backward compatibility cleanup is 90 done 91 928. oem-ibm: Alias `pldm_oem_ibm_fru_field_type` members as `PLDM_OEM_IBM_*` 939. oem: ibm: Add Firmware Update Access Key(UAK) as a FRU field type 9410. platform: Add 3 PDR type enum for Redfish Device Enablement per 95 DSP0248_1.2.0 9611. state_set: Add CONNECTED and DISCONNECTED enum for Link State set 9712. entity: Add enum for Network Interface Connectors and Network Ports 98 Connection Types 9913. pdr: Add decode_numeric_effecter_pdr_data() 10014. oem: ibm: Support for the Real SAI entity id 10115. fw_update: Add encode req & decode resp for query_downstream_devices 10216. fw_update: Add encode req & decode resp for query_downstream_identifiers 10317. platform: Add support for GetStateEffecterStates command 104 105### Changed 106 1071. base: Stabilise pldm_msg_hdr_correlate_response() 1082. transport: af-mctp: Stabilise pldm_transport_af_mctp_bind() 1093. libpldm: Fix header use 1104. libpldm: More fixes for header use 1115. pdr: Stabilise pldm_pdr_find_last_in_range() API 1126. pdr: Stabilise pldm_entity_association_pdr_add_from_node_with_record_handle() 1137. oem: meta: stabilise decode_oem_meta_file_io_req() 1148. pdr: pldm_entity_association_tree_copy_root(): Document preconditions 115 116### Deprecated 117 1181. Deprecate `pldm_oem_ibm_fru_field_type` members that that are not prefixed 119 with `PLDM_OEM_IBM_` 120 121### Fixed 122 1231. libpldm: Rationalise the local and installed path of pldm.h 1242. pdr: Assign record_handle in entity_association_pdr_add_children() 1253. msgbuf: Require sensor data enum in pldm_msgbuf_extract_sensor_value() 1264. pdr: Remove redundant constant for minimum numeric sensor PDR length 1275. tests: oem: meta: Fix fileio use of msgbuf 128 129## [0.7.0] - 2023-08-29 130 131### Added 132 1331. state-set: Add new enum for Operational Fault Status enum 134 135### Changed 136 1371. transport: Match specified metadata in pldm_transport_send_recv_msg() 1382. transport: mctp-demux: Drop ABI annotation for internal symbols 1393. transport: Stabilise core transport and implementation APIs 140 141 This stabilisation covers the following headers and functions: 142 143 - libpldm/transport.h 144 145 - pldm_transport_poll() 146 - pldm_transport_send_msg() 147 - pldm_transport_recv_msg() 148 - pldm_transport_send_recv_msg() 149 150 - libpldm/transport/af-mctp.h 151 152 - pldm_transport_af_mctp_init() 153 - pldm_transport_af_mctp_destroy() 154 - pldm_transport_af_mctp_core() 155 - pldm_transport_af_mctp_init_pollfd() 156 - pldm_transport_af_mctp_map_tid() 157 - pldm_transport_af_mctp_unmap_tid() 158 159 - libpldm/transport/mctp-demux.h 160 - pldm_transport_mctp_demux_init() 161 - pldm_transport_mctp_demux_destroy() 162 - pldm_transport_mctp_demux_core() 163 - pldm_transport_mctp_demux_init_pollfd() 164 - pldm_transport_mctp_demux_map_tid() 165 - pldm_transport_mctp_demux_unmap_tid() 166 167### Deprecated 168 1691. All the existing "requester" APIs from `libpldm/pldm.h` (also known as 170 `libpldm/requester/pldm.h`): 171 172 - pldm_open() 173 - pldm_send_recv() 174 - pldm_send() 175 - pldm_recv() 176 - pldm_recv_any() 177 - pldm_close() 178 179 Users should migrate to the newer "transport" APIs instead. 180 181## Fixed 182 1831. tests: Exclude transport tests when build excludes testing ABIs 1842. abi: Capture deprecation of pldm_close() 185 186## [0.6.0] - 2023-08-22 187 188### Changed 189 1901. pdr: Avoid ID overflow in pldm_entity_association_tree_add_entity() 1912. meson: Apply `b_ndebug=if-release` by default 1923. pdr : Stabilize pldm_entity_association_tree_add_entity() 1934. pdr: Stabilise pldm_entity_association_tree_find_with_locality() 1945. pdr: Stabilize pldm_entity_node_get_remote_container_id() 1956. transport: af-mctp: Assign out-params on success in \*\_recv() 1967. transport: Generalise the pldm_transport_recv_msg() API 197 198### Removed 199 2001. pdr: Remove pldm_entity_association_pdr_add() 2012. state-set: Remove enum pldm_state_set_operational_fault_status_values 202 203### Fixed 204 2051. transport: register init_pollfd callback for af-mctp 2062. transport: fix init_pollfd function parameter 2073. transport: Fix doxygen and variables for send and recv functions 2084. transport: af-mctp: Ensure malloc() succeeds in \*\_recv() 209 210## [0.5.0] - 2023-08-09 211 212### Added 213 2141. pdr: Introduce pldm_entity_association_pdr_add_check() 215 216### Changed 217 2181. pdr: Allow record_handle to be NULL for pldm_pdr_add_check() 2192. transport: pldm_transport_poll(): Adjust return value semantics 2203. transport: free un-wanted responses in pldm_transport_send_recv_msg() 221 222### Deprecated 223 2241. state-set: Enum pldm_state_set_operational_fault_status_values 225 226 The enum operational_fault_status is defined with wrong members and will 227 eventually be replaced with the correct members. Any uses of 228 pldm_state_set_operational_fault_status_values members should move to 229 equivalent pldm_state_set_operational_stress_status_values members if needed. 230 2312. platform: Struct field name in fru_record_set PDR 232 233 References to entity_instance_num should be changed to entity_instance 234 2353. platform: Struct field name in numeric sensor value PDR 236 237 References to entity_instance_num should be changed to entity_instance 238 239### Removed 240 2411. bios_table: Remove pldm_bios_table_attr_entry_integer_encode_length() 2422. bios_table: Remove pldm_bios_table_attr_value_entry_encode_enum() 2433. bios_table: Remove pldm_bios_table_attr_value_entry_encode_string() 2444. bios_table: Remove pldm_bios_table_attr_value_entry_encode_integer() 2455. bios_table: Remove pldm_bios_table_append_pad_checksum() 2466. fru: Remove get_fru_record_by_option() 2477. pdr: Make is_present() static 2488. pdr: Remove pldm_pdr_add() 2499. pdr: Remove pldm_pdr_add_fru_record_set() 25010. pdr: Remove pldm_entity_association_pdr_add_from_node() 25111. pdr: Make find_entity_ref_in_tree() static 25212. pdr: Make entity_association_tree_find() static 253 254### Fixed 255 2561. requester: Fix response buffer cast in pldm_send_recv() 2572. pdr: Hoist record handle overflow test to avoid memory leak 2583. transport: Correct comparison in while loop condition 259 260## [0.4.0] - 2023-07-14 261 262### Added 263 2641. bios_table: Introduce pldm_bios_table_append_pad_checksum_check() 2652. fru: Introduce get_fru_record_by_option_check() 2663. pdr: Introduce pldm_entity_association_pdr_add_from_node_check() 2674. pdr: Introduce pldm_pdr_add_check() 2685. pdr: Introduce pldm_pdr_add_fru_record_set_check() 269 270### Changed 271 2721. requester: Mark pldm_close() as LIBPLDM_ABI_TESTING 2732. requester: Expose pldm_close() in header 2743. bios_table: pldm_bios_table_string_entry_encode_check(): Handle overflow 2754. bios_table: pldm_bios_table_iter_create(): Return NULL on failed alloc 2765. bios_table: pldm_bios_table_iter_next(): Invalid entry halts iteration 2776. pdr: pldm_pdr_init(): Return NULL on allocation failure 2787. pdr: pldm_pdr_destroy(): Exit early if repo is NULL 2798. pdr: Document preconditions for trivial accessor functions 280 281 A trivial accessor function is one that exposes properties of an object in a 282 way can't result in an error, beyond passing an invalid argument to the 283 function. For APIs meeting this definition we define a precondition that 284 struct pointers must point to valid objects to avoid polluting the function 285 prototypes. The following APIs now have this precondition explicitly defined: 286 287 - pldm_entity_extract() 288 - pldm_entity_get_parent() 289 - pldm_entity_is_exist_parent() 290 - pldm_entity_is_node_parent() 291 - pldm_is_current_parent_child 292 - pldm_is_empty_entity_assoc_tree() 293 - pldm_pdr_get_record_count() 294 - pldm_pdr_get_record_handle() 295 - pldm_pdr_get_repo_size() 296 - pldm_pdr_record_is_remote() 297 2989. pdr: pldm_entity_node_get_remote_container_id() is a trivial accessor 29910. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Exit early on NULL arguments 30011. pdr: pldm_entity_association_tree_init(): Return NULL on failed alloc 30112. pdr: pldm_entity_association_tree_visit(): Document preconditions 30213. pdr: pldm_entity_association_tree_visit(): Exit early on failure 30314. pdr: pldm_entity_association_tree_destroy(): Exit early on bad argument 30415. pdr: pldm_entity_get_num_children(): Return zero for invalid arguments 30516. pdr: pldm_is_current_parent_child(): Return false for invalid arguments 30617. pdr: pldm_entity_association_pdr_add(): Exit early on bad arguments 30718. pdr: pldm_find_entity_ref_in_tree(): Exit early on bad arguments 30819. pdr: pldm_entity_association_tree_find(): Early exit on bad arguments 30920. pdr: pldm_entity_association_tree_destroy_root(): Exit early on bad arg 31021. pdr: pldm_entity_association_pdr_extract(): Early exit on bad arguments 31122. pdr: pldm_entity_association_pdr_extract(): Assign out params at exit 31223. pdr: pldm_entity_get_num_children(): Don't return invalid values 31324. libpldm: Lift or remove asserts where a subsequent check exists 314 315### Deprecated 316 3171. pldm_bios_table_attr_entry_integer_encode() 318 319 Migrate to pldm_bios_table_attr_entry_integer_encode_check() 320 3212. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_enum() 322 323 Migrate to pldm_bios_table_attr_value_entry_encode_enum_check() 324 3253. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_string() 326 327 Migrate to pldm_bios_table_attr_value_entry_encode_string_check() 328 3294. bios_table: Deprecate pldm_bios_table_attr_value_entry_encode_integer() 330 331 Migrate to pldm_bios_table_attr_value_entry_encode_integer_check() 332 3335. pdr: Deprecate is_present() 334 335 There should be no users of this symbol. If you are a user, you should figure 336 out how to stop, or get in touch. This symbol will be marked static the 337 release after deprecation. 338 3396. pdr: Deprecate find_entity_ref_in_tree() 340 341 There should be no users of this symbol. If you are a user, you should figure 342 out how to stop, or get in touch. This symbol will be marked static the 343 release after deprecation. 344 3457. pdr: Deprecate entity_association_tree_find() 346 347 There should be no users of this symbol. If you are a user, you should figure 348 out how to stop, or get in touch. This symbol will be marked static the 349 release after deprecation. 350 3518. bios_table: Stabilise pldm_bios_table_append_pad_checksum_check() 352 353 pldm_bios_table_append_pad_checksum() is deprecated by this change. Users of 354 pldm_bios_table_append_pad_checksum() should migrate to 355 pldm_bios_table_append_pad_checksum_check() 356 3579. fru: Stabilise get_fru_record_by_option_check() 358 359 get_fru_record_by_option() is deprecated by this change. Users of 360 get_fru_record_by_option() should migrate to get_fru_record_by_option_check() 361 36210. pdr: Stabilise pldm_entity_association_pdr_add_from_node_check() 363 364 pldm_entity_association_pdr_add_from_node() is deprecated by this change. 365 Users of pldm_entity_association_pdr_add_from_node() should migrate to 366 pldm_entity_association_pdr_add_from_node_check() 367 36811. pdr: Stabilise pldm_pdr_add_check() 369 370 pldm_pdr_add() is deprecated by this change. Users of pldm_pdr_add() should 371 migrate to pldm_pdr_add_check() 372 37312. pdr: Stabilise pldm_pdr_add_fru_record_set_check() 374 375 pldm_pdr_add_fru_record_set() is deprecated by this change. Users of 376 pldm_pdr_add_fru_record_set() should migrate to 377 pldm_pdr_add_fru_record_set_check() 378 379### Removed 380 3811. bios_table: Remove deprecated APIs sanitized by assert(): 382 383 - pldm_bios_table_string_entry_encode() 384 - pldm_bios_table_string_entry_decode_string() 385 - pldm_bios_table_attr_entry_enum_encode() 386 - pldm_bios_table_attr_entry_enum_decode_pv_num() 387 - pldm_bios_table_attr_entry_enum_decode_def_num() 388 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 389 - pldm_bios_table_attr_entry_string_encode() 390 - pldm_bios_table_attr_entry_string_decode_def_string_length() 391 392### Fixed 393 3941. pdr: Return success for pldm_pdr_find_child_container_id_range_exclude() API 3952. pdr: Rework pldm_pdr_find_container_id_range_exclude() API 3963. transport: mctp-demux: Don't test socket for non-zero value 3974. requester: Return PLDM_REQUESTER_OPEN_FAIL from pldm_open() on error 3985. pdr: pldm_pdr_fru_record_set_find_by_rsi(): Document reality of return 3996. transport: Fix possible NULL ptr deref in pldm_socket_sndbuf_init() 4007. abi: Update to remove pldm_close() from reference dumps 4018. bios_table: Annotate pldm_bios_table_attr_value_entry_encode_integer() 402 403## [0.3.0] - 2023-06-23 404 405### Added 406 4071. Add encode/decode pldmMessagePollEvent data 4082. README: Add a section on working with libpldm 4093. pdr: Introduce remote_container_id and associated APIs 4104. pdr: Add APIs for creating and locating remote PDRs 4115. pdr: Add pldm_pdr_find_last_in_range() 4126. pdr: Add pldm_entity_association_pdr_add_from_node_with_record_handle() 4137. pdr: Add pldm_pdr_find_container_id_range_exclude() 414 415### Changed 416 4171. include: Move installed transport.h under libpldm/ 4182. libpldm: Explicit deprecated, stable and testing ABI classes 4193. meson: Reduce strength of oem-ibm requirements from enabled to allowed 420 421 The `oem-ibm` feature is now enabled by the default meson configuration, for 422 CI purposes. `oem-ibm` is still disabled by default in the `libpldm` bitbake 423 recipe: 424 425 <https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-phosphor/libpldm/libpldm_git.bb#L10> 426 427 To disable `oem-ibm` in your development builds, pass `-Doem-ibm=disabled` 428 when invoking `meson setup` 429 4304. bios_table: Relax pldm_bios_table_string_entry_decode_string_check() 4315. bios_table: Relax pldm_bios_table_attr_entry_enum_decode_pv_hdls_check() 432 433### Deprecated 434 4351. bios_table: Deprecate APIs with arguments sanitized using assert() 436 437 C provides enough foot-guns without us encoding them into library APIs. 438 Specifically, deprecate the following in favour of their `*_check()` variants 439 which ensure assertions won't fail or otherwise invoke UB: 440 441 - pldm_bios_table_string_entry_encode() 442 - pldm_bios_table_string_entry_decode_string() 443 - pldm_bios_table_attr_entry_enum_encode() 444 - pldm_bios_table_attr_entry_enum_decode_pv_num() 445 - pldm_bios_table_attr_entry_enum_decode_def_num() 446 - pldm_bios_table_attr_entry_enum_decode_pv_hdls() 447 - pldm_bios_table_attr_entry_string_encode() 448 - pldm_bios_table_attr_entry_string_decode_def_string_length() 449 450### Removed 451 4521. libpldm: Remove the requester-api option 453 454### Fixed 455 4561. requester: Make pldm_open() return existing fd 4572. transport: Prevent sticking in waiting for response 4583. transport: Match on response in pldm_transport_send_recv_msg() 4594. requester: Add check before accessing hdr in pldm_recv() 4605. bios_table: pldm_bios_table_attr_entry_string_info_check() NULL deref 461