Atomic operations deadlock
Posted: Sun Jun 26, 2022 11:11 pm
Heya,
I'm currently writing an 86_64 bare metal kernel.
After a successful boot into my kernel using EDK2 as a bootloader (calling ExitBootServices) I now want to use spinlocks for synchronization (f.e. a synchronized logger and global allocator).
I'm using rust, which in turn gets compiled down to llvm code, so my spinlock implementation uses llvm atomics under the hood for the x86_64-unknown-none-elf target. Currently interrupts are disabled.
This works perfectly in qemu! But when booting on real hardware (either through grub or plain uefi) the locks appear to be always locked.
Now my question:
Does anything need to be activated/set to enable atomics as stated in this post?
I'm currently writing an 86_64 bare metal kernel.
After a successful boot into my kernel using EDK2 as a bootloader (calling ExitBootServices) I now want to use spinlocks for synchronization (f.e. a synchronized logger and global allocator).
I'm using rust, which in turn gets compiled down to llvm code, so my spinlock implementation uses llvm atomics under the hood for the x86_64-unknown-none-elf target. Currently interrupts are disabled.
This works perfectly in qemu! But when booting on real hardware (either through grub or plain uefi) the locks appear to be always locked.
Now my question:
Does anything need to be activated/set to enable atomics as stated in this post?