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>hifive-unleashed-5.1
parent
fd21069dfe
commit
0dc0064add
|
@ -952,6 +952,19 @@ static int find_virq(unsigned int virq, unsigned int cpu)
|
||||||
return rc;
|
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)
|
int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
|
||||||
{
|
{
|
||||||
struct evtchn_bind_virq bind_virq;
|
struct evtchn_bind_virq bind_virq;
|
||||||
|
|
|
@ -85,11 +85,6 @@ static inline unsigned xen_evtchn_max_channels(void)
|
||||||
return evtchn_ops->max_channels();
|
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
|
* Do any ABI specific setup for a bound event channel before it can
|
||||||
* be unmasked and used.
|
* be unmasked and used.
|
||||||
|
|
|
@ -417,7 +417,7 @@ static long evtchn_ioctl(struct file *file,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
if (unbind.port >= NR_EVENT_CHANNELS)
|
if (unbind.port >= xen_evtchn_nr_channels())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
rc = -ENOTCONN;
|
rc = -ENOTCONN;
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include <asm/xen/hypercall.h>
|
#include <asm/xen/hypercall.h>
|
||||||
#include <asm/xen/events.h>
|
#include <asm/xen/events.h>
|
||||||
|
|
||||||
|
unsigned xen_evtchn_nr_channels(void);
|
||||||
|
|
||||||
int bind_evtchn_to_irq(unsigned int evtchn);
|
int bind_evtchn_to_irq(unsigned int evtchn);
|
||||||
int bind_evtchn_to_irqhandler(unsigned int evtchn,
|
int bind_evtchn_to_irqhandler(unsigned int evtchn,
|
||||||
irq_handler_t handler,
|
irq_handler_t handler,
|
||||||
|
|
Loading…
Reference in New Issue