bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 3/5 gnumach] smp: Delay setting spl_init flag until after smp bri


From: Damien Zammit
Subject: [PATCH 3/5 gnumach] smp: Delay setting spl_init flag until after smp bringup
Date: Tue, 10 Dec 2024 07:29:56 +0000

If this is not done, the spl code is called by kmsg_putchar
on APs during printing of bringup debug, causing the only
unnecessary early access of GS.
---
 i386/i386/mp_desc.c     | 3 ++-
 i386/i386at/model_dep.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c
index 16b1c865..7595eb1e 100644
--- a/i386/i386/mp_desc.c
+++ b/i386/i386/mp_desc.c
@@ -325,7 +325,7 @@ start_other_cpus(void)
 
        unsigned cpu;
 
-       splhigh();
+       asm volatile ("cli");
 
        /* Disable IOAPIC interrupts (IPIs not affected).
         * Clearing this flag is similar to masking all
@@ -357,5 +357,6 @@ start_other_cpus(void)
 
        /* Re-enable IOAPIC interrupts as per setup */
        lapic_enable();
+       spl_init = 1;
 }
 #endif /* NCPUS > 1 */
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 30449c37..7cbbf70b 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -380,8 +380,9 @@ i386at_init(void)
 #else  /* MACH_HYP */
        hyp_intrinit();
 #endif /* MACH_HYP */
+#if NCPUS == 1
        spl_init = 1;
-
+#endif
        /*
         * Read memory map and load it into the physical page allocator.
         */
-- 
2.45.2





reply via email to

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