From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH RFC 1/4] xen: evtchn: make evtchn_reset() ready for soft reset Date: Mon, 08 Jun 2015 15:10:06 +0100 Message-ID: <5575BE5E02000078000822DE@mail.emea.novell.com> References: <1433338522-8422-1-git-send-email-vkuznets@redhat.com> <1433338522-8422-2-git-send-email-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z1xkk-0004dQ-7B for xen-devel@lists.xenproject.org; Mon, 08 Jun 2015 14:10:14 +0000 In-Reply-To: <1433338522-8422-2-git-send-email-vkuznets@redhat.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vitaly Kuznetsov Cc: Olaf Hering , Wei Liu , Ian Campbell , Stefano Stabellini , Andrew Cooper , Julien Grall , Ian Jackson , Andrew Jones , Tim Deegan , David Vrabel , xen-devel@lists.xenproject.org, Daniel De Graaf , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 03.06.15 at 15:35, wrote: > --- a/xen/common/event_channel.c > +++ b/xen/common/event_channel.c > @@ -274,11 +274,13 @@ static long evtchn_bind_interdomain(evtchn_bind_interdomain_t *bind) > > lchn->u.interdomain.remote_dom = rd; > lchn->u.interdomain.remote_port = rport; > + lchn->u.interdomain.opened_by = current->domain; > lchn->state = ECS_INTERDOMAIN; > evtchn_port_init(ld, lchn); > > rchn->u.interdomain.remote_dom = ld; > rchn->u.interdomain.remote_port = lport; > + rchn->u.interdomain.opened_by = current->domain; > rchn->state = ECS_INTERDOMAIN; For one ld == current->domain. And I don't think you need to store domain pointers here; storing the domain ID would seem sufficient (with the nice benefit of not growing struct evtchn). Plus "opened_by" doesn't really reflect what is being done here - the event channels are being bound, not opened. > @@ -933,26 +935,30 @@ int evtchn_unmask(unsigned int port) > } > > > -static long evtchn_reset(evtchn_reset_t *r) > +void evtchn_reset(struct domain *d, bool_t soft_reset) > { > - domid_t dom = r->dom; > - struct domain *d; > - int i, rc; > - > - d = rcu_lock_domain_by_any_id(dom); > - if ( d == NULL ) > - return -ESRCH; > - > - rc = xsm_evtchn_reset(XSM_TARGET, current->domain, d); > - if ( rc ) > - goto out; > + int i; unsigned int > + struct evtchn *chn; const (and perhaps moved inside the loop below) > + /* > + * ECS_INTERDOMAIN channels with port number suitable for the 2-level ABI > + * opened by other domains should remain opened as the domain doing soft > + * reset won't be able to reopen them. One question of course is - does this really apply to _all_ interdomain event channels (rather than just to the xenstore and xenconsole ones)? Jan