aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit via Bug reports for the GNU Hurd <bug-hurd@gnu.org>2024-12-09 12:18:02 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-09 22:39:35 +0100
commit5d1a540211adc9f9f96b80f2c037369b85b9edbd (patch)
tree867a253da53aafd093dbbe2e92189a799bc8bbc6
parent106b03767c910f9516347b9c6d7f7e009e0f1a09 (diff)
downloadgnumach-5d1a540211adc9f9f96b80f2c037369b85b9edbd.tar.gz
gnumach-5d1a540211adc9f9f96b80f2c037369b85b9edbd.tar.bz2
gnumach-5d1a540211adc9f9f96b80f2c037369b85b9edbd.zip
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>
-rw-r--r--i386/i386/apic.c5
1 files changed, 1 insertions, 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;