xen/evtchn: support more than 4096 ports
authorDavid Vrabel <david.vrabel@citrix.com>
Mon, 23 Sep 2013 20:03:38 +0000 (21:03 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 6 Jan 2014 15:07:50 +0000 (10:07 -0500)
Remove the check during unbind for NR_EVENT_CHANNELS as this limits
support to less than 4096 ports.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
drivers/xen/events/events_base.c
drivers/xen/events/events_internal.h
drivers/xen/evtchn.c
include/xen/events.h

index c6d64f1e191c6e57a8640b2eed35ad7f59010843..9d0d88cf74af791e283b1edff8fb7d83aa4b5deb 100644 (file)
@@ -952,6 +952,19 @@ static int find_virq(unsigned int virq, unsigned int cpu)
        return rc;
 }
 
+/**
+ * xen_evtchn_nr_channels - number of usable event channel ports
+ *
+ * This may be less than the maximum supported by the current
+ * hypervisor ABI. Use xen_evtchn_max_channels() for the maximum
+ * supported.
+ */
+unsigned xen_evtchn_nr_channels(void)
+{
+        return evtchn_ops->nr_channels();
+}
+EXPORT_SYMBOL_GPL(xen_evtchn_nr_channels);
+
 int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
 {
        struct evtchn_bind_virq bind_virq;
index a3d9aeceda1a6e3252c24c490dc23b3e3115b464..2862e1cccf1c9064a2c1f1339f8159190d97eb8a 100644 (file)
@@ -85,11 +85,6 @@ static inline unsigned xen_evtchn_max_channels(void)
        return evtchn_ops->max_channels();
 }
 
-static inline unsigned xen_evtchn_nr_channels(void)
-{
-       return evtchn_ops->nr_channels();
-}
-
 /*
  * Do any ABI specific setup for a bound event channel before it can
  * be unmasked and used.
index 5de2063e16d3c10b598b926c4f38f3e38b2547d7..00f40f051d95668b01ebf6b4c17e6f0e90912198 100644 (file)
@@ -417,7 +417,7 @@ static long evtchn_ioctl(struct file *file,
                        break;
 
                rc = -EINVAL;
-               if (unbind.port >= NR_EVENT_CHANNELS)
+               if (unbind.port >= xen_evtchn_nr_channels())
                        break;
 
                rc = -ENOTCONN;
index 32ae0f2637491ebe709ba24635a1c51982b773db..55b42cc997f655c6811bf1b1624dc7be5be67f7b 100644 (file)
@@ -7,6 +7,8 @@
 #include <asm/xen/hypercall.h>
 #include <asm/xen/events.h>
 
+unsigned xen_evtchn_nr_channels(void);
+
 int bind_evtchn_to_irq(unsigned int evtchn);
 int bind_evtchn_to_irqhandler(unsigned int evtchn,
                              irq_handler_t handler,