From 173c5d0aad8c0d327bfe55a0436369c48d4fa3ac Mon Sep 17 00:00:00 2001 From: NyeonWoo Kim Date: Sat, 5 Apr 2025 19:44:56 +0900 Subject: [PATCH] src/arch/x86/c_start: Delete duplicated code masking stack pointer I found duplicated code masking stack pointer. So, i'd like to remove the duplicate for refactoring :-). This is my build output of c_start.o, before vs after modifying. before modifying ... 44: f3 ab rep stos %eax,%es:(%edi) 46: bc 00 00 00 00 mov $0x0,%esp 4b: 83 e4 f0 and $0xfffffff0,%esp 4e: b0 6e mov $0x6e,%al 50: e6 80 out %al,$0x80 52: 83 e4 f0 and $0xfffffff0,%esp // deleted. 55: e8 fc ff ff ff call 56 <_start+0x56> ... after modifying ... 44: f3 ab rep stos %eax,%es:(%edi) 46: bc 00 00 00 00 mov $0x0,%esp 4b: 83 e4 f0 and $0xfffffff0,%esp 4e: b0 6e mov $0x6e,%al 50: e6 80 out %al,$0x80 52: e8 fc ff ff ff call 53 <_start+0x53> ... P.S. it is commits which introduced duplication. 32bit : 4d75dbd1c1d 64bit : 1c4c7ad1e5a Change-Id: I417ce90279fea4b00432e6a209f77a6dd0c0fee6 Signed-off-by: NyeonWoo Kim Reviewed-on: https://review.coreboot.org/c/coreboot/+/87181 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph --- src/arch/x86/c_start.S | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/arch/x86/c_start.S b/src/arch/x86/c_start.S index 94b9bd9fa5..fd61cab44d 100644 --- a/src/arch/x86/c_start.S +++ b/src/arch/x86/c_start.S @@ -101,13 +101,6 @@ _start: */ post_code(POSTCODE_PRE_HARDWAREMAIN) /* post 6e */ -#if ENV_X86_64 - movq $0xFFFFFFFFFFFFFFF0, %rax - and %rax, %rsp -#else - andl $0xFFFFFFF0, %esp -#endif - #if CONFIG(ASAN_IN_RAMSTAGE) call asan_init #endif