From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 7F3C2D80A20 for ; Wed, 14 Feb 2024 14:27:23 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=rPc4CM+sFedZ+j9QOkG4fVkXwJr3KZznHqPBO/5TBIk=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20140610; t=1707920842; v=1; b=kp8q8ZTK/2I06fwgLk/bjBa7DCRlcizsEXk0k7ICSzMP8iDHMNjWUTVsgek8z8yWHN1ygsZD QjXJPN3qPxG4XHKC5fVKZ2nAwi22YMkfgekp13m6QbKznJYV93yLg1At81B/whs7MkzUALR/J27 ot9QbBKqj1m6lUARHXe1M7a8= X-Received: by 127.0.0.2 with SMTP id 0tEZYY7687511xQhs91O7uhK; Wed, 14 Feb 2024 06:27:22 -0800 X-Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by mx.groups.io with SMTP id smtpd.web10.42192.1707920841217993467 for ; Wed, 14 Feb 2024 06:27:21 -0800 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 3792FCE225F for ; Wed, 14 Feb 2024 14:27:19 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 774DAC43399 for ; Wed, 14 Feb 2024 14:27:18 +0000 (UTC) X-Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-511972043c3so2606085e87.1 for ; Wed, 14 Feb 2024 06:27:18 -0800 (PST) X-Gm-Message-State: K7ooDqLPUYGVOFUiuhSD8mRKx7686176AA= X-Google-Smtp-Source: AGHT+IGm++mWCD9P+Gi/DRkPQ7mnxU73uZYgRPHBCxdAo3Mo6Odr1n+Abiu1nyYJE0edusQt9/9VaJeGKtr87a9IuqM= X-Received: by 2002:ac2:5b10:0:b0:511:8c69:c53f with SMTP id v16-20020ac25b10000000b005118c69c53fmr2338388lfn.48.1707920836704; Wed, 14 Feb 2024 06:27:16 -0800 (PST) MIME-Version: 1.0 References: <36593e23-d3e8-b71a-808d-ef94260b5fd0@redhat.com> <20240207010437.105506-1-lersek@redhat.com> <20240207010437.105506-2-lersek@redhat.com> In-Reply-To: <20240207010437.105506-2-lersek@redhat.com> From: "Ard Biesheuvel" Date: Wed, 14 Feb 2024 15:27:05 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH 01/11] OvmfPkg/Sec: Use correct prototype of ProcessLibraryConstructorList() To: Laszlo Ersek Cc: edk2-devel-groups-io , Erdem Aktas , Gerd Hoffmann , Jiewen Yao , Michael Roth , Min Xu , Tom Lendacky Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=kp8q8ZTK; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) On Wed, 7 Feb 2024 at 02:04, Laszlo Ersek wrote: > > From: Ard Biesheuvel > > The prototype of ProcessLibraryConstructorList(), which is generated by > the build tools, depends on the boot phase, and SEC and PEI differ in > this regard. However, OVMF's SEC implemention includes PeimEntryPoint.h > and calls the PEI version of the protoype (passing NULL arguments), > whereas the actual implementation observed by the compiler follows the > SEC version, which takes VOID. > > The compiler usually doesn't spot the difference, but the LTO linker > does, and throws an error: > > MdePkg/Include/Library/PeimEntryPoint.h:74:1: error: type of 'ProcessLibraryConstructorList' does not match original declaration [-Werror=lto-type-mismatch] > 74 | ProcessLibraryConstructorList ( > | ^ > Build/OvmfX64/RELEASE_GCC5/X64/OvmfPkg/Sec/SecMain/DEBUG/AutoGen.c:310:1: note: type mismatch in parameter 1 > 310 | ProcessLibraryConstructorList ( > | ^ > Build/OvmfX64/RELEASE_GCC5/X64/OvmfPkg/Sec/SecMain/DEBUG/AutoGen.c:310:1: note: type 'void' should match type 'void *' > Build/OvmfX64/RELEASE_GCC5/X64/OvmfPkg/Sec/SecMain/DEBUG/AutoGen.c:310:1: note: 'ProcessLibraryConstructorList' was previously declared here > > Fix this by dropping the #include, and providing a declaration of > ProcessLibraryConstructorList() in SecMain.c > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4643 > Signed-off-by: Ard Biesheuvel > Message-Id: <20240202182455.1535328-1-ardb+git@google.com> > Cc: Ard Biesheuvel > Cc: Erdem Aktas > Cc: Gerd Hoffmann > Cc: Jiewen Yao > Cc: Michael Roth > Cc: Min Xu > Cc: Tom Lendacky > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990 > Signed-off-by: Laszlo Ersek Where appropriate in the series Reviewed-by: Ard Biesheuvel Thanks for cleaning this up. > --- > > Notes: > Picked up Ard's patch from the list with no changes. The URL is > ; see also the Message-Id > included by git-am in the commit message. > > This patch is necessary at the front of the series; otherwise a > subsequent patch causes a build error (conflicting prototypes). > > OvmfPkg/Sec/SecMain.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c > index 31da5d0ace51..7b7d4793984c 100644 > --- a/OvmfPkg/Sec/SecMain.c > +++ b/OvmfPkg/Sec/SecMain.c > @@ -11,7 +11,6 @@ > > #include > > -#include > #include > #include > #include > @@ -39,6 +38,12 @@ typedef struct _SEC_IDT_TABLE { > IA32_IDT_GATE_DESCRIPTOR IdtTable[SEC_IDT_ENTRY_COUNT]; > } SEC_IDT_TABLE; > > +VOID > +EFIAPI > +ProcessLibraryConstructorList ( > + VOID > + ); > + > VOID > EFIAPI > SecStartupPhase2 ( > @@ -844,7 +849,7 @@ SecCoreStartupWithStack ( > InitializeCpuExceptionHandlers (NULL); > } > > - ProcessLibraryConstructorList (NULL, NULL); > + ProcessLibraryConstructorList (); > > if (!SevEsIsEnabled ()) { > // > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115458): https://edk2.groups.io/g/devel/message/115458 Mute This Topic: https://groups.io/mt/104210775/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-