diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2022-11-10 13:34:49 +0100 |
---|---|---|
committer | Arthur Heymans <arthur@aheymans.xyz> | 2022-11-12 14:23:51 +0000 |
commit | d4dfc21f70616bc97191969aa2b6d0196a525fce (patch) | |
tree | 7c4944b9f923710316df04bfa06f97005c9ca03b /src/arch/x86/c_start.S | |
parent | 407e00dca06e36d2d9b11f998a278109ff330783 (diff) |
cpu/x86: Set thread local storage in C code
Doing this in C code is way easier to understand. Also the thread local
storage is now in .bss instead of the AP stack. This makes it more
robust against stack overflows, as APs stacks overflow in each other.
TESTED: work on qemu.
Change-Id: I19d3285daf97798a2d28408b5601ad991e29e718
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69435
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch/x86/c_start.S')
-rw-r--r-- | src/arch/x86/c_start.S | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/arch/x86/c_start.S b/src/arch/x86/c_start.S index 02a9b8933a..5b7052ef58 100644 --- a/src/arch/x86/c_start.S +++ b/src/arch/x86/c_start.S @@ -1,6 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#include <cpu/x86/cpu_info.S.inc> #include <cpu/x86/post_code.h> #include <arch/ram_segs.h> @@ -78,21 +77,6 @@ _start: movl $_estack, %esp andl $(~(CONFIG_STACK_SIZE-1)), %esp - push_cpu_info - - /* Allocate the per_cpu_segment_data on the stack */ - push_per_cpu_segment_data - - /* - * Update the BSP's per_cpu_segment_descriptor to point to the - * per_cpu_segment_data that was allocated on the stack. - */ - set_segment_descriptor_base $per_cpu_segment_descriptors, %esp - - mov $per_cpu_segment_selector, %eax - movl (%eax), %eax - mov %eax, %gs - /* * Now we are finished. Memory is up, data is copied and * bss is cleared. Now we call the main routine and |