From 235d7472ba424351d2b1ea17a0ad7281a1f16b71 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 3 Jun 2021 19:29:25 +0200 Subject: [PATCH] [HAL:APIC] Remove obsolete hacks These hacks were used to work around broken VBox. VBox works fine without the hacks these days. --- hal/halx86/apic/apic.c | 11 +---------- hal/halx86/apic/apictrap.S | 28 ---------------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/hal/halx86/apic/apic.c b/hal/halx86/apic/apic.c index 65a6d2e4d20..25bd4e4b4c3 100644 --- a/hal/halx86/apic/apic.c +++ b/hal/halx86/apic/apic.c @@ -16,8 +16,6 @@ #define NDEBUG #include -void __cdecl HackEoi(void); - #ifndef _M_AMD64 //#define APIC_LAZY_IRQL //FIXME: Disabled due to bug. #endif @@ -155,8 +153,7 @@ FORCEINLINE VOID ApicSendEOI(void) { - //ApicWrite(APIC_EOI, 0); - HackEoi(); + ApicWrite(APIC_EOI, 0); } FORCEINLINE @@ -174,15 +171,9 @@ ApicGetCurrentIrql(VOID) #ifdef _M_AMD64 return (KIRQL)__readcr8(); #elif defined(APIC_LAZY_IRQL) - // HACK: some magic to Sync VBox's APIC registers - ApicRead(APIC_VER); - /* Return the field in the PCR */ return (KIRQL)__readfsbyte(FIELD_OFFSET(KPCR, Irql)); #else - // HACK: some magic to Sync VBox's APIC registers - ApicRead(APIC_VER); - /* Read the TPR and convert it to an IRQL */ return TprToIrql(ApicRead(APIC_TPR)); #endif diff --git a/hal/halx86/apic/apictrap.S b/hal/halx86/apic/apictrap.S index 52f1dabec0f..381f5492023 100644 --- a/hal/halx86/apic/apictrap.S +++ b/hal/halx86/apic/apictrap.S @@ -22,23 +22,6 @@ PUBLIC ApicSpuriousService ApicSpuriousService: iretq -PUBLIC HackEoi -HackEoi: - xor rax, rax - mov ax, ss - push rax - push rsp - pushfq - mov ax, cs - push rax - lea rax, HackEoiReturn[rip] - push rax - mov dword ptr [HEX(0FFFFFFFFFFFE00B0)], 0 - iretq -HackEoiReturn: - add rsp, 8 // esp was changed by the iret to the pushed value - ret - #else #include #include @@ -54,17 +37,6 @@ PUBLIC _ApicSpuriousService _ApicSpuriousService: iret -// 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