Skip to content

Commit 656a5dc

Browse files
authored
[NTOS:KE] Implement KeI386VirtualIntExtensions code paths for INT and IRET. CORE-19049 (reactos#7742)
Co-authored-by: Thomas Faber <[email protected]> Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]> Continued from PR reactos#6070 JIRA issue: CORE-19049
1 parent 5c505d9 commit 656a5dc

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

ntoskrnl/ke/i386/v86vdm.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,21 @@ KiVdmOpcodeINTnn(IN PKTRAP_FRAME TrapFrame,
191191
V86EFlags &= (EFLAGS_ALIGN_CHECK | EFLAGS_INTERRUPT_MASK);
192192

193193
/* Check for VME support */
194-
ASSERT(KeI386VirtualIntExtensions == FALSE);
194+
if (KeI386VirtualIntExtensions)
195+
{
196+
/* Set IF based on VIF */
197+
V86EFlags &= ~EFLAGS_INTERRUPT_MASK;
198+
if (TrapEFlags & EFLAGS_VIF)
199+
{
200+
V86EFlags |= EFLAGS_INTERRUPT_MASK;
201+
}
202+
}
195203

196204
/* Mask in the relevant V86 EFlags into the trap flags */
197205
V86EFlags |= (TrapEFlags & ~EFLAGS_INTERRUPT_MASK);
198206

199207
/* And mask out the VIF, nested task and TF flag from the trap flags */
200-
TrapFrame->EFlags = TrapEFlags &~ (EFLAGS_VIF | EFLAGS_NESTED_TASK | EFLAGS_TF);
208+
TrapFrame->EFlags = TrapEFlags & ~(EFLAGS_VIF | EFLAGS_NESTED_TASK | EFLAGS_TF);
201209

202210
/* Add the IOPL flag to the local trap flags */
203211
V86EFlags |= EFLAGS_IOPL;
@@ -299,11 +307,17 @@ KiVdmOpcodeIRET(IN PKTRAP_FRAME TrapFrame,
299307
}
300308

301309
/* Mask out EFlags */
302-
EFlags &= ~(EFLAGS_IOPL + EFLAGS_VIF + EFLAGS_NESTED_TASK + EFLAGS_VIP);
310+
EFlags &= ~(EFLAGS_VIP | EFLAGS_VIF | EFLAGS_NESTED_TASK | EFLAGS_IOPL);
303311
V86EFlags = EFlags;
304312

305313
/* Check for VME support */
306-
ASSERT(KeI386VirtualIntExtensions == FALSE);
314+
if (KeI386VirtualIntExtensions)
315+
{
316+
if (EFlags & EFLAGS_INTERRUPT_MASK)
317+
{
318+
EFlags |= EFLAGS_VIF;
319+
}
320+
}
307321

308322
/* Add V86 and Interrupt flag */
309323
EFlags |= EFLAGS_V86_MASK | EFLAGS_INTERRUPT_MASK;

0 commit comments

Comments
 (0)