[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v5 13/52] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield
From: |
David Woodhouse |
Subject: |
[RFC PATCH v5 13/52] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield |
Date: |
Fri, 30 Dec 2022 12:11:56 +0000 |
From: David Woodhouse <dwmw@amazon.co.uk>
They both do the same thing and just call sched_yield. This is 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 | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c
index 5f2b55ef10..80005ea527 100644
--- a/target/i386/kvm/xen-emu.c
+++ b/target/i386/kvm/xen-emu.c
@@ -227,6 +227,18 @@ 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.
+ */
+ case SCHEDOP_yield:
+ sched_yield();
+ err = 0;
+ break;
+
default:
return false;
}
--
2.35.3
- [RFC PATCH v5 00/52] Xen support under KVM, David Woodhouse, 2022/12/30
- [RFC PATCH v5 36/52] hw/xen: Implement EVTCHNOP_bind_interdomain, David Woodhouse, 2022/12/30
- [RFC PATCH v5 43/52] hw/xen: Add xen_gnttab device for grant table emulation, David Woodhouse, 2022/12/30
- [RFC PATCH v5 19/52] i386/xen: implement HYPERVISOR_hvm_op, David Woodhouse, 2022/12/30
- [RFC PATCH v5 46/52] hw/xen: Implement GNTTABOP_query_size, David Woodhouse, 2022/12/30
- [RFC PATCH v5 34/52] hw/xen: Implement EVTCHNOP_send, David Woodhouse, 2022/12/30
- [RFC PATCH v5 13/52] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield,
David Woodhouse <=
- [RFC PATCH v5 08/52] xen-platform: allow its creation with XEN_EMULATE mode, David Woodhouse, 2022/12/30
- [RFC PATCH v5 37/52] hw/xen: Implement EVTCHNOP_bind_vcpu, David Woodhouse, 2022/12/30
- [RFC PATCH v5 11/52] i386/xen: implement HYPERVISOR_xen_version, David Woodhouse, 2022/12/30
- [RFC PATCH v5 18/52] i386/xen: implement XENMEM_add_to_physmap_batch, David Woodhouse, 2022/12/30
- [RFC PATCH v5 51/52] hw/xen: Add xen_xenstore device for xenstore emulation, David Woodhouse, 2022/12/30
- [RFC PATCH v5 03/52] xen: Add XEN_DISABLED mode and make it default, David Woodhouse, 2022/12/30
- [RFC PATCH v5 38/52] hw/xen: Implement EVTCHNOP_reset, David Woodhouse, 2022/12/30
- [RFC PATCH v5 29/52] hw/xen: Implement EVTCHNOP_status, David Woodhouse, 2022/12/30
- [RFC PATCH v5 30/52] hw/xen: Implement EVTCHNOP_close, David Woodhouse, 2022/12/30
- [RFC PATCH v5 15/52] i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode, David Woodhouse, 2022/12/30