arch/x86,cpu/x86/mp_init: Switch cpu_info index type to size_t

The alignment for `struct cpu_info` is wrong on x86_64. c_start.S uses
the `push` instruction when setting up the cpu_info struct. This
instruction will push 8 bytes but `unsigned int` is 4 bytes. By making
it a `size_t` we get the correct size for both x86_32 and x86_64.

BUG=b:179699789
TEST=Boot guybrush to the OS

Suggested-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I8ef311aaa8333ccf8a5b3f1f0e852bb26777671c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56573
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Raul E Rangel 2021-07-23 10:34:38 -06:00 committed by Patrick Georgi
parent 474781b270
commit e279d90d4d
2 changed files with 2 additions and 2 deletions

View File

@ -225,7 +225,7 @@ struct thread;
struct cpu_info { struct cpu_info {
struct device *cpu; struct device *cpu;
unsigned int index; size_t index;
#if CONFIG(COOP_MULTITASKING) #if CONFIG(COOP_MULTITASKING)
struct thread *thread; struct thread *thread;
#endif #endif

View File

@ -569,7 +569,7 @@ static void init_bsp(struct bus *cpu_bus)
info->cpu->name = processor_name; info->cpu->name = processor_name;
if (info->index != 0) if (info->index != 0)
printk(BIOS_CRIT, "BSP index(%d) != 0!\n", info->index); printk(BIOS_CRIT, "BSP index(%zd) != 0!\n", info->index);
/* Track BSP in cpu_map structures. */ /* Track BSP in cpu_map structures. */
cpu_add_map_entry(info->index); cpu_add_map_entry(info->index);