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.

Change-Id: I2750d30119fee01baf4748d8001a672d18a13fb0
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/17504
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Aaron Durbin 2016-11-19 10:06:00 -06:00
parent 4c002ac729
commit ebbd12f8bc
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,10 @@ static void move_gdt(int is_recovery)
u16 num_gdt_bytes = (uintptr_t)&gdt_end - (uintptr_t)&gdt; u16 num_gdt_bytes = (uintptr_t)&gdt_end - (uintptr_t)&gdt;
struct gdtarg gdtarg; 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); newgdt = cbmem_find(CBMEM_ID_GDT);
if (!newgdt) { if (!newgdt) {
newgdt = cbmem_add(CBMEM_ID_GDT, ALIGN(num_gdt_bytes, 512)); newgdt = cbmem_add(CBMEM_ID_GDT, ALIGN(num_gdt_bytes, 512));