summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Add functions to backtrace into a non-text bufferBenjamin Herrenschmidt2014-11-182-28/+72
| | | | | | | | | | | | | | | | | | Separate text translation from capture of the backtrace Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | | Stack checking extensionsBenjamin Herrenschmidt2014-11-175-14/+107
|/ / | | | | | | | | | | | | | | | | | | | | | | This patch adds: - Normal builds are done with -fstack-protector (we want to investigate using -fstack-protector-strong on gcc4.9 but for now we just use that - Build with STACK_CHECK=1 will use -fstack-protector-all and -pg and will check the stack in mcount Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | timer: Change property name "ibm,heartbeat-freq" -> "ibm,heartbeat-ms"Benjamin Herrenschmidt2014-11-141-2/+2
| | | | | | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | bt/ipmi: Quieten logging outputAlistair Popple2014-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Some tools (eg. ipmitool) that use the Linux ipmi stack send potentially invalid commands to probe functionality. Currently skiboot prints an error to the console whenever this happens resulting in excessive noise when using the Linux ipmi stack. This patch just removes and/or lowers the logging level of these errors. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | timer: Only check "poll" timers on actual poll, not any interruptBenjamin Herrenschmidt2014-11-123-4/+5
| | | | | | | | | | | | | | | | Due to the lack of SLW timed interrupt support, we take the opportunity to check out timers on any incoming interrupt. However we really don't want to do that for the background pollers. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | i2c: Use new timer facility and improve interrupts handlingBenjamin Herrenschmidt2014-11-122-1/+2
| | | | | | | | | | | | | | | | | | | | We only poll the masters for the chip that got the interrupt and we improve the running of the timers as well. We user the new TIMER_POLL facility to replace the use of the OPAL poller, which simplifies the code further. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | timer: Add "polling" timersBenjamin Herrenschmidt2014-11-122-16/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | These have no expiry and get called whenever the opal pollers run, they are intended to replace most opal pollers and allow the same code in drivers to chose between a poller or a timer based on things like interrupt availability for example. The other advantage over existing pollers (which I hope to deprecate) is that they are protected against re-entrancy (while still running without locks held). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | i2c: Move bus management and OPAL API to core i2c codeBenjamin Herrenschmidt2014-11-112-1/+117
| | | | | | | | | | | | And start adding interfaces to lookup i2c busses. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | timer: Add scheduled timer facilityBenjamin Herrenschmidt2014-11-076-1/+202
| | | | | | | | | | | | | | 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>
* | i2c: Bug fixes, clean up of the codeNeelesh Gupta2014-11-051-2/+3
| | | | | | | | | | | | | | | | | | Fixed few bugs and clean up a lot. Renamed the state machine variables to make more sense. A new helper 'p8_i2c_check_work' to avoid hitting deep call stack after request complete. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | core: Add support for loading an external initramfsJeremy Kerr2014-10-301-0/+25
| | | | | | | | | | | | | | | | | | | | | | Using the platform.load_resource interface, allow an external initramfs image to be passed to the kernel. We split the KERNEL_LOAD_BASE/KERNEL_LOAD_SIZE region in half, to allow space for the initramfs. Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | platform: add a platform hook for loading external resourcesJeremy Kerr2014-10-301-38/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, in core/init.c we do a fsp-specific load procedure to grab the kernel image. We'd like to do two things: allow other types of resources, and have paths for non-FSP platforms to perform loads. This change adds a platform-specific load_resource hook, and moves the currently loading code to fsp_load_resource. To allow other resource types, we add an identifier to indicate the type of resouce to load. Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | ipmi: Add an opal interface to the ipmi stackAlistair Popple2014-10-301-3/+5
| | | | | | | | | | | | | | | | | | This patch adds two opal calls (opal_ipmi_send and opal_ipmi_recv) to allow an operating system to send and receive arbitrary ipmi messages to the BMC. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | opal: Add facility for dynamic event bitsJeremy Kerr2014-10-301-1/+39
| | | | | | | | | | | | | | | | We steal opal_update_pending_evt's lock for protecting the allocated dynamic event mask. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | Revert "core/init: Add device tree fixup for the i2c base address"Benjamin Herrenschmidt2014-10-281-172/+2
| | | | | | | | | | | | This reverts commit cdaf6b5b313c4ea5e0cdcc299a6890817f6b02c1. This hard codes Tuleta implementation details in the generic code...
* | Fix stack usage might be unbounded warning in core/test/run-mem_region_initStewart Smith2014-10-271-1/+4
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | core/init: Add device tree fixup for the i2c base addressNeelesh Gupta2014-10-271-2/+172
| | | | | | | | | | | | | | | | This patch adds the fix up in device tree to have I2C node under xscom, providing all the relevant information of a given i2c core. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | hw/i2c: i2c driver infrastructure providing device I/ONeelesh Gupta2014-10-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the generic i2c driver infrastructure to handle multiple i2c master cores present in the system and exposes structures and interfaces for the client to perform I/O on the i2c slave devices. The driver adds the capability to queue multiple requests from client and let clients notified asynchronously after completion. It does that by handling the i2c interrupt or through OPAL poller in the absence of interrupt. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | irq/occ/opal: Add self-sent dummy interruptBenjamin Herrenschmidt2014-10-241-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | This makes OPAL use the OCC interrupt facility to send itself an interrupt whenever the OPAL event bit is set as a result of an OPAL call that wasn't itself opal_handle_interrupt() or opal_handle_hmi() (both of which we know the OS will already deal with appropriately). This ensures that OPAL event changes are notified to Linux via its interrupt path which is necessary for it to properly broadcast the state change to its various clients. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | Test cleanup code path in opal_msg_init()Stewart Smith2014-10-221-2/+11
| | | | | | | | | | | | (Although when exactly is this going to be hit?) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | fsp/elog: Make the logging backend platform specificAlistair Popple2014-10-221-2/+8
| | | | | | | | | | | | | | | | | | | | OpenPOWER boxes don't have an FSP and therefore implement their own method for passing log messages to a support processor. This patch makes the logging method platform specific. Signed-off-by: Alistair Popple <alistair@popple.id.au> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | fsp/elog: Create a logging frontendAlistair Popple2014-10-225-2/+312
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | fsp/elog: Separate the PEL log formatting functionsAlistair Popple2014-10-224-3/+338
| | | | | | | | | | | | | | | | | | | | 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 some (not that good) testing of mem_dump_allocs()Stewart Smith2014-10-221-0/+1
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Test zalloc() failure case.Stewart Smith2014-10-221-0/+4
| | | | | | | | | | | | This brings us to near total test coverage of core/malloc.c Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Add unit test for realloc failureStewart Smith2014-10-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increases test coverage of realloc too! Was: Hit Total Coverage Lines: 1936 2574 75.2 % Functions: 177 225 78.7 % Branches: 1243 2360 52.7 % Now: Lines: 1945 2582 75.3 % Functions: 177 225 78.7 % Branches: 1247 2364 52.7 % Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Preliminary code coverage reporting infrastructureStewart Smith2014-10-222-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix make check after Ben broke it with external/* -> external/trace/ renameStewart Smith2014-10-211-1/+1
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Rename mem_size() to mem_allocated_size()Stewart Smith2014-10-173-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | This better states the intention of what it should return. I was bit unsure when fixing mem_size(), so hopefully this makes future me (or other people) less unsure as to the intended return value of this function. No functional changes, just rename. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Rusty Russell <rusty@au1.ibm.com>
* | in realloc(), memcpy() call would copy past end of allocationStewart Smith2014-10-172-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | or: Fix mem_size() to remove struct alloc_hdr from returned value This bug was caught by switching test/run-malloc.c over to using malloc/free (system malloc/free) to allocate the heap that we use for testing our malloc and free. Basically, when we did that, run-malloc.c test would get this valgrind warning: ==3869== Invalid read of size 8 ==3869== at 0x4C2A706: memcpy (mc_replace_strmem.c:838) ==3869== by 0x40323F: __realloc (malloc.c:69) ==3869== by 0x405815: main (run-malloc.c:142) Which was because in realloc(), when we have to relocate the allocated bit of memory, we memcpy the contents of the old location into the new one. The current mem_size() implementation *included* struct alloc_hdr which mean that we were copying allocated size + sizeof(struct alloc_hdr) from the returned pointer. This meant we read sizeof(struct alloc_hdr) past the end of the allocation... which will pretty much always be harmless, just get random junk in the realloc()ed space. i.e. we would memcpy() 64+16 (80) bytes from the malloc(64) space to the realloc(128) space, which is, obviously, 16 bytes more than we should. IF we had some memory after a region that would make us explode if we read, then we'd explode around the realloc() call... which would not be so good. After a bit of a code audit I'm pretty sure this isn't going to actually hurt us anywhere... or, at least, I hope not... The fix is simple: fix mem_size() to subtract sizeof(struct alloc_hdr) from the returned value. This should be okay with the other test case that checks mem_size() result and there are no other mem_size() callers. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Rusty Russell <rusty@au1.ibm.com>
* | Fix stack usage in run-malloc-speed test by using mallocStewart Smith2014-10-151-1/+4
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | HBRT: Cleanup log outputBenjamin Herrenschmidt2014-10-151-3/+3
| | | | | | | | | | | | A line was way too long... Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | Quieten a couple more thingsBenjamin Herrenschmidt2014-10-151-3/+3
| | | | | | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | uart: Give UART it's own OPAL console callbacks instead of dummy consoleBenjamin Herrenschmidt2014-10-151-6/+1
| | | | | | | | | | | | | | | | | | | | | | This means the Linux output no longer gets into our internal log, which makes dumping of it from Linux a lot nicer. It will also allow us to improve the way we do the bufferring for Linux and to exploit eventually the TX interrupts. It will also allow us to implement some form of timeouts for the OPAL console variant of it so we don't get stuck of the BMC doesn't consume from the virtual UART. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | console: Move dummy_console_add_nodes() to common codeBenjamin Herrenschmidt2014-10-152-4/+4
| | | | | | | | | | | | All the platforms basically do the same thing Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | skiboot: Add default error handler for ipmi messagesAlistair Popple2014-10-151-2/+5
| | | | | | | | | | | | | | | | Most messages won't require their own error handler. This patch adds a default handler to ensure we don't leak messages. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | (somewhat) quieten PCI during bootStewart Smith2014-10-151-7/+6
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Make HB a lot quieter on boot, set log priority in core/hostservices.cStewart Smith2014-10-151-35/+36
| | | | | | | | | | | | Many things can just be PR_DEBUG, a few PR_INFO Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Get assert and PEL log messages from HBRT to the correct priorityStewart Smith2014-10-151-2/+2
| | | | | | | | | | | | (PR_CRIT and PR_ERR respectively) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Secondary CPUs calling in should be PR_DEBUGStewart Smith2014-10-151-1/+1
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | convert printf in core/cpu.c to prlog with PR_INFO or PR_DEBUGStewart Smith2014-10-151-7/+8
| | | | | | | | | | | | | | | | Most of these things are only needed during some interesting debugging sessions, not for normal startup. Let's keep them in memory buffer, not on serial console (unless user specifies) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Returning CPU message just needs to be PR_DEBUG at mostStewart Smith2014-10-151-1/+1
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Modify the (many) printouts in core/cpu.c to have appropriate PR levelsStewart Smith2014-10-151-8/+12
| | | | | | | | | | | | | | We don't need too much detail coming out the serial port, some more detail in memory is good, but for the most part, summarize. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | opal_del_caller shouldn't be called: up severity level, change message.Stewart Smith2014-10-151-1/+2
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Make assert(false) for calling attn be a PR_EMERG level errorStewart Smith2014-10-151-1/+1
| | | | | | | | | | | | | | When we do something so severe we're asserting... we want that to be in the log! Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Merge branch 'release-2.1.1'Benjamin Herrenschmidt2014-10-081-9/+8
|\|
| * PCI: Refactor error injectionGavin Shan2014-10-081-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch refactors the code we had for PCI error injection. It doesn't change the logic: * Rename names of error types and functions according to the comments given by Michael Ellerman when reviewing the kernel counterpart. * Split The backend of error injection for PHB3 and P7IOC to multiple functions to improve code readability. Some logics are simplified without affecting their original functionality. * Misc cleanup like renaming variables and functions. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | core: Make secondary spin and locks use cpu_relax()Benjamin Herrenschmidt2014-10-083-9/+6
| | | | | | | | | | | | | | | | This makes secondaries spinning waiting for a job and spinlocks use cpu_relax() which speeds up the primary thread and thus speeds up the boot process a bit. Also prettify a bit cpu_relax() implementation Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | plat/palmetto: Move most code to a common file & reorder inits a bitBenjamin Herrenschmidt2014-10-051-1/+1
| | | | | | | | | | | | | | | | | | This moves most of the palmetto platform code to a "common" file to share with other platforms using AST BMC. We also initialize IPMI later. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | Merge branch 'release-2.1.1'Benjamin Herrenschmidt2014-10-021-11/+7
|\|
OpenPOWER on IntegriCloud