Hi Ray,

Definitely - this is just an optimisation “while we’re at it“, nothing urgent.

Best regards,
Marvin

> On 31. Mar 2023, at 07:09, Ni, Ray <ray...@intel.com> wrote:
> 
> 
> 
> diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionH=
> andlerAsm.nasm b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHan=
> dlerAsm.nasm
> similarity index 92%
> rename from UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHa=
> ndlerAsm.nasm
> rename to UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm=
> .nasm
> index 957478574253e619..10af4cfcdb6b1ea2 100644
> --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/Xcode5ExceptionHandlerA=
> sm.nasm
> +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
> @@ -59,7 +59,7 @@ AsmIdtVectorBegin:
> %rep 256=0D
> push strict dword %[Vector] ; This instruction pushes sign-extended=
> 8-byte value on stack=0D
> push rax=0D
> - mov rax, strict qword 0 ; mov rax, ASM_PFX(CommonInterruptE=
> ntry)=0D
> + mov rax, ASM_PFX(CommonInterruptEntry)=0D
> I'm fairly certain this can be a relative reference, as the code doesn't seem 
> to be copied away (as opposed to HookAfterStubHeaderBegin). If true, this 
> would save 256 relocs, which sounds quite nice. Would you mind verifying? 
> Thanks!
> 
> Marvin,
> 
> You are right the mov can be replaced with “lea”. But, we need to analyze if 
> using lea, the size of each idt stub is fixed or variant (today the size is 
> fixed, so StubSize = TotalSize / 256).
> 
> Another thing we need to evaluate is the impact to “Hook after” feature 
> because “hook after” stub is very like the idt stub.
> 
> I think we can firstly use Ard’s solution. Later to evaluate to eliminate 
> unnecessary absolute reference.
> 
> Thanks,
> 
> Ray


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102250): https://edk2.groups.io/g/devel/message/102250
Mute This Topic: https://groups.io/mt/97960766/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to