aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2017-08-18 20:58:33 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-08-19 15:34:48 +0000
commite09cd1b787c4dbb8e90dcdbc3e053fca927a8483 (patch)
tree1128008d7bedf05f5f23e5e60fcef3038b79d27a
parenta9450081cf76bf0041b55f87b64824bdc5b26eda (diff)
arch/x86: Sanity checking on HAVE_SMI_HANDLER
Fail at build-time if one of the following happens: Platform includes SMI handler setup function smm_init() in the build when configuration has HAVE_SMI_HANDLER=n. Platform does not implement smm_init_completion() when HAVE_SMI_HANDLER=y. Change-Id: I7d61c155d2b7c2d71987980db4c25d520452dabf Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/21097 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
-rw-r--r--src/cpu/amd/smm/smm_init.c4
-rw-r--r--src/cpu/x86/lapic/lapic_cpu_init.c8
-rw-r--r--src/soc/intel/sch/smi.c4
3 files changed, 13 insertions, 3 deletions
diff --git a/src/cpu/amd/smm/smm_init.c b/src/cpu/amd/smm/smm_init.c
index 4d04cf7762..7af8808c62 100644
--- a/src/cpu/amd/smm/smm_init.c
+++ b/src/cpu/amd/smm/smm_init.c
@@ -77,3 +77,7 @@ void smm_lock(void)
{
/* We lock SMM in CPU init */
}
+
+void smm_init_completion(void)
+{
+}
diff --git a/src/cpu/x86/lapic/lapic_cpu_init.c b/src/cpu/x86/lapic/lapic_cpu_init.c
index c2ac51374d..898a5c476a 100644
--- a/src/cpu/x86/lapic/lapic_cpu_init.c
+++ b/src/cpu/x86/lapic/lapic_cpu_init.c
@@ -593,11 +593,13 @@ void initialize_cpus(struct bus *cpu_bus)
recover_lowest_1M();
}
-/* Platform-specific code for SMI handler overrides this. */
-__attribute__((weak)) void smm_init(void)
+#if !IS_ENABLED(CONFIG_HAVE_SMI_HANDLER)
+/* Empty stubs for platforms without SMI handlers. */
+void smm_init(void)
{
}
-__attribute__((weak)) void smm_init_completion(void)
+void smm_init_completion(void)
{
}
+#endif
diff --git a/src/soc/intel/sch/smi.c b/src/soc/intel/sch/smi.c
index f79e963ba1..7e5ce241f9 100644
--- a/src/soc/intel/sch/smi.c
+++ b/src/soc/intel/sch/smi.c
@@ -312,6 +312,10 @@ void smm_init(void)
smi_set_eos();
}
+void smm_init_completion(void)
+{
+}
+
void smm_lock(void)
{
/* LOCK the SMM memory window and enable normal SMM.