-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpu/idt: Process #HV events during IRET to interrupts-enabled code
It is possible for an #HV event to be delivered during the IRET flow, as registers are being restored in preparation for a return to the point of the exception or interrupt. This code executes with interrupts disabled, so any #HV event that arrives during this window will be deferred. If the point to which the IRET flow will return has interrupts enabled, this will cause the pending #HV event to deferred for an unbounded amount of time, which could cause issues with timely processing. This change detects cases where an #HV arrives during the path of returning via IRET to a context that has interrupts enabled, and if such a case is detected, it continues to process the #HV event. To prevent unbounded stack consumption, the #HV handler will "take over" the stack frame of the original event, such that the return from the #HV handler will be the one that returns directly to the original point. Signed-off-by: Jon Lange <jlange@microsoft.com>
- Loading branch information
1 parent
ba53bcc
commit 760ca4c
Showing
1 changed file
with
152 additions
and
28 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