Skip to content

Commit

Permalink
fix(hal_x86_64): remove tracing in timer ISR
Browse files Browse the repository at this point in the history
this makes the kernel deadlock because im a fucking idiot
  • Loading branch information
hawkw committed Dec 29, 2024
1 parent 8c2cc10 commit c4183db
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions hal-x86_64/src/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,6 @@ impl hal_core::interrupt::Control for Idt {
extern "x86-interrupt" fn pit_timer_isr<H: Handlers<Registers>>(_regs: Registers) {
if crate::time::Pit::handle_interrupt() {
H::timer_tick()
} else {
tracing::trace!("PIT sleep completed");
}
unsafe {
INTERRUPT_CONTROLLER
Expand Down

1 comment on commit c4183db

@hawkw
Copy link
Owner Author

@hawkw hawkw commented on c4183db Dec 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically, dont do this:

>>> info stack
#0  0xffff8000001837c8 in core::core_arch::x86::sse2::_mm_pause ()
    at /home/eliza/.rustup/toolchains/nightly-2024-01-20-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:25
#1  core::hint::spin_loop ()
    at /home/eliza/.rustup/toolchains/nightly-2024-01-20-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/hint.rs:223
#2  core::sync::atomic::spin_loop_hint ()
    at /home/eliza/.rustup/toolchains/nightly-2024-01-20-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:3761
#3  portable_atomic::hint::spin_loop ()
    at /home/eliza/.cargo/registry/src/index.crates.io-6f17d22bba15001f/portable-atomic-1.6.0/src/lib.rs:511
#4  maitake_sync::util::backoff::Backoff::spin (self=<optimized out>) at maitake-sync/src/util/backoff.rs:59
#5  maitake_sync::spin::{impl#2}::lock (self=0xffff8000003461de <hal_x86_64::serial::COM1+22>) at maitake-sync/src/spin.rs:110
#6  0xffff80000016db57 in maitake_sync::blocking::mutex::Mutex<hal_x86_64::serial::Registers, maitake_sync::spin::Spinlock>::lock<hal_x86_64::serial::Registers, maitake_sync::spin::Spinlock> (self=0xffff8000003461d2 <hal_x86_64::serial::COM1+10>)
    at maitake-sync/src/blocking/mutex.rs:263
#7  hal_x86_64::serial::Port::lock (self=0xffff8000003461d2 <hal_x86_64::serial::COM1+10>) at hal-x86_64/src/serial.rs:124
#8  hal_x86_64::serial::{impl#11}::make_writer (self=0x88) at hal-x86_64/src/serial.rs:395
#9  0xffff8000000e1f2c in mycelium_trace::writer::MakeWriter::make_writer_for<&hal_x86_64::serial::Port> (self=0x88,
    meta=0xffff8000002c4d98 <hal_x86_64::interrupt::<impl hal_core::interrupt::Control for hal_x86_64::interrupt::idt::Idt>::register_handlers::pit_timer_isr::__CALLSITE::__META>) at trace/src/writer.rs:86

Please sign in to comment.