#
68a24c9e |
| 25-Jul-2023 |
Patrick Williams <patrick@stwcx.xyz> |
resolve stricter warnings
In order to convert this repository to Meson, we need to make it compile under `warning_level=3`. Fix a number of warning classes across the repository or disable them.
S
resolve stricter warnings
In order to convert this repository to Meson, we need to make it compile under `warning_level=3`. Fix a number of warning classes across the repository or disable them.
Some fixes are:
* Add missing header files. * Fully initialize structs as necessary. * Add `__attribute__((unused))` on parameters as necessary. * Fix comparisons between signed and unsigned. * Fix printf specifiers as necessary. * Avoid case-fallthrough. * Remove if conditions which are always true.
Some warnings would require extensive code changes, due to their pervasive use, and so are disabled at a per-file level: * `-Wpointer-arith` * `-Wunused-result`
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: If8992b9108f12b39f796ed090ba29868c9f3c627
show more ...
|
#
4b8203d7 |
| 06-May-2019 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Don't require mbox
With the DBus interface to the daemon in place it's possible to implement any hardware interface in terms of the DBus interface. This is the strategy used to support the IP
mboxd: Don't require mbox
With the DBus interface to the daemon in place it's possible to implement any hardware interface in terms of the DBus interface. This is the strategy used to support the IPMI HIOMAP transport. Further, the use of MBOX is deprecated due to security concerns. We want to drop the driver from the kernel, which failed to get traction upstream, so make support optional.
As a consequence, switch the default transport to DBus.
Change-Id: I9f16ca053ce48943dce59b83ca991ec5494580d8 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
fac3689e |
| 17-May-2019 |
Andrew Jeffery <andrew@aj.id.au> |
dbus: Unref replies to avoid leaks
Testing showed that failing to free DBus message replies was leaking 800-900kiB per boot. After adding the appropriate unrefs, mboxd memory consumption stayed stab
dbus: Unref replies to avoid leaks
Testing showed that failing to free DBus message replies was leaking 800-900kiB per boot. After adding the appropriate unrefs, mboxd memory consumption stayed stable at 71920kiB across multiple reboots of the host.
The root cause was identified using a DBus capture of the host's IPMI traffic during boot, then reducing the output to mboxd-specific messages and turning them into commands that could be run with ipmitool. Adding all of these commands to a script and running `pmap` between ipmitool invocations showed the growth in memory usage across the "boot" process, but this did not correlate with any particular set of commands to mboxd. The lack of correlation lead to the hypothesis that we might be able to reproduce by sending a lot of dbus messages, such as:
``` root@witherspoon:/tmp# for i in `seq 1 10000`; do \ busctl call xyz.openbmc_project.Hiomapd \ /xyz/openbmc_project/Hiomapd \ xyz.openbmc_project.Hiomapd.Protocol.V2 \ GetInfo y 2; \ done ```
Spamming the daemon in this way demonstrated the growth in memory seen during a regular boot process, confirming that just sending DBus messages was enough.
Add the necessary unrefs for the replies at the end of each method handler to ensure the replies are appropriately freed.
Testing and confirmation of the fix were performed on a Witherspoon system.
Change-Id: If5fe7576aaca1be617181526bf64511ccee1dd9f Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
9ed627ca |
| 25-Nov-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Remove ProtocolReset and WindowReset signals
These are replaced by the equivalent properties.
Change-Id: Ie2acb98cc592c0ed1f2039f8aa570f1c7944b1e2 Signed-off-by: Andrew Jeffery <an
transport: dbus: Remove ProtocolReset and WindowReset signals
These are replaced by the equivalent properties.
Change-Id: Ie2acb98cc592c0ed1f2039f8aa570f1c7944b1e2 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
fd4fa34d |
| 22-Nov-2018 |
Andrew Jeffery <andrew@aj.id.au> |
protocol: Rework publication of events over DBus transport
A set of races was discovered around the propagation of HIOMAP protocol BMC status events during BMC shutdown. In particular the change imp
protocol: Rework publication of events over DBus transport
A set of races was discovered around the propagation of HIOMAP protocol BMC status events during BMC shutdown. In particular the change impacts the design of the DBus transport defined in the protocol specification, as signalling of both acknowledgeable and non-acknowledgeable events could not be made atomic.
A particular case where this matters is when the daemon is terminated, at which point it should simultaneously clear BMC_EVENT_DAEMON_READY and set BMC_EVENT_PROTOCOL_RESET. The DBus interface as designed required this be done as two separate messages, which lead to races propagating the complete state update to the host during shutdown of ipmid.
Change-Id: Iaf38f77c28b8e4e4dd092b0de97dc7e777bfac65 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
fab672bd |
| 01-Nov-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Mark the protocol as reset on shutdown
This is necessary for the host firmware to properly recover from a daemon restart event, as it needs to re-perform the GET_INFO handshake and re-establi
mboxd: Mark the protocol as reset on shutdown
This is necessary for the host firmware to properly recover from a daemon restart event, as it needs to re-perform the GET_INFO handshake and re-establish any window it had active prior to the daemon restarting.
While we're here, rename the symbol to align with the documentation.
Change-Id: I628d2ee5972177b7ad78392a86122d16104e7011 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
fe0c9e86 |
| 31-Oct-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Broadcast the daemon is ready on all transports
The code as it stood only sent the state update at startup on the active transport, which is somewhat arbitrarily chosen as an implementation d
mboxd: Broadcast the daemon is ready on all transports
The code as it stood only sent the state update at startup on the active transport, which is somewhat arbitrarily chosen as an implementation detail of the mbox initialisation function.
If the host firmware is using IPMI, it will not learn of the update unless it attempts to contact mboxd, which it won't do if it knows the daemon isn't there, which it may have learned of by receiving a state update from the daemon's shutdown path. In this circumstance the host firmware is now stuck.
Relieve the host firmware of this problem by always sending the daemon state on all supported transports. To avoid some insanity we introduce a new callback in struct transport_ops that allows use to send the BMC's entire event state rather than just set or clear updates.
Change-Id: I094ff4089eeebd8be99fbd343b94f7bbef023fb1 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
f62601b8 |
| 31-Oct-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: Fix event handling
Events were not quite being handled as per the intent of the recent refactor: The protocol layer was meant to record the raw set of events and provide the protocol-vers
transport: Fix event handling
Events were not quite being handled as per the intent of the recent refactor: The protocol layer was meant to record the raw set of events and provide the protocol-version-specific mask to the transport layer, which the transport layer would then use to flush out the state in accordance with its implementation-specific requirements.
What was going wrong was that the transport implementations were overwriting the raw set of events with the protocol-specific masked set of events, meaning that we'd lose the raw state and provide an incomplete BMC state value on protocol upgrade.
Rework the event handling to make sure the responsibilities are properly split between the layers.
Change-Id: Iace6615a121e4ce7dcca690d9adf62e5ab9ccee2 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
ea5400f5 |
| 23-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Implement erase
Change-Id: Ic10ba2be78deb6307af195fc01daceb19a82ef95 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
#
d66af2ab |
| 23-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Implement flush
Change-Id: If34f2f6cac002fae417d99baec8c08f675cdb974 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
#
40ef67be |
| 23-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Implement mark_dirty
Change-Id: I989d5e2a65950cb936fca77d28f7a540d3ec90a2 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
#
c2cbb3d8 |
| 23-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Implement close
Change-Id: I9f261b56fe66e56d71c069d63f5caba5394cbe12 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
#
0e785f43 |
| 23-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Implement create_write_window
Change-Id: I85b318cae135cfe8203cb01c54ab4872fcc947c0 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
#
b9d72d0f |
| 23-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Implement create_read_window
Change-Id: I1d16f72c28a4ce2ab8dd92d17b29ad9227ea542b Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
#
9c627170 |
| 23-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Implement get_flash_info
Change-Id: Ibf94de2dfa3554c5e81fe53ee2b422f9a4014581 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
#
bcc33995 |
| 23-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Implement ack
Change-Id: I15de434610b0f2a3cd54061c353dcc4d9434352b Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
#
7255d266 |
| 23-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Implement reset
Change-Id: I652b76adea470de02d1d01dc1d062caf52a37448 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
#
0453aa4c |
| 20-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: Rework BMC event handling
Change-Id: I99b13eca8f25d9855aac2af0a9ec46dfe5390834 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
#
a6ca7a9c |
| 19-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Handle events
Change-Id: I873c60ef072c2e46d1306a086ce81d28927b593c Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|
#
4414fb8d |
| 19-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: Retain knowledge of setting and clearing of events
The protocol layer now just filters the events based on the version of the protocol in use, and leaves it to the transport layer to mana
transport: Retain knowledge of setting and clearing of events
The protocol layer now just filters the events based on the version of the protocol in use, and leaves it to the transport layer to manage how the resulting state is represented. For the moment this simply moves manipulation of bmc_events in struct mbox_context down in to the transport layer.
Change-Id: Iff1df934505dc9c769be3d376396d425fb4e8264 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
23a48212 |
| 10-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: Switch transports as required on GET_MBOX_INFO
Also flush the event state out via the new transport. This must be done after the command has completed for the mbox transport.
Change-Id:
transport: Switch transports as required on GET_MBOX_INFO
Also flush the event state out via the new transport. This must be done after the command has completed for the mbox transport.
Change-Id: I251fb949ae67a477288d0d57a1a6afe5b2af5f8f Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
#
23140bee |
| 04-Sep-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: dbus: Add get_info
Change-Id: I59cf0155b3f8600527cca23a14f41ef7d916a831 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
|