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 []) by mx.groups.io with SMTP id smtpd.web10.18114.1611690454769792371 for ; Tue, 26 Jan 2021 11:47:36 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=N3ar8bHS; spf=softfail (domain: outlook.com, ip: , mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jub1n2ib1wLwfYnGS6B97fvdfXSozsSqQtVFmRKCkiG7s6wlA4kUM2hbHuzGpeW+PrAvMEAABTHwqeEaGFIhlQuVjr9KKCjWiN85I3FzuWZ2XpH8LmjBfOjFT0hl1kUbofepIOstcVZgbHACDq5lo9Gmzgpm/4wHhKHqe3FRizNmTATw3HUdWS3usBt+h1lLm1RPgr69+Vis5wgX0nk7in53CyuwYmOVoesg9/QG5J41eIF/+P8+Ef9gmZhA3H3cHhezmxkCLSgeEAqmQCzb6Ybh0kwylzMniOR4R3Robg1mGqXKMPAkPSu78KqwRXkmS34QUYuGHeQoJ/EnGVxJNQ== 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=+5+8IhAp0r7zhNo6fnWZkL3WkwF3npRPgbrmayoJ9t8=; b=k93LQpNNY+HJzC21iIKODdOV6rKABUZAt2cpHEud78MgRB5RLj72iiMnrFKfKpp6LUYzU8y0eeCEDXt0nqpHb61Mn5pWEhkAB8+euSTIzPLpsrdp87ajxGlCJbjCCNzKKiKSMJYtZdQHHuTFImmuO/1uE3AEOsTlguCSQ4w1KNIb5AgRgQLAC91euj6M/mpln9hHzDJ/ndbu7IAgyCca4TujWHVMD74jyslzC4srLx6nxrCXU29Fcah89AAxGDp4UeM7v4GllAXOstwqQP8Cfkws1TUJWASN7wMoOdbdVrJu3FumQvz3vboJzPDATBFuRN+WLkpwdCumzPvQ1ZFp4A== 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=+5+8IhAp0r7zhNo6fnWZkL3WkwF3npRPgbrmayoJ9t8=; b=N3ar8bHS9LSQnUQE0GG9rB+VRZ+WKyirKZrO3L4UwVB38mUHecLL/1KSWcUZ7DPsOUTQU9Rd1V0Yz0itCsLVSmh1q4l2/jzSP3UIPZCbk1L9gcPMcB7V1+xvp9ObhwDQB38xiCTJ6pm1Czfe/agpL3RpjalJDEAk2lDVprR+zFqkXA4IyjSCuePAxFesYWoAvNFd7m6lBHVyITJUoHhA6tjusO8rJvQQ+8kYoJKozpVXr0OHiNJ38NpuXGDQpeBuWR+jDJbQiNxaYGVTYul1VWLGlsvZUCJyrda6x2A6sB5hYhReVdPgEFbRu4LhEi2igO7Od7/uOspQ0K+th3B35w== Received: from BN7NAM10FT059.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e8f::53) by BN7NAM10HT180.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e8f::322) 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:47:34 +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:47:34 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:701ED54BE7B69376F89E59075BFEE6FE679DDA23FF8B414F2FF62FBA3B2044A8;UpperCasedChecksum:E0DE08C58ECC192B87E178CFC2F9BFE71A0A4072589DE1E1B2FB73FF910F825F;SizeAsReceived:7473;Count:47 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:47:34 +0000 From: "Kun Qin" To: devel@edk2.groups.io CC: Eric Dong , Ray Ni , Laszlo Ersek , Rahul Kumar Subject: [PATCH v4 17/20] UefiCpuPkg: CpuIo2Smm: Move CpuIo2Smm driver to consume gMmst Date: Tue, 26 Jan 2021 11:47:07 -0800 Message-ID: X-Mailer: git-send-email 2.30.0.windows.1 In-Reply-To: <20210126194710.2248-1-kun.q@outlook.com> References: <20210126194710.2248-1-kun.q@outlook.com> X-TMN: [vyDa2K3MHvjkiei6HRC9CCixXjqcOPPV] X-ClientProxiedBy: MWHPR11CA0001.namprd11.prod.outlook.com (2603:10b6:301:1::11) To MWHPR06MB3102.namprd06.prod.outlook.com (2603:10b6:301:3e::35) Return-Path: kun.q@outlook.com X-Microsoft-Original-Message-ID: <20210126194710.2248-15-kun.q@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (50.35.88.161) by MWHPR11CA0001.namprd11.prod.outlook.com (2603:10b6:301:1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.14 via Frontend Transport; Tue, 26 Jan 2021 19:47:31 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 3d981f94-d639-4193-a087-08d8c2333859 X-MS-TrafficTypeDiagnostic: BN7NAM10HT180: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YR2y/PS06aampg286rdA/7oqaG8Zeg4v7vclhRe2R4VO3Mo3dRzgqz7MUFWVWAsGBWFXz4ft2lHSDb8G9cXyefPr5jX5qS6Xk3ws9iD7lpaSXtgkc/bt1gbPgiBP9n2zwhLrcSpP7Gw/C3ptiAhl7jZRHgwBiYEdOX9E1B00buFImV/s7ijUsa8A7CnBNNQE9an4puMn3Zl6l6Wak5sFGoHUoaz1fU3Vd8iRT65LKVJe9zKuLvmKqwwKUbN4XDQr X-MS-Exchange-AntiSpam-MessageData: ntNWsJszIX8V0x/4PGGBwLivONxcEPx0kbLL8rjqhCjfMY4hrNcOhXPbc1L7oALseruwZBs4Pm3cHPpzsQ3gJHBEMkwTFRWc1PC03d88ENGTLNgUgkeesSKFE87Hn0vP4wga53hRrYGC3Yg1WrKwIg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d981f94-d639-4193-a087-08d8c2333859 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2021 19:47:32.0591 (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: BN7NAM10HT180 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 Reviewed-by: Laszlo Ersek Reviewed-by: Ray Ni --- Notes: v4: - Added reviewed-by tag [Laszlo] - Added reviewed-by tag [Ray] =20 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 5834eafaa200..c3c27afff88e 100644 --- a/UefiCpuPkg/UefiCpuPkg.dsc +++ b/UefiCpuPkg/UefiCpuPkg.dsc @@ -91,6 +91,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