Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44174 )
Change subject: [TESTONLY] smm loader v2 fixups for B85M Pro4 ......................................................................
[TESTONLY] smm loader v2 fixups for B85M Pro4
Change-Id: I754c661fbad0bc5fbddfab9747607e664ad1e2b6 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/cpu/x86/mp_init.c M src/cpu/x86/smm/smm_module_loaderv2.c M src/include/cpu/x86/smm.h M src/mainboard/asrock/b85m_pro4/Kconfig 4 files changed, 17 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/44174/1
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index caed8f4..375c94e 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -726,8 +726,18 @@ * the location of the new SMBASE. If using SMM modules then this * calculation needs to match that of the module loader. */ - perm_smbase = mp_state.perm_smbase; - perm_smbase -= cpu * runtime->save_state_size; + if (CONFIG(X86_SMM_LOADER_VERSION2)) { + perm_smbase = smm_get_cpu_smbase(cpu); + mp_state.perm_smbase = perm_smbase; + + if (!perm_smbase) { + printk(BIOS_ERR, "%s: bad SMBASE for CPU %d\n", __func__, cpu); + return; + } + } else { + perm_smbase = mp_state.perm_smbase; + perm_smbase -= cpu * runtime->save_state_size; + }
printk(BIOS_DEBUG, "New SMBASE 0x%08lx\n", perm_smbase);
diff --git a/src/cpu/x86/smm/smm_module_loaderv2.c b/src/cpu/x86/smm/smm_module_loaderv2.c index c084f74..e6ccfdf 100644 --- a/src/cpu/x86/smm/smm_module_loaderv2.c +++ b/src/cpu/x86/smm/smm_module_loaderv2.c @@ -173,7 +173,7 @@ * input: cpu_num - cpu number which is used as an index into the * map to return the smbase */ -int smm_get_cpu_smbase(unsigned int cpu_num) +u32 smm_get_cpu_smbase(unsigned int cpu_num) { if (cpu_num < CONFIG_MAX_CPUS) { if (cpus[cpu_num].active) diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h index 7838223..084d150 100644 --- a/src/include/cpu/x86/smm.h +++ b/src/include/cpu/x86/smm.h @@ -149,21 +149,19 @@ struct smm_runtime *runtime;
/* 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; unsigned int smm_main_entry_offset; unsigned int smram_start; unsigned int smram_end; - #endif +#endif };
/* Both of these return 0 on success, < 0 on failure. */ int smm_setup_relocation_handler(struct smm_loader_params *params); int smm_load_module(void *smram, size_t size, struct smm_loader_params *params);
-#if CONFIG(X86_SMM_LOADER_VERSION2) -int smm_get_cpu_smbase(unsigned int cpu_num); -#endif +u32 smm_get_cpu_smbase(unsigned int cpu_num);
/* Backup and restore default SMM region. */ void *backup_default_smm_area(void); diff --git a/src/mainboard/asrock/b85m_pro4/Kconfig b/src/mainboard/asrock/b85m_pro4/Kconfig index dc65120..2afc334 100644 --- a/src/mainboard/asrock/b85m_pro4/Kconfig +++ b/src/mainboard/asrock/b85m_pro4/Kconfig @@ -17,6 +17,7 @@ select SERIRQ_CONTINUOUS_MODE select SOUTHBRIDGE_INTEL_LYNXPOINT select SUPERIO_NUVOTON_NCT6776 + select X86_SMM_LOADER_VERSION2
config MAINBOARD_DIR string
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44174
to look at the new patch set (#2).
Change subject: [TESTONLY] smm loader v2 fixups for B85M Pro4 ......................................................................
[TESTONLY] smm loader v2 fixups for B85M Pro4
Change-Id: I754c661fbad0bc5fbddfab9747607e664ad1e2b6 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/mainboard/asrock/b85m_pro4/Kconfig 1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/44174/2
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44174
to look at the new patch set (#3).
Change subject: mb/asrock/b85m_pro4: Select X86_SMM_LOADER_VERSION2 ......................................................................
mb/asrock/b85m_pro4: Select X86_SMM_LOADER_VERSION2
Change-Id: I754c661fbad0bc5fbddfab9747607e664ad1e2b6 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/mainboard/asrock/b85m_pro4/Kconfig 1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/44174/3
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44174
to look at the new patch set (#7).
Change subject: configs/config.asrock_b85m_pro4...: Select X86_SMM_LOADER_VERSION2 ......................................................................
configs/config.asrock_b85m_pro4...: Select X86_SMM_LOADER_VERSION2
This allows build-testing the code while it isn't used anywhere.
Change-Id: I754c661fbad0bc5fbddfab9747607e664ad1e2b6 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M configs/config.asrock_b85m_pro4.debug_smmstore_hotplug_gcov_ubsan_em100 1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/44174/7
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44174 )
Change subject: configs/config.asrock_b85m_pro4...: Select X86_SMM_LOADER_VERSION2 ......................................................................
Patch Set 7: Code-Review+2
Let's hope xeon_sp gets SMM quickly or that V1 disappears.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44174 )
Change subject: configs/config.asrock_b85m_pro4...: Select X86_SMM_LOADER_VERSION2 ......................................................................
Patch Set 7: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/44174 )
Change subject: configs/config.asrock_b85m_pro4...: Select X86_SMM_LOADER_VERSION2 ......................................................................
configs/config.asrock_b85m_pro4...: Select X86_SMM_LOADER_VERSION2
This allows build-testing the code while it isn't used anywhere.
Change-Id: I754c661fbad0bc5fbddfab9747607e664ad1e2b6 Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/44174 Reviewed-by: Arthur Heymans arthur@aheymans.xyz Reviewed-by: Nico Huber nico.h@gmx.de Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M configs/config.asrock_b85m_pro4.debug_smmstore_hotplug_gcov_ubsan_em100 1 file changed, 2 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Arthur Heymans: Looks good to me, approved
diff --git a/configs/config.asrock_b85m_pro4.debug_smmstore_hotplug_gcov_ubsan_em100 b/configs/config.asrock_b85m_pro4.debug_smmstore_hotplug_gcov_ubsan_em100 index 62169b5..563f83a 100644 --- a/configs/config.asrock_b85m_pro4.debug_smmstore_hotplug_gcov_ubsan_em100 +++ b/configs/config.asrock_b85m_pro4.debug_smmstore_hotplug_gcov_ubsan_em100 @@ -9,6 +9,7 @@ # + Silicon Image SIL3114 driver # + Genesys Logic GL9763E driver # + EM100 support +# + SMM module loader V2 CONFIG_COVERAGE=y CONFIG_UBSAN=y CONFIG_VENDOR_ASROCK=y @@ -44,4 +45,5 @@ CONFIG_DEBUG_BOOT_STATE=y CONFIG_DEBUG_ADA_CODE=y CONFIG_HAVE_EM100_SUPPORT=y +CONFIG_X86_SMM_LOADER_VERSION2=y CONFIG_EM100=y