public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Kinney, Michael D" <michael.d.kinney@intel.com>
To: "H. Peter Anvin" <hpa@zytor.com>,
	"Fan, Jeff" <jeff.fan@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@ml01.01.org>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: Andrew Fish <afish@apple.com>
Subject: Re: [Patch V2] UefiCpuPkg/MpInitLib: Fix X64 XCODE5/NASM compatibility issues
Date: Tue, 13 Jun 2017 23:15:49 +0000	[thread overview]
Message-ID: <E92EE9817A31E24EB0585FDF735412F5A7D35161@ORSMSX113.amr.corp.intel.com> (raw)
In-Reply-To: <629c1154-77c8-07cf-131e-cdc64300245c@zytor.com>

hpa,

Use of esi is on purpose.  esi is the base address of a structure and 
it is consistently used as a 32-bit value in all 3 execution modes in
this file.

I agree we can remove the qword specifier as a cleaner style.

Also, as we consolidate on NASM sources, we can see if ASM_PFX() can be
dropped completely.  That would be another good clean up.

I also agree that the mov and call can be reduced to a single call 
instruction.  Another good cleanup.

There are many more NASM source files that need to be updated to be 
compatible with XCODE5 tool chain.  We are continuing to work on those
updates.

Thanks,

Mike


-----Original Message-----
From: H. Peter Anvin [mailto:hpa@zytor.com] 
Sent: Tuesday, June 6, 2017 12:42 PM
To: Fan, Jeff <jeff.fan@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; edk2-devel@lists.01.org <edk2-devel@ml01.01.org>
Cc: Andrew Fish <afish@apple.com>
Subject: Re: [edk2] [Patch V2] UefiCpuPkg/MpInitLib: Fix X64 XCODE5/NASM compatibility issues

On 05/22/17 19:08, Fan, Jeff wrote:
>  
> diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
> index fa54d01..0b14a53 100644
> --- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
> +++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
> @@ -1,5 +1,5 @@
>  ;------------------------------------------------------------------------------ ; -; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
> +; Copyright (c) 2015 - 2017, Intel Corporation. All rights 
> +reserved.<BR>
>  ; 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 @@ -201,7 +201,7 @@ CProcedureInvoke:
>      push       rbp
>      mov        rbp, rsp
>  
> -    mov        rax, ASM_PFX(InitializeFloatingPointUnits)
> +    mov        rax, qword [esi + InitializeFloatingPointUnitsAddress]
>      sub        rsp, 20h
>      call       rax               ; Call assembly function to initialize FPU per UEFI spec
>      add        rsp, 20h

FYI, the qword specifier is unnecessary since you are already specifying
rax.

However, why not simply drop the use of rax entirely and do:

	call [esi + InitializeFloatingPointUnitsAddress]

(Also: is this *really* supposed to be esi and not rsi?  The former
means a 32-bit address.)

	-hpa

      parent reply	other threads:[~2017-06-13 23:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 17:12 [Patch V2] UefiCpuPkg/MpInitLib: Fix X64 XCODE5/NASM compatibility issues Michael Kinney
2017-05-22 17:14 ` Andrew Fish
2017-05-23  2:08 ` Fan, Jeff
2017-06-06 19:41   ` H. Peter Anvin
2017-06-06 20:49     ` Andrew Fish
2017-06-06 21:05       ` hpa
2017-06-06 21:15         ` Andrew Fish
2017-06-06 21:21           ` hpa
2017-06-13 23:15     ` Kinney, Michael D [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E92EE9817A31E24EB0585FDF735412F5A7D35161@ORSMSX113.amr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox