From: Nadav Amit <nadav.amit@xxxxxxxxx> When APIC IDs are not allocated consecutively, smptest fails. Fix it by using id_map, which maps CPU numbers to their apic-IDs. Signed-off-by: Nadav Amit <nadav.amit@xxxxxxxxx> --- x86/smptest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x86/smptest.c b/x86/smptest.c index 2989aa0..cbb4e60 100644 --- a/x86/smptest.c +++ b/x86/smptest.c @@ -1,4 +1,5 @@ #include "libcflat.h" +#include "apic.h" #include "smp.h" unsigned nipis; @@ -8,7 +9,7 @@ static void ipi_test(void *data) int n = (long)data; printf("ipi called, cpu %d\n", n); - if (n != smp_id()) + if (id_map[n] != smp_id()) printf("but wrong cpu %d\n", smp_id()); else nipis++; -- 2.25.1