Patches contributed by Eötvös Lorand University


commit ae216dd239765afd592f65d94d8430244cf77ed1
Merge: f9915bfef3c6 34cd4998d38f
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Feb 10 13:58:28 2009 +0100

    Merge branch 'tip/tracing/ftrace' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace

commit f9915bfef3c64ea0b0b960dd1b999b584a7ef460
Merge: b91facc36736 acd895795d35
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Feb 10 13:25:42 2009 +0100

    Merge branches 'tracing/ftrace' and 'tracing/urgent' into tracing/core

commit 92e2d508464b6293ad274fb606f766a458894142
Merge: 5d96218b4a5e d315760ffa26
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Feb 10 00:41:02 2009 +0100

    Merge branch 'x86/urgent' into core/percpu
    
    Conflicts:
            arch/x86/kernel/acpi/boot.c

diff --cc arch/x86/kernel/acpi/boot.c
index 4cb5964f1499,7678f10c4568..c193ec3c695e
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@@ -973,19 -973,42 +973,42 @@@ void __init mp_register_ioapic(int id, 
  	nr_ioapics++;
  }
  
+ int __init acpi_probe_gsi(void)
+ {
+ 	int idx;
+ 	int gsi;
+ 	int max_gsi = 0;
+ 
+ 	if (acpi_disabled)
+ 		return 0;
+ 
+ 	if (!acpi_ioapic)
+ 		return 0;
+ 
+ 	max_gsi = 0;
+ 	for (idx = 0; idx < nr_ioapics; idx++) {
+ 		gsi = mp_ioapic_routing[idx].gsi_end;
+ 
+ 		if (gsi > max_gsi)
+ 			max_gsi = gsi;
+ 	}
+ 
+ 	return max_gsi + 1;
+ }
+ 
 -static void assign_to_mp_irq(struct mp_config_intsrc *m,
 -				    struct mp_config_intsrc *mp_irq)
 +static void assign_to_mp_irq(struct mpc_intsrc *m,
 +				    struct mpc_intsrc *mp_irq)
  {
 -	memcpy(mp_irq, m, sizeof(struct mp_config_intsrc));
 +	memcpy(mp_irq, m, sizeof(struct mpc_intsrc));
  }
  
 -static int mp_irq_cmp(struct mp_config_intsrc *mp_irq,
 -				struct mp_config_intsrc *m)
 +static int mp_irq_cmp(struct mpc_intsrc *mp_irq,
 +				struct mpc_intsrc *m)
  {
 -	return memcmp(mp_irq, m, sizeof(struct mp_config_intsrc));
 +	return memcmp(mp_irq, m, sizeof(struct mpc_intsrc));
  }
  
 -static void save_mp_irq(struct mp_config_intsrc *m)
 +static void save_mp_irq(struct mpc_intsrc *m)
  {
  	int i;
  
diff --cc arch/x86/kernel/io_apic.c
index c0498daf01c3,bc7ac4da90d7..0480d06a12a4
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@@ -3812,32 -3841,26 +3812,42 @@@ int __init io_apic_get_redir_entries (i
  
  void __init probe_nr_irqs_gsi(void)
  {
- 	int idx;
  	int nr = 0;
  
- 	for (idx = 0; idx < nr_ioapics; idx++)
- 		nr += io_apic_get_redir_entries(idx) + 1;
- 
- 	if (nr > nr_irqs_gsi)
+ 	nr = acpi_probe_gsi();
+ 	if (nr > nr_irqs_gsi) {
  		nr_irqs_gsi = nr;
+ 	} else {
+ 		/* for acpi=off or acpi is not compiled in */
+ 		int idx;
+ 
+ 		nr = 0;
+ 		for (idx = 0; idx < nr_ioapics; idx++)
+ 			nr += io_apic_get_redir_entries(idx) + 1;
+ 
+ 		if (nr > nr_irqs_gsi)
+ 			nr_irqs_gsi = nr;
+ 	}
+ 
+ 	printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi);
  }
  
 +#ifdef CONFIG_SPARSE_IRQ
 +int __init arch_probe_nr_irqs(void)
 +{
 +	int nr;
 +
 +	nr = ((8 * nr_cpu_ids) > (32 * nr_ioapics) ?
 +		(NR_VECTORS + (8 * nr_cpu_ids)) :
 +		(NR_VECTORS + (32 * nr_ioapics)));
 +
 +	if (nr < nr_irqs && nr > nr_irqs_gsi)
 +		nr_irqs = nr;
 +
 +	return 0;
 +}
 +#endif
 +
  /* --------------------------------------------------------------------------
                            ACPI-based IOAPIC Configuration
     -------------------------------------------------------------------------- */

commit 5d96218b4a5ee0c5ff0ac87f3ba90cfa86ca0ca1
Merge: 249d51b53aea 18114f61359a
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Feb 10 00:40:48 2009 +0100

    Merge branch 'x86/uaccess' into core/percpu

diff --cc arch/x86/include/asm/paravirt.h
index c85e7475e171,32bc6c2c1386..ff691736f5e9
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@@ -1466,13 -1387,8 +1466,11 @@@ static inline void __set_fixmap(unsigne
  }
  
  void _paravirt_nop(void);
 +u32 _paravirt_ident_32(u32);
 +u64 _paravirt_ident_64(u64);
 +
  #define paravirt_nop	((void *)_paravirt_nop)
  
- void paravirt_use_bytelocks(void);
- 
  #ifdef CONFIG_SMP
  
  static inline int __raw_spin_is_locked(struct raw_spinlock *lock)

commit 249d51b53aea1b7cdb1be65a1a9a0c59d9e06f3e
Merge: 44581a28e805 8e4921515c1a
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Feb 9 14:58:11 2009 +0100

    Merge commit 'v2.6.29-rc4' into core/percpu
    
    Conflicts:
            arch/x86/mach-voyager/voyager_smp.c
            arch/x86/mm/fault.c

diff --cc arch/arm/kernel/irq.c
index 4bb723eadad1,363db186cb93..45eacb5a2ecd
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@@ -101,14 -101,9 +101,14 @@@ unlock
  /* Handle bad interrupts */
  static struct irq_desc bad_irq_desc = {
  	.handle_irq = handle_bad_irq,
- 	.lock = SPIN_LOCK_UNLOCKED
+ 	.lock = __SPIN_LOCK_UNLOCKED(bad_irq_desc.lock),
  };
  
 +#ifdef CONFIG_CPUMASK_OFFSTACK
 +/* We are not allocating bad_irq_desc.affinity or .pending_mask */
 +#error "ARM architecture does not support CONFIG_CPUMASK_OFFSTACK."
 +#endif
 +
  /*
   * do_IRQ handles all hardware IRQ's.  Decoded IRQs should not
   * come via this function.  Instead, they should provide their
diff --cc arch/x86/kernel/entry_64.S
index e4c9710cae52,a1346217e43c..586bed677557
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@@ -342,11 -341,12 +342,12 @@@ ENTRY(save_args
  	 * a little cheaper to use a separate counter in the PDA (short of
  	 * moving irq_enter into assembly, which would be too much work)
  	 */
 -1:	incl %gs:pda_irqcount
 +1:	incl PER_CPU_VAR(irq_count)
  	jne 2f
  	popq_cfi %rax			/* move return address... */
 -	mov %gs:pda_irqstackptr,%rsp
 +	mov PER_CPU_VAR(irq_stack_ptr),%rsp
  	EMPTY_FRAME 0
+ 	pushq_cfi %rbp			/* backlink for unwinder */
  	pushq_cfi %rax			/* ... to the new stack */
  	/*
  	 * We entered an interrupt context - irqs are off:
diff --cc arch/x86/mach-voyager/voyager_smp.c
index 58c7cac3440d,7ffcdeec4631..6f5a38c7f900
--- a/arch/x86/mach-voyager/voyager_smp.c
+++ b/arch/x86/mach-voyager/voyager_smp.c
@@@ -1746,13 -1745,14 +1744,13 @@@ static void __init voyager_smp_prepare_
  
  static void __cpuinit voyager_smp_prepare_boot_cpu(void)
  {
 -	init_gdt(smp_processor_id());
 -	switch_to_new_gdt();
 +	int cpu = smp_processor_id();
 +	switch_to_new_gdt(cpu);
  
- 	cpu_set(cpu, cpu_online_map);
- 	cpu_set(cpu, cpu_callout_map);
- 	cpu_set(cpu, cpu_possible_map);
- 	cpu_set(cpu, cpu_present_map);
+ 	cpu_online_map = cpumask_of_cpu(smp_processor_id());
+ 	cpu_callout_map = cpumask_of_cpu(smp_processor_id());
+ 	cpu_callin_map = CPU_MASK_NONE;
+ 	cpu_present_map = cpumask_of_cpu(smp_processor_id());
 -
  }
  
  static int __cpuinit voyager_cpu_up(unsigned int cpu)
@@@ -1779,11 -1779,12 +1777,11 @@@ static void __init voyager_smp_cpus_don
  void __init smp_setup_processor_id(void)
  {
  	current_thread_info()->cpu = hard_smp_processor_id();
 -	x86_write_percpu(cpu_number, hard_smp_processor_id());
  }
  
- static void voyager_send_call_func(cpumask_t callmask)
+ static void voyager_send_call_func(const struct cpumask *callmask)
  {
- 	__u32 mask = cpus_addr(callmask)[0] & ~(1 << smp_processor_id());
+ 	__u32 mask = cpus_addr(*callmask)[0] & ~(1 << smp_processor_id());
  	send_CPI(mask, VIC_CALL_FUNCTION_CPI);
  }
  
diff --cc arch/x86/mm/fault.c
index 65709a6aa6ee,c76ef1d701c9..8c3f3113a6ec
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@@ -807,8 -601,8 +807,6 @@@ void __kprobes do_page_fault(struct pt_
  	/* get the address */
  	address = read_cr2();
  
- 	if (unlikely(notify_page_fault(regs)))
- 		return;
 -	si_code = SEGV_MAPERR;
 -
  	if (unlikely(kmmio_fault(regs, address)))
  		return;
  
@@@ -835,17 -629,23 +833,22 @@@
  			return;
  
  		/* Can handle a stale RO->RW TLB */
 -		if (spurious_fault(address, error_code))
 +		if (spurious_fault(error_code, address))
  			return;
  
+ 		/* kprobes don't want to hook the spurious faults. */
+ 		if (notify_page_fault(regs))
+ 			return;
  		/*
  		 * Don't take the mm semaphore here. If we fixup a prefetch
  		 * fault we could otherwise deadlock.
  		 */
 -		goto bad_area_nosemaphore;
 +		bad_area_nosemaphore(regs, error_code, address);
 +		return;
  	}
  
 -	/* kprobes don't want to hook the spurious faults. */
 -	if (notify_page_fault(regs))
