5b56182b | 12-Feb-2020 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Sanitize the SRC ASCII string field
This field may be displayed by things like a web UI and LCD panel, so on unflattening convert any disallowed characters to a space.
Only allow: alphanumeric
PEL: Sanitize the SRC ASCII string field
This field may be displayed by things like a web UI and LCD panel, so on unflattening convert any disallowed characters to a space.
Only allow: alphanumeric, '.', ':', '/', ' '.
When a host PEL is received, the PEL will be unflattened and reflattened when the commit timestamp and PLID are modified, and this will be fixed up then.
This matches other service processor implementations that dealt with PELs.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I7afe64e199ebd2448b54e4ba5769de436d30b9ba
show more ...
|
945299f0 | 06-Feb-2020 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Add ESEL event log keyword to README
Explain how the ESEL keyword can be used in the Additional Data event log property to send in PEL data.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Ch
PEL: Add ESEL event log keyword to README
Explain how the ESEL keyword can be used in the Additional Data event log property to send in PEL data.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I47fd97c4ee5f756b7d0139a4041f1e395c2859b3
show more ...
|
19e72901 | 24-Jan-2020 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Add PELs from ESELs
When the OpenPower host firmware subsystem hostboot creates PELs, those PELs get added to OpenBMC event logs in the ESEL entry of the AdditionalData property. (Eventually h
PEL: Add PELs from ESELs
When the OpenPower host firmware subsystem hostboot creates PELs, those PELs get added to OpenBMC event logs in the ESEL entry of the AdditionalData property. (Eventually hostboot will update their code to use PLDM to send down PELs.)
This commit looks for that ESEL keyword on incoming event logs, extracts the PEL data, and adds it to the PEL repository with all of the other PELs.
It extracts the PEL data by converting the string value to a vector of uint8_ts starting after the IPMI data fields contained in that string.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I2b7f2915dceb9c306466b8181cae05a3ddd65057
show more ...
|
e95fd015 | 07-Jan-2020 |
Matt Spinler <spinler@us.ibm.com> |
PEL: New event log when receiving bad host PEL
Create a new event log/PEL when a PEL comes in from the host but it isn't valid.
The PEL subsystem used is 'platform firmware' because the code won't
PEL: New event log when receiving bad host PEL
Create a new event log/PEL when a PEL comes in from the host but it isn't valid.
The PEL subsystem used is 'platform firmware' because the code won't know which specific host subsystem it came from. The severity is unrecoverable as opposed to informational to make it easier to notice.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I933e5c82f1ef755c6266604fbdec6d0c1fe5b784
show more ...
|
05c2c6c4 | 18-Dec-2019 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Create error log for 'bad PEL'
Create an event log (and a PEL) for the case when the host rejects a PEL because it is malformed. This requires a new message registry entry for the error.
Sign
PEL: Create error log for 'bad PEL'
Create an event log (and a PEL) for the case when the host rejects a PEL because it is malformed. This requires a new message registry entry for the error.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ibd52921b5d6020f98b457b9ee0b3bb4f0b95e707
show more ...
|
f682b40d | 18-Dec-2019 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Add ability to create event logs
There are cases where the PEL code wants to be able to create OpenBMC event logs (and thus PELs) for problems it encounters when trying to create or import othe
PEL: Add ability to create event logs
There are cases where the PEL code wants to be able to create OpenBMC event logs (and thus PELs) for problems it encounters when trying to create or import other PELs. For example, if the host were to send down a malformed PEL, this code would like to create a new event log and capture part of that bad PEL in the new PEL for debug purposes, as the malformed PEL cannot be reported anywhere since it is malformed.
To handle this, create the EventLogger class that provides a log() function that allows the PEL extension code to create OpenBMC event logs (and thus PELs) from within.
The underlying function to do the event log creating is passed in via the constructor so that it can be changed for testing.
The sd_event_add_defer function (wrapped by sdeventplus) is used to dispatch the creation of a single event, so that the entry point is from the event loop. If there are still events left on the queue after that, then they will be also be scheduled with sd_event_add_defer so that the events are always created from event loop calls.
EventLogger does not allow events to be added to the queue if it is being done from within the creation function so that the code can't get stuck in a loop of creating a new event every time an event is created.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I6a9062074dc62cfb6043139ff0a9f3dfcd06c708
show more ...
|
7ae2fa69 | 18-Dec-2019 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Allow adding to AdditionalData
Add an interface to add a key/value pair to the data stored in the AdditionalData class. Also add an interface to get to the raw underlying map of data.
Signed-
PEL: Allow adding to AdditionalData
Add an interface to add a key/value pair to the data stored in the AdditionalData class. Also add an interface to get to the raw underlying map of data.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I61200f92b45be8e86992d3f4888698d6a5bbe251
show more ...
|
e2d1bf31 | 06-Feb-2020 |
Harisuddin Mohamed Isa <harisuddin@gmail.com> |
PEL: Print Failing MTMS section into JSON
Remove any trailing whitespace for serial number.
"Failing MTMS": { "Section Version": "1", "Sub-section type": "0", "Created
PEL: Print Failing MTMS section into JSON
Remove any trailing whitespace for serial number.
"Failing MTMS": { "Section Version": "1", "Sub-section type": "0", "Created by": "0x4552", "Machine Type Model": "OPWR-131", "Serial Number": "1318ABA" },
Testing: Manually run peltool and verified output. All unit tests passed. Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com> Change-Id: I7a05790bdf406ef6d7946ffae831a45ee6dd5cda
show more ...
|
c32e5516 | 06-Feb-2020 |
Harisuddin Mohamed Isa <harisuddin@gmail.com> |
PEL: Fix SRC Format and more SRC flags in peltool
"Primary SRC": { "Section Version": "1", "Sub-section type": "0", "Created by": "0x4552", "SRC Versio
PEL: Fix SRC Format and more SRC flags in peltool
"Primary SRC": { "Section Version": "1", "Sub-section type": "0", "Created by": "0x4552", "SRC Version": "0x02", "SRC Format": "0x60", "Virtual Progress SRC": "False", "I5/OS Service Event Bit": "False", "Hypervisor Dump Initiated":"False", "Power Control Net Fault": "False", "Valid Word Count": "0x04", "Reference Code": "B700F142", "Hex Word 2": "00000060", "Hex Word 3": "00000001", "Hex Word 4": "00000005" }
Testing: Manually run peltool and verified output. All unit tests passed. Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com> Change-Id: Ic510b4bcae5eba0ac3cf52f83a10dfa3fb48e533
show more ...
|
0f717e10 | 15-Jan-2020 |
Harisuddin Mohamed Isa <harisuddin@gmail.com> |
PEL: Print SRC section into JSON
For BMC created errors, look up the reason code in the message registry for error description and also meaning of data stored in hexwords 6-9 (if any).
Added regist
PEL: Print SRC section into JSON
For BMC created errors, look up the reason code in the message registry for error description and also meaning of data stored in hexwords 6-9 (if any).
Added registry message field in peltool list output.
"Primary SRC": { "Section Version": "1", "Sub-section type": "1", "Created by": "0x1000", "SRC Version": "0x02", "SRC Format": "0x55", "Power Control Net Fault": "False", "Error Details": { "Message": "PS 0x64 had a PGOOD Fault", "PS_NUM": "0x64" }, "Valid Word Count": "0x09", "Reference Code": "BD8D1001", "Hex Word 2": "00000055", "Hex Word 3": "00000010", "Hex Word 4": "00000000", "Hex Word 5": "00000000", "Hex Word 6": "00000064", "Hex Word 7": "00000000", "Hex Word 8": "00000000", "Hex Word 9": "00000000" }
"Primary SRC": { "Section Version": "1", "Sub-section type": "0", "Created by": "0x4552", "SRC Version": "0x02", "SRC Format": "0x2008000", "Power Control Net Fault": "False", "Valid Word Count": "0x04", "Reference Code": "B2001020", "Hex Word 2": "02008000", "Hex Word 3": "00000000", "Hex Word 4": "00000012", "Callout Section": { "Callout Count": "1", "Callouts": [{ "FRU Type": "Symbolic FRU", "Priority": "Medium Priority", "Part Number": "NEXTLVL" }] } }
Testing: Manually run peltool and verified out. All unit tests passed. Signed-off-by: Harisuddin Mohamed Isa <harisuddin@gmail.com> Change-Id: I124627ba785413ebda02305b7d9f95431922e714
show more ...
|
677381b8 | 23-Jan-2020 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Save BMC Version ID in UserData section
When creating a PEL, save the VERSION_ID value from the /etc/os-release file in the UserData section that keeps useful system information.
Signed-off-by
PEL: Save BMC Version ID in UserData section
When creating a PEL, save the VERSION_ID value from the /etc/os-release file in the UserData section that keeps useful system information.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I6d9008b15c5347239bf8c21ef79219d3b6ee08e6
show more ...
|
4dcd3f46 | 22-Jan-2020 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Save process name in a UserData section
When creating a new PEL, add a UserData section that contains various pieces of system information that will be saved in every error log.
In this first
PEL: Save process name in a UserData section
When creating a new PEL, add a UserData section that contains various pieces of system information that will be saved in every error log.
In this first commit, just save the process name of the creator, provided they passed in the '_PID' AdditionalData item containing their PID.
Future commits will add other items like certain D-Bus properties.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I7139b4056e494277ff3388bfa8a00002c9c89dc1
show more ...
|
c7c3e402 | 22-Jan-2020 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Move util namespace to bottom of pel.cpp
It makes more sense for the util code to be at the bottom of the file rather than in the middle.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Chang
PEL: Move util namespace to bottom of pel.cpp
It makes more sense for the util code to be at the bottom of the file rather than in the middle.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I46fe120849377bdf9397aa72addda1e9dfa4e56c
show more ...
|
6d663820 | 22-Jan-2020 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Check UserData section size before adding
While not really likely, it is technically possible that the AdditionalData property in an event log is large enough that saving it into a UserData sec
PEL: Check UserData section size before adding
While not really likely, it is technically possible that the AdditionalData property in an event log is large enough that saving it into a UserData section could make the PEL exceed its maximum size of 16KB. To guard against this, check that an overflow wouldn't occur before saving that section in the PEL.
In future commits, other UserData sections will be added where this check will also be needed.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Iac312a24b1d445e93de5a09f35a43d940571a3f8
show more ...
|
f1b46ff4 | 22-Jan-2020 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Add function to get PEL size
Add a size() function to the PEL class that adds up the size fields in the header of every PEL section.
This required a fix to some testcases where the size field
PEL: Add function to get PEL size
Add a size() function to the PEL class that adds up the size fields in the header of every PEL section.
This required a fix to some testcases where the size field was wrong in a header.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I0d70deae116cd3835f2c0ab34e13811da471fb14
show more ...
|
9694ba62 | 29-Jan-2020 |
Deepak Kodihalli <dkodihal@in.ibm.com> |
openpower-pels: react to PLDM API change
The PLDM NewFileAvailable request now takes in a uint64 file size instead of uint32. A corresponding request buffer size correction has been added.
Change-I
openpower-pels: react to PLDM API change
The PLDM NewFileAvailable request now takes in a uint64 file size instead of uint32. A corresponding request buffer size correction has been added.
Change-Id: I68f4a69164b4a3924f48621f94d5492eab230f0e Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
show more ...
|
0e1593ec | 16-Dec-2019 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Add additional HostNotifier documentation
Give a high level overview of how the class works.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I83957e572239997cde6757abb77481890cf98b
PEL: Add additional HostNotifier documentation
Give a high level overview of how the class works.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I83957e572239997cde6757abb77481890cf98b7a
show more ...
|
6b1a5c83 | 07-Jan-2020 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Close PEL FD after getPEL call
To close the file descriptor returned from the getPEL D-Bus method call, use the 'Defer' sdeventplus object to schedule it to happen from the event loop.
Signed-
PEL: Close PEL FD after getPEL call
To close the file descriptor returned from the getPEL D-Bus method call, use the 'Defer' sdeventplus object to schedule it to happen from the event loop.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I2b850a1c92215e7f66166cc5440d7071663065c0
show more ...
|
a34ab72c | 16-Dec-2019 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Add PEL D-Bus methods
Implement the org.open_power.Logging.PEL D-Bus interface on /xyz/openbmc_project/logging.
It provides the following methods: * getPEL - Return a unix FD to the PEL data b
PEL: Add PEL D-Bus methods
Implement the org.open_power.Logging.PEL D-Bus interface on /xyz/openbmc_project/logging.
It provides the following methods: * getPEL - Return a unix FD to the PEL data based on the PEL id. * getPELFromOBMCID - Return PEL data in a vector based on the corresponding OpenBMC event log id. * hostAck - Called when the host has sent the PEL up to the OS, which is the final step in the reporting process. * hostReject - Called when the host has an issue with a PEL, either: - The host doesn't have any more room for PELs at this moment. - The PEL was malformed.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I633ae9e26d8336973363a1a207e8fd493f7ff7d2
show more ...
|
17ed2ed1 | 12-Dec-2019 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Create the PLDMInterface class
Create the PLDMInterface class and pass it into the constructor of the Manager class. This is done at this level so that it can be easily mocked for testing.
Ad
PEL: Create the PLDMInterface class
Create the PLDMInterface class and pass it into the constructor of the Manager class. This is done at this level so that it can be easily mocked for testing.
Add a --enable-dont-send-pels-to-host configure option for systems that don't need PELs sent to the host. If this is set, then don't create and pass in the PLDMInterface class, and then the Manager class won't create a HostNotifier class to do the sending.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I34059470ee117e65c5c02b684a9d916571135bfd
show more ...
|
5c350fdf | 12-Dec-2019 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Add PLDM command handler
Derive a PLDMInterface class from the HostInterface class to implement sending the 'new file available' PLDM command to notify the host of the ID and size of PELs.
The
PEL: Add PLDM command handler
Derive a PLDMInterface class from the HostInterface class to implement sending the 'new file available' PLDM command to notify the host of the ID and size of PELs.
The command response is received asynchronously by watching for activity on the MCTP file descriptor that was used for the command. If a response isn't received in 10 seconds, it will be considered a failure.
Both on response success and failure the class will call the registered callback function and pass it the result.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ica00da590628cc81114a48e2831a436dc2115269
show more ...
|
a19b6234 | 12-Dec-2019 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Receive a 'bad PEL' indication from host
If the code somehow sent the host a malformed PEL, it will respond with the 'Ack PEL' PLDM command with a special value that indicates this, and the PLD
PEL: Receive a 'bad PEL' indication from host
If the code somehow sent the host a malformed PEL, it will respond with the 'Ack PEL' PLDM command with a special value that indicates this, and the PLDM daemon will relay it to this daemon.
In this case, change the host transmission state to 'bad' so it doesn't get sent again. This should never happen as the Repository class already validates PELs and removes bad ones, though maybe the host and Repository have different ideas about what constitutes a malformed PEL.
In the future, if event logging support is added to the PEL code running inside the logging daemon, it may be a good idea to create a new PEL for this case.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Id6f9fd37764bf5b5d09b4277a1e36b1f26b3e9a5
show more ...
|
41293cb8 | 12-Dec-2019 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Notifier support for 'host full'
The host firmware may have a limited size for its staging area before it passes the PELs through to the OS, and this area may fill up with PELs it can't send if
PEL: Notifier support for 'host full'
The host firmware may have a limited size for its staging area before it passes the PELs through to the OS, and this area may fill up with PELs it can't send if there are too many or the OS isn't up yet.
In this case, it will send down an 'Ack PEL' PLDM command with a special response indicating this host full condition. The PLDM daemon will then call a method on this daemon to let it know.
This command handles the host full condition on the HostNotifier class. When this is set:
* The PEL that hit this condition will be put back on the queue to be sent again. * No new PELs will be sent up, except as noted below * A 60s timer will be started at the end of which another attempt will be made to send a PEL, in the hopes the condition went away. - If it didn't go away, this process will repeat. - If it did go away, a successful ack will be received and things will proceed as normal.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Iaeb38f43f7acc595bcff234ba50cedf8188b3d9b
show more ...
|
cc3b64ae | 12-Dec-2019 |
Matt Spinler <spinler@us.ibm.com> |
PEL: Support for the host acking a PEL
After the host firmware successfully transfers a PEL to the OS, it will respond with an 'Ack' command that the PLDM daemon sends over to this daemon via a D-Bu
PEL: Support for the host acking a PEL
After the host firmware successfully transfers a PEL to the OS, it will respond with an 'Ack' command that the PLDM daemon sends over to this daemon via a D-Bus method call.
Add support to the HostNotifier class for this. It will change the state field in the PEL to 'acked' so that it doesn't get sent up again.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Id2a9985965017d9431419c1375d5374a2d0ae00b
show more ...
|
7d800a4e | 12-Dec-2019 |
Matt Spinler <spinler@us.ibm.com> |
PEL: On new PEL, send to host if necessary
When a new PEL comes in, send it to the host now if the host is up and the class is currently idle.
The PLDM command will be dispatched in a standalone fu
PEL: On new PEL, send to host if necessary
When a new PEL comes in, send it to the host now if the host is up and the class is currently idle.
The PLDM command will be dispatched in a standalone function called from the event loop so that this function, which may be part of the 'Create new log' D-Bus method response, can return first.
Also added testcases to start verifying these paths now that there is a full mock of the HostInterface class.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ib30a99cc61be9205122287ba310bc315d762e863
show more ...
|