From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.6980.1614564317516321393 for ; Sun, 28 Feb 2021 18:05:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=NNks9Mli; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: hao.a.wu@intel.com) IronPort-SDR: bPFv8SVQazoHedWyRvZnHNrVNClgLI2oOfWcrd4XpZmmZRFnS2tfU8kPTAG8InXf3fjHh2RZMh OAHN6d8tK38A== X-IronPort-AV: E=McAfee;i="6000,8403,9909"; a="182931163" X-IronPort-AV: E=Sophos;i="5.81,214,1610438400"; d="scan'208";a="182931163" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2021 18:05:16 -0800 IronPort-SDR: bl3zfwxKKwxX/RwguJsuEDW834+DyFfAmM6bCQuCwJXS/Bu11+qhluA/FtXAUy/lHdfhN7tplh cRrTR6ukn0yA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,214,1610438400"; d="scan'208";a="504343879" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga001.fm.intel.com with ESMTP; 28 Feb 2021 18:05:15 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sun, 28 Feb 2021 18:05:15 -0800 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sun, 28 Feb 2021 18:05:15 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Sun, 28 Feb 2021 18:05:15 -0800 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.41) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Sun, 28 Feb 2021 18:05:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XN90coa79gHKvNoUC3npNZZZybWDlYS+0PxKuUbgaMgPrjcjLsyP6D7038cf3W9IEVahzVjNrtGwW5scgH7CF9demRgyjZT+0Cuj6xdNga9UFd73eEvFRGXybeL+zJqtUGyAosiT0cVlLAPViWNLl0FLRLAj3yUWX0VD3Gci89x7yJwHe6L8nTkZ8hmJR1w0H1qVvgfIUUllowce9WfM32dvvGCAkZWLY6sFO2SgwCfwiGcTyOQqH8MbpfxE1hiwJ0Sy0bXox6n/cxjEdX4eq7VbMYAlqU/8odc6sB25U5t103SuCvDbTCbxkAMxOddGEu8aYASsstb/rOe89YHNjQ== 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=xkLsNaP5CnXS1NOhkWdmeDAGqdkTj7Mkxa9ZbrK6dRw=; b=nAhqFlGEMoYgnnrMMLAJ4ENkQA6Jbr4xi3CR11FSbQ1uMWYVTbzEXa08Eu8wDhq1v7xZ7TNMWoFOAAEebLzPmLF4RLftEAUEjTQr90TwIEsKKLAJYrarFVg9NkNcSa8S7s8zN1GaY9pkmcPP6IGwhH0o72QtEaShawCNf1XrDBUjfK8SKjS1WLufVuT3Y11PI2KG0BC5CRpURwutuJ24tOzHgeLd9YJEglj7LGTgbMBzkOHA5OoRxzbYimpcAi0soG0Bsz57IG/3Thx5h6q3ptW83HJmCU16uugnFgqQhFJuu2Bg3297k+nUO/DxP/DAD03oiKQr0/i6MwVTK7blgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xkLsNaP5CnXS1NOhkWdmeDAGqdkTj7Mkxa9ZbrK6dRw=; b=NNks9Mli0wTXHNWyncSclTcCNeJ1P/XxhSI4wnubmPzPKD2870nZ6QVQX0Wshmk3gS5OEHAzxvBWersy4irNI23QS/4QafzM4Bs5fsiqB2aKpprBXaLczoU8QoJrv65TJmEP4LUqTRjWWeERL0puMXVVXNtYOQLn513AoXCnNGU= Received: from BN8PR11MB3666.namprd11.prod.outlook.com (2603:10b6:408:8c::19) by BN6PR11MB1714.namprd11.prod.outlook.com (2603:10b6:404:47::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.28; Mon, 1 Mar 2021 02:05:13 +0000 Received: from BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::9d91:6348:53a9:cb20]) by BN8PR11MB3666.namprd11.prod.outlook.com ([fe80::9d91:6348:53a9:cb20%7]) with mapi id 15.20.3890.023; Mon, 1 Mar 2021 02:05:13 +0000 From: "Wu, Hao A" To: Kun Qin , "devel@edk2.groups.io" CC: "Kinney, Michael D" , Liming Gao , "Liu, Zhiguang" , "Yao, Jiewen" Subject: Re: [PATCH v3 1/7] MdePkg: MmUnblockMemoryLib: Added definition and null instance Thread-Topic: [PATCH v3 1/7] MdePkg: MmUnblockMemoryLib: Added definition and null instance Thread-Index: AQHXDJIftUldmfkETk6S58Yq3M3NP6puZQBQ Date: Mon, 1 Mar 2021 02:05:13 +0000 Message-ID: References: <20210226225158.1378-1-kun.q@outlook.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: outlook.com; dkim=none (message not signed) header.d=none;outlook.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.218] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b6a34c3d-4a54-4607-c978-08d8dc56738e x-ms-traffictypediagnostic: BN6PR11MB1714: x-ms-exchange-minimumurldomainage: tianocore.org#6026 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WLbp11agJ3+doejpIS+4rFeXdISrJK8A+532DDznIF2o1ymy8DCMpdgFNX7yk6P583y9OzfEaVPt9l3SDYD3lxNU5llkP4NIXTJaccpyLZoXk43OWYoEDvvv438HvC52SFVjot6k5gm8NgDSNnt8BL8mIZ1ExEae8WD+ERdMaplXDp9ZlXZDAfcoQW2NI8V0ybrKDL2fpjA2uBhoYLyLrZ1mZNOeoOtQLw1a5PJp1ATyiU5VXspS7RuoQBTPX2Wbf1Nu64yjGMrn0qrzEzAeWPDV/S8AaJQxbsXw1RlIrmzBYy66C0VmzQMHKX/uhC0vAvJxexawWtDlvSMOGp/LYsPuu9cRw76zTimQnn//FxId6L1jK7L/jCUh936t32YfRAwC76c5QEHjnUfCc0+SjFx6IBMARnwI1i4b6o8F+WnYDkYBs7ojOGHVi8Rs8PjjLGqu9H0etrab6CTnYSPgZ05zd8Hwh/FJaacXdAs8PMh7S4vH6h9BAcz3pi8cArjE+XvTUoBQUn6MngWAxtgDpZ87fhGDm8pWyUMMWwXa9T2t7ZpvdCvBkHf7K8YyHGyUoUYtFSsrLnAquerGjVAcjQRcSTUX94Tl7pMwIDFnJ4Y= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR11MB3666.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(346002)(376002)(396003)(136003)(366004)(39860400002)(2906002)(33656002)(83380400001)(107886003)(66556008)(26005)(186003)(54906003)(6506007)(76116006)(71200400001)(64756008)(66446008)(4326008)(110136005)(53546011)(66946007)(52536014)(86362001)(7696005)(66476007)(8676002)(5660300002)(478600001)(8936002)(966005)(55016002)(9686003)(316002)(45080400002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?CQquti5IC1c0O93bQS5gqfJlif1ECzXj69k8St9OiQYA5sGNrH3wxe7ek7ZI?= =?us-ascii?Q?0Sd1Vjvu1wTfbNNM6UGx05WeTe/7njv28tWmZotfmeJ2yAEerLHsTkdKVso6?= =?us-ascii?Q?4TidbLBfo9rrw2dttNm8IANhlAQOLe0Kq98GTbELubXJhVCZA4wxY7eQCOzG?= =?us-ascii?Q?02WUI5G8w8I6bf6Q8W/9GyU3Xdcofa6QmPUEROpAWjrlt/XIPei15lJLV2PO?= =?us-ascii?Q?lRDYA9/mdJ9DXkWK8s3fOvvWw3wbiTJq95hKEzwiQUiPw5Z5i0EIKo4EMlIw?= =?us-ascii?Q?EHV54/+UBAyUKiLVRbhrd9TgkSbRG8Z/5aqoEE5E7LAWoryW3yuJb0TzzG/x?= =?us-ascii?Q?q/vDRBXIKgp+oECFrxSEP+JQLQICqPUDX9BgIcaLh3wBjbbtRfFBCD9W0H72?= =?us-ascii?Q?soeVydQwTH3q++EWXywLylLwdlfBd7im8qORI6bMW1uWp72HjGRLgyvWI4vM?= =?us-ascii?Q?y5XlHzse/4fkKJ90b/pHgZKtI2p2x3jtbO1rMbqIXK9MK+DMhx9cVYN9i8hc?= =?us-ascii?Q?6LRWiBrpF84b1pgbyLI6GMlEloVCu/lxj1SQ7nJ6iHh/Tyzm4kqKtXWG+Tx+?= =?us-ascii?Q?FmkGPw+EEQQGRUwnKIy9Azrxbo8VbAbrL5DS0UvZia9QEZw92rY457oHakdo?= =?us-ascii?Q?doin+xSnoTAu4eaPPBTReZLsX+/nd9bA11+9yujeq0IVnH8igWO4WHzp1f9a?= =?us-ascii?Q?P2q/JSDfY0V3Rk5CEtIZ/XB2lo2jw5D0WYayFMfZJEVv4dvXH/5yEFHqfVTr?= =?us-ascii?Q?Ozcl9lfFSQ5Hu1GdXDAXX21jH9JmtCYTADyHul3OMtRQ7r3ufXYilsX6DEHb?= =?us-ascii?Q?tlT4S6h/s6Vte7z8YDQ3r+rN+9Jyx3bi+T2EzLQpcNXE6GWEJf/hNQfLIVhV?= =?us-ascii?Q?4DC8dz8ISvdJksUjH58Msop9F+iGJojLjKDAlsN9y9kA9fIaa1t/PZ7MXTWj?= =?us-ascii?Q?hvbC87D8usVvmBmnkWS0joAW+xMe5XHA7b1YVhQgZdCRHDD/3ibzvhYOPH5g?= =?us-ascii?Q?EWES6C0UphkIbRMOaQ9F5W60UIuhLxXYnI3DSVgeRXA5kqI9Y+4atvoZei39?= =?us-ascii?Q?BLTnGyB/4fWINfeGJXFHGhQqU7s2OipJAmdjEMEvUxpnQGczH8JJLCRft9JA?= =?us-ascii?Q?HRa2tI7xVH0zQU6fzeAhmDe5NPLMDd3jteCpb4+6IRIq4JLUsUTO0Z0MuUs+?= =?us-ascii?Q?Av2QocJtvIRtV9z+LlfkfS3txob+3zJDAIAZNZFgDWX43x0xt1XmkCn68rsc?= =?us-ascii?Q?jMX/M28QLpfIJjD6qW5J6UdNUOvTmlfjigDKN5JoV6Rt1aCU6JniZZvx4+Hg?= =?us-ascii?Q?YfbUqlBbTLosuoNcnveZpbN2?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3666.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6a34c3d-4a54-4607-c978-08d8dc56738e X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2021 02:05:13.6191 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Ecfe/dx2nqe2G0cIDLmovvDZBKXVqo7pd3ot9vDeioSlIVdObABV3o5AG5b3sEtLZSLmLAAi3lkx9yOqq1A26g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1714 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Kun Qin > Sent: Saturday, February 27, 2021 6:52 AM > To: devel@edk2.groups.io > Cc: Kinney, Michael D ; Liming Gao > ; Liu, Zhiguang ; Wu, > Hao A ; Yao, Jiewen > Subject: [PATCH v3 1/7] MdePkg: MmUnblockMemoryLib: Added definition > and null instance >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3168 >=20 > This interface definition provides an abstraction layer for applicable dr= ivers to > request certain memory blocks to be mapped/unblocked for accessibility > inside MM environment. >=20 > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Hao A Wu > Cc: Jiewen Yao >=20 > Signed-off-by: Kun Qin > --- >=20 > Notes: > v3: > - Move interface to MdePkg [Hao, Liming, Jiewen] > - Remove Dxe prefix [Jiewen] >=20 > v2: > - Resend with practical usage. No change [Hao] >=20 > MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.c | 40 > ++++++++++++++++++++ > MdePkg/Include/Library/MmUnblockMemoryLib.h | 40 > ++++++++++++++++++++ > MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf | > 29 ++++++++++++++ Hello Kun, Could you help to add a UNI file for this library instance? Best Regards, Hao Wu > MdePkg/MdePkg.dec | 5 +++ > MdePkg/MdePkg.dsc | 1 + > 5 files changed, 115 insertions(+) >=20 > diff --git > a/MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.c > b/MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.c > new file mode 100644 > index 000000000000..ed9a45587b64 > --- /dev/null > +++ > b/MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.c > @@ -0,0 +1,40 @@ > +/** @file > + Null instance of MM Unblock Page Library. > + > + This library provides an abstraction layer of requesting certain page > + access to be unblocked by MM environment if applicable. > + > + Copyright (c) Microsoft Corporation. > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > + > +/** > + This API provides a way to unblock certain data pages to be accessible > inside MM environment. > + > + @param UnblockAddress The address of buffer caller requests = to > unblock, the address > + has to be page aligned. > + @param NumberOfPages The number of pages requested to be > unblocked from MM > + environment. > + > + @return EFI_SUCCESS The request goes through successfully. > + @return EFI_NOT_AVAILABLE_YET The requested functionality is not > produced yet. > + @return EFI_UNSUPPORTED The requested functionality is not > supported on current platform. > + @return EFI_SECURITY_VIOLATION The requested address failed to pass > security check for > + unblocking. > + @return EFI_INVALID_PARAMETER Input address either NULL pointer or > not page aligned. > + @return EFI_ACCESS_DENIED The request is rejected due to system > has passed certain boot > + phase. > + > +**/ > +EFI_STATUS > +EFIAPI > +MmUnblockMemoryRequest ( > + IN EFI_PHYSICAL_ADDRESS UnblockAddress, > + IN UINT64 NumberOfPages > + ) > +{ > + return EFI_UNSUPPORTED; > +} > diff --git a/MdePkg/Include/Library/MmUnblockMemoryLib.h > b/MdePkg/Include/Library/MmUnblockMemoryLib.h > new file mode 100644 > index 000000000000..adff8ddc8063 > --- /dev/null > +++ b/MdePkg/Include/Library/MmUnblockMemoryLib.h > @@ -0,0 +1,40 @@ > +/** @file > + MM Unblock Memory Library Interface. > + > + This library provides an abstraction layer of requesting certain page > + access to be unblocked by MM environment if applicable. > + > + Copyright (c) Microsoft Corporation. > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef MM_UNBLOCK_MEMORY_LIB_H_ > +#define MM_UNBLOCK_MEMORY_LIB_H_ > + > +/** > + This API provides a way to unblock certain data pages to be accessible > inside MM environment. > + > + @param UnblockAddress The address of buffer caller requests = to > unblock, the address > + has to be page aligned. > + @param NumberOfPages The number of pages requested to be > unblocked from MM > + environment. > + > + @return EFI_SUCCESS The request goes through successfully. > + @return EFI_NOT_AVAILABLE_YET The requested functionality is not > produced yet. > + @return EFI_UNSUPPORTED The requested functionality is not > supported on current platform. > + @return EFI_SECURITY_VIOLATION The requested address failed to pass > security check for > + unblocking. > + @return EFI_INVALID_PARAMETER Input address either NULL pointer or > not page aligned. > + @return EFI_ACCESS_DENIED The request is rejected due to system > has passed certain boot > + phase. > + > +**/ > +EFI_STATUS > +EFIAPI > +MmUnblockMemoryRequest ( > + IN EFI_PHYSICAL_ADDRESS UnblockAddress, > + IN UINT64 NumberOfPages > +); > + > +#endif // MM_UNBLOCK_MEMORY_LIB_H_ > diff --git > a/MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf > b/MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf > new file mode 100644 > index 000000000000..4c1f3d1c8e87 > --- /dev/null > +++ > b/MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf > @@ -0,0 +1,29 @@ > +## @file > +# Null instance of MM Unblock Page Library. > +# > +# This library provides an abstraction layer of requesting certain > +page access to be unblocked # by MM environment if applicable. > +# > +# Copyright (c) Microsoft Corporation. > +# SPDX-License-Identifier: BSD-2-Clause-Patent # # ## > + > +[Defines] > + INF_VERSION =3D 0x0001001B > + BASE_NAME =3D MmUnblockMemoryLibNull > + FILE_GUID =3D 9E890F68-5C95-4C31-95DD-59E6286F85E= A > + MODULE_TYPE =3D BASE > + VERSION_STRING =3D 1.0 > + LIBRARY_CLASS =3D MmUnblockMemoryLib > + > +# > +# VALID_ARCHITECTURES =3D IA32 X64 > +# > + > +[Sources] > + MmUnblockMemoryLibNull.c > + > +[Packages] > + MdePkg/MdePkg.dec > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index > 3928db65d188..32a9e009c813 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -257,6 +257,11 @@ [LibraryClasses] > # > UnitTestHostBaseLib|Test/UnitTest/Include/Library/UnitTestHostBaseLib.= h >=20 > + ## @libraryclass This library provides an interface for DXE drivers = to > request MM environment > + # to map/unblock a memory region for accessibility inside MM. > + # > + MmUnblockMemoryLib|Include/Library/MmUnblockMemoryLib.h > + > [LibraryClasses.IA32, LibraryClasses.X64] > ## @libraryclass Abstracts both S/W SMI generation and detection. > ## > diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index > ce009086815f..79629e3f93ba 100644 > --- a/MdePkg/MdePkg.dsc > +++ b/MdePkg/MdePkg.dsc > @@ -168,6 +168,7 @@ [Components.IA32, Components.X64] > MdePkg/Library/SmmPciExpressLib/SmmPciExpressLib.inf > MdePkg/Library/SmiHandlerProfileLibNull/SmiHandlerProfileLibNull.inf > MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf > + MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf >=20 > [Components.EBC] > MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > -- > 2.30.0.windows.1