From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from SMTP02.CITRIX.COM (smtp02.citrix.com [66.165.176.63]) (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 D5D088216D for ; Thu, 23 Feb 2017 04:43:59 -0800 (PST) X-IronPort-AV: E=Sophos;i="5.35,197,1484006400"; d="scan'208";a="418044658" Date: Thu, 23 Feb 2017 12:43:58 +0000 From: Anthony PERARD To: Laszlo Ersek CC: "Gao, Liming" , Chao Zhang , David Wei , "Guo, Mang" , Ard Biesheuvel , "Justen, Jordan L" , "edk2-devel@ml01.01.org" Message-ID: <20170223124358.GE1867@perard.uk.xensource.com> References: <53c67cb5-e947-8979-7738-288cc83f374b@redhat.com> <20161202160201.GA1848@perard.uk.xensource.com> <9c0c9f43-a297-179f-2d57-fa5d8fab3763@redhat.com> <20170221163922.GC1867@perard.uk.xensource.com> <97214320-6054-8034-7667-6edde4debd80@redhat.com> <20170221175303.GD1867@perard.uk.xensource.com> <2a9ad7dd-fbeb-5a36-091f-d8592e95c509@redhat.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14D6E2BC3@shsmsx102.ccr.corp.intel.com> <3250749d-e8b3-3143-734f-a922e15e3c91@redhat.com> MIME-Version: 1.0 In-Reply-To: <3250749d-e8b3-3143-734f-a922e15e3c91@redhat.com> User-Agent: Mutt/1.7.2 (2016-11-26) Subject: Re: [PATCH 0/4] Fix runtime issue in XenBusDxe when compiled with GCC5 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2017 12:44:00 -0000 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline 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