|
@@ -123,7 +123,6 @@ EXPORT_PER_CPU_SYMBOL(cpu_info);
|
|
|
|
|
|
static atomic_t init_deasserted;
|
|
static atomic_t init_deasserted;
|
|
|
|
|
|
-static int boot_cpu_logical_apicid;
|
|
|
|
|
|
|
|
/* representing cpus for which sibling maps can be computed */
|
|
/* representing cpus for which sibling maps can be computed */
|
|
static cpumask_t cpu_sibling_setup_map;
|
|
static cpumask_t cpu_sibling_setup_map;
|
|
@@ -165,6 +164,8 @@ static void unmap_cpu_to_node(int cpu)
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifdef CONFIG_X86_32
|
|
#ifdef CONFIG_X86_32
|
|
|
|
+static int boot_cpu_logical_apicid;
|
|
|
|
+
|
|
u8 cpu_2_logical_apicid[NR_CPUS] __read_mostly =
|
|
u8 cpu_2_logical_apicid[NR_CPUS] __read_mostly =
|
|
{ [0 ... NR_CPUS-1] = BAD_APICID };
|
|
{ [0 ... NR_CPUS-1] = BAD_APICID };
|
|
|
|
|
|
@@ -546,8 +547,7 @@ static inline void __inquire_remote_apic(int apicid)
|
|
printk(KERN_CONT
|
|
printk(KERN_CONT
|
|
"a previous APIC delivery may have failed\n");
|
|
"a previous APIC delivery may have failed\n");
|
|
|
|
|
|
- apic_write_around(APIC_ICR2, SET_APIC_DEST_FIELD(apicid));
|
|
|
|
- apic_write_around(APIC_ICR, APIC_DM_REMRD | regs[i]);
|
|
|
|
|
|
+ apic_icr_write(APIC_DM_REMRD | regs[i], apicid);
|
|
|
|
|
|
timeout = 0;
|
|
timeout = 0;
|
|
do {
|
|
do {
|
|
@@ -579,11 +579,9 @@ wakeup_secondary_cpu(int logical_apicid, unsigned long start_eip)
|
|
int maxlvt;
|
|
int maxlvt;
|
|
|
|
|
|
/* Target chip */
|
|
/* Target chip */
|
|
- apic_write_around(APIC_ICR2, SET_APIC_DEST_FIELD(logical_apicid));
|
|
|
|
-
|
|
|
|
/* Boot on the stack */
|
|
/* Boot on the stack */
|
|
/* Kick the second */
|
|
/* Kick the second */
|
|
- apic_write_around(APIC_ICR, APIC_DM_NMI | APIC_DEST_LOGICAL);
|
|
|
|
|
|
+ apic_icr_write(APIC_DM_NMI | APIC_DEST_LOGICAL, logical_apicid);
|
|
|
|
|
|
Dprintk("Waiting for send to finish...\n");
|
|
Dprintk("Waiting for send to finish...\n");
|
|
send_status = safe_apic_wait_icr_idle();
|
|
send_status = safe_apic_wait_icr_idle();
|
|
@@ -639,13 +637,11 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
|
|
/*
|
|
/*
|
|
* Turn INIT on target chip
|
|
* Turn INIT on target chip
|
|
*/
|
|
*/
|
|
- apic_write_around(APIC_ICR2, SET_APIC_DEST_FIELD(phys_apicid));
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* Send IPI
|
|
* Send IPI
|
|
*/
|
|
*/
|
|
- apic_write_around(APIC_ICR, APIC_INT_LEVELTRIG | APIC_INT_ASSERT
|
|
|
|
- | APIC_DM_INIT);
|
|
|
|
|
|
+ apic_icr_write(APIC_INT_LEVELTRIG | APIC_INT_ASSERT | APIC_DM_INIT,
|
|
|
|
+ phys_apicid);
|
|
|
|
|
|
Dprintk("Waiting for send to finish...\n");
|
|
Dprintk("Waiting for send to finish...\n");
|
|
send_status = safe_apic_wait_icr_idle();
|
|
send_status = safe_apic_wait_icr_idle();
|
|
@@ -655,10 +651,8 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
|
|
Dprintk("Deasserting INIT.\n");
|
|
Dprintk("Deasserting INIT.\n");
|
|
|
|
|
|
/* Target chip */
|
|
/* Target chip */
|
|
- apic_write_around(APIC_ICR2, SET_APIC_DEST_FIELD(phys_apicid));
|
|
|
|
-
|
|
|
|
/* Send IPI */
|
|
/* Send IPI */
|
|
- apic_write_around(APIC_ICR, APIC_INT_LEVELTRIG | APIC_DM_INIT);
|
|
|
|
|
|
+ apic_icr_write(APIC_INT_LEVELTRIG | APIC_DM_INIT, phys_apicid);
|
|
|
|
|
|
Dprintk("Waiting for send to finish...\n");
|
|
Dprintk("Waiting for send to finish...\n");
|
|
send_status = safe_apic_wait_icr_idle();
|
|
send_status = safe_apic_wait_icr_idle();
|
|
@@ -703,12 +697,10 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
|
|
*/
|
|
*/
|
|
|
|
|
|
/* Target chip */
|
|
/* Target chip */
|
|
- apic_write_around(APIC_ICR2, SET_APIC_DEST_FIELD(phys_apicid));
|
|
|
|
-
|
|
|
|
/* Boot on the stack */
|
|
/* Boot on the stack */
|
|
/* Kick the second */
|
|
/* Kick the second */
|
|
- apic_write_around(APIC_ICR, APIC_DM_STARTUP
|
|
|
|
- | (start_eip >> 12));
|
|
|
|
|
|
+ apic_icr_write(APIC_DM_STARTUP | (start_eip >> 12),
|
|
|
|
+ phys_apicid);
|
|
|
|
|
|
/*
|
|
/*
|
|
* Give the other CPU some time to accept the IPI.
|
|
* Give the other CPU some time to accept the IPI.
|
|
@@ -1147,7 +1139,9 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
|
|
* Setup boot CPU information
|
|
* Setup boot CPU information
|
|
*/
|
|
*/
|
|
smp_store_cpu_info(0); /* Final full version of the data */
|
|
smp_store_cpu_info(0); /* Final full version of the data */
|
|
|
|
+#ifdef CONFIG_X86_32
|
|
boot_cpu_logical_apicid = logical_smp_processor_id();
|
|
boot_cpu_logical_apicid = logical_smp_processor_id();
|
|
|
|
+#endif
|
|
current_thread_info()->cpu = 0; /* needed? */
|
|
current_thread_info()->cpu = 0; /* needed? */
|
|
set_cpu_sibling_map(0);
|
|
set_cpu_sibling_map(0);
|
|
|
|
|