aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/smpboot.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-22 20:59:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-22 20:59:09 -0400
commitd70b3ef54ceaf1c7c92209f5a662a670d04cbed9 (patch)
tree0f38109c1cabe9e2df028041c1e30f36c803ec5b /arch/x86/kernel/smpboot.c
parent650ec5a6bd5df4ab0c9ef38d05b94cd82fb99ad8 (diff)
parent7ef3d7d58d9dc73ee3d4f8f56d0024c8cca8163f (diff)
Merge branch 'x86-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 core updates from Ingo Molnar: "There were so many changes in the x86/asm, x86/apic and x86/mm topics in this cycle that the topical separation of -tip broke down somewhat - so the result is a more traditional architecture pull request, collected into the 'x86/core' topic. The topics were still maintained separately as far as possible, so bisectability and conceptual separation should still be pretty good - but there were a handful of merge points to avoid excessive dependencies (and conflicts) that would have been poorly tested in the end. The next cycle will hopefully be much more quiet (or at least will have fewer dependencies). The main changes in this cycle were: * x86/apic changes, with related IRQ core changes: (Jiang Liu, Thomas Gleixner) - This is the second and most intrusive part of changes to the x86 interrupt handling - full conversion to hierarchical interrupt domains: [IOAPIC domain] ----- | [MSI domain] --------[Remapping domain] ----- [ Vector domain ] | (optional) | [HPET MSI domain] ----- | | [DMAR domain] ----------------------------- | [Legacy domain] ----------------------------- This now reflects the actual hardware and allowed us to distangle the domain specific code from the underlying parent domain, which can be optional in the case of interrupt remapping. It's a clear separation of functionality and removes quite some duct tape constructs which plugged the remap code between ioapic/msi/hpet and the vector management. - Intel IOMMU IRQ remapping enhancements, to allow direct interrupt injection into guests (Feng Wu) * x86/asm changes: - Tons of cleanups and small speedups, micro-optimizations. This is in preparation to move a good chunk of the low level entry code from assembly to C code (Denys Vlasenko, Andy Lutomirski, Brian Gerst) - Moved all system entry related code to a new home under arch/x86/entry/ (Ingo Molnar) - Removal of the fragile and ugly CFI dwarf debuginfo annotations. Conversion to C will reintroduce many of them - but meanwhile they are only getting in the way, and the upstream kernel does not rely on them (Ingo Molnar) - NOP handling refinements. (Borislav Petkov) * x86/mm changes: - Big PAT and MTRR rework: making the code more robust and preparing to phase out exposing direct MTRR interfaces to drivers - in favor of using PAT driven interfaces (Toshi Kani, Luis R Rodriguez, Borislav Petkov) - New ioremap_wt()/set_memory_wt() interfaces to support Write-Through cached memory mappings. This is especially important for good performance on NVDIMM hardware (Toshi Kani) * x86/ras changes: - Add support for deferred errors on AMD (Aravind Gopalakrishnan) This is an important RAS feature which adds hardware support for poisoned data. That means roughly that the hardware marks data which it has detected as corrupted but wasn't able to correct, as poisoned data and raises an APIC interrupt to signal that in the form of a deferred error. It is the OS's responsibility then to take proper recovery action and thus prolonge system lifetime as far as possible. - Add support for Intel "Local MCE"s: upcoming CPUs will support CPU-local MCE interrupts, as opposed to the traditional system- wide broadcasted MCE interrupts (Ashok Raj) - Misc cleanups (Borislav Petkov) * x86/platform changes: - Intel Atom SoC updates ... and lots of other cleanups, fixlets and other changes - see the shortlog and the Git log for details" * 'x86-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (222 commits) x86/hpet: Use proper hpet device number for MSI allocation x86/hpet: Check for irq==0 when allocating hpet MSI interrupts x86/mm/pat, drivers/infiniband/ipath: Use arch_phys_wc_add() and require PAT disabled x86/mm/pat, drivers/media/ivtv: Use arch_phys_wc_add() and require PAT disabled x86/platform/intel/baytrail: Add comments about why we disabled HPET on Baytrail genirq: Prevent crash in irq_move_irq() genirq: Enhance irq_data_to_desc() to support hierarchy irqdomain iommu, x86: Properly handle posted interrupts for IOMMU hotplug iommu, x86: Provide irq_remapping_cap() interface iommu, x86: Setup Posted-Interrupts capability for Intel iommu iommu, x86: Add cap_pi_support() to detect VT-d PI capability iommu, x86: Avoid migrating VT-d posted interrupts iommu, x86: Save the mode (posted or remapped) of an IRTE iommu, x86: Implement irq_set_vcpu_affinity for intel_ir_chip iommu: dmar: Provide helper to copy shared irte fields iommu: dmar: Extend struct irte for VT-d Posted-Interrupts iommu: Add new member capability to struct irq_remap_ops x86/asm/entry/64: Disentangle error_entry/exit gsbase/ebx/usermode code x86/asm/entry/32: Shorten __audit_syscall_entry() args preparation x86/asm/entry/32: Explain reloading of registers after __audit_syscall_entry() ...
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r--arch/x86/kernel/smpboot.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 6d4bfea25874..8add66b22f33 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -515,6 +515,40 @@ void __inquire_remote_apic(int apicid)
515} 515}
516 516
517/* 517/*
518 * The Multiprocessor Specification 1.4 (1997) example code suggests
519 * that there should be a 10ms delay between the BSP asserting INIT
520 * and de-asserting INIT, when starting a remote processor.
521 * But that slows boot and resume on modern processors, which include
522 * many cores and don't require that delay.
523 *
524 * Cmdline "init_cpu_udelay=" is available to over-ride this delay.
525 * Modern processor families are quirked to remove the delay entirely.
526 */
527#define UDELAY_10MS_DEFAULT 10000
528
529static unsigned int init_udelay = UDELAY_10MS_DEFAULT;
530
531static int __init cpu_init_udelay(char *str)
532{
533 get_option(&str, &init_udelay);
534
535 return 0;
536}
537early_param("cpu_init_udelay", cpu_init_udelay);
538
539static void __init smp_quirk_init_udelay(void)
540{
541 /* if cmdline changed it from default, leave it alone */
542 if (init_udelay != UDELAY_10MS_DEFAULT)
543 return;
544
545 /* if modern processor, use no delay */
546 if (((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 == 6)) ||
547 ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF)))
548 init_udelay = 0;
549}
550
551/*
518 * Poke the other CPU in the eye via NMI to wake it up. Remember that the normal 552 * Poke the other CPU in the eye via NMI to wake it up. Remember that the normal
519 * INIT, INIT, STARTUP sequence will reset the chip hard for us, and this 553 * INIT, INIT, STARTUP sequence will reset the chip hard for us, and this
520 * won't ... remember to clear down the APIC, etc later. 554 * won't ... remember to clear down the APIC, etc later.
@@ -556,7 +590,7 @@ wakeup_secondary_cpu_via_nmi(int apicid, unsigned long start_eip)
556static int 590static int
557wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip) 591wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
558{ 592{
559 unsigned long send_status, accept_status = 0; 593 unsigned long send_status = 0, accept_status = 0;
560 int maxlvt, num_starts, j; 594 int maxlvt, num_starts, j;
561 595
562 maxlvt = lapic_get_maxlvt(); 596 maxlvt = lapic_get_maxlvt();
@@ -584,7 +618,7 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
584 pr_debug("Waiting for send to finish...\n"); 618 pr_debug("Waiting for send to finish...\n");
585 send_status = safe_apic_wait_icr_idle(); 619 send_status = safe_apic_wait_icr_idle();
586 620
587 mdelay(10); 621 udelay(init_udelay);
588 622
589 pr_debug("Deasserting INIT\n"); 623 pr_debug("Deasserting INIT\n");
590 624
@@ -652,6 +686,7 @@ wakeup_secondary_cpu_via_init(int phys_apicid, unsigned long start_eip)
652 * Give the other CPU some time to accept the IPI. 686 * Give the other CPU some time to accept the IPI.
653 */ 687 */
654 udelay(200); 688 udelay(200);
689
655 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */ 690 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */
656 apic_write(APIC_ESR, 0); 691 apic_write(APIC_ESR, 0);
657 accept_status = (apic_read(APIC_ESR) & 0xEF); 692 accept_status = (apic_read(APIC_ESR) & 0xEF);
@@ -793,8 +828,6 @@ void common_cpu_up(unsigned int cpu, struct task_struct *idle)
793 clear_tsk_thread_flag(idle, TIF_FORK); 828 clear_tsk_thread_flag(idle, TIF_FORK);
794 initial_gs = per_cpu_offset(cpu); 829 initial_gs = per_cpu_offset(cpu);
795#endif 830#endif
796 per_cpu(kernel_stack, cpu) =
797 (unsigned long)task_stack_page(idle) + THREAD_SIZE;
798} 831}
799 832
800/* 833/*
@@ -1177,6 +1210,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1177 uv_system_init(); 1210 uv_system_init();
1178 1211
1179 set_mtrr_aps_delayed_init(); 1212 set_mtrr_aps_delayed_init();
1213
1214 smp_quirk_init_udelay();
1180} 1215}
1181 1216
1182void arch_enable_nonboot_cpus_begin(void) 1217void arch_enable_nonboot_cpus_begin(void)