cpu/x86/mp_init: remove adjust_cpu_apic_entry()
The original purpose of adjust_cpu_apic_entry() was to set up an APIC map. That map was effectively only used for mapping *default* APIC id to CPU number in the SMM handler. The normal AP startup path didn't need this mapping because it was whoever won the race got the next cpu number. Instead of statically calculating (and wrong) just initialize the default APIC id map when the APs come online. Once the APs are online the SMM handler is loaded and the mapping is utilized. Change-Id: Idff3b8cfc17aef0729d3193b4499116a013b7930 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/21452 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Subrata Banik <subrata.banik@intel.com> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
This commit is contained in:
@ -712,7 +712,6 @@ static void haswell_init(struct device *cpu)
|
||||
|
||||
/* MP initialization support. */
|
||||
static const void *microcode_patch;
|
||||
static int ht_disabled;
|
||||
|
||||
static void pre_mp_init(void)
|
||||
{
|
||||
@ -740,8 +739,6 @@ static int get_cpu_count(void)
|
||||
printk(BIOS_DEBUG, "CPU has %u cores, %u threads enabled.\n",
|
||||
num_cores, num_threads);
|
||||
|
||||
ht_disabled = num_threads == num_cores;
|
||||
|
||||
return num_threads;
|
||||
}
|
||||
|
||||
@ -752,14 +749,6 @@ static void get_microcode_info(const void **microcode, int *parallel)
|
||||
*parallel = 1;
|
||||
}
|
||||
|
||||
static int adjust_apic_id(int index, int apic_id)
|
||||
{
|
||||
if (ht_disabled)
|
||||
return 2 * index;
|
||||
else
|
||||
return index;
|
||||
}
|
||||
|
||||
static void per_cpu_smm_trigger(void)
|
||||
{
|
||||
/* Relocate the SMM handler. */
|
||||
@ -784,7 +773,6 @@ static const struct mp_ops mp_ops = {
|
||||
.get_cpu_count = get_cpu_count,
|
||||
.get_smm_info = smm_info,
|
||||
.get_microcode_info = get_microcode_info,
|
||||
.adjust_cpu_apic_entry = adjust_apic_id,
|
||||
.pre_mp_smm_init = smm_initialize,
|
||||
.per_cpu_smm_trigger = per_cpu_smm_trigger,
|
||||
.relocation_handler = smm_relocation_handler,
|
||||
|
Reference in New Issue
Block a user