]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.xen/xen-x86-consistent-nmi
Corrected links and text on ids.cgi
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.xen / xen-x86-consistent-nmi
1 From: jbeulich@novell.com
2 Subject: make i386 and x86 NMI code consistent, disable all APIC-related stuff
3 Patch-mainline: obsolete
4 References: 191115
5
6 --- head-2008-12-08.orig/arch/x86/kernel/Makefile 2008-12-08 13:37:43.000000000 +0100
7 +++ head-2008-12-08/arch/x86/kernel/Makefile 2008-12-08 13:39:19.000000000 +0100
8 @@ -120,7 +120,6 @@ ifeq ($(CONFIG_X86_64),y)
9
10 obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
11
12 - obj-$(CONFIG_XEN) += nmi.o
13 time_64-$(CONFIG_XEN) += time_32.o
14 endif
15
16 --- head-2008-12-08.orig/arch/x86/kernel/cpu/Makefile 2008-12-08 13:37:45.000000000 +0100
17 +++ head-2008-12-08/arch/x86/kernel/cpu/Makefile 2008-12-08 13:39:19.000000000 +0100
18 @@ -24,4 +24,4 @@ obj-$(CONFIG_CPU_FREQ) += cpufreq/
19
20 obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o
21
22 -disabled-obj-$(CONFIG_XEN) := hypervisor.o vmware.o
23 +disabled-obj-$(CONFIG_XEN) := hypervisor.o perfctr-watchdog.o vmware.o
24 --- head-2008-12-08.orig/arch/x86/kernel/nmi.c 2008-12-08 13:25:43.000000000 +0100
25 +++ head-2008-12-08/arch/x86/kernel/nmi.c 2008-12-08 13:39:19.000000000 +0100
26 @@ -27,7 +27,7 @@
27 #include <linux/kdebug.h>
28 #include <linux/smp.h>
29
30 -#ifndef CONFIG_XEN
31 +#ifdef ARCH_HAS_NMI_WATCHDOG
32 #include <asm/i8259.h>
33 #endif
34 #include <asm/io_apic.h>
35 @@ -41,6 +41,9 @@
36 #include <mach_traps.h>
37
38 int unknown_nmi_panic;
39 +
40 +#ifdef ARCH_HAS_NMI_WATCHDOG
41 +
42 int nmi_watchdog_enabled;
43
44 static cpumask_t backtrace_mask = CPU_MASK_NONE;
45 @@ -181,10 +184,8 @@ int __init check_nmi_watchdog(void)
46 kfree(prev_nmi_count);
47 return 0;
48 error:
49 -#ifndef CONFIG_XEN
50 if (nmi_watchdog == NMI_IO_APIC && !timer_through_8259)
51 disable_8259A_irq(0);
52 -#endif
53 #ifdef CONFIG_X86_32
54 timer_ack = 0;
55 #endif
56 @@ -460,6 +461,8 @@ nmi_watchdog_tick(struct pt_regs *regs,
57 return rc;
58 }
59
60 +#endif /* ARCH_HAS_NMI_WATCHDOG */
61 +
62 #ifdef CONFIG_SYSCTL
63
64 static int __init setup_unknown_nmi_panic(char *str)
65 @@ -479,6 +482,7 @@ static int unknown_nmi_panic_callback(st
66 return 0;
67 }
68
69 +#ifdef ARCH_HAS_NMI_WATCHDOG
70 /*
71 * proc handler for /proc/sys/kernel/nmi
72 */
73 @@ -511,6 +515,7 @@ int proc_nmi_enabled(struct ctl_table *t
74 }
75 return 0;
76 }
77 +#endif
78
79 #endif /* CONFIG_SYSCTL */
80
81 @@ -523,6 +528,7 @@ int do_nmi_callback(struct pt_regs *regs
82 return 0;
83 }
84
85 +#ifdef ARCH_HAS_NMI_WATCHDOG
86 void __trigger_all_cpu_backtrace(void)
87 {
88 int i;
89 @@ -535,3 +541,4 @@ void __trigger_all_cpu_backtrace(void)
90 mdelay(1);
91 }
92 }
93 +#endif
94 --- head-2008-12-08.orig/arch/x86/kernel/traps_32-xen.c 2008-12-08 13:37:51.000000000 +0100
95 +++ head-2008-12-08/arch/x86/kernel/traps_32-xen.c 2008-12-08 13:39:19.000000000 +0100
96 @@ -823,12 +823,14 @@ static notrace __kprobes void default_do
97 == NOTIFY_STOP)
98 return;
99 #ifdef CONFIG_X86_LOCAL_APIC
100 +#ifdef ARCH_HAS_NMI_WATCHDOG
101 /*
102 * Ok, so this is none of the documented NMI sources,
103 * so it must be the NMI watchdog.
104 */
105 if (nmi_watchdog_tick(regs, reason))
106 return;
107 +#endif
108 if (!do_nmi_callback(regs, cpu))
109 unknown_nmi_error(reason, regs);
110 #else
111 --- head-2008-12-08.orig/arch/x86/kernel/traps_64-xen.c 2008-12-08 13:37:51.000000000 +0100
112 +++ head-2008-12-08/arch/x86/kernel/traps_64-xen.c 2008-12-08 13:39:19.000000000 +0100
113 @@ -636,7 +636,7 @@ void die(const char *str, struct pt_regs
114 oops_end(flags, regs, SIGSEGV);
115 }
116
117 -#if defined(CONFIG_X86_LOCAL_APIC) || defined(CONFIG_SYSCTL)
118 +#ifdef CONFIG_SYSCTL
119 notrace __kprobes void
120 die_nmi(char *str, struct pt_regs *regs, int do_panic)
121 {
122 @@ -882,6 +882,7 @@ asmlinkage notrace __kprobes void defaul
123 == NOTIFY_STOP)
124 return;
125 #ifdef CONFIG_X86_LOCAL_APIC
126 +#ifdef ARCH_HAS_NMI_WATCHDOG
127 /*
128 * Ok, so this is none of the documented NMI sources,
129 * so it must be the NMI watchdog.
130 @@ -891,6 +892,9 @@ asmlinkage notrace __kprobes void defaul
131 #endif
132 if (!do_nmi_callback(regs, cpu))
133 unknown_nmi_error(reason, regs);
134 +#else
135 + unknown_nmi_error(reason, regs);
136 +#endif
137
138 return;
139 }
140 --- head-2008-12-08.orig/arch/x86/mach-xen/setup.c 2008-12-08 13:25:43.000000000 +0100
141 +++ head-2008-12-08/arch/x86/mach-xen/setup.c 2008-12-08 13:39:19.000000000 +0100
142 @@ -108,12 +108,10 @@ void __init machine_specific_arch_setup(
143 .address = CALLBACK_ADDR(system_call)
144 };
145 #endif
146 -#if defined(CONFIG_X86_LOCAL_APIC) || defined(CONFIG_X86_32)
147 static struct callback_register __initdata nmi_cb = {
148 .type = CALLBACKTYPE_nmi,
149 .address = CALLBACK_ADDR(nmi)
150 };
151 -#endif
152
153 ret = HYPERVISOR_callback_op(CALLBACKOP_register, &event);
154 if (ret == 0)
155 @@ -137,7 +135,6 @@ void __init machine_specific_arch_setup(
156 #endif
157 BUG_ON(ret);
158
159 -#if defined(CONFIG_X86_LOCAL_APIC) || defined(CONFIG_X86_32)
160 ret = HYPERVISOR_callback_op(CALLBACKOP_register, &nmi_cb);
161 #if CONFIG_XEN_COMPAT <= 0x030002
162 if (ret == -ENOSYS) {
163 @@ -148,7 +145,6 @@ void __init machine_specific_arch_setup(
164 HYPERVISOR_nmi_op(XENNMI_register_callback, &cb);
165 }
166 #endif
167 -#endif
168
169 #ifdef CONFIG_X86_32
170 /* Do an early initialization of the fixmap area */
171 --- head-2008-12-08.orig/include/asm-x86/irq.h 2008-12-08 13:15:52.000000000 +0100
172 +++ head-2008-12-08/include/asm-x86/irq.h 2008-12-08 13:39:19.000000000 +0100
173 @@ -15,7 +15,7 @@ static inline int irq_canonicalize(int i
174 return ((irq == 2) ? 9 : irq);
175 }
176
177 -#ifdef CONFIG_X86_LOCAL_APIC
178 +#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_XEN)
179 # define ARCH_HAS_NMI_WATCHDOG
180 #endif
181
182 --- head-2008-12-08.orig/include/asm-x86/nmi.h 2008-12-08 13:15:52.000000000 +0100
183 +++ head-2008-12-08/include/asm-x86/nmi.h 2008-12-08 13:39:19.000000000 +0100
184 @@ -5,8 +5,6 @@
185 #include <asm/irq.h>
186 #include <asm/io.h>
187
188 -#ifdef ARCH_HAS_NMI_WATCHDOG
189 -
190 /**
191 * do_nmi_callback
192 *
193 @@ -20,6 +18,11 @@ extern void default_do_nmi(struct pt_reg
194 #endif
195
196 extern void die_nmi(char *str, struct pt_regs *regs, int do_panic);
197 +
198 +extern int unknown_nmi_panic;
199 +
200 +#ifdef ARCH_HAS_NMI_WATCHDOG
201 +
202 extern int check_nmi_watchdog(void);
203 extern int nmi_watchdog_enabled;
204 extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
205 @@ -46,7 +49,6 @@ struct ctl_table;
206 struct file;
207 extern int proc_nmi_enabled(struct ctl_table *, int , struct file *,
208 void __user *, size_t *, loff_t *);
209 -extern int unknown_nmi_panic;
210
211 void __trigger_all_cpu_backtrace(void);
212 #define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace()
213 @@ -69,7 +71,6 @@ static inline int nmi_watchdog_active(vo
214 */
215 return nmi_watchdog & 0x3;
216 }
217 -#endif
218
219 void lapic_watchdog_stop(void);
220 int lapic_watchdog_init(unsigned nmi_hz);
221 @@ -78,6 +79,9 @@ unsigned lapic_adjust_nmi_hz(unsigned hz
222 int lapic_watchdog_ok(void);
223 void disable_lapic_nmi_watchdog(void);
224 void enable_lapic_nmi_watchdog(void);
225 +
226 +#endif
227 +
228 void stop_nmi(void);
229 void restart_nmi(void);
230
231 --- head-2008-12-08.orig/kernel/sysctl.c 2008-12-08 13:17:58.000000000 +0100
232 +++ head-2008-12-08/kernel/sysctl.c 2008-12-08 13:39:19.000000000 +0100
233 @@ -673,6 +673,7 @@ static struct ctl_table kern_table[] = {
234 .mode = 0644,
235 .proc_handler = &proc_dointvec,
236 },
237 +#ifdef ARCH_HAS_NMI_WATCHDOG
238 {
239 .procname = "nmi_watchdog",
240 .data = &nmi_watchdog_enabled,
241 @@ -681,6 +682,7 @@ static struct ctl_table kern_table[] = {
242 .proc_handler = &proc_nmi_enabled,
243 },
244 #endif
245 +#endif
246 #if defined(CONFIG_X86)
247 {
248 .ctl_name = KERN_PANIC_ON_NMI,