Jordan: I want to keep the same behavior with current Thunkt16.asm, because they have been verified for long time. So, I suggest to remove nop from 32bit Thunk16.nasm, and keep nop for x64bit Thunk16.nasm.
Thanks Liming -----Original Message----- From: Jordan Justen [mailto:jljus...@gmail.com] Sent: Friday, August 22, 2014 9:04 AM To: edk2-devel@lists.sourceforge.net Subject: Re: [edk2] [PATCH 5/8] MdePkg/BaseLib Thunk16: Replace X64 GAS Thunk16 with NASM version On Thu, Aug 21, 2014 at 5:09 PM, Gao, Liming <liming....@intel.com> wrote: > Jordan: > Another question. Why you put some nop opcode in Thunk16.nasm code? > 32bit Thunk16.nasm has one nop. 64bit Thunk16.nasm have two nop. In MdePkg/Library/BaseLib/X64/Thunk16.asm, see: @64BitCode: db 090h db 048h, 0bch ; mov rsp, imm64 SavedSp DQ ? ; restore stack nop db 090h is a nop, so that is why there are 2 for X64. For IA32, I don't remember why. I suspect I may have added it while debugging and I forgot it. Do you think it is safe to remove both in X64/Thunk16.nasm? -Jordan > -----Original Message----- > From: Jordan Justen [mailto:jljus...@gmail.com] > Sent: Thursday, August 21, 2014 9:13 AM > To: edk2-devel@lists.sourceforge.net > Subject: Re: [edk2] [PATCH 5/8] MdePkg/BaseLib Thunk16: Replace X64 > GAS Thunk16 with NASM version > > On Wed, Aug 20, 2014 at 2:40 PM, Mike Maslenkin <miha...@parallels.com> wrote: >> Hello Jordan ! >> build -p build -p >> IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc >> -a X64 >> told me about next errors: >> >> Building ... >> /home/mg/sources/jljusten/edk2/MdePkg/Library/BaseReportStatusCodeLib >> N ull/BaseReportStatusCodeLibNull.inf [X64] >> /home/mg/sources/jljusten/edk2/Build/IntelFrameworkModuleAll/DEBUG_GC >> C >> 47/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/X64/Thunk16.iii:193: >> error: segment alignment `0x8' is not power of two >> make: *** >> [/home/mg/sources/jljusten/edk2/Build/IntelFrameworkModuleAll/DEBUG_G >> C C47/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/X64/Thunk16.obj] >> Error 1 >> >> /home/mg/sources/jljusten/edk2/Build/IntelFrameworkModuleAll/DEBUG_GC >> C >> 47/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/X64/Thunk16.iii:240: >> error: invalid combination of opcode and operands >> /home/mg/sources/jljusten/edk2/Build/IntelFrameworkModuleAll/DEBUG_GC >> C >> 47/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/X64/Thunk16.iii:242: >> error: invalid combination of opcode and operands >> /home/mg/sources/jljusten/edk2/Build/IntelFrameworkModuleAll/DEBUG_GC >> C >> 47/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/X64/Thunk16.iii:244: >> error: invalid combination of opcode and operands >> /home/mg/sources/jljusten/edk2/Build/IntelFrameworkModuleAll/DEBUG_GC >> C >> 47/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/X64/Thunk16.iii:310: >> error: invalid combination of opcode and operands >> /home/mg/sources/jljusten/edk2/Build/IntelFrameworkModuleAll/DEBUG_GC >> C >> 47/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/X64/Thunk16.iii:312: >> error: invalid combination of opcode and operands >> /home/mg/sources/jljusten/edk2/Build/IntelFrameworkModuleAll/DEBUG_GC >> C >> 47/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/X64/Thunk16.iii:314: >> error: invalid combination of opcode and operands >> make: *** >> [/home/mg/sources/jljusten/edk2/Build/IntelFrameworkModuleAll/DEBUG_G >> C C47/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/X64/Thunk16.obj] >> Error 1 >> >> The last errors come from this >> +global ASM_PFX(InternalAsmThunk16) >> +ASM_PFX(InternalAsmThunk16): >> <skip> >> >> >> ^^^^^^^^^^^^^^^^^^^^^^^ >>> + push rbx ; Save ds segment register on the stack >>> + mov rbx, es >>> ^^^^^^^^^^^^^^^^^^^^^^^ >>> + push rbx ; Save es segment register on the stack >>> + mov rbx, ss >> ^^^^^^^^^^^^^^^^^^^^^^^ >>> + push rbx ; Save ss segment register on the stack >> <skip> >> >>> + mov ss, rbx >>> ^^^^^^^^^^^^^^^^^^^^^^^ >>> + pop rbx >>> + mov es, rbx >> ^^^^^^^^^^^^^^^^^^^^^^^ >>> + pop rbx >>> + mov ds, rbx >> ^^^^^^^^^^^^^^^^^^^^^^^ >> >> >> Initially I used a NASM version used in our build system. Do not know >> for where we got it but it reported itself as NASM version 2.09.04 >> >> After that I installed a default NASM that comes with openSuSE 12.2: >> NASM version 2.09.08 compiled on Jun 16 2011 >> >> I got same errors. >> So, please clarify which minimal version of NASM is required. > > I did put NASM 2.03 in the tools_def (which was taken from VTF0), but I was > testing with 2.11. > > I'll try with 2.03 to make sure we can actually support that version. > > -Jordan > > ---------------------------------------------------------------------- > -------- > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/edk2-devel > > ---------------------------------------------------------------------- > -------- > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel