[PATCH 3/3] efi_selftest: implement exception test for sandbox
Simon Glass
sjg at chromium.org
Wed Nov 11 15:32:16 CET 2020
On Tue, 10 Nov 2020 at 16:09, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> Provide a unit test that causes an illegal instruction to occur.
>
> The test can be run with the following commands:
>
> => setenv efi_selftest exception
> => bootefi selftest
>
> This might be the output:
>
> Executing 'exception'
> EFI application triggers exception.
> Illegal instruction
> pc = 0x1444d016, pc_reloc = 0xffffaa078e8dd016
> UEFI image [0x0000000000000000:0xffffffffffffffff] '/\selftest'
> UEFI image [0x000000001444b000:0x0000000014451fff] pc=0x2016 '/bug.efi'
> Resetting ...
>
> It would tell us that the exception was triggered by an instruction
> 0x2016 bytes after the load address of the binary with filename /bug.efi.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
> lib/efi_selftest/efi_selftest_miniapp_exception.c | 2 ++
> 1 file changed, 2 insertions(+)
Test for U-Boot code should be via U-Boot directly and not EFI. It is
OK to have an EFI test as well if you like, but I really don't want to
rely on the EFI complexity to test U-Boot itself.
Regards,
Simon
More information about the U-Boot
mailing list