[PATCH v2 0/4] sandbox: exception handling

Heinrich Schuchardt xypron.glpk at gmx.de
Thu Nov 12 00:29:55 CET 2020


Currently if an exception SIGILL, SIGBUS, SIGSEGV occurs the sandbox
stops execution. This does not match the behavior on other architectures.

Instead print the current program counter and if any the involved UEFI
binaries. Then depending on a customizing system either reset the system
or exit to the OS.

When testing UEFI binaries like the Self Certification Test exceptions may
occur. Without information about the UEFI binary where the exception
was caused it is difficult to analyze the cause.

The exception command is implemented for the sandbox. This command allows
to trigger SIGILL or SIGSEGV.

v2:
	add a customizing switch
	set SA_NODEFER flag for sigaction
	provide a unit test for the exception command

Heinrich Schuchardt (4):
  sandbox: add handler for exceptions
  cmd: sandbox: implement exception command
  efi_selftest: implement exception test for sandbox
  test: unit test for exception command

 arch/Kconfig                                  |  1 +
 arch/sandbox/Kconfig                          |  9 ++++
 arch/sandbox/cpu/os.c                         | 40 ++++++++++++++++++
 arch/sandbox/cpu/start.c                      |  4 ++
 arch/sandbox/lib/interrupts.c                 | 35 ++++++++++++++++
 cmd/Kconfig                                   |  2 +-
 cmd/Makefile                                  |  1 +
 cmd/sandbox/Makefile                          |  3 ++
 cmd/sandbox/exception.c                       | 41 +++++++++++++++++++
 include/os.h                                  | 17 ++++++++
 .../efi_selftest_miniapp_exception.c          |  2 +
 test/py/tests/test_sandbox_exit.py            | 24 +++++++++++
 12 files changed, 178 insertions(+), 1 deletion(-)
 create mode 100644 cmd/sandbox/Makefile
 create mode 100644 cmd/sandbox/exception.c

--
2.28.0



More information about the U-Boot mailing list