From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.92.42.25]) by mx.groups.io with SMTP id smtpd.web08.18084.1611690530392634442 for ; Tue, 26 Jan 2021 11:48:50 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=ASm9dxNX; spf=pass (domain: outlook.com, ip: 40.92.42.25, mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R0yf5c3iI6AdTFxz4hfvMVN+ZufNORmHTZNsXpKMejfc5Y+Gmln25qGMrZDCyui5mLSyUG/5tPYoao4Dg/cQ+pKqZfl2iRYJhtJie2HIT+qrHrJwPY+Vk5oOBWnpNNQ1402zaulD0rPrxFvwY8l6QHBHwB0YR1s3Xhf7zM6bwSHE2lImr5HR6ALfunlPvXxQfUx8byuEMXu8Y0RjDOGYIC/S+CYD/btimLGMZc56I47IKJpQJcCh7AkV49Sxq6s3Ki10ukiyoeXIqWOQ+NAAx1PRiOwy4XzaqO5u3fLjleWVTeA/RCp/gb6vW1TwLmFQriN6FvBqkl1AWICJweM4yw== 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=dJ5c3SHes+AKFWaunL1t6g7KHiVgIDK4+k6rT6guRQs=; b=IbNvt9mDyuvIPl+ffW/eQNDMEGRLjbQrr3mqcPUQAZzU7HnfAUGGeTasAPvf9aaDqbR5RaW193STQQ+2I7QMkLXWoYX7dIoxBCYQnJTV2heiQ5XCQtDXspYIP4aQ5LMWyfDnC5BgUElIcKh4Mm8rHKV8fDaZoSqoWB7XBDdHoX7s1s3mkaV1B1AsjdSuWODHb/ujZRFccXqILh/b/f5pkKw0CGV4TZNcT9OR5RwSYC4nT7pbcdxx6vIgsnsH5t3QdGjkkHTXSpKPqCiC9ubC+PgTOjsmk1WBw3uNTWfpaEsgjmntXzJuswt0kjHlJRFDU+E6Qn2xCW1mc6KyoJSCSQ== 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=dJ5c3SHes+AKFWaunL1t6g7KHiVgIDK4+k6rT6guRQs=; b=ASm9dxNX3FTn10g3uGu4qlzSpabUcrhy5a6Nt2xULT5gsqrHruLFghRDfbGzIEyM00P7a0kT2vhybOJJD1eeA8Cn+/XPo6mbvhbIoL+5C1qjZDmi+syjjX/N+tNDiozpIZrTey9vKjdHzUwV6NmSFF8wwaFq/PQDHpHIIpbaUHHpuPz9sS3iSzQtk5h9OLSm/z/OBMZGSf8+EY+VgmFsRfABISniUoifgNUpPWyf3BiQ8n2nG1A+HSiCaSxfeeMV3SttnVbFVvl3tsEmj2nuJuJ+stkbL4OvKmWHhWw3vyff0fm70iTPtxCmv466ttekaiSFXqLFT1y2elw4Ghkgtg== Received: from BN7NAM10FT059.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e8f::53) by BN7NAM10HT140.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e8f::75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11; Tue, 26 Jan 2021 19:48:49 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:7e8f::4c) by BN7NAM10FT059.mail.protection.outlook.com (2a01:111:e400:7e8f::447) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Tue, 26 Jan 2021 19:48:49 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:226CAB68DFF6CC392259A8FC5561587A1798DBCF559FF7DF5FAD25DF40B4DBBC;UpperCasedChecksum:02006F74390AC0A4EBC13AC8DCAD16BCD516BB858550CB7B8848EC939EA58E83;SizeAsReceived:7381;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%6]) with mapi id 15.20.3784.017; Tue, 26 Jan 2021 19:48:49 +0000 From: "Kun Qin" To: devel@edk2.groups.io CC: Eric Dong , Ray Ni , Laszlo Ersek , Rahul Kumar Subject: [PATCH v4 19/20] UefiCpuPkg: CpuIo2Smm: Support of CpuIo driver under StandaloneMm Date: Tue, 26 Jan 2021 11:48:32 -0800 Message-ID: X-Mailer: git-send-email 2.30.0.windows.1 X-TMN: [TtIvIniCU7qOkRp/FZ7vB5Z+P3X0DO9G] X-ClientProxiedBy: CO2PR04CA0192.namprd04.prod.outlook.com (2603:10b6:104:5::22) To MWHPR06MB3102.namprd06.prod.outlook.com (2603:10b6:301:3e::35) Return-Path: kun.q@outlook.com X-Microsoft-Original-Message-ID: <20210126194833.2322-1-kun.q@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (50.35.88.161) by CO2PR04CA0192.namprd04.prod.outlook.com (2603:10b6:104:5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Tue, 26 Jan 2021 19:48:48 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 0489e968-6292-4a44-555d-08d8c233664c X-MS-TrafficTypeDiagnostic: BN7NAM10HT140: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tsgeQWZaxa7qobYklzS4fhRTNBUY/rpSFzrJgOjCiOpP+OCw5nIuf92Uqpr+1IGkZJh2iVt1WVMweXYIefWUGrKi4+ZcKPbmYuwFlhUtVl1B07OOFeEhxS7fwWsxx6JFP12OnN/U8nIFwilforYVnkk0iQesT1ma41esEsXwFed9X4H98dBFCAzcJTfzwrcGy85XElqhY2JpznS+yBxbTl4MVkbe86zgyND/+0jQKCG43M3BYK6+1WO1BsLjmm+YDavVddxa41gqZ+EL9OKD/I3jsxj4hTVnYghaFVMxED1gDB97B6dXKSpAAVXXjjcwpDfn5EL+g8Un0+6X88RVs+bdh9RigHrNtr3YXpTKRDWicTUwU/5KJIyntRzo2p4XkPOuHBndi+MBoBXsv2FsyA== X-MS-Exchange-AntiSpam-MessageData: qKESKpEAE+XyFREQRlo3XeCjI/V00VyAxZ2mDd/ccJ52Eh+Cz7C99qkypklRkdlxH8qhUQUWLAUAszFgXGbeZtVF+BrDEEfVcrwXdvjc5F19EpuItY3dofthwalEpMP8hahVR2VOQqSd3gBbsHBVqw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0489e968-6292-4a44-555d-08d8c233664c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2021 19:48:49.0353 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: BN7NAM10FT059.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: BN7NAM10HT140 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain This change adds a new CpuIo driver instance for MM_STANDALONE type. The new driver entrypoint is implemented in a separate file to match the interface definition of MM_STANDALONE modules. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Signed-off-by: Kun Qin --- Notes: v4: - Break SMM instance abstraction and file renaming into a separate patch [Ray] =20 v3: - Revert file name change of "CpuIo2Smm" for review and git history concern [Laszlo] - Break driver entrypoint into separate patch [Laszlo] =20 v2: - Removed "EFIAPI" for internal functions. UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.c | 32 ++++++++++++++ UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf | 45 ++++++++++++++++++++ UefiCpuPkg/UefiCpuPkg.dsc | 5 +++ 3 files changed, 82 insertions(+) diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.c b/UefiCpuPkg/CpuIo2S= mm/CpuIo2StandaloneMm.c new file mode 100644 index 000000000000..9cff4b7166db --- /dev/null +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.c @@ -0,0 +1,32 @@ +/** @file + Produces the SMM CPU I/O Protocol. + +Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation. +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +#include "CpuIo2Mm.h" + +/** + The module Entry Point for Standalone MM CpuIoProtocol driver + + @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval Other Some error occurs when executing this entry point. + +**/ +EFI_STATUS +EFIAPI +StandaloneMmCpuIo2Initialize ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *SystemTable + ) +{ + return CommonCpuIo2Initialize (); +} diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf b/UefiCpuPkg/CpuIo= 2Smm/CpuIo2StandaloneMm.inf new file mode 100644 index 000000000000..ec37a9d9198a --- /dev/null +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf @@ -0,0 +1,45 @@ +## @file +# Produces the SMM CPU I/O 2 Protocol by using the services of the I/O Li= brary. +# +# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D CpuIo2StandaloneMm + FILE_GUID =3D E3121A26-BB1C-4A18-8E23-2EA3F0412248 + MODULE_TYPE =3D MM_STANDALONE + VERSION_STRING =3D 1.0 + PI_SPECIFICATION_VERSION =3D 0x00010032 + ENTRY_POINT =3D StandaloneMmCpuIo2Initialize + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + CpuIo2StandaloneMm.c + CpuIo2Mm.c + CpuIo2Mm.h + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + StandaloneMmDriverEntryPoint + BaseLib + DebugLib + IoLib + MmServicesTableLib + BaseMemoryLib + +[Protocols] + gEfiSmmCpuIo2ProtocolGuid ## PRODUCES + +[Depex] + TRUE diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc index c3c27afff88e..9128cef076dd 100644 --- a/UefiCpuPkg/UefiCpuPkg.dsc +++ b/UefiCpuPkg/UefiCpuPkg.dsc @@ -38,6 +38,7 @@ [LibraryClasses] UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/U= efiRuntimeServicesTableLib.inf UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBoo= tServicesTableLib.inf UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf + StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint= /StandaloneMmDriverEntryPoint.inf DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableL= ib.inf PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf @@ -96,6 +97,9 @@ [LibraryClasses.common.DXE_SMM_DRIVER] HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuE= xceptionHandlerLib.inf =20 +[LibraryClasses.common.MM_STANDALONE] + MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/Standalon= eMmServicesTableLib.inf + [LibraryClasses.common.UEFI_APPLICATION] UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiA= pplicationEntryPoint.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf @@ -126,6 +130,7 @@ [Components.IA32, Components.X64] NULL|UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.in= f } UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf + UefiCpuPkg/CpuIo2Smm/CpuIo2StandaloneMm.inf UefiCpuPkg/CpuMpPei/CpuMpPei.inf UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf --=20 2.30.0.windows.1