> -----Original Message-----
> From: Jan Beulich [mailto:[email protected]]
> Sent: Tuesday, July 3, 2018 6:16 PM
> To: Xin Li (Talons) <[email protected]>; Xin Li <[email protected]>
> Cc: Andrew Cooper <[email protected]>; George Dunlap
> <[email protected]>; Ming Lu <[email protected]>; Sergey Dyasli
> <[email protected]>; Wei Liu <[email protected]>; Stefano Stabellini
> <[email protected]>; [email protected]; Konrad Rzeszutek Wilk
> <[email protected]>; Daniel de Graaf <[email protected]>; Tim
> (Xen.org) <[email protected]>
> Subject: RE: [PATCH 2/2] xen/xsm: Add new SILO mode for XSM
> 
> >>> On 03.07.18 at 11:07, <[email protected]> wrote:
> >> From: Jan Beulich [mailto:[email protected]]
> >> Sent: Tuesday, July 3, 2018 3:34 PM
> >> >>> On 03.07.18 at 03:26, <[email protected]> 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
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to