summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-01-07 19:26:36 +0100
committerRichard Braun <rbraun@sceen.net>2018-01-07 20:14:09 +0100
commit9ed76fef2de5bd094559bf4a85ffcecb5474136a (patch)
treebd486374ffe169eb8b6103e29c7db87a3106e946
parentdea146ea3d0bfa2c906a965bcca71d3ec6aed822 (diff)
test/test_xcall: update to trigger local APIC init race
-rw-r--r--test/test_xcall.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/test_xcall.c b/test/test_xcall.c
index 6de73a00..49706cde 100644
--- a/test/test_xcall.c
+++ b/test/test_xcall.c
@@ -70,7 +70,7 @@ test_run_cpu(void *arg)
{
(void)arg;
- for (unsigned int i = 0; i < cpu_count(); i++) {
+ for (unsigned int i = (cpu_count() - 1); i < cpu_count(); i++) {
test_once(i);
}
}
@@ -82,6 +82,7 @@ test_run(void *arg)
struct thread_attr attr;
struct thread *thread;
struct cpumap *cpumap;
+ unsigned int cpu;
int error;
(void)arg;
@@ -90,9 +91,15 @@ test_run(void *arg)
error_check(error, "cpumap_create");
for (unsigned int i = 0; i < cpu_count(); i++) {
+ /*
+ * FIXME There seems to be an initialization race of the local APIC when
+ * sending IPIs early from CPU 1 to CPU 2 or more.
+ */
+ cpu = (1 + i) % cpu_count();
+
cpumap_zero(cpumap);
- cpumap_set(cpumap, i);
- snprintf(name, sizeof(name), THREAD_KERNEL_PREFIX "test_run/%u", i);
+ cpumap_set(cpumap, cpu);
+ snprintf(name, sizeof(name), THREAD_KERNEL_PREFIX "test_run/%u", cpu);
thread_attr_init(&attr, name);
thread_attr_set_cpumap(&attr, cpumap);
error = thread_create(&thread, &attr, test_run_cpu, NULL);