Event channels created during the domain build process for HVM domains
did not call the XSM creation hook. Since these channels are used
internally by Xen, redirect them to DOMAIN_INVAID instead of failing
to create if the XSM hook fails the permissions check.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
{
struct evtchn *chn;
struct domain *d = local_vcpu->domain;
- int port;
+ int port, rc;
spin_lock(&d->event_lock);
goto out;
chn = evtchn_from_port(d, port);
+ rc = xsm_evtchn_unbound(d, chn, remote_domid);
+
chn->state = ECS_UNBOUND;
chn->xen_consumer = get_xen_consumer(notification_fn);
chn->notify_vcpu_id = local_vcpu->vcpu_id;
- chn->u.unbound.remote_domid = remote_domid;
+ chn->u.unbound.remote_domid = !rc ? remote_domid : DOMID_INVALID;
out:
spin_unlock(&d->event_lock);