From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.92.41.18]) by mx.groups.io with SMTP id smtpd.web12.707.1614884311815223693 for ; Thu, 04 Mar 2021 10:58:32 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=q+Tcokkz; spf=pass (domain: outlook.com, ip: 40.92.41.18, mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NQp+W+jZgXltBgdc9IwEwU2HpHtJTnbsxFdQFmAuVMrcmaSYoD7xDgJAdjILhyXp4DZM3DaargFddCppmdCZUA/QKK5/AywVqQkYzIuM+0e2STBtX8db02DrNeniApDA4OI/vWXIoWM6A1kbQtDxeSx3r0VRY6uit/fjRBMdx0fTgUTv4ODca0Wf62JgcbBQUE5wOCnzjh9ww/iq15AUusFXaruTi6dH//oSS5z/m7dDoz4TJlz6ApHyBR9YhK2A9osdEZJwOtq+bnnD8y2WY2hS5Dwr+gVvfiQYTVvrVw+Vm+ofGBvQv5p8Aq3jiq8xTJnO90Xf5yVSWEyKbEv73g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ks6EM6VGgDKBCQLUhfC+UqxkVtJFSZt7+Z2iJwK0Zns=; b=GNtTGWK2orQA7J1onLu+sVO4Y08vlDTHhe/Nnkr5bL1YRlavPKBKxgHTHeVJ3y1pYEojHYSQTIEr2zc7zVit/YdJIZ1MyogQwSW0d09c413TqgGfAyHnslGVMuDXZwayd0SILO+TUM0OBUE5z9f15Ypxfakzei5OGBSzrd0Kh2oKU3kOVe478pEIKDzTsH9gkQoAFCU0hla8phSxPjZV+WYeZXQRt9X7mg8l3lrAJ57oy0e5a+ufVpT4DkLZd4CQ2opt0CIops3i4UFNu9OxSsozKyf2Idf8J3A3sBEmFC/Bx8jStjY2odPLPKgY9Fxq7D8+BT6jmClZ59/SPNvJBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ks6EM6VGgDKBCQLUhfC+UqxkVtJFSZt7+Z2iJwK0Zns=; b=q+TcokkzztqVIPNiyffUag2VG6A7YJD97qCp+YZUXo/+aEP6WNxsg/2PewtiuVjrX1Hr9CkbPZWHN4YjF5jydBrOzinO+gy/YE3GbXbit6JdL4kq/aGIkKrsQ9KCir7gCXqNzHESIW8f7Co872FG5P62a6nrpjL+gaaetBPgugBotFjxahRD8PvQL3LtTd0RtbsnOzUBB7VvHgyHjLou5Nds/jraF2HsIhib+MYQ3AJMKTr1I3t0yZnbk8Or+TY1M1mrEU0F0rzqUrqmKH0+aikqoAWjHMozTodJf/xihhUpp6FAwnjUURADZoqrW4cXixvk8WfLwjHSXHCjShWaYQ== Received: from MW2NAM10FT057.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e87::40) by MW2NAM10HT238.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e87::81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Thu, 4 Mar 2021 18:58:30 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:7e87::4c) by MW2NAM10FT057.mail.protection.outlook.com (2a01:111:e400:7e87::229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Thu, 4 Mar 2021 18:58:30 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:8BC1DBCB6104A9367BDFB2FAB5437C95F3FF0B2738480FFD6FD4B4303ED21D63;UpperCasedChecksum:955B2888B72BFE680833E3DB0DF4B57726DC8662380572EF7F72C961D24F483E;SizeAsReceived:7671;Count:45 Received: from MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::d4ee:1260:6f53:3f7b]) by MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::d4ee:1260:6f53:3f7b%7]) with mapi id 15.20.3890.028; Thu, 4 Mar 2021 18:58:30 +0000 From: "Kun Qin" To: devel@edk2.groups.io CC: Michael D Kinney , Liming Gao , Zhiguang Liu , Jiewen Yao , Jian J Wang , Hao A Wu , Laszlo Ersek , Ard Biesheuvel , Jordan Justen , Qi Zhang , Rahul Kumar Subject: [PATCH v5 0/7] Add MmUnblockMemoryLib Interface and Usages Date: Thu, 4 Mar 2021 10:58:07 -0800 Message-ID: X-Mailer: git-send-email 2.30.0.windows.1 X-TMN: [yAjy1nmaiQueJwuXPZDJA7fnaAK3wVxG] X-ClientProxiedBy: MW4PR03CA0169.namprd03.prod.outlook.com (2603:10b6:303:8d::24) To MWHPR06MB3102.namprd06.prod.outlook.com (2603:10b6:301:3e::35) Return-Path: kun.q@outlook.com X-Microsoft-Original-Message-ID: <20210304185814.1652-1-kun.q@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (50.35.88.161) by MW4PR03CA0169.namprd03.prod.outlook.com (2603:10b6:303:8d::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.18 via Frontend Transport; Thu, 4 Mar 2021 18:58:29 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 191be110-cd74-4f64-b781-08d8df3f801e X-MS-TrafficTypeDiagnostic: MW2NAM10HT238: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BwmmR9YxbSXwv2cqgiDcoxKk6GWHG7YvXmKV2A35asgIqzp4PDXYwLzilabPH7H17s7jveaaUUxH4O9Qoq5hLP+XOapSNFyu3jHTJ5IB05oHkuY9l+GQ+PxB9enChSlq8qUAEh3HHwdtj6I0vNsQXdzUEEY72OxUih9jdqYtE9lPaonnx95OCGwWsEvvjzZWWcUX6ghN+kYKO3UpG7sdMLOh5Y4YvQZkhSWNGkGdtD0SaxrUD2gFpB8+Fx8ANYWEaGUOkKHh7jD36yMh60UfmRP3JYKpD94ItKbkb+q4TgJNf83cw4MUdImOJOV5KHEeynY4TXfs4AJ5TvykRudIjdnjN2yiiAJ3XG1qAZfZY1n6TWe9pCvYyL1QIIuzRRDxlaVgslY8bektfGXKul7hSSLCVv0iAC6ETh7ZA8Z54idQJN34GIy7gId8Z0adD/3j X-MS-Exchange-AntiSpam-MessageData: nsY4f7HEAtXOtJi4aX/jjCI1S7S9kmfFB33+vH46aWxdv2/OScR3QzQmwA6qY1dGtUDn3mctG7/Jhd6hpJxAp9FTlXwZW7vQW+uwC5EQ2jQheq/sIzBQZe9xBPSF2rgp+ESlPg+8Nx10Jsud79xPNg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 191be110-cd74-4f64-b781-08d8df3f801e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2021 18:58:30.1653 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: MW2NAM10FT057.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2NAM10HT238 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain This patch series is a follow up of previous submission: https://edk2.groups.io/g/devel/message/72343 The module changes are validated on two different physical platforms and QEMU based Q35 plastform. Standalone and traditional MM are both tested to be functional on these systems. v5 patches mainly focus on feedback for reviewed commits in v4 patches, including: a. Adding "Reviewed-by" tags for applicable patch; b. Downgrade EFI_* data types to RETURN_*; Patch v5 branch: https://github.com/kuqin12/edk2/tree/unblock_mem_v5 Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Jiewen Yao Cc: Jian J Wang Cc: Hao A Wu Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Qi Zhang Cc: Rahul Kumar Kun Qin (7): MdePkg: MmUnblockMemoryLib: Added definition and null instance OvmfPkg: resolve MmUnblockMemoryLib (mainly for VariableSmmRuntimeDxe) MdeModulePkg: VariableSmmRuntimeDxe: Added request unblock memory interface SecurityPkg: Tcg2Smm: Switching from gSmst to gMmst SecurityPkg: Tcg2Smm: Separate Tcg2Smm into 2 modules SecurityPkg: Tcg2Smm: Added support for Standalone Mm SecurityPkg: Tcg2Acpi: Added unblock memory interface for NVS region MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c | 42= + MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.c | 44= + SecurityPkg/Tcg/{Tcg2Smm/Tcg2Smm.c =3D> Tcg2Acpi/Tcg2Acpi.c} | 3= 58 ++++---- SecurityPkg/Tcg/Tcg2Smm/Tcg2MmDependencyDxe.c | 48= ++ SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 857= ++++---------------- SecurityPkg/Tcg/Tcg2Smm/Tcg2StandaloneMm.c | 71= ++ SecurityPkg/Tcg/Tcg2Smm/Tcg2TraditionalMm.c | 82= ++ MdeModulePkg/MdeModulePkg.dsc | 1= + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf | 1= + MdePkg/Include/Library/MmUnblockMemoryLib.h | 44= + MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf | 34= + MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.uni | 21= + MdePkg/MdePkg.dec | 5= + MdePkg/MdePkg.dsc | 1= + OvmfPkg/OvmfPkgIa32.dsc | 3= + OvmfPkg/OvmfPkgIa32X64.dsc | 3= + OvmfPkg/OvmfPkgX64.dsc | 3= + SecurityPkg/Include/Guid/TpmNvsMm.h | 68= ++ SecurityPkg/SecurityPkg.ci.yaml | 1= + SecurityPkg/SecurityPkg.dec | 8= + SecurityPkg/SecurityPkg.dsc | 12= + SecurityPkg/Tcg/{Tcg2Smm/Tcg2Smm.inf =3D> Tcg2Acpi/Tcg2Acpi.inf} | = 35 +- SecurityPkg/Tcg/{Tcg2Smm =3D> Tcg2Acpi}/Tpm.asl | = 0 SecurityPkg/Tcg/Tcg2Smm/Tcg2MmDependencyDxe.inf | 43= + SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h | 121= +-- SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf | 27= +- SecurityPkg/Tcg/Tcg2Smm/{Tcg2Smm.inf =3D> Tcg2StandaloneMm.inf} | = 50 +- 27 files changed, 950 insertions(+), 1033 deletions(-) create mode 100644 MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNul= l.c copy SecurityPkg/Tcg/{Tcg2Smm/Tcg2Smm.c =3D> Tcg2Acpi/Tcg2Acpi.c} (72%) create mode 100644 SecurityPkg/Tcg/Tcg2Smm/Tcg2MmDependencyDxe.c create mode 100644 SecurityPkg/Tcg/Tcg2Smm/Tcg2StandaloneMm.c create mode 100644 SecurityPkg/Tcg/Tcg2Smm/Tcg2TraditionalMm.c create mode 100644 MdePkg/Include/Library/MmUnblockMemoryLib.h create mode 100644 MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNul= l.inf create mode 100644 MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNul= l.uni create mode 100644 SecurityPkg/Include/Guid/TpmNvsMm.h copy SecurityPkg/Tcg/{Tcg2Smm/Tcg2Smm.inf =3D> Tcg2Acpi/Tcg2Acpi.inf} (76%= ) rename SecurityPkg/Tcg/{Tcg2Smm =3D> Tcg2Acpi}/Tpm.asl (100%) create mode 100644 SecurityPkg/Tcg/Tcg2Smm/Tcg2MmDependencyDxe.inf copy SecurityPkg/Tcg/Tcg2Smm/{Tcg2Smm.inf =3D> Tcg2StandaloneMm.inf} (52%) --=20 2.30.0.windows.1