++	if (unlikely(notify_page_fault(regs)))
+ 		return;
 -
  	/*
  	 * It's safe to allow irq's after cr2 has been saved and the
  	 * vmalloc fault has been handled.
diff --cc kernel/irq/numa_migrate.c
index 666260e4c065,acd88356ac76..7f9b80434e32
--- a/kernel/irq/numa_migrate.c
+++ b/kernel/irq/numa_migrate.c
@@@ -95,8 -81,10 +95,9 @@@ static struct irq_desc *__real_move_irq
  		desc = old_desc;
  		goto out_unlock;
  	}
 -	init_copy_one_irq_desc(irq, old_desc, desc, cpu);
  
  	irq_desc_ptrs[irq] = desc;
+ 	spin_unlock_irqrestore(&sparse_irq_lock, flags);
  
  	/* free the old one */
  	free_one_irq_desc(old_desc, desc);

commit eca217b36e5d7d4377493d5cedd89105e66a5a72
Merge: 54a353a0f845 e4d0407185cd
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Feb 9 12:16:59 2009 +0100

    Merge branch 'x86/paravirt' into x86/apic
    
    Conflicts:
            arch/x86/mach-voyager/voyager_smp.c

diff --cc arch/x86/include/asm/paravirt.h
index 7e674ea80f0d,c85e7475e171..ff691736f5e9
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@@ -1371,8 -1466,13 +1466,11 @@@ static inline void __set_fixmap(unsigne
  }
  
  void _paravirt_nop(void);
