bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 6/6 gnumach] i386/apic: Fix condition on non-BSP


From: Damien Zammit
Subject: [PATCH 6/6 gnumach] i386/apic: Fix condition on non-BSP
Date: Mon, 09 Dec 2024 12:18:02 +0000

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.

---
 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;
-- 
2.45.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]