提交 a40b2fd0 编写于 作者: L Lai Jiangshan 提交者: Paolo Bonzini

x86/kvm: Don't enable IRQ when IRQ enabled in kvm_wait

Commit f4e61f0c ("x86/kvm: Fix broken irq restoration in kvm_wait")
replaced "local_irq_restore() when IRQ enabled" with "local_irq_enable()
when IRQ enabled" to suppress a warnning.

Although there is no similar debugging warnning for doing local_irq_enable()
when IRQ enabled as doing local_irq_restore() in the same IRQ situation.  But
doing local_irq_enable() when IRQ enabled is no less broken as doing
local_irq_restore() and we'd better avoid it.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: NLai Jiangshan <laijs@linux.alibaba.com>
Message-Id: <20210814035129.154242-1-jiangshanlai@gmail.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 3cc4e148
...@@ -884,9 +884,10 @@ static void kvm_wait(u8 *ptr, u8 val) ...@@ -884,9 +884,10 @@ static void kvm_wait(u8 *ptr, u8 val)
} else { } else {
local_irq_disable(); local_irq_disable();
/* safe_halt() will enable IRQ */
if (READ_ONCE(*ptr) == val) if (READ_ONCE(*ptr) == val)
safe_halt(); safe_halt();
else
local_irq_enable(); local_irq_enable();
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册