-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpu: process pending #HV events when enabling interrupts
Interrupts delivered via #HV are ignored when EFLAGS.IF=0. When enabling interrupts, the #HV doorbell page must be checked for pending events that were suppressed while interrupts were disabled so that they do not remain pending indefinitely. Signed-off-by: Jon Lange <[email protected]>
- Loading branch information
1 parent
5e08626
commit d1fa0d3
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
// | ||
// Author: Joerg Roedel <[email protected]> | ||
|
||
use crate::cpu::percpu::this_cpu; | ||
use crate::cpu::{irqs_disable, irqs_enable}; | ||
use core::arch::asm; | ||
use core::marker::PhantomData; | ||
|
@@ -32,6 +33,12 @@ pub unsafe fn raw_irqs_disable() { | |
#[inline(always)] | ||
pub unsafe fn raw_irqs_enable() { | ||
asm!("sti", options(att_syntax, preserves_flags, nomem)); | ||
|
||
// Now that interrupts are enabled, process any #HV events that may be | ||
// pending. | ||
if let Some(doorbell) = this_cpu().hv_doorbell() { | ||
doorbell.process_if_required(); | ||
} | ||
} | ||
|
||
/// Query IRQ state on current CPU | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters