b2d46b7b | 10-Jul-2023 |
Pavithra Barithaya <pavithra.b@ibm.com> |
clang-error: fix clang-diagnostic-unused-const-variable error
This clang-error is generated when there is a constant unused variable.
Change-Id: I4c101d3d58d468b728768fd63c1fd842e8c09ac4 Signed-off
clang-error: fix clang-diagnostic-unused-const-variable error
This clang-error is generated when there is a constant unused variable.
Change-Id: I4c101d3d58d468b728768fd63c1fd842e8c09ac4 Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
show more ...
|
165749d1 | 10-Jul-2023 |
Pavithra Barithaya <pavithra.b@ibm.com> |
clang-error: fix clang-diagnostic-inconsistent-missing-override error
This clang-error is generated when a function overrides a member function but is not marked 'override'.
Change-Id: I664941c2dff
clang-error: fix clang-diagnostic-inconsistent-missing-override error
This clang-error is generated when a function overrides a member function but is not marked 'override'.
Change-Id: I664941c2dff5be93dec1571cc974fae2168925f2 Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
show more ...
|
2e248e8e | 03-Jul-2023 |
Andrew Jeffery <andrew@aj.id.au> |
libpldmresponder: Migrate to pldm_pdr_add_fru_record_set_check()
pldm_pdr_add_fru_record_set() is deprecated in libpldm as it used assert() to communicate failure to the caller. pldm_pdr_add_fru_rec
libpldmresponder: Migrate to pldm_pdr_add_fru_record_set_check()
pldm_pdr_add_fru_record_set() is deprecated in libpldm as it used assert() to communicate failure to the caller. pldm_pdr_add_fru_record_set_check() instead returns a value indicating success or failure.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I88ed90a03b15a949641788906495c9507a5a196b
show more ...
|
64f37feb | 03-Jul-2023 |
Andrew Jeffery <andrew@aj.id.au> |
pldmd: Migrate to pldm_pdr_add_check()
pldm_pdr_add() is deprecated in libpldm as it uses assert() to communicate to the caller that an error occurred. pldm_pdr_add_check() instead returns a value t
pldmd: Migrate to pldm_pdr_add_check()
pldm_pdr_add() is deprecated in libpldm as it uses assert() to communicate to the caller that an error occurred. pldm_pdr_add_check() instead returns a value that indicates success or failure.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Icca92fd742f07fb935202a9d9e62f5648916b12b
show more ...
|
663783b6 | 02-Jul-2023 |
Andrew Jeffery <andrew@aj.id.au> |
libpldmresponder: Migrate to get_fru_record_by_option_check()
get_fru_record_by_option() is deprecated in libpldm as it relied on assert() to communicate failures from the implementation. get_fru_re
libpldmresponder: Migrate to get_fru_record_by_option_check()
get_fru_record_by_option() is deprecated in libpldm as it relied on assert() to communicate failures from the implementation. get_fru_record_by_option_check() instead returns a value indicating whether or not it succeeded.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I621bdcc713e37bb12ac40825edb399b151123427
show more ...
|
c43f2115 | 29-Jun-2023 |
Andrew Jeffery <andrew@aj.id.au> |
libpldmresponder: pldm_bios_table_append_pad_checksum() is deprecated
Migrate to pldm_bios_table_append_pad_checksum_check() which does not sanitize its behaviour with assert().
Signed-off-by: Andr
libpldmresponder: pldm_bios_table_append_pad_checksum() is deprecated
Migrate to pldm_bios_table_append_pad_checksum_check() which does not sanitize its behaviour with assert().
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ide288bb40e5acabd2bf85870849bf176ddcbc621
show more ...
|
e1874e8a | 02-May-2023 |
Varsha Kaverappa <vkaverap@in.ibm.com> |
oem-ibm : Support New record to the backplane vpd
This commit is to support a new VPD record called PSPD that contains few keywords called #D and VM. Since these keywords are typically larger in siz
oem-ibm : Support New record to the backplane vpd
This commit is to support a new VPD record called PSPD that contains few keywords called #D and VM. Since these keywords are typically larger in size (4K bytes) than what is managed by PLDM, we are adding a file into which these keywords will be extracted. This keyword file is transferred to the HB PLDM layer with a readFileByType request from HB.
This also includes transfer of PSPD record data via PLDM with offset included.
Tested by using pldmtool to send read request command to PLDM
Change-Id: Iba814a802cbbd2c2d641ee5a4c81919c3b8bdf20 Signed-off-by: Varsha Kaverappa <vkaverap@in.ibm.com>
show more ...
|
acb20299 | 29-Jun-2023 |
Andrew Jeffery <andrew@aj.id.au> |
pldmd: Account for pldm_pdr_init() returning NULL
Historically, libpldm's pldm_pdr_init() has internall used assert() to enforce that the returned value is not NULL. Efforts are underway to remove t
pldmd: Account for pldm_pdr_init() returning NULL
Historically, libpldm's pldm_pdr_init() has internall used assert() to enforce that the returned value is not NULL. Efforts are underway to remove this reliance on assert() in libpldm to ensure consumers aren't ungracefully terminated.
This change chooses to return an appropriate error to the caller of pldmd's internal APIs where possible. However, in a number of circumstances there was either not a sensible value that could be returned, or it was not possible to return a value without further refactoring. In these circumstances we choose to throw `std::runtime_error`, which will at least do what it can to unwind. While it may feel like it falls short of proper error handling, the reality is the calling code is already structured such that it pretends allocation failures never occur. The switch to throwing a runtime error makes a strict improvement over the immediate termination implemented by assert().
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ibb6bc3abf62e32f05ac079453853873298db6c4f
show more ...
|
d15ecf92 | 27-Jun-2023 |
Andrew Jeffery <andrew@aj.id.au> |
pldm: Migrate off deprecated libpldm BIOS table entry encoding APIs
libpldm has deprecated the affected APIs. Prefer using their `*_check()` variants as these return an error code rather than preven
pldm: Migrate off deprecated libpldm BIOS table entry encoding APIs
libpldm has deprecated the affected APIs. Prefer using their `*_check()` variants as these return an error code rather than prevent misbehaviour with assert().
1. pldm_bios_table_attr_entry_integer_encode() 2. pldm_bios_table_attr_value_entry_encode_enum() 3. pldm_bios_table_attr_value_entry_encode_string() 4. pldm_bios_table_attr_value_entry_encode_integer()
Tested: Successfully booted a p10bmc host, dumped each of the BIOS tables with pldmtool without issue
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I823b24884e518f8c53fd153b3bc30569595ecd86
show more ...
|
488f19d0 | 13-Jun-2023 |
Andrew Jeffery <andrew@aj.id.au> |
pldm: Convert to pldm_bios_table_*_check() APIs
The pldm_bios_table_*_check() APIs wrap around unchecked equivalents that only sanitize their parameters using assert(). The checks included in the pl
pldm: Convert to pldm_bios_table_*_check() APIs
The pldm_bios_table_*_check() APIs wrap around unchecked equivalents that only sanitize their parameters using assert(). The checks included in the pldm_bios_table_*_check() APIs test the same conditions that would trigger the assert()s in the unchecked APIs but instead return an error code on failure.
Use of the unchecked APIs has the potential to blow up the pldmd process, but also requires that libpldm continue to be built with `-UNDEBUG` to avoid undefined behaviour (by aborting the process). This impacts the performance of the library in addition to be a bit of a UX disaster.
The unchecked APIs are deprecated in libpldm as a step improve its safety and code generation:
https://gerrit.openbmc.org/c/openbmc/libpldm/+/64179
Tested: Booted the host on a p10bmc system with the patch applied.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I9677a7fa5ca59d04865963b367f3bb55c8676cfb
show more ...
|
47792274 | 13-Jun-2023 |
Andrew Jeffery <andrew@aj.id.au> |
pldm: Include config.h via compiler argument
This removes any ambiguity about which config.h is being included. Subprojects such as libpldm and phosphor-logging also generate config.h files, and the
pldm: Include config.h via compiler argument
This removes any ambiguity about which config.h is being included. Subprojects such as libpldm and phosphor-logging also generate config.h files, and these are exposed in the include path.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I3e0ccd6339f088380ffa29d41167b07aefc7dd16
show more ...
|
9138c209 | 19-May-2023 |
vkaverap@in.ibm.com <vkaverap@in.ibm.com> |
PLDM : Change the dbus timeout to 5 seconds
Dbus timeout value for every dbus call in PLDM is set to 5 seconds instead of default 25 seconds so that all dbus calls that expect a reply exists after 5
PLDM : Change the dbus timeout to 5 seconds
Dbus timeout value for every dbus call in PLDM is set to 5 seconds instead of default 25 seconds so that all dbus calls that expect a reply exists after 5 seconds if there is no response from the client. While BMC is still waiting for a response on any dbus calls it is possible that host can timeout and return an error. Another reason is that memory address from where BMC would read data sent by host may get deallocated after 20 seconds and it is possible for this to happen even before BMC has read the data. This has lead to DMA issues.
Tested by adding a sleep for 10 seconds inside main function of phospher-host-postd and executed get dbus property on snoopd interface from pldm. PLDM dbus call timed out after 5 seconds.
Change-Id: I1aa1b4ad7fceff2224a3ccc3bcf6abd5705963bc Signed-off-by: Varsha Kaverappa <vkaverap@in.ibm.com>
show more ...
|
a330b2f0 | 04-May-2023 |
Andrew Jeffery <andrew@aj.id.au> |
pldmd: Migrate instance ID allocation to pldm::InstanceIdDb
This removes use of `pldm::dbus_api::Requester` from around the code-base. This makes progress towards removing the DBus API entirely once
pldmd: Migrate instance ID allocation to pldm::InstanceIdDb
This removes use of `pldm::dbus_api::Requester` from around the code-base. This makes progress towards removing the DBus API entirely once all its consumers are converted to the libpldm instance ID APIs.
There was never a good reason for the code using the class to have knowledge that it was related to DBus anyway, so this is, in-effect, a double clean up improving separation of concerns.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I2d9397cae1b3c8c251c32e36ca520aad9c9b8cf6
show more ...
|
7c1dc7ea | 28-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
pldmd: move to libpldm instance ID alloc/free
Refactor the dbus_api::Requester class to be implemented in terms of libpldm's instance ID database. To make that easier to deal with we introduce a lig
pldmd: move to libpldm instance ID alloc/free
Refactor the dbus_api::Requester class to be implemented in terms of libpldm's instance ID database. To make that easier to deal with we introduce a light-weight RAII C++ binding along with a helper class for unit tests.
Change-Id: Ia03de8245dfb114e6266ba36dcf26ca4398a4ce0 Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
6da4f91b | 10-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: I61b093f75011417cc9c7acf9605200f4fa429bac Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
25c999c9 | 28-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
Revert "oem-ibm : New record to backplane vpd"
This reverts commit 9eee2518cabb21790dceef847eae5fe39d3c4792.
The patch in question breaks the build in multiple ways:
``` ../oem/ibm/libpldmresponde
Revert "oem-ibm : New record to backplane vpd"
This reverts commit 9eee2518cabb21790dceef847eae5fe39d3c4792.
The patch in question breaks the build in multiple ways:
``` ../oem/ibm/libpldmresponder/file_io_type_vpd.cpp: In member function ‘virtual int pldm::responder::keywordHandler::read(uint32_t, uint32_t&, pldm::responder::Response&, pldm::responder::oem_platform::Handler*)’: ../oem/ibm/libpldmresponder/file_io_type_vpd.cpp:30:21: error: ‘DBusHandler’ has not been declared 30 | auto& bus = DBusHandler::getBus(); | ^~~~~~~~~~~ ../oem/ibm/libpldmresponder/file_io_type_vpd.cpp:74:19: error: ‘pldm::PelSeverity’ has not been declared 74 | pldm::PelSeverity::ERROR); | ^~~~~~~~~~~ ../oem/ibm/libpldmresponder/file_io_type_vpd.cpp:106:48: error: cannot bind non-const lvalue reference of type ‘uint32_t&’ {aka ‘unsigned int&’} to a value of type ‘long unsigned int’ 106 | auto rc = readFile(keywrdFilePath, offset, keywrdSize, response); | ^~~~~~~~~~ In file included from ../oem/ibm/libpldmresponder/file_io_type_vpd.hpp:3, from ../oem/ibm/libpldmresponder/file_io_type_vpd.cpp:1: ../oem/ibm/libpldmresponder/file_io_by_type.hpp:90:36: note: initializing argument 3 of ‘virtual int pldm::responder::FileHandler::readFile(const std::string&, uint32_t, uint32_t&, pldm::responder::Response&)’ 90 | uint32_t& length, Response& response); | ~~~~~~~~~~^~~~~~ ../oem/ibm/libpldmresponder/file_io_type_vpd.cpp:114:19: error: ‘pldm::PelSeverity’ has not been declared 114 | pldm::PelSeverity::ERROR); | ^~~~~~~~~~~ [53/71] Compiling C++ object libpldmresponder/libpldmresponder.so.0.1.p/.._oem_ibm_libpldmresponder_file_io_by_type.cpp.o FAILED: libpldmresponder/libpldmresponder.so.0.1.p/.._oem_ibm_libpldmresponder_file_io_by_type.cpp.o ... responder_file_io_by_type.cpp.o -c ../oem/ibm/libpldmresponder/file_io_by_type.cpp ../oem/ibm/libpldmresponder/file_io_by_type.cpp: In function ‘std::unique_ptr<pldm::responder::FileHandler> pldm::responder::getHandlerByType(uint16_t, uint32_t)’: ../oem/ibm/libpldmresponder/file_io_by_type.cpp:173:14: error: ‘PLDM_FILE_TYPE_PSPD_VPD_PDD_KEYWORD’ was not declared in this scope 173 | case PLDM_FILE_TYPE_PSPD_VPD_PDD_KEYWORD: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ninja: build stopped: subcommand failed. ```
Let's get that fixed and try again.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I39f0894509d5ef8420320897999f654896354281
show more ...
|
9eee2518 | 28-Oct-2022 |
Varsha Kaverappa <vkaverap@in.ibm.com> |
oem-ibm : New record to backplane vpd
This commit is to support a new VPD record called PSPD that contains few keywords called #D and VM. Since these keywords are typically larger in size (4K bytes)
oem-ibm : New record to backplane vpd
This commit is to support a new VPD record called PSPD that contains few keywords called #D and VM. Since these keywords are typically larger in size (4K bytes) than what is managed by PLDM, we are adding a file into which these keywords will be extracted. This keyword file is transferred to the HB PLDM layer with a readFileByType request from HB.
Signed-off-by: Varsha Kaverappa <vkaverap@in.ibm.com> Change-Id: I94ed20bb54e704173a2c0a2dd6dbea853174b7de
show more ...
|
87083f26 | 17-Apr-2023 |
Pavithra Barithaya <pavithra.b@ibm.com> |
Fix a bug in libpldmresponder
This commit fixes the bug in the getStateSensorReading command handler. We need to check the correct request bytes for getStateSensorReading command (Section 20.2 in DS
Fix a bug in libpldmresponder
This commit fixes the bug in the getStateSensorReading command handler. We need to check the correct request bytes for getStateSensorReading command (Section 20.2 in DSP0248) and not getSensorReading command (Section 18.2 in DSP0248).
Change-Id: I0e5bf8774903c724ef3d9a4db76686ac6b0f897a Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
show more ...
|
49cfb138 | 02-Mar-2023 |
Riya Dixit <riyadixitagra@gmail.com> |
PLDM: Implementing Phosphor-Logging/LG2 logging
This commit adds changes in PLDM for implementing structured LG2 logging, thereby moving away from std::cout/cerr practice of logging which are output
PLDM: Implementing Phosphor-Logging/LG2 logging
This commit adds changes in PLDM for implementing structured LG2 logging, thereby moving away from std::cout/cerr practice of logging which are output streams and not logging mechanism.
PLDM now can make use of lg2 features like accurate CODE LINE Number and CODE_FUNCTION Name and better detailing in json object values which can be used in log tracking.
More detailed logging change: https://gist.github.com/riyadixitagra/c251685c1ba84248181891f7bc282395
Tested: Ran a power off, on, cycle, and reset-reload.
Change-Id: I0485035f15f278c3fd172f0581b053c1c37f3a5b Signed-off-by: Riya Dixit <riyadixitagra@gmail.com>
show more ...
|
6c39c7a7 | 05-Dec-2022 |
ArchanaKakani <archana.kakani@ibm.com> |
Populate correct terminusId
Hardcoded terminus id 0 is used at multiple places in the current code. Made changes to populate correct terminus id instead of hardcoded one.
Change-Id: I63cedcb38fb2d9
Populate correct terminusId
Hardcoded terminus id 0 is used at multiple places in the current code. Made changes to populate correct terminus id instead of hardcoded one.
Change-Id: I63cedcb38fb2d993e2e4a2b45846c19531d55839 Signed-off-by: ArchanaKakani <archana.kakani@ibm.com>
show more ...
|
5f213471 | 29-Aug-2022 |
Pavithra Barithaya <pavithra.b@ibm.com> |
PLDM : fix the invalid effecter and sensor PDRs
The LED effecter and sensor PDRs where created even when the FRU or the entity path was not present which puts the entity ID in the PDR as 0. This com
PLDM : fix the invalid effecter and sensor PDRs
The LED effecter and sensor PDRs where created even when the FRU or the entity path was not present which puts the entity ID in the PDR as 0. This commit fixes that issue.
Change-Id: I70f1838cfe613a4f11432105b793e465e8fa8adb Signed-off-by: Pavithra Barithaya <pavithra.b@ibm.com>
show more ...
|
b90fb7fd | 12-Apr-2023 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are for: * bus_t * exception_t * manager_t * match_t * message_t * object_t * slot_t
Change-Id: I3f8b8f54bcb0018d48d1e9aa0628f9bb271a8fd7 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
8fbf3ccc | 11-Apr-2023 |
Andrew Jeffery <andrew@aj.id.au> |
libpldmresponder: platform: Remove awkward reinterpret_cast()
Arrays naturally decay to pointers. The reinterpret_cast() is required if you're trying to take the address of the array and coerce the
libpldmresponder: platform: Remove awkward reinterpret_cast()
Arrays naturally decay to pointers. The reinterpret_cast() is required if you're trying to take the address of the array and coerce the type into the array's underlying type, but if we exploit the natural decay we can drop the reinterpret_cast():
``` $ g++ -std=c++20 -x c++ -Wall -pedantic -Werror - \ > <<< 'unsigned char a[4]; unsigned char *s = &a; int main() { }' <stdin>:1:40: error: cannot convert ‘unsigned char (*)[4]’ to ‘unsigned char*’ in initialization $ g++ -std=c++20 -x c++ -Wall -pedantic -Werror - \ > <<< 'unsigned char a[4]; unsigned char *s = a; int main() { }' $ echo $? 0 $ ```
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I6ab3912d9065e33d2c36ea916c9abaa98a2b3076
show more ...
|
d987c94c | 24-Mar-2023 |
Matt Spinler <spinler@us.ibm.com> |
Listen for ifacesAdded for BIOS attribute props
PLDM was just watching for PropertiesChanged signals on the D-Bus properties that back BIOS attributes. Just doing that can miss properties on interf
Listen for ifacesAdded for BIOS attribute props
PLDM was just watching for PropertiesChanged signals on the D-Bus properties that back BIOS attributes. Just doing that can miss properties on interfaces that get added after PLDM starts and then never change after that, because they would just send a single InterfacesAdded signal.
Close that hole by also adding an InterfacesAdded match along with the PropertiesChanged match.
Change-Id: Iab6679b0c99d049bd5f11e6508f784b2e8eb9349 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
show more ...
|
040c618b | 20-Feb-2023 |
Archana Kakani <archana.kakani@ibm.com> |
Handle Dbus query exception gracefully
For every Dbus query PLDM uses new_method_call defined in Sdbusplus. Any error during dbus query it throws an exception. Modifying code to handle the exception
Handle Dbus query exception gracefully
For every Dbus query PLDM uses new_method_call defined in Sdbusplus. Any error during dbus query it throws an exception. Modifying code to handle the exception thrown by new_method_call
Change-Id: Ie474e1d230773cb184127b71d333846090ad6c84 Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
show more ...
|