From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.zytor.com (terminus.zytor.com [65.50.211.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E41D321967BE3 for ; Tue, 6 Jun 2017 14:22:37 -0700 (PDT) Received: from [IPv6:2607:fb90:a6b8:4699:dd98:d3be:7336:c13d] ([172.58.39.94]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id v56LLStN006840 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Jun 2017 14:21:29 -0700 Date: Tue, 06 Jun 2017 14:21:18 -0700 User-Agent: K-9 Mail for Android In-Reply-To: References: <1495473154-18184-1-git-send-email-michael.d.kinney@intel.com> <542CF652F8836A4AB8DBFAAD40ED192A4C5E8084@shsmsx102.ccr.corp.intel.com> <629c1154-77c8-07cf-131e-cdc64300245c@zytor.com> <7A0046FF-FF4E-44FA-9A6F-D2765E07DAA1@apple.com> MIME-Version: 1.0 To: Andrew Fish CC: "Fan, Jeff" , Mike Kinney , "edk2-devel@lists.01.org" From: hpa@zytor.com Message-ID: <1B7E64B9-5B5B-4F68-BB5E-62A8F0A3643E@zytor.com> Subject: Re: [Patch V2] UefiCpuPkg/MpInitLib: Fix X64 XCODE5/NASM compatibility issues X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jun 2017 21:22:38 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On June 6, 2017 2:15:08 PM PDT, Andrew Fish wrote: > >> On Jun 6, 2017, at 2:05 PM, hpa@zytor=2Ecom wrote: >>=20 >> On June 6, 2017 1:49:34 PM PDT, Andrew Fish wrote: >>>=20 >>>> On Jun 6, 2017, at 12:41 PM, H=2E Peter Anvin wrote= : >>>>=20 >>>> On 05/22/17 19:08, Fan, Jeff wrote: >>>>>=20 >>>>> diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs=2Enasm >>> b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs=2Enasm >>>>> index fa54d01=2E=2E0b14a53 100644 >>>>> --- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs=2Enasm >>>>> +++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs=2Enasm >>>>> @@ -1,5 +1,5 @@ >>>>>=20 >>> >;------------------------------------------------------------------------= ------ >>> ; -; Copyright (c) 2015 - 2016, Intel Corporation=2E All rights >>> reserved=2E
>>>>> +; Copyright (c) 2015 - 2017, Intel Corporation=2E All rights=20 >>>>> +reserved=2E
>>>>> ; This program and the accompanying materials ; are licensed and >>> made available under the terms and conditions of the BSD License ; >>> which accompanies this distribution=2E The full text of the license >may >>> be found at @@ -201,7 +201,7 @@ CProcedureInvoke: >>>>> push rbp >>>>> mov rbp, rsp >>>>>=20 >>>>> - mov rax, ASM_PFX(InitializeFloatingPointUnits) >>>>> + mov rax, qword [esi + >>> InitializeFloatingPointUnitsAddress] >>>=20 >>> Does nasm remove the need for the ASM_PFX() macro? That macro hides >if >>> C is decorating with a _ prefix=2E=20 >>>=20 >>> Also given it is a #define (equ) why do we use camel case vs=2E all >caps? >>>=20 >>> Thanks, >>>=20 >>> Andrew Fish >>>=20 >>>>> sub rsp, 20h >>>>> call rax ; Call assembly function to >>> initialize FPU per UEFI spec >>>>> add rsp, 20h >>>>=20 >>>> FYI, the qword specifier is unnecessary since you are already >>> specifying >>>> rax=2E >>>>=20 >>>> However, why not simply drop the use of rax entirely and do: >>>>=20 >>>> call [esi + InitializeFloatingPointUnitsAddress] >>>>=20 >>>> (Also: is this *really* supposed to be esi and not rsi? The former >>>> means a 32-bit address=2E) >>>>=20 >>>> -hpa >>>> _______________________________________________ >>>> edk2-devel mailing list >>>> edk2-devel@lists=2E01=2Eorg >>>> https://lists=2E01=2Eorg/mailman/listinfo/edk2-devel >>=20 >> The NASM command-line option --prefix _ should do exactly that=2E > >How does it know when to prefix the _? That could break dead stripping >with the Xcode linker=2E L is used to imply local symbol, don't dead >strip=2E=20 > >Thanks, > >Andrew Fish > >> --=20 >> Sent from my Android device with K-9 Mail=2E Please excuse my brevity= =2E It appends the underscore to global or external variables=2E --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E