Yield on unexpected errors running vCPU.
Bug: 144477730
Change-Id: I6b750571b9a1e4ae7ce7774588344d380faceb46
diff --git a/main.c b/main.c
index b838407..5bd5709 100644
--- a/main.c
+++ b/main.c
@@ -416,11 +416,11 @@
hf_notify_waiters(vcpu->vm->id);
break;
- /* Abort was triggered. */
case SPCI_ERROR_32:
pr_warn("SPCI error %d running VM %d vCPU %d", ret.arg2,
vcpu->vm->id, vcpu->vcpu_index);
switch (ret.arg2) {
+ /* Abort was triggered. */
case SPCI_ABORTED:
for (i = 0; i < vcpu->vm->vcpu_count; i++) {
if (i == vcpu->vcpu_index)
@@ -430,6 +430,11 @@
}
hf_vcpu_sleep(vcpu);
break;
+ default:
+ /* Treat as a yield and try again later. */
+ if (!kthread_should_stop())
+ schedule();
+ break;
}
break;
}