+ u32 _paravirt_ident_32(u32);
+ u64 _paravirt_ident_64(u64);
+ 
  #define paravirt_nop	((void *)_paravirt_nop)
  
 -void paravirt_use_bytelocks(void);
 -
  #ifdef CONFIG_SMP
  
  static inline int __raw_spin_is_locked(struct raw_spinlock *lock)
diff --cc arch/x86/mach-voyager/voyager_smp.c
index 328cb0ce62f0,58c7cac3440d..6f5a38c7f900
--- a/arch/x86/mach-voyager/voyager_smp.c
+++ b/arch/x86/mach-voyager/voyager_smp.c
@@@ -1744,13 -1746,13 +1744,13 @@@ static void __init voyager_smp_prepare_
  
  static void __cpuinit voyager_smp_prepare_boot_cpu(void)
  {
- 	switch_to_new_gdt();
+ 	int cpu = smp_processor_id();
+ 	switch_to_new_gdt(cpu);
  
 -	cpu_set(cpu, cpu_online_map);
 -	cpu_set(cpu, cpu_callout_map);
 -	cpu_set(cpu, cpu_possible_map);
 -	cpu_set(cpu, cpu_present_map);
 +	cpu_online_map = cpumask_of_cpu(smp_processor_id());
 +	cpu_callout_map = cpumask_of_cpu(smp_processor_id());
 +	cpu_callin_map = CPU_MASK_NONE;
 +	cpu_present_map = cpumask_of_cpu(smp_processor_id());
- 
  }
  
  static int __cpuinit voyager_cpu_up(unsigned int cpu)

