Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, mcheck: Avoid duplicate sysfs links/files for thresholding banks
io-mapping: Fix the address space annotations
x86: Fix the address space annotations of iomap_atomic_prot_pfn()
x86, mm: Fix CONFIG_VMSPLIT_1G and 2G_OPT trampoline
x86, hwmon: Fix unsafe smp_processor_id() in thermal_throttle_add_dev

+25 -25
+2 -2
arch/x86/include/asm/iomap.h
··· 26 #include <asm/pgtable.h> 27 #include <asm/tlbflush.h> 28 29 - void * 30 iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); 31 32 void 33 - iounmap_atomic(void *kvaddr, enum km_type type); 34 35 int 36 iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot);
··· 26 #include <asm/pgtable.h> 27 #include <asm/tlbflush.h> 28 29 + void __iomem * 30 iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); 31 32 void 33 + iounmap_atomic(void __iomem *kvaddr, enum km_type type); 34 35 int 36 iomap_create_wc(resource_size_t base, unsigned long size, pgprot_t *prot);
+2 -2
arch/x86/kernel/cpu/mcheck/mce_amd.c
··· 530 err = -ENOMEM; 531 goto out; 532 } 533 - if (!alloc_cpumask_var(&b->cpus, GFP_KERNEL)) { 534 kfree(b); 535 err = -ENOMEM; 536 goto out; ··· 543 #ifndef CONFIG_SMP 544 cpumask_setall(b->cpus); 545 #else 546 - cpumask_copy(b->cpus, c->llc_shared_map); 547 #endif 548 549 per_cpu(threshold_banks, cpu)[bank] = b;
··· 530 err = -ENOMEM; 531 goto out; 532 } 533 + if (!zalloc_cpumask_var(&b->cpus, GFP_KERNEL)) { 534 kfree(b); 535 err = -ENOMEM; 536 goto out; ··· 543 #ifndef CONFIG_SMP 544 cpumask_setall(b->cpus); 545 #else 546 + cpumask_set_cpu(cpu, b->cpus); 547 #endif 548 549 per_cpu(threshold_banks, cpu)[bank] = b;
+5 -4
arch/x86/kernel/cpu/mcheck/therm_throt.c
··· 202 203 #ifdef CONFIG_SYSFS 204 /* Add/Remove thermal_throttle interface for CPU device: */ 205 - static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev) 206 { 207 int err; 208 - struct cpuinfo_x86 *c = &cpu_data(smp_processor_id()); 209 210 err = sysfs_create_group(&sys_dev->kobj, &thermal_attr_group); 211 if (err) ··· 252 case CPU_UP_PREPARE: 253 case CPU_UP_PREPARE_FROZEN: 254 mutex_lock(&therm_cpu_lock); 255 - err = thermal_throttle_add_dev(sys_dev); 256 mutex_unlock(&therm_cpu_lock); 257 WARN_ON(err); 258 break; ··· 288 #endif 289 /* connect live CPUs to sysfs */ 290 for_each_online_cpu(cpu) { 291 - err = thermal_throttle_add_dev(get_cpu_sysdev(cpu)); 292 WARN_ON(err); 293 } 294 #ifdef CONFIG_HOTPLUG_CPU
··· 202 203 #ifdef CONFIG_SYSFS 204 /* Add/Remove thermal_throttle interface for CPU device: */ 205 + static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev, 206 + unsigned int cpu) 207 { 208 int err; 209 + struct cpuinfo_x86 *c = &cpu_data(cpu); 210 211 err = sysfs_create_group(&sys_dev->kobj, &thermal_attr_group); 212 if (err) ··· 251 case CPU_UP_PREPARE: 252 case CPU_UP_PREPARE_FROZEN: 253 mutex_lock(&therm_cpu_lock); 254 + err = thermal_throttle_add_dev(sys_dev, cpu); 255 mutex_unlock(&therm_cpu_lock); 256 WARN_ON(err); 257 break; ··· 287 #endif 288 /* connect live CPUs to sysfs */ 289 for_each_online_cpu(cpu) { 290 + err = thermal_throttle_add_dev(get_cpu_sysdev(cpu), cpu); 291 WARN_ON(err); 292 } 293 #ifdef CONFIG_HOTPLUG_CPU
+1 -2
arch/x86/kernel/trampoline.c
··· 45 /* Copy kernel address range */ 46 clone_pgd_range(trampoline_pg_dir + KERNEL_PGD_BOUNDARY, 47 swapper_pg_dir + KERNEL_PGD_BOUNDARY, 48 - min_t(unsigned long, KERNEL_PGD_PTRS, 49 - KERNEL_PGD_BOUNDARY)); 50 51 /* Initialize low mappings */ 52 clone_pgd_range(trampoline_pg_dir,
··· 45 /* Copy kernel address range */ 46 clone_pgd_range(trampoline_pg_dir + KERNEL_PGD_BOUNDARY, 47 swapper_pg_dir + KERNEL_PGD_BOUNDARY, 48 + KERNEL_PGD_PTRS); 49 50 /* Initialize low mappings */ 51 clone_pgd_range(trampoline_pg_dir,
+3 -3
arch/x86/mm/iomap_32.c
··· 74 /* 75 * Map 'pfn' using fixed map 'type' and protections 'prot' 76 */ 77 - void * 78 iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) 79 { 80 /* ··· 86 if (!pat_enabled && pgprot_val(prot) == pgprot_val(PAGE_KERNEL_WC)) 87 prot = PAGE_KERNEL_UC_MINUS; 88 89 - return kmap_atomic_prot_pfn(pfn, type, prot); 90 } 91 EXPORT_SYMBOL_GPL(iomap_atomic_prot_pfn); 92 93 void 94 - iounmap_atomic(void *kvaddr, enum km_type type) 95 { 96 unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; 97 enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
··· 74 /* 75 * Map 'pfn' using fixed map 'type' and protections 'prot' 76 */ 77 + void __iomem * 78 iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot) 79 { 80 /* ··· 86 if (!pat_enabled && pgprot_val(prot) == pgprot_val(PAGE_KERNEL_WC)) 87 prot = PAGE_KERNEL_UC_MINUS; 88 89 + return (void __force __iomem *) kmap_atomic_prot_pfn(pfn, type, prot); 90 } 91 EXPORT_SYMBOL_GPL(iomap_atomic_prot_pfn); 92 93 void 94 + iounmap_atomic(void __iomem *kvaddr, enum km_type type) 95 { 96 unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; 97 enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
+12 -12
include/linux/io-mapping.h
··· 79 } 80 81 /* Atomic map/unmap */ 82 - static inline void * 83 io_mapping_map_atomic_wc(struct io_mapping *mapping, 84 unsigned long offset, 85 int slot) ··· 94 } 95 96 static inline void 97 - io_mapping_unmap_atomic(void *vaddr, int slot) 98 { 99 iounmap_atomic(vaddr, slot); 100 } 101 102 - static inline void * 103 io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) 104 { 105 resource_size_t phys_addr; ··· 111 } 112 113 static inline void 114 - io_mapping_unmap(void *vaddr) 115 { 116 iounmap(vaddr); 117 } ··· 125 static inline struct io_mapping * 126 io_mapping_create_wc(resource_size_t base, unsigned long size) 127 { 128 - return (struct io_mapping *) ioremap_wc(base, size); 129 } 130 131 static inline void 132 io_mapping_free(struct io_mapping *mapping) 133 { 134 - iounmap(mapping); 135 } 136 137 /* Atomic map/unmap */ 138 - static inline void * 139 io_mapping_map_atomic_wc(struct io_mapping *mapping, 140 unsigned long offset, 141 int slot) 142 { 143 - return ((char *) mapping) + offset; 144 } 145 146 static inline void 147 - io_mapping_unmap_atomic(void *vaddr, int slot) 148 { 149 } 150 151 /* Non-atomic map/unmap */ 152 - static inline void * 153 io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) 154 { 155 - return ((char *) mapping) + offset; 156 } 157 158 static inline void 159 - io_mapping_unmap(void *vaddr) 160 { 161 } 162
··· 79 } 80 81 /* Atomic map/unmap */ 82 + static inline void __iomem * 83 io_mapping_map_atomic_wc(struct io_mapping *mapping, 84 unsigned long offset, 85 int slot) ··· 94 } 95 96 static inline void 97 + io_mapping_unmap_atomic(void __iomem *vaddr, int slot) 98 { 99 iounmap_atomic(vaddr, slot); 100 } 101 102 + static inline void __iomem * 103 io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) 104 { 105 resource_size_t phys_addr; ··· 111 } 112 113 static inline void 114 + io_mapping_unmap(void __iomem *vaddr) 115 { 116 iounmap(vaddr); 117 } ··· 125 static inline struct io_mapping * 126 io_mapping_create_wc(resource_size_t base, unsigned long size) 127 { 128 + return (struct io_mapping __force *) ioremap_wc(base, size); 129 } 130 131 static inline void 132 io_mapping_free(struct io_mapping *mapping) 133 { 134 + iounmap((void __force __iomem *) mapping); 135 } 136 137 /* Atomic map/unmap */ 138 + static inline void __iomem * 139 io_mapping_map_atomic_wc(struct io_mapping *mapping, 140 unsigned long offset, 141 int slot) 142 { 143 + return ((char __force __iomem *) mapping) + offset; 144 } 145 146 static inline void 147 + io_mapping_unmap_atomic(void __iomem *vaddr, int slot) 148 { 149 } 150 151 /* Non-atomic map/unmap */ 152 + static inline void __iomem * 153 io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) 154 { 155 + return ((char __force __iomem *) mapping) + offset; 156 } 157 158 static inline void 159 + io_mapping_unmap(void __iomem *vaddr) 160 { 161 } 162