From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.2463.1628213602408030380 for ; Thu, 05 Aug 2021 18:33:22 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=GWs3wbl4; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [167.220.2.74]) by linux.microsoft.com (Postfix) with ESMTPSA id 077A320B36EA; Thu, 5 Aug 2021 18:33:22 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 077A320B36EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1628213602; bh=1AgCdlkAZVe4fE9u+GQygTQ4jQeNTIN1aFMnYL8ykqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GWs3wbl4DCRmzqrpgg/diWsmEKtov+aO7VgQyeyOArlBtJL50TPxMIqrnBocnjqLX gFcWIkL74jW1XyLuBjeLC0WCWlolWqUBuZBCigbVptimvsPSApJ5wH2x6pIGEShdWR yUcc/jjlbWClLH6lfx4b8PYwZbkRDJJCNZbB0TAs= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-platforms][PATCH v2 3/5] MinPlatformPkg/TestPointCheckLib: Fix incorrect array index Date: Thu, 5 Aug 2021 21:32:48 -0400 Message-Id: <20210806013250.2928-4-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20210806013250.2928-1-mikuback@linux.microsoft.com> References: <20210806013250.2928-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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. Also defines a macro "TEST_POINT_INDEX_BYTE6_SMM" for the byte index 6 value. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: Michael Kubacki --- Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPoin= tCheckLib.c | 26 +++++++++++--------- Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h = | 1 + 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib= /SmmTestPointCheckLib.c b/Platform/Intel/MinPlatformPkg/Test/Library/Test= PointCheckLib/SmmTestPointCheckLib.c index 4b4f874c7bbc..75200969d3e7 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTes= tPointCheckLib.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTes= tPointCheckLib.c @@ -109,7 +109,7 @@ TestPointSmmEndOfDxeSmrrFunctional ( EFI_STATUS Status; BOOLEAN Result; =20 - if ((mFeatureImplemented[5] & TEST_POINT_BYTE6_SMM_END_OF_DXE_SMRR_FUN= CTIONAL) =3D=3D 0) { + if ((mFeatureImplemented[TEST_POINT_INDEX_BYTE6_SMM] & TEST_POINT_BYTE= 6_SMM_END_OF_DXE_SMRR_FUNCTIONAL) =3D=3D 0) { return EFI_SUCCESS; } =20 @@ -125,7 +125,7 @@ TestPointSmmEndOfDxeSmrrFunctional ( TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, NULL, - 5, + TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_END_OF_DXE_SMRR_FUNCTIONAL ); } @@ -156,7 +156,8 @@ TestPointSmmReadyToLockSmmMemoryAttributeTableFunctio= nal ( EFI_STATUS Status; BOOLEAN Result; =20 - if ((mFeatureImplemented[6] & TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SMM_M= EMORY_ATTRIBUTE_TABLE_FUNCTIONAL) =3D=3D 0) { + if ((mFeatureImplemented[TEST_POINT_INDEX_BYTE6_SMM] & + TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SMM_MEMORY_ATTRIBUTE_TABLE_FUNCTI= ONAL) =3D=3D 0) { return EFI_SUCCESS; } =20 @@ -173,7 +174,7 @@ TestPointSmmReadyToLockSmmMemoryAttributeTableFunctio= nal ( TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, NULL, - 6, + TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SMM_MEMORY_ATTRIBUTE_TABLE_FUNC= TIONAL ); } @@ -202,7 +203,8 @@ TestPointSmmReadyToLockSecureSmmCommunicationBuffer ( EFI_MEMORY_ATTRIBUTES_TABLE *MemoryAttributesTable; UINTN MemoryAttributesTableSize; =20 - if ((mFeatureImplemented[6] & TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECUR= E_SMM_COMMUNICATION_BUFFER) =3D=3D 0) { + if ((mFeatureImplemented[TEST_POINT_INDEX_BYTE6_SMM] & + TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECURE_SMM_COMMUNICATION_BUFFER) = =3D=3D 0) { return EFI_SUCCESS; } =20 @@ -248,7 +250,8 @@ TestPointSmmReadyToBootSmmPageProtection ( EFI_STATUS Status; BOOLEAN Result; =20 - if ((mFeatureImplemented[6] & TEST_POINT_BYTE6_SMM_READY_TO_BOOT_SMM_P= AGE_LEVEL_PROTECTION) =3D=3D 0) { + if ((mFeatureImplemented[TEST_POINT_INDEX_BYTE6_SMM] + & TEST_POINT_BYTE6_SMM_READY_TO_BOOT_SMM_PAGE_LEVEL_PROTECTION) =3D=3D= 0) { return EFI_SUCCESS; } =20 @@ -264,7 +267,7 @@ TestPointSmmReadyToBootSmmPageProtection ( TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, NULL, - 6, + TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_BOOT_SMM_PAGE_LEVEL_PROTECTION ); } @@ -280,7 +283,7 @@ TestPointSmmReadyToBootSmmPageProtection ( TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, NULL, - 6, + TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECURE_SMM_COMMUNICATION_BUFF= ER ); } @@ -312,7 +315,8 @@ TestPointSmmReadyToBootSmmPageProtectionHandler ( TEST_POINT_SMM_COMMUNICATION_UEFI_GCD_MAP_INFO *CommData; UINTN TempCommBufferSize= ; =20 - if ((mFeatureImplemented[6] & TEST_POINT_BYTE6_SMM_READY_TO_BOOT_SMM_P= AGE_LEVEL_PROTECTION) =3D=3D 0) { + if ((mFeatureImplemented[TEST_POINT_INDEX_BYTE6_SMM] + & TEST_POINT_BYTE6_SMM_READY_TO_BOOT_SMM_PAGE_LEVEL_PROTECTION) =3D=3D= 0) { return EFI_SUCCESS; } =20 @@ -390,14 +394,14 @@ TestPointSmmReadyToBootSmmPageProtectionHandler ( TestPointLibSetFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, NULL, - 6, + TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECURE_SMM_COMMUNICATION_BUFF= ER ); } else { TestPointLibClearFeaturesVerified ( PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV, NULL, - 6, + TEST_POINT_INDEX_BYTE6_SMM, TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECURE_SMM_COMMUNICATION_BUFF= ER ); } diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheck= Lib.h b/Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h index 7265e2268961..73c30522179c 100644 --- a/Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h +++ b/Platform/Intel/MinPlatformPkg/Include/Library/TestPointCheckLib.h @@ -738,6 +738,7 @@ TestPointSmmExitBootServices ( #define TEST_POINT_SMM_READY_TO_BOOT = L" - SMM Ready To Boot - " #define TEST_POINT_SMM_EXIT_BOOT_SERVICES = L" - SMM Exit Boot Services - " =20 +#define TEST_POINT_INDEX_BYTE6_SMM = 6 #define TEST_POINT_BYTE6_SMM_END_OF_DXE_SMRR_FUNCTIONAL = BIT0 #define TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SMM_MEMORY_ATTRIBUTE_TABLE_FU= NCTIONAL BIT1 #define TEST_POINT_BYTE6_SMM_READY_TO_LOCK_SECURE_SMM_COMMUNICATION_BUFF= ER BIT2 --=20 2.28.0.windows.1