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

Re: [Xen-devel] [RFC PATCH V3 07/22] Add evtchn_extended in struct domain



On 27/02/13 14:34, Wei Liu wrote:
> This field is a bitmap of currently in use extended event channel ABI, which
> can have 0 (no extended event channel in use) 1 bit set. It is manipulated by
> hypervisor only, so if anything goes wrong it is a bug.
> 
> The default event channel ABI is EVTCHN_EXTENDED_NONE, which means no extended
> event channel is used.
[...]
> --- a/xen/include/xen/event.h
> +++ b/xen/include/xen/event.h
> @@ -14,6 +14,7 @@
>  #include <xen/softirq.h>
>  #include <asm/bitops.h>
>  #include <asm/event.h>
> +#include <public/event_channel.h>
>  
>  #ifndef CONFIG_COMPAT
>  #define BITS_PER_EVTCHN_WORD(d) BITS_PER_LONG
> @@ -22,7 +23,16 @@
>  #endif
>  static inline unsigned int max_evtchns(struct domain *d)
>  {
> -    return BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
> +    unsigned int ret = 0;
> +    switch ( d->evtchn_extended )
> +    {
> +    case EVTCHN_EXTENDED_NONE:
> +        ret = BITS_PER_EVTCHN_WORD(d) * BITS_PER_EVTCHN_WORD(d);
> +        break;
> +    default:
> +        BUG();
> +    }

BUG'ing in every switch that uses d->evtchn_extended doesn't seem useful
and may add extra overhead in hot paths.

Perhaps an ASSERT() but this this field is written in such a limited set
of places this doesn't seem useful.

David

_______________________________________________
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®.