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 7CD98AC0FF0 for ; Thu, 17 Aug 2023 16:10:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=s9ahQ3ZpZ78qTKMkqUwvdnnjegokOkBZdpozzCCo1Qs=; c=relaxed/simple; d=groups.io; h=From:To:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1692288638; v=1; b=i0ibQxYck5E7G7wKCAUWlTZoalbhwuTXTmi770WrLKrXEX42lE+zB2bmRvLfCzEnWStY1wl5 YZ3sNv6zTwiBt9Pa+B+/TfBAO2fBgdwYPatxAwdheioQkAE+EVYAeY/cClqN4L1SNRy2Kjv+ySl IgQd+LlCN9aXMaoGOtgW4TKM= X-Received: by 127.0.0.2 with SMTP id lOdgYY7687511xRGs2ebgZJR; Thu, 17 Aug 2023 09:10:38 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.896.1692288637246503490 for ; Thu, 17 Aug 2023 09:10:37 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A91011063 for ; Thu, 17 Aug 2023 09:11:17 -0700 (PDT) X-Received: from beelzebub.ast.arm.com (abhsin07-ThinkStation-P720.austin.arm.com [10.118.30.31]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 910A93F793 for ; Thu, 17 Aug 2023 09:10:36 -0700 (PDT) From: "Abhimanyu Singh" To: devel@edk2.groups.io Subject: [edk2-devel] [PATCH v1 1/1] uefi-sct/SctPkg: TCG MemoryOverwriteRequest Date: Thu, 17 Aug 2023 11:10:27 -0500 Message-Id: <20230817161027.1198282-2-Abhi.Singh@arm.com> In-Reply-To: <20230817161027.1198282-1-Abhi.Singh@arm.com> References: <20230817161027.1198282-1-Abhi.Singh@arm.com> MIME-Version: 1.0 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,Abhi.Singh@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: jPdyMKoi4jtVLUQ5e32FOo0px7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=i0ibQxYc; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io From: "Abhi.Singh" SCT Platform Reset Check Test SCT spec: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4374 Test: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4419 -Implement initial test infrastructure for all test cases including updates to: CommonGenFramework.sh, UEFI_SCT.dsc, and Category.ini. -Add Guid.c and Guid.h files to cover the assertions defined in the SCT spec -Add TCGMemoryOverwriteRequestBBTestMain.h to enable any required macros that define states for MOR/MORLOCK -Add Platform Reset Check Test -check if the platform creates the MOR & MORLOCK EFI variables as defined in the TCG Spec -sets MOR bit 0 and validate if the platform clears the MOR bit 0 upon reset. Signed-off-by: Abhi Singh Change-Id: I774d5893e5aff47690dadf90c36c7b9e7e7ee584 --- uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc = | 1 + uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteReques= t/BlackBoxTest/TCGMemoryOverwriteRequestBBTest.inf | 53 +++ uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteReques= t/BlackBoxTest/Guid.h | 276 +++++++++++++ uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteReques= t/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.h | 138 +++++++ uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteReques= t/BlackBoxTest/Guid.c | 129 ++++++ uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteReques= t/BlackBoxTest/TCGMemoryOverwriteRequestBBTestFunction.c | 418 ++++++++++++= ++++++++ uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteReques= t/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.c | 115 ++++++ uefi-sct/SctPkg/CommonGenFramework.sh = | 1 + uefi-sct/SctPkg/Config/Data/Category.ini = | 7 + 9 files changed, 1138 insertions(+) diff --git a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc b/uefi-sct/SctPkg/UEFI/UEFI_= SCT.dsc index 155490fa39d3..536d5f2ed37a 100644 --- a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc +++ b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc @@ -235,6 +235,7 @@ [Components] SctPkg/TestCase/UEFI/EFI/RuntimeServices/MiscRuntimeServices/BlackBoxTest/= MiscRuntimeServicesBBTest.inf=0D SctPkg/TestCase/UEFI/EFI/RuntimeServices/TimeServices/BlackBoxTest/TimeSer= vicesBBTest.inf=0D SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxTest/Var= iableServicesBBTest.inf=0D +SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBo= xTest/TCGMemoryOverwriteRequestBBTest.inf=0D =0D SctPkg/TestCase/UEFI/EFI/Protocol/GraphicsOutput/BlackBoxTest/GraphicsOutp= utBBTest.inf=0D SctPkg/TestCase/UEFI/EFI/Protocol/Bis/BlackBoxTest/BisBBTest.inf=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOve= rwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTest.inf b/uefi-sct/S= ctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBoxT= est/TCGMemoryOverwriteRequestBBTest.inf new file mode 100644 index 000000000000..35d82043e2e7 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteR= equest/BlackBoxTest/TCGMemoryOverwriteRequestBBTest.inf @@ -0,0 +1,53 @@ +## @file=0D +#=0D +# Copyright 2006 - 2015 Unified EFI, Inc.
=0D +# Copyright (c) 2013, Intel Corporation. All rights reserved.
=0D +# Copyright (c) 2023, Arm Inc. All rights reserved.
=0D +#=0D +# This program and the accompanying materials=0D +# are licensed and made available under the terms and conditions of the B= SD License=0D +# which accompanies this distribution. The full text of the license may = be found at=0D +# http://opensource.org/licenses/bsd-license.php=0D +#=0D +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED.=0D +#=0D +##=0D +#/*++=0D +#=0D +# Module Name:=0D +#=0D +# TCGMemoryOverwriteRequestBBTest.inf=0D +#=0D +# Abstract:=0D +#=0D +# Component description file for TCG MemoryOverwriteRequest UEFI variabl= es Test.=0D +#=0D +#--*/=0D +=0D +[defines]=0D + INF_VERSION =3D 0x00010005=0D + BASE_NAME =3D TCGMemoryOverwriteRequestBBTest=0D + FILE_GUID =3D ACA989CD-4AEE-45A3-B80F-E9A523BB7164=0D + MODULE_TYPE =3D UEFI_DRIVER=0D + VERSION_STRING =3D 1.0=0D + ENTRY_POINT =3D InitializeTestTCGMemoryOverwriteRequest=0D +=0D +[sources.common]=0D + TCGMemoryOverwriteRequestBBTestMain.c=0D + TCGMemoryOverwriteRequestBBTestMain.h=0D + TCGMemoryOverwriteRequestBBTestFunction.c=0D + Guid.c=0D +=0D +[Packages]=0D + MdePkg/MdePkg.dec=0D + SctPkg/SctPkg.dec=0D + SctPkg/UEFI/UEFI.dec=0D +=0D +[LibraryClasses]=0D + UefiDriverEntryPoint=0D + SctLib=0D + EfiTestLib=0D +=0D +[Protocols]=0D + gEfiTestRecoveryLibraryGuid=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOve= rwriteRequest/BlackBoxTest/Guid.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Runti= meServices/TCGMemoryOverwriteRequest/BlackBoxTest/Guid.h new file mode 100644 index 000000000000..324254b25b08 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteR= equest/BlackBoxTest/Guid.h @@ -0,0 +1,276 @@ +/** @file=0D +=0D + Copyright 2006 - 2016 Unified EFI, Inc.
=0D + Copyright (c) 2013, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2023, Arm Inc. All rights reserved.
=0D +=0D + This program and the accompanying materials=0D + are licensed and made available under the terms and conditions of the BS= D License=0D + which accompanies this distribution. The full text of the license may b= e found at=0D + http://opensource.org/licenses/bsd-license.php=0D +=0D + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D +=0D +**/=0D +/*++=0D +=0D +Module Name:=0D +=0D + guid.h=0D +=0D +Abstract:=0D +=0D + GUIDs auto-generated for EFI test assertion.=0D +=0D +--*/=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_001_GUID \=0D +{ 0xd1c31d5f, 0x944f, 0x434c, {0x88, 0x26, 0xa6, 0xfb, 0x00, 0xd4, 0xbb, 0= x97 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_002_GUID \=0D +{ 0xa6c191b1, 0x9bfb, 0x4231, {0xb9, 0x2d, 0x4e, 0xa2, 0x21, 0xf6, 0x4b, 0= x5d }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_003_GUID \=0D +{ 0x34d41a18, 0x8ffe, 0x456b, {0xa4, 0x82, 0x97, 0xb9, 0x9c, 0x50, 0x7d, 0= x9e }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_004_GUID \=0D +{ 0x002519c6, 0x859f, 0x4d25, {0xb1, 0x36, 0xb2, 0xef, 0x61, 0xe5, 0xd9, 0= x6f }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_005_GUID \=0D +{ 0x13e97668, 0xe905, 0x452d, {0xa0, 0x72, 0x03, 0xde, 0xbf, 0x53, 0xdf, 0= xa2 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_006_GUID \=0D +{ 0x94811e97, 0x7513, 0x4099, {0xae, 0xb8, 0x5a, 0x7e, 0x7d, 0x50, 0xb4, 0= x99 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_007_GUID \=0D +{ 0x15378290, 0x17dd, 0x4cbf, {0x8e, 0x8f, 0xc2, 0x4b, 0xc9, 0x09, 0xb4, 0= x14 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_008_GUID \=0D +{ 0x5f0b42ef, 0x3cec, 0x46ad, {0xbc, 0x5b, 0xc3, 0x7a, 0x1d, 0x45, 0x41, 0= x29 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_009_GUID \=0D +{ 0x9665c8d9, 0x267c, 0x4393, {0xa4, 0x72, 0x10, 0x54, 0x43, 0x56, 0x20, 0= x21 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_010_GUID \=0D +{ 0xce655812, 0xcc40, 0x42b0, {0x80, 0xd1, 0xa7, 0x26, 0xdb, 0x14, 0x9e, 0= xa8 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_011_GUID \=0D +{ 0xd34348ad, 0x5d46, 0x4961, {0x91, 0x3e, 0xb1, 0xf2, 0xc5, 0xe7, 0x0f, 0= x7d }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_012_GUID \=0D +{ 0x838311e0, 0x419a, 0x4c92, {0x90, 0x60, 0xbf, 0x94, 0x59, 0xd3, 0xc3, 0= x59 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_013_GUID \=0D +{ 0x12998a9c, 0xc863, 0x4572, {0x80, 0x6c, 0xb6, 0x40, 0x97, 0x91, 0x89, 0= x7f }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_014_GUID \=0D +{ 0xebd4ba26, 0x44c3, 0x464a, {0x88, 0xe3, 0x3b, 0x44, 0x94, 0x88, 0xbb, 0= xb8 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_015_GUID \=0D +{ 0x00920c8e, 0x241d, 0x4da0, {0x8b, 0x59, 0xc3, 0xad, 0xe0, 0xd6, 0x4e, 0= xc9 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_016_GUID \=0D +{ 0x169a43cc, 0x23fa, 0x4887, {0x8b, 0x4f, 0x11, 0xb2, 0xa0, 0x88, 0x4f, 0= x63 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_017_GUID \=0D +{ 0x7c11d0ab, 0x7a84, 0x482b, {0xb7, 0x5a, 0xd7, 0x72, 0x6c, 0x3e, 0xae, 0= x0e }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_018_GUID \=0D +{ 0xbbaa52b6, 0x5576, 0x4acd, {0xb9, 0x5f, 0x86, 0x22, 0x5e, 0xfc, 0xb0, 0= x31 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_019_GUID \=0D +{ 0x60b227e0, 0x9f5c, 0x412c, {0x88, 0x79, 0xd3, 0x59, 0xfc, 0xd0, 0xdd, 0= x3f }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_020_GUID \=0D +{ 0x2eba284a, 0xf701, 0x4c19, {0xbe, 0x5c, 0x39, 0x27, 0xb0, 0x68, 0x4f, 0= xd7 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_021_GUID \=0D +{ 0x9a1b44ae, 0x08ce, 0x474c, {0xa5, 0x8e, 0xa6, 0xe2, 0xcf, 0xaf, 0x91, 0= x2c }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_022_GUID \=0D +{ 0x490d7b39, 0xcad4, 0x4e8c, {0xb1, 0x5d, 0x63, 0xd2, 0x0c, 0xb3, 0xe9, 0= x45 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_023_GUID \=0D +{ 0x397394ae, 0xce01, 0x4350, {0xa2, 0x0c, 0xe1, 0xb3, 0xe8, 0x74, 0xdc, 0= x01 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_024_GUID \=0D +{ 0x9cf27a60, 0x94b5, 0x4e2e, {0xb3, 0x2b, 0x51, 0x0f, 0x24, 0x7a, 0x80, 0= xd7 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_025_GUID \=0D +{ 0x766dc008, 0x2a88, 0x4eed, {0x91, 0x95, 0x46, 0x92, 0xdc, 0xcc, 0x1d, 0= xf6 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_026_GUID \=0D +{ 0x5f66c8e5, 0x1bf8, 0x4af4, {0x86, 0x45, 0xf4, 0x93, 0xa0, 0xee, 0x26, 0= x88 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_027_GUID \=0D +{ 0x1064f6ce, 0xb307, 0x4981, {0xac, 0x8f, 0xe5, 0xca, 0x20, 0x6c, 0x1b, 0= x8b }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_028_GUID \=0D +{ 0x40f2c4e9, 0xe937, 0x426e, {0x98, 0xc5, 0x62, 0xca, 0x23, 0x68, 0x52, 0= xd0 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_029_GUID \=0D +{ 0x6d5dcb4d, 0xe008, 0x41cc, {0x98, 0x32, 0xdf, 0xa8, 0x38, 0xb1, 0xb6, 0= x02 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_030_GUID \=0D +{ 0x29b81ee0, 0x368d, 0x447c, {0x9e, 0xd0, 0xa5, 0xfe, 0xd7, 0x02, 0x65, 0= x7b }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_031_GUID \=0D +{ 0xe88b22ce, 0x3de6, 0x49b0, {0xb2, 0x46, 0x9e, 0x35, 0x98, 0x2b, 0x9b, 0= x1c }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_032_GUID \=0D +{ 0xc8894201, 0x7a3a, 0x47d4, {0xa8, 0x8d, 0xdf, 0x4b, 0x03, 0xff, 0xde, 0= x4f }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_033_GUID \=0D +{ 0x38a813ac, 0x8eb9, 0x46ce, {0xa8, 0x6b, 0x40, 0x8c, 0x07, 0x5f, 0xc7, 0= xed }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_034_GUID \=0D +{ 0x919b8392, 0xcb78, 0x49ff, {0xa3, 0x18, 0x49, 0x78, 0x76, 0xe0, 0xf8, 0= xf8 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_035_GUID \=0D +{ 0x219abaf2, 0x04a9, 0x407c, {0xb5, 0xde, 0xa0, 0x03, 0x6e, 0x65, 0xb0, 0= xb9 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_036_GUID \=0D +{ 0x9a51640a, 0xff14, 0x402b, {0xb0, 0x57, 0xa0, 0xc4, 0xf7, 0x20, 0x8e, 0= x44 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_037_GUID \=0D +{ 0x8ccd0dbb, 0x9b0a, 0x4bfb, {0xa0, 0x7e, 0xc6, 0x06, 0x8b, 0x91, 0x0d, 0= xfb }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_038_GUID \=0D +{ 0xde6f4e17, 0xe375, 0x4dcb, {0x8f, 0x07, 0x77, 0x7e, 0x62, 0x49, 0xea, 0= x2c }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_039_GUID \=0D +{ 0x4ab6927b, 0x5ee4, 0x4748, {0xa4, 0x9d, 0x2d, 0xf3, 0x70, 0x01, 0x41, 0= xd5 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_040_GUID \=0D +{ 0x33142ecf, 0x0f92, 0x4625, {0xb7, 0xf6, 0x7f, 0x15, 0x25, 0x74, 0xd3, 0= x03 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_041_GUID \=0D +{ 0xf73c04df, 0x2e42, 0x4174, {0x82, 0x18, 0x0f, 0x25, 0x46, 0x4a, 0x55, 0= xe9 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_042_GUID \=0D +{ 0xd4eacf82, 0x55d1, 0x4ba1, {0xbe, 0x89, 0x6a, 0x2e, 0x44, 0x0f, 0xc7, 0= xc0 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_043_GUID \=0D +{ 0xfd88fe63, 0x5ed4, 0x482a, {0x98, 0x44, 0x23, 0x90, 0xf9, 0x09, 0x1c, 0= x20 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_044_GUID \=0D +{ 0x176f16cb, 0xf3a4, 0x4f12, {0x8f, 0x96, 0x4a, 0xc1, 0x8b, 0xdd, 0x6e, 0= x3c }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_045_GUID \=0D +{ 0xf0d5e7b3, 0xdc0f, 0x4a18, {0xb9, 0x78, 0x09, 0x3b, 0x15, 0x55, 0x66, 0= xbf }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_046_GUID \=0D +{ 0x9bf14c4b, 0x2950, 0x4c4e, {0x8b, 0xa3, 0x06, 0x46, 0xf1, 0x27, 0x8c, 0= x05 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_047_GUID \=0D +{ 0xb0468dee, 0xb1d0, 0x4795, {0x9f, 0xbf, 0xbe, 0x3f, 0x40, 0x2f, 0x3d, 0= x6f }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_048_GUID \=0D +{ 0x1f7dd903, 0xcd58, 0x4d6f, {0x80, 0xd6, 0x4f, 0x6d, 0xcb, 0x4a, 0xd6, 0= xc9 }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_049_GUID \=0D +{ 0x439179c2, 0x744d, 0x43bc, {0xb0, 0x67, 0x7b, 0x65, 0x60, 0x62, 0x6f, 0= x5e }}=0D +=0D +#define EFI_TEST_TCGMORTESTFUNCTION_ASSERTION_050_GUID \=0D +{ 0x9f68794f, 0x6b2f, 0x41b4, {0xa9, 0xba, 0x96, 0x28, 0xe2, 0x6e, 0xca, 0= xae }}=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid001;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid002;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid003;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid004;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid005;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid006;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid007;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid008;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid009;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid010;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid011;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid012;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid013;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid014;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid015;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid016;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid017;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid018;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid019;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid020;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid021;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid022;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid023;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid024;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid025;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid026;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid027;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid028;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid029;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid030;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid031;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid032;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid033;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid034;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid035;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid036;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid037;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid038;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid039;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid040;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid041;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid042;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid043;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid044;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid045;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid046;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid047;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid048;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid049;=0D +=0D +extern EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid050;=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOve= rwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.h b/uefi-sct= /SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBo= xTest/TCGMemoryOverwriteRequestBBTestMain.h new file mode 100644 index 000000000000..599d16f3bb44 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteR= equest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.h @@ -0,0 +1,138 @@ +/** @file=0D +=0D + Copyright 2006 - 2017 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2023, Arm Inc. All rights reserved.
=0D +=0D + This program and the accompanying materials=0D + are licensed and made available under the terms and conditions of the BS= D License=0D + which accompanies this distribution. The full text of the license may b= e found at=0D + http://opensource.org/licenses/bsd-license.php=0D +=0D + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D +=0D +**/=0D +/*++=0D +=0D +Module Name:=0D +=0D + TCGMemoryOverwriteRequestTest.h=0D +=0D +Abstract:=0D +=0D + Test Driver of TCG MOR and MORLOCK EFI variables that are defined inside= =0D + TCG Platform Reset Attack Mitigation v1.10 Section 4 (UEFI Interface)=0D +=0D +--*/=0D +=0D +#ifndef _TCG_MOR_BB_TEST_MAIN=0D +#define _TCG_MOR_BB_TEST_MAIN=0D +=0D +#include "Efi.h"=0D +#include "Guid.h"=0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +typedef struct _RESET_DATA {=0D + UINTN Step;=0D + UINTN CheckpointStep;=0D +} RESET_DATA;=0D +=0D +#include EFI_TEST_PROTOCOL_DEFINITION(TestRecoveryLibrary)=0D +=0D +#define TCG_MOR_TEST_REVISION 0x00010000=0D +=0D +#define MOR_BIT_LOW 0x0=0D +#define MOR_BIT_HIGH 0x1=0D +=0D +#define MOR_LOCK_DATA_UNLOCKED 0x0=0D +#define MOR_LOCK_DATA_LOCKED_WITHOUT_KEY 0x1=0D +#define MOR_LOCK_DATA_LOCKED_WITH_KEY 0x2=0D +=0D +#define MOR_LOCK_NO_KEY_SIZE 1=0D +#define MOR_LOCK_WITH_KEY_SIZE 8=0D +=0D +#define MOR_LOCK_TEST_KEY 0x11111111=0D +#define MOR_LOCK_INVALID_TEST_KEY 0x22222222=0D +=0D +=0D +//=0D +// TEST GUID for TCG Platform Reset Attack Mitigation MemoryOverwriteReque= st (MOR) Test=0D +//=0D +#define EFI_TCG_MOR_TEST_GUID \=0D + { 0x265e661d, 0xd51e, 0x454b, {0xbb, 0xc9, 0x66, 0x5f, 0x46, 0xec, 0x0a,= 0x04 }}=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +InitializeTestTCGMemoryOverwriteRequest (=0D + IN EFI_HANDLE ImageHandle,=0D + IN EFI_SYSTEM_TABLE *SystemTable=0D + );=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +UnloadTCGMemoryOverwriteRequestTest (=0D + IN EFI_HANDLE ImageHandle=0D + );=0D +=0D +EFI_STATUS=0D +BBTestTCGMemoryOverwriteRequestFunctionTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + );=0D +=0D +EFI_STATUS=0D +TCGMemoryOverwriteRequestPlatformResetCheck (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_TEST_RECOVERY_LIBRARY_PROTOCOL *RecoveryLib,=0D + IN RESET_DATA *ResetData=0D + );=0D +=0D +EFI_STATUS=0D +TCGMemoryOverwriteRequestControlSetVariable (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_TEST_RECOVERY_LIBRARY_PROTOCOL *RecoveryLib,=0D + IN RESET_DATA *ResetData=0D + );=0D +=0D +EFI_STATUS=0D +TCGMemoryOverwriteRequestControlLockSetVariable (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_TEST_RECOVERY_LIBRARY_PROTOCOL *RecoveryLib,=0D + IN RESET_DATA *ResetData=0D + );=0D +=0D +EFI_STATUS=0D +TCGMemoryOverwriteRequestControlLockUnlockedState (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_TEST_RECOVERY_LIBRARY_PROTOCOL *RecoveryLib,=0D + IN RESET_DATA *ResetData=0D +);=0D +=0D +EFI_STATUS=0D +TCGMemoryOverwriteRequestControlLockLockedNoKeyState (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_TEST_RECOVERY_LIBRARY_PROTOCOL *RecoveryLib,=0D + IN RESET_DATA *ResetData=0D + );=0D +=0D +EFI_STATUS=0D +TCGMemoryOverwriteRequestControlLockLockedWithKeyState (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_TEST_RECOVERY_LIBRARY_PROTOCOL *RecoveryLib,=0D + IN RESET_DATA *ResetData=0D + );=0D +=0D +// ***********************************************************************= *****=0D +// Entry GUIDs for Test=0D +// ***********************************************************************= *****=0D +=0D +#define EFI_TCG_MOR_TEST_ENTRY_GUID0101 \=0D + { 0x2104436a, 0x77c8, 0x4514, {0xb7, 0xd7, 0xaa, 0x8a, 0x6b, 0xd1, 0x8d,= 0xa4 }}=0D +=0D +#endif=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOve= rwriteRequest/BlackBoxTest/Guid.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Runti= meServices/TCGMemoryOverwriteRequest/BlackBoxTest/Guid.c new file mode 100644 index 000000000000..ecd7b9bf1462 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteR= equest/BlackBoxTest/Guid.c @@ -0,0 +1,129 @@ +/** @file=0D +=0D + Copyright 2006 - 2013 Unified EFI, Inc.
=0D + Copyright (c) 2013, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2023, Arm Inc. All rights reserved.
=0D +=0D + This program and the accompanying materials=0D + are licensed and made available under the terms and conditions of the BS= D License=0D + which accompanies this distribution. The full text of the license may b= e found at=0D + http://opensource.org/licenses/bsd-license.php=0D +=0D + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D +=0D +**/=0D +/*++=0D +=0D +Module Name:=0D +=0D + guid.c=0D +=0D +Abstract:=0D +=0D + GUIDs auto-generated for EFI test assertion.=0D +=0D +--*/=0D +=0D +#include "Efi.h"=0D +#include "Guid.h"=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid001 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_001_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid002 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_002_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid003 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_003_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid004 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_004_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid005 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_005_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid006 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_006_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid007 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_007_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid008 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_008_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid009 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_009_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid010 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_010_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid011 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_011_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid012 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_012_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid013 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_013_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid014 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_014_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid015 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_015_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid016 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_016_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid017 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_017_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid018 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_018_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid019 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_019_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid020 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_020_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid021 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_021_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid022 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_022_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid023 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_023_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid024 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_024_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid025 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_025_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid026 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_026_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid027 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_027_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid028 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_028_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid029 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_029_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid030 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_030_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid031 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_031_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid032 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_032_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid033 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_033_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid034 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_034_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid035 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_035_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid036 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_036_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid037 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_037_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid038 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_038_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid039 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_039_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid040 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_040_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid041 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_041_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid042 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_042_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid043 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_043_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid044 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_044_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid045 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_045_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid046 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_046_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid047 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_047_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid048 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_048_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid049 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_049_GUID;=0D +=0D +EFI_GUID gTCGMemoryOverwriteRequestTestFunctionAssertionGuid050 =3D EFI_TE= ST_TCGMORTESTFUNCTION_ASSERTION_050_GUID;=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOve= rwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestFunction.c b/uefi= -sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/Bla= ckBoxTest/TCGMemoryOverwriteRequestBBTestFunction.c new file mode 100644 index 000000000000..20313446a554 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteR= equest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestFunction.c @@ -0,0 +1,418 @@ +/** @file=0D +=0D + Copyright 2006 - 2016 Unified EFI, Inc.
=0D + Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2023, Arm Inc. All rights reserved.
=0D +=0D + This program and the accompanying materials=0D + are licensed and made available under the terms and conditions of the BS= D License=0D + which accompanies this distribution. The full text of the license may b= e found at=0D + http://opensource.org/licenses/bsd-license.php=0D +=0D + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D +=0D +**/=0D +/*++=0D +=0D +Module Name:=0D +=0D + TCGMemoryOverwriteRequestBBTestFunction.c=0D +=0D +Abstract:=0D +=0D + Function Test Cases for the TCG MOR and MORLOCK EFI variables that are d= efined=0D + in TCG Platform Reset Attack Mitigation v1.10 Section 4 (UEFI Interface)= =0D +=0D +--*/=0D +=0D +#include "SctLib.h"=0D +#include "TCGMemoryOverwriteRequestBBTestMain.h"=0D +=0D +#define RECOVER_BUFFER_SIZE 2048=0D +=0D +#define TCG_MOR_VARIABLE_ATTRIBUTES (EFI_VARIABLE_NON_VOLATILE | EFI_VARI= ABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS)=0D +=0D +#define CONTROL_PLATFORM_RESET_TEST 1=0D +=0D +#define CONTROL_SET_VARIABLE_TEST 2=0D +=0D +#define LOCK_SET_VARIABLE_TEST 3=0D +=0D +#define LOCK_UNLOCKED_STATE_TEST 4=0D +=0D +#define LOCK_NO_KEY_STATE_TEST 5=0D +=0D +#define LOCK_WITH_KEY_STATE_TEST 6=0D +=0D +=0D +/**=0D + * Entry point for TCG Platform Reset Attack Mitigation MemoryOverwrite E= FI Variables Function Test.=0D + * @param This A pointer to the EFI_BB_TEST_PROTOCOL instance= .=0D + * @param ClientInterface A pointer to the interface to be tested.=0D + * @param TestLevel Test "thoroughness" control.=0D + * @param SupportHandle A handle containing support protocols.=0D + * @return EFI_SUCCESS Test cases ran Successfully, may still contain= errors in assertions.=0D + * @return Other value Something failed.=0D + */=0D +EFI_STATUS=0D +BBTestTCGMemoryOverwriteRequestFunctionTest (=0D + IN EFI_BB_TEST_PROTOCOL *This,=0D + IN VOID *ClientInterface,=0D + IN EFI_TEST_LEVEL TestLevel,=0D + IN EFI_HANDLE SupportHandle=0D + )=0D +{=0D + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib;=0D + EFI_TEST_RECOVERY_LIBRARY_PROTOCOL *RecoveryLib;=0D + EFI_STATUS Status;=0D + RESET_DATA *ResetData;=0D + UINT8 Buffer[RECOVER_BUFFER_SIZE];=0D + UINTN Size;=0D +=0D + ResetData =3D (RESET_DATA *)Buffer;=0D +=0D + //=0D + // Get the Standard Library Interface=0D + //=0D + Status =3D gtBS->HandleProtocol (=0D + SupportHandle,=0D + &gEfiStandardTestLibraryGuid,=0D + (VOID **) &StandardLib=0D + );=0D + if (EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Get the Recovery Library Interface=0D + //=0D + Status =3D gtBS->HandleProtocol (=0D + SupportHandle,=0D + &gEfiTestRecoveryLibraryGuid,=0D + (VOID **) &RecoveryLib=0D + );=0D + if (EFI_ERROR(Status)) {=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + EFI_TEST_ASSERTION_FAILED,=0D + gTestGenericFailureGuid,=0D + L"BS.HandleProtocol - Handle recovery library",=0D + L"%a:%d:Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + return Status;=0D + }=0D +=0D + //=0D + // Read reset record=0D + //=0D + Status =3D RecoveryLib->ReadResetRecord (=0D + RecoveryLib,=0D + &Size,=0D + Buffer=0D + );=0D +=0D + //=0D + // Check Reset Record's checkpoint for which test to run, all tests must= run so they are all included in the same function=0D + //=0D + if (EFI_ERROR(Status) || (Size < sizeof(RESET_DATA)) || (ResetData->Chec= kpointStep =3D=3D CONTROL_PLATFORM_RESET_TEST)) {=0D + if (EFI_ERROR(Status) || Size < sizeof(RESET_DATA)) { // if true, Rese= tData has not been intialized by the tests yet, set Step =3D 0 to start the= first step of the tests=0D + ResetData->Step =3D 0;=0D + }=0D + //=0D + // Test Checkpoint CONTROL_PLATFORM_RESET_TEST=0D + //=0D + Status =3D TCGMemoryOverwriteRequestPlatformResetCheck (StandardLib, R= ecoveryLib, ResetData);=0D + //=0D + // Status is returned in the event that the MOR/MORLOCK variables do n= ot exist in occordance to spec,=0D + // or the WriteResetRecord returns EFI_ERROR, test ends prematurely=0D + //=0D + if(EFI_ERROR(Status)) {=0D + return Status;=0D + }=0D + }=0D + //=0D + // After all Checkpoints have run=0D + //=0D + return EFI_SUCCESS;=0D +}=0D +=0D +=0D +/**=0D + * MOR & MORLock EFI variables are correctly created by platform=0D + * Initially setting MOR bit 0 is then cleared upon platform reset=0D + * @param StandardLib A pointer to EFI_STANDARD_TEST_LIBRARY_PROTOCOL= =0D + * instance.=0D + * @param RecoveryLib A pointer to EFI_TEST_RECOVERY_LIBRARY_PROTOCOL= =0D + * instance.=0D + * @return EFI_SUCCESS Successfully.=0D + * @return Other value Something failed.=0D + */=0D +EFI_STATUS=0D +TCGMemoryOverwriteRequestPlatformResetCheck (=0D + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib,=0D + IN EFI_TEST_RECOVERY_LIBRARY_PROTOCOL *RecoveryLib,=0D + IN RESET_DATA *ResetData=0D + )=0D +{=0D + EFI_STATUS Status;=0D + EFI_TEST_ASSERTION Result;=0D + UINTN DataSize;=0D + UINT8 MemoryOverwriteRequestControlData;= =0D + UINT8 MemoryOverwriteRequestControlLockDa= ta;=0D + UINT32 Attributes;=0D +=0D + //=0D + // Check Step to see which part of test remains to be executed=0D + //=0D + if (ResetData->Step =3D=3D 0) {=0D + goto INITIAL_RESET;=0D + } else if (ResetData->Step =3D=3D 1) {=0D + goto MOR_VARIABLE_CHECK;=0D + } else if (ResetData->Step =3D=3D 2) {=0D + goto MOR_BIT_CLEAR_ON_RESET;=0D + }=0D +=0D +INITIAL_RESET:=0D + //=0D + // Perform initial plaform reset=0D + //=0D + ResetData->Step =3D 1;=0D + ResetData->CheckpointStep =3D CONTROL_PLATFORM_RESET_TEST;=0D +=0D + Status =3D RecoveryLib->WriteResetRecord (=0D + RecoveryLib,=0D + sizeof (RESET_DATA),=0D + (UINT8*)ResetData=0D + );=0D + if (EFI_ERROR(Status)) {=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + EFI_TEST_ASSERTION_FAILED,=0D + gTestGenericFailureGuid,=0D + L"TestRecoveryLib - WriteResetRecord",=0D + L"%a:%d:Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + return Status;=0D + }=0D + SctPrint (L"System will cold reset after 1 second...");=0D + gtBS->Stall (1000000);=0D + gtRT->ResetSystem (=0D + EfiResetCold,=0D + EFI_SUCCESS,=0D + 0,=0D + NULL=0D + );=0D +=0D +MOR_VARIABLE_CHECK:=0D + //=0D + // Post system reset, Check if the MOR EFI var is correctly created by p= latform=0D + //=0D +=0D + // Write reset record before the second reset (MOR_BIT_CLEAR_ON_RESET)=0D + ResetData->Step =3D 2;=0D + ResetData->CheckpointStep =3D CONTROL_PLATFORM_RESET_TEST;=0D +=0D + Status =3D RecoveryLib->WriteResetRecord (=0D + RecoveryLib,=0D + sizeof (RESET_DATA),=0D + (UINT8*)ResetData=0D + );=0D + if (EFI_ERROR(Status)) {=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + EFI_TEST_ASSERTION_FAILED,=0D + gTestGenericFailureGuid,=0D + L"TestRecoveryLib - WriteResetRecord",=0D + L"%a:%d:Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + return Status;=0D + }=0D +=0D + //=0D + // GetVariable and check if the DataSize and Attributes are as expected= =0D + //=0D + DataSize =3D sizeof(MemoryOverwriteRequestControlData);=0D + Attributes =3D TCG_MOR_VARIABLE_ATTRIBUTES;=0D +=0D + Status =3D gtRT->GetVariable (=0D + L"MemoryOverwriteRequestControl", // VariableName=0D + &gEfiMemoryOverwriteControlDataGuid, // VendorGuid=0D + &Attributes, // Attributes=0D + &DataSize, // DataSize=0D + &MemoryOverwriteRequestControlData // Data=0D + );=0D + if (EFI_ERROR (Status) || (DataSize !=3D 1) || (Attributes !=3D TCG_MOR_= VARIABLE_ATTRIBUTES)) {=0D + Result =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + Result =3D EFI_TEST_ASSERTION_PASSED;=0D + }=0D +=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + Result,=0D + gTCGMemoryOverwriteRequestTestFunctionAssertionGuid001,= =0D + L"MemoryOverwriteRequestControl - Validate that the MOR = Variable is created by the platform in accordance with TCG Spec",=0D + L"%a:%d:Status - %r, DataSize - %d, Attributes - %x",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status,=0D + (UINTN)DataSize,=0D + Attributes=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Set MemoryOverwriteRequestControlData bit 0 and verify the platform c= lears bit 0 upon system reset=0D + // MOR bit 0 indicates to platform firmware that system memory must be w= iped during platform initialization=0D + //=0D + DataSize =3D sizeof(MemoryOverwriteRequestControlData);=0D + Attributes =3D TCG_MOR_VARIABLE_ATTRIBUTES;=0D + MemoryOverwriteRequestControlData |=3D MOR_BIT_HIGH << MOR_CLEAR_MEMORY_= BIT_OFFSET;=0D +=0D + Status =3D gtRT->SetVariable (=0D + L"MemoryOverwriteRequestControl", // VariableName=0D + &gEfiMemoryOverwriteControlDataGuid, // VendorGuid=0D + Attributes, // Attributes=0D + DataSize, // DataSize=0D + &MemoryOverwriteRequestControlData // Data=0D + );=0D + if (Status =3D=3D EFI_SUCCESS) {=0D + Result =3D EFI_TEST_ASSERTION_PASSED;=0D + }else {=0D + Result =3D EFI_TEST_ASSERTION_FAILED;=0D + }=0D +=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + Result,=0D + gTCGMemoryOverwriteRequestTestFunctionAssertionGuid002,= =0D + L"MemoryOverwriteRequestControl - SetVariable() with MOR= bit 0 set high returns EFI_SUCCESS",=0D + L"%a:%d:Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D +=0D + // Cold reset system again for step 2=0D + SctPrint (L"System will cold reset after 1 second and test will be resum= ed after reboot.");=0D + gtBS->Stall (1000000);=0D + gtRT->ResetSystem (=0D + EfiResetCold,=0D + EFI_SUCCESS,=0D + 0,=0D + NULL=0D + );=0D +=0D +MOR_BIT_CLEAR_ON_RESET:=0D + //=0D + // Clear Step count and increment checkpoint for next test=0D + //=0D +=0D + ResetData->Step =3D 0;=0D + ResetData->CheckpointStep =3D CONTROL_SET_VARIABLE_TEST;=0D +=0D + Status =3D RecoveryLib->WriteResetRecord (=0D + RecoveryLib,=0D + sizeof (RESET_DATA),=0D + (UINT8*)ResetData=0D + );=0D + if (EFI_ERROR(Status)) {=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + EFI_TEST_ASSERTION_FAILED,=0D + gTestGenericFailureGuid,=0D + L"TestRecoveryLib - WriteResetRecord",=0D + L"%a:%d:Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + return Status;=0D + }=0D +=0D + //=0D + // Check if the platform has cleared the set MOR bit 0 on reset=0D + //=0D + DataSize =3D sizeof(MemoryOverwriteRequestControlData);=0D + Attributes =3D TCG_MOR_VARIABLE_ATTRIBUTES;=0D +=0D + Status =3D gtRT->GetVariable (=0D + L"MemoryOverwriteRequestControl", // VariableName=0D + &gEfiMemoryOverwriteControlDataGuid, // VendorGuid=0D + &Attributes, // Attributes=0D + &DataSize, // DataSize=0D + &MemoryOverwriteRequestControlData // Data=0D + );=0D + if (EFI_ERROR (Status) || (MOR_CLEAR_MEMORY_VALUE (MemoryOverwriteReques= tControlData) !=3D MOR_BIT_LOW)) {=0D + Result =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + Result =3D EFI_TEST_ASSERTION_PASSED;=0D + }=0D +=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + Result,=0D + gTCGMemoryOverwriteRequestTestFunctionAssertionGuid003,= =0D + L"MemoryOverwriteRequestControl - Validate that MOR bit = 0 is cleared after a cold reset when the bit 0 is initially set",=0D + L"%a:%d:Status - %r",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D +=0D + //=0D + // Verify MemoryOverwriteRequestControlLock is created as defined in TCG= spec=0D + //=0D + DataSize =3D sizeof(MemoryOverwriteRequestControlLockData);=0D + Attributes =3D TCG_MOR_VARIABLE_ATTRIBUTES;=0D +=0D + Status =3D gtRT->GetVariable (=0D + L"MemoryOverwriteRequestControlLock", // Variable= Name=0D + &gEfiMemoryOverwriteRequestControlLockGuid, // VendorGu= id=0D + &Attributes, // Attribut= es=0D + &DataSize, // DataSize= =0D + &MemoryOverwriteRequestControlLockData // Data=0D + );=0D + if (EFI_ERROR (Status) || (MemoryOverwriteRequestControlLockData !=3D MO= R_LOCK_DATA_UNLOCKED) ||=0D + (DataSize !=3D 1) || (Attributes !=3D TCG_MOR_VARIABLE_ATTRIBUTES)) = {=0D + Result =3D EFI_TEST_ASSERTION_FAILED;=0D + } else {=0D + Result =3D EFI_TEST_ASSERTION_PASSED;=0D + }=0D +=0D + StandardLib->RecordAssertion (=0D + StandardLib,=0D + Result,=0D + gTCGMemoryOverwriteRequestTestFunctionAssertionGuid004,= =0D + L"MemoryOverwriteRequestControlLock - Validate that MORL= OCK is created by the platform in accordance with TCG Spec",=0D + L"%a:%d:Status - %r, DataSize - %d, Attributes - %x",=0D + __FILE__,=0D + (UINTN)__LINE__,=0D + Status,=0D + (UINTN)DataSize,=0D + Attributes=0D + );=0D + if (EFI_ERROR (Status)) {=0D + return Status;=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOve= rwriteRequest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.c b/uefi-sct= /SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteRequest/BlackBo= xTest/TCGMemoryOverwriteRequestBBTestMain.c new file mode 100644 index 000000000000..db01df9db5e2 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TCGMemoryOverwriteR= equest/BlackBoxTest/TCGMemoryOverwriteRequestBBTestMain.c @@ -0,0 +1,115 @@ +/** @file=0D +=0D + Copyright 2006 - 2016 Unified EFI, Inc.
=0D + Copyright (c) 2023, Arm Inc. All rights reserved.
=0D +=0D + This program and the accompanying materials=0D + are licensed and made available under the terms and conditions of the BS= D License=0D + which accompanies this distribution. The full text of the license may b= e found at=0D + http://opensource.org/licenses/bsd-license.php=0D +=0D + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D +=0D +**/=0D +/*++=0D +=0D +Module Name:=0D +=0D + TCG2MORTestMain.c=0D +=0D +Abstract:=0D +=0D + for EFI Driver TCG MemoryOverwriteRequest Test=0D +=0D +--*/=0D +#include "SctLib.h"=0D +#include "TCGMemoryOverwriteRequestBBTestMain.h"=0D +=0D +EFI_GUID gEfiMemoryOverwriteControlDataGuid =3D MEMORY_ONLY_RESET_CONTROL_= GUID;=0D +=0D +EFI_GUID gEfiMemoryOverwriteRequestControlLockGuid =3D MEMORY_OVERWRITE_RE= QUEST_CONTROL_LOCK_GUID;=0D +=0D +EFI_BB_TEST_PROTOCOL_FIELD gEfiTCGMemoryOverwriteRequestTestProtocolField = =3D {=0D + TCG_MOR_TEST_REVISION,=0D + EFI_TCG_MOR_TEST_GUID,=0D + L"TCG MemoryOverwriteRequest Test",=0D + L"TCG MemoryOverwriteRequest Functionality Test"=0D +};=0D +=0D +EFI_GUID gSupportProtocolGuid1[2] =3D {=0D + EFI_STANDARD_TEST_LIBRARY_GUID,=0D + EFI_NULL_GUID=0D +};=0D +=0D +EFI_BB_TEST_ENTRY_FIELD gLoadTCGMemoryOverwriteRequestEntryField[] =3D {=0D +=0D + {=0D + EFI_TCG_MOR_TEST_ENTRY_GUID0101,=0D + L"Test MOR and MORLOCK",=0D + L"Test for MOR and MORLOCK EFI variables in accordance with TCG spec",= =0D + EFI_TEST_LEVEL_DEFAULT,=0D + gSupportProtocolGuid1,=0D + EFI_TEST_CASE_AUTO,=0D + BBTestTCGMemoryOverwriteRequestFunctionTest=0D + },=0D +=0D + EFI_NULL_GUID=0D +};=0D +=0D +EFI_BB_TEST_PROTOCOL *gTCGMemoryOverwriteRequestTestProt;=0D +=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +UnloadTCGMemoryOverwriteRequestTest (=0D + IN EFI_HANDLE ImageHandle=0D + );=0D +=0D +/**=0D + * Creates/installs the BlackBox Interface and eminating Entry Point node= list.=0D + * @param ImageHandle The test driver image handle=0D + * @param SystemTable Pointer to System Table=0D + * @return EFI_SUCCESS Indicates the interface was installed=0D + * @return EFI_OUT_OF_RESOURCES Indicates space for the new handle could = not be allocated=0D + * @return EFI_INVALID_PARAMETER: One of the parameters has an invalid va= lue.=0D + */=0D +EFI_STATUS=0D +EFIAPI=0D +InitializeTestTCGMemoryOverwriteRequest (=0D + IN EFI_HANDLE ImageHandle,=0D + IN EFI_SYSTEM_TABLE *SystemTable=0D + )=0D +{=0D + //=0D + // initialize test utility lib=0D + //=0D + EfiInitializeTestLib (ImageHandle, SystemTable);=0D + SctInitializeLib (ImageHandle, SystemTable);=0D +=0D + return EfiInitAndInstallBBTestInterface (=0D + &ImageHandle,=0D + &gEfiTCGMemoryOverwriteRequestTestProtocolField,=0D + gLoadTCGMemoryOverwriteRequestEntryField,=0D + UnloadTCGMemoryOverwriteRequestTest,=0D + &gTCGMemoryOverwriteRequestTestProt=0D + );=0D +}=0D +=0D +=0D +/**=0D + * Unloads the BlackBox Interface and the Entry Point list.=0D + * @param ImageHandle The image handle.=0D + * @return EFI_SUCCESS The interface was uninstalled successfully.=0D + */=0D +EFI_STATUS=0D +EFIAPI=0D +UnloadTCGMemoryOverwriteRequestTest (=0D + IN EFI_HANDLE ImageHandle=0D + )=0D +{=0D + return EfiUninstallAndFreeBBTestInterface (=0D + ImageHandle,=0D + gTCGMemoryOverwriteRequestTestProt=0D + );=0D +}=0D diff --git a/uefi-sct/SctPkg/CommonGenFramework.sh b/uefi-sct/SctPkg/Common= GenFramework.sh index fb9043b56bca..886e7eb7596b 100755 --- a/uefi-sct/SctPkg/CommonGenFramework.sh +++ b/uefi-sct/SctPkg/CommonGenFramework.sh @@ -226,6 +226,7 @@ then if [ -e $ProcessorType/RiscVBootProtocolBBTest.efi ]; then cp $ProcessorType/RiscVBootProtocolBBTest.efi $Framewor= k/Test/ > NUL fi + cp $ProcessorType/TCGMemoryOverwriteRequestBBTest.efi $Framework/= Test/ > NUL =20 # ********************************************* # Copy ENTS binary diff --git a/uefi-sct/SctPkg/Config/Data/Category.ini b/uefi-sct/SctPkg/Con= fig/Data/Category.ini index b34d35db9ac8..bf02ccea9218 100644 --- a/uefi-sct/SctPkg/Config/Data/Category.ini +++ b/uefi-sct/SctPkg/Config/Data/Category.ini @@ -165,6 +165,13 @@ InterfaceGuid =3D AFF115FB-387B-4C18-8C41-6AFC7F03BB90 Name =3D RuntimeServicesTest\MiscRuntimeServicesTest=0D Description =3D=0D =0D +[Category Data]=0D +Revision =3D 0x00010000=0D +CategoryGuid =3D 265E661D-D51E-454B-BBC9-665F46EC0A04=0D +InterfaceGuid =3D AFF115FB-387B-4C18-8C41-6AFC7F03BB90=0D +Name =3D RuntimeServicesTest\TCGMemoryOverwriteRequestTest=0D +Description =3D Test TCG Platform Reset Attack Mitigation EFI variables= =0D +=0D [Category Data]=0D Revision =3D 0x00010000=0D CategoryGuid =3D 5B1B31A1-9562-11D2-8E3F-00A0C969723B=0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107834): https://edk2.groups.io/g/devel/message/107834 Mute This Topic: https://groups.io/mt/100803328/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-