seL4/include/kernel
julia 09e6c3f5e2 debug: invalidate ksKernelEntry on kernel exit
There's a few cases in the kernel where the ksKernelEntry tracking
is not perfect, such as in SError reporting, and (I believe) a few
other places which I haven't tracked down to a cause - but some of
e.g. the RISC-V trap code where the first entry faults and the 2nd
proceeds can report stale information.

In these cases, the kernel says that the entry was via a certain
syscall or interrupt (etc), even though that was clearly not the
case because we know the kernel exited. Now we will print out this:

    halting...
    Kernel entry via Unknown (0)

The changes:

- When exiting the kernel, via `c_exit_hook()`, reset
  `ksKernelEntry.path` to "Unknown".

  An alternative here would have been add a global "valid" boolean
  to the kernel state, but this requires modifying every site where
  we set the ksKernelEntry.path to also set valid = true, which is
  ugly.

- Remove Entry_UnimplementedDevice from entry_type_t as it is never
  used, to leave enough room to add Entry_Unknown.

- Switch out the CONFIG_DEBUG_BUILD || BENCHMARK TRACK ENTRIES #if
  in the x86 breakpoint code with the more concise
  `TRACK_KERNEL_ENTRIES` define used elsewhere.

Signed-off-by: julia <git.ts@trainwit.ch>
2025-08-20 15:57:58 +01:00
..
boot.h boot: fix argname in populate_bi_frame prototype 2025-07-31 14:20:15 +10:00
cspace.h replacing all ifndef with pargma once 2020-03-23 11:04:46 +11:00
faulthandler.h mcs: small changes to ease verification 2025-03-21 16:48:00 +11:00
sporadic.h treewide: typo fixes 2025-04-14 12:05:16 +10:00
stack.h replacing all ifndef with pargma once 2020-03-23 11:04:46 +11:00
thread.h arm,riscv: eliminate idle_thread function prologue 2025-08-19 09:06:24 +01:00
traps.h debug: invalidate ksKernelEntry on kernel exit 2025-08-20 15:57:58 +01:00
vspace.h Make kernel log buffer derived from cmake config 2020-11-10 16:24:43 +11:00