Commit 66e6161
feat(migtd): route warn/error/fatal logs to COM1 serial port
MigTD debugging has historically required ad-hoc TDVMCALL.IO writes
inserted by hand, because failure paths often did not call any of
the `log::*` macros and there was no guarantee that fatal exits
reached the host console.
td-logger is already initialised with `LevelFilter::Trace` and, with
the `tdx` feature, writes each byte to COM1 (0x3F8) via TDVMCALL.IO,
which QEMU forwards through `-serial mon:stdio`. This change makes
that serial path the canonical debugging channel:
* Add `release_max_level_info` to the `log` dependency so release
builds compile out `debug!`/`trace!` while keeping `info!`,
`warn!` and `error!` on the serial line. No VMM changes, no
shared buffer and no extra TDVMCALL are required.
* Emit `log::error!` from `panic_with_guest_crash_reg_report` with
the error code, message and caller `file:line` so every fatal
exit is visible on the serial port even when the surrounding
code forgot to log.
Signed-off-by: Michal Tarnacki <michal.tarnacki@intel.com>
Co-authored-by: GitHub Copilot <noreply@github.com>1 parent de248d6 commit 66e6161
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
0 commit comments