At present, I'm not sure what function used to add the debug statement (is it printk?) and where to look for the debug log info (is it /var/log/message?) .
The returned errno is from src/xen/common/event_channel.c
874-long do_event_channel_op(int cmd, XEN_GUEST_HANDLE(void) arg)
880 case EVTCHNOP_alloc_unbound: {
881 struct evtchn_alloc_unbound alloc_unbound;
882 if ( copy_from_guest(&alloc_unbound, arg, 1) != 0 )
884 rc = evtchn_alloc_unbound(&alloc_unbound); // only here returns -1(EPERM) , others return -EFAULT
885 if ( (rc == 0) && (copy_to_guest(arg, &alloc_unbound, 1) != 0) )
886 rc = -EFAULT; /* Cleaning up here would be a mess! */
Two statements below may affect the rc.
124-static long evtchn_alloc_unbound(evtchn_alloc_unbound_t *alloc)
129 domid_t dom = alloc->dom;
132 rc = rcu_lock_target_domain_by_id(dom, &d);
136 spin_lock(&d->event_lock);
138 if ( (port = get_free_port(d)) < 0 )
139 ERROR_EXIT_DOM(port, d);
140 chn = evtchn_from_port(d, port);
142 rc = xsm_evtchn_unbound(d, chn, alloc->remote_dom);
146 chn->state = ECS_UNBOUND;
147 if ( (chn->u.unbound.remote_domid = alloc->remote_dom) == DOMID_SELF )
148 chn->u.unbound.remote_domid = current->domain->domain_id;
153 spin_unlock(&d->event_lock);
154 rcu_unlock_domain(d);