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

[Xen-devel] [RFC PATCH V5 14/14] xen: register 3-level event channel



CPU hotplug is supported.

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


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