lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200805291741.13956.borntraeger@de.ibm.com>
Date:	Thu, 29 May 2008 17:41:13 +0200
From:	Christian Borntraeger <borntraeger@...ibm.com>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	Martin Schwidefsky <schwidefsky@...ibm.com>
Subject: [Patch/RFC]: check CONFIG_GENERIC_HARDIRQS for request/free_irq in interrupt.h

I currently try to evaluate virtio_console for kvm on s390 and got
the following problem:

virtio_console uses hvc_alloc with irq=0. That means, register_irq
and free_irq are never called by hvc_console.c, but the linker will
still complain about unknown references to free_irq and request_irq.

As the whole kernel/irq folder depends on CONFIG_GENERIC_HARDIRQS 
it seems consistent to declare all functions from kernel/irq only if
CONFIG_GENERIC_HARDIRQS is set. Otherwise we can use empty functions.

This patch does that for register_irq and free_irq. 

Comments?

Signed-off-by: Christian Borntraeger <borntraeger@...ibm.com>
CC: Ingo Molnar <mingo@...e.hu>
CC: Thomas Gleixner <tglx@...utronix.de>
CC: Martin Schwidefsky <schwidefsky@...ibm.com>
---
 include/linux/interrupt.h |   13 +++++++++++++
 1 file changed, 13 insertions(+)

Index: linux-2.6/include/linux/interrupt.h
===================================================================
--- linux-2.6.orig/include/linux/interrupt.h
+++ linux-2.6/include/linux/interrupt.h
@@ -69,9 +69,22 @@ struct irqaction {
 };
 
 extern irqreturn_t no_action(int cpl, void *dev_id);
+
+#ifdef CONFIG_GENERIC_HARDIRQS
 extern int __must_check request_irq(unsigned int, irq_handler_t handler,
 		       unsigned long, const char *, void *);
 extern void free_irq(unsigned int, void *);
+#else
+static inline int request_irq(unsigned int irq, irq_handler_t handler,
+		unsigned long irqflags, const char *devname, void *dev_id)
+{
+	return -EINVAL;
+}
+
+static inline void free_irq(unsigned int irq, void *dev_id)
+{
+}
+#endif
 
 struct device;
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