x86 cpu_reset: if failed to switch to BSP proceed to cpu_reset_real

If cpu_reset() is called on an AP and if it somehow fails to wake the
BSP, then it's better to attempt the reset on the AP than just sit there
spinning on an unusable and undebuggable system.

MFC after:	16 days
This commit is contained in:
Andriy Gapon 2018-04-02 08:06:18 +00:00
parent 5d29acd810
commit ace498d81e
2 changed files with 14 additions and 12 deletions

View File

@ -611,13 +611,14 @@ cpu_reset()
ia32_pause();
cnt++; /* Wait for BSP to announce restart */
}
if (cpu_reset_proxy_active == 0)
if (cpu_reset_proxy_active == 0) {
printf("cpu_reset: Failed to restart BSP\n");
cpu_reset_proxy_active = 2;
while (1)
ia32_pause();
/* NOTREACHED */
} else {
cpu_reset_proxy_active = 2;
while (1)
ia32_pause();
/* NOTREACHED */
}
}
DELAY(1000000);

View File

@ -623,13 +623,14 @@ cpu_reset()
ia32_pause();
cnt++; /* Wait for BSP to announce restart */
}
if (cpu_reset_proxy_active == 0)
if (cpu_reset_proxy_active == 0) {
printf("cpu_reset: Failed to restart BSP\n");
cpu_reset_proxy_active = 2;
while (1)
ia32_pause();
/* NOTREACHED */
} else {
cpu_reset_proxy_active = 2;
while (1)
ia32_pause();
/* NOTREACHED */
}
}
DELAY(1000000);