This hypercall is unused by guests these days, but there was no prevention of
usable subops. The following ops have been restricted, as there is no
suitable structure in the evntchn_op union.
EVTCHNOP_reset
EVTCHNOP_init_control
EVTCHNOP_expand_array
EVTCHNOP_set_priority
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
if ( unlikely(copy_from_guest(&op, uop, 1) != 0) )
return -EFAULT;
- return do_event_channel_op(op.cmd, guest_handle_from_ptr(&uop.p->u, void));
+ switch ( op.cmd )
+ {
+ case EVTCHNOP_bind_interdomain:
+ case EVTCHNOP_bind_virq:
+ case EVTCHNOP_bind_pirq:
+ case EVTCHNOP_close:
+ case EVTCHNOP_send:
+ case EVTCHNOP_status:
+ case EVTCHNOP_alloc_unbound:
+ case EVTCHNOP_bind_ipi:
+ case EVTCHNOP_bind_vcpu:
+ case EVTCHNOP_unmask:
+ return do_event_channel_op(op.cmd,
+ guest_handle_from_ptr(&uop.p->u, void));
+
+ default:
+ return -ENOSYS;
+ }
}
#endif