All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: konrad.wilk@oracle.com, xen-devel@lists.xen.org
Subject: Re: [RFC PATCH 2/3] Xen: rework NR_EVENT_CHANNELS related stuffs.
Date: Wed, 2 Jan 2013 14:20:23 +0000	[thread overview]
Message-ID: <50E44227.1090803@citrix.com> (raw)
In-Reply-To: <1356979137-18484-3-git-send-email-wei.liu2@citrix.com>

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

Again, the changeset description is too brief.

> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
>  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

  reply	other threads:[~2013-01-02 14:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-31 18:38 Implement 3-level event channel routines in Linux Wei Liu
2012-12-31 18:38 ` [RFC PATCH 1/3] Xen: generalized event channel operations Wei Liu
2013-01-02 14:13   ` David Vrabel
2012-12-31 18:38 ` [RFC PATCH 2/3] Xen: rework NR_EVENT_CHANNELS related stuffs Wei Liu
2013-01-02 14:20   ` David Vrabel [this message]
2012-12-31 18:38 ` [RFC PATCH 3/3] Xen: implement 3-level event channel routines Wei Liu
2013-01-02 14:57   ` David Vrabel
2013-01-02 18:26 ` Implement 3-level event channel routines in Linux Konrad Rzeszutek Wilk
2013-01-02 18:46   ` Wei Liu
2013-01-02 21:12     ` Konrad Rzeszutek Wilk
2013-01-03 12:09       ` Wei Liu
2013-01-03 12:12         ` Andrew Cooper
2013-01-04 16:36         ` Konrad Rzeszutek Wilk
  -- strict thread matches above, loose matches on Subject: below --
2012-12-31 18:37 [RFC PATCH 2/3] Xen: rework NR_EVENT_CHANNELS related stuffs Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50E44227.1090803@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.