Attention is currently required from: Fred Reitberger, Jason Glenesk, Matt DeVillier.
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/79836?usp=email )
Change subject: soc/amd: use apm_get_apmc() in APMC SMI handler
......................................................................
soc/amd: use apm_get_apmc() in APMC SMI handler
Instead of open-coding this functionality, call the apm_get_apmc()
helper function.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: Iac6b614d900e51d91a0c155116a5edc29775ea99
---
M src/soc/amd/common/block/cpu/smm/smi_apmc.c
M src/soc/amd/stoneyridge/smihandler.c
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/79836/1
diff --git a/src/soc/amd/common/block/cpu/smm/smi_apmc.c b/src/soc/amd/common/block/cpu/smm/smi_apmc.c
index 0eab86c..9df6ae3 100644
--- a/src/soc/amd/common/block/cpu/smm/smi_apmc.c
+++ b/src/soc/amd/common/block/cpu/smm/smi_apmc.c
@@ -91,7 +91,7 @@
void fch_apmc_smi_handler(void)
{
- const uint8_t cmd = inb(pm_acpi_smi_cmd_port());
+ const uint8_t cmd = apm_get_apmc();
switch (cmd) {
case APM_CNT_ACPI_ENABLE:
diff --git a/src/soc/amd/stoneyridge/smihandler.c b/src/soc/amd/stoneyridge/smihandler.c
index a8521c5..f962fa0 100644
--- a/src/soc/amd/stoneyridge/smihandler.c
+++ b/src/soc/amd/stoneyridge/smihandler.c
@@ -21,7 +21,7 @@
*/
static void stoneyridge_fch_apmc_smi_handler(void)
{
- const uint8_t cmd = inb(pm_acpi_smi_cmd_port());
+ const uint8_t cmd = apm_get_apmc();
switch (cmd) {
case APM_CNT_ACPI_ENABLE:
--
To view, visit https://review.coreboot.org/c/coreboot/+/79836?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Iac6b614d900e51d91a0c155116a5edc29775ea99
Gerrit-Change-Number: 79836
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Fred Reitberger <reitbergerfred(a)gmail.com>
Gerrit-Reviewer: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Attention: Jason Glenesk <jason.glenesk(a)gmail.com>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)amd.corp-partner.google.com>
Gerrit-Attention: Fred Reitberger <reitbergerfred(a)gmail.com>
Gerrit-MessageType: newchange
Attention is currently required from: Jérémy Compostella.
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/79835?usp=email )
Change subject: cpu/x86/smi_trigger: use enum cb_err as apm_control return type
......................................................................
cpu/x86/smi_trigger: use enum cb_err as apm_control return type
Even though the return value from apm_control isn't checked at any of
its call sites, using the cb_err enum instead of an integer as return
type makes it clearer what the returned value means.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: I07ced74cae915df52a9d439835b84237d51fdd11
---
M src/cpu/x86/smi_trigger.c
M src/include/cpu/x86/smm.h
2 files changed, 4 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/79835/1
diff --git a/src/cpu/x86/smi_trigger.c b/src/cpu/x86/smi_trigger.c
index 9781642..5c63b9e 100644
--- a/src/cpu/x86/smi_trigger.c
+++ b/src/cpu/x86/smi_trigger.c
@@ -29,11 +29,11 @@
}
}
-int apm_control(u8 cmd)
+enum cb_err apm_control(u8 cmd)
{
/* Never proceed inside SMI handler or without one. */
if (ENV_SMM || !CONFIG(HAVE_SMI_HANDLER))
- return -1;
+ return CB_ERR;
apmc_log(__func__, cmd);
@@ -41,7 +41,7 @@
outb(cmd, pm_acpi_smi_cmd_port());
printk(BIOS_DEBUG, "APMC done.\n");
- return 0;
+ return CB_SUCCESS;
}
u8 apm_get_apmc(void)
diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h
index a240ac2..dfb27cd 100644
--- a/src/include/cpu/x86/smm.h
+++ b/src/include/cpu/x86/smm.h
@@ -43,7 +43,7 @@
#endif
/* Send cmd to APM_CNT with HAVE_SMI_HANDLER checking. */
-int apm_control(u8 cmd);
+enum cb_err apm_control(u8 cmd);
u8 apm_get_apmc(void);
void io_trap_handler(int smif);
--
To view, visit https://review.coreboot.org/c/coreboot/+/79835?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I07ced74cae915df52a9d439835b84237d51fdd11
Gerrit-Change-Number: 79835
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-Attention: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-MessageType: newchange
Attention is currently required from: Jérémy Compostella.
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/79834?usp=email )
Change subject: arch/x86/include/smm: improve documentation of call_smm
......................................................................
arch/x86/include/smm: improve documentation of call_smm
Since the inline assembly code doesn't make it exactly obvious how this
function to call the APMC SMI handler works in detail and especially how
it passes the sub-command and argument pointer to the SMI handler, add a
more detailed explanation as comment.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: I3566af191492ce00a3033335ff80e01c33e98e63
---
M src/arch/x86/include/smm_call.h
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/79834/1
diff --git a/src/arch/x86/include/smm_call.h b/src/arch/x86/include/smm_call.h
index 66925c4..d940d0b 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 can then read 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 https://review.coreboot.org/c/coreboot/+/79834?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I3566af191492ce00a3033335ff80e01c33e98e63
Gerrit-Change-Number: 79834
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-Attention: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-MessageType: newchange
Attention is currently required from: Jérémy Compostella.
Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/79833?usp=email )
Change subject: arch/x86/include: rename smm.h to smm_call.h
......................................................................
arch/x86/include: rename smm.h to smm_call.h
Rename smm.h to smm_call.h to make including this file look less
ambiguous.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: Ia907ad92459e835feeddf7eb4743a38f99549179
---
R src/arch/x86/include/smm_call.h
1 file changed, 0 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/79833/1
diff --git a/src/arch/x86/include/smm.h b/src/arch/x86/include/smm_call.h
similarity index 100%
rename from src/arch/x86/include/smm.h
rename to src/arch/x86/include/smm_call.h
--
To view, visit https://review.coreboot.org/c/coreboot/+/79833?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ia907ad92459e835feeddf7eb4743a38f99549179
Gerrit-Change-Number: 79833
Gerrit-PatchSet: 1
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-Attention: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-MessageType: newchange
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/79766?usp=email
to look at the new patch set (#3).
Change subject: drivers/smmstore/ramstage: use call_smm
......................................................................
drivers/smmstore/ramstage: use call_smm
Use call_smm instead of open-coding the same in inline assembly
functionality in init_store. The local ebx variable is dropped, since
call_smm takes a pointer to the argument instead of an integer, and the
local eax variable is renamed to res to make the code a bit clearer,
since the EAX register is used for both passing the command and
subcommand to the APMC SMI handler and to get the return value from the
handler.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: Ib14de0d120ae5c7db3bb7a529837ababe653e1a2
---
M src/drivers/smmstore/ramstage.c
1 file changed, 4 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/66/79766/3
--
To view, visit https://review.coreboot.org/c/coreboot/+/79766?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ib14de0d120ae5c7db3bb7a529837ababe653e1a2
Gerrit-Change-Number: 79766
Gerrit-PatchSet: 3
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Jérémy Compostella.
Hello Jérémy Compostella, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/79827?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by build bot (Jenkins)
Change subject: arch/x86/include/smm: use inline asm from drivers/smmstore/ramstage
......................................................................
arch/x86/include/smm: use inline asm from drivers/smmstore/ramstage
The call_smm function is currently unused and the inline assembly code
for more or less the same functionality in drivers/smmstore/ramstage is
both a bit easier to understand since it uses the register names in the
'outb' instruction instead of positional arguments, and also tells the
compiler that this piece of code might change global memory. Having too
much in the clobber list might only have some performance impact, which
should however be negligible compared to the SMI handler being called,
while missing something in the clobber list might cause hard to debug
problems.
This is a preparation to make drivers/smmstore/ramstage use call_smm
instead of having its own inline assembly implementation for this.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: I73837cab75429014897486b38a5c56f93a850f96
---
M src/arch/x86/include/smm.h
1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/79827/2
--
To view, visit https://review.coreboot.org/c/coreboot/+/79827?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I73837cab75429014897486b38a5c56f93a850f96
Gerrit-Change-Number: 79827
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Felix Held, Jérémy Compostella, Patrick Rudolph.
Hello Jérémy Compostella, Patrick Rudolph, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/79567?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Code-Review+1 by Jérémy Compostella, Code-Review+2 by Patrick Rudolph
Change subject: cpu/x86/smi_trigger: call pm_acpi_smi_cmd_port to get APMC SMI IO port
......................................................................
cpu/x86/smi_trigger: call pm_acpi_smi_cmd_port to get APMC SMI IO port
Instead of hard-coding the APMC SMI command IO port in the FADT, call
pm_acpi_smi_cmd_port() to get the APMC SMI command IO port. Also update
the comment in apm_get_apmc to match what it's doing.
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
Change-Id: I0f36b8a0e93a82b8c6d23c5c5d8fbebb1bc6b0bc
---
M src/cpu/x86/smi_trigger.c
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/79567/5
--
To view, visit https://review.coreboot.org/c/coreboot/+/79567?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I0f36b8a0e93a82b8c6d23c5c5d8fbebb1bc6b0bc
Gerrit-Change-Number: 79567
Gerrit-PatchSet: 5
Gerrit-Owner: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-Reviewer: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Attention: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-Attention: Felix Held <felix-coreboot(a)felixheld.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: Angel Pons, David Hendricks, Jakub Czapiga, Martin L Roth, Matt DeVillier, Nicholas Chin, Paul Menzel.
Felix Singer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/79441?usp=email )
Change subject: Documentation/getting_started: Add a FAQ document
......................................................................
Patch Set 5: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/79441?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ia324e4800bf9dfc7ad86f4f99272c87ac566304e
Gerrit-Change-Number: 79441
Gerrit-PatchSet: 5
Gerrit-Owner: Martin L Roth <gaumless(a)gmail.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Felix Singer <service+coreboot-gerrit(a)felixsinger.de>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Jakub Czapiga <czapiga(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Martin L Roth <gaumless(a)gmail.com>
Gerrit-Attention: Jakub Czapiga <czapiga(a)google.com>
Gerrit-Attention: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Comment-Date: Fri, 05 Jan 2024 21:59:33 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment