Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen/evtchn: support more than 4096 ports

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>

authored by

David Vrabel and committed by
Konrad Rzeszutek Wilk
0dc0064a fd21069d

+16 -6
+13
drivers/xen/events/events_base.c
··· 952 952 return rc; 953 953 } 954 954 955 + /** 956 + * xen_evtchn_nr_channels - number of usable event channel ports 957 + * 958 + * This may be less than the maximum supported by the current 959 + * hypervisor ABI. Use xen_evtchn_max_channels() for the maximum 960 + * supported. 961 + */ 962 + unsigned xen_evtchn_nr_channels(void) 963 + { 964 + return evtchn_ops->nr_channels(); 965 + } 966 + EXPORT_SYMBOL_GPL(xen_evtchn_nr_channels); 967 + 955 968 int bind_virq_to_irq(unsigned int virq, unsigned int cpu) 956 969 { 957 970 struct evtchn_bind_virq bind_virq;
-5
drivers/xen/events/events_internal.h
··· 85 85 return evtchn_ops->max_channels(); 86 86 } 87 87 88 - static inline unsigned xen_evtchn_nr_channels(void) 89 - { 90 - return evtchn_ops->nr_channels(); 91 - } 92 - 93 88 /* 94 89 * Do any ABI specific setup for a bound event channel before it can 95 90 * be unmasked and used.
+1 -1
drivers/xen/evtchn.c
··· 417 417 break; 418 418 419 419 rc = -EINVAL; 420 - if (unbind.port >= NR_EVENT_CHANNELS) 420 + if (unbind.port >= xen_evtchn_nr_channels()) 421 421 break; 422 422 423 423 rc = -ENOTCONN;
+2
include/xen/events.h
··· 7 7 #include <asm/xen/hypercall.h> 8 8 #include <asm/xen/events.h> 9 9 10 + unsigned xen_evtchn_nr_channels(void); 11 + 10 12 int bind_evtchn_to_irq(unsigned int evtchn); 11 13 int bind_evtchn_to_irqhandler(unsigned int evtchn, 12 14 irq_handler_t handler,