]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.31/patches.xen/xen3-patch-2.6.21
Add a patch to fix Intel E100 wake-on-lan problems.
[ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.xen / xen3-patch-2.6.21
CommitLineData
2cb7cef9
BS
1From: www.kernel.org
2Subject: Linux 2.6.21
3Patch-mainline: 2.6.21
4
5Automatically created from "patches.kernel.org/patch-2.6.21" by xen-port-patches.py
6
7Acked-by: jbeulich@novell.com
8
9--- sle11-2009-05-14.orig/arch/x86/Kconfig 2009-02-05 10:22:19.000000000 +0100
10+++ sle11-2009-05-14/arch/x86/Kconfig 2009-03-04 11:25:55.000000000 +0100
11@@ -50,13 +50,15 @@ config GENERIC_CMOS_UPDATE
12
13 config CLOCKSOURCE_WATCHDOG
14 def_bool y
15+ depends on !X86_XEN
16
17 config GENERIC_CLOCKEVENTS
18 def_bool y
19+ depends on !X86_XEN
20
21 config GENERIC_CLOCKEVENTS_BROADCAST
22 def_bool y
23- depends on X86_64 || (X86_32 && X86_LOCAL_APIC)
24+ depends on X86_64 || (X86_32 && X86_LOCAL_APIC && !X86_XEN)
25
26 config LOCKDEP_SUPPORT
27 def_bool y
28--- sle11-2009-05-14.orig/arch/x86/kernel/Makefile 2009-03-04 11:28:34.000000000 +0100
29+++ sle11-2009-05-14/arch/x86/kernel/Makefile 2009-03-04 11:25:55.000000000 +0100
30@@ -124,7 +124,7 @@ ifeq ($(CONFIG_X86_64),y)
31 pci-dma_64-$(CONFIG_XEN) += pci-dma_32.o
32 endif
33
34-disabled-obj-$(CONFIG_XEN) := early-quirks.o i8253.o i8259_$(BITS).o reboot.o \
35- smpboot_$(BITS).o tsc_$(BITS).o
36+disabled-obj-$(CONFIG_XEN) := early-quirks.o hpet.o i8253.o i8259_$(BITS).o reboot.o \
37+ smpboot_$(BITS).o tsc_$(BITS).o tsc_sync.o
38 disabled-obj-$(CONFIG_XEN_UNPRIVILEGED_GUEST) += mpparse_64.o
39 %/head_$(BITS).o %/head_$(BITS).s: $(if $(CONFIG_XEN),EXTRA_AFLAGS,dummy) :=
40--- sle11-2009-05-14.orig/arch/x86/kernel/apic_32-xen.c 2009-03-04 11:28:34.000000000 +0100
41+++ sle11-2009-05-14/arch/x86/kernel/apic_32-xen.c 2009-03-04 11:25:55.000000000 +0100
42@@ -25,6 +25,8 @@
43 #include <linux/kernel_stat.h>
44 #include <linux/sysdev.h>
45 #include <linux/cpu.h>
46+#include <linux/clockchips.h>
47+#include <linux/acpi_pmtmr.h>
48 #include <linux/module.h>
49
50 #include <asm/atomic.h>
51@@ -56,83 +58,26 @@ static cpumask_t timer_bcast_ipi;
52 */
53
54 /*
55- * Debug level
56+ * Debug level, exported for io_apic.c
57 */
58 int apic_verbosity;
59
60 #ifndef CONFIG_XEN
61 static int modern_apic(void)
62 {
63- unsigned int lvr, version;
64 /* AMD systems use old APIC versions, so check the CPU */
65 if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
66- boot_cpu_data.x86 >= 0xf)
67+ boot_cpu_data.x86 >= 0xf)
68 return 1;
69- lvr = apic_read(APIC_LVR);
70- version = GET_APIC_VERSION(lvr);
71- return version >= 0x14;
72+ return lapic_get_version() >= 0x14;
73 }
74 #endif /* !CONFIG_XEN */
75
76-/*
77- * 'what should we do if we get a hw irq event on an illegal vector'.
78- * each architecture has to answer this themselves.
79- */
80-void ack_bad_irq(unsigned int irq)
81-{
82- printk("unexpected IRQ trap at vector %02x\n", irq);
83- /*
84- * Currently unexpected vectors happen only on SMP and APIC.
85- * We _must_ ack these because every local APIC has only N
86- * irq slots per priority level, and a 'hanging, unacked' IRQ
87- * holds up an irq slot - in excessive cases (when multiple
88- * unexpected vectors occur) that might lock up the APIC
89- * completely.
90- * But only ack when the APIC is enabled -AK
91- */
92- if (cpu_has_apic)
93- ack_APIC_irq();
94-}
95-
96 int get_physical_broadcast(void)
97 {
98 return 0xff;
99 }
100
101-#ifndef CONFIG_XEN
102-#ifndef CONFIG_SMP
103-static void up_apic_timer_interrupt_call(void)
104-{
105- int cpu = smp_processor_id();
106-
107- /*
108- * the NMI deadlock-detector uses this.
109- */
110- per_cpu(irq_stat, cpu).apic_timer_irqs++;
111-
112- smp_local_timer_interrupt();
113-}
114-#endif
115-
116-void smp_send_timer_broadcast_ipi(void)
117-{
118- cpumask_t mask;
119-
120- cpus_and(mask, cpu_online_map, timer_bcast_ipi);
121- if (!cpus_empty(mask)) {
122-#ifdef CONFIG_SMP
123- send_IPI_mask(mask, LOCAL_TIMER_VECTOR);
124-#else
125- /*
126- * We can directly call the apic timer interrupt handler
127- * in UP case. Minus all irq related functions
128- */
129- up_apic_timer_interrupt_call();
130-#endif
131- }
132-}
133-#endif
134-
135 int setup_profiling_timer(unsigned int multiplier)
136 {
137 return -EINVAL;
138--- sle11-2009-05-14.orig/arch/x86/kernel/cpu/common-xen.c 2008-12-15 11:26:44.000000000 +0100
139+++ sle11-2009-05-14/arch/x86/kernel/cpu/common-xen.c 2009-03-04 11:25:55.000000000 +0100
140@@ -610,7 +610,7 @@ void __init early_cpu_init(void)
141 struct pt_regs * __devinit idle_regs(struct pt_regs *regs)
142 {
143 memset(regs, 0, sizeof(struct pt_regs));
144- regs->xgs = __KERNEL_PDA;
145+ regs->xfs = __KERNEL_PDA;
146 return regs;
147 }
148
149@@ -667,12 +667,12 @@ struct i386_pda boot_pda = {
150 .pcurrent = &init_task,
151 };
152
153-static inline void set_kernel_gs(void)
154+static inline void set_kernel_fs(void)
155 {
156- /* Set %gs for this CPU's PDA. Memory clobber is to create a
157+ /* Set %fs for this CPU's PDA. Memory clobber is to create a
158 barrier with respect to any PDA operations, so the compiler
159 doesn't move any before here. */
160- asm volatile ("mov %0, %%gs" : : "r" (__KERNEL_PDA) : "memory");
161+ asm volatile ("mov %0, %%fs" : : "r" (__KERNEL_PDA) : "memory");
162 }
163
164 /* Initialize the CPU's GDT and PDA. The boot CPU does this for
165@@ -730,7 +730,7 @@ void __cpuinit cpu_set_gdt(int cpu)
166 }
167 BUG_ON(HYPERVISOR_set_gdt(frames, (cpu_gdt_descr->size + 1) / 8));
168
169- set_kernel_gs();
170+ set_kernel_fs();
171 }
172
173 /* Common CPU init for both boot and secondary CPUs */
174@@ -775,8 +775,8 @@ static void __cpuinit _cpu_init(int cpu,
175 __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss);
176 #endif
177
178- /* Clear %fs. */
179- asm volatile ("mov %0, %%fs" : : "r" (0));
180+ /* Clear %gs. */
181+ asm volatile ("mov %0, %%gs" : : "r" (0));
182
183 /* Clear all 6 debug registers: */
184 set_debugreg(0, 0);
185--- sle11-2009-05-14.orig/arch/x86/kernel/e820_32-xen.c 2008-12-15 11:26:44.000000000 +0100
186+++ sle11-2009-05-14/arch/x86/kernel/e820_32-xen.c 2009-03-04 11:25:55.000000000 +0100
187@@ -14,6 +14,7 @@
188 #include <asm/pgtable.h>
189 #include <asm/page.h>
190 #include <asm/e820.h>
191+#include <asm/setup.h>
192 #include <xen/interface/memory.h>
193
194 #ifdef CONFIG_EFI
195@@ -157,21 +158,22 @@ static struct resource standard_io_resou
196 .flags = IORESOURCE_BUSY | IORESOURCE_IO
197 } };
198
199-static int romsignature(const unsigned char *x)
200+#define ROMSIGNATURE 0xaa55
201+
202+static int __init romsignature(const unsigned char *rom)
203 {
204 unsigned short sig;
205- int ret = 0;
206- if (probe_kernel_address((const unsigned short *)x, sig) == 0)
207- ret = (sig == 0xaa55);
208- return ret;
209+
210+ return probe_kernel_address((const unsigned short *)rom, sig) == 0 &&
211+ sig == ROMSIGNATURE;
212 }
213
214 static int __init romchecksum(unsigned char *rom, unsigned long length)
215 {
216- unsigned char *p, sum = 0;
217+ unsigned char sum;
218
219- for (p = rom; p < rom + length; p++)
220- sum += *p;
221+ for (sum = 0; length; length--)
222+ sum += *rom++;
223 return sum == 0;
224 }
225
226--- sle11-2009-05-14.orig/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:08:06.000000000 +0200
227+++ sle11-2009-05-14/arch/x86/kernel/entry_32-xen.S 2009-05-14 11:09:56.000000000 +0200
228@@ -30,7 +30,7 @@
229 * 18(%esp) - %eax
230 * 1C(%esp) - %ds
231 * 20(%esp) - %es
232- * 24(%esp) - %gs
233+ * 24(%esp) - %fs
234 * 28(%esp) - orig_eax
235 * 2C(%esp) - %eip
236 * 30(%esp) - %cs
237@@ -102,9 +102,9 @@ NMI_MASK = 0x80000000
238
239 #define SAVE_ALL \
240 cld; \
241- pushl %gs; \
242+ pushl %fs; \
243 CFI_ADJUST_CFA_OFFSET 4;\
244- /*CFI_REL_OFFSET gs, 0;*/\
245+ /*CFI_REL_OFFSET fs, 0;*/\
246 pushl %es; \
247 CFI_ADJUST_CFA_OFFSET 4;\
248 /*CFI_REL_OFFSET es, 0;*/\
249@@ -136,7 +136,7 @@ NMI_MASK = 0x80000000
250 movl %edx, %ds; \
251 movl %edx, %es; \
252 movl $(__KERNEL_PDA), %edx; \
253- movl %edx, %gs
254+ movl %edx, %fs
255
256 #define RESTORE_INT_REGS \
257 popl %ebx; \
258@@ -169,9 +169,9 @@ NMI_MASK = 0x80000000
259 2: popl %es; \
260 CFI_ADJUST_CFA_OFFSET -4;\
261 /*CFI_RESTORE es;*/\
262-3: popl %gs; \
263+3: popl %fs; \
264 CFI_ADJUST_CFA_OFFSET -4;\
265- /*CFI_RESTORE gs;*/\
266+ /*CFI_RESTORE fs;*/\
267 .pushsection .fixup,"ax"; \
268 4: movl $0,(%esp); \
269 jmp 1b; \
270@@ -230,6 +230,7 @@ ENTRY(ret_from_fork)
271 CFI_ADJUST_CFA_OFFSET -4
272 jmp syscall_exit
273 CFI_ENDPROC
274+END(ret_from_fork)
275
276 /*
277 * Return to user mode is not as complex as all this looks,
278@@ -261,6 +262,7 @@ ENTRY(resume_userspace)
279 # int/exception return?
280 jne work_pending
281 jmp restore_all
282+END(ret_from_exception)
283
284 #ifdef CONFIG_PREEMPT
285 ENTRY(resume_kernel)
286@@ -275,6 +277,7 @@ need_resched:
287 jz restore_all
288 call preempt_schedule_irq
289 jmp need_resched
290+END(resume_kernel)
291 #endif
292 CFI_ENDPROC
293
294@@ -352,16 +355,17 @@ sysenter_past_esp:
295 movl PT_OLDESP(%esp), %ecx
296 xorl %ebp,%ebp
297 TRACE_IRQS_ON
298-1: mov PT_GS(%esp), %gs
299+1: mov PT_FS(%esp), %fs
300 ENABLE_INTERRUPTS_SYSEXIT
301 CFI_ENDPROC
302 .pushsection .fixup,"ax"
303-2: movl $0,PT_GS(%esp)
304+2: movl $0,PT_FS(%esp)
305 jmp 1b
306 .section __ex_table,"a"
307 .align 4
308 .long 1b,2b
309 .popsection
310+ENDPROC(sysenter_entry)
311
312 # pv sysenter call handler stub
313 ENTRY(sysenter_entry_pv)
314@@ -533,6 +537,7 @@ hypervisor_iret:
315 jmp hypercall_page + (__HYPERVISOR_iret * 32)
316 #endif
317 CFI_ENDPROC
318+ENDPROC(system_call)
319
320 # perform work that needs to be done immediately before resumption
321 ALIGN
322@@ -578,6 +583,7 @@ work_notifysig_v86:
323 xorl %edx, %edx
324 call do_notify_resume
325 jmp resume_userspace_sig
326+END(work_pending)
327
328 # perform syscall exit tracing
329 ALIGN
330@@ -593,6 +599,7 @@ syscall_trace_entry:
331 cmpl $(nr_syscalls), %eax
332 jnae syscall_call
333 jmp syscall_exit
334+END(syscall_trace_entry)
335
336 # perform syscall exit tracing
337 ALIGN
338@@ -606,6 +613,7 @@ syscall_exit_work:
339 movl $1, %edx
340 call do_syscall_trace
341 jmp resume_userspace
342+END(syscall_exit_work)
343 CFI_ENDPROC
344
345 RING0_INT_FRAME # can't unwind into user space anyway
346@@ -616,16 +624,18 @@ syscall_fault:
347 GET_THREAD_INFO(%ebp)
348 movl $-EFAULT,PT_EAX(%esp)
349 jmp resume_userspace
350+END(syscall_fault)
351
352 syscall_badsys:
353 movl $-ENOSYS,PT_EAX(%esp)
354 jmp resume_userspace
355+END(syscall_badsys)
356 CFI_ENDPROC
357
358 #ifndef CONFIG_XEN
359 #define FIXUP_ESPFIX_STACK \
360 /* since we are on a wrong stack, we cant make it a C code :( */ \
361- movl %gs:PDA_cpu, %ebx; \
362+ movl %fs:PDA_cpu, %ebx; \
363 PER_CPU(cpu_gdt_descr, %ebx); \
364 movl GDS_address(%ebx), %ebx; \
365 GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah); \
366@@ -656,9 +666,9 @@ syscall_badsys:
367 ENTRY(interrupt)
368 .text
369
370-vector=0
371 ENTRY(irq_entries_start)
372 RING0_INT_FRAME
373+vector=0
374 .rept NR_IRQS
375 ALIGN
376 .if vector
377@@ -667,11 +677,16 @@ ENTRY(irq_entries_start)
378 1: pushl $~(vector)
379 CFI_ADJUST_CFA_OFFSET 4
380 jmp common_interrupt
381-.data
382+ .previous
383 .long 1b
384-.text
385+ .text
386 vector=vector+1
387 .endr
388+END(irq_entries_start)
389+
390+.previous
391+END(interrupt)
392+.previous
393
394 /*
395 * the CPU automatically disables interrupts when executing an IRQ vector,
396@@ -684,6 +699,7 @@ common_interrupt:
397 movl %esp,%eax
398 call do_IRQ
399 jmp ret_from_intr
400+ENDPROC(common_interrupt)
401 CFI_ENDPROC
402
403 #define BUILD_INTERRUPT(name, nr) \
404@@ -696,10 +712,16 @@ ENTRY(name) \
405 movl %esp,%eax; \
406 call smp_/**/name; \
407 jmp ret_from_intr; \
408- CFI_ENDPROC
409+ CFI_ENDPROC; \
410+ENDPROC(name)
411
412 /* The include is where all of the SMP etc. interrupts come from */
413 #include "entry_arch.h"
414+
415+/* This alternate entry is needed because we hijack the apic LVTT */
416+#if defined(CONFIG_VMI) && defined(CONFIG_X86_LOCAL_APIC)
417+BUILD_INTERRUPT(apic_vmi_timer_interrupt,LOCAL_TIMER_VECTOR)
418+#endif
419 #else
420 #define UNWIND_ESPFIX_STACK
421 #endif
422@@ -710,7 +732,7 @@ KPROBE_ENTRY(page_fault)
423 CFI_ADJUST_CFA_OFFSET 4
424 ALIGN
425 error_code:
426- /* the function address is in %gs's slot on the stack */
427+ /* the function address is in %fs's slot on the stack */
428 pushl %es
429 CFI_ADJUST_CFA_OFFSET 4
430 /*CFI_REL_OFFSET es, 0*/
431@@ -739,20 +761,20 @@ error_code:
432 CFI_ADJUST_CFA_OFFSET 4
433 CFI_REL_OFFSET ebx, 0
434 cld
435- pushl %gs
436+ pushl %fs
437 CFI_ADJUST_CFA_OFFSET 4
438- /*CFI_REL_OFFSET gs, 0*/
439+ /*CFI_REL_OFFSET fs, 0*/
440 movl $(__KERNEL_PDA), %ecx
441- movl %ecx, %gs
442+ movl %ecx, %fs
443 UNWIND_ESPFIX_STACK
444 popl %ecx
445 CFI_ADJUST_CFA_OFFSET -4
446 /*CFI_REGISTER es, ecx*/
447- movl PT_GS(%esp), %edi # get the function address
448+ movl PT_FS(%esp), %edi # get the function address
449 movl PT_ORIG_EAX(%esp), %edx # get the error code
450 movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart
451- mov %ecx, PT_GS(%esp)
452- /*CFI_REL_OFFSET gs, ES*/
453+ mov %ecx, PT_FS(%esp)
454+ /*CFI_REL_OFFSET fs, ES*/
455 movl $(__USER_DS), %ecx
456 movl %ecx, %ds
457 movl %ecx, %es
458@@ -844,7 +866,7 @@ critical_fixup_table:
459 .byte 6 # pop %eax
460 .byte 7 # pop %ds
461 .byte 8 # pop %es
462- .byte 9,9 # pop %gs
463+ .byte 9,9 # pop %fs
464 .byte 10,10,10 # add $4,%esp
465 .byte 11 # iret
466 .byte -1,-1,-1,-1 # movb $1,1(%esi) = __DISABLE_INTERRUPTS
467@@ -909,6 +931,7 @@ ENTRY(coprocessor_error)
468 CFI_ADJUST_CFA_OFFSET 4
469 jmp error_code
470 CFI_ENDPROC
471+END(coprocessor_error)
472
473 ENTRY(simd_coprocessor_error)
474 RING0_INT_FRAME
475@@ -918,6 +941,7 @@ ENTRY(simd_coprocessor_error)
476 CFI_ADJUST_CFA_OFFSET 4
477 jmp error_code
478 CFI_ENDPROC
479+END(simd_coprocessor_error)
480
481 ENTRY(device_not_available)
482 RING0_INT_FRAME
483@@ -940,6 +964,7 @@ device_available_emulate:
484 call math_state_restore
485 jmp ret_from_exception
486 CFI_ENDPROC
487+END(device_not_available)
488
489 #ifndef CONFIG_XEN
490 /*
491@@ -1101,10 +1126,12 @@ ENTRY(native_iret)
492 .align 4
493 .long 1b,iret_exc
494 .previous
495+END(native_iret)
496
497 ENTRY(native_irq_enable_sysexit)
498 sti
499 sysexit
500+END(native_irq_enable_sysexit)
501 #endif
502
503 KPROBE_ENTRY(int3)
504@@ -1127,6 +1154,7 @@ ENTRY(overflow)
505 CFI_ADJUST_CFA_OFFSET 4
506 jmp error_code
507 CFI_ENDPROC
508+END(overflow)
509
510 ENTRY(bounds)
511 RING0_INT_FRAME
512@@ -1136,6 +1164,7 @@ ENTRY(bounds)
513 CFI_ADJUST_CFA_OFFSET 4
514 jmp error_code
515 CFI_ENDPROC
516+END(bounds)
517
518 ENTRY(invalid_op)
519 RING0_INT_FRAME
520@@ -1145,6 +1174,7 @@ ENTRY(invalid_op)
521 CFI_ADJUST_CFA_OFFSET 4
522 jmp error_code
523 CFI_ENDPROC
524+END(invalid_op)
525
526 ENTRY(coprocessor_segment_overrun)
527 RING0_INT_FRAME
528@@ -1154,6 +1184,7 @@ ENTRY(coprocessor_segment_overrun)
529 CFI_ADJUST_CFA_OFFSET 4
530 jmp error_code
531 CFI_ENDPROC
532+END(coprocessor_segment_overrun)
533
534 ENTRY(invalid_TSS)
535 RING0_EC_FRAME
536@@ -1161,6 +1192,7 @@ ENTRY(invalid_TSS)
537 CFI_ADJUST_CFA_OFFSET 4
538 jmp error_code
539 CFI_ENDPROC
540+END(invalid_TSS)
541
542 ENTRY(segment_not_present)
543 RING0_EC_FRAME
544@@ -1168,6 +1200,7 @@ ENTRY(segment_not_present)
545 CFI_ADJUST_CFA_OFFSET 4
546 jmp error_code
547 CFI_ENDPROC
548+END(segment_not_present)
549
550 ENTRY(stack_segment)
551 RING0_EC_FRAME
552@@ -1175,6 +1208,7 @@ ENTRY(stack_segment)
553 CFI_ADJUST_CFA_OFFSET 4
554 jmp error_code
555 CFI_ENDPROC
556+END(stack_segment)
557
558 KPROBE_ENTRY(general_protection)
559 RING0_EC_FRAME
560@@ -1190,6 +1224,7 @@ ENTRY(alignment_check)
561 CFI_ADJUST_CFA_OFFSET 4
562 jmp error_code
563 CFI_ENDPROC
564+END(alignment_check)
565
566 ENTRY(divide_error)
567 RING0_INT_FRAME
568@@ -1199,6 +1234,7 @@ ENTRY(divide_error)
569 CFI_ADJUST_CFA_OFFSET 4
570 jmp error_code
571 CFI_ENDPROC
572+END(divide_error)
573
574 #ifdef CONFIG_X86_MCE
575 ENTRY(machine_check)
576@@ -1209,6 +1245,7 @@ ENTRY(machine_check)
577 CFI_ADJUST_CFA_OFFSET 4
578 jmp error_code
579 CFI_ENDPROC
580+END(machine_check)
581 #endif
582
583 #ifndef CONFIG_XEN
584@@ -1228,6 +1265,7 @@ ENTRY(fixup_4gb_segment)
585 CFI_ADJUST_CFA_OFFSET 4
586 jmp error_code
587 CFI_ENDPROC
588+END(spurious_interrupt_bug)
589
590 ENTRY(kernel_thread_helper)
591 pushl $0 # fake return address for unwinder
592--- sle11-2009-05-14.orig/arch/x86/kernel/head_32-xen.S 2008-12-15 11:26:44.000000000 +0100
593+++ sle11-2009-05-14/arch/x86/kernel/head_32-xen.S 2009-03-04 11:25:55.000000000 +0100
594@@ -27,6 +27,7 @@
595 #define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability
596 #define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id
597
598+.section .text.head,"ax",@progbits
599 #define VIRT_ENTRY_OFFSET 0x0
600 .org VIRT_ENTRY_OFFSET
601 ENTRY(startup_32)
602@@ -60,11 +61,11 @@ ENTRY(startup_32)
603
604 movb $1,X86_HARD_MATH
605
606- xorl %eax,%eax # Clear FS
607- movl %eax,%fs
608+ xorl %eax,%eax # Clear GS
609+ movl %eax,%gs
610
611 movl $(__KERNEL_PDA),%eax
612- mov %eax,%gs
613+ mov %eax,%fs
614
615 cld # gcc2 wants the direction flag cleared at all times
616
617@@ -75,7 +76,7 @@ ENTRY(startup_32)
618 * Point the GDT at this CPU's PDA. This will be
619 * cpu_gdt_table and boot_pda.
620 */
621-setup_pda:
622+ENTRY(setup_pda)
623 /* get the PDA pointer */
624 movl $boot_pda, %eax
625
626--- sle11-2009-05-14.orig/arch/x86/kernel/io_apic_32-xen.c 2008-12-15 11:26:44.000000000 +0100
627+++ sle11-2009-05-14/arch/x86/kernel/io_apic_32-xen.c 2009-03-04 11:25:55.000000000 +0100
628@@ -167,7 +167,7 @@ static inline void io_apic_write(unsigne
629 */
630 static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
631 {
632- volatile struct io_apic *io_apic = io_apic_base(apic);
633+ volatile struct io_apic __iomem *io_apic = io_apic_base(apic);
634 if (sis_apic_bug)
635 writel(reg, &io_apic->index);
636 writel(value, &io_apic->data);
637@@ -392,7 +392,7 @@ static void set_ioapic_affinity_irq(unsi
638 break;
639 entry = irq_2_pin + entry->next;
640 }
641- set_native_irq_info(irq, cpumask);
642+ irq_desc[irq].affinity = cpumask;
643 spin_unlock_irqrestore(&ioapic_lock, flags);
644 }
645
646@@ -531,8 +531,8 @@ static void do_irq_balance(void)
647 package_index = CPU_TO_PACKAGEINDEX(i);
648 for (j = 0; j < NR_IRQS; j++) {
649 unsigned long value_now, delta;
650- /* Is this an active IRQ? */
651- if (!irq_desc[j].action)
652+ /* Is this an active IRQ or balancing disabled ? */
653+ if (!irq_desc[j].action || irq_balancing_disabled(j))
654 continue;
655 if ( package_index == i )
656 IRQ_DELTA(package_index,j) = 0;
657@@ -785,7 +785,7 @@ failed:
658 return 0;
659 }
660
661-int __init irqbalance_disable(char *str)
662+int __devinit irqbalance_disable(char *str)
663 {
664 irqbalance_disabled = 1;
665 return 1;
666@@ -1329,11 +1329,9 @@ static void ioapic_register_intr(int irq
667 trigger == IOAPIC_LEVEL)
668 set_irq_chip_and_handler_name(irq, &ioapic_chip,
669 handle_fasteoi_irq, "fasteoi");
670- else {
671- irq_desc[irq].status |= IRQ_DELAYED_DISABLE;
672+ else
673 set_irq_chip_and_handler_name(irq, &ioapic_chip,
674 handle_edge_irq, "edge");
675- }
676 set_intr_gate(vector, interrupt[irq]);
677 }
678 #else
679@@ -1407,7 +1405,6 @@ static void __init setup_IO_APIC_irqs(vo
680 }
681 spin_lock_irqsave(&ioapic_lock, flags);
682 __ioapic_write_entry(apic, pin, entry);
683- set_native_irq_info(irq, TARGET_CPUS);
684 spin_unlock_irqrestore(&ioapic_lock, flags);
685 }
686 }
687@@ -1638,7 +1635,7 @@ void /*__init*/ print_local_APIC(void *
688 v = apic_read(APIC_LVR);
689 printk(KERN_INFO "... APIC VERSION: %08x\n", v);
690 ver = GET_APIC_VERSION(v);
691- maxlvt = get_maxlvt();
692+ maxlvt = lapic_get_maxlvt();
693
694 v = apic_read(APIC_TASKPRI);
695 printk(KERN_DEBUG "... APIC TASKPRI: %08x (%02x)\n", v, v & APIC_TPRI_MASK);
696@@ -1976,7 +1973,7 @@ static void __init setup_ioapic_ids_from
697 #endif
698
699 #ifndef CONFIG_XEN
700-static int no_timer_check __initdata;
701+int no_timer_check __initdata;
702
703 static int __init notimercheck(char *s)
704 {
705@@ -2369,7 +2366,7 @@ static inline void __init check_timer(vo
706
707 disable_8259A_irq(0);
708 set_irq_chip_and_handler_name(0, &lapic_chip, handle_fasteoi_irq,
709- "fasteio");
710+ "fasteoi");
711 apic_write_around(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */
712 enable_8259A_irq(0);
713
714@@ -2662,7 +2659,7 @@ static void set_msi_irq_affinity(unsigne
715 msg.address_lo |= MSI_ADDR_DEST_ID(dest);
716
717 write_msi_msg(irq, &msg);
718- set_native_irq_info(irq, mask);
719+ irq_desc[irq].affinity = mask;
720 }
721 #endif /* CONFIG_SMP */
722
723@@ -2681,25 +2678,32 @@ static struct irq_chip msi_chip = {
724 .retrigger = ioapic_retrigger_irq,
725 };
726
727-int arch_setup_msi_irq(unsigned int irq, struct pci_dev *dev)
728+int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
729 {
730 struct msi_msg msg;
731- int ret;
732+ int irq, ret;
733+ irq = create_irq();
734+ if (irq < 0)
735+ return irq;
736+
737+ set_irq_msi(irq, desc);
738 ret = msi_compose_msg(dev, irq, &msg);
739- if (ret < 0)
740+ if (ret < 0) {
741+ destroy_irq(irq);
742 return ret;
743+ }
744
745 write_msi_msg(irq, &msg);
746
747 set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq,
748 "edge");
749
750- return 0;
751+ return irq;
752 }
753
754 void arch_teardown_msi_irq(unsigned int irq)
755 {
756- return;
757+ destroy_irq(irq);
758 }
759
760 #endif /* CONFIG_PCI_MSI */
761@@ -2739,7 +2743,7 @@ static void set_ht_irq_affinity(unsigned
762 dest = cpu_mask_to_apicid(mask);
763
764 target_ht_irq(irq, dest);
765- set_native_irq_info(irq, mask);
766+ irq_desc[irq].affinity = mask;
767 }
768 #endif
769
770@@ -2947,7 +2951,6 @@ int io_apic_set_pci_routing (int ioapic,
771
772 spin_lock_irqsave(&ioapic_lock, flags);
773 __ioapic_write_entry(ioapic, pin, entry);
774- set_native_irq_info(irq, TARGET_CPUS);
775 spin_unlock_irqrestore(&ioapic_lock, flags);
776
777 return 0;
778--- sle11-2009-05-14.orig/arch/x86/kernel/irq_32-xen.c 2009-03-04 11:28:34.000000000 +0100
779+++ sle11-2009-05-14/arch/x86/kernel/irq_32-xen.c 2009-03-04 11:25:55.000000000 +0100
780@@ -10,7 +10,6 @@
781 * io_apic.c.)
782 */
783
784-#include <asm/uaccess.h>
785 #include <linux/module.h>
786 #include <linux/seq_file.h>
787 #include <linux/interrupt.h>
788@@ -19,19 +18,34 @@
789 #include <linux/cpu.h>
790 #include <linux/delay.h>
791
792+#include <asm/apic.h>
793+#include <asm/uaccess.h>
794+
795 DEFINE_PER_CPU(irq_cpustat_t, irq_stat) ____cacheline_internodealigned_in_smp;
796 EXPORT_PER_CPU_SYMBOL(irq_stat);
797
798-#ifndef CONFIG_X86_LOCAL_APIC
799 /*
800 * 'what should we do if we get a hw irq event on an illegal vector'.
801 * each architecture has to answer this themselves.
802 */
803 void ack_bad_irq(unsigned int irq)
804 {
805- printk("unexpected IRQ trap at vector %02x\n", irq);
806-}
807+ printk(KERN_ERR "unexpected IRQ trap at vector %02x\n", irq);
808+
809+#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_XEN)
810+ /*
811+ * Currently unexpected vectors happen only on SMP and APIC.
812+ * We _must_ ack these because every local APIC has only N
813+ * irq slots per priority level, and a 'hanging, unacked' IRQ
814+ * holds up an irq slot - in excessive cases (when multiple
815+ * unexpected vectors occur) that might lock up the APIC
816+ * completely.
817+ * But only ack when the APIC is enabled -AK
818+ */
819+ if (cpu_has_apic)
820+ ack_APIC_irq();
821 #endif
822+}
823
824 #ifdef CONFIG_4KSTACKS
825 /*
826--- sle11-2009-05-14.orig/arch/x86/kernel/microcode-xen.c 2008-12-15 11:26:44.000000000 +0100
827+++ sle11-2009-05-14/arch/x86/kernel/microcode-xen.c 2009-03-04 11:25:55.000000000 +0100
828@@ -108,7 +108,7 @@ static ssize_t microcode_write (struct f
829 return ret;
830 }
831
832-static struct file_operations microcode_fops = {
833+static const struct file_operations microcode_fops = {
834 .owner = THIS_MODULE,
835 .write = microcode_write,
836 .open = microcode_open,
837--- sle11-2009-05-14.orig/arch/x86/kernel/mpparse_32-xen.c 2008-12-15 11:26:44.000000000 +0100
838+++ sle11-2009-05-14/arch/x86/kernel/mpparse_32-xen.c 2009-03-04 11:25:55.000000000 +0100
839@@ -1079,7 +1079,7 @@ int mp_register_gsi(u32 gsi, int trigger
840 static int gsi_to_irq[MAX_GSI_NUM];
841
842 /* Don't set up the ACPI SCI because it's already set up */
843- if (acpi_fadt.sci_int == gsi)
844+ if (acpi_gbl_FADT.sci_interrupt == gsi)
845 return gsi;
846
847 ioapic = mp_find_ioapic(gsi);
848@@ -1136,7 +1136,7 @@ int mp_register_gsi(u32 gsi, int trigger
849 /*
850 * Don't assign IRQ used by ACPI SCI
851 */
852- if (gsi == acpi_fadt.sci_int)
853+ if (gsi == acpi_gbl_FADT.sci_interrupt)
854 gsi = pci_irq++;
855 gsi_to_irq[irq] = gsi;
856 } else {
857--- sle11-2009-05-14.orig/arch/x86/kernel/pci-dma-xen.c 2008-12-15 11:26:44.000000000 +0100
858+++ sle11-2009-05-14/arch/x86/kernel/pci-dma-xen.c 2009-03-04 11:25:55.000000000 +0100
859@@ -311,7 +311,7 @@ int dma_declare_coherent_memory(struct d
860 return DMA_MEMORY_IO;
861
862 free1_out:
863- kfree(dev->dma_mem->bitmap);
864+ kfree(dev->dma_mem);
865 out:
866 if (mem_base)
867 iounmap(mem_base);
868--- sle11-2009-05-14.orig/arch/x86/kernel/pcspeaker.c 2009-05-14 10:56:29.000000000 +0200
869+++ sle11-2009-05-14/arch/x86/kernel/pcspeaker.c 2009-03-04 11:25:55.000000000 +0100
870@@ -7,6 +7,11 @@ static __init int add_pcspkr(void)
871 struct platform_device *pd;
872 int ret;
873
874+#ifdef CONFIG_XEN
875+ if (!is_initial_xendomain())
876+ return 0;
877+#endif
878+
879 pd = platform_device_alloc("pcspkr", -1);
880 if (!pd)
881 return -ENOMEM;
882--- sle11-2009-05-14.orig/arch/x86/kernel/process_32-xen.c 2008-12-15 11:26:44.000000000 +0100
883+++ sle11-2009-05-14/arch/x86/kernel/process_32-xen.c 2009-03-04 11:25:55.000000000 +0100
884@@ -38,6 +38,7 @@
885 #include <linux/ptrace.h>
886 #include <linux/random.h>
887 #include <linux/personality.h>
888+#include <linux/tick.h>
889
890 #include <asm/uaccess.h>
891 #include <asm/pgtable.h>
892@@ -160,6 +161,7 @@ void cpu_idle(void)
893
894 /* endless idle loop with no priority at all */
895 while (1) {
896+ tick_nohz_stop_sched_tick();
897 while (!need_resched()) {
898 void (*idle)(void);
899
900@@ -175,6 +177,7 @@ void cpu_idle(void)
901 __get_cpu_var(irq_stat).idle_timestamp = jiffies;
902 idle();
903 }
904+ tick_nohz_restart_sched_tick();
905 preempt_enable_no_resched();
906 schedule();
907 preempt_disable();
908@@ -247,8 +250,8 @@ void show_regs(struct pt_regs * regs)
909 regs->eax,regs->ebx,regs->ecx,regs->edx);
910 printk("ESI: %08lx EDI: %08lx EBP: %08lx",
911 regs->esi, regs->edi, regs->ebp);
912- printk(" DS: %04x ES: %04x GS: %04x\n",
913- 0xffff & regs->xds,0xffff & regs->xes, 0xffff & regs->xgs);
914+ printk(" DS: %04x ES: %04x FS: %04x\n",
915+ 0xffff & regs->xds,0xffff & regs->xes, 0xffff & regs->xfs);
916
917 cr0 = read_cr0();
918 cr2 = read_cr2();
919@@ -279,7 +282,7 @@ int kernel_thread(int (*fn)(void *), voi
920
921 regs.xds = __USER_DS;
922 regs.xes = __USER_DS;
923- regs.xgs = __KERNEL_PDA;
924+ regs.xfs = __KERNEL_PDA;
925 regs.orig_eax = -1;
926 regs.eip = (unsigned long) kernel_thread_helper;
927 regs.xcs = __KERNEL_CS | get_kernel_rpl();
928@@ -356,7 +359,7 @@ int copy_thread(int nr, unsigned long cl
929
930 p->thread.eip = (unsigned long) ret_from_fork;
931
932- savesegment(fs,p->thread.fs);
933+ savesegment(gs,p->thread.gs);
934
935 tsk = current;
936 if (unlikely(test_tsk_thread_flag(tsk, TIF_IO_BITMAP))) {
937@@ -434,8 +437,8 @@ void dump_thread(struct pt_regs * regs,
938 dump->regs.eax = regs->eax;
939 dump->regs.ds = regs->xds;
940 dump->regs.es = regs->xes;
941- savesegment(fs,dump->regs.fs);
942- dump->regs.gs = regs->xgs;
943+ dump->regs.fs = regs->xfs;
944+ savesegment(gs,dump->regs.gs);
945 dump->regs.orig_eax = regs->orig_eax;
946 dump->regs.eip = regs->eip;
947 dump->regs.cs = regs->xcs;
948@@ -637,16 +640,6 @@ struct task_struct fastcall * __switch_t
949 prefetch(&next->i387.fxsave);
950
951 /*
952- * Restore %fs if needed.
953- *
954- * Glibc normally makes %fs be zero.
955- */
956- if (unlikely(next->fs))
957- loadsegment(fs, next->fs);
958-
959- write_pda(pcurrent, next_p);
960-
961- /*
962 * Now maybe handle debug registers
963 */
964 if (unlikely(task_thread_info(next_p)->flags & _TIF_WORK_CTXSW))
965@@ -654,6 +647,15 @@ struct task_struct fastcall * __switch_t
966
967 disable_tsc(prev_p, next_p);
968
969+ /*
970+ * Leave lazy mode, flushing any hypercalls made here.
971+ * This must be done before restoring TLS segments so
972+ * the GDT and LDT are properly updated, and must be
973+ * done before math_state_restore, so the TS bit is up
974+ * to date.
975+ */
976+ arch_leave_lazy_cpu_mode();
977+
978 /* If the task has used fpu the last 5 timeslices, just do a full
979 * restore of the math state immediately to avoid the trap; the
980 * chances of needing FPU soon are obviously high now
981@@ -661,6 +663,14 @@ struct task_struct fastcall * __switch_t
982 if (next_p->fpu_counter > 5)
983 math_state_restore();
984
985+ /*
986+ * Restore %gs if needed (which is common)
987+ */
988+ if (prev->gs | next->gs)
989+ loadsegment(gs, next->gs);
990+
991+ write_pda(pcurrent, next_p);
992+
993 return prev_p;
994 }
995
996--- sle11-2009-05-14.orig/arch/x86/kernel/setup_32-xen.c 2008-12-15 11:26:44.000000000 +0100
997+++ sle11-2009-05-14/arch/x86/kernel/setup_32-xen.c 2009-03-04 11:25:55.000000000 +0100
998@@ -33,7 +33,6 @@
999 #include <linux/initrd.h>
1000 #include <linux/bootmem.h>
1001 #include <linux/seq_file.h>
1002-#include <linux/platform_device.h>
1003 #include <linux/console.h>
1004 #include <linux/mca.h>
1005 #include <linux/root_dev.h>
1006@@ -148,7 +147,7 @@ unsigned long saved_videomode;
1007 #define RAMDISK_PROMPT_FLAG 0x8000
1008 #define RAMDISK_LOAD_FLAG 0x4000
1009
1010-static char command_line[COMMAND_LINE_SIZE];
1011+static char __initdata command_line[COMMAND_LINE_SIZE];
1012
1013 unsigned char __initdata boot_params[PARAM_SIZE];
1014
1015@@ -647,8 +646,8 @@ void __init setup_arch(char **cmdline_p)
1016
1017 if ((i = MAX_GUEST_CMDLINE) > COMMAND_LINE_SIZE)
1018 i = COMMAND_LINE_SIZE;
1019- memcpy(saved_command_line, xen_start_info->cmd_line, i);
1020- saved_command_line[i - 1] = '\0';
1021+ memcpy(boot_command_line, xen_start_info->cmd_line, i);
1022+ boot_command_line[i - 1] = '\0';
1023 parse_early_param();
1024
1025 if (user_defined_memmap) {
1026@@ -656,11 +655,19 @@ void __init setup_arch(char **cmdline_p)
1027 print_memory_map("user");
1028 }
1029
1030- strlcpy(command_line, saved_command_line, COMMAND_LINE_SIZE);
1031+ strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
1032 *cmdline_p = command_line;
1033
1034 max_low_pfn = setup_memory();
1035
1036+#ifdef CONFIG_VMI
1037+ /*
1038+ * Must be after max_low_pfn is determined, and before kernel
1039+ * pagetables are setup.
1040+ */
1041+ vmi_init();
1042+#endif
1043+
1044 /*
1045 * NOTE: before this point _nobody_ is allowed to allocate
1046 * any memory using the bootmem allocator. Although the
1047@@ -823,7 +830,6 @@ void __init setup_arch(char **cmdline_p)
1048 conswitchp = &dummy_con;
1049 #endif
1050 }
1051- tsc_init();
1052 }
1053
1054 static int
1055@@ -833,31 +839,3 @@ xen_panic_event(struct notifier_block *t
1056 /* we're never actually going to get here... */
1057 return NOTIFY_DONE;
1058 }
1059-
1060-static __init int add_pcspkr(void)
1061-{
1062- struct platform_device *pd;
1063- int ret;
1064-
1065- if (!is_initial_xendomain())
1066- return 0;
1067-
1068- pd = platform_device_alloc("pcspkr", -1);
1069- if (!pd)
1070- return -ENOMEM;
1071-
1072- ret = platform_device_add(pd);
1073- if (ret)
1074- platform_device_put(pd);
1075-
1076- return ret;
1077-}
1078-device_initcall(add_pcspkr);
1079-
1080-/*
1081- * Local Variables:
1082- * mode:c
1083- * c-file-style:"k&r"
1084- * c-basic-offset:8
1085- * End:
1086- */
1087--- sle11-2009-05-14.orig/arch/x86/kernel/smp_32-xen.c 2008-12-15 11:26:44.000000000 +0100
1088+++ sle11-2009-05-14/arch/x86/kernel/smp_32-xen.c 2009-03-04 11:25:55.000000000 +0100
1089@@ -335,8 +335,7 @@ static void flush_tlb_others(cpumask_t c
1090 /*
1091 * i'm not happy about this global shared spinlock in the
1092 * MM hot path, but we'll see how contended it is.
1093- * Temporarily this turns IRQs off, so that lockups are
1094- * detected by the NMI watchdog.
1095+ * AK: x86-64 has a faster method that could be ported.
1096 */
1097 spin_lock(&tlbstate_lock);
1098
1099@@ -361,7 +360,7 @@ static void flush_tlb_others(cpumask_t c
1100
1101 while (!cpus_empty(flush_cpumask))
1102 /* nothing. lockup detection does not belong here */
1103- mb();
1104+ cpu_relax();
1105
1106 flush_mm = NULL;
1107 flush_va = 0;
1108--- sle11-2009-05-14.orig/arch/x86/kernel/time_32-xen.c 2009-03-24 10:08:30.000000000 +0100
1109+++ sle11-2009-05-14/arch/x86/kernel/time_32-xen.c 2009-03-24 10:11:08.000000000 +0100
1110@@ -51,6 +51,7 @@
1111 #include <linux/kernel_stat.h>
1112 #include <linux/posix-timers.h>
1113 #include <linux/cpufreq.h>
1114+#include <linux/clocksource.h>
1115
1116 #include <asm/io.h>
1117 #include <asm/smp.h>
1118@@ -75,25 +76,17 @@
1119 #include <xen/evtchn.h>
1120 #include <xen/interface/vcpu.h>
1121
1122-#if defined (__i386__)
1123-#include <asm/i8259.h>
1124+#ifdef CONFIG_X86_32
1125 #include <asm/i8253.h>
1126 DEFINE_SPINLOCK(i8253_lock);
1127 EXPORT_SYMBOL(i8253_lock);
1128-#endif
1129-
1130-#define XEN_SHIFT 22
1131-
1132 int pit_latch_buggy; /* extern */
1133-
1134-#if defined(__x86_64__)
1135-unsigned long vxtime_hz = PIT_TICK_RATE;
1136-struct vxtime_data __vxtime __section_vxtime; /* for vsyscalls */
1137+#else
1138 volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES;
1139-struct timespec __xtime __section_xtime;
1140-struct timezone __sys_tz __section_sys_tz;
1141 #endif
1142
1143+#define XEN_SHIFT 22
1144+
1145 unsigned int cpu_khz; /* Detected as we calibrate the TSC */
1146 EXPORT_SYMBOL(cpu_khz);
1147
1148@@ -113,9 +106,6 @@ static DEFINE_PER_CPU(struct shadow_time
1149 static struct timespec shadow_tv;
1150 static u32 shadow_tv_version;
1151
1152-static struct timeval monotonic_tv;
1153-static spinlock_t monotonic_lock = SPIN_LOCK_UNLOCKED;
1154-
1155 /* Keep track of last time we did processing/updating of jiffies and xtime. */
1156 static u64 processed_system_time; /* System time (ns) at last processing. */
1157 static DEFINE_PER_CPU(u64, processed_system_time);
1158@@ -228,7 +218,7 @@ static inline u64 scale_delta(u64 delta,
1159 return product;
1160 }
1161
1162-void init_cpu_khz(void)
1163+static void init_cpu_khz(void)
1164 {
1165 u64 __cpu_khz = 1000000ULL << 32;
1166 struct vcpu_time_info *info = &vcpu_info(0)->time;
1167@@ -247,16 +237,6 @@ static u64 get_nsec_offset(struct shadow
1168 return scale_delta(delta, shadow->tsc_to_nsec_mul, shadow->tsc_shift);
1169 }
1170
1171-#ifdef CONFIG_X86_64
1172-static unsigned long get_usec_offset(struct shadow_time_info *shadow)
1173-{
1174- u64 now, delta;
1175- rdtscll(now);
1176- delta = now - shadow->tsc_timestamp;
1177- return scale_delta(delta, shadow->tsc_to_usec_mul, shadow->tsc_shift);
1178-}
1179-#endif
1180-
1181 static void __update_wallclock(time_t sec, long nsec)
1182 {
1183 long wtm_nsec, xtime_nsec;
1184@@ -369,139 +349,6 @@ void rtc_cmos_write(unsigned char val, u
1185 }
1186 EXPORT_SYMBOL(rtc_cmos_write);
1187
1188-#ifdef CONFIG_X86_64
1189-
1190-/*
1191- * This version of gettimeofday has microsecond resolution
1192- * and better than microsecond precision on fast x86 machines with TSC.
1193- */
1194-void do_gettimeofday(struct timeval *tv)
1195-{
1196- unsigned long seq;
1197- unsigned long usec, sec;
1198- unsigned long flags;
1199- s64 nsec;
1200- unsigned int cpu;
1201- struct shadow_time_info *shadow;
1202- u32 local_time_version;
1203-
1204- cpu = get_cpu();
1205- shadow = &per_cpu(shadow_time, cpu);
1206-
1207- do {
1208- local_time_version = shadow->version;
1209- seq = read_seqbegin(&xtime_lock);
1210-
1211- usec = get_usec_offset(shadow);
1212-
1213- sec = xtime.tv_sec;
1214- usec += (xtime.tv_nsec / NSEC_PER_USEC);
1215-
1216- nsec = shadow->system_timestamp - processed_system_time;
1217- __normalize_time(&sec, &nsec);
1218- usec += (long)nsec / NSEC_PER_USEC;
1219-
1220- if (unlikely(!time_values_up_to_date(cpu))) {
1221- /*
1222- * We may have blocked for a long time,
1223- * rendering our calculations invalid
1224- * (e.g. the time delta may have
1225- * overflowed). Detect that and recalculate
1226- * with fresh values.
1227- */
1228- get_time_values_from_xen(cpu);
1229- continue;
1230- }
1231- } while (read_seqretry(&xtime_lock, seq) ||
1232- (local_time_version != shadow->version));
1233-
1234- put_cpu();
1235-
1236- while (usec >= USEC_PER_SEC) {
1237- usec -= USEC_PER_SEC;
1238- sec++;
1239- }
1240-
1241- spin_lock_irqsave(&monotonic_lock, flags);
1242- if ((sec > monotonic_tv.tv_sec) ||
1243- ((sec == monotonic_tv.tv_sec) && (usec > monotonic_tv.tv_usec)))
1244- {
1245- monotonic_tv.tv_sec = sec;
1246- monotonic_tv.tv_usec = usec;
1247- } else {
1248- sec = monotonic_tv.tv_sec;
1249- usec = monotonic_tv.tv_usec;
1250- }
1251- spin_unlock_irqrestore(&monotonic_lock, flags);
1252-
1253- tv->tv_sec = sec;
1254- tv->tv_usec = usec;
1255-}
1256-
1257-EXPORT_SYMBOL(do_gettimeofday);
1258-
1259-int do_settimeofday(struct timespec *tv)
1260-{
1261- time_t sec;
1262- s64 nsec;
1263- unsigned int cpu;
1264- struct shadow_time_info *shadow;
1265- struct xen_platform_op op;
1266-
1267- if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
1268- return -EINVAL;
1269-
1270- cpu = get_cpu();
1271- shadow = &per_cpu(shadow_time, cpu);
1272-
1273- write_seqlock_irq(&xtime_lock);
1274-
1275- /*
1276- * Ensure we don't get blocked for a long time so that our time delta
1277- * overflows. If that were to happen then our shadow time values would
1278- * be stale, so we can retry with fresh ones.
1279- */
1280- for (;;) {
1281- nsec = tv->tv_nsec - get_nsec_offset(shadow);
1282- if (time_values_up_to_date(cpu))
1283- break;
1284- get_time_values_from_xen(cpu);
1285- }
1286- sec = tv->tv_sec;
1287- __normalize_time(&sec, &nsec);
1288-
1289- if (is_initial_xendomain() && !independent_wallclock) {
1290- op.cmd = XENPF_settime;
1291- op.u.settime.secs = sec;
1292- op.u.settime.nsecs = nsec;
1293- op.u.settime.system_time = shadow->system_timestamp;
1294- WARN_ON(HYPERVISOR_platform_op(&op));
1295- update_wallclock();
1296- } else if (independent_wallclock) {
1297- nsec -= shadow->system_timestamp;
1298- __normalize_time(&sec, &nsec);
1299- __update_wallclock(sec, nsec);
1300- }
1301- ntp_clear();
1302-
1303- /* Reset monotonic gettimeofday() timeval. */
1304- spin_lock(&monotonic_lock);
1305- monotonic_tv.tv_sec = 0;
1306- monotonic_tv.tv_usec = 0;
1307- spin_unlock(&monotonic_lock);
1308-
1309- write_sequnlock_irq(&xtime_lock);
1310-
1311- put_cpu();
1312-
1313- clock_was_set();
1314- return 0;
1315-}
1316-
1317-EXPORT_SYMBOL(do_settimeofday);
1318-
1319-#endif
1320-
1321 static void sync_xen_wallclock(unsigned long dummy);
1322 static DEFINE_TIMER(sync_xen_wallclock_timer, sync_xen_wallclock, 0, 0);
1323 static void sync_xen_wallclock(unsigned long dummy)
1324@@ -550,15 +397,7 @@ static int set_rtc_mmss(unsigned long no
1325 return retval;
1326 }
1327
1328-#ifdef CONFIG_X86_64
1329-/* monotonic_clock(): returns # of nanoseconds passed since time_init()
1330- * Note: This function is required to return accurate
1331- * time even in the absence of multiple timer ticks.
1332- */
1333-unsigned long long monotonic_clock(void)
1334-#else
1335 unsigned long long sched_clock(void)
1336-#endif
1337 {
1338 unsigned int cpu = get_cpu();
1339 struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
1340@@ -578,21 +417,18 @@ unsigned long long sched_clock(void)
1341
1342 return time;
1343 }
1344-#ifdef CONFIG_X86_64
1345-EXPORT_SYMBOL(monotonic_clock);
1346-
1347-unsigned long long sched_clock(void)
1348-{
1349- return monotonic_clock();
1350-}
1351-#endif
1352
1353 unsigned long profile_pc(struct pt_regs *regs)
1354 {
1355 unsigned long pc = instruction_pointer(regs);
1356
1357 #if defined(CONFIG_SMP) || defined(__x86_64__)
1358- if (!user_mode_vm(regs) && in_lock_functions(pc)) {
1359+# ifdef __i386__
1360+ if (!v8086_mode(regs) && SEGMENT_IS_KERNEL_CODE(regs->xcs)
1361+# else
1362+ if (!user_mode(regs)
1363+# endif
1364+ && in_lock_functions(pc)) {
1365 # ifdef CONFIG_FRAME_POINTER
1366 # ifdef __i386__
1367 return ((unsigned long *)regs->ebp)[1];
1368@@ -601,14 +437,11 @@ unsigned long profile_pc(struct pt_regs
1369 # endif
1370 # else
1371 # ifdef __i386__
1372- unsigned long *sp;
1373- if ((regs->xcs & 2) == 0)
1374- sp = (unsigned long *)&regs->esp;
1375- else
1376- sp = (unsigned long *)regs->esp;
1377+ unsigned long *sp = (unsigned long *)&regs->esp;
1378 # else
1379 unsigned long *sp = (unsigned long *)regs->rsp;
1380 # endif
1381+
1382 /* Return address is either directly at stack pointer
1383 or above a saved eflags. Eflags has bits 22-31 zero,
1384 kernel addresses don't. */
1385@@ -761,19 +594,6 @@ irqreturn_t timer_interrupt(int irq, voi
1386 return IRQ_HANDLED;
1387 }
1388
1389-#ifndef CONFIG_X86_64
1390-
1391-void tsc_init(void)
1392-{
1393- init_cpu_khz();
1394- printk(KERN_INFO "Xen reported: %u.%03u MHz processor.\n",
1395- cpu_khz / 1000, cpu_khz % 1000);
1396-
1397- use_tsc_delay();
1398-}
1399-
1400-#include <linux/clocksource.h>
1401-
1402 void mark_tsc_unstable(void)
1403 {
1404 #ifndef CONFIG_XEN /* XXX Should tell the hypervisor about this fact. */
1405@@ -829,21 +649,9 @@ static struct clocksource clocksource_xe
1406 .mask = CLOCKSOURCE_MASK(64),
1407 .mult = 1 << XEN_SHIFT, /* time directly in nanoseconds */
1408 .shift = XEN_SHIFT,
1409- .is_continuous = 1,
1410+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
1411 };
1412
1413-static int __init init_xen_clocksource(void)
1414-{
1415- clocksource_xen.mult = clocksource_khz2mult(cpu_khz,
1416- clocksource_xen.shift);
1417-
1418- return clocksource_register(&clocksource_xen);
1419-}
1420-
1421-module_init(init_xen_clocksource);
1422-
1423-#endif
1424-
1425 static void init_missing_ticks_accounting(unsigned int cpu)
1426 {
1427 struct vcpu_register_runstate_memory_area area;
1428@@ -864,7 +672,7 @@ static void init_missing_ticks_accountin
1429 }
1430
1431 /* not static: needed by APM */
1432-unsigned long get_cmos_time(void)
1433+unsigned long read_persistent_clock(void)
1434 {
1435 unsigned long retval;
1436 unsigned long flags;
1437@@ -877,11 +685,11 @@ unsigned long get_cmos_time(void)
1438
1439 return retval;
1440 }
1441-EXPORT_SYMBOL(get_cmos_time);
1442
1443 static void sync_cmos_clock(unsigned long dummy);
1444
1445 static DEFINE_TIMER(sync_cmos_timer, sync_cmos_clock, 0, 0);
1446+int no_sync_cmos_clock;
1447
1448 static void sync_cmos_clock(unsigned long dummy)
1449 {
1450@@ -925,7 +733,8 @@ static void sync_cmos_clock(unsigned lon
1451
1452 void notify_arch_cmos_timer(void)
1453 {
1454- mod_timer(&sync_cmos_timer, jiffies + 1);
1455+ if (!no_sync_cmos_clock)
1456+ mod_timer(&sync_cmos_timer, jiffies + 1);
1457 mod_timer(&sync_xen_wallclock_timer, jiffies + 1);
1458 }
1459
1460@@ -958,29 +767,11 @@ static int time_init_device(void)
1461
1462 device_initcall(time_init_device);
1463
1464-#ifdef CONFIG_HPET_TIMER
1465 extern void (*late_time_init)(void);
1466-/* Duplicate of time_init() below, with hpet_enable part added */
1467-static void __init hpet_time_init(void)
1468-{
1469- struct timespec ts;
1470- ts.tv_sec = get_cmos_time();
1471- ts.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
1472-
1473- do_settimeofday(&ts);
1474-
1475- if ((hpet_enable() >= 0) && hpet_use_timer) {
1476- printk("Using HPET for base-timer\n");
1477- }
1478-
1479- do_time_init();
1480-}
1481-#endif
1482
1483 /* Dynamically-mapped IRQ. */
1484 DEFINE_PER_CPU(int, timer_irq);
1485
1486-extern void (*late_time_init)(void);
1487 static void setup_cpu0_timer_irq(void)
1488 {
1489 per_cpu(timer_irq, 0) =
1490@@ -988,7 +779,7 @@ static void setup_cpu0_timer_irq(void)
1491 VIRQ_TIMER,
1492 0,
1493 timer_interrupt,
1494- SA_INTERRUPT,
1495+ IRQF_DISABLED|IRQF_NOBALANCING,
1496 "timer0",
1497 NULL);
1498 BUG_ON(per_cpu(timer_irq, 0) < 0);
1499@@ -1000,16 +791,9 @@ static struct vcpu_set_periodic_timer xe
1500
1501 void __init time_init(void)
1502 {
1503-#ifdef CONFIG_HPET_TIMER
1504- if (is_hpet_capable()) {
1505- /*
1506- * HPET initialization needs to do memory-mapped io. So, let
1507- * us do a late initialization after mem_init().
1508- */
1509- late_time_init = hpet_time_init;
1510- return;
1511- }
1512-#endif
1513+ init_cpu_khz();
1514+ printk(KERN_INFO "Xen reported: %u.%03u MHz processor.\n",
1515+ cpu_khz / 1000, cpu_khz % 1000);
1516
1517 switch (HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, 0,
1518 &xen_set_periodic_tick)) {
1519@@ -1028,18 +812,12 @@ void __init time_init(void)
1520 per_cpu(processed_system_time, 0) = processed_system_time;
1521 init_missing_ticks_accounting(0);
1522
1523- update_wallclock();
1524+ clocksource_register(&clocksource_xen);
1525
1526-#ifdef CONFIG_X86_64
1527- init_cpu_khz();
1528- printk(KERN_INFO "Xen reported: %u.%03u MHz processor.\n",
1529- cpu_khz / 1000, cpu_khz % 1000);
1530+ update_wallclock();
1531
1532- vxtime.mode = VXTIME_TSC;
1533- vxtime.quot = (1000000L << 32) / vxtime_hz;
1534- vxtime.tsc_quot = (1000L << 32) / cpu_khz;
1535- sync_core();
1536- rdtscll(vxtime.last_tsc);
1537+#ifndef CONFIG_X86_64
1538+ use_tsc_delay();
1539 #endif
1540
1541 /* Cannot request_irq() until kmem is initialised. */
1542@@ -1196,7 +974,7 @@ int __cpuinit local_setup_timer(unsigned
1543 irq = bind_virq_to_irqhandler(VIRQ_TIMER,
1544 cpu,
1545 timer_interrupt,
1546- SA_INTERRUPT,
1547+ IRQF_DISABLED|IRQF_NOBALANCING,
1548 timer_name[cpu],
1549 NULL);
1550 if (irq < 0)
1551@@ -1285,7 +1063,7 @@ static ctl_table xen_table[] = {
1552 };
1553 static int __init xen_sysctl_init(void)
1554 {
1555- (void)register_sysctl_table(xen_table, 0);
1556+ (void)register_sysctl_table(xen_table);
1557 return 0;
1558 }
1559 __initcall(xen_sysctl_init);
1560--- sle11-2009-05-14.orig/arch/x86/kernel/traps_32-xen.c 2008-12-15 11:26:44.000000000 +0100
1561+++ sle11-2009-05-14/arch/x86/kernel/traps_32-xen.c 2009-03-04 11:25:55.000000000 +0100
1562@@ -100,6 +100,7 @@ asmlinkage void fixup_4gb_segment(void);
1563 asmlinkage void machine_check(void);
1564
1565 int kstack_depth_to_print = 24;
1566+static unsigned int code_bytes = 64;
1567 ATOMIC_NOTIFIER_HEAD(i386die_chain);
1568
1569 int register_die_notifier(struct notifier_block *nb)
1570@@ -297,10 +298,11 @@ void show_registers(struct pt_regs *regs
1571 int i;
1572 int in_kernel = 1;
1573 unsigned long esp;
1574- unsigned short ss;
1575+ unsigned short ss, gs;
1576
1577 esp = (unsigned long) (&regs->esp);
1578 savesegment(ss, ss);
1579+ savesegment(gs, gs);
1580 if (user_mode_vm(regs)) {
1581 in_kernel = 0;
1582 esp = regs->esp;
1583@@ -319,8 +321,8 @@ void show_registers(struct pt_regs *regs
1584 regs->eax, regs->ebx, regs->ecx, regs->edx);
1585 printk(KERN_EMERG "esi: %08lx edi: %08lx ebp: %08lx esp: %08lx\n",
1586 regs->esi, regs->edi, regs->ebp, esp);
1587- printk(KERN_EMERG "ds: %04x es: %04x ss: %04x\n",
1588- regs->xds & 0xffff, regs->xes & 0xffff, ss);
1589+ printk(KERN_EMERG "ds: %04x es: %04x fs: %04x gs: %04x ss: %04x\n",
1590+ regs->xds & 0xffff, regs->xes & 0xffff, regs->xfs & 0xffff, gs, ss);
1591 printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)",
1592 TASK_COMM_LEN, current->comm, current->pid,
1593 current_thread_info(), current, current->thread_info);
1594@@ -330,7 +332,8 @@ void show_registers(struct pt_regs *regs
1595 */
1596 if (in_kernel) {
1597 u8 *eip;
1598- int code_bytes = 64;
1599+ unsigned int code_prologue = code_bytes * 43 / 64;
1600+ unsigned int code_len = code_bytes;
1601 unsigned char c;
1602
1603 printk("\n" KERN_EMERG "Stack: ");
1604@@ -338,14 +341,14 @@ void show_registers(struct pt_regs *regs
1605
1606 printk(KERN_EMERG "Code: ");
1607
1608- eip = (u8 *)regs->eip - 43;
1609+ eip = (u8 *)regs->eip - code_prologue;
1610 if (eip < (u8 *)PAGE_OFFSET ||
1611 probe_kernel_address(eip, c)) {
1612 /* try starting at EIP */
1613 eip = (u8 *)regs->eip;
1614- code_bytes = 32;
1615+ code_len = code_len - code_prologue + 1;
1616 }
1617- for (i = 0; i < code_bytes; i++, eip++) {
1618+ for (i = 0; i < code_len; i++, eip++) {
1619 if (eip < (u8 *)PAGE_OFFSET ||
1620 probe_kernel_address(eip, c)) {
1621 printk(" Bad EIP value.");
1622@@ -1134,3 +1137,13 @@ static int __init kstack_setup(char *s)
1623 return 1;
1624 }
1625 __setup("kstack=", kstack_setup);
1626+
1627+static int __init code_bytes_setup(char *s)
1628+{
1629+ code_bytes = simple_strtoul(s, NULL, 0);
1630+ if (code_bytes > 8192)
1631+ code_bytes = 8192;
1632+
1633+ return 1;
1634+}
1635+__setup("code_bytes=", code_bytes_setup);
1636--- sle11-2009-05-14.orig/arch/x86/mm/fault_32-xen.c 2008-12-15 11:26:44.000000000 +0100
1637+++ sle11-2009-05-14/arch/x86/mm/fault_32-xen.c 2009-03-04 11:25:55.000000000 +0100
1638@@ -46,43 +46,17 @@ int unregister_page_fault_notifier(struc
1639 }
1640 EXPORT_SYMBOL_GPL(unregister_page_fault_notifier);
1641
1642-static inline int notify_page_fault(enum die_val val, const char *str,
1643- struct pt_regs *regs, long err, int trap, int sig)
1644+static inline int notify_page_fault(struct pt_regs *regs, long err)
1645 {
1646 struct die_args args = {
1647 .regs = regs,
1648- .str = str,
1649+ .str = "page fault",
1650 .err = err,
1651- .trapnr = trap,
1652- .signr = sig
1653+ .trapnr = 14,
1654+ .signr = SIGSEGV
1655 };
1656- return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
1657-}
1658-
1659-/*
1660- * Unlock any spinlocks which will prevent us from getting the
1661- * message out
1662- */
1663-void bust_spinlocks(int yes)
1664-{
1665- int loglevel_save = console_loglevel;
1666-
1667- if (yes) {
1668- oops_in_progress = 1;
1669- return;
1670- }
1671-#ifdef CONFIG_VT
1672- unblank_screen();
1673-#endif
1674- oops_in_progress = 0;
1675- /*
1676- * OK, the message is on the console. Now we call printk()
1677- * without oops_in_progress set so that printk will give klogd
1678- * a poke. Hold onto your hats...
1679- */
1680- console_loglevel = 15; /* NMI oopser may have shut the console up */
1681- printk(" ");
1682- console_loglevel = loglevel_save;
1683+ return atomic_notifier_call_chain(&notify_page_fault_chain,
1684+ DIE_PAGE_FAULT, &args);
1685 }
1686
1687 /*
1688@@ -476,8 +450,7 @@ fastcall void __kprobes do_page_fault(st
1689 /* Can take a spurious fault if mapping changes R/O -> R/W. */
1690 if (spurious_fault(regs, address, error_code))
1691 return;
1692- if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
1693- SIGSEGV) == NOTIFY_STOP)
1694+ if (notify_page_fault(regs, error_code) == NOTIFY_STOP)
1695 return;
1696 /*
1697 * Don't take the mm semaphore here. If we fixup a prefetch
1698@@ -486,8 +459,7 @@ fastcall void __kprobes do_page_fault(st
1699 goto bad_area_nosemaphore;
1700 }
1701
1702- if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
1703- SIGSEGV) == NOTIFY_STOP)
1704+ if (notify_page_fault(regs, error_code) == NOTIFY_STOP)
1705 return;
1706
1707 /* It's safe to allow irq's after cr2 has been saved and the vmalloc
1708--- sle11-2009-05-14.orig/arch/x86/mm/highmem_32-xen.c 2008-12-15 11:26:44.000000000 +0100
1709+++ sle11-2009-05-14/arch/x86/mm/highmem_32-xen.c 2009-03-04 11:25:55.000000000 +0100
1710@@ -33,14 +33,16 @@ static void *__kmap_atomic(struct page *
1711
1712 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
1713 pagefault_disable();
1714+
1715+ idx = type + KM_TYPE_NR*smp_processor_id();
1716+ BUG_ON(!pte_none(*(kmap_pte-idx)));
1717+
1718 if (!PageHighMem(page))
1719 return page_address(page);
1720
1721- idx = type + KM_TYPE_NR*smp_processor_id();
1722 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
1723- if (!pte_none(*(kmap_pte-idx)))
1724- BUG();
1725 set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot));
1726+ /*arch_flush_lazy_mmu_mode();*/
1727
1728 return (void*) vaddr;
1729 }
1730@@ -94,6 +96,7 @@ void *kmap_atomic_pfn(unsigned long pfn,
1731 idx = type + KM_TYPE_NR*smp_processor_id();
1732 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
1733 set_pte(kmap_pte-idx, pfn_pte(pfn, kmap_prot));
1734+ /*arch_flush_lazy_mmu_mode();*/
1735
1736 return (void*) vaddr;
1737 }
1738--- sle11-2009-05-14.orig/arch/x86/mm/init_32-xen.c 2008-12-15 11:26:44.000000000 +0100
1739+++ sle11-2009-05-14/arch/x86/mm/init_32-xen.c 2009-03-04 11:25:55.000000000 +0100
1740@@ -66,6 +66,7 @@ static pmd_t * __init one_md_table_init(
1741
1742 #ifdef CONFIG_X86_PAE
1743 pmd_table = (pmd_t *) alloc_bootmem_low_pages(PAGE_SIZE);
1744+ paravirt_alloc_pd(__pa(pmd_table) >> PAGE_SHIFT);
1745 make_lowmem_page_readonly(pmd_table, XENFEAT_writable_page_tables);
1746 set_pgd(pgd, __pgd(__pa(pmd_table) | _PAGE_PRESENT));
1747 pud = pud_offset(pgd, 0);
1748@@ -87,6 +88,7 @@ static pte_t * __init one_page_table_ini
1749 {
1750 if (pmd_none(*pmd)) {
1751 pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
1752+ paravirt_alloc_pt(__pa(page_table) >> PAGE_SHIFT);
1753 make_lowmem_page_readonly(page_table,
1754 XENFEAT_writable_page_tables);
1755 set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE));
1756--- sle11-2009-05-14.orig/arch/x86/mm/pgtable_32-xen.c 2008-12-15 11:26:44.000000000 +0100
1757+++ sle11-2009-05-14/arch/x86/mm/pgtable_32-xen.c 2009-03-04 11:25:55.000000000 +0100
1758@@ -149,6 +149,8 @@ void __set_fixmap (enum fixed_addresses
1759 void __init reserve_top_address(unsigned long reserve)
1760 {
1761 BUG_ON(fixmaps > 0);
1762+ printk(KERN_INFO "Reserving virtual address space above 0x%08x\n",
1763+ (int)-reserve);
1764 __FIXADDR_TOP = -reserve - PAGE_SIZE;
1765 __VMALLOC_RESERVE += reserve;
1766 }
1767@@ -258,6 +260,12 @@ void pgd_ctor(void *pgd, struct kmem_cac
1768 swapper_pg_dir + USER_PTRS_PER_PGD,
1769 KERNEL_PGD_PTRS);
1770 memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
1771+
1772+ /* must happen under lock */
1773+ paravirt_alloc_pd_clone(__pa(pgd) >> PAGE_SHIFT,
1774+ __pa(swapper_pg_dir) >> PAGE_SHIFT,
1775+ USER_PTRS_PER_PGD, PTRS_PER_PGD - USER_PTRS_PER_PGD);
1776+
1777 pgd_list_add(pgd);
1778 spin_unlock_irqrestore(&pgd_lock, flags);
1779 }
1780@@ -268,6 +276,7 @@ void pgd_dtor(void *pgd, struct kmem_cac
1781 {
1782 unsigned long flags; /* can be called from interrupt context */
1783
1784+ paravirt_release_pd(__pa(pgd) >> PAGE_SHIFT);
1785 spin_lock_irqsave(&pgd_lock, flags);
1786 pgd_list_del(pgd);
1787 spin_unlock_irqrestore(&pgd_lock, flags);
1788@@ -292,6 +301,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
1789 pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
1790 if (!pmd)
1791 goto out_oom;
1792+ paravirt_alloc_pd(__pa(pmd) >> PAGE_SHIFT);
1793 set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
1794 }
1795 return pgd;
1796@@ -314,6 +324,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
1797 pmd[i] = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
1798 if (!pmd[i])
1799 goto out_oom;
1800+ paravirt_alloc_pd(__pa(pmd) >> PAGE_SHIFT);
1801 }
1802
1803 spin_lock_irqsave(&pgd_lock, flags);
1804@@ -354,12 +365,17 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
1805
1806 out_oom:
1807 if (HAVE_SHARED_KERNEL_PMD) {
1808- for (i--; i >= 0; i--)
1809- kmem_cache_free(pmd_cache,
1810- (void *)__va(pgd_val(pgd[i])-1));
1811+ for (i--; i >= 0; i--) {
1812+ pgd_t pgdent = pgd[i];
1813+ void* pmd = (void *)__va(pgd_val(pgdent)-1);
1814+ paravirt_release_pd(__pa(pmd) >> PAGE_SHIFT);
1815+ kmem_cache_free(pmd_cache, pmd);
1816+ }
1817 } else {
1818- for (i--; i >= 0; i--)
1819+ for (i--; i >= 0; i--) {
1820+ paravirt_release_pd(__pa(pmd[i]) >> PAGE_SHIFT);
1821 kmem_cache_free(pmd_cache, pmd[i]);
1822+ }
1823 kfree(pmd);
1824 }
1825 kmem_cache_free(pgd_cache, pgd);
1826@@ -383,7 +399,9 @@ void pgd_free(pgd_t *pgd)
1827 /* in the PAE case user pgd entries are overwritten before usage */
1828 if (PTRS_PER_PMD > 1) {
1829 for (i = 0; i < USER_PTRS_PER_PGD; ++i) {
1830- pmd_t *pmd = (void *)__va(pgd_val(pgd[i])-1);
1831+ pgd_t pgdent = pgd[i];
1832+ void* pmd = (void *)__va(pgd_val(pgdent)-1);
1833+ paravirt_release_pd(__pa(pmd) >> PAGE_SHIFT);
1834 kmem_cache_free(pmd_cache, pmd);
1835 }
1836
1837--- sle11-2009-05-14.orig/arch/x86/ia32/ia32entry-xen.S 2009-03-04 11:28:34.000000000 +0100
1838+++ sle11-2009-05-14/arch/x86/ia32/ia32entry-xen.S 2009-03-04 11:25:55.000000000 +0100
1839@@ -465,7 +465,7 @@ ia32_sys_call_table:
1840 .quad sys32_vm86_warning /* vm86old */
1841 .quad compat_sys_wait4
1842 .quad sys_swapoff /* 115 */
1843- .quad sys32_sysinfo
1844+ .quad compat_sys_sysinfo
1845 .quad sys32_ipc
1846 .quad sys_fsync
1847 .quad stub32_sigreturn
1848@@ -510,7 +510,7 @@ ia32_sys_call_table:
1849 .quad sys_sched_yield
1850 .quad sys_sched_get_priority_max
1851 .quad sys_sched_get_priority_min /* 160 */
1852- .quad sys_sched_rr_get_interval
1853+ .quad sys32_sched_rr_get_interval
1854 .quad compat_sys_nanosleep
1855 .quad sys_mremap
1856 .quad sys_setresuid16
1857@@ -668,4 +668,5 @@ ia32_sys_call_table:
1858 .quad compat_sys_vmsplice
1859 .quad compat_sys_move_pages
1860 .quad sys_getcpu
1861+ .quad sys_epoll_pwait
1862 ia32_syscall_end:
1863--- sle11-2009-05-14.orig/arch/x86/kernel/acpi/sleep_64-xen.c 2009-05-14 10:56:29.000000000 +0200
1864+++ sle11-2009-05-14/arch/x86/kernel/acpi/sleep_64-xen.c 2009-03-04 11:25:55.000000000 +0100
1865@@ -59,7 +59,7 @@ unsigned long acpi_wakeup_address = 0;
1866 unsigned long acpi_video_flags;
1867 extern char wakeup_start, wakeup_end;
1868
1869-extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
1870+extern unsigned long acpi_copy_wakeup_routine(unsigned long);
1871
1872 static pgd_t low_ptr;
1873
1874@@ -67,8 +67,10 @@ static void init_low_mapping(void)
1875 {
1876 pgd_t *slot0 = pgd_offset(current->mm, 0UL);
1877 low_ptr = *slot0;
1878+ /* FIXME: We're playing with the current task's page tables here, which
1879+ * is potentially dangerous on SMP systems.
1880+ */
1881 set_pgd(slot0, *pgd_offset(current->mm, PAGE_OFFSET));
1882- WARN_ON(num_online_cpus() != 1);
1883 local_flush_tlb();
1884 }
1885 #endif
1886--- sle11-2009-05-14.orig/arch/x86/kernel/e820_64-xen.c 2009-03-04 11:28:34.000000000 +0100
1887+++ sle11-2009-05-14/arch/x86/kernel/e820_64-xen.c 2009-03-04 11:25:55.000000000 +0100
1888@@ -88,6 +88,13 @@ static inline int bad_addr(unsigned long
1889 return 1;
1890 }
1891
1892+#ifdef CONFIG_NUMA
1893+ /* NUMA memory to node map */
1894+ if (last >= nodemap_addr && addr < nodemap_addr + nodemap_size) {
1895+ *addrp = nodemap_addr + nodemap_size;
1896+ return 1;
1897+ }
1898+#endif
1899 /* XXX ramdisk image here? */
1900 #else
1901 if (last < (table_end<<PAGE_SHIFT)) {
1902@@ -213,6 +220,37 @@ unsigned long __init e820_end_of_ram(voi
1903 }
1904
1905 /*
1906+ * Find the hole size in the range.
1907+ */
1908+unsigned long __init e820_hole_size(unsigned long start, unsigned long end)
1909+{
1910+ unsigned long ram = 0;
1911+ int i;
1912+
1913+ for (i = 0; i < e820.nr_map; i++) {
1914+ struct e820entry *ei = &e820.map[i];
1915+ unsigned long last, addr;
1916+
1917+ if (ei->type != E820_RAM ||
1918+ ei->addr+ei->size <= start ||
1919+ ei->addr >= end)
1920+ continue;
1921+
1922+ addr = round_up(ei->addr, PAGE_SIZE);
1923+ if (addr < start)
1924+ addr = start;
1925+
1926+ last = round_down(ei->addr + ei->size, PAGE_SIZE);
1927+ if (last >= end)
1928+ last = end;
1929+
1930+ if (last > addr)
1931+ ram += last - addr;
1932+ }
1933+ return ((end - start) - ram);
1934+}
1935+
1936+/*
1937 * Mark e820 reserved areas as busy for the resource manager.
1938 */
1939 void __init e820_reserve_resources(struct e820entry *e820, int nr_map)
1940@@ -738,7 +776,7 @@ static int __init parse_memmap_opt(char
1941 }
1942 early_param("memmap", parse_memmap_opt);
1943
1944-void finish_e820_parsing(void)
1945+void __init finish_e820_parsing(void)
1946 {
1947 if (userdef) {
1948 printk(KERN_INFO "user-defined physical RAM map:\n");
1949--- sle11-2009-05-14.orig/arch/x86/kernel/entry_64-xen.S 2008-12-15 11:26:44.000000000 +0100
1950+++ sle11-2009-05-14/arch/x86/kernel/entry_64-xen.S 2009-03-04 11:25:55.000000000 +0100
1951@@ -629,6 +629,9 @@ END(invalidate_interrupt\num)
1952 ENTRY(call_function_interrupt)
1953 apicinterrupt CALL_FUNCTION_VECTOR,smp_call_function_interrupt
1954 END(call_function_interrupt)
1955+ENTRY(irq_move_cleanup_interrupt)
1956+ apicinterrupt IRQ_MOVE_CLEANUP_VECTOR,smp_irq_move_cleanup_interrupt
1957+END(irq_move_cleanup_interrupt)
1958 #endif
1959
1960 ENTRY(apic_timer_interrupt)
1961--- sle11-2009-05-14.orig/arch/x86/kernel/genapic_64-xen.c 2008-12-15 11:26:44.000000000 +0100
1962+++ sle11-2009-05-14/arch/x86/kernel/genapic_64-xen.c 2009-03-04 11:25:55.000000000 +0100
1963@@ -65,8 +65,8 @@ void __init clustered_apic_check(void)
1964 * Some x86_64 machines use physical APIC mode regardless of how many
1965 * procs/clusters are present (x86_64 ES7000 is an example).
1966 */
1967- if (acpi_fadt.revision > FADT2_REVISION_ID)
1968- if (acpi_fadt.force_apic_physical_destination_mode) {
1969+ if (acpi_gbl_FADT.header.revision > FADT2_REVISION_ID)
1970+ if (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) {
1971 genapic = &apic_cluster;
1972 goto print;
1973 }
1974--- sle11-2009-05-14.orig/arch/x86/kernel/head64-xen.c 2008-12-15 11:26:44.000000000 +0100
1975+++ sle11-2009-05-14/arch/x86/kernel/head64-xen.c 2009-03-04 11:25:55.000000000 +0100
1976@@ -45,8 +45,6 @@ static void __init clear_bss(void)
1977 #define OLD_CL_BASE_ADDR 0x90000
1978 #define OLD_CL_OFFSET 0x90022
1979
1980-extern char saved_command_line[];
1981-
1982 static void __init copy_bootdata(char *real_mode_data)
1983 {
1984 #ifndef CONFIG_XEN
1985@@ -62,14 +60,14 @@ static void __init copy_bootdata(char *r
1986 new_data = OLD_CL_BASE_ADDR + * (u16 *) OLD_CL_OFFSET;
1987 }
1988 command_line = (char *) ((u64)(new_data));
1989- memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
1990+ memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
1991 #else
1992 int max_cmdline;
1993
1994 if ((max_cmdline = MAX_GUEST_CMDLINE) > COMMAND_LINE_SIZE)
1995 max_cmdline = COMMAND_LINE_SIZE;
1996- memcpy(saved_command_line, xen_start_info->cmd_line, max_cmdline);
1997- saved_command_line[max_cmdline-1] = '\0';
1998+ memcpy(boot_command_line, xen_start_info->cmd_line, max_cmdline);
1999+ boot_command_line[max_cmdline-1] = '\0';
2000 #endif
2001 }
2002
2003--- sle11-2009-05-14.orig/arch/x86/kernel/io_apic_64-xen.c 2008-12-15 11:26:44.000000000 +0100
2004+++ sle11-2009-05-14/arch/x86/kernel/io_apic_64-xen.c 2009-03-04 11:25:55.000000000 +0100
2005@@ -36,6 +36,7 @@
2006 #include <acpi/acpi_bus.h>
2007 #endif
2008
2009+#include <asm/idle.h>
2010 #include <asm/io.h>
2011 #include <asm/smp.h>
2012 #include <asm/desc.h>
2013@@ -47,7 +48,20 @@
2014 #include <asm/msidef.h>
2015 #include <asm/hypertransport.h>
2016
2017-static int assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result);
2018+struct irq_cfg {
2019+#ifndef CONFIG_XEN
2020+ cpumask_t domain;
2021+ cpumask_t old_domain;
2022+#endif
2023+ unsigned move_cleanup_count;
2024+ u8 vector;
2025+ u8 move_in_progress : 1;
2026+};
2027+
2028+/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */
2029+struct irq_cfg irq_cfg[NR_IRQS] __read_mostly;
2030+
2031+static int assign_irq_vector(int irq, cpumask_t mask);
2032
2033 #define __apicdebuginit __init
2034
2035@@ -89,7 +103,7 @@ int nr_ioapic_registers[MAX_IO_APICS];
2036 * Rough estimation of how many shared IRQs there are, can
2037 * be changed anytime.
2038 */
2039-#define MAX_PLUS_SHARED_IRQS NR_IRQ_VECTORS
2040+#define MAX_PLUS_SHARED_IRQS NR_IRQS
2041 #define PIN_MAP_SIZE (MAX_PLUS_SHARED_IRQS + NR_IRQS)
2042
2043 /*
2044@@ -262,21 +276,19 @@ static void __target_IO_APIC_irq(unsigne
2045
2046 static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask)
2047 {
2048+ struct irq_cfg *cfg = irq_cfg + irq;
2049 unsigned long flags;
2050 unsigned int dest;
2051 cpumask_t tmp;
2052- int vector;
2053
2054 cpus_and(tmp, mask, cpu_online_map);
2055 if (cpus_empty(tmp))
2056- tmp = TARGET_CPUS;
2057-
2058- cpus_and(mask, tmp, CPU_MASK_ALL);
2059+ return;
2060
2061- vector = assign_irq_vector(irq, mask, &tmp);
2062- if (vector < 0)
2063+ if (assign_irq_vector(irq, mask))
2064 return;
2065
2066+ cpus_and(tmp, cfg->domain, mask);
2067 dest = cpu_mask_to_apicid(tmp);
2068
2069 /*
2070@@ -285,8 +297,8 @@ static void set_ioapic_affinity_irq(unsi
2071 dest = SET_APIC_LOGICAL_ID(dest);
2072
2073 spin_lock_irqsave(&ioapic_lock, flags);
2074- __target_IO_APIC_irq(irq, dest, vector);
2075- set_native_irq_info(irq, mask);
2076+ __target_IO_APIC_irq(irq, dest, cfg->vector);
2077+ irq_desc[irq].affinity = mask;
2078 spin_unlock_irqrestore(&ioapic_lock, flags);
2079 }
2080 #endif
2081@@ -332,11 +344,11 @@ static void add_pin_to_irq(unsigned int
2082 reg = io_apic_read(entry->apic, 0x10 + R + pin*2); \
2083 reg ACTION; \
2084 io_apic_modify(entry->apic, reg); \
2085+ FINAL; \
2086 if (!entry->next) \
2087 break; \
2088 entry = irq_2_pin + entry->next; \
2089 } \
2090- FINAL; \
2091 }
2092
2093 #define DO_ACTION(name,R,ACTION, FINAL) \
2094@@ -669,77 +681,62 @@ static int pin_2_irq(int idx, int apic,
2095 return irq;
2096 }
2097
2098-static inline int IO_APIC_irq_trigger(int irq)
2099-{
2100- int apic, idx, pin;
2101-
2102- for (apic = 0; apic < nr_ioapics; apic++) {
2103- for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) {
2104- idx = find_irq_entry(apic,pin,mp_INT);
2105- if ((idx != -1) && (irq == pin_2_irq(idx,apic,pin)))
2106- return irq_trigger(idx);
2107- }
2108- }
2109- /*
2110- * nonexistent IRQs are edge default
2111- */
2112- return 0;
2113-}
2114-
2115-/* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */
2116-static u8 irq_vector[NR_IRQ_VECTORS] __read_mostly;
2117-
2118-static int __assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result)
2119+static int __assign_irq_vector(int irq, cpumask_t mask)
2120 {
2121- int vector;
2122 struct physdev_irq irq_op;
2123+ struct irq_cfg *cfg;
2124
2125- BUG_ON((unsigned)irq >= NR_IRQ_VECTORS);
2126+ BUG_ON((unsigned)irq >= NR_IRQS);
2127
2128 if (irq < PIRQ_BASE || irq - PIRQ_BASE >= NR_PIRQS)
2129 return -EINVAL;
2130
2131- cpus_and(*result, mask, cpu_online_map);
2132+ cfg = &irq_cfg[irq];
2133+
2134+ if ((cfg->move_in_progress) || cfg->move_cleanup_count)
2135+ return -EBUSY;
2136
2137- if (irq_vector[irq] > 0)
2138- return irq_vector[irq];
2139+ if (cfg->vector)
2140+ return 0;
2141
2142 irq_op.irq = irq;
2143 if (HYPERVISOR_physdev_op(PHYSDEVOP_alloc_irq_vector, &irq_op))
2144 return -ENOSPC;
2145
2146- vector = irq_op.vector;
2147- irq_vector[irq] = vector;
2148+ cfg->vector = irq_op.vector;
2149
2150- return vector;
2151+ return 0;
2152 }
2153
2154-static int assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result)
2155+static int assign_irq_vector(int irq, cpumask_t mask)
2156 {
2157- int vector;
2158+ int err;
2159 unsigned long flags;
2160
2161 spin_lock_irqsave(&vector_lock, flags);
2162- vector = __assign_irq_vector(irq, mask, result);
2163+ err = __assign_irq_vector(irq, mask);
2164 spin_unlock_irqrestore(&vector_lock, flags);
2165- return vector;
2166+ return err;
2167 }
2168
2169 #ifndef CONFIG_XEN
2170 static void __clear_irq_vector(int irq)
2171 {
2172+ struct irq_cfg *cfg;
2173 cpumask_t mask;
2174 int cpu, vector;
2175
2176- BUG_ON(!irq_vector[irq]);
2177+ BUG_ON((unsigned)irq >= NR_IRQS);
2178+ cfg = &irq_cfg[irq];
2179+ BUG_ON(!cfg->vector);
2180
2181- vector = irq_vector[irq];
2182- cpus_and(mask, irq_domain[irq], cpu_online_map);
2183+ vector = cfg->vector;
2184+ cpus_and(mask, cfg->domain, cpu_online_map);
2185 for_each_cpu_mask(cpu, mask)
2186 per_cpu(vector_irq, cpu)[vector] = -1;
2187
2188- irq_vector[irq] = 0;
2189- irq_domain[irq] = CPU_MASK_NONE;
2190+ cfg->vector = 0;
2191+ cfg->domain = CPU_MASK_NONE;
2192 }
2193
2194 void __setup_vector_irq(int cpu)
2195@@ -749,10 +746,10 @@ void __setup_vector_irq(int cpu)
2196 int irq, vector;
2197
2198 /* Mark the inuse vectors */
2199- for (irq = 0; irq < NR_IRQ_VECTORS; ++irq) {
2200- if (!cpu_isset(cpu, irq_domain[irq]))
2201+ for (irq = 0; irq < NR_IRQS; ++irq) {
2202+ if (!cpu_isset(cpu, irq_cfg[irq].domain))
2203 continue;
2204- vector = irq_vector[irq];
2205+ vector = irq_cfg[irq].vector;
2206 per_cpu(vector_irq, cpu)[vector] = irq;
2207 }
2208 /* Mark the free vectors */
2209@@ -760,41 +757,49 @@ void __setup_vector_irq(int cpu)
2210 irq = per_cpu(vector_irq, cpu)[vector];
2211 if (irq < 0)
2212 continue;
2213- if (!cpu_isset(cpu, irq_domain[irq]))
2214+ if (!cpu_isset(cpu, irq_cfg[irq].domain))
2215 per_cpu(vector_irq, cpu)[vector] = -1;
2216 }
2217 }
2218
2219-extern void (*interrupt[NR_IRQS])(void);
2220-
2221 static struct irq_chip ioapic_chip;
2222
2223-#define IOAPIC_AUTO -1
2224-#define IOAPIC_EDGE 0
2225-#define IOAPIC_LEVEL 1
2226-
2227-static void ioapic_register_intr(int irq, int vector, unsigned long trigger)
2228+static void ioapic_register_intr(int irq, unsigned long trigger)
2229 {
2230- if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
2231- trigger == IOAPIC_LEVEL)
2232+ if (trigger)
2233 set_irq_chip_and_handler_name(irq, &ioapic_chip,
2234 handle_fasteoi_irq, "fasteoi");
2235- else {
2236- irq_desc[irq].status |= IRQ_DELAYED_DISABLE;
2237+ else
2238 set_irq_chip_and_handler_name(irq, &ioapic_chip,
2239 handle_edge_irq, "edge");
2240- }
2241 }
2242 #else
2243-#define ioapic_register_intr(irq, vector, trigger) evtchn_register_pirq(irq)
2244+#define ioapic_register_intr(irq, trigger) evtchn_register_pirq(irq)
2245 #endif /* !CONFIG_XEN */
2246
2247-static void __init setup_IO_APIC_irq(int apic, int pin, int idx, int irq)
2248+static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq,
2249+ int trigger, int polarity)
2250 {
2251+ struct irq_cfg *cfg = irq_cfg + irq;
2252 struct IO_APIC_route_entry entry;
2253- int vector;
2254- unsigned long flags;
2255+ cpumask_t mask;
2256+
2257+ if (!IO_APIC_IRQ(irq))
2258+ return;
2259
2260+ mask = TARGET_CPUS;
2261+ if (assign_irq_vector(irq, mask))
2262+ return;
2263+
2264+#ifndef CONFIG_XEN
2265+ cpus_and(mask, cfg->domain, mask);
2266+#endif
2267+
2268+ apic_printk(APIC_VERBOSE,KERN_DEBUG
2269+ "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
2270+ "IRQ %d Mode:%i Active:%i)\n",
2271+ apic, mp_ioapics[apic].mpc_apicid, pin, cfg->vector,
2272+ irq, trigger, polarity);
2273
2274 /*
2275 * add it to the IO-APIC irq-routing table:
2276@@ -803,41 +808,23 @@ static void __init setup_IO_APIC_irq(int
2277
2278 entry.delivery_mode = INT_DELIVERY_MODE;
2279 entry.dest_mode = INT_DEST_MODE;
2280+ entry.dest = cpu_mask_to_apicid(mask);
2281 entry.mask = 0; /* enable IRQ */
2282- entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
2283-
2284- entry.trigger = irq_trigger(idx);
2285- entry.polarity = irq_polarity(idx);
2286+ entry.trigger = trigger;
2287+ entry.polarity = polarity;
2288+ entry.vector = cfg->vector;
2289
2290- if (irq_trigger(idx)) {
2291- entry.trigger = 1;
2292+ /* Mask level triggered irqs.
2293+ * Use IRQ_DELAYED_DISABLE for edge triggered irqs.
2294+ */
2295+ if (trigger)
2296 entry.mask = 1;
2297- entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
2298- }
2299-
2300- if (/* !apic && */ !IO_APIC_IRQ(irq))
2301- return;
2302
2303- if (IO_APIC_IRQ(irq)) {
2304- cpumask_t mask;
2305- vector = assign_irq_vector(irq, TARGET_CPUS, &mask);
2306- if (vector < 0)
2307- return;
2308-
2309- entry.dest.logical.logical_dest = cpu_mask_to_apicid(mask);
2310- entry.vector = vector;
2311-
2312- ioapic_register_intr(irq, vector, IOAPIC_AUTO);
2313- if (!apic && (irq < 16))
2314- disable_8259A_irq(irq);
2315- }
2316+ ioapic_register_intr(irq, trigger);
2317+ if (irq < 16)
2318+ disable_8259A_irq(irq);
2319
2320 ioapic_write_entry(apic, pin, entry);
2321-
2322- spin_lock_irqsave(&ioapic_lock, flags);
2323- set_native_irq_info(irq, TARGET_CPUS);
2324- spin_unlock_irqrestore(&ioapic_lock, flags);
2325-
2326 }
2327
2328 static void __init setup_IO_APIC_irqs(void)
2329@@ -862,8 +849,8 @@ static void __init setup_IO_APIC_irqs(vo
2330 irq = pin_2_irq(idx, apic, pin);
2331 add_pin_to_irq(irq, apic, pin);
2332
2333- setup_IO_APIC_irq(apic, pin, idx, irq);
2334-
2335+ setup_IO_APIC_irq(apic, pin, irq,
2336+ irq_trigger(idx), irq_polarity(idx));
2337 }
2338 }
2339
2340@@ -894,7 +881,7 @@ static void __init setup_ExtINT_IRQ0_pin
2341 */
2342 entry.dest_mode = INT_DEST_MODE;
2343 entry.mask = 0; /* unmask IRQ now */
2344- entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
2345+ entry.dest = cpu_mask_to_apicid(TARGET_CPUS);
2346 entry.delivery_mode = INT_DELIVERY_MODE;
2347 entry.polarity = 0;
2348 entry.trigger = 0;
2349@@ -994,18 +981,17 @@ void __apicdebuginit print_IO_APIC(void)
2350
2351 printk(KERN_DEBUG ".... IRQ redirection table:\n");
2352
2353- printk(KERN_DEBUG " NR Log Phy Mask Trig IRR Pol"
2354- " Stat Dest Deli Vect: \n");
2355+ printk(KERN_DEBUG " NR Dst Mask Trig IRR Pol"
2356+ " Stat Dmod Deli Vect: \n");
2357
2358 for (i = 0; i <= reg_01.bits.entries; i++) {
2359 struct IO_APIC_route_entry entry;
2360
2361 entry = ioapic_read_entry(apic, i);
2362
2363- printk(KERN_DEBUG " %02x %03X %02X ",
2364+ printk(KERN_DEBUG " %02x %03X ",
2365 i,
2366- entry.dest.logical.logical_dest,
2367- entry.dest.physical.physical_dest
2368+ entry.dest
2369 );
2370
2371 printk("%1d %1d %1d %1d %1d %1d %1d %02X\n",
2372@@ -1269,8 +1255,7 @@ void disable_IO_APIC(void)
2373 entry.dest_mode = 0; /* Physical */
2374 entry.delivery_mode = dest_ExtINT; /* ExtInt */
2375 entry.vector = 0;
2376- entry.dest.physical.physical_dest =
2377- GET_APIC_ID(apic_read(APIC_ID));
2378+ entry.dest = GET_APIC_ID(apic_read(APIC_ID));
2379
2380 /*
2381 * Add it to the IO-APIC irq-routing table:
2382@@ -1355,16 +1340,15 @@ static unsigned int startup_ioapic_irq(u
2383
2384 static int ioapic_retrigger_irq(unsigned int irq)
2385 {
2386+ struct irq_cfg *cfg = &irq_cfg[irq];
2387 cpumask_t mask;
2388- unsigned vector;
2389 unsigned long flags;
2390
2391 spin_lock_irqsave(&vector_lock, flags);
2392- vector = irq_vector[irq];
2393 cpus_clear(mask);
2394- cpu_set(first_cpu(irq_domain[irq]), mask);
2395+ cpu_set(first_cpu(cfg->domain), mask);
2396
2397- send_IPI_mask(mask, vector);
2398+ send_IPI_mask(mask, cfg->vector);
2399 spin_unlock_irqrestore(&vector_lock, flags);
2400
2401 return 1;
2402@@ -1379,8 +1363,68 @@ static int ioapic_retrigger_irq(unsigned
2403 * races.
2404 */
2405
2406+#ifdef CONFIG_SMP
2407+asmlinkage void smp_irq_move_cleanup_interrupt(void)
2408+{
2409+ unsigned vector, me;
2410+ ack_APIC_irq();
2411+ exit_idle();
2412+ irq_enter();
2413+
2414+ me = smp_processor_id();
2415+ for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
2416+ unsigned int irq;
2417+ struct irq_desc *desc;
2418+ struct irq_cfg *cfg;
2419+ irq = __get_cpu_var(vector_irq)[vector];
2420+ if (irq >= NR_IRQS)
2421+ continue;
2422+
2423+ desc = irq_desc + irq;
2424+ cfg = irq_cfg + irq;
2425+ spin_lock(&desc->lock);
2426+ if (!cfg->move_cleanup_count)
2427+ goto unlock;
2428+
2429+ if ((vector == cfg->vector) && cpu_isset(me, cfg->domain))
2430+ goto unlock;
2431+
2432+ __get_cpu_var(vector_irq)[vector] = -1;
2433+ cfg->move_cleanup_count--;
2434+unlock:
2435+ spin_unlock(&desc->lock);
2436+ }
2437+
2438+ irq_exit();
2439+}
2440+
2441+static void irq_complete_move(unsigned int irq)
2442+{
2443+ struct irq_cfg *cfg = irq_cfg + irq;
2444+ unsigned vector, me;
2445+
2446+ if (likely(!cfg->move_in_progress))
2447+ return;
2448+
2449+ vector = ~get_irq_regs()->orig_rax;
2450+ me = smp_processor_id();
2451+ if ((vector == cfg->vector) &&
2452+ cpu_isset(smp_processor_id(), cfg->domain)) {
2453+ cpumask_t cleanup_mask;
2454+
2455+ cpus_and(cleanup_mask, cfg->old_domain, cpu_online_map);
2456+ cfg->move_cleanup_count = cpus_weight(cleanup_mask);
2457+ send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
2458+ cfg->move_in_progress = 0;
2459+ }
2460+}
2461+#else
2462+static inline void irq_complete_move(unsigned int irq) {}
2463+#endif
2464+
2465 static void ack_apic_edge(unsigned int irq)
2466 {
2467+ irq_complete_move(irq);
2468 move_native_irq(irq);
2469 ack_APIC_irq();
2470 }
2471@@ -1389,6 +1433,7 @@ static void ack_apic_level(unsigned int
2472 {
2473 int do_unmask_irq = 0;
2474
2475+ irq_complete_move(irq);
2476 #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
2477 /* If we are moving the irq we need to mask it */
2478 if (unlikely(irq_desc[irq].status & IRQ_MOVE_PENDING)) {
2479@@ -1440,7 +1485,7 @@ static inline void init_IO_APIC_traps(vo
2480 */
2481 for (irq = 0; irq < NR_IRQS ; irq++) {
2482 int tmp = irq;
2483- if (IO_APIC_IRQ(tmp) && !irq_vector[tmp]) {
2484+ if (IO_APIC_IRQ(tmp) && !irq_cfg[tmp].vector) {
2485 /*
2486 * Hmm.. We don't have an entry for this,
2487 * so default to an old-fashioned 8259
2488@@ -1538,7 +1583,7 @@ static inline void unlock_ExtINT_logic(v
2489
2490 entry1.dest_mode = 0; /* physical delivery */
2491 entry1.mask = 0; /* unmask IRQ now */
2492- entry1.dest.physical.physical_dest = hard_smp_processor_id();
2493+ entry1.dest = hard_smp_processor_id();
2494 entry1.delivery_mode = dest_ExtINT;
2495 entry1.polarity = entry0.polarity;
2496 entry1.trigger = 0;
2497@@ -1582,15 +1627,14 @@ static inline void unlock_ExtINT_logic(v
2498 */
2499 static inline void check_timer(void)
2500 {
2501+ struct irq_cfg *cfg = irq_cfg + 0;
2502 int apic1, pin1, apic2, pin2;
2503- int vector;
2504- cpumask_t mask;
2505
2506 /*
2507 * get/set the timer IRQ vector:
2508 */
2509 disable_8259A_irq(0);
2510- vector = assign_irq_vector(0, TARGET_CPUS, &mask);
2511+ assign_irq_vector(0, TARGET_CPUS);
2512
2513 /*
2514 * Subtle, code in do_timer_interrupt() expects an AEOI
2515@@ -1610,7 +1654,7 @@ static inline void check_timer(void)
2516 apic2 = ioapic_i8259.apic;
2517
2518 apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n",
2519- vector, apic1, pin1, apic2, pin2);
2520+ cfg->vector, apic1, pin1, apic2, pin2);
2521
2522 if (pin1 != -1) {
2523 /*
2524@@ -1641,7 +1685,7 @@ static inline void check_timer(void)
2525 /*
2526 * legacy devices should be connected to IO APIC #0
2527 */
2528- setup_ExtINT_IRQ0_pin(apic2, pin2, vector);
2529+ setup_ExtINT_IRQ0_pin(apic2, pin2, cfg->vector);
2530 if (timer_irq_works()) {
2531 apic_printk(APIC_VERBOSE," works.\n");
2532 nmi_watchdog_default();
2533@@ -1666,14 +1710,14 @@ static inline void check_timer(void)
2534
2535 disable_8259A_irq(0);
2536 irq_desc[0].chip = &lapic_irq_type;
2537- apic_write(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */
2538+ apic_write(APIC_LVT0, APIC_DM_FIXED | cfg->vector); /* Fixed mode */
2539 enable_8259A_irq(0);
2540
2541 if (timer_irq_works()) {
2542 apic_printk(APIC_VERBOSE," works.\n");
2543 return;
2544 }
2545- apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | vector);
2546+ apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_FIXED | cfg->vector);
2547 apic_printk(APIC_VERBOSE," failed.\n");
2548
2549 apic_printk(APIC_VERBOSE, KERN_INFO "...trying to set up timer as ExtINT IRQ...");
2550@@ -1828,19 +1872,16 @@ int create_irq(void)
2551 /* Allocate an unused irq */
2552 int irq;
2553 int new;
2554- int vector = 0;
2555 unsigned long flags;
2556- cpumask_t mask;
2557
2558 irq = -ENOSPC;
2559 spin_lock_irqsave(&vector_lock, flags);
2560 for (new = (NR_IRQS - 1); new >= 0; new--) {
2561 if (platform_legacy_irq(new))
2562 continue;
2563- if (irq_vector[new] != 0)
2564+ if (irq_cfg[new].vector != 0)
2565 continue;
2566- vector = __assign_irq_vector(new, TARGET_CPUS, &mask);
2567- if (likely(vector > 0))
2568+ if (__assign_irq_vector(new, TARGET_CPUS) == 0)
2569 irq = new;
2570 break;
2571 }
2572@@ -1871,12 +1912,15 @@ void destroy_irq(unsigned int irq)
2573 #if defined(CONFIG_PCI_MSI) && !defined(CONFIG_XEN)
2574 static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_msg *msg)
2575 {
2576- int vector;
2577+ struct irq_cfg *cfg = irq_cfg + irq;
2578+ int err;
2579 unsigned dest;
2580 cpumask_t tmp;
2581
2582- vector = assign_irq_vector(irq, TARGET_CPUS, &tmp);
2583- if (vector >= 0) {
2584+ tmp = TARGET_CPUS;
2585+ err = assign_irq_vector(irq, tmp);
2586+ if (!err) {
2587+ cpus_and(tmp, cfg->domain, tmp);
2588 dest = cpu_mask_to_apicid(tmp);
2589
2590 msg->address_hi = MSI_ADDR_BASE_HI;
2591@@ -1896,40 +1940,38 @@ static int msi_compose_msg(struct pci_de
2592 ((INT_DELIVERY_MODE != dest_LowestPrio) ?
2593 MSI_DATA_DELIVERY_FIXED:
2594 MSI_DATA_DELIVERY_LOWPRI) |
2595- MSI_DATA_VECTOR(vector);
2596+ MSI_DATA_VECTOR(cfg->vector);
2597 }
2598- return vector;
2599+ return err;
2600 }
2601
2602 #ifdef CONFIG_SMP
2603 static void set_msi_irq_affinity(unsigned int irq, cpumask_t mask)
2604 {
2605+ struct irq_cfg *cfg = irq_cfg + irq;
2606 struct msi_msg msg;
2607 unsigned int dest;
2608 cpumask_t tmp;
2609- int vector;
2610
2611 cpus_and(tmp, mask, cpu_online_map);
2612 if (cpus_empty(tmp))
2613- tmp = TARGET_CPUS;
2614-
2615- cpus_and(mask, tmp, CPU_MASK_ALL);
2616+ return;
2617
2618- vector = assign_irq_vector(irq, mask, &tmp);
2619- if (vector < 0)
2620+ if (assign_irq_vector(irq, mask))
2621 return;
2622
2623+ cpus_and(tmp, cfg->domain, mask);
2624 dest = cpu_mask_to_apicid(tmp);
2625
2626 read_msi_msg(irq, &msg);
2627
2628 msg.data &= ~MSI_DATA_VECTOR_MASK;
2629- msg.data |= MSI_DATA_VECTOR(vector);
2630+ msg.data |= MSI_DATA_VECTOR(cfg->vector);
2631 msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
2632 msg.address_lo |= MSI_ADDR_DEST_ID(dest);
2633
2634 write_msi_msg(irq, &msg);
2635- set_native_irq_info(irq, mask);
2636+ irq_desc[irq].affinity = mask;
2637 }
2638 #endif /* CONFIG_SMP */
2639
2640@@ -1948,24 +1990,31 @@ static struct irq_chip msi_chip = {
2641 .retrigger = ioapic_retrigger_irq,
2642 };
2643
2644-int arch_setup_msi_irq(unsigned int irq, struct pci_dev *dev)
2645+int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
2646 {
2647 struct msi_msg msg;
2648- int ret;
2649+ int irq, ret;
2650+ irq = create_irq();
2651+ if (irq < 0)
2652+ return irq;
2653+
2654+ set_irq_msi(irq, desc);
2655 ret = msi_compose_msg(dev, irq, &msg);
2656- if (ret < 0)
2657+ if (ret < 0) {
2658+ destroy_irq(irq);
2659 return ret;
2660+ }
2661
2662 write_msi_msg(irq, &msg);
2663
2664 set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, "edge");
2665
2666- return 0;
2667+ return irq;
2668 }
2669
2670 void arch_teardown_msi_irq(unsigned int irq)
2671 {
2672- return;
2673+ destroy_irq(irq);
2674 }
2675
2676 #endif /* CONFIG_PCI_MSI */
2677@@ -1993,24 +2042,22 @@ static void target_ht_irq(unsigned int i
2678
2679 static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask)
2680 {
2681+ struct irq_cfg *cfg = irq_cfg + irq;
2682 unsigned int dest;
2683 cpumask_t tmp;
2684- int vector;
2685
2686 cpus_and(tmp, mask, cpu_online_map);
2687 if (cpus_empty(tmp))
2688- tmp = TARGET_CPUS;
2689-
2690- cpus_and(mask, tmp, CPU_MASK_ALL);
2691+ return;
2692
2693- vector = assign_irq_vector(irq, mask, &tmp);
2694- if (vector < 0)
2695+ if (assign_irq_vector(irq, mask))
2696 return;
2697
2698+ cpus_and(tmp, cfg->domain, mask);
2699 dest = cpu_mask_to_apicid(tmp);
2700
2701- target_ht_irq(irq, dest, vector);
2702- set_native_irq_info(irq, mask);
2703+ target_ht_irq(irq, dest, cfg->vector);
2704+ irq_desc[irq].affinity = mask;
2705 }
2706 #endif
2707
2708@@ -2027,14 +2074,17 @@ static struct irq_chip ht_irq_chip = {
2709
2710 int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
2711 {
2712- int vector;
2713+ struct irq_cfg *cfg = irq_cfg + irq;
2714+ int err;
2715 cpumask_t tmp;
2716
2717- vector = assign_irq_vector(irq, TARGET_CPUS, &tmp);
2718- if (vector >= 0) {
2719+ tmp = TARGET_CPUS;
2720+ err = assign_irq_vector(irq, tmp);
2721+ if (!err) {
2722 struct ht_irq_msg msg;
2723 unsigned dest;
2724
2725+ cpus_and(tmp, cfg->domain, tmp);
2726 dest = cpu_mask_to_apicid(tmp);
2727
2728 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
2729@@ -2042,7 +2092,7 @@ int arch_setup_ht_irq(unsigned int irq,
2730 msg.address_lo =
2731 HT_IRQ_LOW_BASE |
2732 HT_IRQ_LOW_DEST_ID(dest) |
2733- HT_IRQ_LOW_VECTOR(vector) |
2734+ HT_IRQ_LOW_VECTOR(cfg->vector) |
2735 ((INT_DEST_MODE == 0) ?
2736 HT_IRQ_LOW_DM_PHYSICAL :
2737 HT_IRQ_LOW_DM_LOGICAL) |
2738@@ -2057,7 +2107,7 @@ int arch_setup_ht_irq(unsigned int irq,
2739 set_irq_chip_and_handler_name(irq, &ht_irq_chip,
2740 handle_edge_irq, "edge");
2741 }
2742- return vector;
2743+ return err;
2744 }
2745 #endif /* CONFIG_HT_IRQ */
2746
2747@@ -2082,13 +2132,8 @@ int __init io_apic_get_redir_entries (in
2748 }
2749
2750
2751-int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low)
2752+int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int polarity)
2753 {
2754- struct IO_APIC_route_entry entry;
2755- unsigned long flags;
2756- int vector;
2757- cpumask_t mask;
2758-
2759 if (!IO_APIC_IRQ(irq)) {
2760 apic_printk(APIC_QUIET,KERN_ERR "IOAPIC[%d]: Invalid reference to IRQ 0\n",
2761 ioapic);
2762@@ -2101,42 +2146,7 @@ int io_apic_set_pci_routing (int ioapic,
2763 if (irq >= 16)
2764 add_pin_to_irq(irq, ioapic, pin);
2765
2766-
2767- vector = assign_irq_vector(irq, TARGET_CPUS, &mask);
2768- if (vector < 0)
2769- return vector;
2770-
2771- /*
2772- * Generate a PCI IRQ routing entry and program the IOAPIC accordingly.
2773- * Note that we mask (disable) IRQs now -- these get enabled when the
2774- * corresponding device driver registers for this IRQ.
2775- */
2776-
2777- memset(&entry,0,sizeof(entry));
2778-
2779- entry.delivery_mode = INT_DELIVERY_MODE;
2780- entry.dest_mode = INT_DEST_MODE;
2781- entry.dest.logical.logical_dest = cpu_mask_to_apicid(mask);
2782- entry.trigger = edge_level;
2783- entry.polarity = active_high_low;
2784- entry.mask = 1; /* Disabled (masked) */
2785- entry.vector = vector & 0xff;
2786-
2787- apic_printk(APIC_VERBOSE,KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> "
2788- "IRQ %d Mode:%i Active:%i)\n", ioapic,
2789- mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq,
2790- edge_level, active_high_low);
2791-
2792- ioapic_register_intr(irq, entry.vector, edge_level);
2793-
2794- if (!ioapic && (irq < 16))
2795- disable_8259A_irq(irq);
2796-
2797- ioapic_write_entry(ioapic, pin, entry);
2798-
2799- spin_lock_irqsave(&ioapic_lock, flags);
2800- set_native_irq_info(irq, TARGET_CPUS);
2801- spin_unlock_irqrestore(&ioapic_lock, flags);
2802+ setup_IO_APIC_irq(ioapic, pin, irq, triggering, polarity);
2803
2804 return 0;
2805 }
2806@@ -2169,8 +2179,10 @@ void __init setup_ioapic_dest(void)
2807 * when you have too many devices, because at that time only boot
2808 * cpu is online.
2809 */
2810- if(!irq_vector[irq])
2811- setup_IO_APIC_irq(ioapic, pin, irq_entry, irq);
2812+ if (!irq_cfg[irq].vector)
2813+ setup_IO_APIC_irq(ioapic, pin, irq,
2814+ irq_trigger(irq_entry),
2815+ irq_polarity(irq_entry));
2816 else
2817 set_ioapic_affinity_irq(irq, TARGET_CPUS);
2818 }
2819--- sle11-2009-05-14.orig/arch/x86/kernel/irq_64-xen.c 2008-12-15 11:26:44.000000000 +0100
2820+++ sle11-2009-05-14/arch/x86/kernel/irq_64-xen.c 2009-03-04 11:25:55.000000000 +0100
2821@@ -18,6 +18,7 @@
2822 #include <asm/uaccess.h>
2823 #include <asm/io_apic.h>
2824 #include <asm/idle.h>
2825+#include <asm/smp.h>
2826
2827 atomic_t irq_err_count;
2828
2829@@ -120,9 +121,15 @@ asmlinkage unsigned int do_IRQ(struct pt
2830
2831 if (likely(irq < NR_IRQS))
2832 generic_handle_irq(irq);
2833- else if (printk_ratelimit())
2834- printk(KERN_EMERG "%s: %d.%d No irq handler for irq\n",
2835- __func__, smp_processor_id(), irq);
2836+ else {
2837+#ifndef CONFIG_XEN
2838+ if (!disable_apic)
2839+ ack_APIC_irq();
2840+#endif
2841+ if (printk_ratelimit())
2842+ printk(KERN_EMERG "%s: %d.%d No irq handler for irq\n",
2843+ __func__, smp_processor_id(), irq);
2844+ }
2845
2846 /*irq_exit();*/
2847
2848--- sle11-2009-05-14.orig/arch/x86/kernel/mpparse_64-xen.c 2008-12-15 11:26:44.000000000 +0100
2849+++ sle11-2009-05-14/arch/x86/kernel/mpparse_64-xen.c 2009-03-04 11:25:55.000000000 +0100
2850@@ -60,9 +60,9 @@ unsigned long mp_lapic_addr = 0;
2851 /* Processor that is doing the boot up */
2852 unsigned int boot_cpu_id = -1U;
2853 /* Internal processor count */
2854-unsigned int num_processors __initdata = 0;
2855+unsigned int num_processors __cpuinitdata = 0;
2856
2857-unsigned disabled_cpus __initdata;
2858+unsigned disabled_cpus __cpuinitdata;
2859
2860 /* Bitmask of physically existing CPUs */
2861 physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE;
2862@@ -808,7 +808,7 @@ int mp_register_gsi(u32 gsi, int trigger
2863 return gsi;
2864
2865 /* Don't set up the ACPI SCI because it's already set up */
2866- if (acpi_fadt.sci_int == gsi)
2867+ if (acpi_gbl_FADT.sci_interrupt == gsi)
2868 return gsi;
2869
2870 ioapic = mp_find_ioapic(gsi);
2871--- sle11-2009-05-14.orig/arch/x86/kernel/process_64-xen.c 2008-12-15 11:26:44.000000000 +0100
2872+++ sle11-2009-05-14/arch/x86/kernel/process_64-xen.c 2009-03-04 11:25:55.000000000 +0100
2873@@ -338,14 +338,17 @@ void load_gs_index(unsigned gs)
2874 void flush_thread(void)
2875 {
2876 struct task_struct *tsk = current;
2877- struct thread_info *t = current_thread_info();
2878
2879- if (t->flags & _TIF_ABI_PENDING) {
2880- t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32);
2881- if (t->flags & _TIF_IA32)
2882+ if (test_tsk_thread_flag(tsk, TIF_ABI_PENDING)) {
2883+ clear_tsk_thread_flag(tsk, TIF_ABI_PENDING);
2884+ if (test_tsk_thread_flag(tsk, TIF_IA32)) {
2885+ clear_tsk_thread_flag(tsk, TIF_IA32);
2886+ } else {
2887+ set_tsk_thread_flag(tsk, TIF_IA32);
2888 current_thread_info()->status |= TS_COMPAT;
2889+ }
2890 }
2891- t->flags &= ~_TIF_DEBUG;
2892+ clear_tsk_thread_flag(tsk, TIF_DEBUG);
2893
2894 tsk->thread.debugreg0 = 0;
2895 tsk->thread.debugreg1 = 0;
2896--- sle11-2009-05-14.orig/arch/x86/kernel/setup_64-xen.c 2008-12-15 11:26:44.000000000 +0100
2897+++ sle11-2009-05-14/arch/x86/kernel/setup_64-xen.c 2009-03-04 11:25:55.000000000 +0100
2898@@ -141,7 +141,7 @@ EXPORT_SYMBOL_GPL(edid_info);
2899
2900 extern int root_mountflags;
2901
2902-char command_line[COMMAND_LINE_SIZE];
2903+char __initdata command_line[COMMAND_LINE_SIZE];
2904
2905 struct resource standard_io_resources[] = {
2906 { .name = "dma1", .start = 0x00, .end = 0x1f,
2907@@ -179,134 +179,6 @@ struct resource code_resource = {
2908 .flags = IORESOURCE_RAM,
2909 };
2910
2911-#define IORESOURCE_ROM (IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM)
2912-
2913-static struct resource system_rom_resource = {
2914- .name = "System ROM",
2915- .start = 0xf0000,
2916- .end = 0xfffff,
2917- .flags = IORESOURCE_ROM,
2918-};
2919-
2920-static struct resource extension_rom_resource = {
2921- .name = "Extension ROM",
2922- .start = 0xe0000,
2923- .end = 0xeffff,
2924- .flags = IORESOURCE_ROM,
2925-};
2926-
2927-static struct resource adapter_rom_resources[] = {
2928- { .name = "Adapter ROM", .start = 0xc8000, .end = 0,
2929- .flags = IORESOURCE_ROM },
2930- { .name = "Adapter ROM", .start = 0, .end = 0,
2931- .flags = IORESOURCE_ROM },
2932- { .name = "Adapter ROM", .start = 0, .end = 0,
2933- .flags = IORESOURCE_ROM },
2934- { .name = "Adapter ROM", .start = 0, .end = 0,
2935- .flags = IORESOURCE_ROM },
2936- { .name = "Adapter ROM", .start = 0, .end = 0,
2937- .flags = IORESOURCE_ROM },
2938- { .name = "Adapter ROM", .start = 0, .end = 0,
2939- .flags = IORESOURCE_ROM }
2940-};
2941-
2942-static struct resource video_rom_resource = {
2943- .name = "Video ROM",
2944- .start = 0xc0000,
2945- .end = 0xc7fff,
2946- .flags = IORESOURCE_ROM,
2947-};
2948-
2949-static struct resource video_ram_resource = {
2950- .name = "Video RAM area",
2951- .start = 0xa0000,
2952- .end = 0xbffff,
2953- .flags = IORESOURCE_RAM,
2954-};
2955-
2956-#define romsignature(x) (*(unsigned short *)(x) == 0xaa55)
2957-
2958-static int __init romchecksum(unsigned char *rom, unsigned long length)
2959-{
2960- unsigned char *p, sum = 0;
2961-
2962- for (p = rom; p < rom + length; p++)
2963- sum += *p;
2964- return sum == 0;
2965-}
2966-
2967-static void __init probe_roms(void)
2968-{
2969- unsigned long start, length, upper;
2970- unsigned char *rom;
2971- int i;
2972-
2973-#ifdef CONFIG_XEN
2974- /* Nothing to do if not running in dom0. */
2975- if (!is_initial_xendomain())
2976- return;
2977-#endif
2978-
2979- /* video rom */
2980- upper = adapter_rom_resources[0].start;
2981- for (start = video_rom_resource.start; start < upper; start += 2048) {
2982- rom = isa_bus_to_virt(start);
2983- if (!romsignature(rom))
2984- continue;
2985-
2986- video_rom_resource.start = start;
2987-
2988- /* 0 < length <= 0x7f * 512, historically */
2989- length = rom[2] * 512;
2990-
2991- /* if checksum okay, trust length byte */
2992- if (length && romchecksum(rom, length))
2993- video_rom_resource.end = start + length - 1;
2994-
2995- request_resource(&iomem_resource, &video_rom_resource);
2996- break;
2997- }
2998-
2999- start = (video_rom_resource.end + 1 + 2047) & ~2047UL;
3000- if (start < upper)
3001- start = upper;
3002-
3003- /* system rom */
3004- request_resource(&iomem_resource, &system_rom_resource);
3005- upper = system_rom_resource.start;
3006-
3007- /* check for extension rom (ignore length byte!) */
3008- rom = isa_bus_to_virt(extension_rom_resource.start);
3009- if (romsignature(rom)) {
3010- length = extension_rom_resource.end - extension_rom_resource.start + 1;
3011- if (romchecksum(rom, length)) {
3012- request_resource(&iomem_resource, &extension_rom_resource);
3013- upper = extension_rom_resource.start;
3014- }
3015- }
3016-
3017- /* check for adapter roms on 2k boundaries */
3018- for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper;
3019- start += 2048) {
3020- rom = isa_bus_to_virt(start);
3021- if (!romsignature(rom))
3022- continue;
3023-
3024- /* 0 < length <= 0x7f * 512, historically */
3025- length = rom[2] * 512;
3026-
3027- /* but accept any length that fits if checksum okay */
3028- if (!length || start + length > upper || !romchecksum(rom, length))
3029- continue;
3030-
3031- adapter_rom_resources[i].start = start;
3032- adapter_rom_resources[i].end = start + length - 1;
3033- request_resource(&iomem_resource, &adapter_rom_resources[i]);
3034-
3035- start = adapter_rom_resources[i++].end & ~2047UL;
3036- }
3037-}
3038-
3039 #ifdef CONFIG_PROC_VMCORE
3040 /* elfcorehdr= specifies the location of elf core header
3041 * stored by the crashed kernel. This option will be passed
3042@@ -403,7 +275,7 @@ void __init setup_arch(char **cmdline_p)
3043 #ifdef CONFIG_XEN
3044 extern struct e820map machine_e820;
3045
3046- printk(KERN_INFO "Command line: %s\n", saved_command_line);
3047+ printk(KERN_INFO "Command line: %s\n", boot_command_line);
3048
3049 /* Register a call for panic conditions. */
3050 atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block);
3051@@ -430,7 +302,7 @@ void __init setup_arch(char **cmdline_p)
3052
3053 ARCH_SETUP
3054 #else
3055- printk(KERN_INFO "Command line: %s\n", saved_command_line);
3056+ printk(KERN_INFO "Command line: %s\n", boot_command_line);
3057
3058 ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
3059 screen_info = SCREEN_INFO;
3060@@ -461,7 +333,7 @@ void __init setup_arch(char **cmdline_p)
3061
3062 early_identify_cpu(&boot_cpu_data);
3063
3064- strlcpy(command_line, saved_command_line, COMMAND_LINE_SIZE);
3065+ strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
3066 *cmdline_p = command_line;
3067
3068 parse_early_param();
3069@@ -531,6 +403,11 @@ void __init setup_arch(char **cmdline_p)
3070 /* reserve ebda region */
3071 if (ebda_addr)
3072 reserve_bootmem_generic(ebda_addr, ebda_size);
3073+#ifdef CONFIG_NUMA
3074+ /* reserve nodemap region */
3075+ if (nodemap_addr)
3076+ reserve_bootmem_generic(nodemap_addr, nodemap_size);
3077+#endif
3078
3079 #ifdef CONFIG_SMP
3080 /*
3081@@ -731,10 +608,8 @@ void __init setup_arch(char **cmdline_p)
3082 #endif
3083
3084 /*
3085- * Request address space for all standard RAM and ROM resources
3086- * and also for regions reported as reserved by the e820.
3087+ * We trust e820 completely. No explicit ROM probing in memory.
3088 */
3089- probe_roms();
3090 #ifdef CONFIG_XEN
3091 if (is_initial_xendomain())
3092 e820_reserve_resources(machine_e820.map, machine_e820.nr_map);
3093@@ -743,8 +618,6 @@ void __init setup_arch(char **cmdline_p)
3094 e820_mark_nosave_regions();
3095 #endif
3096
3097- request_resource(&iomem_resource, &video_ram_resource);
3098-
3099 {
3100 unsigned i;
3101 /* request I/O space for devices used on all i[345]86 PCs */
3102@@ -1321,7 +1194,8 @@ static int show_cpuinfo(struct seq_file
3103 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3104 NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
3105 NULL, NULL, NULL, NULL, "nx", NULL, "mmxext", NULL,
3106- NULL, "fxsr_opt", NULL, "rdtscp", NULL, "lm", "3dnowext", "3dnow",
3107+ NULL, "fxsr_opt", "pdpe1gb", "rdtscp", NULL, "lm",
3108+ "3dnowext", "3dnow",
3109
3110 /* Transmeta-defined */
3111 "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL,
3112@@ -1339,7 +1213,7 @@ static int show_cpuinfo(struct seq_file
3113 /* Intel-defined (#2) */
3114 "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", "smx", "est",
3115 "tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL,
3116- NULL, NULL, "dca", NULL, NULL, NULL, NULL, NULL,
3117+ NULL, NULL, "dca", NULL, NULL, NULL, NULL, "popcnt",
3118 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3119
3120 /* VIA/Cyrix/Centaur-defined */
3121@@ -1349,8 +1223,10 @@ static int show_cpuinfo(struct seq_file
3122 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3123
3124 /* AMD-defined (#2) */
3125- "lahf_lm", "cmp_legacy", "svm", NULL, "cr8_legacy", NULL, NULL, NULL,
3126- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3127+ "lahf_lm", "cmp_legacy", "svm", "extapic", "cr8_legacy",
3128+ "altmovcr8", "abm", "sse4a",
3129+ "misalignsse", "3dnowprefetch",
3130+ "osvw", "ibs", NULL, NULL, NULL, NULL,
3131 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3132 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
3133 };
3134@@ -1361,6 +1237,9 @@ static int show_cpuinfo(struct seq_file
3135 "ttp", /* thermal trip */
3136 "tm",
3137 "stc",
3138+ "100mhzsteps",
3139+ "hwpstate",
3140+ NULL, /* tsc invariant mapped to constant_tsc */
3141 NULL,
3142 /* nothing */ /* constant_tsc - moved to flags */
3143 };
3144@@ -1477,26 +1356,3 @@ struct seq_operations cpuinfo_op = {
3145 .stop = c_stop,
3146 .show = show_cpuinfo,
3147 };
3148-
3149-#if defined(CONFIG_INPUT_PCSPKR) || defined(CONFIG_INPUT_PCSPKR_MODULE)
3150-#include <linux/platform_device.h>
3151-static __init int add_pcspkr(void)
3152-{
3153- struct platform_device *pd;
3154- int ret;
3155-
3156- if (!is_initial_xendomain())
3157- return 0;
3158-
3159- pd = platform_device_alloc("pcspkr", -1);
3160- if (!pd)
3161- return -ENOMEM;
3162-
3163- ret = platform_device_add(pd);
3164- if (ret)
3165- platform_device_put(pd);
3166-
3167- return ret;
3168-}
3169-device_initcall(add_pcspkr);
3170-#endif
3171--- sle11-2009-05-14.orig/arch/x86/kernel/vsyscall_64-xen.c 2008-12-15 11:26:44.000000000 +0100
3172+++ sle11-2009-05-14/arch/x86/kernel/vsyscall_64-xen.c 2009-03-04 11:25:55.000000000 +0100
3173@@ -26,6 +26,7 @@
3174 #include <linux/seqlock.h>
3175 #include <linux/jiffies.h>
3176 #include <linux/sysctl.h>
3177+#include <linux/clocksource.h>
3178 #include <linux/getcpu.h>
3179 #include <linux/cpu.h>
3180 #include <linux/smp.h>
3181@@ -34,6 +35,7 @@
3182 #include <asm/vsyscall.h>
3183 #include <asm/pgtable.h>
3184 #include <asm/page.h>
3185+#include <asm/unistd.h>
3186 #include <asm/fixmap.h>
3187 #include <asm/errno.h>
3188 #include <asm/io.h>
3189@@ -44,56 +46,41 @@
3190 #define __vsyscall(nr) __attribute__ ((unused,__section__(".vsyscall_" #nr)))
3191 #define __syscall_clobber "r11","rcx","memory"
3192
3193-int __sysctl_vsyscall __section_sysctl_vsyscall = 1;
3194-seqlock_t __xtime_lock __section_xtime_lock = SEQLOCK_UNLOCKED;
3195+struct vsyscall_gtod_data_t {
3196+ seqlock_t lock;
3197+ int sysctl_enabled;
3198+ struct timeval wall_time_tv;
3199+ struct timezone sys_tz;
3200+ cycle_t offset_base;
3201+ struct clocksource clock;
3202+};
3203 int __vgetcpu_mode __section_vgetcpu_mode;
3204
3205-#include <asm/unistd.h>
3206-
3207-static __always_inline void timeval_normalize(struct timeval * tv)
3208+struct vsyscall_gtod_data_t __vsyscall_gtod_data __section_vsyscall_gtod_data =
3209 {
3210- time_t __sec;
3211-
3212- __sec = tv->tv_usec / 1000000;
3213- if (__sec) {
3214- tv->tv_usec %= 1000000;
3215- tv->tv_sec += __sec;
3216- }
3217-}
3218+ .lock = SEQLOCK_UNLOCKED,
3219+ .sysctl_enabled = 1,
3220+};
3221
3222-static __always_inline void do_vgettimeofday(struct timeval * tv)
3223+void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
3224 {
3225- long sequence, t;
3226- unsigned long sec, usec;
3227+ unsigned long flags;
3228
3229- do {
3230- sequence = read_seqbegin(&__xtime_lock);
3231-
3232- sec = __xtime.tv_sec;
3233- usec = __xtime.tv_nsec / 1000;
3234-
3235- if (__vxtime.mode != VXTIME_HPET) {
3236- t = get_cycles_sync();
3237- if (t < __vxtime.last_tsc)
3238- t = __vxtime.last_tsc;
3239- usec += ((t - __vxtime.last_tsc) *
3240- __vxtime.tsc_quot) >> 32;
3241- /* See comment in x86_64 do_gettimeofday. */
3242- } else {
3243- usec += ((readl((void __iomem *)
3244- fix_to_virt(VSYSCALL_HPET) + 0xf0) -
3245- __vxtime.last) * __vxtime.quot) >> 32;
3246- }
3247- } while (read_seqretry(&__xtime_lock, sequence));
3248-
3249- tv->tv_sec = sec + usec / 1000000;
3250- tv->tv_usec = usec % 1000000;
3251+ write_seqlock_irqsave(&vsyscall_gtod_data.lock, flags);
3252+ /* copy vsyscall data */
3253+ vsyscall_gtod_data.clock = *clock;
3254+ vsyscall_gtod_data.wall_time_tv.tv_sec = wall_time->tv_sec;
3255+ vsyscall_gtod_data.wall_time_tv.tv_usec = wall_time->tv_nsec/1000;
3256+ vsyscall_gtod_data.sys_tz = sys_tz;
3257+ write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags);
3258 }
3259
3260-/* RED-PEN may want to readd seq locking, but then the variable should be write-once. */
3261+/* RED-PEN may want to readd seq locking, but then the variable should be
3262+ * write-once.
3263+ */
3264 static __always_inline void do_get_tz(struct timezone * tz)
3265 {
3266- *tz = __sys_tz;
3267+ *tz = __vsyscall_gtod_data.sys_tz;
3268 }
3269
3270 static __always_inline int gettimeofday(struct timeval *tv, struct timezone *tz)
3271@@ -101,7 +88,8 @@ static __always_inline int gettimeofday(
3272 int ret;
3273 asm volatile("vsysc2: syscall"
3274 : "=a" (ret)
3275- : "0" (__NR_gettimeofday),"D" (tv),"S" (tz) : __syscall_clobber );
3276+ : "0" (__NR_gettimeofday),"D" (tv),"S" (tz)
3277+ : __syscall_clobber );
3278 return ret;
3279 }
3280
3281@@ -114,10 +102,44 @@ static __always_inline long time_syscall
3282 return secs;
3283 }
3284
3285+static __always_inline void do_vgettimeofday(struct timeval * tv)
3286+{
3287+ cycle_t now, base, mask, cycle_delta;
3288+ unsigned long seq, mult, shift, nsec_delta;
3289+ cycle_t (*vread)(void);
3290+ do {
3291+ seq = read_seqbegin(&__vsyscall_gtod_data.lock);
3292+
3293+ vread = __vsyscall_gtod_data.clock.vread;
3294+ if (unlikely(!__vsyscall_gtod_data.sysctl_enabled || !vread)) {
3295+ gettimeofday(tv,NULL);
3296+ return;
3297+ }
3298+ now = vread();
3299+ base = __vsyscall_gtod_data.clock.cycle_last;
3300+ mask = __vsyscall_gtod_data.clock.mask;
3301+ mult = __vsyscall_gtod_data.clock.mult;
3302+ shift = __vsyscall_gtod_data.clock.shift;
3303+
3304+ *tv = __vsyscall_gtod_data.wall_time_tv;
3305+
3306+ } while (read_seqretry(&__vsyscall_gtod_data.lock, seq));
3307+
3308+ /* calculate interval: */
3309+ cycle_delta = (now - base) & mask;
3310+ /* convert to nsecs: */
3311+ nsec_delta = (cycle_delta * mult) >> shift;
3312+
3313+ /* convert to usecs and add to timespec: */
3314+ tv->tv_usec += nsec_delta / NSEC_PER_USEC;
3315+ while (tv->tv_usec > USEC_PER_SEC) {
3316+ tv->tv_sec += 1;
3317+ tv->tv_usec -= USEC_PER_SEC;
3318+ }
3319+}
3320+
3321 int __vsyscall(0) vgettimeofday(struct timeval * tv, struct timezone * tz)
3322 {
3323- if (!__sysctl_vsyscall)
3324- return gettimeofday(tv,tz);
3325 if (tv)
3326 do_vgettimeofday(tv);
3327 if (tz)
3328@@ -129,11 +151,11 @@ int __vsyscall(0) vgettimeofday(struct t
3329 * unlikely */
3330 time_t __vsyscall(1) vtime(time_t *t)
3331 {
3332- if (!__sysctl_vsyscall)
3333+ if (unlikely(!__vsyscall_gtod_data.sysctl_enabled))
3334 return time_syscall(t);
3335 else if (t)
3336- *t = __xtime.tv_sec;
3337- return __xtime.tv_sec;
3338+ *t = __vsyscall_gtod_data.wall_time_tv.tv_sec;
3339+ return __vsyscall_gtod_data.wall_time_tv.tv_sec;
3340 }
3341
3342 /* Fast way to get current CPU and node.
3343@@ -210,7 +232,7 @@ static int vsyscall_sysctl_change(ctl_ta
3344 ret = -ENOMEM;
3345 goto out;
3346 }
3347- if (!sysctl_vsyscall) {
3348+ if (!vsyscall_gtod_data.sysctl_enabled) {
3349 writew(SYSCALL, map1);
3350 writew(SYSCALL, map2);
3351 } else {
3352@@ -232,16 +254,17 @@ static int vsyscall_sysctl_nostrat(ctl_t
3353
3354 static ctl_table kernel_table2[] = {
3355 { .ctl_name = 99, .procname = "vsyscall64",
3356- .data = &sysctl_vsyscall, .maxlen = sizeof(int), .mode = 0644,
3357+ .data = &vsyscall_gtod_data.sysctl_enabled, .maxlen = sizeof(int),
3358+ .mode = 0644,
3359 .strategy = vsyscall_sysctl_nostrat,
3360 .proc_handler = vsyscall_sysctl_change },
3361- { 0, }
3362+ {}
3363 };
3364
3365 static ctl_table kernel_root_table2[] = {
3366 { .ctl_name = CTL_KERN, .procname = "kernel", .mode = 0555,
3367 .child = kernel_table2 },
3368- { 0 },
3369+ {}
3370 };
3371
3372 #endif
3373@@ -304,14 +327,14 @@ static int __init vsyscall_init(void)
3374 BUG_ON((unsigned long) &vgetcpu != VSYSCALL_ADDR(__NR_vgetcpu));
3375 map_vsyscall();
3376 #ifdef CONFIG_XEN
3377- sysctl_vsyscall = 0; /* disable vgettimeofay() */
3378+ vsyscall_gtod_data.sysctl_enabled = 0; /* disable vgettimeofay() */
3379 if (boot_cpu_has(X86_FEATURE_RDTSCP))
3380 vgetcpu_mode = VGETCPU_RDTSCP;
3381 else
3382 vgetcpu_mode = VGETCPU_LSL;
3383 #endif
3384 #ifdef CONFIG_SYSCTL
3385- register_sysctl_table(kernel_root_table2, 0);
3386+ register_sysctl_table(kernel_root_table2);
3387 #endif
3388 on_each_cpu(cpu_vsyscall_init, NULL, 0, 1);
3389 hotcpu_notifier(cpu_vsyscall_notifier, 0);
3390--- sle11-2009-05-14.orig/arch/x86/mm/fault_64-xen.c 2008-12-15 11:26:44.000000000 +0100
3391+++ sle11-2009-05-14/arch/x86/mm/fault_64-xen.c 2009-03-04 11:25:55.000000000 +0100
3392@@ -56,38 +56,17 @@ int unregister_page_fault_notifier(struc
3393 }
3394 EXPORT_SYMBOL_GPL(unregister_page_fault_notifier);
3395
3396-static inline int notify_page_fault(enum die_val val, const char *str,
3397- struct pt_regs *regs, long err, int trap, int sig)
3398+static inline int notify_page_fault(struct pt_regs *regs, long err)
3399 {
3400 struct die_args args = {
3401 .regs = regs,
3402- .str = str,
3403+ .str = "page fault",
3404 .err = err,
3405- .trapnr = trap,
3406- .signr = sig
3407+ .trapnr = 14,
3408+ .signr = SIGSEGV
3409 };
3410- return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args);
3411-}
3412-
3413-void bust_spinlocks(int yes)
3414-{
3415- int loglevel_save = console_loglevel;
3416- if (yes) {
3417- oops_in_progress = 1;
3418- } else {
3419-#ifdef CONFIG_VT
3420- unblank_screen();
3421-#endif
3422- oops_in_progress = 0;
3423- /*
3424- * OK, the message is on the console. Now we call printk()
3425- * without oops_in_progress set so that printk will give klogd
3426- * a poke. Hold onto your hats...
3427- */
3428- console_loglevel = 15; /* NMI oopser may have shut the console up */
3429- printk(" ");
3430- console_loglevel = loglevel_save;
3431- }
3432+ return atomic_notifier_call_chain(&notify_page_fault_chain,
3433+ DIE_PAGE_FAULT, &args);
3434 }
3435
3436 /* Sometimes the CPU reports invalid exceptions on prefetch.
3437@@ -437,8 +416,7 @@ asmlinkage void __kprobes do_page_fault(
3438 /* Can take a spurious fault if mapping changes R/O -> R/W. */
3439 if (spurious_fault(regs, address, error_code))
3440 return;
3441- if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
3442- SIGSEGV) == NOTIFY_STOP)
3443+ if (notify_page_fault(regs, error_code) == NOTIFY_STOP)
3444 return;
3445 /*
3446 * Don't take the mm semaphore here. If we fixup a prefetch
3447@@ -447,8 +425,7 @@ asmlinkage void __kprobes do_page_fault(
3448 goto bad_area_nosemaphore;
3449 }
3450
3451- if (notify_page_fault(DIE_PAGE_FAULT, "page fault", regs, error_code, 14,
3452- SIGSEGV) == NOTIFY_STOP)
3453+ if (notify_page_fault(regs, error_code) == NOTIFY_STOP)
3454 return;
3455
3456 if (likely(regs->eflags & X86_EFLAGS_IF))
3457--- sle11-2009-05-14.orig/arch/x86/mm/init_64-xen.c 2008-12-15 11:26:44.000000000 +0100
3458+++ sle11-2009-05-14/arch/x86/mm/init_64-xen.c 2009-03-04 11:25:55.000000000 +0100
3459@@ -1108,20 +1108,30 @@ int kern_addr_valid(unsigned long addr)
3460 extern int exception_trace, page_fault_trace;
3461
3462 static ctl_table debug_table2[] = {
3463- { 99, "exception-trace", &exception_trace, sizeof(int), 0644, NULL,
3464- proc_dointvec },
3465- { 0, }
3466+ {
3467+ .ctl_name = 99,
3468+ .procname = "exception-trace",
3469+ .data = &exception_trace,
3470+ .maxlen = sizeof(int),
3471+ .mode = 0644,
3472+ .proc_handler = proc_dointvec
3473+ },
3474+ {}
3475 };
3476
3477 static ctl_table debug_root_table2[] = {
3478- { .ctl_name = CTL_DEBUG, .procname = "debug", .mode = 0555,
3479- .child = debug_table2 },
3480- { 0 },
3481+ {
3482+ .ctl_name = CTL_DEBUG,
3483+ .procname = "debug",
3484+ .mode = 0555,
3485+ .child = debug_table2
3486+ },
3487+ {}
3488 };
3489
3490 static __init int x8664_sysctl_init(void)
3491 {
3492- register_sysctl_table(debug_root_table2, 1);
3493+ register_sysctl_table(debug_root_table2);
3494 return 0;
3495 }
3496 __initcall(x8664_sysctl_init);
3497--- sle11-2009-05-14.orig/arch/x86/mm/pageattr_64-xen.c 2008-12-15 11:26:44.000000000 +0100
3498+++ sle11-2009-05-14/arch/x86/mm/pageattr_64-xen.c 2009-03-04 11:25:55.000000000 +0100
3499@@ -350,8 +350,8 @@ static void flush_kernel_map(void *arg)
3500 void *adr = page_address(pg);
3501 if (cpu_has_clflush)
3502 cache_flush_page(adr);
3503- __flush_tlb_one(adr);
3504 }
3505+ __flush_tlb_all();
3506 }
3507
3508 static inline void flush_map(struct list_head *l)
3509@@ -376,6 +376,7 @@ static void revert_page(unsigned long ad
3510 pud_t *pud;
3511 pmd_t *pmd;
3512 pte_t large_pte;
3513+ unsigned long pfn;
3514
3515 pgd = pgd_offset_k(address);
3516 BUG_ON(pgd_none(*pgd));
3517@@ -383,7 +384,8 @@ static void revert_page(unsigned long ad
3518 BUG_ON(pud_none(*pud));
3519 pmd = pmd_offset(pud, address);
3520 BUG_ON(__pmd_val(*pmd) & _PAGE_PSE);
3521- large_pte = mk_pte_phys(__pa(address) & LARGE_PAGE_MASK, ref_prot);
3522+ pfn = (__pa(address) & LARGE_PAGE_MASK) >> PAGE_SHIFT;
3523+ large_pte = pfn_pte(pfn, ref_prot);
3524 large_pte = pte_mkhuge(large_pte);
3525 set_pte((pte_t *)pmd, large_pte);
3526 }
3527--- sle11-2009-05-14.orig/drivers/acpi/processor_extcntl.c 2009-02-16 15:58:14.000000000 +0100
3528+++ sle11-2009-05-14/drivers/acpi/processor_extcntl.c 2009-03-04 11:25:55.000000000 +0100
3529@@ -32,9 +32,8 @@
3530
3531 #define ACPI_PROCESSOR_COMPONENT 0x01000000
3532 #define ACPI_PROCESSOR_CLASS "processor"
3533-#define ACPI_PROCESSOR_DRIVER_NAME "ACPI Processor Driver"
3534 #define _COMPONENT ACPI_PROCESSOR_COMPONENT
3535-ACPI_MODULE_NAME("acpi_processor")
3536+ACPI_MODULE_NAME("processor_extcntl")
3537
3538 static int processor_extcntl_parse_csd(struct acpi_processor *pr);
3539 static int processor_extcntl_get_performance(struct acpi_processor *pr);
3540@@ -56,24 +55,17 @@ static int processor_notify_smm(void)
3541 return 0;
3542
3543 /* Can't write pstate_cnt to smi_cmd if either value is zero */
3544- if ((!acpi_fadt.smi_cmd) || (!acpi_fadt.pstate_cnt)) {
3545+ if (!acpi_gbl_FADT.smi_command || !acpi_gbl_FADT.pstate_control) {
3546 ACPI_DEBUG_PRINT((ACPI_DB_INFO,"No SMI port or pstate_cnt\n"));
3547 return 0;
3548 }
3549
3550 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
3551 "Writing pstate_cnt [0x%x] to smi_cmd [0x%x]\n",
3552- acpi_fadt.pstate_cnt, acpi_fadt.smi_cmd));
3553+ acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command));
3554
3555- /* FADT v1 doesn't support pstate_cnt, many BIOS vendors use
3556- * it anyway, so we need to support it... */
3557- if (acpi_fadt_is_v1) {
3558- ACPI_DEBUG_PRINT((ACPI_DB_INFO,
3559- "Using v1.0 FADT reserved value for pstate_cnt\n"));
3560- }
3561-
3562- status = acpi_os_write_port(acpi_fadt.smi_cmd,
3563- (u32) acpi_fadt.pstate_cnt, 8);
3564+ status = acpi_os_write_port(acpi_gbl_FADT.smi_command,
3565+ acpi_gbl_FADT.pstate_control, 8);
3566 if (ACPI_FAILURE(status))
3567 return status;
3568
3569--- sle11-2009-05-14.orig/drivers/char/tpm/tpm_xen.c 2009-03-04 11:28:34.000000000 +0100
3570+++ sle11-2009-05-14/drivers/char/tpm/tpm_xen.c 2009-03-04 11:25:55.000000000 +0100
3571@@ -481,7 +481,6 @@ static struct xenbus_device_id tpmfront_
3572
3573 static struct xenbus_driver tpmfront = {
3574 .name = "vtpm",
3575- .owner = THIS_MODULE,
3576 .ids = tpmfront_ids,
3577 .probe = tpmfront_probe,
3578 .remove = tpmfront_remove,
3579@@ -491,9 +490,9 @@ static struct xenbus_driver tpmfront = {
3580 .suspend_cancel = tpmfront_suspend_cancel,
3581 };
3582
3583-static void __init init_tpm_xenbus(void)
3584+static int __init init_tpm_xenbus(void)
3585 {
3586- xenbus_register_frontend(&tpmfront);
3587+ return xenbus_register_frontend(&tpmfront);
3588 }
3589
3590 static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
3591--- sle11-2009-05-14.orig/drivers/pci/msi-xen.c 2008-12-15 11:26:44.000000000 +0100
3592+++ sle11-2009-05-14/drivers/pci/msi-xen.c 2009-03-04 11:25:55.000000000 +0100
3593@@ -44,6 +44,36 @@ struct msi_pirq_entry {
3594 int entry_nr;
3595 };
3596
3597+static void msi_set_enable(struct pci_dev *dev, int enable)
3598+{
3599+ int pos;
3600+ u16 control;
3601+
3602+ pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
3603+ if (pos) {
3604+ pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control);
3605+ control &= ~PCI_MSI_FLAGS_ENABLE;
3606+ if (enable)
3607+ control |= PCI_MSI_FLAGS_ENABLE;
3608+ pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control);
3609+ }
3610+}
3611+
3612+static void msix_set_enable(struct pci_dev *dev, int enable)
3613+{
3614+ int pos;
3615+ u16 control;
3616+
3617+ pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
3618+ if (pos) {
3619+ pci_read_config_word(dev, pos + PCI_MSIX_FLAGS, &control);
3620+ control &= ~PCI_MSIX_FLAGS_ENABLE;
3621+ if (enable)
3622+ control |= PCI_MSIX_FLAGS_ENABLE;
3623+ pci_write_config_word(dev, pos + PCI_MSIX_FLAGS, control);
3624+ }
3625+}
3626+
3627 static struct msi_dev_list *get_msi_dev_pirq_list(struct pci_dev *dev)
3628 {
3629 struct msi_dev_list *msi_dev_list, *ret = NULL;
3630@@ -235,126 +265,26 @@ static int msi_map_vector(struct pci_dev
3631
3632 static int msi_init(void)
3633 {
3634- static int status = 0;
3635-
3636- if (pci_msi_quirk) {
3637- pci_msi_enable = 0;
3638- printk(KERN_WARNING "PCI: MSI quirk detected. MSI disabled.\n");
3639- status = -EINVAL;
3640- }
3641-
3642- return status;
3643-}
3644-
3645-void pci_scan_msi_device(struct pci_dev *dev) { }
3646-
3647-void disable_msi_mode(struct pci_dev *dev, int pos, int type)
3648-{
3649- u16 control;
3650-
3651- pci_read_config_word(dev, msi_control_reg(pos), &control);
3652- if (type == PCI_CAP_ID_MSI) {
3653- /* Set enabled bits to single MSI & enable MSI_enable bit */
3654- msi_disable(control);
3655- pci_write_config_word(dev, msi_control_reg(pos), control);
3656- dev->msi_enabled = 0;
3657- } else {
3658- msix_disable(control);
3659- pci_write_config_word(dev, msi_control_reg(pos), control);
3660- dev->msix_enabled = 0;
3661- }
3662-
3663- pci_intx(dev, 1); /* enable intx */
3664-}
3665-
3666-static void enable_msi_mode(struct pci_dev *dev, int pos, int type)
3667-{
3668- u16 control;
3669-
3670- pci_read_config_word(dev, msi_control_reg(pos), &control);
3671- if (type == PCI_CAP_ID_MSI) {
3672- /* Set enabled bits to single MSI & enable MSI_enable bit */
3673- msi_enable(control, 1);
3674- pci_write_config_word(dev, msi_control_reg(pos), control);
3675- dev->msi_enabled = 1;
3676- } else {
3677- msix_enable(control);
3678- pci_write_config_word(dev, msi_control_reg(pos), control);
3679- dev->msix_enabled = 1;
3680- }
3681-
3682- pci_intx(dev, 0); /* disable intx */
3683+ return 0;
3684 }
3685
3686 #ifdef CONFIG_PM
3687-int pci_save_msi_state(struct pci_dev *dev)
3688+static void __pci_restore_msi_state(struct pci_dev *dev)
3689 {
3690- int pos;
3691-
3692- pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
3693- if (pos <= 0 || dev->no_msi)
3694- return 0;
3695+ int pirq;
3696
3697 if (!dev->msi_enabled)
3698- return 0;
3699-
3700- /* Restore dev->irq to its default pin-assertion vector */
3701- msi_unmap_pirq(dev, dev->irq);
3702- /* Disable MSI mode */
3703- disable_msi_mode(dev, pos, PCI_CAP_ID_MSI);
3704- /* Set the flags for use of restore */
3705- dev->msi_enabled = 1;
3706- return 0;
3707-}
3708-
3709-void pci_restore_msi_state(struct pci_dev *dev)
3710-{
3711- int pos, pirq;
3712-
3713- pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
3714- if (pos <= 0)
3715 return;
3716
3717- if (!dev->msi_enabled)
3718- return;
3719+ pci_intx(dev, 0); /* disable intx */
3720+ msi_set_enable(dev, 0);
3721
3722 pirq = msi_map_pirq_to_vector(dev, dev->irq, 0, 0);
3723 if (pirq < 0)
3724 return;
3725- enable_msi_mode(dev, pos, PCI_CAP_ID_MSI);
3726 }
3727
3728-int pci_save_msix_state(struct pci_dev *dev)
3729-{
3730- int pos;
3731- unsigned long flags;
3732- struct msi_dev_list *msi_dev_entry;
3733- struct msi_pirq_entry *pirq_entry, *tmp;
3734-
3735- pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
3736- if (pos <= 0 || dev->no_msi)
3737- return 0;
3738-
3739- /* save the capability */
3740- if (!dev->msix_enabled)
3741- return 0;
3742-
3743- msi_dev_entry = get_msi_dev_pirq_list(dev);
3744-
3745- spin_lock_irqsave(&msi_dev_entry->pirq_list_lock, flags);
3746- list_for_each_entry_safe(pirq_entry, tmp,
3747- &msi_dev_entry->pirq_list_head, list)
3748- msi_unmap_pirq(dev, pirq_entry->pirq);
3749- spin_unlock_irqrestore(&msi_dev_entry->pirq_list_lock, flags);
3750-
3751- disable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
3752- /* Set the flags for use of restore */
3753- dev->msix_enabled = 1;
3754-
3755- return 0;
3756-}
3757-
3758-void pci_restore_msix_state(struct pci_dev *dev)
3759+static void __pci_restore_msix_state(struct pci_dev *dev)
3760 {
3761 int pos;
3762 unsigned long flags;
3763@@ -369,6 +299,9 @@ void pci_restore_msix_state(struct pci_d
3764 if (!dev->msix_enabled)
3765 return;
3766
3767+ pci_intx(dev, 0); /* disable intx */
3768+ msix_set_enable(dev, 0);
3769+
3770 msi_dev_entry = get_msi_dev_pirq_list(dev);
3771 table_base = find_table_base(dev, pos);
3772 if (!table_base)
3773@@ -386,10 +319,14 @@ void pci_restore_msix_state(struct pci_d
3774 pirq_entry->pirq, rc);
3775 }
3776 spin_unlock_irqrestore(&msi_dev_entry->pirq_list_lock, flags);
3777+}
3778
3779- enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
3780+void pci_restore_msi_state(struct pci_dev *dev)
3781+{
3782+ __pci_restore_msi_state(dev);
3783+ __pci_restore_msix_state(dev);
3784 }
3785-#endif
3786+#endif /* CONFIG_PM */
3787
3788 /**
3789 * msi_capability_init - configure device's MSI capability structure
3790@@ -405,6 +342,8 @@ static int msi_capability_init(struct pc
3791 int pos, pirq;
3792 u16 control;
3793
3794+ msi_set_enable(dev, 0); /* Ensure msi is disabled as I set it up */
3795+
3796 pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
3797 pci_read_config_word(dev, msi_control_reg(pos), &control);
3798
3799@@ -413,7 +352,8 @@ static int msi_capability_init(struct pc
3800 return -EBUSY;
3801
3802 /* Set MSI enabled bits */
3803- enable_msi_mode(dev, pos, PCI_CAP_ID_MSI);
3804+ pci_intx(dev, 0); /* disable intx */
3805+ msi_set_enable(dev, 1);
3806 dev->msi_enabled = 1;
3807
3808 dev->irq = pirq;
3809@@ -441,6 +381,8 @@ static int msix_capability_init(struct p
3810 if (!msi_dev_entry)
3811 return -ENOMEM;
3812
3813+ msix_set_enable(dev, 0);/* Ensure msix is disabled as I set it up */
3814+
3815 pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
3816 table_base = find_table_base(dev, pos);
3817 if (!table_base)
3818@@ -484,7 +426,8 @@ static int msix_capability_init(struct p
3819 return avail;
3820 }
3821
3822- enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
3823+ pci_intx(dev, 0); /* disable intx */
3824+ msix_set_enable(dev, 1);
3825 dev->msix_enabled = 1;
3826
3827 return 0;
3828@@ -567,17 +510,14 @@ int pci_enable_msi(struct pci_dev* dev)
3829 /* Check whether driver already requested for MSI-X irqs */
3830 if (dev->msix_enabled) {
3831 printk(KERN_INFO "PCI: %s: Can't enable MSI. "
3832- "Device already has MSI-X irq assigned\n",
3833- pci_name(dev));
3834- dev->irq = temp;
3835+ "Device already has MSI-X enabled\n",
3836+ pci_name(dev));
3837 return -EINVAL;
3838 }
3839
3840 status = msi_capability_init(dev);
3841 if ( !status )
3842 dev->irq_old = temp;
3843- else
3844- dev->irq = temp;
3845
3846 return status;
3847 }
3848@@ -585,7 +525,6 @@ int pci_enable_msi(struct pci_dev* dev)
3849 extern void pci_frontend_disable_msi(struct pci_dev* dev);
3850 void pci_disable_msi(struct pci_dev* dev)
3851 {
3852- int pos;
3853 int pirq;
3854
3855 if (!pci_msi_enable)
3856@@ -602,8 +541,7 @@ void pci_disable_msi(struct pci_dev* dev
3857 }
3858 #endif
3859
3860- pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
3861- if (!pos)
3862+ if (!dev->msi_enabled)
3863 return;
3864
3865 pirq = dev->irq;
3866@@ -612,7 +550,9 @@ void pci_disable_msi(struct pci_dev* dev
3867 msi_unmap_pirq(dev, pirq);
3868
3869 /* Disable MSI mode */
3870- disable_msi_mode(dev, pos, PCI_CAP_ID_MSI);
3871+ msi_set_enable(dev, 0);
3872+ pci_intx(dev, 1); /* enable intx */
3873+ dev->msi_enabled = 0;
3874 }
3875
3876 /**
3877@@ -705,7 +645,6 @@ int pci_enable_msix(struct pci_dev* dev,
3878 printk(KERN_INFO "PCI: %s: Can't enable MSI-X. "
3879 "Device already has an MSI irq assigned\n",
3880 pci_name(dev));
3881- dev->irq = temp;
3882 return -EINVAL;
3883 }
3884
3885@@ -713,8 +652,6 @@ int pci_enable_msix(struct pci_dev* dev,
3886
3887 if ( !status )
3888 dev->irq_old = temp;
3889- else
3890- dev->irq = temp;
3891
3892 return status;
3893 }
3894@@ -722,10 +659,6 @@ int pci_enable_msix(struct pci_dev* dev,
3895 extern void pci_frontend_disable_msix(struct pci_dev* dev);
3896 void pci_disable_msix(struct pci_dev* dev)
3897 {
3898- int pos;
3899- u16 control;
3900-
3901-
3902 if (!pci_msi_enable)
3903 return;
3904 if (!dev)
3905@@ -751,18 +684,15 @@ void pci_disable_msix(struct pci_dev* de
3906 }
3907 #endif
3908
3909- pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
3910- if (!pos)
3911- return;
3912-
3913- pci_read_config_word(dev, msi_control_reg(pos), &control);
3914- if (!(control & PCI_MSIX_FLAGS_ENABLE))
3915+ if (!dev->msix_enabled)
3916 return;
3917
3918 msi_remove_pci_irq_vectors(dev);
3919
3920 /* Disable MSI mode */
3921- disable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
3922+ msix_set_enable(dev, 0);
3923+ pci_intx(dev, 1); /* enable intx */
3924+ dev->msix_enabled = 0;
3925 }
3926
3927 /**
3928--- sle11-2009-05-14.orig/drivers/xen/balloon/sysfs.c 2008-11-25 13:31:07.000000000 +0100
3929+++ sle11-2009-05-14/drivers/xen/balloon/sysfs.c 2009-03-04 11:25:55.000000000 +0100
3930@@ -34,6 +34,7 @@
3931 #include <linux/stat.h>
3932 #include <linux/string.h>
3933 #include <linux/sysdev.h>
3934+#include <linux/module.h>
3935 #include "common.h"
3936
3937 #ifdef HAVE_XEN_PLATFORM_COMPAT_H
3938--- sle11-2009-05-14.orig/drivers/xen/blkback/xenbus.c 2009-05-14 10:56:29.000000000 +0200
3939+++ sle11-2009-05-14/drivers/xen/blkback/xenbus.c 2009-03-04 11:25:55.000000000 +0100
3940@@ -527,7 +527,6 @@ static const struct xenbus_device_id blk
3941
3942 static struct xenbus_driver blkback = {
3943 .name = "vbd",
3944- .owner = THIS_MODULE,
3945 .ids = blkback_ids,
3946 .probe = blkback_probe,
3947 .remove = blkback_remove,
3948@@ -537,5 +536,6 @@ static struct xenbus_driver blkback = {
3949
3950 void blkif_xenbus_init(void)
3951 {
3952- xenbus_register_backend(&blkback);
3953+ if (xenbus_register_backend(&blkback))
3954+ BUG();
3955 }
3956--- sle11-2009-05-14.orig/drivers/xen/blkfront/blkfront.c 2009-03-24 10:08:27.000000000 +0100
3957+++ sle11-2009-05-14/drivers/xen/blkfront/blkfront.c 2009-03-24 10:08:49.000000000 +0100
3958@@ -902,7 +902,6 @@ MODULE_ALIAS("xen:vbd");
3959
3960 static struct xenbus_driver blkfront = {
3961 .name = "vbd",
3962- .owner = THIS_MODULE,
3963 .ids = blkfront_ids,
3964 .probe = blkfront_probe,
3965 .remove = blkfront_remove,
3966--- sle11-2009-05-14.orig/drivers/xen/blktap/xenbus.c 2009-05-14 10:56:29.000000000 +0200
3967+++ sle11-2009-05-14/drivers/xen/blktap/xenbus.c 2009-03-04 11:25:55.000000000 +0100
3968@@ -465,7 +465,6 @@ static const struct xenbus_device_id blk
3969
3970 static struct xenbus_driver blktap = {
3971 .name = "tap",
3972- .owner = THIS_MODULE,
3973 .ids = blktap_ids,
3974 .probe = blktap_probe,
3975 .remove = blktap_remove,
3976@@ -475,5 +474,6 @@ static struct xenbus_driver blktap = {
3977
3978 void tap_blkif_xenbus_init(void)
3979 {
3980- xenbus_register_backend(&blktap);
3981+ if (xenbus_register_backend(&blktap))
3982+ BUG();
3983 }
3984--- sle11-2009-05-14.orig/drivers/xen/core/evtchn.c 2009-03-04 11:28:34.000000000 +0100
3985+++ sle11-2009-05-14/drivers/xen/core/evtchn.c 2009-03-04 11:25:55.000000000 +0100
3986@@ -145,7 +145,7 @@ static void bind_evtchn_to_cpu(unsigned
3987 BUG_ON(!test_bit(chn, s->evtchn_mask));
3988
3989 if (irq != -1)
3990- set_native_irq_info(irq, cpumask_of_cpu(cpu));
3991+ irq_desc[irq].affinity = cpumask_of_cpu(cpu);
3992
3993 clear_bit(chn, (unsigned long *)cpu_evtchn_mask[cpu_evtchn[chn]]);
3994 set_bit(chn, (unsigned long *)cpu_evtchn_mask[cpu]);
3995@@ -158,7 +158,7 @@ static void init_evtchn_cpu_bindings(voi
3996
3997 /* By default all event channels notify CPU#0. */
3998 for (i = 0; i < NR_IRQS; i++)
3999- set_native_irq_info(i, cpumask_of_cpu(0));
4000+ irq_desc[i].affinity = cpumask_of_cpu(0);
4001
4002 memset(cpu_evtchn, 0, sizeof(cpu_evtchn));
4003 memset(cpu_evtchn_mask[0], ~0, sizeof(cpu_evtchn_mask[0]));
4004@@ -736,6 +736,7 @@ static struct irq_chip dynirq_chip = {
4005 .name = "Dynamic",
4006 .startup = startup_dynirq,
4007 .shutdown = mask_dynirq,
4008+ .disable = mask_dynirq,
4009 .mask = mask_dynirq,
4010 .unmask = unmask_dynirq,
4011 .mask_ack = ack_dynirq,
4012--- sle11-2009-05-14.orig/drivers/xen/core/smpboot.c 2008-12-15 11:26:44.000000000 +0100
4013+++ sle11-2009-05-14/drivers/xen/core/smpboot.c 2009-03-04 11:25:55.000000000 +0100
4014@@ -117,7 +117,7 @@ static int __cpuinit xen_smp_intr_init(u
4015 rc = bind_ipi_to_irqhandler(RESCHEDULE_VECTOR,
4016 cpu,
4017 smp_reschedule_interrupt,
4018- SA_INTERRUPT,
4019+ IRQF_DISABLED|IRQF_NOBALANCING,
4020 resched_name[cpu],
4021 NULL);
4022 if (rc < 0)
4023@@ -128,7 +128,7 @@ static int __cpuinit xen_smp_intr_init(u
4024 rc = bind_ipi_to_irqhandler(CALL_FUNCTION_VECTOR,
4025 cpu,
4026 smp_call_function_interrupt,
4027- SA_INTERRUPT,
4028+ IRQF_DISABLED|IRQF_NOBALANCING,
4029 callfunc_name[cpu],
4030 NULL);
4031 if (rc < 0)
4032@@ -257,7 +257,7 @@ void __init smp_prepare_cpus(unsigned in
4033 {
4034 unsigned int cpu;
4035 struct task_struct *idle;
4036- int apicid, acpiid;
4037+ int apicid;
4038 struct vcpu_get_physid cpu_id;
4039 #ifdef __x86_64__
4040 struct desc_ptr *gdt_descr;
4041@@ -266,14 +266,8 @@ void __init smp_prepare_cpus(unsigned in
4042 #endif
4043
4044 apicid = 0;
4045- if (HYPERVISOR_vcpu_op(VCPUOP_get_physid, 0, &cpu_id) == 0) {
4046+ if (HYPERVISOR_vcpu_op(VCPUOP_get_physid, 0, &cpu_id) == 0)
4047 apicid = xen_vcpu_physid_to_x86_apicid(cpu_id.phys_id);
4048- acpiid = xen_vcpu_physid_to_x86_acpiid(cpu_id.phys_id);
4049-#ifdef CONFIG_ACPI
4050- if (acpiid != 0xff)
4051- x86_acpiid_to_apicid[acpiid] = apicid;
4052-#endif
4053- }
4054 boot_cpu_data.apicid = apicid;
4055 cpu_data[0] = boot_cpu_data;
4056
4057@@ -329,14 +323,8 @@ void __init smp_prepare_cpus(unsigned in
4058 XENFEAT_writable_descriptor_tables);
4059
4060 apicid = cpu;
4061- if (HYPERVISOR_vcpu_op(VCPUOP_get_physid, cpu, &cpu_id) == 0) {
4062+ if (HYPERVISOR_vcpu_op(VCPUOP_get_physid, cpu, &cpu_id) == 0)
4063 apicid = xen_vcpu_physid_to_x86_apicid(cpu_id.phys_id);
4064- acpiid = xen_vcpu_physid_to_x86_acpiid(cpu_id.phys_id);
4065-#ifdef CONFIG_ACPI
4066- if (acpiid != 0xff)
4067- x86_acpiid_to_apicid[acpiid] = apicid;
4068-#endif
4069- }
4070 cpu_data[cpu] = boot_cpu_data;
4071 cpu_data[cpu].apicid = apicid;
4072
4073--- sle11-2009-05-14.orig/drivers/xen/fbfront/xenfb.c 2008-12-15 11:26:44.000000000 +0100
4074+++ sle11-2009-05-14/drivers/xen/fbfront/xenfb.c 2009-03-04 11:25:55.000000000 +0100
4075@@ -857,7 +857,6 @@ MODULE_ALIAS("xen:vfb");
4076
4077 static struct xenbus_driver xenfb_driver = {
4078 .name = "vfb",
4079- .owner = THIS_MODULE,
4080 .ids = xenfb_ids,
4081 .probe = xenfb_probe,
4082 .remove = xenfb_remove,
4083--- sle11-2009-05-14.orig/drivers/xen/fbfront/xenkbd.c 2009-03-04 11:28:34.000000000 +0100
4084+++ sle11-2009-05-14/drivers/xen/fbfront/xenkbd.c 2009-03-04 11:25:55.000000000 +0100
4085@@ -323,7 +323,6 @@ MODULE_ALIAS("xen:vkbd");
4086
4087 static struct xenbus_driver xenkbd_driver = {
4088 .name = "vkbd",
4089- .owner = THIS_MODULE,
4090 .ids = xenkbd_ids,
4091 .probe = xenkbd_probe,
4092 .remove = xenkbd_remove,
4093--- sle11-2009-05-14.orig/drivers/xen/netback/xenbus.c 2009-05-14 10:56:29.000000000 +0200
4094+++ sle11-2009-05-14/drivers/xen/netback/xenbus.c 2009-03-04 11:25:55.000000000 +0100
4095@@ -439,7 +439,6 @@ static const struct xenbus_device_id net
4096
4097 static struct xenbus_driver netback = {
4098 .name = "vif",
4099- .owner = THIS_MODULE,
4100 .ids = netback_ids,
4101 .probe = netback_probe,
4102 .remove = netback_remove,
4103@@ -450,5 +449,6 @@ static struct xenbus_driver netback = {
4104
4105 void netif_xenbus_init(void)
4106 {
4107- xenbus_register_backend(&netback);
4108+ if (xenbus_register_backend(&netback))
4109+ BUG();
4110 }
4111--- sle11-2009-05-14.orig/drivers/xen/netfront/netfront.c 2009-03-30 16:34:59.000000000 +0200
4112+++ sle11-2009-05-14/drivers/xen/netfront/netfront.c 2009-03-30 16:35:44.000000000 +0200
4113@@ -1892,20 +1892,19 @@ static struct ethtool_ops network_ethtoo
4114 };
4115
4116 #ifdef CONFIG_SYSFS
4117-static ssize_t show_rxbuf_min(struct class_device *cd, char *buf)
4118+static ssize_t show_rxbuf_min(struct device *dev,
4119+ struct device_attribute *attr, char *buf)
4120 {
4121- struct net_device *netdev = container_of(cd, struct net_device,
4122- class_dev);
4123- struct netfront_info *info = netdev_priv(netdev);
4124+ struct netfront_info *info = netdev_priv(to_net_dev(dev));
4125
4126 return sprintf(buf, "%u\n", info->rx_min_target);
4127 }
4128
4129-static ssize_t store_rxbuf_min(struct class_device *cd,
4130+static ssize_t store_rxbuf_min(struct device *dev,
4131+ struct device_attribute *attr,
4132 const char *buf, size_t len)
4133 {
4134- struct net_device *netdev = container_of(cd, struct net_device,
4135- class_dev);
4136+ struct net_device *netdev = to_net_dev(dev);
4137 struct netfront_info *np = netdev_priv(netdev);
4138 char *endp;
4139 unsigned long target;
4140@@ -1935,20 +1934,19 @@ static ssize_t store_rxbuf_min(struct cl
4141 return len;
4142 }
4143
4144-static ssize_t show_rxbuf_max(struct class_device *cd, char *buf)
4145+static ssize_t show_rxbuf_max(struct device *dev,
4146+ struct device_attribute *attr, char *buf)
4147 {
4148- struct net_device *netdev = container_of(cd, struct net_device,
4149- class_dev);
4150- struct netfront_info *info = netdev_priv(netdev);
4151+ struct netfront_info *info = netdev_priv(to_net_dev(dev));
4152
4153 return sprintf(buf, "%u\n", info->rx_max_target);
4154 }
4155
4156-static ssize_t store_rxbuf_max(struct class_device *cd,
4157+static ssize_t store_rxbuf_max(struct device *dev,
4158+ struct device_attribute *attr,
4159 const char *buf, size_t len)
4160 {
4161- struct net_device *netdev = container_of(cd, struct net_device,
4162- class_dev);
4163+ struct net_device *netdev = to_net_dev(dev);
4164 struct netfront_info *np = netdev_priv(netdev);
4165 char *endp;
4166 unsigned long target;
4167@@ -1978,16 +1976,15 @@ static ssize_t store_rxbuf_max(struct cl
4168 return len;
4169 }
4170
4171-static ssize_t show_rxbuf_cur(struct class_device *cd, char *buf)
4172+static ssize_t show_rxbuf_cur(struct device *dev,
4173+ struct device_attribute *attr, char *buf)
4174 {
4175- struct net_device *netdev = container_of(cd, struct net_device,
4176- class_dev);
4177- struct netfront_info *info = netdev_priv(netdev);
4178+ struct netfront_info *info = netdev_priv(to_net_dev(dev));
4179
4180 return sprintf(buf, "%u\n", info->rx_target);
4181 }
4182
4183-static const struct class_device_attribute xennet_attrs[] = {
4184+static struct device_attribute xennet_attrs[] = {
4185 __ATTR(rxbuf_min, S_IRUGO|S_IWUSR, show_rxbuf_min, store_rxbuf_min),
4186 __ATTR(rxbuf_max, S_IRUGO|S_IWUSR, show_rxbuf_max, store_rxbuf_max),
4187 __ATTR(rxbuf_cur, S_IRUGO, show_rxbuf_cur, NULL),
4188@@ -1999,8 +1996,8 @@ static int xennet_sysfs_addif(struct net
4189 int error = 0;
4190
4191 for (i = 0; i < ARRAY_SIZE(xennet_attrs); i++) {
4192- error = class_device_create_file(&netdev->class_dev,
4193- &xennet_attrs[i]);
4194+ error = device_create_file(&netdev->dev,
4195+ &xennet_attrs[i]);
4196 if (error)
4197 goto fail;
4198 }
4199@@ -2008,8 +2005,7 @@ static int xennet_sysfs_addif(struct net
4200
4201 fail:
4202 while (--i >= 0)
4203- class_device_remove_file(&netdev->class_dev,
4204- &xennet_attrs[i]);
4205+ device_remove_file(&netdev->dev, &xennet_attrs[i]);
4206 return error;
4207 }
4208
4209@@ -2017,10 +2013,8 @@ static void xennet_sysfs_delif(struct ne
4210 {
4211 int i;
4212
4213- for (i = 0; i < ARRAY_SIZE(xennet_attrs); i++) {
4214- class_device_remove_file(&netdev->class_dev,
4215- &xennet_attrs[i]);
4216- }
4217+ for (i = 0; i < ARRAY_SIZE(xennet_attrs); i++)
4218+ device_remove_file(&netdev->dev, &xennet_attrs[i]);
4219 }
4220
4221 #endif /* CONFIG_SYSFS */
4222@@ -2186,7 +2180,6 @@ MODULE_ALIAS("xen:vif");
4223
4224 static struct xenbus_driver netfront_driver = {
4225 .name = "vif",
4226- .owner = THIS_MODULE,
4227 .ids = netfront_ids,
4228 .probe = netfront_probe,
4229 .remove = __devexit_p(netfront_remove),
4230--- sle11-2009-05-14.orig/drivers/xen/pciback/xenbus.c 2008-12-15 11:26:44.000000000 +0100
4231+++ sle11-2009-05-14/drivers/xen/pciback/xenbus.c 2009-03-04 11:25:55.000000000 +0100
4232@@ -682,7 +682,6 @@ static const struct xenbus_device_id xen
4233
4234 static struct xenbus_driver xenbus_pciback_driver = {
4235 .name = "pciback",
4236- .owner = THIS_MODULE,
4237 .ids = xenpci_ids,
4238 .probe = pciback_xenbus_probe,
4239 .remove = pciback_xenbus_remove,
4240--- sle11-2009-05-14.orig/drivers/xen/pcifront/xenbus.c 2009-05-14 10:56:29.000000000 +0200
4241+++ sle11-2009-05-14/drivers/xen/pcifront/xenbus.c 2009-03-04 11:25:55.000000000 +0100
4242@@ -436,7 +436,6 @@ MODULE_ALIAS("xen:pci");
4243
4244 static struct xenbus_driver xenbus_pcifront_driver = {
4245 .name = "pcifront",
4246- .owner = THIS_MODULE,
4247 .ids = xenpci_ids,
4248 .probe = pcifront_xenbus_probe,
4249 .remove = pcifront_xenbus_remove,
4250--- sle11-2009-05-14.orig/drivers/xen/scsiback/xenbus.c 2009-05-14 10:56:29.000000000 +0200
4251+++ sle11-2009-05-14/drivers/xen/scsiback/xenbus.c 2009-03-04 11:25:55.000000000 +0100
4252@@ -350,7 +350,6 @@ static struct xenbus_device_id scsiback_
4253
4254 static struct xenbus_driver scsiback = {
4255 .name = "vscsi",
4256- .owner = THIS_MODULE,
4257 .ids = scsiback_ids,
4258 .probe = scsiback_probe,
4259 .remove = scsiback_remove,
4260--- sle11-2009-05-14.orig/drivers/xen/scsifront/xenbus.c 2009-05-14 10:56:29.000000000 +0200
4261+++ sle11-2009-05-14/drivers/xen/scsifront/xenbus.c 2009-03-04 11:25:55.000000000 +0100
4262@@ -401,7 +401,6 @@ static struct xenbus_device_id scsifront
4263
4264 static struct xenbus_driver scsifront_driver = {
4265 .name = "vscsi",
4266- .owner = THIS_MODULE,
4267 .ids = scsifront_ids,
4268 .probe = scsifront_probe,
4269 .remove = scsifront_remove,
4270--- sle11-2009-05-14.orig/drivers/xen/tpmback/common.h 2009-03-04 11:28:34.000000000 +0100
4271+++ sle11-2009-05-14/drivers/xen/tpmback/common.h 2009-03-04 11:25:55.000000000 +0100
4272@@ -54,11 +54,11 @@ typedef struct tpmif_st {
4273
4274 void tpmif_disconnect_complete(tpmif_t * tpmif);
4275 tpmif_t *tpmif_find(domid_t domid, struct backend_info *bi);
4276-void tpmif_interface_init(void);
4277+int tpmif_interface_init(void);
4278 void tpmif_interface_exit(void);
4279 void tpmif_schedule_work(tpmif_t * tpmif);
4280 void tpmif_deschedule_work(tpmif_t * tpmif);
4281-void tpmif_xenbus_init(void);
4282+int tpmif_xenbus_init(void);
4283 void tpmif_xenbus_exit(void);
4284 int tpmif_map(tpmif_t *tpmif, unsigned long shared_page, unsigned int evtchn);
4285 irqreturn_t tpmif_be_int(int irq, void *dev_id);
4286--- sle11-2009-05-14.orig/drivers/xen/tpmback/interface.c 2008-12-15 11:26:44.000000000 +0100
4287+++ sle11-2009-05-14/drivers/xen/tpmback/interface.c 2009-03-04 11:25:55.000000000 +0100
4288@@ -156,13 +156,14 @@ void tpmif_disconnect_complete(tpmif_t *
4289 free_tpmif(tpmif);
4290 }
4291
4292-void __init tpmif_interface_init(void)
4293+int __init tpmif_interface_init(void)
4294 {
4295 tpmif_cachep = kmem_cache_create("tpmif_cache", sizeof (tpmif_t),
4296 0, 0, NULL, NULL);
4297+ return tpmif_cachep ? 0 : -ENOMEM;
4298 }
4299
4300-void __exit tpmif_interface_exit(void)
4301+void tpmif_interface_exit(void)
4302 {
4303 kmem_cache_destroy(tpmif_cachep);
4304 }
4305--- sle11-2009-05-14.orig/drivers/xen/tpmback/tpmback.c 2009-03-04 11:28:34.000000000 +0100
4306+++ sle11-2009-05-14/drivers/xen/tpmback/tpmback.c 2009-03-04 11:25:55.000000000 +0100
4307@@ -923,22 +923,30 @@ static int __init tpmback_init(void)
4308 spin_lock_init(&tpm_schedule_list_lock);
4309 INIT_LIST_HEAD(&tpm_schedule_list);
4310
4311- tpmif_interface_init();
4312- tpmif_xenbus_init();
4313+ rc = tpmif_interface_init();
4314+ if (!rc) {
4315+ rc = tpmif_xenbus_init();
4316+ if (rc)
4317+ tpmif_interface_exit();
4318+ }
4319+ if (rc) {
4320+ misc_deregister(&vtpms_miscdevice);
4321+ return rc;
4322+ }
4323
4324 printk(KERN_ALERT "Successfully initialized TPM backend driver.\n");
4325
4326 return 0;
4327 }
4328-
4329 module_init(tpmback_init);
4330
4331-void __exit tpmback_exit(void)
4332+static void __exit tpmback_exit(void)
4333 {
4334 vtpm_release_packets(NULL, 0);
4335 tpmif_xenbus_exit();
4336 tpmif_interface_exit();
4337 misc_deregister(&vtpms_miscdevice);
4338 }
4339+module_exit(tpmback_exit)
4340
4341 MODULE_LICENSE("Dual BSD/GPL");
4342--- sle11-2009-05-14.orig/drivers/xen/tpmback/xenbus.c 2009-05-14 10:56:29.000000000 +0200
4343+++ sle11-2009-05-14/drivers/xen/tpmback/xenbus.c 2009-03-04 11:25:55.000000000 +0100
4344@@ -270,7 +270,6 @@ static const struct xenbus_device_id tpm
4345
4346 static struct xenbus_driver tpmback = {
4347 .name = "vtpm",
4348- .owner = THIS_MODULE,
4349 .ids = tpmback_ids,
4350 .probe = tpmback_probe,
4351 .remove = tpmback_remove,
4352@@ -278,9 +277,9 @@ static struct xenbus_driver tpmback = {
4353 };
4354
4355
4356-void tpmif_xenbus_init(void)
4357+int tpmif_xenbus_init(void)
4358 {
4359- xenbus_register_backend(&tpmback);
4360+ return xenbus_register_backend(&tpmback);
4361 }
4362
4363 void tpmif_xenbus_exit(void)
4364--- sle11-2009-05-14.orig/drivers/xen/xenbus/xenbus_probe.c 2008-12-15 11:26:44.000000000 +0100
4365+++ sle11-2009-05-14/drivers/xen/xenbus/xenbus_probe.c 2009-03-04 11:25:55.000000000 +0100
4366@@ -365,7 +365,9 @@ static void xenbus_dev_shutdown(struct d
4367 }
4368
4369 int xenbus_register_driver_common(struct xenbus_driver *drv,
4370- struct xen_bus_type *bus)
4371+ struct xen_bus_type *bus,
4372+ struct module *owner,
4373+ const char *mod_name)
4374 {
4375 int ret;
4376
4377@@ -375,7 +377,10 @@ int xenbus_register_driver_common(struct
4378 drv->driver.name = drv->name;
4379 drv->driver.bus = &bus->bus;
4380 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
4381- drv->driver.owner = drv->owner;
4382+ drv->driver.owner = owner;
4383+#endif
4384+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
4385+ drv->driver.mod_name = mod_name;
4386 #endif
4387 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
4388 drv->driver.probe = xenbus_dev_probe;
4389@@ -389,13 +394,15 @@ int xenbus_register_driver_common(struct
4390 return ret;
4391 }
4392
4393-int xenbus_register_frontend(struct xenbus_driver *drv)
4394+int __xenbus_register_frontend(struct xenbus_driver *drv,
4395+ struct module *owner, const char *mod_name)
4396 {
4397 int ret;
4398
4399 drv->read_otherend_details = read_backend_details;
4400
4401- ret = xenbus_register_driver_common(drv, &xenbus_frontend);
4402+ ret = xenbus_register_driver_common(drv, &xenbus_frontend,
4403+ owner, mod_name);
4404 if (ret)
4405 return ret;
4406
4407@@ -404,7 +411,7 @@ int xenbus_register_frontend(struct xenb
4408
4409 return 0;
4410 }
4411-EXPORT_SYMBOL_GPL(xenbus_register_frontend);
4412+EXPORT_SYMBOL_GPL(__xenbus_register_frontend);
4413
4414 void xenbus_unregister_driver(struct xenbus_driver *drv)
4415 {
4416--- sle11-2009-05-14.orig/drivers/xen/xenbus/xenbus_probe.h 2008-11-25 12:35:56.000000000 +0100
4417+++ sle11-2009-05-14/drivers/xen/xenbus/xenbus_probe.h 2009-03-04 11:25:55.000000000 +0100
4418@@ -63,7 +63,9 @@ extern int xenbus_match(struct device *_
4419 extern int xenbus_dev_probe(struct device *_dev);
4420 extern int xenbus_dev_remove(struct device *_dev);
4421 extern int xenbus_register_driver_common(struct xenbus_driver *drv,
4422- struct xen_bus_type *bus);
4423+ struct xen_bus_type *bus,
4424+ struct module *owner,
4425+ const char *mod_name);
4426 extern int xenbus_probe_node(struct xen_bus_type *bus,
4427 const char *type,
4428 const char *nodename);
4429--- sle11-2009-05-14.orig/drivers/xen/xenbus/xenbus_probe_backend.c 2009-05-14 10:56:29.000000000 +0200
4430+++ sle11-2009-05-14/drivers/xen/xenbus/xenbus_probe_backend.c 2009-03-04 11:25:55.000000000 +0100
4431@@ -172,13 +172,15 @@ static int xenbus_uevent_backend(struct
4432 return 0;
4433 }
4434
4435-int xenbus_register_backend(struct xenbus_driver *drv)
4436+int __xenbus_register_backend(struct xenbus_driver *drv,
4437+ struct module *owner, const char *mod_name)
4438 {
4439 drv->read_otherend_details = read_frontend_details;
4440
4441- return xenbus_register_driver_common(drv, &xenbus_backend);
4442+ return xenbus_register_driver_common(drv, &xenbus_backend,
4443+ owner, mod_name);
4444 }
4445-EXPORT_SYMBOL_GPL(xenbus_register_backend);
4446+EXPORT_SYMBOL_GPL(__xenbus_register_backend);
4447
4448 /* backend/<typename>/<frontend-uuid>/<name> */
4449 static int xenbus_probe_backend_unit(const char *dir,
4450--- sle11-2009-05-14.orig/drivers/xen/xenoprof/xenoprofile.c 2009-03-04 11:28:34.000000000 +0100
4451+++ sle11-2009-05-14/drivers/xen/xenoprof/xenoprofile.c 2009-03-04 11:25:55.000000000 +0100
4452@@ -235,7 +235,7 @@ static int bind_virq(void)
4453 result = bind_virq_to_irqhandler(VIRQ_XENOPROF,
4454 i,
4455 xenoprof_ovf_interrupt,
4456- SA_INTERRUPT,
4457+ IRQF_DISABLED|IRQF_NOBALANCING,
4458 "xenoprof",
4459 NULL);
4460
4461--- sle11-2009-05-14.orig/include/asm-x86/i8253.h 2009-05-14 10:56:29.000000000 +0200
4462+++ sle11-2009-05-14/include/asm-x86/i8253.h 2009-03-04 11:25:55.000000000 +0100
4463@@ -8,10 +8,14 @@
4464
4465 extern spinlock_t i8253_lock;
4466
4467+#ifdef CONFIG_GENERIC_CLOCKEVENTS
4468+
4469 extern struct clock_event_device *global_clock_event;
4470
4471 extern void setup_pit_timer(void);
4472
4473+#endif
4474+
4475 #define inb_pit inb_p
4476 #define outb_pit outb_p
4477
4478--- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/desc_32.h 2008-12-15 11:26:44.000000000 +0100
4479+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/desc_32.h 2009-03-04 11:25:55.000000000 +0100
4480@@ -21,7 +21,7 @@ struct Xgt_desc_struct {
4481
4482 extern struct Xgt_desc_struct idt_descr;
4483 DECLARE_PER_CPU(struct Xgt_desc_struct, cpu_gdt_descr);
4484-
4485+extern struct Xgt_desc_struct early_gdt_descr;
4486
4487 static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu)
4488 {
4489--- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/hypervisor.h 2008-12-15 11:26:44.000000000 +0100
4490+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/hypervisor.h 2009-03-04 11:28:11.000000000 +0100
4491@@ -158,6 +158,19 @@ static inline void arch_leave_lazy_mmu_m
4492 #define arch_use_lazy_mmu_mode() unlikely(__get_cpu_var(xen_lazy_mmu))
4493 #endif
4494
4495+#if 0 /* All uses are in places potentially called asynchronously, but
4496+ * asynchronous code should rather not make use of lazy mode at all.
4497+ * Therefore, all uses of this function get commented out, proper
4498+ * detection of asynchronous invocations is added whereever needed,
4499+ * and this function is disabled to catch any new (improper) uses.
4500+ */
4501+static inline void arch_flush_lazy_mmu_mode(void)
4502+{
4503+ if (arch_use_lazy_mmu_mode())
4504+ xen_multicall_flush(false);
4505+}
4506+#endif
4507+
4508 #else /* !CONFIG_XEN || MODULE */
4509
4510 static inline void xen_multicall_flush(bool ignore) {}
4511@@ -215,7 +228,7 @@ HYPERVISOR_block(
4512 return rc;
4513 }
4514
4515-static inline void /*__noreturn*/
4516+static inline void __noreturn
4517 HYPERVISOR_shutdown(
4518 unsigned int reason)
4519 {
4520--- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/mmu_context_32.h 2008-12-15 11:26:44.000000000 +0100
4521+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/mmu_context_32.h 2009-03-04 11:25:55.000000000 +0100
4522@@ -27,13 +27,13 @@ static inline void enter_lazy_tlb(struct
4523 static inline void __prepare_arch_switch(void)
4524 {
4525 /*
4526- * Save away %fs. No need to save %gs, as it was saved on the
4527+ * Save away %gs. No need to save %fs, as it was saved on the
4528 * stack on entry. No need to save %es and %ds, as those are
4529 * always kernel segments while inside the kernel.
4530 */
4531- asm volatile ( "mov %%fs,%0"
4532- : "=m" (current->thread.fs));
4533- asm volatile ( "movl %0,%%fs"
4534+ asm volatile ( "mov %%gs,%0"
4535+ : "=m" (current->thread.gs));
4536+ asm volatile ( "movl %0,%%gs"
4537 : : "r" (0) );
4538 }
4539
4540@@ -95,7 +95,7 @@ static inline void switch_mm(struct mm_s
4541 }
4542
4543 #define deactivate_mm(tsk, mm) \
4544- asm("movl %0,%%fs": :"r" (0));
4545+ asm("movl %0,%%gs": :"r" (0));
4546
4547 static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
4548 {
4549--- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgalloc_32.h 2009-05-14 10:56:29.000000000 +0200
4550+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgalloc_32.h 2009-03-04 11:25:55.000000000 +0100
4551@@ -6,12 +6,23 @@
4552 #include <linux/mm.h> /* for struct page */
4553 #include <asm/io.h> /* for phys_to_virt and page_to_pseudophys */
4554
4555-#define pmd_populate_kernel(mm, pmd, pte) \
4556- set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))
4557+#define paravirt_alloc_pt(pfn) do { } while (0)
4558+#define paravirt_alloc_pd(pfn) do { } while (0)
4559+#define paravirt_alloc_pd(pfn) do { } while (0)
4560+#define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) do { } while (0)
4561+#define paravirt_release_pt(pfn) do { } while (0)
4562+#define paravirt_release_pd(pfn) do { } while (0)
4563+
4564+#define pmd_populate_kernel(mm, pmd, pte) \
4565+do { \
4566+ paravirt_alloc_pt(__pa(pte) >> PAGE_SHIFT); \
4567+ set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))); \
4568+} while (0)
4569
4570 #define pmd_populate(mm, pmd, pte) \
4571 do { \
4572 unsigned long pfn = page_to_pfn(pte); \
4573+ paravirt_alloc_pt(pfn); \
4574 if (test_bit(PG_pinned, &virt_to_page((mm)->pgd)->flags)) { \
4575 if (!PageHighMem(pte)) \
4576 BUG_ON(HYPERVISOR_update_va_mapping( \
4577@@ -42,7 +53,11 @@ static inline void pte_free_kernel(pte_t
4578
4579 extern void pte_free(struct page *pte);
4580
4581-#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
4582+#define __pte_free_tlb(tlb,pte) \
4583+do { \
4584+ paravirt_release_pt(page_to_pfn(pte)); \
4585+ tlb_remove_page((tlb),(pte)); \
4586+} while (0)
4587
4588 #ifdef CONFIG_X86_PAE
4589 /*
4590--- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable_32.h 2008-12-15 11:26:44.000000000 +0100
4591+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable_32.h 2009-03-04 11:25:55.000000000 +0100
4592@@ -275,6 +275,7 @@ static inline pte_t pte_mkhuge(pte_t pte
4593 */
4594 #define pte_update(mm, addr, ptep) do { } while (0)
4595 #define pte_update_defer(mm, addr, ptep) do { } while (0)
4596+#define paravirt_map_pt_hook(slot, va, pfn) do { } while (0)
4597
4598 /*
4599 * We only update the dirty/accessed state if we set
4600@@ -490,12 +491,24 @@ extern pte_t *lookup_address(unsigned lo
4601 #endif
4602
4603 #if defined(CONFIG_HIGHPTE)
4604-#define pte_offset_map(dir, address) \
4605- ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)),KM_PTE0) + \
4606- pte_index(address))
4607-#define pte_offset_map_nested(dir, address) \
4608- ((pte_t *)kmap_atomic_pte(pmd_page(*(dir)),KM_PTE1) + \
4609- pte_index(address))
4610+#define pte_offset_map(dir, address) \
4611+({ \
4612+ pte_t *__ptep; \
4613+ unsigned pfn = pmd_val(*(dir)) >> PAGE_SHIFT; \
4614+ __ptep = (pte_t *)kmap_atomic_pte(pfn_to_page(pfn),KM_PTE0); \
4615+ paravirt_map_pt_hook(KM_PTE0,__ptep, pfn); \
4616+ __ptep = __ptep + pte_index(address); \
4617+ __ptep; \
4618+})
4619+#define pte_offset_map_nested(dir, address) \
4620+({ \
4621+ pte_t *__ptep; \
4622+ unsigned pfn = pmd_val(*(dir)) >> PAGE_SHIFT; \
4623+ __ptep = (pte_t *)kmap_atomic_pte(pfn_to_page(pfn),KM_PTE1); \
4624+ paravirt_map_pt_hook(KM_PTE1,__ptep, pfn); \
4625+ __ptep = __ptep + pte_index(address); \
4626+ __ptep; \
4627+})
4628 #define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
4629 #define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
4630 #else
4631--- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/processor_32.h 2008-12-15 11:26:44.000000000 +0100
4632+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/processor_32.h 2009-03-04 11:25:55.000000000 +0100
4633@@ -431,7 +431,7 @@ struct thread_struct {
4634 .vm86_info = NULL, \
4635 .sysenter_cs = __KERNEL_CS, \
4636 .io_bitmap_ptr = NULL, \
4637- .gs = __KERNEL_PDA, \
4638+ .fs = __KERNEL_PDA, \
4639 }
4640
4641 /*
4642@@ -449,8 +449,8 @@ struct thread_struct {
4643 }
4644
4645 #define start_thread(regs, new_eip, new_esp) do { \
4646- __asm__("movl %0,%%fs": :"r" (0)); \
4647- regs->xgs = 0; \
4648+ __asm__("movl %0,%%gs": :"r" (0)); \
4649+ regs->xfs = 0; \
4650 set_fs(USER_DS); \
4651 regs->xds = __USER_DS; \
4652 regs->xes = __USER_DS; \
4653--- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/segment_32.h 2008-12-15 11:26:44.000000000 +0100
4654+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/segment_32.h 2009-03-04 11:25:55.000000000 +0100
4655@@ -83,14 +83,8 @@
4656 * The GDT has 32 entries
4657 */
4658 #define GDT_ENTRIES 32
4659-
4660 #define GDT_SIZE (GDT_ENTRIES * 8)
4661
4662-/* Matches __KERNEL_CS and __USER_CS (they must be 2 entries apart) */
4663-#define SEGMENT_IS_FLAT_CODE(x) (((x) & 0xec) == GDT_ENTRY_KERNEL_CS * 8)
4664-/* Matches PNP_CS32 and PNP_CS16 (they must be consecutive) */
4665-#define SEGMENT_IS_PNP_CODE(x) (((x) & 0xf4) == GDT_ENTRY_PNPBIOS_BASE * 8)
4666-
4667 /* Simple and small GDT entries for booting only */
4668
4669 #define GDT_ENTRY_BOOT_CS 2
4670@@ -132,4 +126,21 @@
4671 #define SEGMENT_GDT 0x0
4672
4673 #define get_kernel_rpl() (xen_feature(XENFEAT_supervisor_mode_kernel)?0:1)
4674+
4675+/*
4676+ * Matching rules for certain types of segments.
4677+ */
4678+
4679+/* Matches only __KERNEL_CS, ignoring PnP / USER / APM segments */
4680+#define SEGMENT_IS_KERNEL_CODE(x) (((x) & ~3) == GDT_ENTRY_KERNEL_CS * 8 \
4681+ || ((x) & ~3) == (FLAT_KERNEL_CS & ~3))
4682+
4683+/* Matches __KERNEL_CS and __USER_CS (they must be 2 entries apart) */
4684+#define SEGMENT_IS_FLAT_CODE(x) (((x) & ~0x13) == GDT_ENTRY_KERNEL_CS * 8 \
4685+ || ((x) & ~3) == (FLAT_KERNEL_CS & ~3) \
4686+ || ((x) & ~3) == (FLAT_USER_CS & ~3))
4687+
4688+/* Matches PNP_CS32 and PNP_CS16 (they must be consecutive) */
4689+#define SEGMENT_IS_PNP_CODE(x) (((x) & ~0x0b) == GDT_ENTRY_PNPBIOS_BASE * 8)
4690+
4691 #endif
4692--- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/smp_32.h 2008-12-15 11:26:44.000000000 +0100
4693+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/smp_32.h 2009-03-04 11:25:55.000000000 +0100
4694@@ -52,6 +52,11 @@ extern void cpu_exit_clear(void);
4695 extern void cpu_uninit(void);
4696 #endif
4697
4698+#ifndef CONFIG_PARAVIRT
4699+#define startup_ipi_hook(phys_apicid, start_eip, start_esp) \
4700+do { } while (0)
4701+#endif
4702+
4703 /*
4704 * This function is needed by all SMP systems. It must _always_ be valid
4705 * from the initial startup. We map APIC_BASE very early in page_setup(),
4706--- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/dma-mapping_64.h 2008-12-15 11:26:44.000000000 +0100
4707+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/dma-mapping_64.h 2009-03-04 11:25:55.000000000 +0100
4708@@ -9,7 +9,6 @@
4709
4710 #include <asm/scatterlist.h>
4711 #include <asm/io.h>
4712-#include <asm/swiotlb.h>
4713
4714 struct dma_mapping_ops {
4715 int (*mapping_error)(dma_addr_t dma_addr);
4716@@ -67,6 +66,9 @@ static inline int dma_mapping_error(dma_
4717 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
4718 #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
4719
4720+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
4721+#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
4722+
4723 extern void *dma_alloc_coherent(struct device *dev, size_t size,
4724 dma_addr_t *dma_handle, gfp_t gfp);
4725 extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
4726--- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/pgtable_64.h 2008-12-15 11:26:44.000000000 +0100
4727+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/pgtable_64.h 2009-03-04 11:25:55.000000000 +0100
4728@@ -416,15 +416,6 @@ static inline int pmd_large(pmd_t pte) {
4729 #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
4730 #define mk_pte_huge(entry) (__pte_val(entry) |= _PAGE_PRESENT | _PAGE_PSE)
4731
4732-/* physical address -> PTE */
4733-static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
4734-{
4735- unsigned long pteval;
4736- pteval = physpage | pgprot_val(pgprot);
4737- pteval &= __supported_pte_mask;
4738- return __pte(pteval);
4739-}
4740-
4741 /* Change flags of a PTE */
4742 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
4743 {
4744--- sle11-2009-05-14.orig/include/asm-x86/mach-xen/asm/smp_64.h 2008-12-15 11:26:44.000000000 +0100
4745+++ sle11-2009-05-14/include/asm-x86/mach-xen/asm/smp_64.h 2009-03-04 11:25:55.000000000 +0100
4746@@ -7,6 +7,7 @@
4747 #include <linux/threads.h>
4748 #include <linux/cpumask.h>
4749 #include <linux/bitops.h>
4750+#include <linux/init.h>
4751 extern int disable_apic;
4752
4753 #ifdef CONFIG_X86_LOCAL_APIC
4754@@ -73,7 +74,7 @@ extern int __cpu_disable(void);
4755 extern void __cpu_die(unsigned int cpu);
4756 extern void prefill_possible_map(void);
4757 extern unsigned num_processors;
4758-extern unsigned disabled_cpus;
4759+extern unsigned __cpuinitdata disabled_cpus;
4760
4761 #define NO_PROC_ID 0xFF /* No processor magic marker */
4762
4763--- sle11-2009-05-14.orig/include/xen/xenbus.h 2008-11-25 12:35:56.000000000 +0100
4764+++ sle11-2009-05-14/include/xen/xenbus.h 2009-03-04 11:25:55.000000000 +0100
4765@@ -93,8 +93,7 @@ struct xenbus_device_id
4766
4767 /* A xenbus driver. */
4768 struct xenbus_driver {
4769- char *name;
4770- struct module *owner;
4771+ const char *name;
4772 const struct xenbus_device_id *ids;
4773 int (*probe)(struct xenbus_device *dev,
4774 const struct xenbus_device_id *id);
4775@@ -115,8 +114,25 @@ static inline struct xenbus_driver *to_x
4776 return container_of(drv, struct xenbus_driver, driver);
4777 }
4778
4779-int xenbus_register_frontend(struct xenbus_driver *drv);
4780-int xenbus_register_backend(struct xenbus_driver *drv);
4781+int __must_check __xenbus_register_frontend(struct xenbus_driver *drv,
4782+ struct module *owner,
4783+ const char *mod_name);
4784+
4785+static inline int __must_check
4786+xenbus_register_frontend(struct xenbus_driver *drv)
4787+{
4788+ return __xenbus_register_frontend(drv, THIS_MODULE, KBUILD_MODNAME);
4789+}
4790+
4791+int __must_check __xenbus_register_backend(struct xenbus_driver *drv,
4792+ struct module *owner,
4793+ const char *mod_name);
4794+static inline int __must_check
4795+xenbus_register_backend(struct xenbus_driver *drv)
4796+{
4797+ return __xenbus_register_backend(drv, THIS_MODULE, KBUILD_MODNAME);
4798+}
4799+
4800 void xenbus_unregister_driver(struct xenbus_driver *drv);
4801
4802 struct xenbus_transaction
4803--- sle11-2009-05-14.orig/lib/swiotlb-xen.c 2009-03-20 10:00:58.000000000 +0100
4804+++ sle11-2009-05-14/lib/swiotlb-xen.c 2009-03-04 11:25:55.000000000 +0100
4805@@ -135,8 +135,8 @@ __setup("swiotlb=", setup_io_tlb_npages)
4806 * Statically reserve bounce buffer space and initialize bounce buffer data
4807 * structures for the software IO TLB used to implement the PCI DMA API.
4808 */
4809-void
4810-swiotlb_init_with_default_size (size_t default_size)
4811+void __init
4812+swiotlb_init_with_default_size(size_t default_size)
4813 {
4814 unsigned long i, bytes;
4815 int rc;
4816@@ -221,7 +221,7 @@ swiotlb_init_with_default_size (size_t d
4817 dma_bits);
4818 }
4819
4820-void
4821+void __init
4822 swiotlb_init(void)
4823 {
4824 long ram_end;
4825@@ -457,8 +457,8 @@ swiotlb_full(struct device *dev, size_t
4826 * When the mapping is small enough return a static buffer to limit
4827 * the damage, or panic when the transfer is too big.
4828 */
4829- printk(KERN_ERR "PCI-DMA: Out of SW-IOMMU space for %lu bytes at "
4830- "device %s\n", (unsigned long)size, dev ? dev->bus_id : "?");
4831+ printk(KERN_ERR "PCI-DMA: Out of SW-IOMMU space for %zu bytes at "
4832+ "device %s\n", size, dev ? dev->bus_id : "?");
4833
4834 if (size > io_tlb_overflow && do_panic) {
4835 if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL)
4836@@ -602,7 +602,7 @@ swiotlb_map_sg(struct device *hwdev, str
4837 sg[0].dma_length = 0;
4838 return 0;
4839 }
4840- sg->dma_address = (dma_addr_t)virt_to_bus(map);
4841+ sg->dma_address = virt_to_bus(map);
4842 } else
4843 sg->dma_address = dev_addr;
4844 sg->dma_length = sg->length;
4845@@ -624,8 +624,7 @@ swiotlb_unmap_sg(struct device *hwdev, s
4846
4847 for (i = 0; i < nelems; i++, sg++)
4848 if (in_swiotlb_aperture(sg->dma_address))
4849- unmap_single(hwdev,
4850- (void *)bus_to_virt(sg->dma_address),
4851+ unmap_single(hwdev, bus_to_virt(sg->dma_address),
4852 sg->dma_length, dir);
4853 else
4854 gnttab_dma_unmap_page(sg->dma_address);
4855@@ -648,8 +647,7 @@ swiotlb_sync_sg_for_cpu(struct device *h
4856
4857 for (i = 0; i < nelems; i++, sg++)
4858 if (in_swiotlb_aperture(sg->dma_address))
4859- sync_single(hwdev,
4860- (void *)bus_to_virt(sg->dma_address),
4861+ sync_single(hwdev, bus_to_virt(sg->dma_address),
4862 sg->dma_length, dir);
4863 }
4864
4865@@ -663,8 +661,7 @@ swiotlb_sync_sg_for_device(struct device
4866
4867 for (i = 0; i < nelems; i++, sg++)
4868 if (in_swiotlb_aperture(sg->dma_address))
4869- sync_single(hwdev,
4870- (void *)bus_to_virt(sg->dma_address),
4871+ sync_single(hwdev, bus_to_virt(sg->dma_address),
4872 sg->dma_length, dir);
4873 }
4874