Clean up emergency console and use panic for unexpected exceptions.
This removes `eprintln`, which was easy to misuse and not really sound.
Instead, use `emergency_uart`, which has been made unsafe with a clearly
documented safety requirement that it can only be called when the normal
UART instance will never be used again, e.g. just before rebooting.
Also changed `emergency_uart` to return an error rather than panicking,
so panic handler can ignore the error.
Test: atest vmbase_example.integration_test
Change-Id: I76ac1911cf905fde0010054cfd8bc239699298f6
diff --git a/guest/pvmfw/src/entry.rs b/guest/pvmfw/src/entry.rs
index 8ada6a1..cde4cfe 100644
--- a/guest/pvmfw/src/entry.rs
+++ b/guest/pvmfw/src/entry.rs
@@ -98,7 +98,7 @@
};
const REBOOT_REASON_CONSOLE: usize = 1;
- console_writeln!(REBOOT_REASON_CONSOLE, "{}", reboot_reason.as_avf_reboot_string());
+ console_writeln!(REBOOT_REASON_CONSOLE, "{}", reboot_reason.as_avf_reboot_string()).unwrap();
reboot()
// if we reach this point and return, vmbase::entry::rust_entry() will call power::shutdown().