From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (NAM02-CY1-obe.outbound.protection.outlook.com [40.92.4.34]) by mx.groups.io with SMTP id smtpd.web11.1082.1610663819289259657 for ; Thu, 14 Jan 2021 14:36:59 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=Lt6/TewU; spf=pass (domain: outlook.com, ip: 40.92.4.34, mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LfQ7AqfzTyIkWoj2RbKQuZR/UyjAM3BDNK/jnEIAxbCnjppMY3l9wT6A/XTCPvi3613IEjtidF79/62ul77apgZsbQVQOSsGu25wsUaR2qfUVlCZI+fFbR0MWQZx/kQ82I6sMV7BdRp5ikB8oBAOOePYQucs5B5xy7vLsY6PqdFRivlXIC7paZ2vZB+v5ffa4/8T6cqx02KH+65YqNnKAnQoz4Sjb3jFaIVYOUMc0iNmiN/DWf2mrqejiuPUGblaPnh3ZO0nF4FmnnyhlekoVm350LUum5Fvr09MkjAqz12kih37f3+LEL5z/BoZK/+kWdimqMxbqXJGGsKAgnoiog== 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=KULxvd5VHAAV8FR4OZHL1yd5xL2CvhBd9+qJMmb8es8=; b=eK3yKyauzDCc26Ak7ncyAVY5HKIWXkpLRHpufuF6OW7MhUHeqL8hYEQcH8ACTymap0gSrsn9Si1SziBOm2RYTLpntyUnzYb4VT/5ZiuVe+k+dD3L0jO9Cq9d1opSsJlakDTfDsVirF037iNfGlfSgYNLeSm5wU/VH4Vm0JOwC502LRCcfTgcRDqjwdkBZ61KSeenxgr/ouzfwrVuSlxebxMZXzyHpayUh8Rrf6R2PmOx9J4s/cWdIoGOfNoHXfj8kviySQXDsFktBPOGuT7Ln0pX5qF+UaL4sgFTYYtcj6uUs7J5gq4gZtkMUdSIEGonZSoj9JUj/4j6Nda1+cgXgA== 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=KULxvd5VHAAV8FR4OZHL1yd5xL2CvhBd9+qJMmb8es8=; b=Lt6/TewUkD/yhXyQSBih3WZEkXjk4N+6uxTw9ZTxHnMkwDIC90c6yDY6lhh5zq4zfm2LwH4Y1FFlWVWd0uuPauXZF3NUvzO1c4Twdkr5virObW/aUGM+wEqUkxSxcCbxf9qUSdr6qn4Q5Bc8axy3Cvbhcfvf6LqPL1PHg1FWIGDoHyzO1rbvHZCGm5gRok1wFRUzfu/C62CxMFCmVT6UE9ZwtXq3FuUXXkz2XfBOzIglPwSEAxeQjA1Ohki8QonSQBZnLjCae6rFuIFujm9OU6D1ODDB7rTani0iLYjCBD+n+98UHmZeI+EXc/ZI8pbp0QZOSLyrizSBvboLOi7Opw== Received: from CY1NAM02FT023.eop-nam02.prod.protection.outlook.com (10.152.74.60) by CY1NAM02HT150.eop-nam02.prod.protection.outlook.com (10.152.74.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Thu, 14 Jan 2021 22:36:58 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:7e45::41) by CY1NAM02FT023.mail.protection.outlook.com (2a01:111:e400:7e45::237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Thu, 14 Jan 2021 22:36:58 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:10B8EA4FDA87EE327B151F6823F22986CCE1013350CC84D5B6DB0F3B828E6EF0;UpperCasedChecksum:D533FF864996227CB10D87082EF4AB84220D2A681A4E9C410EA6F825CE3ECB68;SizeAsReceived:7468;Count:47 Received: from MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::acb3:ab69:563d:b0d6]) by MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::acb3:ab69:563d:b0d6%5]) with mapi id 15.20.3742.012; Thu, 14 Jan 2021 22:36:58 +0000 From: "Kun Qin" To: devel@edk2.groups.io CC: Eric Dong , Ray Ni , Laszlo Ersek , Rahul Kumar Subject: [PATCH v3 16/18] UefiCpuPkg: CpuIo2Smm: Move CpuIo2Smm driver to consume gMmst Date: Thu, 14 Jan 2021 14:36:35 -0800 Message-ID: X-Mailer: git-send-email 2.30.0.windows.1 In-Reply-To: <20210114223637.2737-1-kun.q@outlook.com> References: <20210114223637.2737-1-kun.q@outlook.com> X-TMN: [eXleuBmQzjn2uh00tzEJhBzansADq7jv] X-ClientProxiedBy: MW4PR04CA0389.namprd04.prod.outlook.com (2603:10b6:303:81::34) To MWHPR06MB3102.namprd06.prod.outlook.com (2603:10b6:301:3e::35) Return-Path: kun.q@outlook.com X-Microsoft-Original-Message-ID: <20210114223637.2737-12-kun.q@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (50.35.88.161) by MW4PR04CA0389.namprd04.prod.outlook.com (2603:10b6:303:81::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10 via Frontend Transport; Thu, 14 Jan 2021 22:36:58 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: f6922928-476d-4192-5587-08d8b8dce74e X-MS-TrafficTypeDiagnostic: CY1NAM02HT150: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /u9bXSWEXUxVcZF1LPaNQMJuTdJDCdwu9ZlIsjyJMGpx7ctSwr+3Ga6+3T9qZWwy4BJkvwF/u9LRqfnt5bAXEEPg0c98nJZUhF2cWknY/w+iJKS0CPx6GPgPzBo7vZgY7k1CsTqsWWgBfZa434ajvqJy9Q8h+wGTzLseWY0tRGFWt04+TM55ri+NgbFuHyiGTwYfL5WopP/RrL9eyxPN4sMNNU2VZxNskB9tHYuz6Ia0yMBcOQF3MA9MmwUoWWK8 X-MS-Exchange-AntiSpam-MessageData: sjU9xXcqQupxkP03C2KnxcTVU7j6gMhArhufBj0ZofWYt8e+ACULLDLet+SGjcrKFu/+VVPI8KKjgNGFdk6/10KouGghdCdRgJvmycSAouZ2nLtFvXeR7DXpmUO9uewTyNzzmz8htuLdsRC0B5X40g== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2021 22:36:58.5561 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-Network-Message-Id: f6922928-476d-4192-5587-08d8b8dce74e X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT023.eop-nam02.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: CY1NAM02HT150 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain This change replaced gSmst with gMmst to support broader compatibility under MM environment for CpuIo2Smm driver. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Signed-off-by: Kun Qin --- Notes: v3: - Break gMmst replacement into separate PR [Laszlo] =20 v2: - Removed "EFIAPI" for internal functions. UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c | 6 +++--- UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h | 2 +- UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf | 2 +- UefiCpuPkg/UefiCpuPkg.dsc | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c b/UefiCpuPkg/CpuIo2Smm/CpuIo2= Smm.c index b840d3e10cae..c0a2baecee03 100644 --- a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.c @@ -390,12 +390,12 @@ SmmCpuIo2Initialize ( // // Copy the SMM CPU I/O Protocol instance into the System Management Sys= tem Table // - CopyMem (&gSmst->SmmIo, &mSmmCpuIo2, sizeof (mSmmCpuIo2)); + CopyMem (&gMmst->MmIo, &mSmmCpuIo2, sizeof (mSmmCpuIo2)); =20 // - // Install the SMM CPU I/O Protocol into the SMM protocol database + // Install the SMM CPU I/O Protocol into the MM protocol database // - Status =3D gSmst->SmmInstallProtocolInterface ( + Status =3D gMmst->MmInstallProtocolInterface ( &mHandle, &gEfiSmmCpuIo2ProtocolGuid, EFI_NATIVE_INTERFACE, diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h b/UefiCpuPkg/CpuIo2Smm/CpuIo2= Smm.h index 4c133b58c9f4..c80261945f71 100644 --- a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.h @@ -16,7 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include -#include +#include #include =20 #define MAX_IO_PORT_ADDRESS 0xFFFF diff --git a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf b/UefiCpuPkg/CpuIo2Smm/CpuI= o2Smm.inf index bc78fa4e42d2..b743a5e0e316 100644 --- a/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf +++ b/UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf @@ -34,7 +34,7 @@ [LibraryClasses] BaseLib DebugLib IoLib - SmmServicesTableLib + MmServicesTableLib BaseMemoryLib =20 [Protocols] diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc index b2b6d78a71b0..9b56bcaabebe 100644 --- a/UefiCpuPkg/UefiCpuPkg.dsc +++ b/UefiCpuPkg/UefiCpuPkg.dsc @@ -89,6 +89,7 @@ [LibraryClasses.common.DXE_DRIVER] =20 [LibraryClasses.common.DXE_SMM_DRIVER] SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableL= ib.inf + MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.= inf MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAlloc= ationLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuE= xceptionHandlerLib.inf --=20 2.30.0.windows.1