commit 1dfba05d0f1a9b4245bb242a7c17fe448811a520
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Feb 9 12:06:54 2009 +0100

    tracing/blktrace: move the tracing file to kernel/trace, fix
    
    Impact: build fix
    
    The BLK_DEV_IO_TRACE entry used to be in block/Kconfig - which
    file itself was dependent on CONFIG_BLOCK. But now the entry is
    in kernel/trace/Kconfig - which is present even on !CONFIG_BLOCK.
    
    So add a 'depends on BLOCK' to BLK_DEV_IO_TRACE.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 4fee43c01942..3a331289457a 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -305,6 +305,7 @@ config WORKQUEUE_TRACER
 config BLK_DEV_IO_TRACE
 	bool "Support for tracing block io actions"
 	depends on SYSFS
+	depends on BLOCK
 	select RELAY
 	select DEBUG_FS
 	select TRACEPOINTS

commit c47c1b1f3a9d6973108020df1dcab7604f7774dd
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Feb 9 11:57:45 2009 +0100

    x86, pgtable.h: fix 2-level 32-bit build
    
    - pmd_flags() needs to be available on 2-levels too
    - provide pud_large() wrapper as well
    - include page.h - it provides basic types relied on by pgtable.h
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h
index 0b16b64a8fe7..823cc931363f 100644
--- a/arch/x86/include/asm/page.h
+++ b/arch/x86/include/asm/page.h
@@ -139,10 +139,6 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
 	return pmd.pmd;
 }
 
-static inline pmdval_t pmd_flags(pmd_t pmd)
-{
-	return native_pmd_val(pmd) & PTE_FLAGS_MASK;
-}
 #else  /* PAGETABLE_LEVELS == 2 */
 #include <asm-generic/pgtable-nopmd.h>
 
@@ -152,6 +148,11 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
 }
 #endif	/* PAGETABLE_LEVELS >= 3 */
 
