cpu/x86/smm_module_loaderv2: Fix compiling for x86_64

Change-Id: I9288ede88f822ff78dd9cb91020451dc935203a0
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48263
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
This commit is contained in:
Arthur Heymans 2020-12-03 11:02:42 +01:00
parent 161d809bc6
commit 9ddd9002cc
2 changed files with 11 additions and 11 deletions

View File

@ -221,7 +221,7 @@ u32 smm_get_cpu_smbase(unsigned int cpu_num)
*/ */
static int smm_place_entry_code(uintptr_t smbase, unsigned int num_cpus, static int smm_place_entry_code(uintptr_t smbase, unsigned int num_cpus,
unsigned int stack_top, const struct smm_loader_params *params) uintptr_t stack_top, const struct smm_loader_params *params)
{ {
unsigned int i; unsigned int i;
unsigned int size; unsigned int size;
@ -235,7 +235,7 @@ static int smm_place_entry_code(uintptr_t smbase, unsigned int num_cpus,
if (cpus[num_cpus - 1].smbase + if (cpus[num_cpus - 1].smbase +
params->smm_main_entry_offset < stack_top) { params->smm_main_entry_offset < stack_top) {
printk(BIOS_ERR, "%s: stack encroachment\n", __func__); printk(BIOS_ERR, "%s: stack encroachment\n", __func__);
printk(BIOS_ERR, "%s: smbase %zx, stack_top %x\n", printk(BIOS_ERR, "%s: smbase %zx, stack_top %lx\n",
__func__, cpus[num_cpus].smbase, stack_top); __func__, cpus[num_cpus].smbase, stack_top);
return 0; return 0;
} }
@ -245,7 +245,7 @@ static int smm_place_entry_code(uintptr_t smbase, unsigned int num_cpus,
return 0; return 0;
} }
printk(BIOS_INFO, "%s: smbase %zx, stack_top %x\n", printk(BIOS_INFO, "%s: smbase %zx, stack_top %lx\n",
__func__, cpus[num_cpus-1].smbase, stack_top); __func__, cpus[num_cpus-1].smbase, stack_top);
/* start at 1, the first CPU stub code is already there */ /* start at 1, the first CPU stub code is already there */
@ -311,9 +311,9 @@ static int smm_stub_place_staggered_entry_points(char *base,
* sets up the stack, and then jumps to common SMI handler * sets up the stack, and then jumps to common SMI handler
*/ */
if (params->num_concurrent_save_states > 1 || stub_entry_offset != 0) { if (params->num_concurrent_save_states > 1 || stub_entry_offset != 0) {
rc = smm_place_entry_code((unsigned int)base, rc = smm_place_entry_code((uintptr_t)base,
params->num_concurrent_save_states, params->num_concurrent_save_states,
(unsigned int)params->stack_top, params); (uintptr_t)params->stack_top, params);
} }
return rc; return rc;
} }
@ -384,7 +384,7 @@ static int smm_module_setup_stub(void *smbase, size_t smm_size,
/* The save state size encroached over the first SMM entry point. */ /* The save state size encroached over the first SMM entry point. */
if (size <= params->smm_main_entry_offset) { if (size <= params->smm_main_entry_offset) {
printk(BIOS_ERR, "%s: encroachment over SMM entry point\n", __func__); printk(BIOS_ERR, "%s: encroachment over SMM entry point\n", __func__);
printk(BIOS_ERR, "%s: state save size: %zx : smm_entry_offset -> %x\n", printk(BIOS_ERR, "%s: state save size: %zx : smm_entry_offset -> %lx\n",
__func__, size, params->smm_main_entry_offset); __func__, size, params->smm_main_entry_offset);
return -1; return -1;
} }

View File

@ -150,10 +150,10 @@ struct smm_loader_params {
/* The following are only used by X86_SMM_LOADER_VERSION2 */ /* The following are only used by X86_SMM_LOADER_VERSION2 */
#if CONFIG(X86_SMM_LOADER_VERSION2) #if CONFIG(X86_SMM_LOADER_VERSION2)
unsigned int smm_entry; uintptr_t smm_entry;
unsigned int smm_main_entry_offset; uintptr_t smm_main_entry_offset;
unsigned int smram_start; uintptr_t smram_start;
unsigned int smram_end; uintptr_t smram_end;
#endif #endif
}; };