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

Re: [Xen-devel] [RFC PATCH 2/3] Xen: rework NR_EVENT_CHANNELS related stuffs.



On 31/12/12 18:38, Wei Liu wrote:
> 

Again, the changeset description is too brief.

> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
>  drivers/xen/events.c        |   44 
> +++++++++++++++++++++++++++++--------------
>  drivers/xen/evtchn.c        |   16 +++++++++-------
>  include/xen/events.h        |    3 +++
>  include/xen/interface/xen.h |   17 ++++++++++++++++-
>  4 files changed, 58 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/xen/events.c b/drivers/xen/events.c
> index 835101f..f60ba76 100644
> --- a/drivers/xen/events.c
> +++ b/drivers/xen/events.c
> @@ -52,7 +52,8 @@
>  #include <xen/interface/hvm/params.h>
>  
>  /* N-level event channel, starting from 2 */
> -static unsigned int evtchn_level = 2;
> +unsigned int evtchn_level = 2;
> +EXPORT_SYMBOL_GPL(evtchn_level);

I presume this is exported so the NR_EVENT_CHANNELS() macro works.  I
think it would be better to provide and export an evtchn_nr_channels()
function instead.  Perhaps make it part of the event channel ops structure?

> --- a/include/xen/interface/xen.h
> +++ b/include/xen/interface/xen.h
> @@ -283,9 +283,24 @@ DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
>  
>  /*
>   * Event channel endpoints per domain:
> + * 2-level:
>   *  1024 if a long is 32 bits; 4096 if a long is 64 bits.
> + * 3-level:
> + *  32k if a long is 32 bits; 256k if a long is 64 bits.
>   */
> -#define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 
> 64)
> +#define NR_EVENT_CHANNELS_L2 (sizeof(unsigned long) * sizeof(unsigned long) 
> * 64)
> +#define NR_EVENT_CHANNELS_L3 (NR_EVENT_CHANNELS_L2 * sizeof(unsigned long))
> +#define NR_EVENT_CHANNELS(x) ({ unsigned int __v = 0;        \
> +     switch (x) {                                    \
> +     case 2:                                         \
> +             __v = NR_EVENT_CHANNELS_L2; break;      \
> +     case 3:                                         \
> +             __v = NR_EVENT_CHANNELS_L3; break;      \
> +     default:                                        \
> +             BUG();                                  \
> +     }                                               \
> +     __v; })
> +
>  
>  struct vcpu_time_info {
>       /*

This should be split into a separate patch that resync's the Linux copy
of the header with the Xen one.

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