All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	"jbeulich@suse.com" <jbeulich@suse.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 04/13] xen: sync public headers
Date: Wed, 6 Feb 2013 11:57:09 -0500	[thread overview]
Message-ID: <20130206165709.GC24458@konrad-lan.dumpdata.com> (raw)
In-Reply-To: <1360085020.7477.167.camel@zion.uk.xensource.com>

On Tue, Feb 05, 2013 at 05:23:40PM +0000, Wei Liu wrote:
> On Tue, 2013-02-05 at 17:00 +0000, Konrad Rzeszutek Wilk wrote:
> > On Thu, Jan 31, 2013 at 02:46:58PM +0000, Wei Liu wrote:
> > > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > > ---
> > >  include/xen/interface/event_channel.h |   33 +++++++++++++++++++++++++++++++++
> > >  include/xen/interface/xen.h           |    9 ++++++++-
> > >  2 files changed, 41 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/include/xen/interface/event_channel.h b/include/xen/interface/event_channel.h
> > > index f494292..9d8b9e7 100644
> > > --- a/include/xen/interface/event_channel.h
> > > +++ b/include/xen/interface/event_channel.h
> > > @@ -190,6 +190,39 @@ struct evtchn_reset {
> > >  };
> > >  typedef struct evtchn_reset evtchn_reset_t;
> > >  
> > > +/*
> > > + * EVTCHNOP_register_nlevel: Register N-level event channel
> > > + * NOTES:
> > > + *  1. Currently only 3-level is supported.
> > > + *  2. Should fall back to 2-level if this call fails.
> > > + */
> > > +#define EVTCHNOP_register_nlevel 11
> > > +/* 64 bit guests need 8 pages for evtchn_pending and evtchn_mask for
> > > + * 256k event channels while 32 bit ones only need 1 page for 32k
> > > + * event channels. */
> > > +#define EVTCHN_MAX_L3_PAGES 8
> > > +struct evtchn_register_3level {
> > > +	/* IN parameters. */
> > > +	uint32_t nr_pages; /* for evtchn_{pending,mask} */
> > > +	uint32_t nr_vcpus; /* for l2sel_{mfns,mask} */
> > > +	GUEST_HANDLE(ulong) evtchn_pending;
> > > +	GUEST_HANDLE(ulong) evtchn_mask;
> > > +	GUEST_HANDLE(ulong) l2sel_mfns;
> > > +	GUEST_HANDLE(ulong) l2sel_offsets;
> > > +};
> > > +typedef struct evtchn_register_3level evtchn_register_3level_t;

Please please not put them in. I know that there are some typdefs in
there but they should actually be removed.

