From 5d1a540211adc9f9f96b80f2c037369b85b9edbd Mon Sep 17 00:00:00 2001 From: Damien Zammit via Bug reports for the GNU Hurd Date: Mon, 9 Dec 2024 12:18:02 +0000 Subject: i386/apic: Fix condition on non-BSP The condition was intended for non-BSP processors to disable timer, but apic_id != 0 means it could affect BSP if its apic id is non-zero. Fixes this bug. Message-ID: <20241209121706.879984-7-damien@zamaudio.com> --- i386/i386/apic.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/i386/i386/apic.c b/i386/i386/apic.c index 41b33599..7ec8c49b 100644 --- a/i386/i386/apic.c +++ b/i386/i386/apic.c @@ -326,14 +326,11 @@ void lapic_setup(void) { unsigned long flags; - int apic_id; volatile uint32_t dummy; int cpu = cpu_number_slow(); cpu_intr_save(&flags); - apic_id = apic_get_cpu_apic_id(cpu); - /* Flat model */ dummy = lapic->dest_format.r; lapic->dest_format.r = 0xffffffff; @@ -348,7 +345,7 @@ lapic_setup(void) lapic->lvt_lint1.r = dummy | LAPIC_DISABLE; dummy = lapic->lvt_performance_monitor.r; lapic->lvt_performance_monitor.r = dummy | LAPIC_DISABLE; - if (apic_id != 0) + if (cpu > 0) { dummy = lapic->lvt_timer.r; lapic->lvt_timer.r = dummy | LAPIC_DISABLE; -- cgit v1.2.3