oxidecomputer / hubris

A lightweight, memory-protected, message-passing kernel for deeply embedded systems.
Mozilla Public License 2.0
2.96k stars 169 forks source link

`HostPanic` and `HostBootFailure` discard bytes #1846

Closed bcantrill closed 1 month ago

bcantrill commented 1 month ago

Running with this fix:

$ humility ringbuf host_sp_comms | grep BootFail
humility: attached via ST-Link V3
       1 Request(HostBootFailure)
  15  712        1        1 Request { now: 0x173bd, sequence: 0x5, message: HostBootFailure { reason: 0x2 } }
$ humility host boot-fail
humility: attached via ST-Link V3
Message is 46 bytes long:
Could not find a valid phase2 image on disk:17
$ humility host last-panic
humility: attached via ST-Link V3
version:   1 (determined)
cause:     IPCC_PANIC_CALL
error:     0
cpuid:     0
thread:    0xfffffffffbe9f1e0
addr:      0x0
pc:        0xfffffffff7cafffa
fp:        0xfffffffffbea5060
rp:        0x0
message:   Could not find a valid phase2 image on disk:17
stack:
           oxide_boot_locate+0x18a                          (0xfffffffff7cafffa)
           boot_image_locate+0xa1                           (0xfffffffffc0c4eb1)
           main+0x137                                       (0xfffffffffc0c5027)
           _locore_start+0x88                               (0xfffffffffbc47e48)

Prior to this, the last_panic version would be inferred:

$ humility host last-panic
humility: attached via ST-Link V3
version:   1 (inferred)
cause:     IPCC_PANIC_CALL
error:     0
cpuid:     0
thread:    0xfffffffffbe9f1e0
addr:      0x0
pc:        0xfffffffff7cafffa
fp:        0xfffffffffbea5060
rp:        0x0
message:   Could not find a valid phase2 image on disk:17
stack:
           oxide_boot_locate+0x18a                          (0xfffffffff7cafffa)
           boot_image_locate+0xa1                           (0xfffffffffc0c4eb1)
           main+0x137                                       (0xfffffffffc0c5027)
           _locore_start+0x88                               (0xfffffffffbc47e48)