> > > +DEFINE_GUEST_HANDLE(evtchn_register_3level_t);
> > > +
> > > +struct evtchn_register_nlevel {
> > > +	/* IN parameters. */
> > > +	uint32_t level;
> > > +	union {
> > > +		evtchn_register_3level_t l3;
> > > +	} u;
> > > +};
> > > +typedef struct evtchn_register_nlevel evtchn_register_nlevel_t;
> > > +DEFINE_GUEST_HANDLE(evtchn_register_nlevel_t);
> > > +
> > >  struct evtchn_op {
> > >  	uint32_t cmd; /* EVTCHNOP_* */
> > >  	union {
> > > diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
> > > index a890804..5220e33 100644
> > > --- a/include/xen/interface/xen.h
> > > +++ b/include/xen/interface/xen.h
> > > @@ -283,9 +283,16 @@ 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)
> > 
> > We did a bit of header change to make the ARM code always use 'unsinged
> > long long' on 32-bit (so it is a nice 8-bytes) and 'unsigned long' on
> > 64-bit. This was all done using the xen_pfn_t and xen_mfn_t typdefs.
> > 
> > Any chance you can do that here? That way on ARM - irregardless if it is
> > 32-bit or 64-bit it is always of the 64-bit size?
> > 
> 
> I don't think so. The reason to use unsigned long here is to guarantee
> each selector (in 2-level case there is only L1 selector) fits into a
> word.

OK, so we do depend on this being of different size on 32-bit and
64-bit.
> 
> > Or do we not care about the ARM case here?
> > 
> 
> What do you mean? How would this definition affect ARM case?
> 

Xen ARM uses 64-bit values even if the host/guest is 32-bit.

> 
> Wei.
> 
> > > +#define NR_EVENT_CHANNELS_L3 (NR_EVENT_CHANNELS_L2 * 64)
> > > +#if !defined(__XEN__) && !defined(__XEN_TOOLS__)
> > > +#define NR_EVENT_CHANNELS NR_EVENT_CHANNELS_L2 /* for compatibility */
> > > +#endif
> > >  
> > >  struct vcpu_time_info {
> > >  	/*
> > > -- 
> > > 1.7.10.4
> > > 
> 
> 

  reply	other threads:[~2013-02-06 16:57 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-31 14:46 [PATCH 00/13] Implement 3-level event channel in Linux Wei Liu
2013-01-31 14:46 ` [PATCH 01/13] xen: fix output of xen_debug_interrupt Wei Liu
2013-02-01 11:06   ` David Vrabel
2013-02-01 13:10     ` Wei Liu
2013-02-01 13:14     ` Wei Liu
2013-01-31 14:46 ` [PATCH 02/13] xen: fix error handling path if xen_allocate_irq_dynamic fails Wei Liu
2013-02-01 11:19   ` David Vrabel
2013-02-01 11:26   ` Ian Campbell
2013-02-01 12:36     ` Wei Liu
2013-02-06 15:49   ` Konrad Rzeszutek Wilk
2013-01-31 14:46 ` [PATCH 03/13] xen: fix evtchn_unbind_from_user Wei Liu
2013-02-01 11:15   ` David Vrabel
2013-02-01 12:33     ` Wei Liu
2013-02-05 16:57       ` Konrad Rzeszutek Wilk
2013-01-31 14:46 ` [PATCH 04/13] xen: sync public headers Wei Liu
2013-02-05 17:00   ` Konrad Rzeszutek Wilk
2013-02-05 17:23     ` Wei Liu
2013-02-06 16:57       ` Konrad Rzeszutek Wilk [this message]
2013-02-07  9:22         ` Paul Durrant
2013-02-07 11:57           ` Wei Liu
2013-02-08 16:06             ` Paul Durrant
2013-02-08 16:22               ` Ian Campbell
2013-02-08 16:36                 ` Paul Durrant
2013-02-08 16:49                   ` Tim Deegan
2013-02-08 16:56                     ` Jan Beulich
2013-02-08 16:59                     ` Ian Campbell
2013-02-08 17:06                       ` Tim Deegan
2013-02-08 17:09                         ` Ian Campbell
2013-02-08 19:45                           ` David Vrabel
2013-02-08 19:55                             ` Ian Campbell
2013-02-08 17:07                     ` Paul Durrant
2013-02-08 16:37                 ` Wei Liu
2013-02-08 16:40                   ` Ian Campbell
2013-02-07 12:23           ` Ian Campbell
2013-01-31 14:46 ` [PATCH 05/13] xen: introduce test_and_set_mask Wei Liu
2013-02-01 11:35   ` David Vrabel
2013-02-01 22:08     ` Ian Campbell
2013-01-31 14:47 ` [PATCH 06/13] xen: replace raw bit ops with functions Wei Liu
2013-01-31 14:47 ` [PATCH 07/13] xen: generalized event channel operations Wei Liu
2013-02-05 17:04   ` Konrad Rzeszutek Wilk
2013-02-05 17:08     ` Wei Liu
2013-02-05 17:19       ` Konrad Rzeszutek Wilk
2013-02-05 17:23         ` Wei Liu
2013-02-05 19:44           ` Konrad Rzeszutek Wilk
2013-01-31 14:47 ` [PATCH 08/13] xen: dynamically allocate cpu_evtchn_mask Wei Liu
2013-02-01 11:29   ` David Vrabel
2013-01-31 14:47 ` [PATCH 09/13] xen: implement 3-level event channel routines Wei Liu
2013-02-05 17:09   ` Konrad Rzeszutek Wilk
2013-02-05 17:39     ` Wei Liu
2013-02-05 19:46       ` Konrad Rzeszutek Wilk
2013-01-31 14:47 ` [PATCH 10/13] xen: introduce xen_event_channel_register_3level Wei Liu
2013-02-04  8:56   ` Jan Beulich
2013-02-04 10:36     ` Wei Liu
2013-02-05 16:55   ` Konrad Rzeszutek Wilk
2013-02-05 17:05     ` Wei Liu
2013-02-05 17:14       ` Konrad Rzeszutek Wilk
2013-01-31 14:47 ` [PATCH 11/13] xen: introduce xen_event_channel_register_nlevel Wei Liu
2013-01-31 14:47 ` [PATCH 12/13] xen: register 3-level event channel Wei Liu
2013-02-01 11:31   ` David Vrabel
2013-01-31 14:47 ` [PATCH 13/13] xen: only register 3-level event channel for Dom0 Wei Liu
2013-01-31 16:39   ` 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=20130206165709.GC24458@konrad-lan.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=jbeulich@suse.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.