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

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

Pull x86 boot updates from Ingo Molnar:
"The main x86 bootup related changes in this cycle were:

- more boot time optimizations. (Len Brown)

- implement hex output to allow the debugging of early bootup
parameters. (Kees Cook)

- remove obsolete MCA leftovers. (Paolo Pisati)"

* 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/smpboot: Remove APIC.wait_for_init_deassert and atomic init_deasserted
x86/smpboot: Remove SIPI delays from cpu_up()
x86/smpboot: Remove udelay(100) when polling cpu_callin_map
x86/smpboot: Remove udelay(100) when polling cpu_initialized_map
x86/boot: Obsolete the MCA sys_desc_table
x86/boot: Add hex output for debugging

+47 -98
+2 -1
Documentation/x86/zero-page.txt
··· 17 17 (struct ist_info) 18 18 080/010 ALL hd0_info hd0 disk parameter, OBSOLETE!! 19 19 090/010 ALL hd1_info hd1 disk parameter, OBSOLETE!! 20 - 0A0/010 ALL sys_desc_table System description table (struct sys_desc_table) 20 + 0A0/010 ALL sys_desc_table System description table (struct sys_desc_table), 21 + OBSOLETE!! 21 22 0B0/010 ALL olpc_ofw_header OLPC's OpenFirmware CIF and friends 22 23 0C0/004 ALL ext_ramdisk_image ramdisk_image high 32bits 23 24 0C4/004 ALL ext_ramdisk_size ramdisk_size high 32bits
+1 -1
arch/x86/boot/Makefile
··· 23 23 subdir- := compressed 24 24 25 25 setup-y += a20.o bioscall.o cmdline.o copy.o cpu.o cpuflags.o cpucheck.o 26 - setup-y += early_serial_console.o edd.o header.o main.o mca.o memory.o 26 + setup-y += early_serial_console.o edd.o header.o main.o memory.o 27 27 setup-y += pm.o pmjump.o printf.o regs.o string.o tty.o video.o 28 28 setup-y += video-mode.o version.o 29 29 setup-$(CONFIG_X86_APM_BOOT) += apm.o
-3
arch/x86/boot/boot.h
··· 307 307 /* header.S */ 308 308 void __attribute__((noreturn)) die(void); 309 309 310 - /* mca.c */ 311 - int query_mca(void); 312 - 313 310 /* memory.c */ 314 311 int detect_memory(void); 315 312
-4
arch/x86/boot/compressed/eboot.c
··· 1041 1041 struct boot_params *make_boot_params(struct efi_config *c) 1042 1042 { 1043 1043 struct boot_params *boot_params; 1044 - struct sys_desc_table *sdt; 1045 1044 struct apm_bios_info *bi; 1046 1045 struct setup_header *hdr; 1047 1046 struct efi_info *efi; ··· 1088 1089 hdr = &boot_params->hdr; 1089 1090 efi = &boot_params->efi_info; 1090 1091 bi = &boot_params->apm_bios_info; 1091 - sdt = &boot_params->sys_desc_table; 1092 1092 1093 1093 /* Copy the second sector to boot_params */ 1094 1094 memcpy(&hdr->jump, image->image_base + 512, 512); ··· 1115 1117 1116 1118 /* Clear APM BIOS info */ 1117 1119 memset(bi, 0, sizeof(*bi)); 1118 - 1119 - memset(sdt, 0, sizeof(*sdt)); 1120 1120 1121 1121 status = efi_parse_options(cmdline_ptr); 1122 1122 if (status != EFI_SUCCESS)
+24
arch/x86/boot/compressed/misc.c
··· 220 220 outb(0xff & (pos >> 1), vidport+1); 221 221 } 222 222 223 + void __puthex(unsigned long value) 224 + { 225 + char alpha[2] = "0"; 226 + int bits; 227 + 228 + for (bits = sizeof(value) * 8 - 4; bits >= 0; bits -= 4) { 229 + unsigned long digit = (value >> bits) & 0xf; 230 + 231 + if (digit < 0xA) 232 + alpha[0] = '0' + digit; 233 + else 234 + alpha[0] = 'a' + (digit - 0xA); 235 + 236 + __putstr(alpha); 237 + } 238 + } 239 + 223 240 static void error(char *x) 224 241 { 225 242 error_putstr("\n\n"); ··· 415 398 416 399 free_mem_ptr = heap; /* Heap */ 417 400 free_mem_end_ptr = heap + BOOT_HEAP_SIZE; 401 + 402 + /* Report initial kernel position details. */ 403 + debug_putaddr(input_data); 404 + debug_putaddr(input_len); 405 + debug_putaddr(output); 406 + debug_putaddr(output_len); 407 + debug_putaddr(run_size); 418 408 419 409 /* 420 410 * The memory hole needed for the kernel is the larger of either
+11
arch/x86/boot/compressed/misc.h
··· 34 34 extern memptr free_mem_end_ptr; 35 35 extern struct boot_params *real_mode; /* Pointer to real-mode data */ 36 36 void __putstr(const char *s); 37 + void __puthex(unsigned long value); 37 38 #define error_putstr(__x) __putstr(__x) 39 + #define error_puthex(__x) __puthex(__x) 38 40 39 41 #ifdef CONFIG_X86_VERBOSE_BOOTUP 40 42 41 43 #define debug_putstr(__x) __putstr(__x) 44 + #define debug_puthex(__x) __puthex(__x) 45 + #define debug_putaddr(__x) { \ 46 + debug_putstr(#__x ": 0x"); \ 47 + debug_puthex((unsigned long)(__x)); \ 48 + debug_putstr("\n"); \ 49 + } 42 50 43 51 #else 44 52 45 53 static inline void debug_putstr(const char *s) 46 54 { } 55 + static inline void debug_puthex(const char *s) 56 + { } 57 + #define debug_putaddr(x) /* */ 47 58 48 59 #endif 49 60
-3
arch/x86/boot/main.c
··· 161 161 /* Set keyboard repeat rate (why?) and query the lock flags */ 162 162 keyboard_init(); 163 163 164 - /* Query MCA information */ 165 - query_mca(); 166 - 167 164 /* Query Intel SpeedStep (IST) information */ 168 165 query_ist(); 169 166
-38
arch/x86/boot/mca.c
··· 1 - /* -*- linux-c -*- ------------------------------------------------------- * 2 - * 3 - * Copyright (C) 1991, 1992 Linus Torvalds 4 - * Copyright 2007 rPath, Inc. - All Rights Reserved 5 - * Copyright 2009 Intel Corporation; author H. Peter Anvin 6 - * 7 - * This file is part of the Linux kernel, and is made available under 8 - * the terms of the GNU General Public License version 2. 9 - * 10 - * ----------------------------------------------------------------------- */ 11 - 12 - /* 13 - * Get the MCA system description table 14 - */ 15 - 16 - #include "boot.h" 17 - 18 - int query_mca(void) 19 - { 20 - struct biosregs ireg, oreg; 21 - u16 len; 22 - 23 - initregs(&ireg); 24 - ireg.ah = 0xc0; 25 - intcall(0x15, &ireg, &oreg); 26 - 27 - if (oreg.eflags & X86_EFLAGS_CF) 28 - return -1; /* No MCA present */ 29 - 30 - set_fs(oreg.es); 31 - len = rdfs16(oreg.bx); 32 - 33 - if (len > sizeof(boot_params.sys_desc_table)) 34 - len = sizeof(boot_params.sys_desc_table); 35 - 36 - copy_from_fs(&boot_params.sys_desc_table, oreg.bx, len); 37 - return 0; 38 - }
-2
arch/x86/include/asm/apic.h
··· 313 313 /* wakeup_secondary_cpu */ 314 314 int (*wakeup_secondary_cpu)(int apicid, unsigned long start_eip); 315 315 316 - bool wait_for_init_deassert; 317 316 void (*inquire_remote_apic)(int apicid); 318 317 319 318 /* apic ops */ ··· 377 378 * APIC functionality to boot other CPUs - only used on SMP: 378 379 */ 379 380 #ifdef CONFIG_SMP 380 - extern atomic_t init_deasserted; 381 381 extern int wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip); 382 382 #endif 383 383
-8
arch/x86/include/asm/processor.h
··· 645 645 646 646 extern void set_task_blockstep(struct task_struct *task, bool on); 647 647 648 - /* 649 - * from system description table in BIOS. Mostly for MCA use, but 650 - * others may find it useful: 651 - */ 652 - extern unsigned int machine_id; 653 - extern unsigned int machine_submodel_id; 654 - extern unsigned int BIOS_revision; 655 - 656 648 /* Boot loader type from the setup header: */ 657 649 extern int bootloader_type; 658 650 extern int bootloader_version;
+1 -1
arch/x86/include/uapi/asm/bootparam.h
··· 120 120 __u8 _pad3[16]; /* 0x070 */ 121 121 __u8 hd0_info[16]; /* obsolete! */ /* 0x080 */ 122 122 __u8 hd1_info[16]; /* obsolete! */ /* 0x090 */ 123 - struct sys_desc_table sys_desc_table; /* 0x0a0 */ 123 + struct sys_desc_table sys_desc_table; /* obsolete! */ /* 0x0a0 */ 124 124 struct olpc_ofw_header olpc_ofw_header; /* 0x0b0 */ 125 125 __u32 ext_ramdisk_image; /* 0x0c0 */ 126 126 __u32 ext_ramdisk_size; /* 0x0c4 */
-2
arch/x86/kernel/apic/apic_flat_64.c
··· 191 191 .send_IPI_all = flat_send_IPI_all, 192 192 .send_IPI_self = apic_send_IPI_self, 193 193 194 - .wait_for_init_deassert = false, 195 194 .inquire_remote_apic = default_inquire_remote_apic, 196 195 197 196 .read = native_apic_mem_read, ··· 298 299 .send_IPI_all = physflat_send_IPI_all, 299 300 .send_IPI_self = apic_send_IPI_self, 300 301 301 - .wait_for_init_deassert = false, 302 302 .inquire_remote_apic = default_inquire_remote_apic, 303 303 304 304 .read = native_apic_mem_read,
-1
arch/x86/kernel/apic/apic_noop.c
··· 152 152 153 153 .wakeup_secondary_cpu = noop_wakeup_secondary_cpu, 154 154 155 - .wait_for_init_deassert = false, 156 155 .inquire_remote_apic = NULL, 157 156 158 157 .read = noop_apic_read,
-2
arch/x86/kernel/apic/apic_numachip.c
··· 92 92 93 93 write_lcsr(CSR_G3_EXT_IRQ_GEN, int_gen.v); 94 94 95 - atomic_set(&init_deasserted, 1); 96 95 return 0; 97 96 } 98 97 ··· 234 235 .send_IPI_self = numachip_send_IPI_self, 235 236 236 237 .wakeup_secondary_cpu = numachip_wakeup_secondary, 237 - .wait_for_init_deassert = false, 238 238 .inquire_remote_apic = NULL, /* REMRD not supported */ 239 239 240 240 .read = native_apic_mem_read,
-1
arch/x86/kernel/apic/bigsmp_32.c
··· 186 186 .send_IPI_all = bigsmp_send_IPI_all, 187 187 .send_IPI_self = default_send_IPI_self, 188 188 189 - .wait_for_init_deassert = true, 190 189 .inquire_remote_apic = default_inquire_remote_apic, 191 190 192 191 .read = native_apic_mem_read,
-1
arch/x86/kernel/apic/probe_32.c
··· 111 111 .send_IPI_all = default_send_IPI_all, 112 112 .send_IPI_self = default_send_IPI_self, 113 113 114 - .wait_for_init_deassert = true, 115 114 .inquire_remote_apic = default_inquire_remote_apic, 116 115 117 116 .read = native_apic_mem_read,
-1
arch/x86/kernel/apic/x2apic_cluster.c
··· 272 272 .send_IPI_all = x2apic_send_IPI_all, 273 273 .send_IPI_self = x2apic_send_IPI_self, 274 274 275 - .wait_for_init_deassert = false, 276 275 .inquire_remote_apic = NULL, 277 276 278 277 .read = native_apic_msr_read,
-1
arch/x86/kernel/apic/x2apic_phys.c
··· 128 128 .send_IPI_all = x2apic_send_IPI_all, 129 129 .send_IPI_self = x2apic_send_IPI_self, 130 130 131 - .wait_for_init_deassert = false, 132 131 .inquire_remote_apic = NULL, 133 132 134 133 .read = native_apic_msr_read,
-2
arch/x86/kernel/apic/x2apic_uv_x.c
··· 248 248 APIC_DM_STARTUP; 249 249 uv_write_global_mmr64(pnode, UVH_IPI_INT, val); 250 250 251 - atomic_set(&init_deasserted, 1); 252 251 return 0; 253 252 } 254 253 ··· 413 414 .send_IPI_self = uv_send_IPI_self, 414 415 415 416 .wakeup_secondary_cpu = uv_wakeup_secondary, 416 - .wait_for_init_deassert = false, 417 417 .inquire_remote_apic = NULL, 418 418 419 419 .read = native_apic_msr_read,
-3
arch/x86/kernel/kexec-bzimage64.c
··· 223 223 memset(&params->hd0_info, 0, sizeof(params->hd0_info)); 224 224 memset(&params->hd1_info, 0, sizeof(params->hd1_info)); 225 225 226 - /* Default sysdesc table */ 227 - params->sys_desc_table.length = 0; 228 - 229 226 if (image->type == KEXEC_TYPE_CRASH) { 230 227 ret = crash_setup_memmap_entries(image, params); 231 228 if (ret)
-5
arch/x86/kernel/setup.c
··· 916 916 #ifdef CONFIG_X86_32 917 917 apm_info.bios = boot_params.apm_bios_info; 918 918 ist_info = boot_params.ist_info; 919 - if (boot_params.sys_desc_table.length != 0) { 920 - machine_id = boot_params.sys_desc_table.table[0]; 921 - machine_submodel_id = boot_params.sys_desc_table.table[1]; 922 - BIOS_revision = boot_params.sys_desc_table.table[2]; 923 - } 924 919 #endif 925 920 saved_video_mode = boot_params.hdr.vid_mode; 926 921 bootloader_type = boot_params.hdr.type_of_loader;
+8 -18
arch/x86/kernel/smpboot.c
··· 97 97 DEFINE_PER_CPU_READ_MOSTLY(struct cpuinfo_x86, cpu_info); 98 98 EXPORT_PER_CPU_SYMBOL(cpu_info); 99 99 100 - atomic_t init_deasserted; 101 - 102 100 static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) 103 101 { 104 102 unsigned long flags; ··· 144 146 145 147 /* 146 148 * If waken up by an INIT in an 82489DX configuration 147 - * we may get here before an INIT-deassert IPI reaches 148 - * our local APIC. We have to wait for the IPI or we'll 149 - * lock up on an APIC access. 150 - * 151 - * Since CPU0 is not wakened up by INIT, it doesn't wait for the IPI. 149 + * cpu_callout_mask guarantees we don't get here before 150 + * an INIT_deassert IPI reaches our local APIC, so it is 151 + * now safe to touch our local APIC. 152 152 */ 153 153 cpuid = smp_processor_id(); 154 - if (apic->wait_for_init_deassert && cpuid) 155 - while (!atomic_read(&init_deasserted)) 156 - cpu_relax(); 157 154 158 155 /* 159 156 * (This works even if the APIC is not enabled.) ··· 613 620 send_status = safe_apic_wait_icr_idle(); 614 621 615 622 mb(); 616 - atomic_set(&init_deasserted, 1); 617 623 618 624 /* 619 625 * Should we send STARTUP IPIs ? ··· 657 665 /* 658 666 * Give the other CPU some time to accept the IPI. 659 667 */ 660 - udelay(300); 668 + if (init_udelay) 669 + udelay(300); 661 670 662 671 pr_debug("Startup point 1\n"); 663 672 ··· 668 675 /* 669 676 * Give the other CPU some time to accept the IPI. 670 677 */ 671 - udelay(200); 678 + if (init_udelay) 679 + udelay(200); 672 680 673 681 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ 674 682 apic_write(APIC_ESR, 0); ··· 853 859 * the targeted processor. 854 860 */ 855 861 856 - atomic_set(&init_deasserted, 0); 857 - 858 862 if (get_uv_system_type() != UV_NON_UNIQUE_APIC) { 859 863 860 864 pr_debug("Setting warm reset code and vector.\n"); ··· 890 898 891 899 if (!boot_error) { 892 900 /* 893 - * Wait 10s total for a response from AP 901 + * Wait 10s total for first sign of life from AP 894 902 */ 895 903 boot_error = -1; 896 904 timeout = jiffies + 10*HZ; ··· 903 911 boot_error = 0; 904 912 break; 905 913 } 906 - udelay(100); 907 914 schedule(); 908 915 } 909 916 } ··· 918 927 * for the MTRR work(triggered by the AP coming online) 919 928 * to be completed in the stop machine context. 920 929 */ 921 - udelay(100); 922 930 schedule(); 923 931 } 924 932 }