Skip to contentSkip to conversation

sandbox: Adjust configuration to hang on panic()

PATCH In review Simon Glass 3 participants 4 messages Dec 20, 2024 – Jan 3, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sandbox: Adjust configuration to hang on panic()

It is annoying to have sandbox enter a boot loop when an assertion fails. Hang instead, since then the error message is only printed once and Ctrl-C can be used to quit, as per normal.

---

 configs/sandbox_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/sandbox_defconfig +1 -0
index 3de4aa79c6d..636130a360d 100644
@@ -354,6 +354,7 @@ CONFIG_WDT_FTWDT010=y
 CONFIG_FS_CBFS=y
 CONFIG_FS_CRAMFS=y
 CONFIG_ADDR_MAP=y
+CONFIG_PANIC_HANG=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_MBEDTLS_LIB=y
 CONFIG_ECDSA=y
Signature · 1 line
2.34.1
#1 lore raw
Quoted 5 lines · Simon Glass

It is annoying to have sandbox enter a boot loop when an assertion fails. Hang instead, since then the error message is only printed once and Ctrl-C can be used to quit, as per normal.

Applied to u-boot/next, thanks!

Signature · 1 line
Tom
#2 lore raw
In reply to Simon Glass
Quoted 15 lines · Simon Glass

It is annoying to have sandbox enter a boot loop when an assertion fails. Hang instead, since then the error message is only printed once and Ctrl-C can be used to quit, as per normal.

---

  configs/sandbox_defconfig | 1 +
  1 file changed, 1 insertion(+)
configs/sandbox_defconfig +0 -0
index 3de4aa79c6d..636130a360d 100644

configs/sandbox_defconfig CONFIG_WDT_FTWDT010=y · line 357

Quoted 4 lines
configs/sandbox_defconfig +1 -0
@@ -354,6 +354,7 @@ CONFIG_WDT_FTWDT010=y
  CONFIG_FS_CBFS=y
  CONFIG_FS_CRAMFS=y
  CONFIG_ADDR_MAP=y
+CONFIG_PANIC_HANG=y

Command line option -S is used for running the UEFI SCT. We need the sandbox to reboot and to allow the SCT to report the failed test.

This patch is not needed. You can already exit the assertion caused loop with CTRL-C.

Best regards

Heinrich

Quoted 3 lines
configs/sandbox_defconfig +0 -0
  CONFIG_CMD_DHRYSTONE=y
  CONFIG_MBEDTLS_LIB=y
  CONFIG_ECDSA=y
#3 lore raw

Hi Heinrich,

Quoted 12 lines · Heinrich Schuchardt
Quoted 10 lines · Simon Glass

It is annoying to have sandbox enter a boot loop when an assertion fails. Hang instead, since then the error message is only printed once and Ctrl-C can be used to quit, as per normal.

---

  configs/sandbox_defconfig | 1 +
  1 file changed, 1 insertion(+)
Quoted 12 lines

configs/sandbox_defconfig CONFIG_WDT_FTWDT010=y · line 357

Quoted 9 lines
configs/sandbox_defconfig +1 -0
index 3de4aa79c6d..636130a360d 100644
@@ -354,6 +354,7 @@ CONFIG_WDT_FTWDT010=y
  CONFIG_FS_CBFS=y
  CONFIG_FS_CRAMFS=y
  CONFIG_ADDR_MAP=y
+CONFIG_PANIC_HANG=y

Command line option -S is used for running the UEFI SCT. We need the sandbox to reboot and to allow the SCT to report the failed test.

What is causing it to panic in this case?

Quoted 3 lines

This patch is not needed. You can already exit the assertion caused loop with CTRL-C.

Right, but this creates a continuous stream of output.

I suppose we could add a command-line flag to reboot on panic, but I would like to understand the mechanism.

Can you please add something to doc/ about how to run this with sandbox, including which build/commit of EDK2 works on x86_64? I was never quite able to get this running with sandbox.

Quoted 5 lines

configs/sandbox_defconfig CONFIG_WDT_FTWDT010=y · line 360

Quoted 4 lines
configs/sandbox_defconfig +0 -0
  CONFIG_CMD_DHRYSTONE=y
  CONFIG_MBEDTLS_LIB=y
  CONFIG_ECDSA=y

Regards,
Simon