From e452980e0ee04c66e04db461e53e63bbc0a09beb Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 22 Apr 2025 16:19:10 +0300 Subject: [PATCH] [HALX86/APIC] Change IRQL for x86 profile interrupt to HIGH_LEVEL While PROFILE_LEVEL is defined as 27 on x86, this does not match the vector for the profiling interrupt, which is 0xFD (see https://community.osr.com/t/odd-ioapic-output/45216), implying IRQL 31. Fixes boot with x86 APIC hal (CORE-20093) --- hal/halx86/apic/apicp.h | 2 ++ hal/halx86/apic/halinit.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hal/halx86/apic/apicp.h b/hal/halx86/apic/apicp.h index 3ba238abfc7..86809a2c98f 100644 --- a/hal/halx86/apic/apicp.h +++ b/hal/halx86/apic/apicp.h @@ -32,6 +32,7 @@ #define IrqlToSoftVector(Irql) ((Irql << 4)|0xf) #define TprToIrql(Tpr) ((KIRQL)(Tpr >> 4)) #define CLOCK2_LEVEL CLOCK_LEVEL + #define APIC_PROFILE_LEVEL PROFILE_LEVEL #else #define LOCAL_APIC_BASE 0xFFFE0000 #define IOAPIC_BASE 0xFFFE1000 @@ -54,6 +55,7 @@ #define IrqlToTpr(Irql) (HalpIRQLtoTPR[Irql]) #define IrqlToSoftVector(Irql) IrqlToTpr(Irql) #define TprToIrql(Tpr) (HalVectorToIRQL[Tpr >> 4]) + #define APIC_PROFILE_LEVEL HIGH_LEVEL #endif #define APIC_MAX_IRQ 24 diff --git a/hal/halx86/apic/halinit.c b/hal/halx86/apic/halinit.c index 8274fd54824..b313b595acc 100644 --- a/hal/halx86/apic/halinit.c +++ b/hal/halx86/apic/halinit.c @@ -63,7 +63,7 @@ HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock) HalpEnableInterruptHandler(IDT_DEVICE, 0, APIC_PROFILE_VECTOR, - PROFILE_LEVEL, + APIC_PROFILE_LEVEL, HalpProfileInterrupt, Latched); }