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 ...
|
5320f6e0 | 14-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Add backend DBus interface and commandline options
Also implement a backend commandline option to mboxctl: `mboxctl --backend ...`, to allow easy run-time switching of the backend from the co
mboxd: Add backend DBus interface and commandline options
Also implement a backend commandline option to mboxctl: `mboxctl --backend ...`, to allow easy run-time switching of the backend from the commandline.
Switching between VPNOR and file backends via mboxctl was tested on Witherspoon, and MTD and file backends on Romulus.
Change-Id: Iaf0e27ecf1d5cdd9e3a31729fb179096bbc37408 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
0297e5b8 | 14-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Remove flash API compatibility shim
The flash API compatibility was kept to reduce the line noise in the previous backend patch. Remove the compatibility layer now and convert the remaining c
mboxd: Remove flash API compatibility shim
The flash API compatibility was kept to reduce the line noise in the previous backend patch. Remove the compatibility layer now and convert the remaining call-sites.
Change-Id: I4b6e54f4463059a7804918add81e7572db7b7c21 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
f1e547c7 | 13-Mar-2019 |
Evan Lojewski <github@meklort.com> |
mboxd: Add a backend abstraction layer to mboxd.
Introduce a backend abstraction, enabling multiple implementations to be compiled in at once. This change formally abstracts the two existing backend
mboxd: Add a backend abstraction layer to mboxd.
Introduce a backend abstraction, enabling multiple implementations to be compiled in at once. This change formally abstracts the two existing backends, mtd and vpnor.
With the backend abstraction in place, subsequent backends are easier to implement.
This change is based of Evan's work and he retains authorship credit. I (AJ) have reworked the patch to pass the vpnor tests, refactored some parts to enable broader use of const structures and others to clarify the initialisation sequences.
Due to the existing lack of abstraction the patch has unfortunately wide-ranging impacts. I've whittled it down as much as I consider reasonable.
Change-Id: I29984a36dae4ea86ec00b853d2a756f0b9afb3ec Signed-off-by: Evan Lojewski <github@meklort.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
cb93504e | 14-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
flash: Introduce flash_validate()
Clean up the protocol_negotiate_version() mess. The existing approach came about due to viewing the vpnor implementation as an edge case in its own right. The code
flash: Introduce flash_validate()
Clean up the protocol_negotiate_version() mess. The existing approach came about due to viewing the vpnor implementation as an edge case in its own right. The code becomes much neater if we consider all backends as equal and afford them the callbacks necessary for correct behaviour.
Change-Id: Ifaeee9da459818cf22b2f137ddc5b8d0356b9be9 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
2dfc2a22 | 14-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
test/flash_copy: Configure MTD device to avoid undefined behaviour
Otherwise we observe invalid memory accesses due to uninitialised variables.
Change-Id: I8b9063ccc9a25b225a562ebe120f2a99a28788ca
test/flash_copy: Configure MTD device to avoid undefined behaviour
Otherwise we observe invalid memory accesses due to uninitialised variables.
Change-Id: I8b9063ccc9a25b225a562ebe120f2a99a28788ca Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
7c1588aa | 13-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
test/mbox: Assert that the flash fd is sane
Change-Id: I8f08db1b0ae19197c3fb8c4053deab900154a125 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
bf2417e5 | 13-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
test/mbox: Use assertions for error handling
No need to try to exit gracefully in the test cases.
Change-Id: Id558c5201c08bdb0b34859cb3af1a0efa1a2809b Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
c84b8f8f | 28-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
test: Add windows_equally_evictable
Tests for the condition where the minimum age is less than any window's current age, in which case we can get a NULL dereference if the windows_reset_all() implem
test: Add windows_equally_evictable
Tests for the condition where the minimum age is less than any window's current age, in which case we can get a NULL dereference if the windows_reset_all() implementation is broken.
windows.c:409:23: runtime error: member access within null pointer of type 'struct window_context' ASAN:DEADLYSIGNAL ================================================================= ==31400==ERROR: AddressSanitizer: SEGV on unknown address 0x00000004 (pc 0x0002b658 bp 0x74c00270 sp 0x7eb7c678 T0) ==31400==The signal is caused by a WRITE memory access. ==31400==Hint: address points to the zero page. #0 0x2b657 in window_reset windows.c:410 #1 0x2cc9b in windows_create_map windows.c:572 #2 0x1f3f3 in protocol_v1_create_window protocol.c:167 #3 0x2121b in protocol_v2_create_window protocol.c:417 #4 0x24cd7f in generic_vpnor_create_window vpnor/protocol.cpp:51 #5 0x24d053 in protocol_v2_vpnor_create_window vpnor/protocol.cpp:63 #6 0x2663b in mbox_handle_create_window transport_mbox.c:282 #7 0x276db in handle_mbox_req transport_mbox.c:568 #8 0x276db in transport_mbox_dispatch transport_mbox.c:649 #9 0x17fcb in poll_loop mboxd.c:185 #10 0x17fcb in main mboxd.c:423 #11 0x46b68517 in __libc_start_main (/lib/libc.so.6+0x46b68517)
AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV windows.c:410 in window_reset ==31400==ABORTING
Change-Id: I8161e2ea17953e196d4bb3ca90d19e44ec10c86d Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
2ebfd20f | 19-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
daemon: Remove the concept of triggering or suppressing events
Rather, trigger them (or not) as necessary in the relevant code-paths. This ensures that any call to one of protocol_events_{set,clear}
daemon: Remove the concept of triggering or suppressing events
Rather, trigger them (or not) as necessary in the relevant code-paths. This ensures that any call to one of protocol_events_{set,clear}() actually has a consequence that we can set about dealing with in the transport layer.
Change-Id: If64733fa53ed9def0da8330c99cbe48327bab934 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 ...
|
26558dbb | 09-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Refactor and rename mbox.h to mboxd.h
Refine the purpose of the header file to represent what's required for the daemon itself, not its constituent pieces. Rather, split those definitions out
mboxd: Refactor and rename mbox.h to mboxd.h
Refine the purpose of the header file to represent what's required for the daemon itself, not its constituent pieces. Rather, split those definitions out to their respective header files and include them as necessary.
Finally the header file is renamed to better reflect its purpose.
Change-Id: I48c409f57d96c844589cd865b24f197477dfe87c Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
b2466ee3 | 09-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: mbox: Rename *init_mbox_dev to *transport_mbox_init
Change-Id: I212277ed2462089b905546ef048308d24a5489d0 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
d86141b6 | 09-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
transport: mbox: Rename dispatch_mbox to transport_mbox_dispatch
Change-Id: I7c5457099e90ea4ed498fd1898b4504f051d13fc Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
5335f093 | 09-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
protocol: Provide abstraction over event notification
How this works will be transport-dependent. Move the event notification helpers into the protocol abstraction and call-back through the register
protocol: Provide abstraction over event notification
How this works will be transport-dependent. Move the event notification helpers into the protocol abstraction and call-back through the registered flush handler as necessary.
Change-Id: I29e3a9a9785b92de46a2b2750257fb7f8480a184 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
c7d1947e | 07-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: Hijack protocol rather than transport
By hijacking the transport the changes in behaviour were limited to the mailbox interface. Now that we have a DBus interface as well this would lead to i
vpnor: Hijack protocol rather than transport
By hijacking the transport the changes in behaviour were limited to the mailbox interface. Now that we have a DBus interface as well this would lead to inconsistent behaviour dependent on the transport.
Instead of hooking the transport, push the hook down to the protocol level where we will achieve consistent behaviour across all transports.
Change-Id: I437866a6dbda107149336c15a00ee1aa058f5875 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
1e531afd | 06-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
protocol: Add get_info
Change-Id: Ie3338714813bb65f5d37fcd046dd5bebc0ba21f0 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
457a6e5f | 07-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Rename mboxd_msg to transport_mbox
Change-Id: I0f4e206648c02a98fa938a7e582470c8d90904f1 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
c1a67fa8 | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
windows: Rename init_windows to windows_init
Change-Id: Icdee1694b230d3c03075b840ec31450a236ab9e1 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
f593b1bd | 07-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Rename windows files
Change-Id: I44e110906fd0f751f8f34b175f971e65896a7301 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
cb9b2100 | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
lpc: Rename init_lpc_dev to lpc_dev_init
Change-Id: I1b3d8f4b561fda13dee8c9c0460aa463d6200e1d Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
cd18611e | 07-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Rename lpc source files
Change-Id: I289618c90b2df8911e362397b7eab99403c86c05 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
0293f2f5 | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
flash: Rename write_flash to flash_write
Change-Id: I4b41aac597299c93369d8998b03a7d3e2a128742 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
4f5d29cf | 08-Aug-2018 |
Andrew Jeffery <andrew@aj.id.au> |
flash: Rename erase_flash to flash_erase
Change-Id: I417319aadb2fdbfa2d688bb26b5515d2f9265994 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |