Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef0eaa13 authored by Steve French's avatar Steve French
Browse files

Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git

parents 53b2ec55 df70b17f
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -1042,8 +1042,3 @@ config X86_TRAMPOLINE
	bool
	bool
	depends on X86_SMP || (X86_VOYAGER && SMP)
	depends on X86_SMP || (X86_VOYAGER && SMP)
	default y
	default y

config PC
	bool
	depends on X86 && !EMBEDDED
	default y
+16 −61
Original line number Original line Diff line number Diff line
@@ -803,7 +803,6 @@ no_apic:


void __init init_apic_mappings(void)
void __init init_apic_mappings(void)
{
{
	unsigned int orig_apicid;
	unsigned long apic_phys;
	unsigned long apic_phys;


	/*
	/*
@@ -825,11 +824,8 @@ void __init init_apic_mappings(void)
	 * Fetch the APIC ID of the BSP in case we have a
	 * Fetch the APIC ID of the BSP in case we have a
	 * default configuration (or the MP table is broken).
	 * default configuration (or the MP table is broken).
	 */
	 */
	orig_apicid = boot_cpu_physical_apicid;
	if (boot_cpu_physical_apicid == -1U)
		boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
		boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
	if ((orig_apicid != -1U) && (orig_apicid != boot_cpu_physical_apicid))
		printk(KERN_WARNING "Boot APIC ID in local APIC unexpected (%d vs %d)",
			orig_apicid, boot_cpu_physical_apicid);


#ifdef CONFIG_X86_IO_APIC
#ifdef CONFIG_X86_IO_APIC
	{
	{
@@ -1259,81 +1255,40 @@ fastcall void smp_error_interrupt(struct pt_regs *regs)
}
}


/*
/*
 * This initializes the IO-APIC and APIC hardware.
 * This initializes the IO-APIC and APIC hardware if this is
 * a UP kernel.
 */
 */
int __init APIC_init(void)
int __init APIC_init_uniprocessor (void)
{
{
	if (enable_local_apic < 0) {
	if (enable_local_apic < 0)
		printk(KERN_INFO "APIC disabled\n");
		clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
		return -1;
	}


	/* See if we have a SMP configuration or have forced enabled
	if (!smp_found_config && !cpu_has_apic)
	 * the local apic.
	 */
	if (!smp_found_config && !acpi_lapic && !cpu_has_apic) {
		enable_local_apic = -1;
		return -1;
		return -1;
	}


	/*
	/*
	 * Complain if the BIOS pretends there is an apic.
	 * Complain if the BIOS pretends there is one.
	 * Then get out because we don't have an a local apic.
	 */
	 */
	if (!cpu_has_apic && APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) {
	if (!cpu_has_apic && APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) {
		printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
		printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
			boot_cpu_physical_apicid);
			boot_cpu_physical_apicid);
		printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
		enable_local_apic = -1;
		return -1;
		return -1;
	}
	}


	verify_local_APIC();
	verify_local_APIC();


	/*
	 * Should not be necessary because the MP table should list the boot
	 * CPU too, but we do it for the sake of robustness anyway.
	 * Makes no sense to do this check in clustered apic mode, so skip it
	 */
	if (!check_phys_apicid_present(boot_cpu_physical_apicid)) {
		printk("weird, boot CPU (#%d) not listed by the BIOS.\n",
				boot_cpu_physical_apicid);
		physid_set(boot_cpu_physical_apicid, phys_cpu_present_map);
	}

	/*
	 * Switch from PIC to APIC mode.
	 */
	connect_bsp_APIC();
	connect_bsp_APIC();
	setup_local_APIC();


#ifdef CONFIG_X86_IO_APIC
	phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid);
	/*
	 * Now start the IO-APICs
	 */
	if (smp_found_config && !skip_ioapic_setup && nr_ioapics)
		setup_IO_APIC();
#endif
	return 0;
}

void __init APIC_late_time_init(void)
{
	/* Improve our loops per jiffy estimate */
	loops_per_jiffy = ((1000 + HZ - 1)/HZ)*cpu_khz;
	boot_cpu_data.loops_per_jiffy = loops_per_jiffy;
	cpu_data[0].loops_per_jiffy = loops_per_jiffy;


	/* setup_apic_nmi_watchdog doesn't work properly before cpu_khz is
	setup_local_APIC();
	 * initialized.  So redo it here to ensure the boot cpu is setup
	 * properly.
	 */
	if (nmi_watchdog == NMI_LOCAL_APIC)
		setup_apic_nmi_watchdog();


#ifdef CONFIG_X86_IO_APIC
#ifdef CONFIG_X86_IO_APIC
	if (smp_found_config && !skip_ioapic_setup && nr_ioapics)
	if (smp_found_config)
		IO_APIC_late_time_init();
		if (!skip_ioapic_setup && nr_ioapics)
			setup_IO_APIC();
#endif
#endif
	setup_boot_APIC_clock();
	setup_boot_APIC_clock();

	return 0;
}
}
+0 −4
Original line number Original line Diff line number Diff line
@@ -435,8 +435,4 @@ void __init init_IRQ(void)
		setup_irq(FPU_IRQ, &fpu_irq);
		setup_irq(FPU_IRQ, &fpu_irq);


	irq_ctx_init(smp_processor_id());
	irq_ctx_init(smp_processor_id());

#ifdef CONFIG_X86_LOCAL_APIC
	APIC_init();
#endif
}
}
+1 −5
Original line number Original line Diff line number Diff line
@@ -2387,15 +2387,11 @@ void __init setup_IO_APIC(void)
	sync_Arb_IDs();
	sync_Arb_IDs();
	setup_IO_APIC_irqs();
	setup_IO_APIC_irqs();
	init_IO_APIC_traps();
	init_IO_APIC_traps();
	check_timer();
	if (!acpi_ioapic)
	if (!acpi_ioapic)
		print_IO_APIC();
		print_IO_APIC();
}
}


void __init IO_APIC_late_time_init(void)
{
	check_timer();
}

/*
/*
 *	Called after all the initialization is done. If we didnt find any
 *	Called after all the initialization is done. If we didnt find any
 *	APIC bugs then we can allow the modify fast path
 *	APIC bugs then we can allow the modify fast path
+52 −16
Original line number Original line Diff line number Diff line
@@ -1078,16 +1078,6 @@ void *xquad_portio;
EXPORT_SYMBOL(xquad_portio);
EXPORT_SYMBOL(xquad_portio);
#endif
#endif


/*
 * Fall back to non SMP mode after errors.
 *
 */
static __init void disable_smp(void)
{
	cpu_set(0, cpu_sibling_map[0]);
	cpu_set(0, cpu_core_map[0]);
}

static void __init smp_boot_cpus(unsigned int max_cpus)
static void __init smp_boot_cpus(unsigned int max_cpus)
{
{
	int apicid, cpu, bit, kicked;
	int apicid, cpu, bit, kicked;
@@ -1100,6 +1090,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
	printk("CPU%d: ", 0);
	printk("CPU%d: ", 0);
	print_cpu_info(&cpu_data[0]);
	print_cpu_info(&cpu_data[0]);


	boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
	boot_cpu_logical_apicid = logical_smp_processor_id();
	boot_cpu_logical_apicid = logical_smp_processor_id();
	x86_cpu_to_apicid[0] = boot_cpu_physical_apicid;
	x86_cpu_to_apicid[0] = boot_cpu_physical_apicid;


@@ -1111,27 +1102,68 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
	cpus_clear(cpu_core_map[0]);
	cpus_clear(cpu_core_map[0]);
	cpu_set(0, cpu_core_map[0]);
	cpu_set(0, cpu_core_map[0]);


	map_cpu_to_logical_apicid();

	/*
	/*
	 * If we couldn't find an SMP configuration at boot time,
	 * If we couldn't find an SMP configuration at boot time,
	 * get out of here now!
	 * get out of here now!
	 */
	 */
	if (!smp_found_config && !acpi_lapic) {
	if (!smp_found_config && !acpi_lapic) {
		printk(KERN_NOTICE "SMP motherboard not detected.\n");
		printk(KERN_NOTICE "SMP motherboard not detected.\n");
		disable_smp();
		smpboot_clear_io_apic_irqs();
		phys_cpu_present_map = physid_mask_of_physid(0);
		if (APIC_init_uniprocessor())
			printk(KERN_NOTICE "Local APIC not detected."
					   " Using dummy APIC emulation.\n");
		map_cpu_to_logical_apicid();
		cpu_set(0, cpu_sibling_map[0]);
		cpu_set(0, cpu_core_map[0]);
		return;
		return;
	}
	}


	/*
	 * Should not be necessary because the MP table should list the boot
	 * CPU too, but we do it for the sake of robustness anyway.
	 * Makes no sense to do this check in clustered apic mode, so skip it
	 */
	if (!check_phys_apicid_present(boot_cpu_physical_apicid)) {
		printk("weird, boot CPU (#%d) not listed by the BIOS.\n",
				boot_cpu_physical_apicid);
		physid_set(hard_smp_processor_id(), phys_cpu_present_map);
	}

	/*
	 * If we couldn't find a local APIC, then get out of here now!
	 */
	if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid]) && !cpu_has_apic) {
		printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
			boot_cpu_physical_apicid);
		printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n");
		smpboot_clear_io_apic_irqs();
		phys_cpu_present_map = physid_mask_of_physid(0);
		cpu_set(0, cpu_sibling_map[0]);
		cpu_set(0, cpu_core_map[0]);
		return;
	}

	verify_local_APIC();

	/*
	/*
	 * If SMP should be disabled, then really disable it!
	 * If SMP should be disabled, then really disable it!
	 */
	 */
	if (!max_cpus || (enable_local_apic < 0)) {
	if (!max_cpus) {
		printk(KERN_INFO "SMP mode deactivated.\n");
		smp_found_config = 0;
		disable_smp();
		printk(KERN_INFO "SMP mode deactivated, forcing use of dummy APIC emulation.\n");
		smpboot_clear_io_apic_irqs();
		phys_cpu_present_map = physid_mask_of_physid(0);
		cpu_set(0, cpu_sibling_map[0]);
		cpu_set(0, cpu_core_map[0]);
		return;
		return;
	}
	}


	connect_bsp_APIC();
	setup_local_APIC();
	map_cpu_to_logical_apicid();


	setup_portio_remap();
	setup_portio_remap();


	/*
	/*
@@ -1212,6 +1244,10 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
	cpu_set(0, cpu_sibling_map[0]);
	cpu_set(0, cpu_sibling_map[0]);
	cpu_set(0, cpu_core_map[0]);
	cpu_set(0, cpu_core_map[0]);


	smpboot_setup_io_apic();

	setup_boot_APIC_clock();

	/*
	/*
	 * Synchronize the TSC with the AP
	 * Synchronize the TSC with the AP
	 */
	 */
Loading