From ebbd12f8bcfb1f21db7991c5272515fb76600b66 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Sat, 19 Nov 2016 10:06:00 -0600 Subject: arch/x86: don't create new gdt in cbmem for relocatable ramstage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/17504 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki Reviewed-by: Paul Menzel --- src/arch/x86/gdt.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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)); -- cgit v1.2.3