summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-11-19 10:06:00 -0600
committerAaron Durbin <adurbin@chromium.org>2016-11-21 16:45:10 +0100
commitebbd12f8bcfb1f21db7991c5272515fb76600b66 (patch)
treeb394ffc4d0cc2ea155853ab1f595c53427dd95a8 /src/arch
parent4c002ac7291f3a25410891445df2263ea5ef3e4a (diff)
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>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/gdt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/arch/x86/gdt.c b/src/arch/x86/gdt.c
index 982b8ae9d2..f662edda3a 100644
--- a/src/arch/x86/gdt.c
+++ b/src/arch/x86/gdt.c
@@ -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));