From af81741f23446aec3f8d57cf5b5223b6d3e34484 Mon Sep 17 00:00:00 2001 From: Ruihan Li Date: Mon, 11 Dec 2023 10:25:14 +0800 Subject: [PATCH] Workaround for QEMU BUG that causes CI to hang --- framework/jinux-frame/src/arch/x86/irq.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/framework/jinux-frame/src/arch/x86/irq.rs b/framework/jinux-frame/src/arch/x86/irq.rs index 4fcc83d50..2a54aa670 100644 --- a/framework/jinux-frame/src/arch/x86/irq.rs +++ b/framework/jinux-frame/src/arch/x86/irq.rs @@ -27,6 +27,10 @@ pub(crate) fn init() { pub(crate) fn enable_local() { x86_64::instructions::interrupts::enable(); + // When emulated with QEMU, interrupts may not be delivered if a STI instruction is immediately + // followed by a RET instruction. It is a BUG of QEMU, see the following patch for details. + // https://lore.kernel.org/qemu-devel/20231210190147.129734-2-lrh2000@pku.edu.cn/ + x86_64::instructions::nop(); } pub(crate) fn disable_local() {