Felix Held submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Matt DeVillier: Looks good to me, approved
arch/x86/include/smm_call: improve documentation of call_smm

Since the inline assembly code in call_smm doesn't make it exactly
obvious how this function to call the APMC SMI handler works in detail,
add a more detailed explanation as comment.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I3566af191492ce00a3033335ff80e01c33e98e63
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79834
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
---
M src/arch/x86/include/smm_call.h
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/arch/x86/include/smm_call.h b/src/arch/x86/include/smm_call.h
index 66925c4..dc78039 100644
--- a/src/arch/x86/include/smm_call.h
+++ b/src/arch/x86/include/smm_call.h
@@ -4,7 +4,10 @@
#include <cpu/x86/smm.h>

/*
- * calls into SMM with the given cmd and subcmd in eax, and arg in ebx
+ * Call the APMC SMI handler that resides in SMM. First, the command and sub-command are stored
+ * in eax, and the argument pointer is stored in ebx, then the command byte is written to the
+ * APMC IO port to trigger the SMI. The APMC SMI handler then reads the command from the APMC
+ * IO port and the contents of eax and ebx from the SMM state save area.
*
* static inline because the resulting assembly is often smaller than
* the call sequence due to constant folding.

To view, visit change 79834. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I3566af191492ce00a3033335ff80e01c33e98e63
Gerrit-Change-Number: 79834
Gerrit-PatchSet: 5
Gerrit-Owner: Felix Held <felix-coreboot@felixheld.de>
Gerrit-Reviewer: Felix Held <felix-coreboot@felixheld.de>
Gerrit-Reviewer: Jérémy Compostella <jeremy.compostella@intel.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged