From nobody Wed May 8 06:56:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78711+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78711+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1628175453; cv=none; d=zohomail.com; s=zohoarc; b=lYkFxvUO3FgXkA+nqTSGeyCSbpDVLLd3iIrgssPDbGY5M2bk+E0JGzAgjg4cIa9oVwiwliC1Wk7j2Qv/3rxU8YGVg3OUcfCxyZ5kFtPD1t37OlQinJEz2xuWaiBi0C77q3hzO+FcyRdDy4JPqUPDXDcA9WvQkVz2ZtPZckR3sSg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628175453; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ld4WDHW9ujuYmdHHje59MkH7KXOn3oVBZYOKDOZZJjU=; b=I/0XlUIoBEEIX93UqY5PkZUE1UY64NL5n3+zy78vyJ/+YNUh2mpONSy8LWlXbg2EGh5B5vcT3lxscFRWeFisMaYZ+P7WvZbxWJ9/KrCvtdl7H1syuGIjuUVA6GZvbsLQJV0d4Gan6/ZrEJKNsV5+5wkZNeM8FRemOF0P5cOUUdI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78711+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1628175453350131.76453542767842; Thu, 5 Aug 2021 07:57:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 82x9YY1788612xZnKOTirLKS; Thu, 05 Aug 2021 07:57:33 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.9902.1628175452546461631 for ; Thu, 05 Aug 2021 07:57:32 -0700 X-Received: from localhost.localdomain (unknown [167.220.2.74]) by linux.microsoft.com (Postfix) with ESMTPSA id 2AE0220B36EA; Thu, 5 Aug 2021 07:57:32 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2AE0220B36EA From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel] [edk2-platforms][PATCH v1 1/5] MinPlatformPkg/TestPointCheckLib: Fix MessageLength cast issue Date: Thu, 5 Aug 2021 10:57:02 -0400 Message-Id: <20210805145706.2470-2-mikuback@linux.microsoft.com> In-Reply-To: <20210805145706.2470-1-mikuback@linux.microsoft.com> References: <20210805145706.2470-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,mikuback@linux.microsoft.com X-Gm-Message-State: QDgBdUqTaMwaYRA1JdF9NhlCx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1628175453; bh=YDTGy+kTx+mImBDacUogsojGox5KjdR8QdH5AeDyOy0=; h=Cc:Date:From:Reply-To:Subject:To; b=jk7hWc7f0mHDRf1Ovt6uzayhbHdN8i+gO/vAbW2rHR7YtW9pBXltw4zf1UtdnRRpLwf NqQ9HqP2x2BEPph9aqKhAQJXWx3MohmT26N0wf726lQy4w7vSSnP9S0Fpq+6Mg/blWiy/ pDMSo+WKdJFh3rcNx/ifd0+Ny9+PJ3WYoVs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1628175455009100001 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3531 The MessageLength field of EFI_MM_COMMUNICATE_HEADER as defined in MdePkg/Include/Protocol/MmCommunication.h was updated to a fixed size as opposed to UINTN to avoid ambiguity between different caller enviornments. This change updates the MessageLength usage in MinPlatformPkg to support the new field structure, in turn, fixing a build issue. Original edk2 change: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3398 Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckSmiHa= ndlerInstrument.c | 4 ++-- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointC= heckLib.c | 15 ++++++++++++++- Platform/Intel/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxe.c = | 10 +++++----- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPointC= heckLib.inf | 1 + 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/D= xeCheckSmiHandlerInstrument.c b/Platform/Intel/MinPlatformPkg/Test/Library/= TestPointCheckLib/DxeCheckSmiHandlerInstrument.c index 3ceeb821fb95..80e8d26f4e1d 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= SmiHandlerInstrument.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= SmiHandlerInstrument.c @@ -106,7 +106,7 @@ GetSmiHandlerProfileDatabase( CommGetInfo->Header.ReturnStatus =3D (UINT64)-1; CommGetInfo->DataSize =3D 0; =20 - CommSize =3D sizeof(EFI_GUID) + sizeof(UINTN) + CommHeader->MessageLengt= h; + CommSize =3D OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + (UINTN)CommH= eader->MessageLength; Status =3D SmmCommunication->Communicate(SmmCommunication, CommBuffer, &= CommSize); if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SmiHandlerProfile: SmmCommunication - %r\n", Stat= us)); @@ -139,7 +139,7 @@ GetSmiHandlerProfileDatabase( CommGetData->Header.DataLength =3D sizeof(*CommGetData); CommGetData->Header.ReturnStatus =3D (UINT64)-1; =20 - CommSize =3D sizeof(EFI_GUID) + sizeof(UINTN) + CommHeader->MessageLengt= h; + CommSize =3D OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + (UINTN)CommH= eader->MessageLength; Buffer =3D (UINT8 *)CommHeader + CommSize; Size -=3D CommSize; =20 diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/D= xeTestPointCheckLib.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPoin= tCheckLib/DxeTestPointCheckLib.c index c012e0afcbaa..e5efbd059954 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestP= ointCheckLib.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestP= ointCheckLib.c @@ -12,6 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include #include #include #include @@ -520,6 +521,7 @@ TestPointDxeSmmReadyToBootSmmPageProtection ( UINTN MemoryAttributesTabl= eSize; EFI_STATUS Status; UINTN CommSize; + UINT64 LongCommSize; UINT8 *CommBuffer; EFI_SMM_COMMUNICATE_HEADER *CommHeader; EFI_SMM_COMMUNICATION_PROTOCOL *SmmCommunication; @@ -620,7 +622,18 @@ TestPointDxeSmmReadyToBootSmmPageProtection ( (UINTN)CommData->UefiMemoryAttributeTableSize ); =20 - CommSize =3D OFFSET_OF(EFI_SMM_COMMUNICATE_HEADER, Data) + CommHeader->M= essageLength; + Status =3D SafeUint64Add (OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data), = CommHeader->MessageLength, &LongCommSize); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, "TestPointDxeSmmReadyToBootSmmPageProtection: Long= CommSize calculation - %r\n", Status)); + return EFI_SUCCESS; + } + + Status =3D SafeUint64ToUintn (LongCommSize, &CommSize); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_INFO, "TestPointDxeSmmReadyToBootSmmPageProtection: Comm= Size conversion - %r\n", Status)); + return EFI_SUCCESS; + } + Status =3D SmmCommunication->Communicate(SmmCommunication, CommBuffer, &= CommSize); if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "TestPointDxeSmmReadyToBootSmmPageProtection: SmmC= ommunication - %r\n", Status)); diff --git a/Platform/Intel/MinPlatformPkg/Test/TestPointStubDxe/TestPointS= tubDxe.c b/Platform/Intel/MinPlatformPkg/Test/TestPointStubDxe/TestPointStu= bDxe.c index 3cc5ccfef6f4..8416b36f56ae 100644 --- a/Platform/Intel/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxe.c +++ b/Platform/Intel/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxe.c @@ -122,7 +122,7 @@ GetTestPointDataSmm ( CommGetInfo->Header.ReturnStatus =3D (UINT64)-1; CommGetInfo->DataSize =3D 0; =20 - CommSize =3D sizeof(EFI_GUID) + sizeof(UINTN) + CommHeader->MessageLengt= h; + CommSize =3D OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + (UINTN)CommH= eader->MessageLength; Status =3D SmmCommunication->Communicate(SmmCommunication, CommBuffer, &= CommSize); if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "SmiHandlerTestPoint: SmmCommunication - %r\n", St= atus)); @@ -155,7 +155,7 @@ GetTestPointDataSmm ( CommGetData->Header.DataLength =3D sizeof(*CommGetData); CommGetData->Header.ReturnStatus =3D (UINT64)-1; =20 - CommSize =3D sizeof(EFI_GUID) + sizeof(UINTN) + CommHeader->MessageLengt= h; + CommSize =3D OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) + (UINTN)CommH= eader->MessageLength; Buffer =3D (UINT8 *)CommHeader + CommSize; Size -=3D CommSize; =20 @@ -233,7 +233,7 @@ PublishSmmTestPoint ( TestPoint =3D mSmmTestPointDatabase; while ((UINTN)TestPoint < (UINTN)mSmmTestPointDatabase + mSmmTestPointDa= tabaseSize) { TestPointSize =3D GetTestPointInfoSize (TestPoint, (UINTN)mSmmTestPoin= tDatabase + mSmmTestPointDatabaseSize - (UINTN)TestPoint); - =20 + TestPointLibSetTable (TestPoint, TestPointSize); =20 TestPoint =3D (ADAPTER_INFO_PLATFORM_TEST_POINT *)((UINTN)TestPoint + = TestPointSize); @@ -286,7 +286,7 @@ OnReadyToBoot ( EFI_EVENT ReadyToBootLaterEvent; =20 gBS->CloseEvent (Event); - =20 + Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, @@ -295,7 +295,7 @@ OnReadyToBoot ( &ReadyToBootLaterEvent ); ASSERT_EFI_ERROR (Status); - =20 + gBS->SignalEvent (ReadyToBootLaterEvent); } =20 diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/D= xeTestPointCheckLib.inf b/Platform/Intel/MinPlatformPkg/Test/Library/TestPo= intCheckLib/DxeTestPointCheckLib.inf index 2ae1db4ee483..54b4015d6767 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestP= ointCheckLib.inf +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestP= ointCheckLib.inf @@ -32,6 +32,7 @@ [LibraryClasses] TestPointLib PciSegmentLib PciSegmentInfoLib + SafeIntLib =20 [Packages] MinPlatformPkg/MinPlatformPkg.dec --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78711): https://edk2.groups.io/g/devel/message/78711 Mute This Topic: https://groups.io/mt/84686303/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 8 06:56:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78712+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78712+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1628175456; cv=none; d=zohomail.com; s=zohoarc; b=Zsj/ebH3wXlFsgYj/FIw/Zg/sTAlZIJpMuTKSDR/ebZBN0bmLMBz9BDUogweOACqYNQ7r39C5nOKKgLJugsc4+3lqm+hTUHNgQPRyKhkC9TQ7ZLMCEhRBcaq8dnPbKPKdI+5qxgw92ZDDHD+GSM0sNDkpxonW9f/mJ4dm3h5mFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628175456; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=tnwcK3tRAOQTMkdgvvXbn1n4qcxCqZtowRZ0/qxrS1w=; b=G8rTxiGopWnPBNynQ52dk459TRlKEfKV9mmQ2D/oMFcjLgpkxCHDdrt0bJ4SfTMjrF+D8JCABHluNJtskXHHNSfG2oQLfngsf2BPMHMb70V3XONC7TW4RUPG4gQsiFeA4jAfPFz4x4RlkD/3XKEYU5FykImcqMm8rKb4Ibr4Eis= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78712+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1628175456405576.658748939419; Thu, 5 Aug 2021 07:57:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id SXWdYY1788612xxwYTeSsheE; Thu, 05 Aug 2021 07:57:36 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.9903.1628175455603980657 for ; Thu, 05 Aug 2021 07:57:35 -0700 X-Received: from localhost.localdomain (unknown [167.220.2.74]) by linux.microsoft.com (Postfix) with ESMTPSA id 3C27620B36ED; Thu, 5 Aug 2021 07:57:35 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3C27620B36ED From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel] [edk2-platforms][PATCH v1 2/5] MinPlatformPkg/TestPointCheckLib: Set required size field in protocol Date: Thu, 5 Aug 2021 10:57:03 -0400 Message-Id: <20210805145706.2470-3-mikuback@linux.microsoft.com> In-Reply-To: <20210805145706.2470-1-mikuback@linux.microsoft.com> References: <20210805145706.2470-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,mikuback@linux.microsoft.com X-Gm-Message-State: XJ1rmFZdn4W18c2pX8ymEMmdx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1628175456; bh=V0PkIVmLS6agYOb9mpi90i1YHp4kHFdevh0g+uNCW7o=; h=Cc:Date:From:Reply-To:Subject:To; b=lEOuazLublNH/gaZRDzLfHpbZxTO+KjUckUcFzPDB8UX8xgU5CICpZV2zXiz3vW3LAo /zW4Mp1eLqP3AT4EDFa9cNkHujYLT1uy4KpYuH26eZ90TnuqPB5eSMGdNqH9DgplVZWr4 zm/wRORnxfJHSKQ+KBHJZ0Iqi1zW2B2Tlik= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1628175457257100001 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3518 Per the protocol definition, the caller must allocate the input structure and set the size field. TestPointCheckTcgTrustedBoot() does not do this which can result in an EFI_BUFFER_TOO_SMALL error. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki --- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTcgTr= ustedBoot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/D= xeCheckTcgTrustedBoot.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPo= intCheckLib/DxeCheckTcgTrustedBoot.c index 2a04f86fedac..7a8e3fed22f9 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= TcgTrustedBoot.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= TcgTrustedBoot.c @@ -41,6 +41,7 @@ TestPointCheckTcgTrustedBoot ( goto Done; } =20 + ProtocolCapability.Size =3D (UINT8) sizeof (ProtocolCapability); Status =3D Tcg2->GetCapability (Tcg2, &ProtocolCapability); if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "Tcg2->GetCapability - %r\n", Status)); --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78712): https://edk2.groups.io/g/devel/message/78712 Mute This Topic: https://groups.io/mt/84686304/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 8 06:56:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78713+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78713+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1628175459; cv=none; d=zohomail.com; s=zohoarc; b=Dt0xR1mHHKCLfMfkTwYqHi65fKbG0MMsgGg+7CUUBDgVaW8fkqBYrOWR359+tJaii6RQ4ILDzDTvyBRVnBIv30Mwiya0lVpe5pU5PXHyUlqE8SeWRtB1GM9wmBKh0FVsQwru9d1SPJebkW6LJR4o4hoiNYPrvW+xNkrfsJP4JYc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628175459; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=8x1u8ZRDjCbVcp45Mga1mb1o7ul7CqshNMNqtWmOUjs=; b=SdjY/unPMV591xg6ar10Dm3iCtJHiKLBHd2hMKumro2HT3EjXrjHdrPgNSLW4IlKfb4Qh1h0ng3Vd907GL4Igw8LMoNX4mXtBcVxw0JlX8vE+huj80vmL94H9q1IGJU5Ddqkd+LHrtCYW64Pajp3Q9c901zLnI6e30DVUZ3t+gY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78713+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1628175459290282.1502417491936; Thu, 5 Aug 2021 07:57:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id dckNYY1788612xnckczIvCBS; Thu, 05 Aug 2021 07:57:38 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.9904.1628175458396083424 for ; Thu, 05 Aug 2021 07:57:38 -0700 X-Received: from localhost.localdomain (unknown [167.220.2.74]) by linux.microsoft.com (Postfix) with ESMTPSA id 066A920B36EE; Thu, 5 Aug 2021 07:57:38 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 066A920B36EE From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel] [edk2-platforms][PATCH v1 3/5] MinPlatformPkg/TestPointCheckLib: Fix incorrect array index Date: Thu, 5 Aug 2021 10:57:04 -0400 Message-Id: <20210805145706.2470-4-mikuback@linux.microsoft.com> In-Reply-To: <20210805145706.2470-1-mikuback@linux.microsoft.com> References: <20210805145706.2470-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,mikuback@linux.microsoft.com X-Gm-Message-State: PS4Gpb7meOuUYslyMVjgXtwvx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1628175458; bh=cZ3DoDfNJ4G1PtE1s++4rXn3BqcQ3xE/LYR7vs+FJwo=; h=Cc:Date:From:Reply-To:Subject:To; b=g7iX9+6EkPNFf/cdu4xWZPB1oA2+WKtnXw2f5wXDX0y6flV/WMPCVrifIy0+6fjkBtK PBLBMxQ2cntn3swLPzLH4jeiUkfOzZHnJ3DpxnHXwd/YW3ADoBCQ1ivKEP1PrfzKsslEH B6MwhpOHB+L5fQwFye7P50V40syMlaSHQyQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1628175459598100006 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3520 TestPointSmmEndOfDxeSmrrFunctional() uses the incorrect byte index to skip the test. It should use byte 6 instead of byte 5. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki --- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPointC= heckLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/S= mmTestPointCheckLib.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPoin= tCheckLib/SmmTestPointCheckLib.c index 4b4f874c7bbc..3e8b2621cccd 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestP= ointCheckLib.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestP= ointCheckLib.c @@ -109,7 +109,7 @@ TestPointSmmEndOfDxeSmrrFunctional ( EFI_STATUS Status; BOOLEAN Result; =20 - if ((mFeatureImplemented[5] & TEST_POINT_BYTE6_SMM_END_OF_DXE_SMRR_FUNCT= IONAL) =3D=3D 0) { + if ((mFeatureImplemented[6] & TEST_POINT_BYTE6_SMM_END_OF_DXE_SMRR_FUNCT= IONAL) =3D=3D 0) { return EFI_SUCCESS; } =20 @@ -125,7 +125,7 @@ TestPointSmmEndOfDxeSmrrFunctional ( TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, NULL, - 5, + 6, TEST_POINT_BYTE6_SMM_END_OF_DXE_SMRR_FUNCTIONAL ); } --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78713): https://edk2.groups.io/g/devel/message/78713 Mute This Topic: https://groups.io/mt/84686307/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 8 06:56:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78714+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78714+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1628175462; cv=none; d=zohomail.com; s=zohoarc; b=Q/Ya8kGGdK9dQiN6mcxer3ySHkR/dOFxCXKyN8i/ja+xxVB172vTySnH7gJVAYC5INXz+GIz9tac8U2OR4WQsOXN5xFpAnhvDrqWX9BDiQN/knC3UXJLUFtAkhLpONPaLo+delTevmXzQIYsSBJVylxS+vPwkdia0/q/My1ihT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628175462; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=+Dy2MRMvrVSmYoIA8//VjCv9bkVSf/xy443LfpmAMa0=; b=SnwVNmOb78i3gojSeNJ/LqCzdVIpM0xopmoBdkUcD5x4iX+5KtzuljZsrjBfpQbmSqLVfaJaEtM46NGsyW8co8vJruqa706kp5KyJ9E/Fgzxq/9fmkAfDj09CF2fqV4ssws91Z3RbzNY13jkW5++CSfkQvxdWV/rvua03m0ASs0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78714+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 162817546297811.787403105586236; Thu, 5 Aug 2021 07:57:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id dnKQYY1788612x84gcuze3iv; Thu, 05 Aug 2021 07:57:42 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.9807.1628175462101864722 for ; Thu, 05 Aug 2021 07:57:42 -0700 X-Received: from localhost.localdomain (unknown [167.220.2.74]) by linux.microsoft.com (Postfix) with ESMTPSA id B4F5D20B36F3; Thu, 5 Aug 2021 07:57:41 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B4F5D20B36F3 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel] [edk2-platforms][PATCH v1 4/5] MinPlatformPkg/TestPointCheckLib: Improve adjacent region checking Date: Thu, 5 Aug 2021 10:57:05 -0400 Message-Id: <20210805145706.2470-5-mikuback@linux.microsoft.com> In-Reply-To: <20210805145706.2470-1-mikuback@linux.microsoft.com> References: <20210805145706.2470-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,mikuback@linux.microsoft.com X-Gm-Message-State: qix5X8o3zoWG1FTvxdazRPw9x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1628175462; bh=pVTVYUvj7Pq/BXT9yMUZ9mMXHa0IwrArzV1TDMMMi0U=; h=Cc:Date:From:Reply-To:Subject:To; b=TwAUWsW1wH0A8LMmk60Iy8We8BDdf+aZ+keTMCkf5rZ5AVISu0GU25IzlAJl0Za2ojo hV4DTAPl6tgynivf1HDGake3i5jdmtnRh4ZmRDE1EitpiupB4Ie6uUBSJ7XdeevPCiI7u bID4mXzn6c7y+8epWdC44PW8SYjpyGxM/eQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1628175464015100001 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3521 The current logic depends on a particular order in which the descriptors for three or more regions are placed in the array to perform proper adjacency checking. When three or more regions are all adjacent, but neighboring descriptors are not adjacent, the logic can improperly report a failure. Adjust the logic so that all descriptors are checked for adjacency. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckSmmIn= fo.c | 56 ++++++++++---------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/D= xeCheckSmmInfo.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointChec= kLib/DxeCheckSmmInfo.c index c493750a27e6..f15f76eab574 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= SmmInfo.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= SmmInfo.c @@ -59,34 +59,36 @@ CheckSmramDescriptor ( ) { UINTN Index; - UINT64 Base; + UINTN Index2; UINT64 Length; + BOOLEAN AdjacentRegion; =20 - Base =3D 0; Length =3D 0; for (Index =3D 0; Index < NumberOfSmmReservedRegions; Index++) { - if (Base =3D=3D 0) { - Base =3D Descriptor[Index].PhysicalStart; - Length =3D Descriptor[Index].PhysicalSize; + AdjacentRegion =3D FALSE; + for (Index2 =3D 0; Index2 < NumberOfSmmReservedRegions; Index2++) { + if ((NumberOfSmmReservedRegions =3D=3D 1) + || (Descriptor[Index].PhysicalStart + Descriptor[Index].Physical= Size =3D=3D Descriptor[Index2].PhysicalStart) + || (Descriptor[Index2].PhysicalStart + Descriptor[Index2].Physic= alSize =3D=3D Descriptor[Index].PhysicalStart)) { + AdjacentRegion =3D TRUE; + break; + } + } + + if (AdjacentRegion =3D=3D TRUE) { + Length +=3D Descriptor[Index].PhysicalSize; } else { - if (Base + Length =3D=3D Descriptor[Index].PhysicalStart) { - Length =3D Length + Descriptor[Index].PhysicalSize; - } else if (Descriptor[Index].PhysicalStart + Descriptor[Index].Physi= calSize =3D=3D Base) { - Base =3D Descriptor[Index].PhysicalStart; - Length =3D Length + Descriptor[Index].PhysicalSize; - } else { - DEBUG ((DEBUG_ERROR, "Smram is not adjacent\n")); - TestPointLibAppendErrorString ( - PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, - NULL, - TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERROR_CODE \ - TEST_POINT_DXE_SMM_READY_TO_LOCK=20 - TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERROR_STR= ING - ); - return EFI_INVALID_PARAMETER; - } + DEBUG ((DEBUG_ERROR, "Smram is not adjacent\n")); + TestPointLibAppendErrorString ( + PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, + NULL, + TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERROR_CODE \ + TEST_POINT_DXE_SMM_READY_TO_LOCK + TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERROR_STRING + ); + return EFI_INVALID_PARAMETER; } - } =20 + } =20 if (Length !=3D GetPowerOfTwo64 (Length)) { DEBUG ((DEBUG_ERROR, "Smram is not aligned\n")); @@ -94,7 +96,7 @@ CheckSmramDescriptor ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, NULL, TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERROR_CODE \ - TEST_POINT_DXE_SMM_READY_TO_LOCK=20 + TEST_POINT_DXE_SMM_READY_TO_LOCK TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERROR_STRING ); return EFI_INVALID_PARAMETER; @@ -111,14 +113,14 @@ TestPointCheckSmmInfo ( EFI_SMM_ACCESS2_PROTOCOL *SmmAccess; UINTN Size; EFI_SMRAM_DESCRIPTOR *SmramRanges; - =20 + DEBUG ((DEBUG_INFO, "=3D=3D=3D=3D TestPointCheckSmmInfo - Enter\n")); - =20 + Status =3D gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid, NULL, (VOID= **)&SmmAccess); if (EFI_ERROR (Status)) { goto Done ; } - =20 + Size =3D 0; Status =3D SmmAccess->GetCapabilities (SmmAccess, &Size, NULL); ASSERT (Status =3D=3D EFI_BUFFER_TOO_SMALL); @@ -128,7 +130,7 @@ TestPointCheckSmmInfo ( =20 Status =3D SmmAccess->GetCapabilities (SmmAccess, &Size, SmramRanges); ASSERT_EFI_ERROR (Status); - =20 + DEBUG ((DEBUG_INFO, "SMRAM Info\n")); DumpSmramDescriptor (Size / sizeof (EFI_SMRAM_DESCRIPTOR), SmramRanges); =20 --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78714): https://edk2.groups.io/g/devel/message/78714 Mute This Topic: https://groups.io/mt/84686308/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 8 06:56:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78715+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78715+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1628175469; cv=none; d=zohomail.com; s=zohoarc; b=E8V4dv9M5kiifSCSL09vsSk4VL27jqnFd7tll2gFLnqPeiQz4RPSmndIs67pnaCoWTHumslyf6cAGELgm7Ea/2Mg2NU1MXXD3qC8oq/P2Mj0spnLgZpUC0wSn9wVSF8QOaNo7b1VaDIaJ2SF7FE4TETkMuVpxN3mDu/GVCLnir4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628175469; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=M5x/G2yoN8g/MFCYJ+aADdroj3kDU2wCkjwbRHBkqRg=; b=WYGkOazmvNVfsMVsE3z0oCqIVVGreqxiwmWcfex5/37USK6WTKKp79zx/JdxTwf0xk/mar/j7ObBbSt1heUpI2nyjOKngyBcnWPsqDvDazPWqoX8nu9Wdh0IYO2+0/26PbncC4lMxDCZwDNpzFij/76c5Fp7tMKjesyAlXgAgEs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78715+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1628175469506208.1664166013362; Thu, 5 Aug 2021 07:57:49 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 5Ga8YY1788612xKqWK8cil1d; Thu, 05 Aug 2021 07:57:45 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web12.9876.1628175464593664107 for ; Thu, 05 Aug 2021 07:57:44 -0700 X-Received: from localhost.localdomain (unknown [167.220.2.74]) by linux.microsoft.com (Postfix) with ESMTPSA id 46DDC20B36E8; Thu, 5 Aug 2021 07:57:44 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 46DDC20B36E8 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel] [edk2-platforms][PATCH v1 5/5] MinPlatformPkg/TestPointCheckLib: Make OutTable parameter optional Date: Thu, 5 Aug 2021 10:57:06 -0400 Message-Id: <20210805145706.2470-6-mikuback@linux.microsoft.com> In-Reply-To: <20210805145706.2470-1-mikuback@linux.microsoft.com> References: <20210805145706.2470-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,mikuback@linux.microsoft.com X-Gm-Message-State: 9xiQp8C8Z4SG8fC33n80t6DAx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1628175465; bh=uJFpyaNFWIB5D5Jz6JdkbkX5wmILSQRpToNU9/u652o=; h=Cc:Date:From:Reply-To:Subject:To; b=OfXL73GDv5SzG7Oft4v9YyxujFXWnUCGNJoedkjnu8Qnvle2b4f7B4RoprolnOhn7yQ Rg2sidbP5kRY3bbocnFsGFdbs7Qgk8BlhBIKlTs/ykm9wW3rv61pQCc8HTai4WxHnJOqC KjydIjsPyUtWbKpTnT35KupSTz8iah0msn0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1628175471099100002 Content-Type: text/plain; charset="utf-8" From: Michael Kubacki Makes the OutTable parameter in DumpAcpiRsdt() and DumpAcpiXsdt() optional since the pointer passed can be NULL if the Signature pointer is also NULL. Can fix a potential failure in TestPointCheckAcpi(). Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpi.= c | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/D= xeCheckAcpi.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLi= b/DxeCheckAcpi.c index cd8f538f7f3f..3d75e5012a4c 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= Acpi.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck= Acpi.c @@ -477,7 +477,7 @@ DumpAcpiTable ( ) { EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt; - =20 + if (Table =3D=3D NULL) { return ; } @@ -535,7 +535,7 @@ CheckAcpiTableResource ( ) { EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt; - =20 + if (Table =3D=3D NULL) { return EFI_INVALID_PARAMETER; } @@ -592,7 +592,7 @@ EFI_STATUS DumpAcpiRsdt ( IN EFI_ACPI_DESCRIPTION_HEADER *Rsdt, IN UINT32 *Signature, OPTIONAL - OUT VOID **OutTable, + OUT VOID **OutTable, OPTIONAL IN BOOLEAN DumpPrint, IN BOOLEAN CheckResource ) @@ -610,7 +610,7 @@ DumpAcpiRsdt ( =20 if (OutTable !=3D NULL) { *OutTable =3D NULL; - } else { + } else if ((OutTable =3D=3D NULL) && (Signature !=3D NULL)) { return EFI_INVALID_PARAMETER; } =20 @@ -632,7 +632,7 @@ DumpAcpiRsdt ( *OutTable =3D Table; } } - =20 + if (OutTable !=3D NULL) { if (*OutTable =3D=3D NULL) { return EFI_NOT_FOUND; @@ -646,7 +646,7 @@ EFI_STATUS DumpAcpiXsdt ( IN EFI_ACPI_DESCRIPTION_HEADER *Xsdt, IN UINT32 *Signature, OPTIONAL - OUT VOID **OutTable, + OUT VOID **OutTable, OPTIONAL IN BOOLEAN DumpPrint, IN BOOLEAN CheckResource ) @@ -662,16 +662,16 @@ DumpAcpiXsdt ( if (Xsdt =3D=3D NULL) { return EFI_INVALID_PARAMETER; } - =20 + if (OutTable !=3D NULL) { *OutTable =3D NULL; - } else { + } else if ((OutTable =3D=3D NULL) && (Signature !=3D NULL)) { return EFI_INVALID_PARAMETER; } =20 ReturnStatus =3D EFI_SUCCESS; EntryCount =3D (Xsdt->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) / s= izeof(UINT64); - =20 + BasePtr =3D (UINTN)(Xsdt + 1); for (Index =3D 0; Index < EntryCount; Index ++) { CopyMem (&EntryPtr, (VOID *)(BasePtr + Index * sizeof(UINT64)), sizeof= (UINT64)); @@ -783,7 +783,7 @@ TestPointCheckAcpi ( if (Status =3D=3D EFI_NOT_FOUND) { Status =3D DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, TRUE, F= ALSE); } - =20 + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "No ACPI table\n")); TestPointLibAppendErrorString ( @@ -796,7 +796,7 @@ TestPointCheckAcpi ( } =20 DEBUG ((DEBUG_INFO, "=3D=3D=3D=3D TestPointCheckAcpi - Exit\n")); - =20 + return Status; } =20 @@ -806,9 +806,9 @@ TestPointCheckAcpiGcdResource ( ) { EFI_STATUS Status; - =20 + DEBUG ((DEBUG_INFO, "=3D=3D=3D=3D TestPointCheckAcpiGcdResource - Enter\= n")); - =20 + // // Check the ACPI existence // @@ -816,7 +816,7 @@ TestPointCheckAcpiGcdResource ( if (Status =3D=3D EFI_NOT_FOUND) { Status =3D DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, FALSE, = FALSE); } - =20 + if (!EFI_ERROR(Status)) { // // Then check resource in ACPI and GCD @@ -828,7 +828,7 @@ TestPointCheckAcpiGcdResource ( Status =3D DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, FALSE= , TRUE); } } - =20 + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "ACPI table resource not in GCD\n")); TestPointLibAppendErrorString ( @@ -840,7 +840,7 @@ TestPointCheckAcpiGcdResource ( ); } DEBUG ((DEBUG_INFO, "=3D=3D=3D=3D TestPointCheckAcpiGcdResource - Exit\n= ")); - =20 + return Status; } =20 --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78715): https://edk2.groups.io/g/devel/message/78715 Mute This Topic: https://groups.io/mt/84686310/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-