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-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, apic: Fix apic=debug boot crash
x86, hotplug: Serialize CPU hotplug to avoid bringup concurrency issues
x86-32: Fix dummy trampoline-related inline stubs
x86-32: Separate 1:1 pagetables from swapper_pg_dir
x86, cpu: Fix regression in AMD errata checking code

+72 -22
+5
arch/x86/Kconfig
··· 245 245 246 246 config KTIME_SCALAR 247 247 def_bool X86_32 248 + 249 + config ARCH_CPU_PROBE_RELEASE 250 + def_bool y 251 + depends on HOTPLUG_CPU 252 + 248 253 source "init/Kconfig" 249 254 source "kernel/Kconfig.freezer" 250 255
+1
arch/x86/include/asm/pgtable_32.h
··· 26 26 struct vm_area_struct; 27 27 28 28 extern pgd_t swapper_pg_dir[1024]; 29 + extern pgd_t trampoline_pg_dir[1024]; 29 30 30 31 static inline void pgtable_cache_init(void) { } 31 32 static inline void check_pgt_cache(void) { }
+4 -1
arch/x86/include/asm/trampoline.h
··· 13 13 14 14 extern unsigned long init_rsp; 15 15 extern unsigned long initial_code; 16 + extern unsigned long initial_page_table; 16 17 extern unsigned long initial_gs; 17 18 18 19 #define TRAMPOLINE_SIZE roundup(trampoline_end - trampoline_data, PAGE_SIZE) 19 20 20 21 extern unsigned long setup_trampoline(void); 22 + extern void __init setup_trampoline_page_table(void); 21 23 extern void __init reserve_trampoline_memory(void); 22 24 #else 23 - static inline void reserve_trampoline_memory(void) {}; 25 + static inline void setup_trampoline_page_table(void) {} 26 + static inline void reserve_trampoline_memory(void) {} 24 27 #endif /* CONFIG_X86_TRAMPOLINE */ 25 28 26 29 #endif /* __ASSEMBLY__ */
+2
arch/x86/kernel/apic/io_apic.c
··· 1728 1728 struct irq_pin_list *entry; 1729 1729 1730 1730 cfg = desc->chip_data; 1731 + if (!cfg) 1732 + continue; 1731 1733 entry = cfg->irq_2_pin; 1732 1734 if (!entry) 1733 1735 continue;
+1 -1
arch/x86/kernel/cpu/amd.c
··· 669 669 } 670 670 671 671 /* OSVW unavailable or ID unknown, match family-model-stepping range */ 672 - ms = (cpu->x86_model << 8) | cpu->x86_mask; 672 + ms = (cpu->x86_model << 4) | cpu->x86_mask; 673 673 while ((range = *erratum++)) 674 674 if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) && 675 675 (ms >= AMD_MODEL_RANGE_START(range)) &&
+7 -1
arch/x86/kernel/head_32.S
··· 334 334 /* 335 335 * Enable paging 336 336 */ 337 - movl $pa(swapper_pg_dir),%eax 337 + movl pa(initial_page_table), %eax 338 338 movl %eax,%cr3 /* set the page table pointer.. */ 339 339 movl %cr0,%eax 340 340 orl $X86_CR0_PG,%eax ··· 614 614 .align 4 615 615 ENTRY(initial_code) 616 616 .long i386_start_kernel 617 + ENTRY(initial_page_table) 618 + .long pa(swapper_pg_dir) 617 619 618 620 /* 619 621 * BSS section ··· 631 629 #endif 632 630 swapper_pg_fixmap: 633 631 .fill 1024,4,0 632 + #ifdef CONFIG_X86_TRAMPOLINE 633 + ENTRY(trampoline_pg_dir) 634 + .fill 1024,4,0 635 + #endif 634 636 ENTRY(empty_zero_page) 635 637 .fill 4096,1,0 636 638
+2
arch/x86/kernel/setup.c
··· 1014 1014 paging_init(); 1015 1015 x86_init.paging.pagetable_setup_done(swapper_pg_dir); 1016 1016 1017 + setup_trampoline_page_table(); 1018 + 1017 1019 tboot_probe(); 1018 1020 1019 1021 #ifdef CONFIG_X86_64
+32 -19
arch/x86/kernel/smpboot.c
··· 73 73 74 74 #ifdef CONFIG_X86_32 75 75 u8 apicid_2_node[MAX_APICID]; 76 - static int low_mappings; 77 76 #endif 78 77 79 78 /* State of each CPU */ ··· 90 91 static DEFINE_PER_CPU(struct task_struct *, idle_thread_array); 91 92 #define get_idle_for_cpu(x) (per_cpu(idle_thread_array, x)) 92 93 #define set_idle_for_cpu(x, p) (per_cpu(idle_thread_array, x) = (p)) 94 + 95 + /* 96 + * We need this for trampoline_base protection from concurrent accesses when 97 + * off- and onlining cores wildly. 98 + */ 99 + static DEFINE_MUTEX(x86_cpu_hotplug_driver_mutex); 100 + 101 + void cpu_hotplug_driver_lock() 102 + { 103 + mutex_lock(&x86_cpu_hotplug_driver_mutex); 104 + } 105 + 106 + void cpu_hotplug_driver_unlock() 107 + { 108 + mutex_unlock(&x86_cpu_hotplug_driver_mutex); 109 + } 110 + 111 + ssize_t arch_cpu_probe(const char *buf, size_t count) { return -1; } 112 + ssize_t arch_cpu_release(const char *buf, size_t count) { return -1; } 93 113 #else 94 114 static struct task_struct *idle_thread_array[NR_CPUS] __cpuinitdata ; 95 115 #define get_idle_for_cpu(x) (idle_thread_array[(x)]) ··· 299 281 * fragile that we want to limit the things done here to the 300 282 * most necessary things. 301 283 */ 284 + 285 + #ifdef CONFIG_X86_32 286 + /* 287 + * Switch away from the trampoline page-table 288 + * 289 + * Do this before cpu_init() because it needs to access per-cpu 290 + * data which may not be mapped in the trampoline page-table. 291 + */ 292 + load_cr3(swapper_pg_dir); 293 + __flush_tlb_all(); 294 + #endif 295 + 302 296 vmi_bringup(); 303 297 cpu_init(); 304 298 preempt_disable(); ··· 328 298 enable_NMI_through_LVT0(); 329 299 legacy_pic->chip->unmask(0); 330 300 } 331 - 332 - #ifdef CONFIG_X86_32 333 - while (low_mappings) 334 - cpu_relax(); 335 - __flush_tlb_all(); 336 - #endif 337 301 338 302 /* This must be done before setting cpu_online_mask */ 339 303 set_cpu_sibling_map(raw_smp_processor_id()); ··· 774 750 #ifdef CONFIG_X86_32 775 751 /* Stack for startup_32 can be just as for start_secondary onwards */ 776 752 irq_ctx_init(cpu); 753 + initial_page_table = __pa(&trampoline_pg_dir); 777 754 #else 778 755 clear_tsk_thread_flag(c_idle.idle, TIF_FORK); 779 756 initial_gs = per_cpu_offset(cpu); ··· 922 897 923 898 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; 924 899 925 - #ifdef CONFIG_X86_32 926 - /* init low mem mapping */ 927 - clone_pgd_range(swapper_pg_dir, swapper_pg_dir + KERNEL_PGD_BOUNDARY, 928 - min_t(unsigned long, KERNEL_PGD_PTRS, KERNEL_PGD_BOUNDARY)); 929 - flush_tlb_all(); 930 - low_mappings = 1; 931 - 932 900 err = do_boot_cpu(apicid, cpu); 933 901 934 - zap_low_mappings(false); 935 - low_mappings = 0; 936 - #else 937 - err = do_boot_cpu(apicid, cpu); 938 - #endif 939 902 if (err) { 940 903 pr_debug("do_boot_cpu failed %d\n", err); 941 904 return -EIO;
+18
arch/x86/kernel/trampoline.c
··· 1 1 #include <linux/io.h> 2 2 3 3 #include <asm/trampoline.h> 4 + #include <asm/pgtable.h> 4 5 #include <asm/e820.h> 5 6 6 7 #if defined(CONFIG_X86_64) && defined(CONFIG_ACPI_SLEEP) ··· 37 36 { 38 37 memcpy(trampoline_base, trampoline_data, TRAMPOLINE_SIZE); 39 38 return virt_to_phys(trampoline_base); 39 + } 40 + 41 + void __init setup_trampoline_page_table(void) 42 + { 43 + #ifdef CONFIG_X86_32 44 + /* Copy kernel address range */ 45 + clone_pgd_range(trampoline_pg_dir + KERNEL_PGD_BOUNDARY, 46 + swapper_pg_dir + KERNEL_PGD_BOUNDARY, 47 + min_t(unsigned long, KERNEL_PGD_PTRS, 48 + KERNEL_PGD_BOUNDARY)); 49 + 50 + /* Initialize low mappings */ 51 + clone_pgd_range(trampoline_pg_dir, 52 + swapper_pg_dir + KERNEL_PGD_BOUNDARY, 53 + min_t(unsigned long, KERNEL_PGD_PTRS, 54 + KERNEL_PGD_BOUNDARY)); 55 + #endif 40 56 }