Add CONFIG_ checks around the handle_smi/handle_smp functions.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/fw/smm.c | 2 ++ src/fw/smp.c | 3 +++ 2 files changed, 5 insertions(+)
diff --git a/src/fw/smm.c b/src/fw/smm.c index c2ce5c3..ce95285 100644 --- a/src/fw/smm.c +++ b/src/fw/smm.c @@ -51,6 +51,8 @@ struct smm_layout { void VISIBLE32FLAT handle_smi(u16 cs) { + if (!CONFIG_USE_SMM) + return; u8 cmd = inb(PORT_SMI_CMD); struct smm_layout *smm = MAKE_FLATPTR(cs, 0); dprintf(DEBUG_HDL_smi, "handle_smi cmd=%x smbase=%p\n", cmd, smm); diff --git a/src/fw/smp.c b/src/fw/smp.c index a2df9de..a466ea6 100644 --- a/src/fw/smp.c +++ b/src/fw/smp.c @@ -49,6 +49,9 @@ int apic_id_is_present(u8 apic_id) void VISIBLE32FLAT handle_smp(void) { + if (!CONFIG_QEMU) + return; + // Enable CPU caching setcr0(getcr0() & ~(CR0_CD|CR0_NW));