Age | Commit message (Collapse) | Author | Files | Lines |
|
It operates on bits representing whatever objects the caller wants
it to represent, it's not per-se a memory allocator (it's meant to
be used among others by XIVE for VP allocations). As such it cannot
keep linked lists of free objects, so don't expect stellar perfs.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[stewart@linux.vnet.ibm.com: add (C) header, fix gcc4.8 build error]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The worst test suite ever
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
A unit test for parsing sub-partition info is useful for a number
of reasons, one of which showed its head during development of
secure/trusted boot.
This patch just moves things around, there's no functional changes.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This enables memory poisoning in allocations and list checking
among other things.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
If the kernel called an OPAL API with vmalloc'd address
or any other address range in real mode, we would hit
a problem with aliasing. Since the top 4 bits are ignored
in real mode, pointers from 0xc.. and 0xd.. (and other ranges)
could collide and lead to hard to solve bugs. This patch
adds the infrastructure for pointer validation and a simple
test case for testing the API
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
[stewart@linux.vnet.ibm.com: move function to opal-internal.h rather than opal-api.h]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Run a small wrapper around some unit tests with the QTEST makefile macro
(QTEST=Quiet TEST). Also, wrap boot tests in mambo and qemu to be quiet
by default.
Both ./test/run.sh and the modified mambo/qemu test runner scripts output
full stdout and stderr in the event of error.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Currently these exist for some parts of the source tree, but not all of it. They're nice if you are only modifing code in a one part of the tree as the full test suite can be a little slow.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
This change adds a function to check whether a range of memory is
covered by one or more reservations.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
We (slightly) change the internal API so that we operate on parameters
rather than globals, this means it's easier to unit test too.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
|
|
This change adds a function to iterate mem_regions.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
If we reserve any memory after mem_region_add_dt_reserved, that
reservation won't appear in the device tree. Ensure that we can't
add new regions after this point.
Also, add a testcase for the finalise, including some basic
reserved-ranges property checks.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
If we reserve any memory after mem_region_add_dt_reserved, that
reservation won't appear in the device tree. Ensure that we can't
add new regions after this point.
Also, add a testcase for the finalise, including some basic
reserved-ranges property checks.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.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>
|
|
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>
|
|
Can still get the details with V=1, just like normal make.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
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>
|
|
The core/test/ and libc/test/ Makefile.check files both contain:
-include core/test/*.d (or libc/test/*d)
which is incorrect, since that evaluates literally to a *.d file.
This results in each build trying to find that file, and creating
it when not found (in an incorrect way because of other problems in
the Makefile).
The correct way to specify it is:
-include $(wildcard core/test/*.d)
Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
For now running off the event pollers, that will improve once we get
delayed interrupts from the SLW
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
In order to support fsp-less machines we need to be able to log errors
using a BMC or some other mechanism. Currently the error logging code
is tightly coupled to the platform making it difficult to add
different platforms.
This patch factors out the generic parts of the error logging code in
preparation for adding different logging backends. It also adds a
generic mechanism for pre-allocating a specific number of objects.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
The PEL log format is not specific to the FSP. We plan to use the same
format for OpenPOWER systems. This patch refactors the code into a
platform agnostic file.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Add support in core/test/Makefile.check to build -gcov
binaries (with -lgcov and -fprofile-blah-blah) as well
as some targets for producing lcov HTML code coverage reports.
As part of this, I had to fix up an oddity in run-mem_region_init
where that due to running under Valgrind, we'd be malloc()ed a
heap with a small address, well inside the mem_regions we added but
when not running under valgrind (e.g. for code coverage reporting)
we would get a much larger address, outside this range and hit
an assert. So, after fiddling with the memory stuff for this test,
I think I have it right - it passes both under valgrind and not and
does produce code coverage data.
Currently, we're at this level of code coverage by unit tests:
Hit Total Coverage
Lines: 1936 2574 75.2 %
Functions: 177 225 78.7 %
Branches: 1243 2360 52.7 %
The totals should largely be ignored due to the only code being
counted is that linked into the unit tests (total LOC is ~50kLOC
according to sloccount... so unit tests currently cover < 5%)
Try the "make coverage-report" target, you'll get coverage-report
directory with a LCOV HTML report
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|