From nobody Mon May 6 15:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 151804348492456.54100212039316; Wed, 7 Feb 2018 14:44:44 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6695C222DE139; Wed, 7 Feb 2018 14:38:59 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 30BDD222DE137 for ; Wed, 7 Feb 2018 14:38:58 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 13E41BDEA; Wed, 7 Feb 2018 22:44:42 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-123.phx2.redhat.com [10.3.117.123]) by smtp.corp.redhat.com (Postfix) with ESMTP id D98F85D6A8; Wed, 7 Feb 2018 22:44:40 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Wed, 7 Feb 2018 23:44:34 +0100 Message-Id: <20180207224435.10730-2-lersek@redhat.com> In-Reply-To: <20180207224435.10730-1-lersek@redhat.com> References: <20180207224435.10730-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 07 Feb 2018 22:44:42 +0000 (UTC) Subject: [edk2] [PATCH v2 1/2] ShellPkg/UefiShellDebug1CommandsLib: sync Compress() definition with decl. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaben Carsey , Ruiyu Ni , Gary Lin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" "Compress.h" declares the Compress() function as EFIAPI, but the definition in "Compress.c" lacks EFIAPI. GCC toolchains without LTO do not catch this error because "Compress.c" does not include "Compress.h"; i.e. the declaration used by callers such as "EfiCompress.c" is not actually matched against the function definition at build time. With LTO enabled, the mismatch is found -- however, as a warning only, due to commit f8d0b9662993 ("BaseTools GCC5: disable warnings-as-errors for now", 2016-08-03). Include the header in the C file (which turns the issue into a hard build error on all GCC toolchains), plus sync the declaration from the header file to the C file. Finally, remove EFIAPI from both declaration and definition -- this was the original intent of commit c4e74e9b814c ("ShellPkg/UefiShellDebug1CommandsLib: Remove unnecessary EFIAPI", 2016-10-09), but it missed the header file. (Gary meant to address that omission in Oct 2017: [edk2] [PATCH] ShellPkg/UefiShellDebug1CommandsLib: Remove EFIAPI from Compress() http://mid.mail-archive.com/20171026065329.32311-1-glin@suse.com and Ray reviewed the patch, but then the patch was never committed.) So do the sync and drop EFIAPI now. This happens to fix the EFICOMPRESS shell command, when built with GCC for X64. Cc: Gary Lin Cc: Jaben Carsey Cc: Ruiyu Ni Fixes: c4e74e9b814cfb4b51cf832f3bb218cd2aba348b Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by Gary Lin Reviewed-by: Jaben Carsey --- Notes: v2: - drop EFIAPI based on Gary's earlier patch which I just stumbled upon - do not pick up Jaben's R-b from v1, due to inverted EFIAPI handling - add "Fixes:" tag ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h | 1 - ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c | 14 ++++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h b/Shell= Pkg/Library/UefiShellDebug1CommandsLib/Compress.h index 39a997178fb7..7fe844e212a8 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.h @@ -28,7 +28,6 @@ @retval EFI_BUFFER_TOO_SMALL The buffer was too small. DstSize is requ= ired. **/ EFI_STATUS -EFIAPI Compress ( IN VOID *SrcBuffer, IN UINT64 SrcSize, diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c b/Shell= Pkg/Library/UefiShellDebug1CommandsLib/Compress.c index 736d2a35b3ac..cde2c54f1b45 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c @@ -23,6 +23,8 @@ #include #include =20 +#include "Compress.h" + // // Macro Definitions // @@ -1307,20 +1309,20 @@ Encode ( The compression routine. =20 @param[in] SrcBuffer The buffer containing the source data. - @param[in] SrcSize The number of bytes in SrcBuffer. + @param[in] SrcSize Number of bytes in SrcBuffer. @param[in] DstBuffer The buffer to put the compressed image in. @param[in, out] DstSize On input the size (in bytes) of DstBuffer= , on - return the number of bytes placed in DstBu= ffer. + return the number of bytes placed in DstB= uffer. =20 @retval EFI_SUCCESS The compression was sucessful. @retval EFI_BUFFER_TOO_SMALL The buffer was too small. DstSize is requ= ired. **/ EFI_STATUS Compress ( - IN VOID *SrcBuffer, - IN UINT64 SrcSize, - IN VOID *DstBuffer, - IN OUT UINT64 *DstSize + IN VOID *SrcBuffer, + IN UINT64 SrcSize, + IN VOID *DstBuffer, + IN OUT UINT64 *DstSize ) { EFI_STATUS Status; --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Mon May 6 15:40:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1518043487106837.0422457293031; Wed, 7 Feb 2018 14:44:47 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D0614222DE137; Wed, 7 Feb 2018 14:39:01 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 A4DCA222DE13B for ; Wed, 7 Feb 2018 14:38:59 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A850EC0587CA; Wed, 7 Feb 2018 22:44:43 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-123.phx2.redhat.com [10.3.117.123]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D4455D6A8; Wed, 7 Feb 2018 22:44:42 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org From: Laszlo Ersek To: edk2-devel@lists.01.org Date: Wed, 7 Feb 2018 23:44:35 +0100 Message-Id: <20180207224435.10730-3-lersek@redhat.com> In-Reply-To: <20180207224435.10730-1-lersek@redhat.com> References: <20180207224435.10730-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 07 Feb 2018 22:44:43 +0000 (UTC) Subject: [edk2] [PATCH v2 2/2] OvmfPkg/PlatformPei: sync AmdSevInitialize() definition with declaration X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen , Brijesh Singh , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" "Platform.h" declares the AmdSevInitialize() function without EFIAPI, but the definition in "AmdSev.c" includes EFIAPI. GCC toolchains without LTO do not catch this error because "AmdSev.c" does not include "Platform.h"; i.e. the declaration used by callers such as "Platform.c" is not actually matched against the function definition at build time. With LTO enabled, the mismatch is found -- however, as a warning only, due to commit f8d0b9662993 ("BaseTools GCC5: disable warnings-as-errors for now", 2016-08-03). Include the header in the C file (which turns the issue into a hard build error on all GCC toolchains), plus sync the declaration from the header file to the C file. There's been no functional breakage because AmdSevInitialize() takes no parameters. Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Jordan Justen Fixes: 13b5d743c87a22dfcd94e8475d943dee5712b62d Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Brijesh Singh Reviewed-by: Jaben Carsey Acked-by: Ard Biesheuvel --- Notes: v2: - no code changes, just pick up feedback tags - add "Fixes:" tag to the commit message OvmfPkg/PlatformPei/AmdSev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index 1539e5b5cdce..ad31b69fb032 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -23,6 +23,8 @@ #include #include =20 +#include "Platform.h" + /** =20 Function checks if SEV support is available, if present then it sets @@ -30,7 +32,6 @@ =20 **/ VOID -EFIAPI AmdSevInitialize ( VOID ) --=20 2.14.1.3.gb7cf6e02401b _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel