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 14/14] xen: register 3-level event channel
Date: Tue, 19 Mar 2013 15:22:08 +0000	[thread overview]
Message-ID: <1363706528-27141-15-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1363706528-27141-1-git-send-email-wei.liu2@citrix.com>

CPU hotplug is supported.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 arch/x86/xen/enlighten.c |   12 ++++++++++++
 drivers/xen/events.c     |   22 +++++++++++++++++++++-
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 3556678..18edf66 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -213,6 +213,18 @@ void xen_vcpu_restore(void)
 		    HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL))
 			BUG();
 	}
+
+	/*
+	 * If we use any extended event channel ABI, should try to
+	 * re-setup it in restore path. Currently only 3-level ABI is
+	 * implemented, so simplify the code a bit.
+	 */
+	if (xen_evtchn_extended & EVTCHN_EXTENDED_L3) {
+		int rc;
+		rc = xen_event_channel_register_extended(EVTCHN_EXTENDED_L3);
+		if (rc)
+			xen_set_event_channel_extended(EVTCHN_EXTENDED_NONE);
+	}
 }
 
 static void __init xen_banner(void)
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 6f21f27..b7e5bc1 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -2368,6 +2368,11 @@ static int __cpuinit xen_events_notifier_cb(struct notifier_block *self,
 				rc = NOTIFY_OK;
 			}
 		}
+		if (rc == NOTIFY_OK &&
+		    xen_evtchn_extended & EVTCHN_EXTENDED_L3) {
+			rc = xen_event_channel_register_3level_l2selector(cpu);
+			rc = (rc == 0 ? NOTIFY_OK : NOTIFY_BAD);
+		}
 		break;
 	default:
 		break;
@@ -2383,8 +2388,23 @@ void __init xen_init_IRQ(void)
 {
 	int i;
 	int cpu;
+	uint64_t evtchn_ext_abis;
+	int rc, fallback_to_default_evtchn = 0;
+
+	evtchn_ext_abis = xen_event_channel_query_extended_abis();
+
+	if (evtchn_ext_abis == EVTCHN_EXTENDED_NONE)
+		fallback_to_default_evtchn = 1;
+	else if (evtchn_ext_abis & EVTCHN_EXTENDED_L3) {
+		rc = xen_event_channel_register_extended(EVTCHN_EXTENDED_L3);
+		if (rc == 0)
+			xen_set_event_channel_extended(EVTCHN_EXTENDED_L3);
+		else
+			fallback_to_default_evtchn = 1;
+	}
 
-	xen_set_event_channel_extended(EVTCHN_EXTENDED_NONE);
+	if (fallback_to_default_evtchn)
+		xen_set_event_channel_extended(EVTCHN_EXTENDED_NONE);
 
 	evtchn_to_irq = kcalloc(xen_nr_event_channels, sizeof(*evtchn_to_irq),
 				    GFP_KERNEL);
-- 
1.7.10.4

      parent reply	other threads:[~2013-03-19 15:22 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 ` [RFC PATCH V5 04/14] xen: sync public headers Wei Liu
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 ` Wei Liu [this message]

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-15-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).