mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: arch/x86: don't create new gdt in cbmem for relocatable ramstage
When running with relocatable ramstage, the gdt loaded from c_start.S is already in CBMEM (high memory). Thus, there's no need to create a new copy of the gdt and reload. BUG=None BRANCH=None TEST=None Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/17504 Tested-by: build bot (Jenkins) Reviewed-by: Kysti Mlkki <kyosti.malkki@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Change-Id: I2750d30119fee01baf4748d8001a672d18a13fb0 Reviewed-on: https://chromium-review.googlesource.com/414550 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
1030a78af3
commit
ceda5797a6
1 changed files with 4 additions and 0 deletions
|
@ -38,6 +38,10 @@ static void move_gdt(int is_recovery)
|
|||
u16 num_gdt_bytes = (uintptr_t)&gdt_end - (uintptr_t)&gdt;
|
||||
struct gdtarg gdtarg;
|
||||
|
||||
/* ramstage is already in high memory. No need to use a new gdt. */
|
||||
if (IS_ENABLED(CONFIG_RELOCATABLE_RAMSTAGE))
|
||||
return;
|
||||
|
||||
newgdt = cbmem_find(CBMEM_ID_GDT);
|
||||
if (!newgdt) {
|
||||
newgdt = cbmem_add(CBMEM_ID_GDT, ALIGN(num_gdt_bytes, 512));
|
||||
|
|
Loading…
Add table
Reference in a new issue