From ceda5797a649786f5a4c51488a1b816a59b377e0 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Sat, 19 Nov 2016 10:06:00 -0600 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/17504 Tested-by: build bot (Jenkins) Reviewed-by: Kysti Mlkki Reviewed-by: Paul Menzel Change-Id: I2750d30119fee01baf4748d8001a672d18a13fb0 Reviewed-on: https://chromium-review.googlesource.com/414550 Commit-Ready: Furquan Shaikh Tested-by: Furquan Shaikh Reviewed-by: Aaron Durbin --- src/arch/x86/gdt.c | 4 ++++ 1 file changed, 4 insertions(+) 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));