commit | 8cef63e3a3652b25f6a310800c1e0bf09aeed4c6 | [log] [tgz] |
---|---|---|
author | Alvin Wang <alvinwang@msn.com> | Tue Oct 15 23:23:38 2019 +0800 |
committer | Andrew Jeffery <andrew@aj.id.au> | Tue Oct 29 14:30:10 2019 +1030 |
tree | 7c39522b8457ca6652c61c79ec3f784d63ebe6e0 | |
parent | 0acc669979cc5b1b66c2c4e5d975c60779bedd81 [diff] |
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>
Copyright 2017 IBM
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This repo contains the protocol definition for the host to BMC mailbox communication specification which can be found in Documentation/mbox_procotol.md.
There is also a reference implementation of a BMC mailbox daemon, the details of which can be found in Documentation/mboxd.md.
Finally there is also an implementation of a mailbox daemon control program, the details of which can be found in Documentation/mboxctl.md.
The build system is a standard autotools setup. bootstrap.sh
runs all the jobs necessary to initialise autotools.
By default mboxd is configured and built without the 'virtual PNOR' feature discussed below. The virtual PNOR functionality is written in C++, and due to some autotools clunkiness even if it is disabled mboxd will still be linked with CXX
. Point CXX
to cc
at configure time if you do not have a C++ compiler for your target (./configure CXX=cc
).
If you are hacking on the reference implementation it's recommended to run bootstrap.sh
with the dev
argument:
$ ./bootstrap.sh dev $ ./configure $ make $ make check
This will turn on several of the compiler's sanitizers to help find bad memory management and undefined behaviour in the code via the test suites.
Otherwise, build with:
$ ./bootstrap.sh $ ./configure $ make $ make check
In addition to its role as a flash abstraction mboxd
can also serve as a partition/filesystem abstraction. This feature is known as 'virtual PNOR' and it can be enabled at configure
time (note that this requires a C++ compiler for your target):
$ ./bootstrap.sh $ ./configure --enable-virtual-pnor $ make $ make check
This codebase is a mix of C (due to its heritage) and C++. This is an ugly split: message logging and error handling can be vastly different inside the same codebase. The aim is to remove the split one way or the other over time and have consistent approaches to solving problems.
phosphor-mboxd is developed as part of the OpenBMC project, which also leads to integration of frameworks such as phosphor-logging. Specifically on phosphor-logging, it's noted that without care we can achieve absurd duplication or irritating splits in where errors are reported, as the C code is not capable of making use of the interfaces provided.
Message logging MUST be done to stdout or stderr, and MUST NOT be done directly via journal APIs or wrappers of the journal APIs.
Rationale:
We have two scenarios where we care about output, with the important restriction that the method must be consistent between C and C++:
In the first case it is desirable that the messages appear in the system journal. To this end, systemd will by default capture stdout and stderr of the launched binary and redirect it to the journal.
In the second case it is desirable that messages be captured by the test runner (make check
) for test failure analysis, and it is undesirable for messages to appear in the system journal (as these are tests, not issues affecting the health of the system they are being executed on).
Therefore direct calls to the journal MUST be avoided for the purpose of message logging.
Note: This section specifically targets the use of phosphor-logging's log<T>()
. It does not prevent the use of elog<T>()
.