Age | Commit message (Collapse) | Author | Files | Lines |
|
If you've built a zImage.epapr using op-build, you can now drop it
in the top level skiboot source tree, run 'make check' and these
test files will pick it up and run a boot test using it.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The OPAL rtc read interface currently fails as the tod state is
not getting updated in the callback. The patch fixes this issue.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This seem to be left behind during the previous commit for creating
a generic interface of reading the cached tod on non-fsp systems.
So, remove the old prototype fsp_rtc_get_cached_tod().
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
There could be some processor chips not populated in the system.
So, if we are not able to get chip data of given chip id, we should
just move on to the next or return instead of aborting (bz 120562).
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Based on Habanero.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Otherwise we crash with recursive lock error during boot on some systems
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
I got the following recursive lock crash:
LOCK ERROR: Invalid recursive lock @0x30108108 (state: 0x0000000000000001)
[315691375,0] Aborting!
CPU 0000 Backtrace:
S: 0000000031a03080 R: 0000000030013508 .backtrace+0x24
S: 0000000031a03100 R: 0000000030017128 .abort+0x64
S: 0000000031a03170 R: 0000000030015d34 .lock_error+0x54
S: 0000000031a031f0 R: 0000000030015de8 .lock+0x50
S: 0000000031a03270 R: 000000003004fc20 .elog_timeout_poll+0x28 <- take elog_write_lock
S: 0000000031a03300 R: 0000000030017d48 .opal_run_pollers+0x54
S: 0000000031a03380 R: 0000000030043fdc .fsp_sync_msg+0x74
S: 0000000031a03410 R: 000000003004eaa0 .op_display+0xdc
S: 0000000031a034c0 R: 0000000030015d08 .lock_error+0x28 <- printf"LOCK ERROR"
S: 0000000031a03540 R: 0000000030015de8 .lock+0x50 <-
S: 0000000031a035c0 R: 000000003002413c .rtc_cache_get+0x20 <- rtc_tod_lock INCORRECTLY KEPT LOCK
S: 0000000031a03650 R: 000000003002421c .rtc_cache_get_datetime+0x24
S: 0000000031a03700 R: 0000000030023100 .create_pel_log+0x340
S: 0000000031a037f0 R: 000000003004f9dc .opal_send_elog_to_fsp+0x5c <- take elog_write_lock
S: 0000000031a03880 R: 00000000300238b4 .log_simple_error+0xe0
S: 0000000031a03a10 R: 00000000300245c8 .__xscom_write+0xb8
S: 0000000031a03aa0 R: 00000000300248c0 .xscom_write+0x138
S: 0000000031a03b60 R: 000000003002af1c .occ_send_dummy_interrupt+0x34
S: 0000000031a03bd0 R: 0000000030017b9c .opal_update_pending_evt+0x68 <- take evt_lock
S: 0000000031a03c60 R: 00000000300511c8 .update_opal_dump_notify+0x48
S: 0000000031a03cd0 R: 00000000300517f0 .add_dump_id_to_list+0xe8
S: 0000000031a03d80 R: 00000000300553e4 .ibm_fsp_init+0xd4
S: 0000000031a03e30 R: 00000000300140f0 .main_cpu_entry+0x3ec
S: 0000000031a03f00 R: 0000000030002504 boot_entry+0x18c
Which is wonderfully fascinating as there are *TWO* lock_error frames in
the call stack, which means we lost the original error.
This is because op_display() sends an FSP message with fsp_sync_msg() which
runs opal_run_pollers() which ended up running a poller that tried to take
a lock we already had when we ran into trouble.
Basically, running pollers during this kind of fatal error handling is a bad
idea. So, instead of doing that, just queue the FSP message and don't wait
for a response (we don't really care about the response on a fatal error
anyway).
Additionally, move op_display() to *after* the printf call on the hope that
printf ends up being a bit more foolproof than having to send FSP messages.
Now, with this bug fixed, the correct lock_error() will be displayed.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Provide the frequencies in same unit (HZ) for calculating the bit rate
divisor value.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Now it shows up as untested in lcov!
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Now it shows up as untested in lcov!
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This means that it shows up in lcov as untested.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Initial implementation and support for more libc test cases
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
While running HMI tests I saw a massive corruption in OPAL for one of the
HMI test that injects TB error. On investigation I found that
vsnprintf()->print_itoa() was the culprit. print_itoa function uses tmp
array of size 16 to convert unsigned long value to ASCII. But an unsigned
value of 0xffffffffffffffff needs atleast 25 characters to print its ASCII
representation. This caused an array to overflow resulting into corruption,
unpredictable behavior and finally system termination.
We could fix this by increasing the size of tmp[] array but that still won't
fix this bug completely. While auditing vsnprintf() function I found that
it makes use of print_*() functions to write data to buffer. But none of
the print_* function have any check on buffer size before writing data to it.
Without size check print_*() can easily overrun buffer passed by
vprlog()->vsnprintf()->print_format()->print_*() causing massive corruption
leading to unpredictable behavior.
This patch fixes this bug by modifying print_*() function to check for
buffer size to avoid buffer overrun.
- Modified print_format(), print_fill() and print_itoa() to take bufsize
as argument and added a size check while writing to buffer.
- Remove temporary array from print_itoa(), instead write data directly to
buffer.
- Added two new function print_str_fill() and print_str() to be used as
helper routine for '%s' fmt case in print_format() function. These new
routines now has a check on buffer size while copying NULL terminated
string to buffer.
- Added "!bufsize" check in vsnprintf() to avoid buffer overrun while
setting NULL character before returning.
I ran HMI tests with this patch successfully. I also tested this patch by
reducing size of the buffer (in core/console-log.c:vprlog()) from 320 to 50
and booted the lid successfully with no corruption at all.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Add unit test for buffer overrun in prlog/printf.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
[stewart@linux.vnet.ibm.com: rebased to stable branch]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
All very early. Comments/review needed.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This way we get a true representation from the lcov coverage-report
about what firmware code we're testing (besides, test cases are always
going to only have 50% of branches hit - we're asserting the tests pass!)
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This increases our code coverage of pel.c from 81.3% to 98.7%
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Cover pel buffer too small case in create_pel_log
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This downloads and installs mambo, the power8 simulator, including some
dependencies to ensure it runs on Travis' ancient Ubuntu 12.04.
Without the newer libc, you'll see a warning like this:
/opt/ibm/systemsim-p8/bin/systemsim-pegasus:
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not
found (required by /opt/ibm/systemsim-p8/bin/systemsim-pegasus)
Where GLIBCXX_3.4.20 is GCC 4.9. This is why we require libstdc++ from the
ppa.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Can still get the details with V=1, just like normal make.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
With some fun Makefile rules, we can pick up all CCAN unit tests.
We exclude the unit test source files from the lcov report itself.
Add skeleton ccan config.h and tap.h that are enough for us to build
and run the test suite. Currently, the minimalist versions should
be fine (and we don't need CCAN configurator).
Also includes -Werror fixes for ccan tests.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
powerpc-linux-gnu-gcc -m64 -c -MMD -Itest/hello_world/hello_kernel/ -o
test/hello_world/hello_kernel/hello_kernel.o
test/hello_world/hello_kernel/hello_kernel.S
test/hello_world/hello_kernel/asm-utils.h
powerpc-linux-gnu-gcc: fatal error: cannot specify -o with -c, -S or -E
with multiple files
GCC barfed as we were passing the header and the c file while compiling
with -c. Fix the rule to just build source file.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The test for expect would always return true. This change makes it do
the correct thing in the presence and absence of expect on my Ubuntu
machine.
Also, skip the test if the user has KERNEL set. With this set skiboot
contains an embedded kernel, and will load that before falling back to
our hello_world test kernel, causing all kinds of confusion.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The strings should be "tyan,..." not "ibm,..."
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Instead of having individual rules to generate .d, add -MMD to
HOSTCC parameters, and just include the generated .d files.
This fixes a few weird dependency issues.
Also, make the mambo hello_kernel test depend on skiboot.lid
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Just calls OPAL_CONSOLE_WRITE with "Hello World!" and with mambo
we can execute this tiny boot test in not much time at all.
Good little sanity check.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
A lot of projects use CROSS_COMPILE for specifying the cross compile
prefix, so support that as well as CROSS.
For example this allows a user to set CROSS_COMPILE once in their
environment and build both Linux & Skiboot with the same setting.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
[stewart@linux.vnet.ibm.com: only set if env variable is set]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Rather than hard coding /tmp/zImage.epapr, get the zImage from an environment
variable.
This is a) cleaner, and b) allows running multiple copies of the
simulator against different kernels simultaneously.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Once we have the FSP in reset, we don't expect it to respond to any
outstanding mbox commands for which we are expecting one. Reset the
bitmap to reflect the same.
While there, remove the stale comment about timeout resets. We use
the fsp_cmdclass->timeout as a constant for all classes and a value
0 indicates an invalid class entry in the discontiguous fsp_cmdclass[].
The bitmap is what gates whether we process outstanding messages in
the class.
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Fix the i2c device node name that should show the functionality and
use a dedicated 'target' name property to tell targets being controlled.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
generic_platform_init() adds this propery by default in commit
9594a715b50c338f1261e88c12c120cf8e5b8bba . If a platform adds it to the dt,
Sapphire detects multiple dt props and dies. So don't add it if already
exists in the dt.
Signed-off-by: Ryan Grimm <grimm@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Passing the wrong parameter to snprintf (sizeof(char*)) rather
than actual length of the string. GCC 4.9 told us about it (and broke
make check when I enabled -Werror)
hdata/test/../memory.c: In function ‘add_address_range’:
hdata/test/../memory.c:144:23: error: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We now prerror() for cases where we're failing to send responses.
there's likely some better handling of this that can go on,
but at least we'll have a log message now.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Fix Wunused-result
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Commit c36c5607 added warn_unused_result compilation flag to
fsp_queue_msg function....which resulted in multiple warnings
in EPOW driver. This patch fixes those warnings.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Commit c36c5607 added warn_unused_result compilation flag to
fsp_queue_msg function....which resulted in multiple warnings
in DPO driver. This patch fixes those warnings.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Fix Wunused_result
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Fix Wunused-result
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Fix Wunused-result
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
fsp_fetch_data_queue() internally calls fsp_queue_msg().
So ideally we should consume the result of this function.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|