dfbeae25 | 12-Mar-2020 |
Joel Stanley <joel@jms.id.au> |
Disable aspeed mbox backend
This disables the mbox backend in the daemon. The associated code remains, as it is tangled in to the tests which provide coverage for parts of the code base beyond the m
Disable aspeed mbox backend
This disables the mbox backend in the daemon. The associated code remains, as it is tangled in to the tests which provide coverage for parts of the code base beyond the mbox backend.
A future cleanup would refactor the tests to not rely on the mbox transport, andfinally remove the mbox transport itself.
Change-Id: Id4fe74617a2dd920c1f8bc8ac4cd69cfbc0239b6 Signed-off-by: Joel Stanley <joel@jms.id.au>
show more ...
|
2ecad07c | 10-Apr-2020 |
Andrew Jeffery <andrew@aj.id.au> |
control: Retain current backend on initialisation failure
A failure to initialise a new backend should not lead to the current backend becoming invalid. Fix the current behaviour by only destroying
control: Retain current backend on initialisation failure
A failure to initialise a new backend should not lead to the current backend becoming invalid. Fix the current behaviour by only destroying the current backend once we know the requested backend has successfully initialised.
Change-Id: I5da11b346b8b5ab2c95085f512de4599d1272f57 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
affbf2ed | 10-Apr-2020 |
Andrew Jeffery <andrew@aj.id.au> |
backend: Ensure ops pointer is valid in backend_init()
If support for e.g. the vpnor backend isn't compiled in then the ops pointer will be set to NULL. Prevent the NULL dereference by validating ea
backend: Ensure ops pointer is valid in backend_init()
If support for e.g. the vpnor backend isn't compiled in then the ops pointer will be set to NULL. Prevent the NULL dereference by validating each pointer in turn.
Change-Id: I5a293d173736f192e087762308017bf16eda7f4d Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
ca5eda80 | 05-Feb-2020 |
Andrew Jeffery <andrew@aj.id.au> |
mbox_log_console(): Add explicit fflush() for stdout
stdout is line-buffered by default while stderr is not. Additionally the logging infra was switching between stderr and stdout based on the sever
mbox_log_console(): Add explicit fflush() for stdout
stdout is line-buffered by default while stderr is not. Additionally the logging infra was switching between stderr and stdout based on the severity of the message. Make sure we flush stdout if necessary.
Change-Id: I9649e1aa20dca6220cdd5ca91f2bab2a99b24aac Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
02821c6a | 31-Jan-2020 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: partition: Fix file descriptor leaks
In the face of errors we were leaking the partition file descriptor when throwing exceptions.
Change-Id: I257a491460062384928d8dda6bbf178da662f3b3 Signed
vpnor: partition: Fix file descriptor leaks
In the face of errors we were leaking the partition file descriptor when throwing exceptions.
Change-Id: I257a491460062384928d8dda6bbf178da662f3b3 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
5b970448 | 31-Jan-2020 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: partition: Only attempt read() for in-bounds accesses
Attempting to read after an lseek() past the end of the file leads to an error and we bail out. The error propagates up the callstack and
vpnor: partition: Only attempt read() for in-bounds accesses
Attempting to read after an lseek() past the end of the file leads to an error and we bail out. The error propagates up the callstack and causes errors on the host side, where really we should just be returning an erased window.
Change-Id: I06cdda4f7f6aa4d66e133de95cd642e04418bbe0 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
e2744c0e | 27-Jan-2020 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: Avoid mmap() due to lack of support on some filesystems
JFFS2 does not support writable mappings. Switch to read()/write() and add all the failure handling to ensure we get the required seman
vpnor: Avoid mmap() due to lack of support on some filesystems
JFFS2 does not support writable mappings. Switch to read()/write() and add all the failure handling to ensure we get the required semantics.
Change-Id: I5ec547bf7a01a389cf8f1403f748026fe6bb21fa Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
3edbf1fa | 28-Jan-2020 |
Andrew Jeffery <andrew@aj.id.au> |
configure: Default-enable virtual pnor
I'm tired of the lack of CI coverage, and I have to care about it.
Rework the README to reflect the change in default behaviour.
Change-Id: I883be8bc4e89b755
configure: Default-enable virtual pnor
I'm tired of the lack of CI coverage, and I have to care about it.
Rework the README to reflect the change in default behaviour.
Change-Id: I883be8bc4e89b755185f9f84f0ebd46a05fee71f Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
c7822e9e | 28-Jan-2020 |
Andrew Jeffery <andrew@aj.id.au> |
README: Spring clean
It's not spring, but a cleanup needed to happen.
Change-Id: I3797f1c9f4fe5ff466d9fb2ec6c449c3846cd1da Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
032fb300 | 27-Jan-2020 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: table: Handle alignment warning
The static_assert() isn't enough for g++-9, do the slow but correct thing and copy the data into a container with the correct alignment.
Resolves:
In file in
vpnor: table: Handle alignment warning
The static_assert() isn't enough for g++-9, do the slow but correct thing and copy the data into a container with the correct alignment.
Resolves:
In file included from vpnor/table.cpp:11: ./vpnor/table.hpp: In instantiation of ‘openpower::virtual_pnor::checksum_t openpower::virtual_pnor::details::checksum(const T&) [with T = pnor_partition_table::<unnamed struct>; openpower::virtual_pnor::checksum_t = unsigned int]’: vpnor/table.cpp:52:50: required from here ./vpnor/table.hpp:66:10: warning: converting a packed ‘const pnor_partition_table::<unnamed struct>’ pointer (alignment 1) to a ‘const unsigned int’ pointer (alignment 4) may result in an unaligned pointer value [-Waddress-of-packed-member] 66 | auto begin = reinterpret_cast<const checksum_t*>(&data); | ^~~~~
Change-Id: If73c72476786628f42a0cb75f43de3d3e313c414 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
8cef63e3 | 15-Oct-2019 |
Alvin Wang <alvinwang@msn.com> |
Add backend_adjust_offset to avoid the windows overlap
In mihawk, the windows overlap will cause the cache coherence. Hostboot writes the SPD data to BMC through a window and read it back with anoth
Add backend_adjust_offset to avoid the windows overlap
In mihawk, the windows overlap will cause the cache coherence. Hostboot writes the SPD data to BMC through a window and read it back with another window. It causes the data missed and DIMM lost.
Hostboot log 23.80714|<<DBG-956|SPD::getMemType() - MemType: 0xff, Error: NoHUID: 0x30008.
BMC log: The overlaped windows Window @ 0x756e0000 for size 0x00046000 maps flash offset 0x000e7000 Window @ 0x757e0000 for size 0x00048000 maps flash offset 0x000e5000
Tested: 1. In mihawk, it can fix the SPD cache coherence issue 2. Add unit test to verify VPNOR offset alignment
Change-Id: I92670ade4e2a91b5c49a0acabfc0456f90d49b93 Signed-off-by: Alvin Wang <alvinwang@msn.com> [AJ: Remove some MSG_INFO() spam, fix whitespace issues] Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
0acc6699 | 09-Oct-2019 |
Adriana Kobylak <anoo@us.ibm.com> |
vpnor: partition: Add write permissions to writable files
The code preserves the file permissions when the partition files are copied to the writeable area. Currently the file permissions are 664, b
vpnor: partition: Add write permissions to writable files
The code preserves the file permissions when the partition files are copied to the writeable area. Currently the file permissions are 664, but if the squashfs was built with file permissions set to 444 to make it explicit that the pnor partition files were read-only, the files in the writable area would also have read only permissions.
Therefore, explicitly add write permissions to the partition files that are copied to the writable area.
Tested:
- With current permissions (there's no change):
root@witherspoon-YL30UF74T02M:~# ls -l /var/lib/phosphor-software-manager/pnor/ro/HBD -rw-rw-r-- 1 253760 401855 1179648 Sep 23 16:30 HBD root@witherspoon-YL30UF74T02M:~#ls -l /var/lib/phosphor-software-manager/pnor/rw/HBD -rw-rw-r-- 1 root root 1179648 Oct 9 18:38 HBD
- With read-only permissions:
root@witherspoon-YL30UF74T02M:~# ls -l /var/lib/phosphor-software-manager/pnor/ro/HBD -r--r--r-- 1 root root 1179648 Oct 9 15:33 /var/lib/phosphor-software-manager/pnor/ro/HBD root@witherspoon-YL30UF74T02M:~# ls -l /var/lib/phosphor-software-manager/pnor/rw/HBD -rw-r--r-- 1 root root 1179648 Oct 9 18:43 /var/lib/phosphor-software-manager/pnor/rw/HBD
Change-Id: Ibc3f47bd3a4f645d99155d19624c7271df4d0470 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
7e3f20d0 | 01-Aug-2019 |
Andrew Jeffery <andrew@aj.id.au> |
autotools: Fix autoconf-archive compatibility issues
autoconf-archive 2019-01-06 changed the setup of code coverage support. Deal with both old and new. Based on Patrick Venture's similar patch in o
autotools: Fix autoconf-archive compatibility issues
autoconf-archive 2019-01-06 changed the setup of code coverage support. Deal with both old and new. Based on Patrick Venture's similar patch in other repositories[1].
[1] https://github.com/openbmc/phosphor-pid-control/commit/90e9dbcae6c1df3127dd3de41f9d1e1b5a438828
Change-Id: I29dae544d8feb462e848ab00c25da188f74686a7 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
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 ...
|
a804a73c | 04-Apr-2019 |
Andrew Jeffery <andrew@aj.id.au> |
mboxctl: Fix retrieval of property-based state
GetDaemonState and GetLpcState were converted from methods to properties and renamed to DaemonState and LpcState respectively in mboxd. mboxctl was ove
mboxctl: Fix retrieval of property-based state
GetDaemonState and GetLpcState were converted from methods to properties and renamed to DaemonState and LpcState respectively in mboxd. mboxctl was overlooked in the change, so update it to match.
Change-Id: I34f55a036b14c611925b164e354934769e1e0759 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
c03b8af1 | 04-Apr-2019 |
Andrew Jeffery <andrew@aj.id.au> |
MAINTAINERS: Remove Suraj
The grass was greener :)
Change-Id: I598a2faddac181684a7924d4db117b534cc7d8ad Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
81d27b04 | 07-Mar-2019 |
Lei YU <mine260309@gmail.com> |
vpnor: Rename generate-squashfs to generate-tar
The tool refernced in table.hpp is renamed to generate-tar. Update the comment in code.
Change-Id: I67f75dbe5018ab71d65f87ee14093c3972eb5846 Signed-o
vpnor: Rename generate-squashfs to generate-tar
The tool refernced in table.hpp is renamed to generate-tar. Update the comment in code.
Change-Id: I67f75dbe5018ab71d65f87ee14093c3972eb5846 Signed-off-by: Lei YU <mine260309@gmail.com>
show more ...
|
76c73772 | 31-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
Merge commit 'e50e654bca8df8254c15849c793f9279adcb1182' into master
Commit e50e654bca8d ("Add --trace support (in blktrace format)") is a broken version of commit ef0c8360065e ("Add --trace support
Merge commit 'e50e654bca8df8254c15849c793f9279adcb1182' into master
Commit e50e654bca8d ("Add --trace support (in blktrace format)") is a broken version of commit ef0c8360065e ("Add --trace support (in blktrace format)") that appears in master's linear history. Merging e50e654bca8d preserves the ability to bisect the openbmc/openbmc respository.
The merge was performed as below, which discards any changes performed in e50e654bca8d:
> $ git merge -s ours e50e654bca8df8254c15849c793f9279adcb1182
Change-Id: I134be5a54303a561ed3ef21813b1e220c0dbd0a6 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
ef0c8360 | 18-Nov-2018 |
Stewart Smith <stewart@linux.ibm.com> |
Add --trace support (in blktrace format)
In an effort understand what PNOR requests come from the host, it'd be good to be able to trace what requests come in and visualise them. blktrace is some Li
Add --trace support (in blktrace format)
In an effort understand what PNOR requests come from the host, it'd be good to be able to trace what requests come in and visualise them. blktrace is some Linux infrastructure for tracing block device activity all the way through the linux block layer, for which there is a variety of existing tooling. These tools process the (typically) kernel produced blktrace output. We can produce this same output programatically from mboxd though.
This patch gives us the (option) to start mboxd in a mode where it will write a blktrace file out, which can be fed into tools like blkparse(1) or tools like iowatcher[1] to generate charts (and video).
A quirk of the blktrace format is that it's very geared towards a full IO subsystem, so we can't directly map window operations (what we know in mboxd) to specific IO ops (i.e. we don't get "firmware read one page out of this window before closing it"). So, for each Window opening (or reusing a cached one), we write THREE blktrace events: a Queue, Dispatch, and Complete.
We can usk tools like blkparse to do everything from get a detailed list of what windows were opened and for how long:
0,0 0 1 0.000000000 0 Q R 0 + 8 [(null)] 0,0 0 2 0.000000000 0 D R 0 + 8 [(null)] 0,0 0 3 0.000182022 0 C R 0 + 8 [0] 0,0 0 4 0.042416351 0 Q R 4144 + 2040 [(null)] 0,0 0 5 0.042416351 0 D R 4144 + 2040 [(null)] 0,0 0 6 0.060802662 0 C R 4144 + 2040 [0] 0,0 0 7 0.084775813 0 Q R 64 + 288 [(null)] 0,0 0 8 0.084775813 0 D R 64 + 288 [(null)] 0,0 0 9 0.087835720 0 C R 64 + 288 [0] 0,0 0 10 1.429234244 0 Q R 8488 + 2048 [(null)]
to getting a simple summary at the end of how many windows were opened read and read/write:
CPU0 (0,0): Reads Queued: 90, 74,040KiB Writes Queued: 6, 2,664KiB Read Dispatches: 90, 74,040KiB Write Dispatches: 6, 2,664KiB Reads Requeued: 0 Writes Requeued: 0 Reads Completed: 90, 74,040KiB Writes Completed: 6, 2,664KiB Read Merges: 0, 0KiB Write Merges: 0, 0KiB Read depth: 1 Write depth: 1 IO unplugs: 0 Timer unplugs: 0
If you change the window size to something tiny, like 4096 bytes, you can get detailed paging information for hostboot at the expense of IPL time.
Pretty graphs and animations: https://www.flamingspork.com/blog/?p=4419
[1] iowatcher: http://masoncoding.com/iowatcher/
Change-Id: I5dd02b6bc616c441abf54d87a5d67c972cbaf228 Signed-off-by: Stewart Smith <stewart@linux.ibm.com> [AJ: Resolve merge conflicts, some tidy ups] Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
e50e654b | 18-Nov-2018 |
Stewart Smith <stewart@linux.ibm.com> |
Add --trace support (in blktrace format)
In an effort understand what PNOR requests come from the host, it'd be good to be able to trace what requests come in and visualise them. blktrace is some Li
Add --trace support (in blktrace format)
In an effort understand what PNOR requests come from the host, it'd be good to be able to trace what requests come in and visualise them. blktrace is some Linux infrastructure for tracing block device activity all the way through the linux block layer, for which there is a variety of existing tooling. These tools process the (typically) kernel produced blktrace output. We can produce this same output programatically from mboxd though.
This patch gives us the (option) to start mboxd in a mode where it will write a blktrace file out, which can be fed into tools like blkparse(1) or tools like iowatcher[1] to generate charts (and video).
A quirk of the blktrace format is that it's very geared towards a full IO subsystem, so we can't directly map window operations (what we know in mboxd) to specific IO ops (i.e. we don't get "firmware read one page out of this window before closing it"). So, for each Window opening (or reusing a cached one), we write THREE blktrace events: a Queue, Dispatch, and Complete.
We can usk tools like blkparse to do everything from get a detailed list of what windows were opened and for how long:
0,0 0 1 0.000000000 0 Q R 0 + 8 [(null)] 0,0 0 2 0.000000000 0 D R 0 + 8 [(null)] 0,0 0 3 0.000182022 0 C R 0 + 8 [0] 0,0 0 4 0.042416351 0 Q R 4144 + 2040 [(null)] 0,0 0 5 0.042416351 0 D R 4144 + 2040 [(null)] 0,0 0 6 0.060802662 0 C R 4144 + 2040 [0] 0,0 0 7 0.084775813 0 Q R 64 + 288 [(null)] 0,0 0 8 0.084775813 0 D R 64 + 288 [(null)] 0,0 0 9 0.087835720 0 C R 64 + 288 [0] 0,0 0 10 1.429234244 0 Q R 8488 + 2048 [(null)]
to getting a simple summary at the end of how many windows were opened read and read/write:
CPU0 (0,0): Reads Queued: 90, 74,040KiB Writes Queued: 6, 2,664KiB Read Dispatches: 90, 74,040KiB Write Dispatches: 6, 2,664KiB Reads Requeued: 0 Writes Requeued: 0 Reads Completed: 90, 74,040KiB Writes Completed: 6, 2,664KiB Read Merges: 0, 0KiB Write Merges: 0, 0KiB Read depth: 1 Write depth: 1 IO unplugs: 0 Timer unplugs: 0
If you change the window size to something tiny, like 4096 bytes, you can get detailed paging information for hostboot at the expense of IPL time.
Pretty graphs and animations: https://www.flamingspork.com/blog/?p=4419
[1] iowatcher: http://masoncoding.com/iowatcher/
Change-Id: I5dd02b6bc616c441abf54d87a5d67c972cbaf228 Signed-off-by: Stewart Smith <stewart@linux.ibm.com> [AJ: Resolve merge conflicts, some tidy ups] Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
4519bb82 | 18-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
Documentation: Remove mboxctl.md
The merge of phosphor-mboxd and mboxbridge blew away the content. No-one has complained, so remove the broken file.
Change-Id: Ic52bb4c3946b03485197efce1f6c6ff7ef71
Documentation: Remove mboxctl.md
The merge of phosphor-mboxd and mboxbridge blew away the content. No-one has complained, so remove the broken file.
Change-Id: Ic52bb4c3946b03485197efce1f6c6ff7ef714c1c Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
4ef0c132 | 18-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
mboxd: Tidy up failure paths on daemon startup
Don't try to cleanup objects we haven't initialised.
Change-Id: I218ab785af36bc3a1d3085c9dcd575e812402433 Signed-off-by: Andrew Jeffery <andrew@aj.id.
mboxd: Tidy up failure paths on daemon startup
Don't try to cleanup objects we haven't initialised.
Change-Id: I218ab785af36bc3a1d3085c9dcd575e812402433 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
81059e32 | 18-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
Makefiles: Centralise some use of VIRTUAL_PNOR_ENABLED
Better that we try to keep all the conditional junk near the top of the tree.
Change-Id: Ic9e8dca892dcf15607bace9f630f4d107e1a4b4e Signed-off-
Makefiles: Centralise some use of VIRTUAL_PNOR_ENABLED
Better that we try to keep all the conditional junk near the top of the tree.
Change-Id: Ic9e8dca892dcf15607bace9f630f4d107e1a4b4e Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
show more ...
|
de08ca2d | 17-Mar-2019 |
Andrew Jeffery <andrew@aj.id.au> |
vpnor: Rename pnor_partition_table sources to table
Change-Id: I95c5129aa81a7b4a4d88ce2f7edf6a10a3c94b98 Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |