[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 09/11] evtchn: implement EVTCHNOP_set_limit



>>> On 13.09.13 at 18:56, David Vrabel <david.vrabel@xxxxxxxxxx> wrote:
> +static long evtchn_set_limit(const struct evtchn_set_limit *set_limit)
> +{
> +    struct domain *d;
> +    unsigned max_port = set_limit->max_port;
> +    long ret;
> +
> +    if ( max_port > EVTCHN_MAX_PORT_UNLIMITED )
> +        return -EINVAL;
> +
> +    d = rcu_lock_domain_by_id(set_limit->domid);
> +    if ( !d )
> +        return -ESRCH;
> +
> +    ret = xsm_evtchn_set_limit(XSM_DM_PRIV, d);
> +    if ( ret )
> +        goto out;
> +
> +    spin_lock(&d->event_lock);
> +
> +    d->max_evtchn_port = max_port;

So you allow this to be set even if the L2 ABI is in use. Does this
make sense? Is this consistent?

> @@ -1189,6 +1229,11 @@ void evtchn_check_pollers(struct domain *d, unsigned 
> port)
>  
>  int evtchn_init(struct domain *d)
>  {
> +    if ( is_control_domain(d) )
> +        d->max_evtchn_port = EVTCHN_MAX_PORT_UNLIMITED;
> +    else
> +        d->max_evtchn_port = EVTCHN_MAX_PORT_DEFAULT;
> +
>      /* Default to N-level ABI. */
>      evtchn_2l_init(d);

Similarly here - you set limits that are not consistent with the default
L2 ABI.

> --- a/xen/include/public/event_channel.h
> +++ b/xen/include/public/event_channel.h
> @@ -308,6 +308,9 @@ struct evtchn_set_limit {
>  };
>  typedef struct evtchn_set_limit evtchn_set_limit_t;
>  
> +#define EVTCHN_MAX_PORT_UNLIMITED ((1u << 31) - 1)
> +#define EVTCHN_MAX_PORT_DEFAULT   (NR_EVENT_CHANNELS - 1)

Does the former really need to be part of the ABI? And does it
really need to be 2^31-1 (rather than 2^32-1)?

Independent of that I think that - as hinted at in the overview
mail - this ought to be a domctl.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.