summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Walbran <qwandor@google.com>2019-11-27 18:41:05 +0000
committerAndrew Walbran <qwandor@google.com>2019-11-27 18:41:05 +0000
commit9abce277b3963472481d1068b98d502fe42d792c (patch)
tree4d9378599137bc4dba8871734b0181817324e5eb
parent39fdefde0565df7811cf4bb98e6185e624a43603 (diff)
downloadlinux-9abce277b3963472481d1068b98d502fe42d792c.tar.gz
Yield on unexpected errors running vCPU.
Bug: 144477730 Change-Id: I6b750571b9a1e4ae7ce7774588344d380faceb46
-rw-r--r--main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main.c b/main.c
index b838407..5bd5709 100644
--- a/main.c
+++ b/main.c
@@ -416,11 +416,11 @@ static int hf_vcpu_thread(void *data)
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 @@ static int hf_vcpu_thread(void *data)
}
hf_vcpu_sleep(vcpu);
break;
+ default:
+ /* Treat as a yield and try again later. */
+ if (!kthread_should_stop())
+ schedule();
+ break;
}
break;
}