u-boot/arch
Heinrich Schuchardt 7c6ca03eae riscv: additional crash information
If an exception occurs, the relocated program counter and return address
are required for an analysis.

With this patch you get:

    => exception undefined

    Unhandled exception: Illegal instruction
    EPC: 0000000080595908 RA: 000000008059c0c6 TVAL: 000000008030c01e
    EPC: 0000000080007908 RA: 000000008000e0c6 reloc adjusted

We can use the relocated addresses to find the involved functions in
u.boot.map:

    .text.do_undefined
                0x0000000080007908        0x8 cmd/built-in.o
    .text.cmd_process
                0x000000008000dfcc      0x11a common/built-in.o
                0x000000008000dfcc                cmd_process

If an exception occurs in an UEFI binary additionally the load addresses of
the UEFI binaries are needed. With this patch:

    => setenv efi_selftest exception
    => bootefi selftest

    Unhandled exception: Illegal instruction
    EPC: 000000008042e18a RA: 000000008042e18a TVAL: 000000008030c01e
    EPC: 000000007fea018a RA: 000000007fea018a reloc adjusted

    UEFI image [0x0000000000000000:0xffffffffffffffff] '/\selftest'
    UEFI image [0x000000008042e000:0x000000008042e43f] pc=0x18a '/bug.efi'

The value pc=0x18a matches the position of the illegal instruction in
efi_selftest_miniapp_exception.efi (loaded as /bug.efi);

    asm volatile (".word 0xffffffff\n");

    00000180   93 85 C5 11  1C 64 22 85  82 97 FF FF  FF FF 1C 64

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Tested-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Rick Chen <rick@andestech.com>
2020-08-14 14:39:41 +08:00
..
arc board_f: Factor out bdinfo bi_mem{start, size} to setup_bdinfo 2020-08-06 14:26:35 -04:00
arm Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell 2020-08-13 08:25:25 -04:00
m68k board_f: m68k: Factor out m68k-specific bdinfo setup 2020-08-06 14:26:35 -04:00
microblaze efi_loader: use CONFIG_STACK_SIZE in the UEFI sub-system 2020-08-01 11:58:23 +02:00
mips - doc: fix qemu-mips build instructions 2020-08-04 11:07:16 -04:00
nds32 treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
nios2 cpu: Convert the methods to use a const udevice * 2020-07-25 14:46:57 -06:00
powerpc board_f: ppc: Factor out ppc-specific bdinfo setup 2020-08-06 14:26:35 -04:00
riscv riscv: additional crash information 2020-08-14 14:39:41 +08:00
sandbox test/py: add tests for the button commands 2020-07-28 19:30:39 -06:00
sh sh: r2dplus: Add SCIF1 to the basic DT 2020-08-02 19:58:27 +02:00
x86 sf: Drop dm.h header file from spi_flash.h 2020-08-03 22:19:54 -04:00
xtensa board_f: Factor out bdinfo bi_mem{start, size} to setup_bdinfo 2020-08-06 14:26:35 -04:00
.gitignore
Kconfig board_f: Factor out bdinfo bi_mem{start, size} to setup_bdinfo 2020-08-06 14:26:35 -04:00
u-boot-elf.lds arch: Add explicit linker script for u-boot-elf 2020-04-03 11:52:55 -04:00