Skip to content

Commit

Permalink
cause triple fault on panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Freax13 committed Nov 13, 2024
1 parent c7772d4 commit e8276d1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tee/supervisor-tdx/src/panic.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
use core::arch::asm;
use core::panic::PanicInfo;

use log::error;

#[panic_handler]
fn panic_handler(info: &PanicInfo) -> ! {
error!("{info}");
loop {}
triple_fault();
}

fn triple_fault() -> ! {
// We don't have an exception handler for int3 or double faults, so this
// will cause a triple fault.
unsafe {
asm!("int3", options(noreturn));
}
}

0 comments on commit e8276d1

Please sign in to comment.