mirror of
https://github.com/reactos/reactos.git
synced 2024-07-08 21:55:08 +00:00
[HAL]
Add a hack to work around a bug in VBox: The APIC emulation requires an iret instruction following closely after writing the EOI register. Since we return from kernel mode traps with a jmp (yes you can return from an interrupt with a jmp!) the EOI is never triggered, making VBox believe we are still serving the interrupt and keeping the PPR on high level, preventing following interrupts. A small asm stub now does the work of both writing the EOI and doing an iret. svn path=/trunk/; revision=53665
This commit is contained in:
parent
99530efcdd
commit
50058d32a2
|
@ -609,17 +609,22 @@ HalBeginSystemInterrupt(
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HackEoi(void);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
HalEndSystemInterrupt(
|
HalEndSystemInterrupt(
|
||||||
IN KIRQL OldIrql,
|
IN KIRQL OldIrql,
|
||||||
IN PKTRAP_FRAME TrapFrame)
|
IN PKTRAP_FRAME TrapFrame)
|
||||||
{
|
{
|
||||||
|
/* Write 0 to the EndOfInterruptRegister */
|
||||||
|
//ApicWrite(APIC_EOI, 0);
|
||||||
|
|
||||||
|
// HACK!
|
||||||
|
HackEoi();
|
||||||
|
|
||||||
/* Restore the old IRQL */
|
/* Restore the old IRQL */
|
||||||
ApicSetCurrentIrql(OldIrql);
|
ApicSetCurrentIrql(OldIrql);
|
||||||
|
|
||||||
/* Write 0 to the EndOfInterruptRegister */
|
|
||||||
ApicWrite(APIC_EOI, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,18 @@ PUBLIC _ApicSpuriousService
|
||||||
TRAP_ENTRY HalpTrap0D, 0
|
TRAP_ENTRY HalpTrap0D, 0
|
||||||
TRAP_ENTRY HalpApcInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
TRAP_ENTRY HalpApcInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
||||||
TRAP_ENTRY HalpDispatchInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
TRAP_ENTRY HalpDispatchInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
||||||
|
|
||||||
|
// VBox APIC needs an iret more or less directly following the EOI
|
||||||
|
PUBLIC _HackEoi
|
||||||
|
_HackEoi:
|
||||||
|
pushfd
|
||||||
|
push cs
|
||||||
|
push offset OnlyOnePersonKnowsHowToHackAroundVBoxBugsAndThatIsNotYou // !!
|
||||||
|
mov dword ptr ds:[HEX(0FFFE00B0)], 0
|
||||||
|
iretd
|
||||||
|
OnlyOnePersonKnowsHowToHackAroundVBoxBugsAndThatIsNotYou:
|
||||||
|
ret
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
TRAP_ENTRY HalpClockInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
TRAP_ENTRY HalpClockInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
||||||
TRAP_ENTRY HalpProfileInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
TRAP_ENTRY HalpProfileInterrupt, KI_PUSH_FAKE_ERROR_CODE
|
||||||
|
|
Loading…
Reference in a new issue