From: Ankur Arora <ankur.a.arora@oracle.com>
The HVMOP_set_evtchn_upcall_vector hypercall sets the per-vCPU upcall
vector, to be delivered to the local APIC just like an MSI (with an EOI).
This takes precedence over the system-wide delivery method set by the
HVMOP_set_param hypercall with HVM_PARAM_CALLBACK_IRQ. It's used by
Windows and Xen (PV shim) guests but normally not by Linux.
Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
[dwmw2: Rework for upstream kernel changes and split from HVMOP_set_param]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
target/i386/cpu.h | 1 +
target/i386/kvm/kvm.c | 7 ++++
target/i386/machine.c | 4 ++-
target/i386/trace-events | 1 +
target/i386/xen.c | 69 +++++++++++++++++++++++++++++++++++++---
target/i386/xen.h | 1 +
6 files changed, 77 insertions(+), 6 deletions(-)
+static bool kvm_xen_hcall_hvm_op(struct kvm_xen_exit *exit, X86CPU *cpu,
int cmd, uint64_t arg)
{
+ int ret = -ENOSYS;
switch (cmd) {
+ case HVMOP_set_evtchn_upcall_vector:
+ ret = kvm_xen_hcall_evtchn_upcall_vector(exit, cpu,
+ exit->u.hcall.params[0]);
+ break;
case HVMOP_pagetable_dying:
- exit->u.hcall.result = -ENOSYS;
- return true;
+ ret = -ENOSYS;
+ break;