Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37008 )
Change subject: cpu/x86/smm: Add a helper function returning top of save state ......................................................................
cpu/x86/smm: Add a helper function returning top of save state
Some entries like smm base and smm revision have a fixed location in the save w.r.t. the save state top.
Change-Id: I82dadcb966ee686c1652c7a1298dcb9938ae888c Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/cpu/x86/smm/smihandler.c M src/cpu/x86/smm/smm_module_handler.c M src/include/cpu/x86/smm.h 3 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/37008/1
diff --git a/src/cpu/x86/smm/smihandler.c b/src/cpu/x86/smm/smihandler.c index 20417d1..79a3936 100644 --- a/src/cpu/x86/smm/smihandler.c +++ b/src/cpu/x86/smm/smihandler.c @@ -132,6 +132,13 @@ return (void *)base; }
+uint8_t *smm_get_save_state_top(int cpu) +{ + const uint32_t smm_base = 0xa0000; + + return (uint8_t *)smm_base + SMM_ENTRY_OFFSET * 2 - (cpu * 0x400); +} + /** * @brief Interrupt handler for SMI# * diff --git a/src/cpu/x86/smm/smm_module_handler.c b/src/cpu/x86/smm/smm_module_handler.c index bd4d48c..80bff9f 100644 --- a/src/cpu/x86/smm/smm_module_handler.c +++ b/src/cpu/x86/smm/smm_module_handler.c @@ -114,6 +114,19 @@ return base; }
+uint8_t *smm_get_save_state_top(int cpu) +{ + uint8_t *base; + + /* This function assumes all save states start at top of default + * SMRAM size space and are staggered down by save state size. */ + base = (void *)smm_runtime->smbase; + base += SMM_DEFAULT_SIZE; + base -= cpu * smm_runtime->save_state_size; + + return base; +} + asmlinkage void smm_handler_start(void *arg) { const struct smm_module_params *p; diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h index cf107b1..0ade970 100644 --- a/src/include/cpu/x86/smm.h +++ b/src/include/cpu/x86/smm.h @@ -94,6 +94,7 @@ /* Retrieve SMM save state for a given CPU. WARNING: This does not take into * account CPUs which are configured to not save their state to RAM. */ void *smm_get_save_state(int cpu); +uint8_t *smm_get_save_state_top(int cpu);
/* SMM Module Loading API */
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37008 )
Change subject: cpu/x86/smm: Add a helper function returning top of save state ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37008/1/src/cpu/x86/smm/smihandler.... File src/cpu/x86/smm/smihandler.c:
https://review.coreboot.org/c/coreboot/+/37008/1/src/cpu/x86/smm/smihandler.... PS1, Line 137: const uint32_t smm_base = 0xa0000; src/include/cpu/x86/smm.h:#define SMM_BASE 0xa0000
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/37008
to look at the new patch set (#2).
Change subject: cpu/x86/smm: Add a helper function returning top of save state ......................................................................
cpu/x86/smm: Add a helper function returning top of save state
Some entries like smm base and smm revision have a fixed location in the save w.r.t. the save state top.
Change-Id: I82dadcb966ee686c1652c7a1298dcb9938ae888c Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/cpu/x86/smm/smihandler.c M src/cpu/x86/smm/smm_module_handler.c M src/include/cpu/x86/smm.h 3 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/37008/2
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37008 )
Change subject: cpu/x86/smm: Add a helper function returning top of save state ......................................................................
Patch Set 2: Code-Review+1
(2 comments)
https://review.coreboot.org/c/coreboot/+/37008/2/src/cpu/x86/smm/smihandler.... File src/cpu/x86/smm/smihandler.c:
https://review.coreboot.org/c/coreboot/+/37008/2/src/cpu/x86/smm/smihandler.... PS2, Line 137: uint32_t uintptr_t
https://review.coreboot.org/c/coreboot/+/37008/2/src/cpu/x86/smm/smm_module_... File src/cpu/x86/smm/smm_module_handler.c:
https://review.coreboot.org/c/coreboot/+/37008/2/src/cpu/x86/smm/smm_module_... PS2, Line 123: base = (void *)smm_runtime->smbase; (void *)(uintptr_t)
Hello build bot (Jenkins), Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/37008
to look at the new patch set (#3).
Change subject: cpu/x86/smm: Add a helper function returning top of save state ......................................................................
cpu/x86/smm: Add a helper function returning top of save state
Some entries like smm base and smm revision have a fixed location in the save w.r.t. the save state top.
Change-Id: I82dadcb966ee686c1652c7a1298dcb9938ae888c Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/cpu/x86/smm/smihandler.c M src/cpu/x86/smm/smm_module_handler.c M src/include/cpu/x86/smm.h 3 files changed, 19 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/37008/3
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37008 )
Change subject: cpu/x86/smm: Add a helper function returning top of save state ......................................................................
Patch Set 3: Code-Review+2
Arthur Heymans has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/37008 )
Change subject: cpu/x86/smm: Add a helper function returning top of save state ......................................................................
Abandoned
superseded in common_smm_save_state