[kvm-unit-tests PATCH 3/8] x86/smptest: handle non-consecutive APIC IDs

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

 



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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux