]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
i386/xen: handle EVTCHNOP_bind_vcpu
authorJoao Martins <joao.m.martins@oracle.com>
Thu, 6 Sep 2018 10:52:01 +0000 (06:52 -0400)
committerJoao Martins <joao.m.martins@oracle.com>
Tue, 19 Feb 2019 14:00:57 +0000 (09:00 -0500)
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
target/i386/xen.c
target/i386/xen_evtchn.c
target/i386/xen_evtchn.h

index 8f523b58b873bd6f8bc6f4c029ece286a327c4aa..1916ddcb98356e450062e0844e4cbceeec44559b 100644 (file)
@@ -748,6 +748,9 @@ static int kvm_xen_hcall_evtchn_op(struct kvm_xen_exit *exit, X86CPU *cpu,
     case EVTCHNOP_alloc_unbound:
         err = kvm_xen_evtchn_alloc_unbound(cpu, eop);
         break;
+    case EVTCHNOP_bind_vcpu:
+        err = kvm_xen_evtchn_bind_vcpu(cpu, eop);
+        break;
     case EVTCHNOP_close:
         err = kvm_xen_evtchn_close(cpu, eop);
         break;
index 4e19bbc554588de8b1f48a7fe8525e3aac880a13..6fadd37e7f4ecc9448079d819ccffca7066a094b 100644 (file)
@@ -432,6 +432,29 @@ int kvm_xen_evtchn_alloc_unbound(X86CPU *cpu, void *arg)
     return 0;
 }
 
+int kvm_xen_evtchn_bind_vcpu(X86CPU *cpu, void *arg)
+{
+    struct evtchn_bind_vcpu bind_vcpu;
+    struct XenEvtChn *evtchn;
+    CPUState *dest;
+
+    memcpy(&bind_vcpu, arg, sizeof(bind_vcpu));
+
+    dest = qemu_get_cpu(bind_vcpu.vcpu);
+    if (!dest) {
+        return -EINVAL;
+    }
+
+    evtchn = evtchn_from_port(bind_vcpu.port);
+    if (!evtchn) {
+        return -ENOENT;
+    }
+
+    evtchn->notify_vcpu_id = bind_vcpu.vcpu;
+
+    return 0;
+}
+
 int kvm_xen_evtchn_close(X86CPU *cpu, void *arg)
 {
     struct evtchn_close close;
index dce83d112e2d0aca73b9baa52de351d62783af29..97b5d6f0978ad10207cfa7d03c4bc71ad338786b 100644 (file)
@@ -20,6 +20,7 @@ int kvm_xen_evtchn_init(XenState *xen_state);
 int kvm_xen_evtchn_bind_ipi(X86CPU *cpu, void *arg);
 int kvm_xen_evtchn_bind_virq(X86CPU *cpu, void *arg);
 int kvm_xen_evtchn_bind_interdomain(X86CPU *cpu, void *arg);
+int kvm_xen_evtchn_bind_vcpu(X86CPU *cpu, void *arg);
 int kvm_xen_evtchn_alloc_unbound(X86CPU *cpu, void *arg);
 int kvm_xen_evtchn_close(X86CPU *cpu, void *arg);
 int kvm_xen_evtchn_unmask(X86CPU *cpu, void *arg);