Skip to content

Commit

Permalink
[NTOS:KE] Implement KeI386VirtualIntExtensions code paths for INT and…
Browse files Browse the repository at this point in the history
… IRET. CORE-19049
  • Loading branch information
ThFabba committed Nov 30, 2023
1 parent f92c44b commit c73fc58
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ntoskrnl/ke/i386/v86vdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,15 @@ KiVdmOpcodeINTnn(IN PKTRAP_FRAME TrapFrame,
V86EFlags &= (EFLAGS_ALIGN_CHECK | EFLAGS_INTERRUPT_MASK);

/* Check for VME support */
ASSERT(KeI386VirtualIntExtensions == FALSE);
if (KeI386VirtualIntExtensions)
{
/* Set IF based on VIF */
V86EFlags &= ~EFLAGS_INTERRUPT_MASK;
if (V86EFlags & EFLAGS_VIF)
{
V86EFlags |= EFLAGS_INTERRUPT_MASK;
}
}

/* Mask in the relevant V86 EFlags into the trap flags */
V86EFlags |= (TrapEFlags & ~EFLAGS_INTERRUPT_MASK);
Expand Down Expand Up @@ -303,7 +311,13 @@ KiVdmOpcodeIRET(IN PKTRAP_FRAME TrapFrame,
V86EFlags = EFlags;

/* Check for VME support */
ASSERT(KeI386VirtualIntExtensions == FALSE);
if (KeI386VirtualIntExtensions)
{
if (EFlags & EFLAGS_INTERRUPT_MASK)
{
EFlags |= EFLAGS_VIF;
}
}

/* Add V86 and Interrupt flag */
EFlags |= EFLAGS_V86_MASK | EFLAGS_INTERRUPT_MASK;
Expand Down

0 comments on commit c73fc58

Please sign in to comment.