+static inline pmdval_t pmd_flags(pmd_t pmd)
+{
+	return native_pmd_val(pmd) & PTE_FLAGS_MASK;
+}
+
 static inline pte_t native_make_pte(pteval_t val)
 {
 	return (pte_t) { .pte = val };
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 76696e98f5b3..178205305ac0 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -1,6 +1,8 @@
 #ifndef _ASM_X86_PGTABLE_H
 #define _ASM_X86_PGTABLE_H
 
+#include <asm/page.h>
+
 #define FIRST_USER_ADDRESS	0
 
 #define _PAGE_BIT_PRESENT	0	/* is present */
@@ -528,6 +530,13 @@ static inline unsigned long pages_to_mb(unsigned long npg)
 #define io_remap_pfn_range(vma, vaddr, pfn, size, prot)	\
 	remap_pfn_range(vma, vaddr, pfn, size, prot)
 
+#if PAGETABLE_LEVELS == 2
+static inline int pud_large(pud_t pud)
+{
+	return 0;
+}
+#endif
+
 #if PAGETABLE_LEVELS > 2
 static inline int pud_none(pud_t pud)
 {

commit e5f7f202f31fd05e9de7e1ba5a7b30de7855f5aa
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Feb 9 11:42:57 2009 +0100

    x86, pgtable.h: macro-ify *_page() methods
    
    The p?d_page() methods still rely on highlevel types and methods:
    
    In file included from arch/x86/kernel/early_printk.c:18:
    /home/mingo/tip/arch/x86/include/asm/pgtable.h: In function ‘pmd_page’:
    /home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: implicit declaration of function ‘__pfn_to_section’
    /home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: initialization makes pointer from integer without a cast
    /home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: implicit declaration of function ‘__section_mem_map_addr’
    /home/mingo/tip/arch/x86/include/asm/pgtable.h:516: error: return makes pointer from integer without a cast
    
    So convert them to macros and document the type dependency.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index a80a956ae655..76696e98f5b3 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -473,10 +473,11 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
 	return (unsigned long)__va(pmd_val(pmd) & PTE_PFN_MASK);
 }
 
-static inline struct page *pmd_page(pmd_t pmd)
-{
-	return pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT);
-}
+/*
+ * Currently stuck as a macro due to indirect forward reference to
+ * linux/mmzone.h's __section_mem_map_addr() definition:
+ */
+#define pmd_page(pmd)	pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT)
 
 /*
  * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
@@ -543,10 +544,11 @@ static inline unsigned long pud_page_vaddr(pud_t pud)
 	return (unsigned long)__va((unsigned long)pud_val(pud) & PTE_PFN_MASK);
 }
 
-static inline struct page *pud_page(pud_t pud)
-{
-	return pfn_to_page(pud_val(pud) >> PAGE_SHIFT);
-}
+/*
+ * Currently stuck as a macro due to indirect forward reference to
+ * linux/mmzone.h's __section_mem_map_addr() definition:
+ */
+#define pud_page(pud)		pfn_to_page(pud_val(pud) >> PAGE_SHIFT)
 
 /* Find an entry in the second-level page table.. */
 static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
@@ -582,10 +584,11 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)
 	return (unsigned long)__va((unsigned long)pgd_val(pgd) & PTE_PFN_MASK);
 }
 
-static inline struct page *pgd_page(pgd_t pgd)
-{
-	return pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT);
-}
+/*
+ * Currently stuck as a macro due to indirect forward reference to
+ * linux/mmzone.h's __section_mem_map_addr() definition:
+ */
+#define pgd_page(pgd)		pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT)
 
 /* to find an entry in a page-table-directory. */
 static inline unsigned pud_index(unsigned long address)

commit 726c0d95b6bd06cb83efd36a76ccf03fa9a770f0
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Feb 9 11:32:17 2009 +0100

    x86: early_printk.c - fix pgtable.h unification fallout
    
     arch/x86/kernel/early_printk.c: In function ‘early_dbgp_init’:
     arch/x86/kernel/early_printk.c:827: error: ‘PAGE_KERNEL_NOCACHE’ undeclared (first use in this function)
     arch/x86/kernel/early_printk.c:827: error: (Each undeclared identifier is reported only once
     arch/x86/kernel/early_printk.c:827: error: for each function it appears in.)
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 6a36dd228b69..639ad98238a2 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -14,6 +14,7 @@
 #include <xen/hvc-console.h>
 #include <asm/pci-direct.h>
 #include <asm/fixmap.h>
+#include <asm/pgtable.h>
 #include <linux/usb/ehci_def.h>
 
 /* Simple VGA output */