From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.158.5]) by mx.groups.io with SMTP id smtpd.web10.5108.1631966043144133999 for ; Sat, 18 Sep 2021 04:54:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=DL18XGXK; spf=pass (domain: linux.ibm.com, ip: 148.163.158.5, mailfrom: stefanb@linux.ibm.com) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18IAxb05023593; Sat, 18 Sep 2021 07:54:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=ehQ6kGX9Gzpnwx7emdtOVDiLv6tknWUZ+wCg4tOAkHo=; b=DL18XGXKDqPmmsmsZUh5gBOlmKE+Jqi5dT1ZJaJK7kGtzZZSFypN5jkwiZEVZqs/soLG db46mKjgO0QmS/Q8+PaTLQnYzo68trlFOaiB+EwhhgbuDjyrhQQnShtFrlke/gw6zr5y E1LInr+c9+I8i+VqwTH2rvA0V8KODvfnOyXgggLC8NRBaDLntKNf2A37MwhKJCDYphtQ Z1bE1vSNI/uk/JeeIPHPPhApPKU3qyNjra4k7bOKo09MX8yCTdAUz6ZKEhxbH7mVaymc Z1u2QGY2285oaunUQ06tnyE/2Tot79YsSOD8yGPaWkowvPTWCGbQMEkAMz4+y/rf2oCG Dw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3b5eumrj0p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 18 Sep 2021 07:54:00 -0400 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 18IBjo81006196; Sat, 18 Sep 2021 07:53:59 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0b-001b2d01.pphosted.com with ESMTP id 3b5eumrj0k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 18 Sep 2021 07:53:59 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 18IBrFc5020745; Sat, 18 Sep 2021 11:53:58 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma01wdc.us.ibm.com with ESMTP id 3b57r8vdh2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 18 Sep 2021 11:53:58 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 18IBrwL811665974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 Sep 2021 11:53:58 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 31E242805C; Sat, 18 Sep 2021 11:53:58 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 01E592805A; Sat, 18 Sep 2021 11:53:57 +0000 (GMT) Received: from [9.47.158.152] (unknown [9.47.158.152]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Sat, 18 Sep 2021 11:53:57 +0000 (GMT) Subject: Re: [edk2-devel] [RFC PATCH 1/3] ArmVirtPkg/TPM: Add a NULL implementation of TpmPlatformHierarchyLib To: Ard Biesheuvel , edk2-devel-groups-io Cc: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Gerd Hoffmann , Jiewen Yao , Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Stefan Berger References: <20210916211752.2714332-1-stefanb@linux.ibm.com> <20210916211752.2714332-2-stefanb@linux.ibm.com> From: "Stefan Berger" Message-ID: <7fae5700-234e-5b63-6d36-19a3c393148f@linux.ibm.com> Date: Sat, 18 Sep 2021 07:53:57 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: KJNAq0_ZwdyXxNJXxPkikL1SYBqbfMhg X-Proofpoint-ORIG-GUID: pHU2X01g9UVLV6A8vowrr4HPx54HyX0C X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-18_03,2021-09-17_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 priorityscore=1501 adultscore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109180080 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 9/18/21 3:55 AM, Ard Biesheuvel wrote: > On Thu, 16 Sept 2021 at 23:18, Stefan Berger wrote: >> From: Stefan Berger >> >> Add a NULL implementation of the library class TpmPlatformHierarchyLib. >> > This patch introduces both the library class and the NULL > implementation, right? No, we already added the library class when adding the 'foundation' for x86 support: https://github.com/tianocore/edk2/tree/master/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib > >> Cc: Ard Biesheuvel >> Cc: Leif Lindholm >> Cc: Sami Mujawar >> Cc: Gerd Hoffmann >> Signed-off-by: Stefan Berger >> --- >> ArmVirtPkg/ArmVirtPkg.dec | 1 + >> .../Include/Library/TpmPlatformHierarchyLib.h | 27 +++++++++++++++++ >> .../PeiDxeTpmPlatformHierarchyLib.c | 22 ++++++++++++++ >> .../PeiDxeTpmPlatformHierarchyLib.inf | 30 +++++++++++++++++++ >> 4 files changed, 80 insertions(+) >> create mode 100644 ArmVirtPkg/Include/Library/TpmPlatformHierarchyLib.h >> create mode 100644 ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c >> create mode 100644 ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf >> >> diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec >> index 4e4d758015..f3bdca118b 100644 >> --- a/ArmVirtPkg/ArmVirtPkg.dec >> +++ b/ArmVirtPkg/ArmVirtPkg.dec >> @@ -27,6 +27,7 @@ >> >> [LibraryClasses] >> ArmVirtMemInfoLib|Include/Library/ArmVirtMemInfoLib.h >> + TpmPlatformHierarchyLib|Include/Library/TpmPlatformHierarchyLib.h >> >> [Guids.common] >> gArmVirtTokenSpaceGuid = { 0x0B6F5CA7, 0x4F53, 0x445A, { 0xB7, 0x6E, 0x2E, 0x36, 0x5B, 0x80, 0x63, 0x66 } } >> diff --git a/ArmVirtPkg/Include/Library/TpmPlatformHierarchyLib.h b/ArmVirtPkg/Include/Library/TpmPlatformHierarchyLib.h >> new file mode 100644 >> index 0000000000..8d61a4867b >> --- /dev/null >> +++ b/ArmVirtPkg/Include/Library/TpmPlatformHierarchyLib.h >> @@ -0,0 +1,27 @@ >> +/** @file >> + TPM Platform Hierarchy configuration library. >> + >> + This library provides functions for customizing the TPM's Platform Hierarchy >> + Authorization Value (platformAuth) and Platform Hierarchy Authorization >> + Policy (platformPolicy) can be defined through this function. >> + >> +Copyright (c) 2019, Intel Corporation. All rights reserved.
>> +Copyright (c) Microsoft Corporation.
>> +SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#ifndef TPM_PLATFORM_HIERARCHY_LIB_H_ >> +#define TPM_PLATFORM_HIERARCHY_LIB_H_ >> + >> +/** >> + This service will perform the TPM Platform Hierarchy configuration at the SmmReadyToLock event. >> + >> +**/ >> +VOID >> +EFIAPI >> +ConfigureTpmPlatformHierarchy ( >> + VOID >> + ); >> + >> +#endif >> diff --git a/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c b/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c >> new file mode 100644 >> index 0000000000..bac1efda63 >> --- /dev/null >> +++ b/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.c >> @@ -0,0 +1,22 @@ >> +/** @file >> + Null TPM Platform Hierarchy configuration library. >> + >> + This library provides stub functions for customizing the TPM's Platform Hierarchy. >> + >> + Copyright (c) 2021, IBM Corporation. >> + SPDX-License-Identifier: BSD-2-Clause-Patent >> + >> +**/ >> + >> +#include >> + >> +/** >> + A NULL implementation of ConfigureTpmPlatformHierarchy. >> +**/ >> +VOID >> +EFIAPI >> +ConfigureTpmPlatformHierarchy ( > VOID Ok , had copied signature 1:1 from here: https://github.com/tianocore/edk2/blob/master/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c#L239 > >> + ) >> +{ >> + /* no nothing */ > double negative :-) Typo. Will fix. > >> +} >> diff --git a/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf b/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf >> new file mode 100644 >> index 0000000000..4f02818bbc >> --- /dev/null >> +++ b/ArmVirtPkg/Library/PeiDxeTpmPlatformHierarchyLibNull/PeiDxeTpmPlatformHierarchyLib.inf >> @@ -0,0 +1,30 @@ >> +### @file >> +# NULL TPM Platform Hierarchy configuration library. >> +# >> +# This library provides functions for customizing the TPM's Platform Hierarchy >> +# Authorization Value (platformAuth) and Platform Hierarchy Authorization >> +# Policy (platformPolicy) can be defined through this function. >> +# >> +# Copyright (c) 2019, Intel Corporation. All rights reserved.
>> +# Copyright (c) Microsoft Corporation.
>> +# >> +# SPDX-License-Identifier: BSD-2-Clause-Patent >> +# >> +### >> + >> +[Defines] >> + INF_VERSION = 0x00010005 > 1.27 Originally all comes from this file here: https://github.com/tianocore/edk2/blob/master/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf#L16 >> + BASE_NAME = PeiDxeTpmPlatformHierarchyLibNull > Make this BasePlatform.... Even though it will be different than here? https://github.com/tianocore/edk2/blob/master/SecurityPkg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.inf#L17 > >> + FILE_GUID = 8947A3F2-BfB4-45EF-968D-5C40C1CE6A58 >> + MODULE_TYPE = PEIM > BASE > >> + VERSION_STRING = 1.0 >> + LIBRARY_CLASS = TpmPlatformHierarchyLib|PEIM DXE_DRIVER >> + >> +[LibraryClasses] >> + BaseLib >> + >> +[Packages] >> + MdePkg/MdePkg.dec >> + >> +[Sources] >> + PeiDxeTpmPlatformHierarchyLib.c >> -- >> 2.31.1 >> >> >> >> ------------ >> Groups.io Links: You receive all messages sent to this group. >> View/Reply Online (#80830): https://edk2.groups.io/g/devel/message/80830 >> Mute This Topic: https://groups.io/mt/85662429/5717338 >> Group Owner: devel+owner@edk2.groups.io >> Unsubscribe: https://edk2.groups.io/g/devel/unsub [ardb+tianocore@kernel.org] >> ------------ >> >>