xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: xen-devel@lists.xen.org, konrad.wilk@oracle.com
Cc: Wei Liu <wei.liu2@citrix.com>,
	ian.campbell@citrix.com, jbeulich@suse.com,
	david.vrabel@citrix.com
Subject: [RFC PATCH V5 04/14] xen: sync public headers
Date: Tue, 19 Mar 2013 15:21:58 +0000	[thread overview]
Message-ID: <1363706528-27141-5-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1363706528-27141-1-git-send-email-wei.liu2@citrix.com>

Stay in sync with Xen public headers:
* event_channel.h:
  * EVTCHNOP_query_extended_abis
  * EVTCHNOP_register_3level
* xen.h:
  * NR_EVENT_CHANNEL*

EVTCHNOP_query_extended_aibs is pretty self-explanatory.

Other structure and macro definitions belong to the 3-level event channel ABI.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 include/xen/interface/event_channel.h |   45 +++++++++++++++++++++++++++++++++
 include/xen/interface/xen.h           |   13 +++++++++-
 2 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/include/xen/interface/event_channel.h b/include/xen/interface/event_channel.h
index 293c3f0..155454e 100644
--- a/include/xen/interface/event_channel.h
+++ b/include/xen/interface/event_channel.h
@@ -189,6 +189,51 @@ struct evtchn_reset {
 	domid_t dom;
 };
 
+/*
+ * EVTCHNOP_query_extended_abis: Query the hypervisor for supported extended
+ * event channel ABIs.
+ */
+#define EVTCHNOP_query_extended_abis 11
+#define EVTCHN_EXTENDED_NONE 0
+#define _EVTCHN_EXTENDED_L3  1
+#define EVTCHN_EXTENDED_L3   (1UL << _EVTCHN_EXTENDED_L3)
+struct evtchn_query_extended_abis {
+	/* OUT parameters. */
+	uint64_t abis;
+};
+
+/*
+ * EVTCHNOP_register_3level: Register 3-level event channel.
+ */
+#define EVTCHNOP_register_3level 12
+/*
+ * 64 bits guests need 8 pages for evtchn_pending and evtchn_mask for 256k
+ * event channels while 32 bits ones only need 1 page for 32k event channels.
+ */
+#define EVTCHN_MAX_L3_PAGES  8
+/*
+ * A guest should register the bitmaps first, then register L2 selector for
+ * individual cpu.
+ */
+#define REGISTER_BITMAPS     1
+#define REGISTER_L2_SELECTOR 2
+struct evtchn_register_3level {
+	/* IN parameters. */
+	uint32_t cmd;
+	union {
+		struct {
+			uint32_t nr_pages;
+			GUEST_HANDLE(xen_pfn_t) evtchn_pending;
+			GUEST_HANDLE(xen_pfn_t) evtchn_mask;
+		} bitmaps;
+		struct {
+			uint32_t  cpu_id;
+			xen_pfn_t mfn;    /* mfn for L2 selector */
+			xen_pfn_t offset; /* offset of L2 selector */
+		} l2_selector;
+	} u;
+};
+
 struct evtchn_op {
 	uint32_t cmd; /* EVTCHNOP_* */
 	union {
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index 53ec416..9b0248d 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -283,9 +283,20 @@ DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
 
 /*
  * Event channel endpoints per domain:
+ * 2-level for x86:
  *  1024 if a long is 32 bits; 4096 if a long is 64 bits.
+ * 3-level for x86:
+ *  32k if a long is 32 bits; 256k if a long is 64 bits.
+ * 2-level for ARM:
+ *  4096 for both 32 bits and 64 bits.
+ * 3-level for ARM:
+ *  256k for both 32 bits and 64 bits.
  */
-#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
+#define NR_EVENT_CHANNELS_L2 (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
+#define NR_EVENT_CHANNELS_L3 (NR_EVENT_CHANNELS_L2 * sizeof(xen_ulong_t) * 8)
+#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

  parent reply	other threads:[~2013-03-19 15:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19 15:21 [RFC PATCH V5] Implement 3-level event channel ABI in Linux Wei Liu
2013-03-19 15:21 ` [RFC PATCH V5 01/14] xen: remove typedef in event_channel.h Wei Liu
2013-03-19 15:21 ` [RFC PATCH V5 02/14] xen: add KERN_DEBUG in printk Wei Liu
2013-03-19 15:21 ` [RFC PATCH V5 03/14] xen: fix output of xen_debug_interrupt Wei Liu
2013-03-19 15:21 ` Wei Liu [this message]
2013-03-19 15:21 ` [RFC PATCH V5 05/14] xen: introduce test_and_set_mask Wei Liu
2013-03-19 15:22 ` [RFC PATCH V5 06/14] xen: replace raw bit ops with functions Wei Liu
2013-03-19 15:22 ` [RFC PATCH V5 07/14] xen: generalized event channel operations Wei Liu
2013-03-19 15:22 ` [RFC PATCH V5 08/14] xen: dynamically allocate cpu_evtchn_mask Wei Liu
2013-03-19 15:22 ` [RFC PATCH V5 09/14] xen: implement 3-level event channel routines Wei Liu
2013-03-19 15:22 ` [RFC PATCH V5 10/14] xen: document 2/3-level event channel ABI Wei Liu
2013-03-19 15:22 ` [RFC PATCH V5 11/14] xen: introduce xen_event_channel_query_extended_abis Wei Liu
2013-03-19 15:22 ` [RFC PATCH V5 12/14] xen: introduce xen_event_channel_register_3level Wei Liu
2013-03-19 15:22 ` [RFC PATCH V5 13/14] xen: introduce xen_event_channel_register_extended Wei Liu
2013-03-19 15:22 ` [RFC PATCH V5 14/14] xen: register 3-level event channel 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=1363706528-27141-5-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=konrad.wilk@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).