Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull x86 fixes from Ingo Molnar.

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/nmi: Fix section mismatch warnings on 32-bit
x86/uv: Fix UV2 BAU legacy mode
x86/mm: Only add extra pages count for the first memory range during pre-allocation early page table space
x86, efi stub: Add .reloc section back into image
x86/ioapic: Fix NULL pointer dereference on CPU hotplug after disabling irqs
x86/reboot: Fix a warning message triggered by stop_other_cpus()
x86/intel/moorestown: Change intel_scu_devices_create() to __devinit
x86/numa: Set numa_nodes_parsed at acpi_numa_memory_affinity_init()
x86/gart: Fix kmemleak warning
x86: mce: Add the dropped timer interval init back
x86/mce: Fix the MCE poll timer logic

+168 -91
+31 -11
arch/x86/boot/header.S
··· 94 94 95 95 .section ".bsdata", "a" 96 96 bugger_off_msg: 97 - .ascii "Direct booting from floppy is no longer supported.\r\n" 98 - .ascii "Please use a boot loader program instead.\r\n" 97 + .ascii "Direct floppy boot is not supported. " 98 + .ascii "Use a boot loader program instead.\r\n" 99 99 .ascii "\n" 100 - .ascii "Remove disk and press any key to reboot . . .\r\n" 100 + .ascii "Remove disk and press any key to reboot ...\r\n" 101 101 .byte 0 102 102 103 103 #ifdef CONFIG_EFI_STUB ··· 111 111 #else 112 112 .word 0x8664 # x86-64 113 113 #endif 114 - .word 2 # nr_sections 114 + .word 3 # nr_sections 115 115 .long 0 # TimeDateStamp 116 116 .long 0 # PointerToSymbolTable 117 117 .long 1 # NumberOfSymbols ··· 158 158 #else 159 159 .quad 0 # ImageBase 160 160 #endif 161 - .long 0x1000 # SectionAlignment 162 - .long 0x200 # FileAlignment 161 + .long 0x20 # SectionAlignment 162 + .long 0x20 # FileAlignment 163 163 .word 0 # MajorOperatingSystemVersion 164 164 .word 0 # MinorOperatingSystemVersion 165 165 .word 0 # MajorImageVersion ··· 200 200 201 201 # Section table 202 202 section_table: 203 - .ascii ".text" 204 - .byte 0 203 + # 204 + # The offset & size fields are filled in by build.c. 205 + # 206 + .ascii ".setup" 205 207 .byte 0 206 208 .byte 0 207 209 .long 0 ··· 219 217 220 218 # 221 219 # The EFI application loader requires a relocation section 222 - # because EFI applications must be relocatable. But since 223 - # we don't need the loader to fixup any relocs for us, we 224 - # just create an empty (zero-length) .reloc section header. 220 + # because EFI applications must be relocatable. The .reloc 221 + # offset & size fields are filled in by build.c. 225 222 # 226 223 .ascii ".reloc" 227 224 .byte 0 ··· 234 233 .word 0 # NumberOfRelocations 235 234 .word 0 # NumberOfLineNumbers 236 235 .long 0x42100040 # Characteristics (section flags) 236 + 237 + # 238 + # The offset & size fields are filled in by build.c. 239 + # 240 + .ascii ".text" 241 + .byte 0 242 + .byte 0 243 + .byte 0 244 + .long 0 245 + .long 0x0 # startup_{32,64} 246 + .long 0 # Size of initialized data 247 + # on disk 248 + .long 0x0 # startup_{32,64} 249 + .long 0 # PointerToRelocations 250 + .long 0 # PointerToLineNumbers 251 + .word 0 # NumberOfRelocations 252 + .word 0 # NumberOfLineNumbers 253 + .long 0x60500020 # Characteristics (section flags) 254 + 237 255 #endif /* CONFIG_EFI_STUB */ 238 256 239 257 # Kernel attributes; used by setup. This is part 1 of the
+109 -63
arch/x86/boot/tools/build.c
··· 50 50 u8 buf[SETUP_SECT_MAX*512]; 51 51 int is_big_kernel; 52 52 53 + #define PECOFF_RELOC_RESERVE 0x20 54 + 53 55 /*----------------------------------------------------------------------*/ 54 56 55 57 static const u32 crctab32[] = { ··· 135 133 die("Usage: build setup system [> image]"); 136 134 } 137 135 136 + #ifdef CONFIG_EFI_STUB 137 + 138 + static void update_pecoff_section_header(char *section_name, u32 offset, u32 size) 139 + { 140 + unsigned int pe_header; 141 + unsigned short num_sections; 142 + u8 *section; 143 + 144 + pe_header = get_unaligned_le32(&buf[0x3c]); 145 + num_sections = get_unaligned_le16(&buf[pe_header + 6]); 146 + 147 + #ifdef CONFIG_X86_32 148 + section = &buf[pe_header + 0xa8]; 149 + #else 150 + section = &buf[pe_header + 0xb8]; 151 + #endif 152 + 153 + while (num_sections > 0) { 154 + if (strncmp((char*)section, section_name, 8) == 0) { 155 + /* section header size field */ 156 + put_unaligned_le32(size, section + 0x8); 157 + 158 + /* section header vma field */ 159 + put_unaligned_le32(offset, section + 0xc); 160 + 161 + /* section header 'size of initialised data' field */ 162 + put_unaligned_le32(size, section + 0x10); 163 + 164 + /* section header 'file offset' field */ 165 + put_unaligned_le32(offset, section + 0x14); 166 + 167 + break; 168 + } 169 + section += 0x28; 170 + num_sections--; 171 + } 172 + } 173 + 174 + static void update_pecoff_setup_and_reloc(unsigned int size) 175 + { 176 + u32 setup_offset = 0x200; 177 + u32 reloc_offset = size - PECOFF_RELOC_RESERVE; 178 + u32 setup_size = reloc_offset - setup_offset; 179 + 180 + update_pecoff_section_header(".setup", setup_offset, setup_size); 181 + update_pecoff_section_header(".reloc", reloc_offset, PECOFF_RELOC_RESERVE); 182 + 183 + /* 184 + * Modify .reloc section contents with a single entry. The 185 + * relocation is applied to offset 10 of the relocation section. 186 + */ 187 + put_unaligned_le32(reloc_offset + 10, &buf[reloc_offset]); 188 + put_unaligned_le32(10, &buf[reloc_offset + 4]); 189 + } 190 + 191 + static void update_pecoff_text(unsigned int text_start, unsigned int file_sz) 192 + { 193 + unsigned int pe_header; 194 + unsigned int text_sz = file_sz - text_start; 195 + 196 + pe_header = get_unaligned_le32(&buf[0x3c]); 197 + 198 + /* Size of image */ 199 + put_unaligned_le32(file_sz, &buf[pe_header + 0x50]); 200 + 201 + /* 202 + * Size of code: Subtract the size of the first sector (512 bytes) 203 + * which includes the header. 204 + */ 205 + put_unaligned_le32(file_sz - 512, &buf[pe_header + 0x1c]); 206 + 207 + #ifdef CONFIG_X86_32 208 + /* 209 + * Address of entry point. 210 + * 211 + * The EFI stub entry point is +16 bytes from the start of 212 + * the .text section. 213 + */ 214 + put_unaligned_le32(text_start + 16, &buf[pe_header + 0x28]); 215 + #else 216 + /* 217 + * Address of entry point. startup_32 is at the beginning and 218 + * the 64-bit entry point (startup_64) is always 512 bytes 219 + * after. The EFI stub entry point is 16 bytes after that, as 220 + * the first instruction allows legacy loaders to jump over 221 + * the EFI stub initialisation 222 + */ 223 + put_unaligned_le32(text_start + 528, &buf[pe_header + 0x28]); 224 + #endif /* CONFIG_X86_32 */ 225 + 226 + update_pecoff_section_header(".text", text_start, text_sz); 227 + } 228 + 229 + #endif /* CONFIG_EFI_STUB */ 230 + 138 231 int main(int argc, char ** argv) 139 232 { 140 - #ifdef CONFIG_EFI_STUB 141 - unsigned int file_sz, pe_header; 142 - #endif 143 233 unsigned int i, sz, setup_sectors; 144 234 int c; 145 235 u32 sys_size; ··· 257 163 die("Boot block hasn't got boot flag (0xAA55)"); 258 164 fclose(file); 259 165 166 + #ifdef CONFIG_EFI_STUB 167 + /* Reserve 0x20 bytes for .reloc section */ 168 + memset(buf+c, 0, PECOFF_RELOC_RESERVE); 169 + c += PECOFF_RELOC_RESERVE; 170 + #endif 171 + 260 172 /* Pad unused space with zeros */ 261 173 setup_sectors = (c + 511) / 512; 262 174 if (setup_sectors < SETUP_SECT_MIN) 263 175 setup_sectors = SETUP_SECT_MIN; 264 176 i = setup_sectors*512; 265 177 memset(buf+c, 0, i-c); 178 + 179 + #ifdef CONFIG_EFI_STUB 180 + update_pecoff_setup_and_reloc(i); 181 + #endif 266 182 267 183 /* Set the default root device */ 268 184 put_unaligned_le16(DEFAULT_ROOT_DEV, &buf[508]); ··· 298 194 put_unaligned_le32(sys_size, &buf[0x1f4]); 299 195 300 196 #ifdef CONFIG_EFI_STUB 301 - file_sz = sz + i + ((sys_size * 16) - sz); 302 - 303 - pe_header = get_unaligned_le32(&buf[0x3c]); 304 - 305 - /* Size of image */ 306 - put_unaligned_le32(file_sz, &buf[pe_header + 0x50]); 307 - 308 - /* 309 - * Subtract the size of the first section (512 bytes) which 310 - * includes the header and .reloc section. The remaining size 311 - * is that of the .text section. 312 - */ 313 - file_sz -= 512; 314 - 315 - /* Size of code */ 316 - put_unaligned_le32(file_sz, &buf[pe_header + 0x1c]); 317 - 318 - #ifdef CONFIG_X86_32 319 - /* 320 - * Address of entry point. 321 - * 322 - * The EFI stub entry point is +16 bytes from the start of 323 - * the .text section. 324 - */ 325 - put_unaligned_le32(i + 16, &buf[pe_header + 0x28]); 326 - 327 - /* .text size */ 328 - put_unaligned_le32(file_sz, &buf[pe_header + 0xb0]); 329 - 330 - /* .text vma */ 331 - put_unaligned_le32(0x200, &buf[pe_header + 0xb4]); 332 - 333 - /* .text size of initialised data */ 334 - put_unaligned_le32(file_sz, &buf[pe_header + 0xb8]); 335 - 336 - /* .text file offset */ 337 - put_unaligned_le32(0x200, &buf[pe_header + 0xbc]); 338 - #else 339 - /* 340 - * Address of entry point. startup_32 is at the beginning and 341 - * the 64-bit entry point (startup_64) is always 512 bytes 342 - * after. The EFI stub entry point is 16 bytes after that, as 343 - * the first instruction allows legacy loaders to jump over 344 - * the EFI stub initialisation 345 - */ 346 - put_unaligned_le32(i + 528, &buf[pe_header + 0x28]); 347 - 348 - /* .text size */ 349 - put_unaligned_le32(file_sz, &buf[pe_header + 0xc0]); 350 - 351 - /* .text vma */ 352 - put_unaligned_le32(0x200, &buf[pe_header + 0xc4]); 353 - 354 - /* .text size of initialised data */ 355 - put_unaligned_le32(file_sz, &buf[pe_header + 0xc8]); 356 - 357 - /* .text file offset */ 358 - put_unaligned_le32(0x200, &buf[pe_header + 0xcc]); 359 - #endif /* CONFIG_X86_32 */ 360 - #endif /* CONFIG_EFI_STUB */ 197 + update_pecoff_text(setup_sectors * 512, sz + i + ((sys_size * 16) - sz)); 198 + #endif 361 199 362 200 crc = partial_crc32(buf, i, crc); 363 201 if (fwrite(buf, 1, i, stdout) != i)
+14
arch/x86/include/asm/nmi.h
··· 54 54 __register_nmi_handler((t), &fn##_na); \ 55 55 }) 56 56 57 + /* 58 + * For special handlers that register/unregister in the 59 + * init section only. This should be considered rare. 60 + */ 61 + #define register_nmi_handler_initonly(t, fn, fg, n) \ 62 + ({ \ 63 + static struct nmiaction fn##_na __initdata = { \ 64 + .handler = (fn), \ 65 + .name = (n), \ 66 + .flags = (fg), \ 67 + }; \ 68 + __register_nmi_handler((t), &fn##_na); \ 69 + }) 70 + 57 71 int __register_nmi_handler(unsigned int, struct nmiaction *); 58 72 59 73 void unregister_nmi_handler(unsigned int, const char *);
-1
arch/x86/include/asm/uv/uv_bau.h
··· 149 149 /* 4 bits of software ack period */ 150 150 #define UV2_ACK_MASK 0x7UL 151 151 #define UV2_ACK_UNITS_SHFT 3 152 - #define UV2_LEG_SHFT UV2H_LB_BAU_MISC_CONTROL_USE_LEGACY_DESCRIPTOR_FORMATS_SHFT 153 152 #define UV2_EXT_SHFT UV2H_LB_BAU_MISC_CONTROL_ENABLE_EXTENDED_SB_STATUS_SHFT 154 153 155 154 /*
-6
arch/x86/kernel/aperture_64.c
··· 20 20 #include <linux/bitops.h> 21 21 #include <linux/ioport.h> 22 22 #include <linux/suspend.h> 23 - #include <linux/kmemleak.h> 24 23 #include <asm/e820.h> 25 24 #include <asm/io.h> 26 25 #include <asm/iommu.h> ··· 94 95 return 0; 95 96 } 96 97 memblock_reserve(addr, aper_size); 97 - /* 98 - * Kmemleak should not scan this block as it may not be mapped via the 99 - * kernel direct mapping. 100 - */ 101 - kmemleak_ignore(phys_to_virt(addr)); 102 98 printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n", 103 99 aper_size >> 10, addr); 104 100 insert_aperture_resource((u32)addr, aper_size);
+2 -2
arch/x86/kernel/apic/io_apic.c
··· 1195 1195 BUG_ON(!cfg->vector); 1196 1196 1197 1197 vector = cfg->vector; 1198 - for_each_cpu_and(cpu, cfg->domain, cpu_online_mask) 1198 + for_each_cpu(cpu, cfg->domain) 1199 1199 per_cpu(vector_irq, cpu)[vector] = -1; 1200 1200 1201 1201 cfg->vector = 0; ··· 1203 1203 1204 1204 if (likely(!cfg->move_in_progress)) 1205 1205 return; 1206 - for_each_cpu_and(cpu, cfg->old_domain, cpu_online_mask) { 1206 + for_each_cpu(cpu, cfg->old_domain) { 1207 1207 for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; 1208 1208 vector++) { 1209 1209 if (per_cpu(vector_irq, cpu)[vector] != irq)
+1 -1
arch/x86/kernel/cpu/mcheck/mce.c
··· 1557 1557 static void __mcheck_cpu_init_timer(void) 1558 1558 { 1559 1559 struct timer_list *t = &__get_cpu_var(mce_timer); 1560 - unsigned long iv = __this_cpu_read(mce_next_interval); 1560 + unsigned long iv = check_interval * HZ; 1561 1561 1562 1562 setup_timer(t, mce_timer_fn, smp_processor_id()); 1563 1563
+2 -2
arch/x86/kernel/nmi_selftest.c
··· 42 42 static void __init init_nmi_testsuite(void) 43 43 { 44 44 /* trap all the unknown NMIs we may generate */ 45 - register_nmi_handler(NMI_UNKNOWN, nmi_unk_cb, 0, "nmi_selftest_unk"); 45 + register_nmi_handler_initonly(NMI_UNKNOWN, nmi_unk_cb, 0, "nmi_selftest_unk"); 46 46 } 47 47 48 48 static void __init cleanup_nmi_testsuite(void) ··· 64 64 { 65 65 unsigned long timeout; 66 66 67 - if (register_nmi_handler(NMI_LOCAL, test_nmi_ipi_callback, 67 + if (register_nmi_handler_initonly(NMI_LOCAL, test_nmi_ipi_callback, 68 68 NMI_FLAG_FIRST, "nmi_selftest")) { 69 69 nmi_fail = FAILURE; 70 70 return;
+4 -2
arch/x86/kernel/reboot.c
··· 639 639 set_cpus_allowed_ptr(current, cpumask_of(reboot_cpu_id)); 640 640 641 641 /* 642 - * O.K Now that I'm on the appropriate processor, 643 - * stop all of the others. 642 + * O.K Now that I'm on the appropriate processor, stop all of the 643 + * others. Also disable the local irq to not receive the per-cpu 644 + * timer interrupt which may trigger scheduler's load balance. 644 645 */ 646 + local_irq_disable(); 645 647 stop_other_cpus(); 646 648 #endif 647 649
+2 -1
arch/x86/mm/init.c
··· 62 62 extra += PMD_SIZE; 63 63 #endif 64 64 /* The first 2/4M doesn't use large pages. */ 65 - extra += mr->end - mr->start; 65 + if (mr->start < PMD_SIZE) 66 + extra += mr->end - mr->start; 66 67 67 68 ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT; 68 69 } else
+2
arch/x86/mm/srat.c
··· 176 176 return; 177 177 } 178 178 179 + node_set(node, numa_nodes_parsed); 180 + 179 181 printk(KERN_INFO "SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]\n", 180 182 node, pxm, 181 183 (unsigned long long) start, (unsigned long long) end - 1);
+1 -1
arch/x86/platform/mrst/mrst.c
··· 782 782 EXPORT_SYMBOL_GPL(intel_scu_notifier); 783 783 784 784 /* Called by IPC driver */ 785 - void intel_scu_devices_create(void) 785 + void __devinit intel_scu_devices_create(void) 786 786 { 787 787 int i; 788 788
-1
arch/x86/platform/uv/tlb_uv.c
··· 1295 1295 */ 1296 1296 mmr_image |= (1L << SOFTACK_MSHIFT); 1297 1297 if (is_uv2_hub()) { 1298 - mmr_image &= ~(1L << UV2_LEG_SHFT); 1299 1298 mmr_image |= (1L << UV2_EXT_SHFT); 1300 1299 } 1301 1300 write_mmr_misc_control(pnode, mmr_image);