bug-hurd
[Top][All Lists]
Advanced

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

[PATCH gnumach] mp_desc: Add assert for AP having non-zero cpu number


From: Damien Zammit
Subject: [PATCH gnumach] mp_desc: Add assert for AP having non-zero cpu number
Date: Sat, 07 Dec 2024 10:12:34 +0000

Non-master processors cannot have cpu_number() == 0.
The synchronisation fails hard if the cpu number is wrong.
Alert the condition if this is the case.

(On AMD fam15h, this assert currently fails, but I haven't
been able to boot it with smp yet either).

---
 i386/i386/mp_desc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c
index 61a7607b..5fff2a68 100644
--- a/i386/i386/mp_desc.c
+++ b/i386/i386/mp_desc.c
@@ -24,6 +24,7 @@
  * the rights to redistribute these changes.
  */
 
+#include <kern/assert.h>
 #include <kern/cpu_number.h>
 #include <kern/debug.h>
 #include <kern/printf.h>
@@ -280,6 +281,8 @@ cpu_ap_main()
 {
     int cpu = cpu_number();
 
+    assert(cpu > 0);
+
     do {
        cpu_pause();
     } while (bspdone != cpu);
-- 
2.45.2





reply via email to

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