From: Cyrill Gorcunov <gorcunov@openvz.org>
To: mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, xemul@openvz.org,
yhlu.kernel@gmail.com, Cyrill Gorcunov <gorcunov@openvz.org>
Subject: [patch 5/6] x86: irqinit - merge math_error_irq and headers
Date: Mon, 30 Mar 2009 00:15:50 +0400 [thread overview]
Message-ID: <20090329202208.295033740@openvz.org> (raw)
In-Reply-To: <20090329201545.470255691@openvz.org>
[-- Attachment #1: x86-irqinit-math_error_irq --]
[-- Type: text/plain, Size: 3377 bytes --]
Though the #include's are to be cleaned up.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
arch/x86/kernel/irqinit_32.c | 8 ++++++--
arch/x86/kernel/irqinit_64.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)
Index: linux-2.6.git/arch/x86/kernel/irqinit_32.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/irqinit_32.c
+++ linux-2.6.git/arch/x86/kernel/irqinit_32.c
@@ -1,19 +1,23 @@
+#include <linux/linkage.h>
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
+#include <linux/timex.h>
#include <linux/slab.h>
#include <linux/random.h>
#include <linux/init.h>
#include <linux/kernel_stat.h>
#include <linux/sysdev.h>
#include <linux/bitops.h>
+#include <linux/acpi.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <asm/atomic.h>
#include <asm/system.h>
+#include <asm/hw_irq.h>
#include <asm/timer.h>
#include <asm/pgtable.h>
#include <asm/desc.h>
@@ -22,7 +26,7 @@
#include <asm/i8259.h>
#include <asm/traps.h>
-
+#ifdef CONFIG_X86_32
/*
* Note that on a 486, we don't want to do a SIGFPE on an irq13
* as the irq is unreliable, and exception 16 works correctly
@@ -34,7 +38,6 @@
* leads to races. IBM designers who came up with it should
* be shot.
*/
-
static irqreturn_t math_error_irq(int cpl, void *dev_id)
{
outb(0, 0xF0);
@@ -53,6 +56,7 @@ static struct irqaction fpu_irq = {
.mask = CPU_MASK_NONE,
.name = "fpu",
};
+#endif /* CONFIG_X86_32 */
/*
* ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts:
Index: linux-2.6.git/arch/x86/kernel/irqinit_64.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/irqinit_64.c
+++ linux-2.6.git/arch/x86/kernel/irqinit_64.c
@@ -4,6 +4,7 @@
#include <linux/sched.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
+#include <linux/kprobes.h>
#include <linux/timex.h>
#include <linux/slab.h>
#include <linux/random.h>
@@ -18,11 +19,45 @@
#include <asm/atomic.h>
#include <asm/system.h>
#include <asm/hw_irq.h>
+#include <asm/timer.h>
#include <asm/pgtable.h>
#include <asm/desc.h>
#include <asm/apic.h>
#include <asm/setup.h>
#include <asm/i8259.h>
+#include <asm/traps.h>
+
+#ifdef CONFIG_X86_32
+/*
+ * Note that on a 486, we don't want to do a SIGFPE on an irq13
+ * as the irq is unreliable, and exception 16 works correctly
+ * (ie as explained in the intel literature). On a 386, you
+ * can't use exception 16 due to bad IBM design, so we have to
+ * rely on the less exact irq13.
+ *
+ * Careful.. Not only is IRQ13 unreliable, but it is also
+ * leads to races. IBM designers who came up with it should
+ * be shot.
+ */
+static irqreturn_t math_error_irq(int cpl, void *dev_id)
+{
+ outb(0, 0xF0);
+ if (ignore_fpu_irq || !boot_cpu_data.hard_math)
+ return IRQ_NONE;
+ math_error((void __user *)get_irq_regs()->ip);
+ return IRQ_HANDLED;
+}
+
+/*
+ * New motherboards sometimes make IRQ 13 be a PCI interrupt,
+ * so allow interrupt sharing.
+ */
+static struct irqaction fpu_irq = {
+ .handler = math_error_irq,
+ .mask = CPU_MASK_NONE,
+ .name = "fpu",
+};
+#endif /* CONFIG_X86_32 */
/*
* ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts:
next prev parent reply other threads:[~2009-03-29 20:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-29 20:15 [patch 0/6] x86-tip: merge irqinit_32/64.c Cyrill Gorcunov
2009-03-29 20:15 ` [patch 1/6] x86: irqinit - order code snippets for easier merging Cyrill Gorcunov
2009-03-29 20:15 ` [patch 2/6] x86: irqinit - merge smp_intr_init Cyrill Gorcunov
2009-03-29 20:15 ` [patch 3/6] x86: irqinit - merge apic_intr_init Cyrill Gorcunov
2009-03-29 20:15 ` [patch 4/6] x86: irqinit - merge native_init_IRQ Cyrill Gorcunov
2009-04-01 14:53 ` Ingo Molnar
2009-04-01 15:01 ` Cyrill Gorcunov
2009-04-01 16:16 ` Cyrill Gorcunov
2009-04-01 16:22 ` Ingo Molnar
2009-04-01 16:40 ` Cyrill Gorcunov
2009-04-01 17:22 ` Cyrill Gorcunov
2009-04-01 18:56 ` Cyrill Gorcunov
2009-03-29 20:15 ` Cyrill Gorcunov [this message]
2009-03-29 20:15 ` [patch 6/6] x86: irqinit - merge irqinit_32/64.c into irqinit.c Cyrill Gorcunov
2009-04-01 15:01 ` Ingo Molnar
2009-04-01 15:05 ` Cyrill Gorcunov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090329202208.295033740@openvz.org \
--to=gorcunov@openvz.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=xemul@openvz.org \
--cc=yhlu.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome