public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: "Gao, Liming" <liming.gao@intel.com>,
	Chao Zhang <chao.b.zhang@intel.com>,
	 David Wei <david.wei@intel.com>,
	"Guo, Mang" <mang.guo@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	"Justen, Jordan L" <jordan.l.justen@intel.com>,
	"edk2-devel@ml01.01.org" <edk2-devel@ml01.01.org>
Subject: Re: [PATCH 0/4] Fix runtime issue in XenBusDxe when compiled with GCC5
Date: Thu, 23 Feb 2017 12:43:58 +0000	[thread overview]
Message-ID: <20170223124358.GE1867@perard.uk.xensource.com> (raw)
In-Reply-To: <3250749d-e8b3-3143-734f-a922e15e3c91@redhat.com>

On Thu, Feb 23, 2017 at 11:19:03AM +0100, Laszlo Ersek wrote:
> On 02/22/17 09:54, Gao, Liming wrote:
> > Laszlo:
> > In edk2, I find the several functions with VA_LIST have no EFIAPI.
> > They may use VA_ARG() or call other functions, but they don't use
> > VA_COPY(). In Base.h, VA_ARG() is defined as __builtin_va_arg(),
> > which is same to native one.
> 
> You are right; apparently __builtin_va_arg() works with __builtin_ms_va_list and __builtin_va_list alike.
> 
> However, as you say,
> 
> > VA_COPY() is defined as
> > __builtin_ms_va_copy(). So, I also think this is MS ABI request. That
> > means only if the function implementation uses VA_START(),VA_END() or
> > VA_COPY(), it must be declared with EFIAPI.
> 
> - __builtin_va_start / __builtin_ms_va_start,
> - __builtin_va_end / __builtin_ms_va_end,
> - __builtin_va_copy / __builtin_ms_va_copy
> 
> must be matched to __builtin_va_list vs. __builtin_ms_va_list.
> 
> > 
> > MdePkg\Library\BasePrintLib\PrintLibInternal.c BasePrintLibSPrintMarker()
> > ShellPkg\Library\UefiShellLib\UefiShellLib.c InternalShellPrintWorker()
> 
> Yes, you are right -- when looking for functions that should be made EFIAPI, we shouldn't search for VA_LIST, but VA_START|VA_END|VA_COPY.
> 
> Thanks for the correction.
> 
> The following command is a good start:
> 
>   git grep -E -n '\<(VA_START|VA_END|VA_COPY)\>|^[A-Za-z0-9_]' \
>   | grep -E -B 3 '\<(VA_START|VA_END|VA_COPY)\>'
> 
> I just went over the output (it was gruesome), and -- outside of EdkCompatibilityPkg -- I indeed found only a handful of affected functions:
> 
> - XenStoreVSPrint()         [OvmfPkg/XenBusDxe/XenStore.c]
> - VariableGetBestLanguage() [SecurityPkg/VariableAuthenticated/EsalVariableDxeSal/Variable.c]
> - SmmBootScriptWrite()      [Vlv2TbltDevicePkg/PlatformSmm/SmmScriptSave.c]
> 
> Anthony, can you please submit the patch for XenStoreVSPrint()?

Done.

Thanks,

-- 
Anthony PERARD


  reply	other threads:[~2017-02-23 12:43 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01 15:28 [PATCH 0/4] Fix runtime issue in XenBusDxe when compiled with GCC5 Anthony PERARD
2016-12-01 15:28 ` [PATCH 1/4] OvmfPkg/XenHypercallLib: Add EFIAPI Anthony PERARD
2016-12-01 15:28 ` [PATCH 2/4] OvmfPkg/XenBusDxe: Add EFIAPI to XenEventChannelNotify Anthony PERARD
2016-12-01 15:28 ` [PATCH 3/4] OvmfPkg/XenBusDxe: Add EFIAPI to XenStore functions Anthony PERARD
2016-12-01 15:28 ` [PATCH 4/4] OvmfPkg/XenBusDxe: Add EFIAPI to XenGrantTable{Grant, End}Access Anthony PERARD
2016-12-01 18:43 ` [PATCH 0/4] Fix runtime issue in XenBusDxe when compiled with GCC5 Laszlo Ersek
2016-12-01 20:06   ` Jordan Justen
2016-12-01 20:54     ` Laszlo Ersek
2016-12-02  0:58       ` Jordan Justen
2016-12-02  9:45         ` Laszlo Ersek
2016-12-02  4:36   ` Gao, Liming
2016-12-02 10:00     ` Laszlo Ersek
2016-12-02 16:02   ` Anthony PERARD
2016-12-02 19:26     ` Laszlo Ersek
2016-12-03 17:59       ` Laszlo Ersek
2016-12-05  2:55         ` Gao, Liming
2016-12-05 10:09           ` Laszlo Ersek
2017-02-21 16:39         ` Anthony PERARD
2017-02-21 17:07           ` Laszlo Ersek
2017-02-21 17:53             ` Anthony PERARD
2017-02-21 19:02               ` Laszlo Ersek
2017-02-21 19:08                 ` Rebecca Cran
2017-02-21 22:45                   ` Jordan Justen
2017-02-21 23:59                     ` Laszlo Ersek
2017-02-22 14:16                       ` Gao, Liming
2017-02-22  8:54                 ` Gao, Liming
2017-02-23 10:19                   ` Laszlo Ersek
2017-02-23 12:43                     ` Anthony PERARD [this message]
2017-02-23 13:00                     ` 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=20170223124358.GE1867@perard.uk.xensource.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