]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
i386/xen: Implement SCHEDOP_poll
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 14 Dec 2022 21:50:41 +0000 (21:50 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 15 Dec 2022 10:41:59 +0000 (10:41 +0000)
Just a dummy implementation which will sched_yield(), but it's enough to
stop the Linux guest panicking when running on a host kernel which doesn't
intercept SCHEDOP_poll and lets it reach userspace.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
target/i386/kvm/xen-emu.c

index 055afba6279d533181442cece880850a57061e47..a8c953e3cae9749ce87e4c42976d10b82681a87d 100644 (file)
@@ -919,6 +919,17 @@ static bool kvm_xen_hcall_sched_op(struct kvm_xen_exit *exit, X86CPU *cpu,
         err = schedop_shutdown(cs, arg);
         break;
 
+    case SCHEDOP_poll:
+        /*
+         * Linux will panic if this doesn't work. Just yield; it's not
+         * worth overthinking it because wWith event channel handling
+         * in KVM, the kernel will intercept this and it will never
+         * reach QEMU anyway.
+         */
+        sched_yield();
+        err = 0;
+        break;
+
     default:
         return false;
     }