From b9d56d0b93ae4827bb447ff4a32f1f7ab46ccd94 Mon Sep 17 00:00:00 2001 From: Jeff Fan Date: Tue, 21 Feb 2017 11:29:45 +0800 Subject: [PATCH] UefiCpuPkg/ExceptionHandlerAsm.S: Fix code length issue with GCC 5.4 X64\ExceptionHandlerAsm.S define MARCO to set up 32 IDT entries header. It assume GCC compiler will generate the same code length on the following instrction for each IDT entry. jmp ASM_PFX(CommonInterruptEntry) It works with GCC 4.x. However, GCC 5.4 will generate different code size of IDT entry code per the offset value from CommonInterruptEntry address. We should use DB to make sure each IDT entry header has the same size whatever compiler version. .ASM and .nasm used the different solution and do not have this issue. https://bugzilla.tianocore.org/show_bug.cgi?id=389 Cc: Liming Gao Cc: Feng Tian Cc: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Liming Gao --- .../Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S index 6b62f095bd..975adaa103 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ ; -# Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -36,7 +36,8 @@ ASM_GLOBAL ASM_PFX(CommonExceptionHandler) .macro IDT_MACRO arg push \arg #endif - jmp ASM_PFX(CommonInterruptEntry) + .byte 0xe9 # jmp ASM_PFX(CommonInterruptEntry) + .long ASM_PFX(CommonInterruptEntry) - . - 4 .endm AsmIdtVectorBegin: -- 2.39.2