public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Andrew Fish <afish@apple.com>
To: Shenglei Zhang <shenglei.zhang@intel.com>
Cc: edk2-devel-01 <edk2-devel@lists.01.org>,
	Mike Kinney <michael.d.kinney@intel.com>,
	Liming Gao <liming.gao@intel.com>
Subject: Re: [PATCH 3/3] MdePkg/BaseSynchronizationLib: Remove inline X86 assembly code
Date: Tue, 05 Mar 2019 12:57:45 -0800	[thread overview]
Message-ID: <C7542524-066B-4DC6-A2D8-B02EF3338042@apple.com> (raw)
In-Reply-To: <20190305014059.17988-4-shenglei.zhang@intel.com>

Shenglei,

I was confused by the names of these patches. From a C point of view this is inline assembly:

VOID
EFIAPI
CpuBreakpoint (
VOID
)
{
__asm__ __volatile__ ("int $3");
}

These patches seem to be removing GAS and MASM assembly files, but not the inline assembly *.c files?

We don't want to remove the inline assembly from the BaseLib as that could have size, performance, and compiler optimization impact. 

For example CpuBreakpoint() for clang with LTO would end up inlining a single byte. For i385 a call to assembler would be 5 bytes at each call location plus the overhead of the function. So that is a size increase and a performance overhead. For a C complier calling an assembly function is a serializing event an that can restrict optimizations. Thus having some limited inline assembly support is very useful. 

Thanks,

Andrew Fish

> On Mar 4, 2019, at 5:40 PM, Shenglei Zhang <shenglei.zhang@intel.com> wrote:
> 
> MdePkg BaseSynchronizationLib still uses the inline X86 assembly code
> in C code files.It should be updated to consume nasm only.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1163
> 
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
> .../Library/BaseSynchronizationLib/BaseSynchronizationLib.inf   | 2 --
> 1 file changed, 2 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf b/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
> index 32414b29fa..719dc1938d 100755
> --- a/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
> +++ b/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
> @@ -75,13 +75,11 @@
> 
> [Sources.ARM]
> Synchronization.c
> -  Arm/Synchronization.asm       | RVCT
> Arm/Synchronization.S         | GCC
> 
> [Sources.AARCH64]
> Synchronization.c
> AArch64/Synchronization.S     | GCC
> -  AArch64/Synchronization.asm   | MSFT
> 
> [Packages]
> MdePkg/MdePkg.dec
> -- 
> 2.18.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel



  reply	other threads:[~2019-03-05 20:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05  1:40 [PATCH 0/3] MdePkg: Remove inline X86 assembly code Shenglei Zhang
2019-03-05  1:40 ` [PATCH 1/3] MdePkg/BaseCpuLib: " Shenglei Zhang
2019-03-05  1:40 ` [PATCH 2/3] MdePkg/BaseLib: " Shenglei Zhang
2019-03-05  1:40 ` [PATCH 3/3] MdePkg/BaseSynchronizationLib: " Shenglei Zhang
2019-03-05 20:57   ` Andrew Fish [this message]
2019-03-05 21:32     ` Gao, Liming
2019-03-05 21:45       ` Kinney, Michael D
2019-03-05 22:43       ` Andrew Fish
2019-03-07  0:28         ` Gao, Liming
2019-03-07  0:41           ` Kinney, Michael D
2019-03-07  1:31             ` Andrew Fish
2019-03-07  5:06               ` Yao, Jiewen
2019-03-07  5:56                 ` Andrew Fish
2019-03-07  6:09                   ` Yao, Jiewen
2019-03-07  6:45                     ` Andrew Fish
2019-03-07  7:15                       ` Gao, Liming
2019-03-07  7:25                         ` Yao, Jiewen
2019-03-09  0:07                           ` Kinney, Michael D
2019-03-09  0:15                             ` Andrew Fish
2019-03-14 22:27                               ` Gao, Liming
2019-03-05  2:10 ` [PATCH 0/3] MdePkg: " Gao, Liming

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=C7542524-066B-4DC6-A2D8-B02EF3338042@apple.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