virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] use NR_IRQS for irq count
@ 2008-04-08 17:04 Glauber Costa
  2008-04-09  4:43 ` Amit Shah
       [not found] ` <200804091013.11149.amit.shah@qumranet.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Glauber Costa @ 2008-04-08 17:04 UTC (permalink / raw)
  To: kvm-devel; +Cc: Glauber Costa, virtualization

Instead of artificially limiting irq numbers, use arch provided NR_IRQS

Signed-off-by: Glauber Costa <gcosta@redhat.com>
---
 irqhook/irqhook_main.c |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/irqhook/irqhook_main.c b/irqhook/irqhook_main.c
index 5f414d1..828c70a 100644
--- a/irqhook/irqhook_main.c
+++ b/irqhook/irqhook_main.c
@@ -31,15 +31,13 @@ #define ERROR(fmt, args...) printk("<1>"
 static spinlock_t irqh_lock;
 static wait_queue_head_t irqh_proc_list;
 
-enum {NINTR = 256};
-
-static DECLARE_BITMAP(pending, NINTR);
-static DECLARE_BITMAP(handled, NINTR);
+static DECLARE_BITMAP(pending, NR_IRQS);
+static DECLARE_BITMAP(handled, NR_IRQS);
 
 #define irqh_on(which, bit)	test_bit(bit, which)
 #define irqh_set(which, bit)	set_bit(bit, which)
 #define irqh_clear(which, bit)	clear_bit(bit, which)
-#define irqh_ffs(which)		find_first_bit(which, NINTR)
+#define irqh_ffs(which)		find_first_bit(which, NR_IRQS)
 
 static irqreturn_t
 irqh_interrupt(int irq, void *p)
@@ -92,7 +90,7 @@ irqh_dev_write(struct file *fp, const ch
 		if (pdp) {
 			if (pci_enable_device(pdp))
 				ERROR("device not enabled\n");
-			if ((unsigned)(n = pdp->irq) >= NINTR) {
+			if ((unsigned)(n = pdp->irq) >= NR_IRQS) {
 				ERROR("device has invalid IRQ set\n");
 				return -EINVAL;
 			}
@@ -107,7 +105,7 @@ irqh_dev_write(struct file *fp, const ch
 		irqh_set(handled, n);
 		goto done;
 	}
-	if ((unsigned)n >= NINTR)
+	if ((unsigned)n >= NR_IRQS)
 		return -EINVAL;
 	if (arg[0] == '-') {
 		if (pdp)
@@ -135,7 +133,7 @@ irqh_dev_read(struct file *fp, char *buf
 		return -EINVAL;
 	spin_lock_irq(&irqh_lock);
 	while (!signal_pending(current)) {
-		if ((n = irqh_ffs(pending)) < NINTR) {
+		if ((n = irqh_ffs(pending)) < NR_IRQS) {
 			if ((m = sprintf(b, "%d", n) + 1) > size)
 				m = size;
 			if (copy_to_user(buf, b, m))
@@ -203,7 +201,7 @@ irqh_cleanup(void)
 
 	DPRINTK("ENTER\n");
 	
-	while ((n = irqh_ffs(handled)) < NINTR) {
+	while ((n = irqh_ffs(handled)) < NR_IRQS) {
 		irqh_clear(handled, n);
 		free_irq(n, (void *)irqh_interrupt);
 	}
-- 
1.4.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] use NR_IRQS for irq count
  2008-04-08 17:04 [PATCH] use NR_IRQS for irq count Glauber Costa
@ 2008-04-09  4:43 ` Amit Shah
       [not found] ` <200804091013.11149.amit.shah@qumranet.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Amit Shah @ 2008-04-09  4:43 UTC (permalink / raw)
  To: Glauber Costa; +Cc: kvm-devel, virtualization

* On Tuesday 08 April 2008 22:34:36 Glauber Costa wrote:
> Instead of artificially limiting irq numbers, use arch provided NR_IRQS
>
> Signed-off-by: Glauber Costa <gcosta@redhat.com>

Thanks, applied.

Going forward, we're going to use the in-kernel approach for interrupt 
injection (which already has this change). The irqhook module will stay 
around for testing / debugging purposes (will be used with -no-kvm-irqchip).

Amit.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] use NR_IRQS for irq count
       [not found] ` <200804091013.11149.amit.shah@qumranet.com>
@ 2008-04-09 12:11   ` Glauber Costa
  2008-04-10  9:11     ` Amit Shah
  0 siblings, 1 reply; 4+ messages in thread
From: Glauber Costa @ 2008-04-09 12:11 UTC (permalink / raw)
  To: Amit Shah; +Cc: kvm-devel, virtualization

Amit Shah wrote:
> * On Tuesday 08 April 2008 22:34:36 Glauber Costa wrote:
>> Instead of artificially limiting irq numbers, use arch provided NR_IRQS
>>
>> Signed-off-by: Glauber Costa <gcosta@redhat.com>
> 
> Thanks, applied.
> 
> Going forward, we're going to use the in-kernel approach for interrupt 
> injection (which already has this change). The irqhook module will stay 
> around for testing / debugging purposes (will be used with -no-kvm-irqchip).
> 
> Amit.
Is it already in your tree?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] use NR_IRQS for irq count
  2008-04-09 12:11   ` Glauber Costa
@ 2008-04-10  9:11     ` Amit Shah
  0 siblings, 0 replies; 4+ messages in thread
From: Amit Shah @ 2008-04-10  9:11 UTC (permalink / raw)
  To: Glauber Costa; +Cc: kvm-devel, virtualization

* On Wednesday 09 Apr 2008 17:41:10 Glauber Costa wrote:
> Amit Shah wrote:
> > * On Tuesday 08 April 2008 22:34:36 Glauber Costa wrote:
> >> Instead of artificially limiting irq numbers, use arch provided NR_IRQS
> >>
> >> Signed-off-by: Glauber Costa <gcosta@redhat.com>
> >
> > Thanks, applied.
> >
> > Going forward, we're going to use the in-kernel approach for interrupt
> > injection (which already has this change). The irqhook module will stay
> > around for testing / debugging purposes (will be used with
> > -no-kvm-irqchip).
> >
> > Amit.
>
> Is it already in your tree?

Yes, it's in the new tree I just sent the link to.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-10  9:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-08 17:04 [PATCH] use NR_IRQS for irq count Glauber Costa
2008-04-09  4:43 ` Amit Shah
     [not found] ` <200804091013.11149.amit.shah@qumranet.com>
2008-04-09 12:11   ` Glauber Costa
2008-04-10  9:11     ` Amit Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).