diff options
author | Eugene Myers <edmyers@tycho.nsa.gov> | 2021-05-12 07:55:28 -0400 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2023-06-10 03:21:08 +0000 |
commit | e7e2bd2a593e95fb8fe7b4020a6822ce9cd8a1ff (patch) | |
tree | 6452249a87db4fed716850f56028b4b00fe7a99d /src/cpu/x86/mp_init.c | |
parent | 0f93a91548c254c7759174b333e51edb65a95712 (diff) | |
download | coreboot-e7e2bd2a593e95fb8fe7b4020a6822ce9cd8a1ff.tar.gz coreboot-e7e2bd2a593e95fb8fe7b4020a6822ce9cd8a1ff.tar.bz2 coreboot-e7e2bd2a593e95fb8fe7b4020a6822ce9cd8a1ff.zip |
cpu/x86/: Centralize MSEG location calculation
This patch centralizes the MSEG location calculation. In the current
implementation, the calculation happens in smm_module_loader and
mp_init. When smm_module_loaderv2 was added, this calculation became
broken as the original calculation made assumptions based on perm_smbase.
The calculation is now located in smm_subregion (tseg_region.c), as the
MSEG is located within the TSEG (or SMM);
These patches have been tested on a Purism librem-l1um server.
Change-Id: Ic17e1a505401c3b2a218826dffae6fe12a5c15c6
Signed-off-by: Eugene Myers <edmyers@tycho.nsa.gov>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55628
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/cpu/x86/mp_init.c')
-rw-r--r-- | src/cpu/x86/mp_init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c index 57b88653c531..313fb3411304 100644 --- a/src/cpu/x86/mp_init.c +++ b/src/cpu/x86/mp_init.c @@ -756,9 +756,9 @@ static void asmlinkage smm_do_relocation(void *arg) if (CONFIG(STM)) { if (is_smm_enabled()) { uintptr_t mseg; + size_t mseg_size; - mseg = mp_state.perm_smbase + - (mp_state.perm_smsize - CONFIG_MSEG_SIZE); + smm_subregion(SMM_SUBREGION_MSEG, &mseg, &mseg_size); stm_setup(mseg, p->cpu, runtime->num_cpus, perm_smbase, |