smp: Fix pathological thrashing with the hypervisor

Writing to the IPI register causes a trap, which sets the event...
causing every CPU to go into a tight loop of traps contended on the BHL.

We don't need to clear IPIs in WFE mode, so don't do that.

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2022-06-19 21:53:42 +09:00
parent 849729f0c0
commit f3ce8a68d0

View file

@ -57,11 +57,12 @@ void smp_secondary_entry(void)
while (1) {
while (!(target = me->target)) {
if (wfe_mode)
if (wfe_mode) {
sysop("wfe");
else
} else {
deep_wfi();
msr(SYS_IMP_APL_IPI_SR_EL1, 1);
}
sysop("isb");
}
sysop("dmb sy");