[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 12/51] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield
From: |
David Woodhouse |
Subject: |
[PATCH v6 12/51] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield |
Date: |
Tue, 10 Jan 2023 12:20:03 +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
- Re: [PATCH v6 25/51] i386/xen: implement HVMOP_set_param, (continued)
- [PATCH v6 41/51] kvm/i386: Add xen-gnttab-max-frames property, David Woodhouse, 2023/01/10
- [PATCH v6 38/51] i386/xen: add monitor commands to test event injection, David Woodhouse, 2023/01/10
- [PATCH v6 43/51] hw/xen: Support mapping grant frames, David Woodhouse, 2023/01/10
- [PATCH v6 45/51] hw/xen: Implement GNTTABOP_query_size, David Woodhouse, 2023/01/10
- [PATCH v6 47/51] i386/xen: Reserve Xen special pages for console, xenstore rings, David Woodhouse, 2023/01/10
- [PATCH v6 10/51] i386/xen: implement HYPERVISOR_xen_version, David Woodhouse, 2023/01/10
- [PATCH v6 32/51] hw/xen: Implement EVTCHNOP_bind_ipi, David Woodhouse, 2023/01/10
- [PATCH v6 12/51] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield,
David Woodhouse <=
- [PATCH v6 37/51] hw/xen: Implement EVTCHNOP_reset, David Woodhouse, 2023/01/10
- [PATCH v6 05/51] i386/kvm: handle Xen HVM cpuid leaves, David Woodhouse, 2023/01/10
- [PATCH v6 18/51] i386/xen: implement HYPERVISOR_hvm_op, David Woodhouse, 2023/01/10
- [PATCH v6 13/51] hw/xen: Add xen_overlay device for emulating shared xenheap pages, David Woodhouse, 2023/01/10
- [PATCH v6 39/51] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_GSI callback, David Woodhouse, 2023/01/10
- [PATCH v6 19/51] i386/xen: implement HYPERVISOR_vcpu_op, David Woodhouse, 2023/01/10