> -----Original Message----- > From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: Tuesday, July 3, 2018 6:16 PM > To: Xin Li (Talons) <xin...@citrix.com>; Xin Li <talons....@gmail.com> > Cc: Andrew Cooper <andrew.coop...@citrix.com>; George Dunlap > <george.dun...@citrix.com>; Ming Lu <ming...@citrix.com>; Sergey Dyasli > <sergey.dya...@citrix.com>; Wei Liu <wei.l...@citrix.com>; Stefano Stabellini > <sstabell...@kernel.org>; xen-de...@lists.xen.org; Konrad Rzeszutek Wilk > <konrad.w...@oracle.com>; Daniel de Graaf <dgde...@tycho.nsa.gov>; Tim > (Xen.org) <t...@xen.org> > Subject: RE: [PATCH 2/2] xen/xsm: Add new SILO mode for XSM > > >>> On 03.07.18 at 11:07, <xin...@citrix.com> wrote: > >> From: Jan Beulich [mailto:jbeul...@suse.com] > >> Sent: Tuesday, July 3, 2018 3:34 PM > >> >>> On 03.07.18 at 03:26, <talons....@gmail.com> wrote: > >> > + return (is_control_domain(cur_dom) || is_control_domain(ldom) || > >> > + is_control_domain(rdom) || ldom == rdom); } > >> > + > >> > +static int silo_evtchn_unbound(struct domain *d1, struct evtchn *chn, > >> > + domid_t id2) { > >> > + int rc = -EPERM; > >> > + struct domain *d2 = rcu_lock_domain_by_id(id2); > >> > + if ( d2 != NULL && silo_mode_dom_check(d1, d2) ) > >> > >> Blank line please between declaration(s) and statement(s). And const > >> on the local variable declaration again. > >> > >> Also, is DOMID_SELF really not allowed here for id2? I don't think > >> so, looking at e.g. evtchn_alloc_unbound(). > > > > static int silo_evtchn_unbound(struct domain *d1, struct evtchn *chn, > > domid_t id2) > > { > > int rc = -EPERM; > > struct domain *d2; > > > > if ( id2 == DOMID_SELF ) > > id2 = current->domain->domain_id; > > d2 = rcu_lock_domain_by_id(id2); > > No - simply call rcu_lock_domain_by_any_id().
Sure. + int rc = -EPERM; + struct domain *d2 = rcu_lock_domain_by_any_id(id2); + + if ( d2 != NULL && silo_mode_dom_check(d1, d2) ) > > Jan > _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel