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

[Xen-devel] [PATCH 13/13] xen: only register 3-level event channel for Dom0



Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 arch/x86/xen/enlighten.c |   23 +++++++++++++----------
 drivers/xen/events.c     |   22 +++++++++++++---------
 2 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 919c7ed..10b7565 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -178,7 +178,6 @@ static void xen_vcpu_setup(int cpu)
 void xen_vcpu_restore(void)
 {
        int cpu;
-       int rc;
 
        for_each_possible_cpu(cpu) {
                bool other_cpu = (cpu != smp_processor_id());
@@ -198,15 +197,19 @@ void xen_vcpu_restore(void)
                        BUG();
        }
 
-       rc = xen_event_channel_register_nlevel(3);
-       if (!rc) {
-               printk(KERN_INFO "Register 3-level event channel succeeded.\n");
-               xen_set_event_channel_nlevel(3);
-       } else {
-               printk(KERN_INFO "Register 3-level event channel failed with 
%d.\n"
-                      "Fall back to default 2-level event channel.\n",
-                      rc);
-               xen_set_event_channel_nlevel(2);
+       if (xen_initial_domain()) {
+               int rc = xen_event_channel_register_nlevel(3);
+               if (!rc) {
+                       printk(KERN_INFO
+                              "Register 3-level event channel succeeded.\n");
+                       xen_set_event_channel_nlevel(3);
+               } else {
+                       printk(KERN_INFO
+                              "Register 3-level event channel failed with 
%d.\n"
+                              "Fall back to default 2-level event channel.\n",
+                              rc);
+                       xen_set_event_channel_nlevel(2);
+               }
        }
 }
 
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 87088b2..cdf7e84 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -2261,15 +2261,19 @@ void __init xen_init_IRQ(void)
        int i, rc;
        int cpu;
 
-       rc = xen_event_channel_register_nlevel(3);
-       if (!rc) {
-               printk(KERN_INFO "Register 3-level event channel succeeded.\n");
-               xen_set_event_channel_nlevel(3);
-       } else {
-               printk(KERN_INFO "Register 3-level event channel failed with 
%d.\n"
-                      "Fall back to default 2-level event channel.\n",
-                      rc);
-               xen_set_event_channel_nlevel(2);
+       if (xen_initial_domain()) {
+               rc = xen_event_channel_register_nlevel(3);
+               if (!rc) {
+                       printk(KERN_INFO
+                              "Register 3-level event channel succeeded.\n");
+                       xen_set_event_channel_nlevel(3);
+               } else {
+                       printk(KERN_INFO
+                              "Register 3-level event channel failed with 
%d.\n"
+                              "Fall back to default 2-level event channel.\n",
+                              rc);
+                       xen_set_event_channel_nlevel(2);
+               }
        }
 
        evtchn_to_irq = kcalloc(nr_event_channels, sizeof(*evtchn_to_irq),
-- 
1.7.10.4


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