From: Ingo Molnar Date: Thu, 26 Mar 2009 20:39:17 +0000 (+0100) Subject: Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 X-Git-Tag: v2.6.30-rc1~639^2~1 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=6e15cf04860074ad032e88c306bea656bbdd0f22 Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 Conflicts: arch/parisc/kernel/irq.c arch/x86/include/asm/fixmap_64.h arch/x86/include/asm/setup.h kernel/irq/handle.c Semantic merge: arch/x86/include/asm/fixmap.h Signed-off-by: Ingo Molnar --- 6e15cf04860074ad032e88c306bea656bbdd0f22 diff --cc arch/ia64/kernel/msi_ia64.c index 368ee4e,dcb6b7c..2b15e23 --- a/arch/ia64/kernel/msi_ia64.c +++ b/arch/ia64/kernel/msi_ia64.c @@@ -146,11 -183,11 +146,11 @@@ static void dmar_msi_set_affinity(unsig msg.data &= ~MSI_DATA_VECTOR_MASK; msg.data |= MSI_DATA_VECTOR(cfg->vector); - msg.address_lo &= ~MSI_ADDR_DESTID_MASK; - msg.address_lo |= MSI_ADDR_DESTID_CPU(cpu_physical_id(cpu)); + msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK; + msg.address_lo |= MSI_ADDR_DEST_ID_CPU(cpu_physical_id(cpu)); dmar_msi_write(irq, &msg); - irq_desc[irq].affinity = *mask; + cpumask_copy(irq_desc[irq].affinity, mask); } #endif /* CONFIG_SMP */ diff --cc arch/parisc/kernel/irq.c index adfd617,4948280..1c740f5 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c @@@ -132,13 -133,10 +132,13 @@@ int cpu_check_affinity(unsigned int irq static void cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest) { - if (cpu_check_affinity(irq, dest)) + int cpu_dest; + + cpu_dest = cpu_check_affinity(irq, dest); + if (cpu_dest < 0) return; - cpumask_copy(&irq_desc[irq].affinity, &cpumask_of_cpu(cpu_dest)); - cpumask_copy(irq_desc[irq].affinity, dest); ++ cpumask_copy(&irq_desc[irq].affinity, dest); } #endif diff --cc arch/x86/include/asm/fixmap.h index 23696d4,dca8f03..63a79c7 --- a/arch/x86/include/asm/fixmap.h +++ b/arch/x86/include/asm/fixmap.h @@@ -1,11 -14,142 +14,132 @@@ #ifndef _ASM_X86_FIXMAP_H #define _ASM_X86_FIXMAP_H + #ifndef __ASSEMBLY__ + #include + #include + #include + #include + #ifdef CONFIG_X86_32 + #include + #include + #else + #include -#ifdef CONFIG_EFI -#include -#endif + #endif + + /* + * We can't declare FIXADDR_TOP as variable for x86_64 because vsyscall + * uses fixmaps that relies on FIXADDR_TOP for proper address calculation. + * Because of this, FIXADDR_TOP x86 integration was left as later work. + */ + #ifdef CONFIG_X86_32 + /* used by vmalloc.c, vsyscall.lds.S. + * + * Leave one empty page between vmalloc'ed areas and + * the start of the fixmap. + */ + extern unsigned long __FIXADDR_TOP; + #define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP) + + #define FIXADDR_USER_START __fix_to_virt(FIX_VDSO) + #define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1) + #else + #define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE) + + /* Only covers 32bit vsyscalls currently. Need another set for 64bit. */ + #define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL) + #define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE) + #endif + + + /* + * Here we define all the compile-time 'special' virtual + * addresses. The point is to have a constant address at + * compile time, but to set the physical address only + * in the boot process. + * for x86_32: We allocate these special addresses + * from the end of virtual memory (0xfffff000) backwards. + * Also this lets us do fail-safe vmalloc(), we + * can guarantee that these special addresses and + * vmalloc()-ed addresses never overlap. + * + * These 'compile-time allocated' memory buffers are + * fixed-size 4k pages (or larger if used with an increment + * higher than 1). Use set_fixmap(idx,phys) to associate + * physical memory with fixmap indices. + * + * TLB entries of such buffers will not be flushed across + * task switches. + */ + enum fixed_addresses { #ifdef CONFIG_X86_32 - # include "fixmap_32.h" + FIX_HOLE, + FIX_VDSO, #else - # include "fixmap_64.h" + VSYSCALL_LAST_PAGE, + VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE + + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1, + VSYSCALL_HPET, #endif + FIX_DBGP_BASE, + FIX_EARLYCON_MEM_BASE, + #ifdef CONFIG_X86_LOCAL_APIC + FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ + #endif + #ifdef CONFIG_X86_IO_APIC + FIX_IO_APIC_BASE_0, + FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1, + #endif -#ifdef CONFIG_X86_64 -#ifdef CONFIG_EFI - FIX_EFI_IO_MAP_LAST_PAGE, - FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE - + MAX_EFI_IO_PAGES - 1, -#endif -#endif + #ifdef CONFIG_X86_VISWS_APIC + FIX_CO_CPU, /* Cobalt timer */ + FIX_CO_APIC, /* Cobalt APIC Redirection Table */ + FIX_LI_PCIA, /* Lithium PCI Bridge A */ + FIX_LI_PCIB, /* Lithium PCI Bridge B */ + #endif + #ifdef CONFIG_X86_F00F_BUG + FIX_F00F_IDT, /* Virtual mapping for IDT */ + #endif + #ifdef CONFIG_X86_CYCLONE_TIMER + FIX_CYCLONE_TIMER, /*cyclone timer register*/ + #endif + #ifdef CONFIG_X86_32 + FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ + FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, + #ifdef CONFIG_PCI_MMCONFIG + FIX_PCIE_MCFG, + #endif + #endif + #ifdef CONFIG_PARAVIRT + FIX_PARAVIRT_BOOTMAP, + #endif + __end_of_permanent_fixed_addresses, + #ifdef CONFIG_PROVIDE_OHCI1394_DMA_INIT + FIX_OHCI1394_BASE, + #endif + /* + * 256 temporary boot-time mappings, used by early_ioremap(), + * before ioremap() is functional. + * + * We round it up to the next 256 pages boundary so that we + * can have a single pgd entry and a single pte table: + */ + #define NR_FIX_BTMAPS 64 + #define FIX_BTMAPS_SLOTS 4 + FIX_BTMAP_END = __end_of_permanent_fixed_addresses + 256 - + (__end_of_permanent_fixed_addresses & 255), + FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS*FIX_BTMAPS_SLOTS - 1, + #ifdef CONFIG_X86_32 + FIX_WP_TEST, + #endif + __end_of_fixed_addresses + }; + + + extern void reserve_top_address(unsigned long reserve); + + #define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT) + #define FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) + #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) + #define FIXADDR_BOOT_START (FIXADDR_TOP - FIXADDR_BOOT_SIZE) extern int fixmaps_set; diff --cc arch/x86/kernel/cpu/intel.c index 5fff00c,25c559b..1a89a2b --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@@ -65,10 -60,20 +64,22 @@@ static void __cpuinit early_init_intel( if (c->x86_power & (1 << 8)) { set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC); + set_cpu_cap(c, X86_FEATURE_TSC_RELIABLE); + sched_clock_stable = 1; } + /* + * There is a known erratum on Pentium III and Core Solo + * and Core Duo CPUs. + * " Page with PAT set to WC while associated MTRR is UC + * may consolidate to UC " + * Because of this erratum, it is better to stick with + * setting WC in MTRR rather than using PAT on these CPUs. + * + * Enable PAT WC only on P4, Core 2 or later CPUs. + */ + if (c->x86 == 6 && c->x86_model < 15) + clear_cpu_cap(c, X86_FEATURE_PAT); } #ifdef CONFIG_X86_32 diff --cc kernel/irq/handle.c index f6cdda6,f51eaee..9ebf779 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c @@@ -243,9 -252,8 +255,9 @@@ int __init early_irq_init(void for (i = 0; i < count; i++) { desc[i].irq = i; + init_alloc_desc_masks(&desc[i], 0, true); + desc[i].kstat_irqs = kstat_irqs_all[i]; } - return arch_early_irq_init(); } diff --cc kernel/irq/internals.h index b60950b,40416a8..ee1aa9f --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h @@@ -15,9 -15,15 +15,16 @@@ extern int __irq_set_trigger(struct irq extern struct lock_class_key irq_desc_lock_class; extern void init_kstat_irqs(struct irq_desc *desc, int cpu, int nr); +extern void clear_kstat_irqs(struct irq_desc *desc); extern spinlock_t sparse_irq_lock; + + #ifdef CONFIG_SPARSE_IRQ + /* irq_desc_ptrs allocated at boot time */ + extern struct irq_desc **irq_desc_ptrs; + #else + /* irq_desc_ptrs is a fixed size array */ extern struct irq_desc *irq_desc_ptrs[NR_IRQS]; + #endif #ifdef CONFIG_PROC_FS extern void register_irq_proc(unsigned int irq, struct irq_desc *desc); diff --cc lib/Makefile index 8bdc647,790de7c..051a33a --- a/lib/Makefile +++ b/lib/Makefile @@@ -12,7 -12,7 +12,7 @@@ lib-y := ctype.o string.o vsprintf.o cm idr.o int_sqrt.o extable.o prio_tree.o \ sha1.o irq_regs.o reciprocal_div.o argv_split.o \ proportions.o prio_heap.o ratelimit.o show_mem.o \ - is_single_threaded.o plist.o - is_single_threaded.o decompress.o ++ is_single_threaded.o plist.o decompress.o lib-$(CONFIG_MMU) += ioremap.o lib-$(CONFIG_SMP) += cpumask.o