5 Automatically created from "patches.kernel.org/patch-2.6.21" by xen-port-patches.py
7 Acked-by: jbeulich@novell.com
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
13 config CLOCKSOURCE_WATCHDOG
17 config GENERIC_CLOCKEVENTS
21 config GENERIC_CLOCKEVENTS_BROADCAST
23 - depends on X86_64 || (X86_32 && X86_LOCAL_APIC)
24 + depends on X86_64 || (X86_32 && X86_LOCAL_APIC && !X86_XEN)
26 config LOCKDEP_SUPPORT
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
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
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>
50 #include <asm/atomic.h>
51 @@ -56,83 +58,26 @@ static cpumask_t timer_bcast_ipi;
56 + * Debug level, exported for io_apic.c
61 static int modern_apic(void)
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)
69 - lvr = apic_read(APIC_LVR);
70 - version = GET_APIC_VERSION(lvr);
71 - return version >= 0x14;
72 + return lapic_get_version() >= 0x14;
74 #endif /* !CONFIG_XEN */
77 - * 'what should we do if we get a hw irq event on an illegal vector'.
78 - * each architecture has to answer this themselves.
80 -void ack_bad_irq(unsigned int irq)
82 - printk("unexpected IRQ trap at vector %02x\n", irq);
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
90 - * But only ack when the APIC is enabled -AK
96 int get_physical_broadcast(void)
103 -static void up_apic_timer_interrupt_call(void)
105 - int cpu = smp_processor_id();
108 - * the NMI deadlock-detector uses this.
110 - per_cpu(irq_stat, cpu).apic_timer_irqs++;
112 - smp_local_timer_interrupt();
116 -void smp_send_timer_broadcast_ipi(void)
120 - cpus_and(mask, cpu_online_map, timer_bcast_ipi);
121 - if (!cpus_empty(mask)) {
123 - send_IPI_mask(mask, LOCAL_TIMER_VECTOR);
126 - * We can directly call the apic timer interrupt handler
127 - * in UP case. Minus all irq related functions
129 - up_apic_timer_interrupt_call();
135 int setup_profiling_timer(unsigned int multiplier)
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)
143 memset(regs, 0, sizeof(struct pt_regs));
144 - regs->xgs = __KERNEL_PDA;
145 + regs->xfs = __KERNEL_PDA;
149 @@ -667,12 +667,12 @@ struct i386_pda boot_pda = {
150 .pcurrent = &init_task,
153 -static inline void set_kernel_gs(void)
154 +static inline void set_kernel_fs(void)
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");
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)
167 BUG_ON(HYPERVISOR_set_gdt(frames, (cpu_gdt_descr->size + 1) / 8));
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);
179 - asm volatile ("mov %0, %%fs" : : "r" (0));
181 + asm volatile ("mov %0, %%gs" : : "r" (0));
183 /* Clear all 6 debug registers: */
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
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>
195 @@ -157,21 +158,22 @@ static struct resource standard_io_resou
196 .flags = IORESOURCE_BUSY | IORESOURCE_IO
199 -static int romsignature(const unsigned char *x)
200 +#define ROMSIGNATURE 0xaa55
202 +static int __init romsignature(const unsigned char *rom)
206 - if (probe_kernel_address((const unsigned short *)x, sig) == 0)
207 - ret = (sig == 0xaa55);
210 + return probe_kernel_address((const unsigned short *)rom, sig) == 0 &&
211 + sig == ROMSIGNATURE;
214 static int __init romchecksum(unsigned char *rom, unsigned long length)
216 - unsigned char *p, sum = 0;
219 - for (p = rom; p < rom + length; p++)
221 + for (sum = 0; length; length--)
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
234 * 28(%esp) - orig_eax
237 @@ -102,9 +102,9 @@ NMI_MASK = 0x80000000
243 CFI_ADJUST_CFA_OFFSET 4;\
244 - /*CFI_REL_OFFSET gs, 0;*/\
245 + /*CFI_REL_OFFSET fs, 0;*/\
247 CFI_ADJUST_CFA_OFFSET 4;\
248 /*CFI_REL_OFFSET es, 0;*/\
249 @@ -136,7 +136,7 @@ NMI_MASK = 0x80000000
252 movl $(__KERNEL_PDA), %edx; \
256 #define RESTORE_INT_REGS \
258 @@ -169,9 +169,9 @@ NMI_MASK = 0x80000000
260 CFI_ADJUST_CFA_OFFSET -4;\
264 CFI_ADJUST_CFA_OFFSET -4;\
265 - /*CFI_RESTORE gs;*/\
266 + /*CFI_RESTORE fs;*/\
267 .pushsection .fixup,"ax"; \
270 @@ -230,6 +230,7 @@ ENTRY(ret_from_fork)
271 CFI_ADJUST_CFA_OFFSET -4
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?
282 +END(ret_from_exception)
284 #ifdef CONFIG_PREEMPT
286 @@ -275,6 +277,7 @@ need_resched:
288 call preempt_schedule_irq
294 @@ -352,16 +355,17 @@ sysenter_past_esp:
295 movl PT_OLDESP(%esp), %ecx
298 -1: mov PT_GS(%esp), %gs
299 +1: mov PT_FS(%esp), %fs
300 ENABLE_INTERRUPTS_SYSEXIT
302 .pushsection .fixup,"ax"
303 -2: movl $0,PT_GS(%esp)
304 +2: movl $0,PT_FS(%esp)
306 .section __ex_table,"a"
310 +ENDPROC(sysenter_entry)
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)
318 +ENDPROC(system_call)
320 # perform work that needs to be done immediately before resumption
322 @@ -578,6 +583,7 @@ work_notifysig_v86:
324 call do_notify_resume
325 jmp resume_userspace_sig
328 # perform syscall exit tracing
330 @@ -593,6 +599,7 @@ syscall_trace_entry:
331 cmpl $(nr_syscalls), %eax
334 +END(syscall_trace_entry)
336 # perform syscall exit tracing
338 @@ -606,6 +613,7 @@ syscall_exit_work:
340 call do_syscall_trace
342 +END(syscall_exit_work)
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)
353 movl $-ENOSYS,PT_EAX(%esp)
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:
371 ENTRY(irq_entries_start)
377 @@ -667,11 +677,16 @@ ENTRY(irq_entries_start)
379 CFI_ADJUST_CFA_OFFSET 4
388 +END(irq_entries_start)
395 * the CPU automatically disables interrupts when executing an IRQ vector,
396 @@ -684,6 +699,7 @@ common_interrupt:
400 +ENDPROC(common_interrupt)
403 #define BUILD_INTERRUPT(name, nr) \
404 @@ -696,10 +712,16 @@ ENTRY(name) \
412 /* The include is where all of the SMP etc. interrupts come from */
413 #include "entry_arch.h"
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)
420 #define UNWIND_ESPFIX_STACK
422 @@ -710,7 +732,7 @@ KPROBE_ENTRY(page_fault)
423 CFI_ADJUST_CFA_OFFSET 4
426 - /* the function address is in %gs's slot on the stack */
427 + /* the function address is in %fs's slot on the stack */
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
437 CFI_ADJUST_CFA_OFFSET 4
438 - /*CFI_REL_OFFSET gs, 0*/
439 + /*CFI_REL_OFFSET fs, 0*/
440 movl $(__KERNEL_PDA), %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
458 @@ -844,7 +866,7 @@ critical_fixup_table:
462 - .byte 9,9 # pop %gs
463 + .byte 9,9 # pop %fs
464 .byte 10,10,10 # add $4,%esp
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
471 +END(coprocessor_error)
473 ENTRY(simd_coprocessor_error)
475 @@ -918,6 +941,7 @@ ENTRY(simd_coprocessor_error)
476 CFI_ADJUST_CFA_OFFSET 4
479 +END(simd_coprocessor_error)
481 ENTRY(device_not_available)
483 @@ -940,6 +964,7 @@ device_available_emulate:
484 call math_state_restore
485 jmp ret_from_exception
487 +END(device_not_available)
491 @@ -1101,10 +1126,12 @@ ENTRY(native_iret)
497 ENTRY(native_irq_enable_sysexit)
500 +END(native_irq_enable_sysexit)
504 @@ -1127,6 +1154,7 @@ ENTRY(overflow)
505 CFI_ADJUST_CFA_OFFSET 4
512 @@ -1136,6 +1164,7 @@ ENTRY(bounds)
513 CFI_ADJUST_CFA_OFFSET 4
520 @@ -1145,6 +1174,7 @@ ENTRY(invalid_op)
521 CFI_ADJUST_CFA_OFFSET 4
526 ENTRY(coprocessor_segment_overrun)
528 @@ -1154,6 +1184,7 @@ ENTRY(coprocessor_segment_overrun)
529 CFI_ADJUST_CFA_OFFSET 4
532 +END(coprocessor_segment_overrun)
536 @@ -1161,6 +1192,7 @@ ENTRY(invalid_TSS)
537 CFI_ADJUST_CFA_OFFSET 4
542 ENTRY(segment_not_present)
544 @@ -1168,6 +1200,7 @@ ENTRY(segment_not_present)
545 CFI_ADJUST_CFA_OFFSET 4
548 +END(segment_not_present)
552 @@ -1175,6 +1208,7 @@ ENTRY(stack_segment)
553 CFI_ADJUST_CFA_OFFSET 4
558 KPROBE_ENTRY(general_protection)
560 @@ -1190,6 +1224,7 @@ ENTRY(alignment_check)
561 CFI_ADJUST_CFA_OFFSET 4
564 +END(alignment_check)
568 @@ -1199,6 +1234,7 @@ ENTRY(divide_error)
569 CFI_ADJUST_CFA_OFFSET 4
574 #ifdef CONFIG_X86_MCE
576 @@ -1209,6 +1245,7 @@ ENTRY(machine_check)
577 CFI_ADJUST_CFA_OFFSET 4
584 @@ -1228,6 +1265,7 @@ ENTRY(fixup_4gb_segment)
585 CFI_ADJUST_CFA_OFFSET 4
588 +END(spurious_interrupt_bug)
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
595 #define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability
596 #define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id
598 +.section .text.head,"ax",@progbits
599 #define VIRT_ENTRY_OFFSET 0x0
600 .org VIRT_ENTRY_OFFSET
602 @@ -60,11 +61,11 @@ ENTRY(startup_32)
604 movb $1,X86_HARD_MATH
606 - xorl %eax,%eax # Clear FS
608 + xorl %eax,%eax # Clear GS
611 movl $(__KERNEL_PDA),%eax
615 cld # gcc2 wants the direction flag cleared at all times
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.
623 /* get the PDA pointer */
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
630 static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
632 - volatile struct io_apic *io_apic = io_apic_base(apic);
633 + volatile struct io_apic __iomem *io_apic = io_apic_base(apic);
635 writel(reg, &io_apic->index);
636 writel(value, &io_apic->data);
637 @@ -392,7 +392,7 @@ static void set_ioapic_affinity_irq(unsi
639 entry = irq_2_pin + entry->next;
641 - set_native_irq_info(irq, cpumask);
642 + irq_desc[irq].affinity = cpumask;
643 spin_unlock_irqrestore(&ioapic_lock, flags);
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))
655 if ( package_index == i )
656 IRQ_DELTA(package_index,j) = 0;
657 @@ -785,7 +785,7 @@ failed:
661 -int __init irqbalance_disable(char *str)
662 +int __devinit irqbalance_disable(char *str)
664 irqbalance_disabled = 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");
671 - irq_desc[irq].status |= IRQ_DELAYED_DISABLE;
673 set_irq_chip_and_handler_name(irq, &ioapic_chip,
674 handle_edge_irq, "edge");
676 set_intr_gate(vector, interrupt[irq]);
679 @@ -1407,7 +1405,6 @@ static void __init setup_IO_APIC_irqs(vo
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);
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();
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
700 -static int no_timer_check __initdata;
701 +int no_timer_check __initdata;
703 static int __init notimercheck(char *s)
705 @@ -2369,7 +2366,7 @@ static inline void __init check_timer(vo
707 disable_8259A_irq(0);
708 set_irq_chip_and_handler_name(0, &lapic_chip, handle_fasteoi_irq,
711 apic_write_around(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */
714 @@ -2662,7 +2659,7 @@ static void set_msi_irq_affinity(unsigne
715 msg.address_lo |= MSI_ADDR_DEST_ID(dest);
717 write_msi_msg(irq, &msg);
718 - set_native_irq_info(irq, mask);
719 + irq_desc[irq].affinity = mask;
721 #endif /* CONFIG_SMP */
723 @@ -2681,25 +2678,32 @@ static struct irq_chip msi_chip = {
724 .retrigger = ioapic_retrigger_irq,
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)
733 + irq = create_irq();
737 + set_irq_msi(irq, desc);
738 ret = msi_compose_msg(dev, irq, &msg);
745 write_msi_msg(irq, &msg);
747 set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq,
754 void arch_teardown_msi_irq(unsigned int irq)
760 #endif /* CONFIG_PCI_MSI */
761 @@ -2739,7 +2743,7 @@ static void set_ht_irq_affinity(unsigned
762 dest = cpu_mask_to_apicid(mask);
764 target_ht_irq(irq, dest);
765 - set_native_irq_info(irq, mask);
766 + irq_desc[irq].affinity = mask;
770 @@ -2947,7 +2951,6 @@ int io_apic_set_pci_routing (int ioapic,
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);
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
784 -#include <asm/uaccess.h>
785 #include <linux/module.h>
786 #include <linux/seq_file.h>
787 #include <linux/interrupt.h>
789 #include <linux/cpu.h>
790 #include <linux/delay.h>
792 +#include <asm/apic.h>
793 +#include <asm/uaccess.h>
795 DEFINE_PER_CPU(irq_cpustat_t, irq_stat) ____cacheline_internodealigned_in_smp;
796 EXPORT_PER_CPU_SYMBOL(irq_stat);
798 -#ifndef CONFIG_X86_LOCAL_APIC
800 * 'what should we do if we get a hw irq event on an illegal vector'.
801 * each architecture has to answer this themselves.
803 void ack_bad_irq(unsigned int irq)
805 - printk("unexpected IRQ trap at vector %02x\n", irq);
807 + printk(KERN_ERR "unexpected IRQ trap at vector %02x\n", irq);
809 +#if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_XEN)
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
817 + * But only ack when the APIC is enabled -AK
824 #ifdef CONFIG_4KSTACKS
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
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];
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)
847 ioapic = mp_find_ioapic(gsi);
848 @@ -1136,7 +1136,7 @@ int mp_register_gsi(u32 gsi, int trigger
850 * Don't assign IRQ used by ACPI SCI
852 - if (gsi == acpi_fadt.sci_int)
853 + if (gsi == acpi_gbl_FADT.sci_interrupt)
855 gsi_to_irq[irq] = gsi;
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;
863 - kfree(dev->dma_mem->bitmap);
864 + kfree(dev->dma_mem);
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;
875 + if (!is_initial_xendomain())
879 pd = platform_device_alloc("pcspkr", -1);
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
885 #include <linux/ptrace.h>
886 #include <linux/random.h>
887 #include <linux/personality.h>
888 +#include <linux/tick.h>
890 #include <asm/uaccess.h>
891 #include <asm/pgtable.h>
892 @@ -160,6 +161,7 @@ void cpu_idle(void)
894 /* endless idle loop with no priority at all */
896 + tick_nohz_stop_sched_tick();
897 while (!need_resched()) {
900 @@ -175,6 +177,7 @@ void cpu_idle(void)
901 __get_cpu_var(irq_stat).idle_timestamp = jiffies;
904 + tick_nohz_restart_sched_tick();
905 preempt_enable_no_resched();
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);
919 @@ -279,7 +282,7 @@ int kernel_thread(int (*fn)(void *), voi
921 regs.xds = __USER_DS;
922 regs.xes = __USER_DS;
923 - regs.xgs = __KERNEL_PDA;
924 + regs.xfs = __KERNEL_PDA;
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
930 p->thread.eip = (unsigned long) ret_from_fork;
932 - savesegment(fs,p->thread.fs);
933 + savesegment(gs,p->thread.gs);
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);
952 - * Restore %fs if needed.
954 - * Glibc normally makes %fs be zero.
956 - if (unlikely(next->fs))
957 - loadsegment(fs, next->fs);
959 - write_pda(pcurrent, next_p);
962 * Now maybe handle debug registers
964 if (unlikely(task_thread_info(next_p)->flags & _TIF_WORK_CTXSW))
965 @@ -654,6 +647,15 @@ struct task_struct fastcall * __switch_t
967 disable_tsc(prev_p, next_p);
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
976 + arch_leave_lazy_cpu_mode();
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();
986 + * Restore %gs if needed (which is common)
988 + if (prev->gs | next->gs)
989 + loadsegment(gs, next->gs);
991 + write_pda(pcurrent, next_p);
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
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
1010 -static char command_line[COMMAND_LINE_SIZE];
1011 +static char __initdata command_line[COMMAND_LINE_SIZE];
1013 unsigned char __initdata boot_params[PARAM_SIZE];
1015 @@ -647,8 +646,8 @@ void __init setup_arch(char **cmdline_p)
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();
1025 if (user_defined_memmap) {
1026 @@ -656,11 +655,19 @@ void __init setup_arch(char **cmdline_p)
1027 print_memory_map("user");
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;
1034 max_low_pfn = setup_memory();
1038 + * Must be after max_low_pfn is determined, and before kernel
1039 + * pagetables are setup.
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;
1055 @@ -833,31 +839,3 @@ xen_panic_event(struct notifier_block *t
1056 /* we're never actually going to get here... */
1060 -static __init int add_pcspkr(void)
1062 - struct platform_device *pd;
1065 - if (!is_initial_xendomain())
1068 - pd = platform_device_alloc("pcspkr", -1);
1072 - ret = platform_device_add(pd);
1074 - platform_device_put(pd);
1078 -device_initcall(add_pcspkr);
1081 - * Local Variables:
1083 - * c-file-style:"k&r"
1084 - * c-basic-offset:8
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
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.
1097 spin_lock(&tlbstate_lock);
1099 @@ -361,7 +360,7 @@ static void flush_tlb_others(cpumask_t c
1101 while (!cpus_empty(flush_cpumask))
1102 /* nothing. lockup detection does not belong here */
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
1111 #include <linux/kernel_stat.h>
1112 #include <linux/posix-timers.h>
1113 #include <linux/cpufreq.h>
1114 +#include <linux/clocksource.h>
1117 #include <asm/smp.h>
1119 #include <xen/evtchn.h>
1120 #include <xen/interface/vcpu.h>
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);
1130 -#define XEN_SHIFT 22
1132 int pit_latch_buggy; /* extern */
1134 -#if defined(__x86_64__)
1135 -unsigned long vxtime_hz = PIT_TICK_RATE;
1136 -struct vxtime_data __vxtime __section_vxtime; /* for vsyscalls */
1138 volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES;
1139 -struct timespec __xtime __section_xtime;
1140 -struct timezone __sys_tz __section_sys_tz;
1143 +#define XEN_SHIFT 22
1145 unsigned int cpu_khz; /* Detected as we calibrate the TSC */
1146 EXPORT_SYMBOL(cpu_khz);
1148 @@ -113,9 +106,6 @@ static DEFINE_PER_CPU(struct shadow_time
1149 static struct timespec shadow_tv;
1150 static u32 shadow_tv_version;
1152 -static struct timeval monotonic_tv;
1153 -static spinlock_t monotonic_lock = SPIN_LOCK_UNLOCKED;
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,
1162 -void init_cpu_khz(void)
1163 +static void init_cpu_khz(void)
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);
1171 -#ifdef CONFIG_X86_64
1172 -static unsigned long get_usec_offset(struct shadow_time_info *shadow)
1176 - delta = now - shadow->tsc_timestamp;
1177 - return scale_delta(delta, shadow->tsc_to_usec_mul, shadow->tsc_shift);
1181 static void __update_wallclock(time_t sec, long nsec)
1183 long wtm_nsec, xtime_nsec;
1184 @@ -369,139 +349,6 @@ void rtc_cmos_write(unsigned char val, u
1186 EXPORT_SYMBOL(rtc_cmos_write);
1188 -#ifdef CONFIG_X86_64
1191 - * This version of gettimeofday has microsecond resolution
1192 - * and better than microsecond precision on fast x86 machines with TSC.
1194 -void do_gettimeofday(struct timeval *tv)
1196 - unsigned long seq;
1197 - unsigned long usec, sec;
1198 - unsigned long flags;
1201 - struct shadow_time_info *shadow;
1202 - u32 local_time_version;
1205 - shadow = &per_cpu(shadow_time, cpu);
1208 - local_time_version = shadow->version;
1209 - seq = read_seqbegin(&xtime_lock);
1211 - usec = get_usec_offset(shadow);
1213 - sec = xtime.tv_sec;
1214 - usec += (xtime.tv_nsec / NSEC_PER_USEC);
1216 - nsec = shadow->system_timestamp - processed_system_time;
1217 - __normalize_time(&sec, &nsec);
1218 - usec += (long)nsec / NSEC_PER_USEC;
1220 - if (unlikely(!time_values_up_to_date(cpu))) {
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.
1228 - get_time_values_from_xen(cpu);
1231 - } while (read_seqretry(&xtime_lock, seq) ||
1232 - (local_time_version != shadow->version));
1236 - while (usec >= USEC_PER_SEC) {
1237 - usec -= USEC_PER_SEC;
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)))
1245 - monotonic_tv.tv_sec = sec;
1246 - monotonic_tv.tv_usec = usec;
1248 - sec = monotonic_tv.tv_sec;
1249 - usec = monotonic_tv.tv_usec;
1251 - spin_unlock_irqrestore(&monotonic_lock, flags);
1254 - tv->tv_usec = usec;
1257 -EXPORT_SYMBOL(do_gettimeofday);
1259 -int do_settimeofday(struct timespec *tv)
1264 - struct shadow_time_info *shadow;
1265 - struct xen_platform_op op;
1267 - if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
1271 - shadow = &per_cpu(shadow_time, cpu);
1273 - write_seqlock_irq(&xtime_lock);
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.
1281 - nsec = tv->tv_nsec - get_nsec_offset(shadow);
1282 - if (time_values_up_to_date(cpu))
1284 - get_time_values_from_xen(cpu);
1287 - __normalize_time(&sec, &nsec);
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);
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);
1309 - write_sequnlock_irq(&xtime_lock);
1317 -EXPORT_SYMBOL(do_settimeofday);
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
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.
1333 -unsigned long long monotonic_clock(void)
1335 unsigned long long sched_clock(void)
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)
1344 -#ifdef CONFIG_X86_64
1345 -EXPORT_SYMBOL(monotonic_clock);
1347 -unsigned long long sched_clock(void)
1349 - return monotonic_clock();
1353 unsigned long profile_pc(struct pt_regs *regs)
1355 unsigned long pc = instruction_pointer(regs);
1357 #if defined(CONFIG_SMP) || defined(__x86_64__)
1358 - if (!user_mode_vm(regs) && in_lock_functions(pc)) {
1360 + if (!v8086_mode(regs) && SEGMENT_IS_KERNEL_CODE(regs->xcs)
1362 + if (!user_mode(regs)
1364 + && in_lock_functions(pc)) {
1365 # ifdef CONFIG_FRAME_POINTER
1367 return ((unsigned long *)regs->ebp)[1];
1368 @@ -601,14 +437,11 @@ unsigned long profile_pc(struct pt_regs
1372 - unsigned long *sp;
1373 - if ((regs->xcs & 2) == 0)
1374 - sp = (unsigned long *)®s->esp;
1376 - sp = (unsigned long *)regs->esp;
1377 + unsigned long *sp = (unsigned long *)®s->esp;
1379 unsigned long *sp = (unsigned long *)regs->rsp;
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
1389 -#ifndef CONFIG_X86_64
1391 -void tsc_init(void)
1394 - printk(KERN_INFO "Xen reported: %u.%03u MHz processor.\n",
1395 - cpu_khz / 1000, cpu_khz % 1000);
1400 -#include <linux/clocksource.h>
1402 void mark_tsc_unstable(void)
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 */
1409 - .is_continuous = 1,
1410 + .flags = CLOCK_SOURCE_IS_CONTINUOUS,
1413 -static int __init init_xen_clocksource(void)
1415 - clocksource_xen.mult = clocksource_khz2mult(cpu_khz,
1416 - clocksource_xen.shift);
1418 - return clocksource_register(&clocksource_xen);
1421 -module_init(init_xen_clocksource);
1425 static void init_missing_ticks_accounting(unsigned int cpu)
1427 struct vcpu_register_runstate_memory_area area;
1428 @@ -864,7 +672,7 @@ static void init_missing_ticks_accountin
1431 /* not static: needed by APM */
1432 -unsigned long get_cmos_time(void)
1433 +unsigned long read_persistent_clock(void)
1435 unsigned long retval;
1436 unsigned long flags;
1437 @@ -877,11 +685,11 @@ unsigned long get_cmos_time(void)
1441 -EXPORT_SYMBOL(get_cmos_time);
1443 static void sync_cmos_clock(unsigned long dummy);
1445 static DEFINE_TIMER(sync_cmos_timer, sync_cmos_clock, 0, 0);
1446 +int no_sync_cmos_clock;
1448 static void sync_cmos_clock(unsigned long dummy)
1450 @@ -925,7 +733,8 @@ static void sync_cmos_clock(unsigned lon
1452 void notify_arch_cmos_timer(void)
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);
1460 @@ -958,29 +767,11 @@ static int time_init_device(void)
1462 device_initcall(time_init_device);
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)
1469 - struct timespec ts;
1470 - ts.tv_sec = get_cmos_time();
1471 - ts.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);
1473 - do_settimeofday(&ts);
1475 - if ((hpet_enable() >= 0) && hpet_use_timer) {
1476 - printk("Using HPET for base-timer\n");
1483 /* Dynamically-mapped IRQ. */
1484 DEFINE_PER_CPU(int, timer_irq);
1486 -extern void (*late_time_init)(void);
1487 static void setup_cpu0_timer_irq(void)
1489 per_cpu(timer_irq, 0) =
1490 @@ -988,7 +779,7 @@ static void setup_cpu0_timer_irq(void)
1495 + IRQF_DISABLED|IRQF_NOBALANCING,
1498 BUG_ON(per_cpu(timer_irq, 0) < 0);
1499 @@ -1000,16 +791,9 @@ static struct vcpu_set_periodic_timer xe
1501 void __init time_init(void)
1503 -#ifdef CONFIG_HPET_TIMER
1504 - if (is_hpet_capable()) {
1506 - * HPET initialization needs to do memory-mapped io. So, let
1507 - * us do a late initialization after mem_init().
1509 - late_time_init = hpet_time_init;
1514 + printk(KERN_INFO "Xen reported: %u.%03u MHz processor.\n",
1515 + cpu_khz / 1000, cpu_khz % 1000);
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);
1523 - update_wallclock();
1524 + clocksource_register(&clocksource_xen);
1526 -#ifdef CONFIG_X86_64
1528 - printk(KERN_INFO "Xen reported: %u.%03u MHz processor.\n",
1529 - cpu_khz / 1000, cpu_khz % 1000);
1530 + update_wallclock();
1532 - vxtime.mode = VXTIME_TSC;
1533 - vxtime.quot = (1000000L << 32) / vxtime_hz;
1534 - vxtime.tsc_quot = (1000L << 32) / cpu_khz;
1536 - rdtscll(vxtime.last_tsc);
1537 +#ifndef CONFIG_X86_64
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,
1547 + IRQF_DISABLED|IRQF_NOBALANCING,
1551 @@ -1285,7 +1063,7 @@ static ctl_table xen_table[] = {
1553 static int __init xen_sysctl_init(void)
1555 - (void)register_sysctl_table(xen_table, 0);
1556 + (void)register_sysctl_table(xen_table);
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);
1565 int kstack_depth_to_print = 24;
1566 +static unsigned int code_bytes = 64;
1567 ATOMIC_NOTIFIER_HEAD(i386die_chain);
1569 int register_die_notifier(struct notifier_block *nb)
1570 @@ -297,10 +298,11 @@ void show_registers(struct pt_regs *regs
1574 - unsigned short ss;
1575 + unsigned short ss, gs;
1577 esp = (unsigned long) (®s->esp);
1578 savesegment(ss, ss);
1579 + savesegment(gs, gs);
1580 if (user_mode_vm(regs)) {
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
1598 - int code_bytes = 64;
1599 + unsigned int code_prologue = code_bytes * 43 / 64;
1600 + unsigned int code_len = code_bytes;
1603 printk("\n" KERN_EMERG "Stack: ");
1604 @@ -338,14 +341,14 @@ void show_registers(struct pt_regs *regs
1606 printk(KERN_EMERG "Code: ");
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;
1615 + code_len = code_len - code_prologue + 1;
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)
1625 __setup("kstack=", kstack_setup);
1627 +static int __init code_bytes_setup(char *s)
1629 + code_bytes = simple_strtoul(s, NULL, 0);
1630 + if (code_bytes > 8192)
1631 + code_bytes = 8192;
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
1640 EXPORT_SYMBOL_GPL(unregister_page_fault_notifier);
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)
1646 struct die_args args = {
1649 + .str = "page fault",
1656 - return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args);
1660 - * Unlock any spinlocks which will prevent us from getting the
1663 -void bust_spinlocks(int yes)
1665 - int loglevel_save = console_loglevel;
1668 - oops_in_progress = 1;
1674 - oops_in_progress = 0;
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...
1680 - console_loglevel = 15; /* NMI oopser may have shut the console up */
1682 - console_loglevel = loglevel_save;
1683 + return atomic_notifier_call_chain(¬ify_page_fault_chain,
1684 + DIE_PAGE_FAULT, &args);
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))
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)
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;
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)
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 *
1712 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
1713 pagefault_disable();
1715 + idx = type + KM_TYPE_NR*smp_processor_id();
1716 + BUG_ON(!pte_none(*(kmap_pte-idx)));
1718 if (!PageHighMem(page))
1719 return page_address(page);
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)))
1725 set_pte_at(&init_mm, vaddr, kmap_pte-idx, mk_pte(page, prot));
1726 + /*arch_flush_lazy_mmu_mode();*/
1728 return (void*) vaddr;
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();*/
1736 return (void*) vaddr;
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(
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
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)
1761 BUG_ON(fixmaps > 0);
1762 + printk(KERN_INFO "Reserving virtual address space above 0x%08x\n",
1764 __FIXADDR_TOP = -reserve - PAGE_SIZE;
1765 __VMALLOC_RESERVE += reserve;
1767 @@ -258,6 +260,12 @@ void pgd_ctor(void *pgd, struct kmem_cac
1768 swapper_pg_dir + USER_PTRS_PER_PGD,
1770 memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
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);
1778 spin_unlock_irqrestore(&pgd_lock, flags);
1780 @@ -268,6 +276,7 @@ void pgd_dtor(void *pgd, struct kmem_cac
1782 unsigned long flags; /* can be called from interrupt context */
1784 + paravirt_release_pd(__pa(pgd) >> PAGE_SHIFT);
1785 spin_lock_irqsave(&pgd_lock, flags);
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);
1792 + paravirt_alloc_pd(__pa(pmd) >> PAGE_SHIFT);
1793 set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
1796 @@ -314,6 +324,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
1797 pmd[i] = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
1800 + paravirt_alloc_pd(__pa(pmd) >> PAGE_SHIFT);
1803 spin_lock_irqsave(&pgd_lock, flags);
1804 @@ -354,12 +365,17 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
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);
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]);
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);
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
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
1856 .quad sys_setresuid16
1857 @@ -668,4 +668,5 @@ ia32_sys_call_table:
1858 .quad compat_sys_vmsplice
1859 .quad compat_sys_move_pages
1861 + .quad sys_epoll_pwait
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;
1869 -extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
1870 +extern unsigned long acpi_copy_wakeup_routine(unsigned long);
1872 static pgd_t low_ptr;
1874 @@ -67,8 +67,10 @@ static void init_low_mapping(void)
1876 pgd_t *slot0 = pgd_offset(current->mm, 0UL);
1878 + /* FIXME: We're playing with the current task's page tables here, which
1879 + * is potentially dangerous on SMP systems.
1881 set_pgd(slot0, *pgd_offset(current->mm, PAGE_OFFSET));
1882 - WARN_ON(num_online_cpus() != 1);
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
1893 + /* NUMA memory to node map */
1894 + if (last >= nodemap_addr && addr < nodemap_addr + nodemap_size) {
1895 + *addrp = nodemap_addr + nodemap_size;
1899 /* XXX ramdisk image here? */
1901 if (last < (table_end<<PAGE_SHIFT)) {
1902 @@ -213,6 +220,37 @@ unsigned long __init e820_end_of_ram(voi
1906 + * Find the hole size in the range.
1908 +unsigned long __init e820_hole_size(unsigned long start, unsigned long end)
1910 + unsigned long ram = 0;
1913 + for (i = 0; i < e820.nr_map; i++) {
1914 + struct e820entry *ei = &e820.map[i];
1915 + unsigned long last, addr;
1917 + if (ei->type != E820_RAM ||
1918 + ei->addr+ei->size <= start ||
1922 + addr = round_up(ei->addr, PAGE_SIZE);
1926 + last = round_down(ei->addr + ei->size, PAGE_SIZE);
1931 + ram += last - addr;
1933 + return ((end - start) - ram);
1937 * Mark e820 reserved areas as busy for the resource manager.
1939 void __init e820_reserve_resources(struct e820entry *e820, int nr_map)
1940 @@ -738,7 +776,7 @@ static int __init parse_memmap_opt(char
1942 early_param("memmap", parse_memmap_opt);
1944 -void finish_e820_parsing(void)
1945 +void __init finish_e820_parsing(void)
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)
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).
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;
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
1980 -extern char saved_command_line[];
1982 static void __init copy_bootdata(char *real_mode_data)
1985 @@ -62,14 +60,14 @@ static void __init copy_bootdata(char *r
1986 new_data = OLD_CL_BASE_ADDR + * (u16 *) OLD_CL_OFFSET;
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);
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';
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
2006 #include <acpi/acpi_bus.h>
2009 +#include <asm/idle.h>
2011 #include <asm/smp.h>
2012 #include <asm/desc.h>
2014 #include <asm/msidef.h>
2015 #include <asm/hypertransport.h>
2017 -static int assign_irq_vector(int irq, cpumask_t mask, cpumask_t *result);
2021 + cpumask_t old_domain;
2023 + unsigned move_cleanup_count;
2025 + u8 move_in_progress : 1;
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;
2031 +static int assign_irq_vector(int irq, cpumask_t mask);
2033 #define __apicdebuginit __init
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.
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)
2044 @@ -262,21 +276,19 @@ static void __target_IO_APIC_irq(unsigne
2046 static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask)
2048 + struct irq_cfg *cfg = irq_cfg + irq;
2049 unsigned long flags;
2054 cpus_and(tmp, mask, cpu_online_map);
2055 if (cpus_empty(tmp))
2056 - tmp = TARGET_CPUS;
2058 - cpus_and(mask, tmp, CPU_MASK_ALL);
2061 - vector = assign_irq_vector(irq, mask, &tmp);
2063 + if (assign_irq_vector(irq, mask))
2066 + cpus_and(tmp, cfg->domain, mask);
2067 dest = cpu_mask_to_apicid(tmp);
2070 @@ -285,8 +297,8 @@ static void set_ioapic_affinity_irq(unsi
2071 dest = SET_APIC_LOGICAL_ID(dest);
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);
2081 @@ -332,11 +344,11 @@ static void add_pin_to_irq(unsigned int
2082 reg = io_apic_read(entry->apic, 0x10 + R + pin*2); \
2084 io_apic_modify(entry->apic, reg); \
2088 entry = irq_2_pin + entry->next; \
2093 #define DO_ACTION(name,R,ACTION, FINAL) \
2094 @@ -669,77 +681,62 @@ static int pin_2_irq(int idx, int apic,
2098 -static inline int IO_APIC_irq_trigger(int irq)
2100 - int apic, idx, pin;
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);
2110 - * nonexistent IRQs are edge default
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;
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)
2122 struct physdev_irq irq_op;
2123 + struct irq_cfg *cfg;
2125 - BUG_ON((unsigned)irq >= NR_IRQ_VECTORS);
2126 + BUG_ON((unsigned)irq >= NR_IRQS);
2128 if (irq < PIRQ_BASE || irq - PIRQ_BASE >= NR_PIRQS)
2131 - cpus_and(*result, mask, cpu_online_map);
2132 + cfg = &irq_cfg[irq];
2134 + if ((cfg->move_in_progress) || cfg->move_cleanup_count)
2137 - if (irq_vector[irq] > 0)
2138 - return irq_vector[irq];
2143 if (HYPERVISOR_physdev_op(PHYSDEVOP_alloc_irq_vector, &irq_op))
2146 - vector = irq_op.vector;
2147 - irq_vector[irq] = vector;
2148 + cfg->vector = irq_op.vector;
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)
2159 unsigned long flags;
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);
2170 static void __clear_irq_vector(int irq)
2172 + struct irq_cfg *cfg;
2176 - BUG_ON(!irq_vector[irq]);
2177 + BUG_ON((unsigned)irq >= NR_IRQS);
2178 + cfg = &irq_cfg[irq];
2179 + BUG_ON(!cfg->vector);
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;
2188 - irq_vector[irq] = 0;
2189 - irq_domain[irq] = CPU_MASK_NONE;
2191 + cfg->domain = CPU_MASK_NONE;
2194 void __setup_vector_irq(int cpu)
2195 @@ -749,10 +746,10 @@ void __setup_vector_irq(int cpu)
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))
2204 - vector = irq_vector[irq];
2205 + vector = irq_cfg[irq].vector;
2206 per_cpu(vector_irq, cpu)[vector] = irq;
2208 /* Mark the free vectors */
2209 @@ -760,41 +757,49 @@ void __setup_vector_irq(int cpu)
2210 irq = per_cpu(vector_irq, cpu)[vector];
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;
2219 -extern void (*interrupt[NR_IRQS])(void);
2221 static struct irq_chip ioapic_chip;
2223 -#define IOAPIC_AUTO -1
2224 -#define IOAPIC_EDGE 0
2225 -#define IOAPIC_LEVEL 1
2227 -static void ioapic_register_intr(int irq, int vector, unsigned long trigger)
2228 +static void ioapic_register_intr(int irq, unsigned long trigger)
2230 - if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
2231 - trigger == IOAPIC_LEVEL)
2233 set_irq_chip_and_handler_name(irq, &ioapic_chip,
2234 handle_fasteoi_irq, "fasteoi");
2236 - irq_desc[irq].status |= IRQ_DELAYED_DISABLE;
2238 set_irq_chip_and_handler_name(irq, &ioapic_chip,
2239 handle_edge_irq, "edge");
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 */
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)
2251 + struct irq_cfg *cfg = irq_cfg + irq;
2252 struct IO_APIC_route_entry entry;
2254 - unsigned long flags;
2257 + if (!IO_APIC_IRQ(irq))
2260 + mask = TARGET_CPUS;
2261 + if (assign_irq_vector(irq, mask))
2265 + cpus_and(mask, cfg->domain, mask);
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);
2275 * add it to the IO-APIC irq-routing table:
2276 @@ -803,41 +808,23 @@ static void __init setup_IO_APIC_irq(int
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);
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;
2290 - if (irq_trigger(idx)) {
2291 - entry.trigger = 1;
2292 + /* Mask level triggered irqs.
2293 + * Use IRQ_DELAYED_DISABLE for edge triggered irqs.
2297 - entry.dest.logical.logical_dest = cpu_mask_to_apicid(TARGET_CPUS);
2300 - if (/* !apic && */ !IO_APIC_IRQ(irq))
2303 - if (IO_APIC_IRQ(irq)) {
2305 - vector = assign_irq_vector(irq, TARGET_CPUS, &mask);
2309 - entry.dest.logical.logical_dest = cpu_mask_to_apicid(mask);
2310 - entry.vector = vector;
2312 - ioapic_register_intr(irq, vector, IOAPIC_AUTO);
2313 - if (!apic && (irq < 16))
2314 - disable_8259A_irq(irq);
2316 + ioapic_register_intr(irq, trigger);
2318 + disable_8259A_irq(irq);
2320 ioapic_write_entry(apic, pin, entry);
2322 - spin_lock_irqsave(&ioapic_lock, flags);
2323 - set_native_irq_info(irq, TARGET_CPUS);
2324 - spin_unlock_irqrestore(&ioapic_lock, flags);
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);
2333 - setup_IO_APIC_irq(apic, pin, idx, irq);
2335 + setup_IO_APIC_irq(apic, pin, irq,
2336 + irq_trigger(idx), irq_polarity(idx));
2340 @@ -894,7 +881,7 @@ static void __init setup_ExtINT_IRQ0_pin
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;
2349 @@ -994,18 +981,17 @@ void __apicdebuginit print_IO_APIC(void)
2351 printk(KERN_DEBUG ".... IRQ redirection table:\n");
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");
2358 for (i = 0; i <= reg_01.bits.entries; i++) {
2359 struct IO_APIC_route_entry entry;
2361 entry = ioapic_read_entry(apic, i);
2363 - printk(KERN_DEBUG " %02x %03X %02X ",
2364 + printk(KERN_DEBUG " %02x %03X ",
2366 - entry.dest.logical.logical_dest,
2367 - entry.dest.physical.physical_dest
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 */
2376 - entry.dest.physical.physical_dest =
2377 - GET_APIC_ID(apic_read(APIC_ID));
2378 + entry.dest = GET_APIC_ID(apic_read(APIC_ID));
2381 * Add it to the IO-APIC irq-routing table:
2382 @@ -1355,16 +1340,15 @@ static unsigned int startup_ioapic_irq(u
2384 static int ioapic_retrigger_irq(unsigned int irq)
2386 + struct irq_cfg *cfg = &irq_cfg[irq];
2389 unsigned long flags;
2391 spin_lock_irqsave(&vector_lock, flags);
2392 - vector = irq_vector[irq];
2394 - cpu_set(first_cpu(irq_domain[irq]), mask);
2395 + cpu_set(first_cpu(cfg->domain), mask);
2397 - send_IPI_mask(mask, vector);
2398 + send_IPI_mask(mask, cfg->vector);
2399 spin_unlock_irqrestore(&vector_lock, flags);
2402 @@ -1379,8 +1363,68 @@ static int ioapic_retrigger_irq(unsigned
2407 +asmlinkage void smp_irq_move_cleanup_interrupt(void)
2409 + unsigned vector, me;
2414 + me = smp_processor_id();
2415 + for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
2417 + struct irq_desc *desc;
2418 + struct irq_cfg *cfg;
2419 + irq = __get_cpu_var(vector_irq)[vector];
2420 + if (irq >= NR_IRQS)
2423 + desc = irq_desc + irq;
2424 + cfg = irq_cfg + irq;
2425 + spin_lock(&desc->lock);
2426 + if (!cfg->move_cleanup_count)
2429 + if ((vector == cfg->vector) && cpu_isset(me, cfg->domain))
2432 + __get_cpu_var(vector_irq)[vector] = -1;
2433 + cfg->move_cleanup_count--;
2435 + spin_unlock(&desc->lock);
2441 +static void irq_complete_move(unsigned int irq)
2443 + struct irq_cfg *cfg = irq_cfg + irq;
2444 + unsigned vector, me;
2446 + if (likely(!cfg->move_in_progress))
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;
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;
2462 +static inline void irq_complete_move(unsigned int irq) {}
2465 static void ack_apic_edge(unsigned int irq)
2467 + irq_complete_move(irq);
2468 move_native_irq(irq);
2471 @@ -1389,6 +1433,7 @@ static void ack_apic_level(unsigned int
2473 int do_unmask_irq = 0;
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
2481 for (irq = 0; irq < NR_IRQS ; irq++) {
2483 - if (IO_APIC_IRQ(tmp) && !irq_vector[tmp]) {
2484 + if (IO_APIC_IRQ(tmp) && !irq_cfg[tmp].vector) {
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
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;
2497 @@ -1582,15 +1627,14 @@ static inline void unlock_ExtINT_logic(v
2499 static inline void check_timer(void)
2501 + struct irq_cfg *cfg = irq_cfg + 0;
2502 int apic1, pin1, apic2, pin2;
2507 * get/set the timer IRQ vector:
2509 disable_8259A_irq(0);
2510 - vector = assign_irq_vector(0, TARGET_CPUS, &mask);
2511 + assign_irq_vector(0, TARGET_CPUS);
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;
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);
2524 @@ -1641,7 +1685,7 @@ static inline void check_timer(void)
2526 * legacy devices should be connected to IO APIC #0
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)
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);
2541 if (timer_irq_works()) {
2542 apic_printk(APIC_VERBOSE," works.\n");
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");
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 */
2555 unsigned long flags;
2559 spin_lock_irqsave(&vector_lock, flags);
2560 for (new = (NR_IRQS - 1); new >= 0; new--) {
2561 if (platform_legacy_irq(new))
2563 - if (irq_vector[new] != 0)
2564 + if (irq_cfg[new].vector != 0)
2566 - vector = __assign_irq_vector(new, TARGET_CPUS, &mask);
2567 - if (likely(vector > 0))
2568 + if (__assign_irq_vector(new, TARGET_CPUS) == 0)
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)
2577 + struct irq_cfg *cfg = irq_cfg + irq;
2582 - vector = assign_irq_vector(irq, TARGET_CPUS, &tmp);
2583 - if (vector >= 0) {
2584 + tmp = TARGET_CPUS;
2585 + err = assign_irq_vector(irq, tmp);
2587 + cpus_and(tmp, cfg->domain, tmp);
2588 dest = cpu_mask_to_apicid(tmp);
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);
2603 static void set_msi_irq_affinity(unsigned int irq, cpumask_t mask)
2605 + struct irq_cfg *cfg = irq_cfg + irq;
2611 cpus_and(tmp, mask, cpu_online_map);
2612 if (cpus_empty(tmp))
2613 - tmp = TARGET_CPUS;
2615 - cpus_and(mask, tmp, CPU_MASK_ALL);
2618 - vector = assign_irq_vector(irq, mask, &tmp);
2620 + if (assign_irq_vector(irq, mask))
2623 + cpus_and(tmp, cfg->domain, mask);
2624 dest = cpu_mask_to_apicid(tmp);
2626 read_msi_msg(irq, &msg);
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);
2634 write_msi_msg(irq, &msg);
2635 - set_native_irq_info(irq, mask);
2636 + irq_desc[irq].affinity = mask;
2638 #endif /* CONFIG_SMP */
2640 @@ -1948,24 +1990,31 @@ static struct irq_chip msi_chip = {
2641 .retrigger = ioapic_retrigger_irq,
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)
2650 + irq = create_irq();
2654 + set_irq_msi(irq, desc);
2655 ret = msi_compose_msg(dev, irq, &msg);
2662 write_msi_msg(irq, &msg);
2664 set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, "edge");
2670 void arch_teardown_msi_irq(unsigned int irq)
2676 #endif /* CONFIG_PCI_MSI */
2677 @@ -1993,24 +2042,22 @@ static void target_ht_irq(unsigned int i
2679 static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask)
2681 + struct irq_cfg *cfg = irq_cfg + irq;
2686 cpus_and(tmp, mask, cpu_online_map);
2687 if (cpus_empty(tmp))
2688 - tmp = TARGET_CPUS;
2690 - cpus_and(mask, tmp, CPU_MASK_ALL);
2693 - vector = assign_irq_vector(irq, mask, &tmp);
2695 + if (assign_irq_vector(irq, mask))
2698 + cpus_and(tmp, cfg->domain, mask);
2699 dest = cpu_mask_to_apicid(tmp);
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;
2708 @@ -2027,14 +2074,17 @@ static struct irq_chip ht_irq_chip = {
2710 int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
2713 + struct irq_cfg *cfg = irq_cfg + irq;
2717 - vector = assign_irq_vector(irq, TARGET_CPUS, &tmp);
2718 - if (vector >= 0) {
2719 + tmp = TARGET_CPUS;
2720 + err = assign_irq_vector(irq, tmp);
2722 struct ht_irq_msg msg;
2725 + cpus_and(tmp, cfg->domain, tmp);
2726 dest = cpu_mask_to_apicid(tmp);
2728 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
2729 @@ -2042,7 +2092,7 @@ int arch_setup_ht_irq(unsigned int irq,
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");
2745 #endif /* CONFIG_HT_IRQ */
2747 @@ -2082,13 +2132,8 @@ int __init io_apic_get_redir_entries (in
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)
2754 - struct IO_APIC_route_entry entry;
2755 - unsigned long flags;
2759 if (!IO_APIC_IRQ(irq)) {
2760 apic_printk(APIC_QUIET,KERN_ERR "IOAPIC[%d]: Invalid reference to IRQ 0\n",
2762 @@ -2101,42 +2146,7 @@ int io_apic_set_pci_routing (int ioapic,
2764 add_pin_to_irq(irq, ioapic, pin);
2767 - vector = assign_irq_vector(irq, TARGET_CPUS, &mask);
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.
2777 - memset(&entry,0,sizeof(entry));
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;
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);
2792 - ioapic_register_intr(irq, entry.vector, edge_level);
2794 - if (!ioapic && (irq < 16))
2795 - disable_8259A_irq(irq);
2797 - ioapic_write_entry(ioapic, pin, entry);
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);
2806 @@ -2169,8 +2179,10 @@ void __init setup_ioapic_dest(void)
2807 * when you have too many devices, because at that time only boot
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));
2817 set_ioapic_affinity_irq(irq, TARGET_CPUS);
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
2822 #include <asm/uaccess.h>
2823 #include <asm/io_apic.h>
2824 #include <asm/idle.h>
2825 +#include <asm/smp.h>
2827 atomic_t irq_err_count;
2829 @@ -120,9 +121,15 @@ asmlinkage unsigned int do_IRQ(struct pt
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);
2838 + if (!disable_apic)
2841 + if (printk_ratelimit())
2842 + printk(KERN_EMERG "%s: %d.%d No irq handler for irq\n",
2843 + __func__, smp_processor_id(), irq);
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;
2857 -unsigned disabled_cpus __initdata;
2858 +unsigned disabled_cpus __cpuinitdata;
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
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)
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)
2876 struct task_struct *tsk = current;
2877 - struct thread_info *t = current_thread_info();
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);
2887 + set_tsk_thread_flag(tsk, TIF_IA32);
2888 current_thread_info()->status |= TS_COMPAT;
2891 - t->flags &= ~_TIF_DEBUG;
2892 + clear_tsk_thread_flag(tsk, TIF_DEBUG);
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);
2900 extern int root_mountflags;
2902 -char command_line[COMMAND_LINE_SIZE];
2903 +char __initdata command_line[COMMAND_LINE_SIZE];
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,
2911 -#define IORESOURCE_ROM (IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM)
2913 -static struct resource system_rom_resource = {
2914 - .name = "System ROM",
2917 - .flags = IORESOURCE_ROM,
2920 -static struct resource extension_rom_resource = {
2921 - .name = "Extension ROM",
2924 - .flags = IORESOURCE_ROM,
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 }
2942 -static struct resource video_rom_resource = {
2943 - .name = "Video ROM",
2946 - .flags = IORESOURCE_ROM,
2949 -static struct resource video_ram_resource = {
2950 - .name = "Video RAM area",
2953 - .flags = IORESOURCE_RAM,
2956 -#define romsignature(x) (*(unsigned short *)(x) == 0xaa55)
2958 -static int __init romchecksum(unsigned char *rom, unsigned long length)
2960 - unsigned char *p, sum = 0;
2962 - for (p = rom; p < rom + length; p++)
2967 -static void __init probe_roms(void)
2969 - unsigned long start, length, upper;
2970 - unsigned char *rom;
2974 - /* Nothing to do if not running in dom0. */
2975 - if (!is_initial_xendomain())
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))
2986 - video_rom_resource.start = start;
2988 - /* 0 < length <= 0x7f * 512, historically */
2989 - length = rom[2] * 512;
2991 - /* if checksum okay, trust length byte */
2992 - if (length && romchecksum(rom, length))
2993 - video_rom_resource.end = start + length - 1;
2995 - request_resource(&iomem_resource, &video_rom_resource);
2999 - start = (video_rom_resource.end + 1 + 2047) & ~2047UL;
3000 - if (start < upper)
3004 - request_resource(&iomem_resource, &system_rom_resource);
3005 - upper = system_rom_resource.start;
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;
3017 - /* check for adapter roms on 2k boundaries */
3018 - for (i = 0; i < ARRAY_SIZE(adapter_rom_resources) && start < upper;
3020 - rom = isa_bus_to_virt(start);
3021 - if (!romsignature(rom))
3024 - /* 0 < length <= 0x7f * 512, historically */
3025 - length = rom[2] * 512;
3027 - /* but accept any length that fits if checksum okay */
3028 - if (!length || start + length > upper || !romchecksum(rom, length))
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]);
3035 - start = adapter_rom_resources[i++].end & ~2047UL;
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)
3044 extern struct e820map machine_e820;
3046 - printk(KERN_INFO "Command line: %s\n", saved_command_line);
3047 + printk(KERN_INFO "Command line: %s\n", boot_command_line);
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)
3055 - printk(KERN_INFO "Command line: %s\n", saved_command_line);
3056 + printk(KERN_INFO "Command line: %s\n", boot_command_line);
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)
3062 early_identify_cpu(&boot_cpu_data);
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;
3068 parse_early_param();
3069 @@ -531,6 +403,11 @@ void __init setup_arch(char **cmdline_p)
3070 /* reserve ebda region */
3072 reserve_bootmem_generic(ebda_addr, ebda_size);
3074 + /* reserve nodemap region */
3076 + reserve_bootmem_generic(nodemap_addr, nodemap_size);
3081 @@ -731,10 +608,8 @@ void __init setup_arch(char **cmdline_p)
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.
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();
3097 - request_resource(&iomem_resource, &video_ram_resource);
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",
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,
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,
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,
3134 @@ -1361,6 +1237,9 @@ static int show_cpuinfo(struct seq_file
3135 "ttp", /* thermal trip */
3140 + NULL, /* tsc invariant mapped to constant_tsc */
3142 /* nothing */ /* constant_tsc - moved to flags */
3144 @@ -1477,26 +1356,3 @@ struct seq_operations cpuinfo_op = {
3146 .show = show_cpuinfo,
3149 -#if defined(CONFIG_INPUT_PCSPKR) || defined(CONFIG_INPUT_PCSPKR_MODULE)
3150 -#include <linux/platform_device.h>
3151 -static __init int add_pcspkr(void)
3153 - struct platform_device *pd;
3156 - if (!is_initial_xendomain())
3159 - pd = platform_device_alloc("pcspkr", -1);
3163 - ret = platform_device_add(pd);
3165 - platform_device_put(pd);
3169 -device_initcall(add_pcspkr);
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
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>
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>
3190 #define __vsyscall(nr) __attribute__ ((unused,__section__(".vsyscall_" #nr)))
3191 #define __syscall_clobber "r11","rcx","memory"
3193 -int __sysctl_vsyscall __section_sysctl_vsyscall = 1;
3194 -seqlock_t __xtime_lock __section_xtime_lock = SEQLOCK_UNLOCKED;
3195 +struct vsyscall_gtod_data_t {
3197 + int sysctl_enabled;
3198 + struct timeval wall_time_tv;
3199 + struct timezone sys_tz;
3200 + cycle_t offset_base;
3201 + struct clocksource clock;
3203 int __vgetcpu_mode __section_vgetcpu_mode;
3205 -#include <asm/unistd.h>
3207 -static __always_inline void timeval_normalize(struct timeval * tv)
3208 +struct vsyscall_gtod_data_t __vsyscall_gtod_data __section_vsyscall_gtod_data =
3212 - __sec = tv->tv_usec / 1000000;
3214 - tv->tv_usec %= 1000000;
3215 - tv->tv_sec += __sec;
3218 + .lock = SEQLOCK_UNLOCKED,
3219 + .sysctl_enabled = 1,
3222 -static __always_inline void do_vgettimeofday(struct timeval * tv)
3223 +void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
3226 - unsigned long sec, usec;
3227 + unsigned long flags;
3230 - sequence = read_seqbegin(&__xtime_lock);
3232 - sec = __xtime.tv_sec;
3233 - usec = __xtime.tv_nsec / 1000;
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. */
3243 - usec += ((readl((void __iomem *)
3244 - fix_to_virt(VSYSCALL_HPET) + 0xf0) -
3245 - __vxtime.last) * __vxtime.quot) >> 32;
3247 - } while (read_seqretry(&__xtime_lock, sequence));
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);
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
3264 static __always_inline void do_get_tz(struct timezone * tz)
3267 + *tz = __vsyscall_gtod_data.sys_tz;
3270 static __always_inline int gettimeofday(struct timeval *tv, struct timezone *tz)
3271 @@ -101,7 +88,8 @@ static __always_inline int gettimeofday(
3273 asm volatile("vsysc2: syscall"
3275 - : "0" (__NR_gettimeofday),"D" (tv),"S" (tz) : __syscall_clobber );
3276 + : "0" (__NR_gettimeofday),"D" (tv),"S" (tz)
3277 + : __syscall_clobber );
3281 @@ -114,10 +102,44 @@ static __always_inline long time_syscall
3285 +static __always_inline void do_vgettimeofday(struct timeval * tv)
3287 + cycle_t now, base, mask, cycle_delta;
3288 + unsigned long seq, mult, shift, nsec_delta;
3289 + cycle_t (*vread)(void);
3291 + seq = read_seqbegin(&__vsyscall_gtod_data.lock);
3293 + vread = __vsyscall_gtod_data.clock.vread;
3294 + if (unlikely(!__vsyscall_gtod_data.sysctl_enabled || !vread)) {
3295 + gettimeofday(tv,NULL);
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;
3304 + *tv = __vsyscall_gtod_data.wall_time_tv;
3306 + } while (read_seqretry(&__vsyscall_gtod_data.lock, seq));
3308 + /* calculate interval: */
3309 + cycle_delta = (now - base) & mask;
3310 + /* convert to nsecs: */
3311 + nsec_delta = (cycle_delta * mult) >> shift;
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) {
3317 + tv->tv_usec -= USEC_PER_SEC;
3321 int __vsyscall(0) vgettimeofday(struct timeval * tv, struct timezone * tz)
3323 - if (!__sysctl_vsyscall)
3324 - return gettimeofday(tv,tz);
3326 do_vgettimeofday(tv);
3328 @@ -129,11 +151,11 @@ int __vsyscall(0) vgettimeofday(struct t
3330 time_t __vsyscall(1) vtime(time_t *t)
3332 - if (!__sysctl_vsyscall)
3333 + if (unlikely(!__vsyscall_gtod_data.sysctl_enabled))
3334 return time_syscall(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;
3342 /* Fast way to get current CPU and node.
3343 @@ -210,7 +232,7 @@ static int vsyscall_sysctl_change(ctl_ta
3347 - if (!sysctl_vsyscall) {
3348 + if (!vsyscall_gtod_data.sysctl_enabled) {
3349 writew(SYSCALL, map1);
3350 writew(SYSCALL, map2);
3352 @@ -232,16 +254,17 @@ static int vsyscall_sysctl_nostrat(ctl_t
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),
3359 .strategy = vsyscall_sysctl_nostrat,
3360 .proc_handler = vsyscall_sysctl_change },
3365 static ctl_table kernel_root_table2[] = {
3366 { .ctl_name = CTL_KERN, .procname = "kernel", .mode = 0555,
3367 .child = kernel_table2 },
3373 @@ -304,14 +327,14 @@ static int __init vsyscall_init(void)
3374 BUG_ON((unsigned long) &vgetcpu != VSYSCALL_ADDR(__NR_vgetcpu));
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;
3382 vgetcpu_mode = VGETCPU_LSL;
3384 #ifdef CONFIG_SYSCTL
3385 - register_sysctl_table(kernel_root_table2, 0);
3386 + register_sysctl_table(kernel_root_table2);
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
3394 EXPORT_SYMBOL_GPL(unregister_page_fault_notifier);
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)
3400 struct die_args args = {
3403 + .str = "page fault",
3410 - return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args);
3413 -void bust_spinlocks(int yes)
3415 - int loglevel_save = console_loglevel;
3417 - oops_in_progress = 1;
3422 - oops_in_progress = 0;
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...
3428 - console_loglevel = 15; /* NMI oopser may have shut the console up */
3430 - console_loglevel = loglevel_save;
3432 + return atomic_notifier_call_chain(¬ify_page_fault_chain,
3433 + DIE_PAGE_FAULT, &args);
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))
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)
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;
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)
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;
3462 static ctl_table debug_table2[] = {
3463 - { 99, "exception-trace", &exception_trace, sizeof(int), 0644, NULL,
3468 + .procname = "exception-trace",
3469 + .data = &exception_trace,
3470 + .maxlen = sizeof(int),
3472 + .proc_handler = proc_dointvec
3477 static ctl_table debug_root_table2[] = {
3478 - { .ctl_name = CTL_DEBUG, .procname = "debug", .mode = 0555,
3479 - .child = debug_table2 },
3482 + .ctl_name = CTL_DEBUG,
3483 + .procname = "debug",
3485 + .child = debug_table2
3490 static __init int x8664_sysctl_init(void)
3492 - register_sysctl_table(debug_root_table2, 1);
3493 + register_sysctl_table(debug_root_table2);
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);
3505 + __flush_tlb_all();
3508 static inline void flush_map(struct list_head *l)
3509 @@ -376,6 +376,7 @@ static void revert_page(unsigned long ad
3513 + unsigned long pfn;
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);
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
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")
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)
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"));
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));
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"));
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))
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_
3573 static struct xenbus_driver tpmfront = {
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,
3583 -static void __init init_tpm_xenbus(void)
3584 +static int __init init_tpm_xenbus(void)
3586 - xenbus_register_frontend(&tpmfront);
3587 + return xenbus_register_frontend(&tpmfront);
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 {
3597 +static void msi_set_enable(struct pci_dev *dev, int enable)
3602 + pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
3604 + pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control);
3605 + control &= ~PCI_MSI_FLAGS_ENABLE;
3607 + control |= PCI_MSI_FLAGS_ENABLE;
3608 + pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control);
3612 +static void msix_set_enable(struct pci_dev *dev, int enable)
3617 + pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
3619 + pci_read_config_word(dev, pos + PCI_MSIX_FLAGS, &control);
3620 + control &= ~PCI_MSIX_FLAGS_ENABLE;
3622 + control |= PCI_MSIX_FLAGS_ENABLE;
3623 + pci_write_config_word(dev, pos + PCI_MSIX_FLAGS, control);
3627 static struct msi_dev_list *get_msi_dev_pirq_list(struct pci_dev *dev)
3629 struct msi_dev_list *msi_dev_list, *ret = NULL;
3630 @@ -235,126 +265,26 @@ static int msi_map_vector(struct pci_dev
3632 static int msi_init(void)
3634 - static int status = 0;
3636 - if (pci_msi_quirk) {
3637 - pci_msi_enable = 0;
3638 - printk(KERN_WARNING "PCI: MSI quirk detected. MSI disabled.\n");
3645 -void pci_scan_msi_device(struct pci_dev *dev) { }
3647 -void disable_msi_mode(struct pci_dev *dev, int pos, int type)
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;
3658 - msix_disable(control);
3659 - pci_write_config_word(dev, msi_control_reg(pos), control);
3660 - dev->msix_enabled = 0;
3663 - pci_intx(dev, 1); /* enable intx */
3666 -static void enable_msi_mode(struct pci_dev *dev, int pos, int type)
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;
3677 - msix_enable(control);
3678 - pci_write_config_word(dev, msi_control_reg(pos), control);
3679 - dev->msix_enabled = 1;
3682 - pci_intx(dev, 0); /* disable intx */
3687 -int pci_save_msi_state(struct pci_dev *dev)
3688 +static void __pci_restore_msi_state(struct pci_dev *dev)
3692 - pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
3693 - if (pos <= 0 || dev->no_msi)
3697 if (!dev->msi_enabled)
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;
3709 -void pci_restore_msi_state(struct pci_dev *dev)
3713 - pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
3717 - if (!dev->msi_enabled)
3719 + pci_intx(dev, 0); /* disable intx */
3720 + msi_set_enable(dev, 0);
3722 pirq = msi_map_pirq_to_vector(dev, dev->irq, 0, 0);
3725 - enable_msi_mode(dev, pos, PCI_CAP_ID_MSI);
3728 -int pci_save_msix_state(struct pci_dev *dev)
3731 - unsigned long flags;
3732 - struct msi_dev_list *msi_dev_entry;
3733 - struct msi_pirq_entry *pirq_entry, *tmp;
3735 - pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
3736 - if (pos <= 0 || dev->no_msi)
3739 - /* save the capability */
3740 - if (!dev->msix_enabled)
3743 - msi_dev_entry = get_msi_dev_pirq_list(dev);
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);
3751 - disable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
3752 - /* Set the flags for use of restore */
3753 - dev->msix_enabled = 1;
3758 -void pci_restore_msix_state(struct pci_dev *dev)
3759 +static void __pci_restore_msix_state(struct pci_dev *dev)
3762 unsigned long flags;
3763 @@ -369,6 +299,9 @@ void pci_restore_msix_state(struct pci_d
3764 if (!dev->msix_enabled)
3767 + pci_intx(dev, 0); /* disable intx */
3768 + msix_set_enable(dev, 0);
3770 msi_dev_entry = get_msi_dev_pirq_list(dev);
3771 table_base = find_table_base(dev, pos);
3773 @@ -386,10 +319,14 @@ void pci_restore_msix_state(struct pci_d
3774 pirq_entry->pirq, rc);
3776 spin_unlock_irqrestore(&msi_dev_entry->pirq_list_lock, flags);
3779 - enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
3780 +void pci_restore_msi_state(struct pci_dev *dev)
3782 + __pci_restore_msi_state(dev);
3783 + __pci_restore_msix_state(dev);
3786 +#endif /* CONFIG_PM */
3789 * msi_capability_init - configure device's MSI capability structure
3790 @@ -405,6 +342,8 @@ static int msi_capability_init(struct pc
3794 + msi_set_enable(dev, 0); /* Ensure msi is disabled as I set it up */
3796 pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
3797 pci_read_config_word(dev, msi_control_reg(pos), &control);
3799 @@ -413,7 +352,8 @@ static int msi_capability_init(struct pc
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;
3809 @@ -441,6 +381,8 @@ static int msix_capability_init(struct p
3813 + msix_set_enable(dev, 0);/* Ensure msix is disabled as I set it up */
3815 pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
3816 table_base = find_table_base(dev, pos);
3818 @@ -484,7 +426,8 @@ static int msix_capability_init(struct p
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;
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",
3835 + "Device already has MSI-X enabled\n",
3840 status = msi_capability_init(dev);
3842 dev->irq_old = temp;
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)
3855 if (!pci_msi_enable)
3856 @@ -602,8 +541,7 @@ void pci_disable_msi(struct pci_dev* dev
3860 - pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
3862 + if (!dev->msi_enabled)
3866 @@ -612,7 +550,9 @@ void pci_disable_msi(struct pci_dev* dev
3867 msi_unmap_pirq(dev, pirq);
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;
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",
3885 @@ -713,8 +652,6 @@ int pci_enable_msix(struct pci_dev* dev,
3888 dev->irq_old = temp;
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)
3902 if (!pci_msi_enable)
3905 @@ -751,18 +684,15 @@ void pci_disable_msix(struct pci_dev* de
3909 - pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
3913 - pci_read_config_word(dev, msi_control_reg(pos), &control);
3914 - if (!(control & PCI_MSIX_FLAGS_ENABLE))
3915 + if (!dev->msix_enabled)
3918 msi_remove_pci_irq_vectors(dev);
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;
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
3931 #include <linux/stat.h>
3932 #include <linux/string.h>
3933 #include <linux/sysdev.h>
3934 +#include <linux/module.h>
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
3942 static struct xenbus_driver blkback = {
3944 - .owner = THIS_MODULE,
3946 .probe = blkback_probe,
3947 .remove = blkback_remove,
3948 @@ -537,5 +536,6 @@ static struct xenbus_driver blkback = {
3950 void blkif_xenbus_init(void)
3952 - xenbus_register_backend(&blkback);
3953 + if (xenbus_register_backend(&blkback))
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");
3960 static struct xenbus_driver blkfront = {
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
3970 static struct xenbus_driver blktap = {
3972 - .owner = THIS_MODULE,
3974 .probe = blktap_probe,
3975 .remove = blktap_remove,
3976 @@ -475,5 +474,6 @@ static struct xenbus_driver blktap = {
3978 void tap_blkif_xenbus_init(void)
3980 - xenbus_register_backend(&blktap);
3981 + if (xenbus_register_backend(&blktap))
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));
3990 - set_native_irq_info(irq, cpumask_of_cpu(cpu));
3991 + irq_desc[irq].affinity = cpumask_of_cpu(cpu);
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
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);
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 = {
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,
4017 smp_reschedule_interrupt,
4019 + IRQF_DISABLED|IRQF_NOBALANCING,
4023 @@ -128,7 +128,7 @@ static int __cpuinit xen_smp_intr_init(u
4024 rc = bind_ipi_to_irqhandler(CALL_FUNCTION_VECTOR,
4026 smp_call_function_interrupt,
4028 + IRQF_DISABLED|IRQF_NOBALANCING,
4032 @@ -257,7 +257,7 @@ void __init smp_prepare_cpus(unsigned in
4035 struct task_struct *idle;
4036 - int apicid, acpiid;
4038 struct vcpu_get_physid cpu_id;
4040 struct desc_ptr *gdt_descr;
4041 @@ -266,14 +266,8 @@ void __init smp_prepare_cpus(unsigned in
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);
4050 - if (acpiid != 0xff)
4051 - x86_acpiid_to_apicid[acpiid] = apicid;
4054 boot_cpu_data.apicid = apicid;
4055 cpu_data[0] = boot_cpu_data;
4057 @@ -329,14 +323,8 @@ void __init smp_prepare_cpus(unsigned in
4058 XENFEAT_writable_descriptor_tables);
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);
4066 - if (acpiid != 0xff)
4067 - x86_acpiid_to_apicid[acpiid] = apicid;
4070 cpu_data[cpu] = boot_cpu_data;
4071 cpu_data[cpu].apicid = apicid;
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");
4077 static struct xenbus_driver xenfb_driver = {
4079 - .owner = THIS_MODULE,
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");
4087 static struct xenbus_driver xenkbd_driver = {
4089 - .owner = THIS_MODULE,
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
4097 static struct xenbus_driver netback = {
4099 - .owner = THIS_MODULE,
4101 .probe = netback_probe,
4102 .remove = netback_remove,
4103 @@ -450,5 +449,6 @@ static struct xenbus_driver netback = {
4105 void netif_xenbus_init(void)
4107 - xenbus_register_backend(&netback);
4108 + if (xenbus_register_backend(&netback))
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
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)
4121 - struct net_device *netdev = container_of(cd, struct net_device,
4123 - struct netfront_info *info = netdev_priv(netdev);
4124 + struct netfront_info *info = netdev_priv(to_net_dev(dev));
4126 return sprintf(buf, "%u\n", info->rx_min_target);
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)
4134 - struct net_device *netdev = container_of(cd, struct net_device,
4136 + struct net_device *netdev = to_net_dev(dev);
4137 struct netfront_info *np = netdev_priv(netdev);
4139 unsigned long target;
4140 @@ -1935,20 +1934,19 @@ static ssize_t store_rxbuf_min(struct cl
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)
4148 - struct net_device *netdev = container_of(cd, struct net_device,
4150 - struct netfront_info *info = netdev_priv(netdev);
4151 + struct netfront_info *info = netdev_priv(to_net_dev(dev));
4153 return sprintf(buf, "%u\n", info->rx_max_target);
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)
4161 - struct net_device *netdev = container_of(cd, struct net_device,
4163 + struct net_device *netdev = to_net_dev(dev);
4164 struct netfront_info *np = netdev_priv(netdev);
4166 unsigned long target;
4167 @@ -1978,16 +1976,15 @@ static ssize_t store_rxbuf_max(struct cl
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)
4175 - struct net_device *netdev = container_of(cd, struct net_device,
4177 - struct netfront_info *info = netdev_priv(netdev);
4178 + struct netfront_info *info = netdev_priv(to_net_dev(dev));
4180 return sprintf(buf, "%u\n", info->rx_target);
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
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]);
4199 @@ -2008,8 +2005,7 @@ static int xennet_sysfs_addif(struct net
4203 - class_device_remove_file(&netdev->class_dev,
4204 - &xennet_attrs[i]);
4205 + device_remove_file(&netdev->dev, &xennet_attrs[i]);
4209 @@ -2017,10 +2013,8 @@ static void xennet_sysfs_delif(struct ne
4213 - for (i = 0; i < ARRAY_SIZE(xennet_attrs); i++) {
4214 - class_device_remove_file(&netdev->class_dev,
4215 - &xennet_attrs[i]);
4217 + for (i = 0; i < ARRAY_SIZE(xennet_attrs); i++)
4218 + device_remove_file(&netdev->dev, &xennet_attrs[i]);
4221 #endif /* CONFIG_SYSFS */
4222 @@ -2186,7 +2180,6 @@ MODULE_ALIAS("xen:vif");
4224 static struct xenbus_driver netfront_driver = {
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
4234 static struct xenbus_driver xenbus_pciback_driver = {
4236 - .owner = THIS_MODULE,
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");
4244 static struct xenbus_driver xenbus_pcifront_driver = {
4246 - .owner = THIS_MODULE,
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_
4254 static struct xenbus_driver scsiback = {
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
4264 static struct xenbus_driver scsifront_driver = {
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 {
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 *
4292 -void __init tpmif_interface_init(void)
4293 +int __init tpmif_interface_init(void)
4295 tpmif_cachep = kmem_cache_create("tpmif_cache", sizeof (tpmif_t),
4297 + return tpmif_cachep ? 0 : -ENOMEM;
4300 -void __exit tpmif_interface_exit(void)
4301 +void tpmif_interface_exit(void)
4303 kmem_cache_destroy(tpmif_cachep);
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);
4311 - tpmif_interface_init();
4312 - tpmif_xenbus_init();
4313 + rc = tpmif_interface_init();
4315 + rc = tpmif_xenbus_init();
4317 + tpmif_interface_exit();
4320 + misc_deregister(&vtpms_miscdevice);
4324 printk(KERN_ALERT "Successfully initialized TPM backend driver.\n");
4329 module_init(tpmback_init);
4331 -void __exit tpmback_exit(void)
4332 +static void __exit tpmback_exit(void)
4334 vtpm_release_packets(NULL, 0);
4335 tpmif_xenbus_exit();
4336 tpmif_interface_exit();
4337 misc_deregister(&vtpms_miscdevice);
4339 +module_exit(tpmback_exit)
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
4346 static struct xenbus_driver tpmback = {
4348 - .owner = THIS_MODULE,
4350 .probe = tpmback_probe,
4351 .remove = tpmback_remove,
4352 @@ -278,9 +277,9 @@ static struct xenbus_driver tpmback = {
4356 -void tpmif_xenbus_init(void)
4357 +int tpmif_xenbus_init(void)
4359 - xenbus_register_backend(&tpmback);
4360 + return xenbus_register_backend(&tpmback);
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
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)
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;
4384 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
4385 + drv->driver.mod_name = mod_name;
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
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)
4399 drv->read_otherend_details = read_backend_details;
4401 - ret = xenbus_register_driver_common(drv, &xenbus_frontend);
4402 + ret = xenbus_register_driver_common(drv, &xenbus_frontend,
4407 @@ -404,7 +411,7 @@ int xenbus_register_frontend(struct xenb
4411 -EXPORT_SYMBOL_GPL(xenbus_register_frontend);
4412 +EXPORT_SYMBOL_GPL(__xenbus_register_frontend);
4414 void xenbus_unregister_driver(struct xenbus_driver *drv)
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,
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
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)
4439 drv->read_otherend_details = read_frontend_details;
4441 - return xenbus_register_driver_common(drv, &xenbus_backend);
4442 + return xenbus_register_driver_common(drv, &xenbus_backend,
4445 -EXPORT_SYMBOL_GPL(xenbus_register_backend);
4446 +EXPORT_SYMBOL_GPL(__xenbus_register_backend);
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,
4455 xenoprof_ovf_interrupt,
4457 + IRQF_DISABLED|IRQF_NOBALANCING,
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
4465 extern spinlock_t i8253_lock;
4467 +#ifdef CONFIG_GENERIC_CLOCKEVENTS
4469 extern struct clock_event_device *global_clock_event;
4471 extern void setup_pit_timer(void);
4475 #define inb_pit inb_p
4476 #define outb_pit outb_p
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 {
4482 extern struct Xgt_desc_struct idt_descr;
4483 DECLARE_PER_CPU(struct Xgt_desc_struct, cpu_gdt_descr);
4485 +extern struct Xgt_desc_struct early_gdt_descr;
4487 static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu)
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))
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.
4501 +static inline void arch_flush_lazy_mmu_mode(void)
4503 + if (arch_use_lazy_mmu_mode())
4504 + xen_multicall_flush(false);
4508 #else /* !CONFIG_XEN || MODULE */
4510 static inline void xen_multicall_flush(bool ignore) {}
4511 @@ -215,7 +228,7 @@ HYPERVISOR_block(
4515 -static inline void /*__noreturn*/
4516 +static inline void __noreturn
4517 HYPERVISOR_shutdown(
4518 unsigned int reason)
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)
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.
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"
4540 @@ -95,7 +95,7 @@ static inline void switch_mm(struct mm_s
4543 #define deactivate_mm(tsk, mm) \
4544 - asm("movl %0,%%fs": :"r" (0));
4545 + asm("movl %0,%%gs": :"r" (0));
4547 static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
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
4552 #include <linux/mm.h> /* for struct page */
4553 #include <asm/io.h> /* for phys_to_virt and page_to_pseudophys */
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)
4564 +#define pmd_populate_kernel(mm, pmd, pte) \
4566 + paravirt_alloc_pt(__pa(pte) >> PAGE_SHIFT); \
4567 + set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte))); \
4570 #define pmd_populate(mm, pmd, pte) \
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
4579 extern void pte_free(struct page *pte);
4581 -#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
4582 +#define __pte_free_tlb(tlb,pte) \
4584 + paravirt_release_pt(page_to_pfn(pte)); \
4585 + tlb_remove_page((tlb),(pte)); \
4588 #ifdef CONFIG_X86_PAE
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
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)
4599 * We only update the dirty/accessed state if we set
4600 @@ -490,12 +491,24 @@ extern pte_t *lookup_address(unsigned lo
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) \
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); \
4619 +#define pte_offset_map_nested(dir, address) \
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); \
4628 #define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
4629 #define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
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, \
4642 @@ -449,8 +449,8 @@ struct thread_struct {
4645 #define start_thread(regs, new_eip, new_esp) do { \
4646 - __asm__("movl %0,%%fs": :"r" (0)); \
4648 + __asm__("movl %0,%%gs": :"r" (0)); \
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
4656 * The GDT has 32 entries
4658 #define GDT_ENTRIES 32
4660 #define GDT_SIZE (GDT_ENTRIES * 8)
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)
4667 /* Simple and small GDT entries for booting only */
4669 #define GDT_ENTRY_BOOT_CS 2
4670 @@ -132,4 +126,21 @@
4671 #define SEGMENT_GDT 0x0
4673 #define get_kernel_rpl() (xen_feature(XENFEAT_supervisor_mode_kernel)?0:1)
4676 + * Matching rules for certain types of segments.
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))
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))
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)
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);
4698 +#ifndef CONFIG_PARAVIRT
4699 +#define startup_ipi_hook(phys_apicid, start_eip, start_esp) \
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
4710 #include <asm/scatterlist.h>
4712 -#include <asm/swiotlb.h>
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)
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)
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)
4732 -/* physical address -> PTE */
4733 -static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
4735 - unsigned long pteval;
4736 - pteval = physpage | pgprot_val(pgprot);
4737 - pteval &= __supported_pte_mask;
4738 - return __pte(pteval);
4741 /* Change flags of a PTE */
4742 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
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
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;
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;
4761 #define NO_PROC_ID 0xFF /* No processor magic marker */
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
4767 /* A xenbus driver. */
4768 struct xenbus_driver {
4770 - struct module *owner;
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);
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);
4785 +static inline int __must_check
4786 +xenbus_register_frontend(struct xenbus_driver *drv)
4788 + return __xenbus_register_frontend(drv, THIS_MODULE, KBUILD_MODNAME);
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)
4797 + return __xenbus_register_backend(drv, THIS_MODULE, KBUILD_MODNAME);
4800 void xenbus_unregister_driver(struct xenbus_driver *drv);
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.
4810 -swiotlb_init_with_default_size (size_t default_size)
4812 +swiotlb_init_with_default_size(size_t default_size)
4814 unsigned long i, bytes;
4816 @@ -221,7 +221,7 @@ swiotlb_init_with_default_size (size_t d
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.
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 : "?");
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;
4840 - sg->dma_address = (dma_addr_t)virt_to_bus(map);
4841 + sg->dma_address = virt_to_bus(map);
4843 sg->dma_address = dev_addr;
4844 sg->dma_length = sg->length;
4845 @@ -624,8 +624,7 @@ swiotlb_unmap_sg(struct device *hwdev, s
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);
4854 gnttab_dma_unmap_page(sg->dma_address);
4855 @@ -648,8 +647,7 @@ swiotlb_sync_sg_for_cpu(struct device *h
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);
4865 @@ -663,8 +661,7 @@ swiotlb_sync_sg_for_device(struct device
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);