summaryrefslogtreecommitdiffstats
path: root/core/utils.c
Commit message (Collapse)AuthorAgeFilesLines
* core/utils: add snprintf_symbolNicholas Piggin2018-02-081-1/+25
| | | | | | | | | | get_symbol is difficult to use. Add snprintf_symbol helper which prints a symbol into a buffer with length, and returns the number of bytes used, similarly to snprintf. Use this in the stack dumping code rather than open-coding it. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add support for new gcc 7 parametrized stack protectorBenjamin Herrenschmidt2017-12-201-3/+0
| | | | | | | | This gives us per-cpu guard values as well. For now I just xor a magic constant with the CPU PIR value. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add fwts annotations for critical errorsStewart Smith2016-06-201-0/+7
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix two sparse warnings on __stack_chk_guardStewart Smith2015-11-091-1/+2
| | | | | | | core/utils.c:25:35: warning: constant 0xdeadf00dbaad300d is so big it is unsigned long core/utils.c:25:15: warning: symbol '__stack_chk_guard' was not declared. Should it be static? Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* platform: Add platform hook for terminate callVasant Hegde2015-09-091-1/+3
| | | | | | | | | Current abort() call works fine on FSP based system. We need different mechanism on BMC based machine. Hence introduce platform hook for terminate call. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Move FSP specific abort() code to platform layerVasant Hegde2015-09-091-15/+3
| | | | | | | | | | | | | | | Presently abort() call sets up HID0, triggers attention and finally calls infinite for loop. FSP takes care of collecting required logs and reboots the system. This sequence is specific to FSP machine and it will not work on BMC based machine. Hence move FSP specific code to hw/fsp/fsp-attn.c. Note that this patch adds new parameter to abort call. Hence replaced _abort() by abort() in exception.c so that we can capture file info as well. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Disable bust_locks for general calls of abort()Alistair Popple2015-07-061-2/+0
| | | | | | | | | | | | | | | | | | Currently bust_locks is set to true whenever abort() is called. This was done for the lock debugging code which calls abort() as its last step. If there is a locking error there is a good chance parts of the console code will be deadlocked (for example if it has a lock on the scom bus). However busting locks can cause problems, especially now that flash data is being read in parallel as this uses the LPC bus. Instead of getting a nice error message showing where the code aborted it is likely the message will go missing, or it will be garbled by the flash data. So instead of always busting locks make it so they're only busted if they're suspected of being broken. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Make abort() update sp attn area (like assert does)Stewart Smith2015-02-111-2/+2
| | | | | | Gives better diagnostics in error logs/dumps Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add symbolic backtraces and expose skiboot map to LinuxBenjamin Herrenschmidt2014-11-181-0/+27
| | | | | | | We use a double link technique, doing a first pass with a .o containing a dummy symbol map, then re-linking with a new .o Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* Rename backtrace.c to stack.c and move stack related bitsBenjamin Herrenschmidt2014-11-181-81/+0
| | | | | | ... from util.c to stack.c Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* Stack checking extensionsBenjamin Herrenschmidt2014-11-171-2/+88
| | | | | | | | | | | | 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>
* Use PR_EMERG priority in assert() codepathStewart Smith2014-08-081-0/+6
| | | | | | | | | | | | | Moving assert_fail() out of libc and into core/utils.c so that we can sanely call prlog(PR_EMERG). We shorten it from three fputs calls down to one prlog() call. This may increase the number of cycles and stack usage for when we hit an assert, which may not be desirable. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* Use PR_EMERG priority in (part of) assert()Stewart Smith2014-08-081-1/+1
| | | | | | | | When handling assert and we're going to fail, get the message out with a high priority. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* Initial commit of Open Source releaseBenjamin Herrenschmidt2014-07-021-0/+59
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
OpenPOWER on IntegriCloud