From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0611.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe48::611]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4AF4381F53 for ; Thu, 9 Feb 2017 08:40:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fgfRjMubLgVgI83Lo3DY/RgWP4sni5YsUCHFD8SaVaY=; b=vb7I2mN8llYkkNUF0iFQTodqsDs0rfymmB07BgYib1Kmh9usqQGEUMcbml94JPjiRzQTuYZox+ZJZWFCdDB4ziLUldC47WHrppEbHHVHsxNQb/LGJSY9XwsEvUgwljo5FvUmsrR5hFlle+VynImupIXS48B9tn5PLYbs5rsxPas= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by MWHPR12MB1245.namprd12.prod.outlook.com (10.169.204.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Thu, 9 Feb 2017 16:40:39 +0000 From: Leo Duran To: CC: Leo Duran Date: Thu, 9 Feb 2017 10:40:21 -0600 Message-ID: <1486658427-6551-1-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: YTOPR01CA0009.CANPRD01.PROD.OUTLOOK.COM (10.166.147.19) To MWHPR12MB1245.namprd12.prod.outlook.com (10.169.204.149) X-MS-Office365-Filtering-Correlation-Id: b6cacd5e-0749-461e-94f9-08d4510a61af X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan: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VCBrw/I5iQn8AxsOQPjdfaTKvK6FKHFwAanZXXX/o5C8LANmOQ5LffCWDP37O+0e9KVXnwNyFuDIlTax0B4uyfjnEX6uk/KkG39T/dwmBw==; 20:R3Nyy6rc3KIiabyyNw3TEGDLA3p6svsb5Bt246srC9pbp4kq78v4KFwCjWm60ifs+qU3KpMWiYjsi3U4VLBMrBik7rJ3YjvOH9e2rQ7677z6ImmRrIRGxMSySgJWaZ34uUNE6utpgsujBreaNcxh05fkASRhGq+soLJfwtIYpICxtAfyYe3QSSCQwHpesN8s3u2Gm5PtxywSr8fOnhLmS77S2v7F9g+LQizm8I5j/3e7Y14PSFZ7lqvfJ5pt9MW31fUPkT3rhHfqNhdppe52vM15Immdzh5F9SuZCEO8K0cb5Q+DxqEmIsvvzv43L9LtKaSbUgJTXCe2g+PrJ+DOsK4xkpYuozRbfUeK/y6P/i2grjyd8QW2ZH8QVGC4udAmHKYD+a1gLI1+n4Y53MmhVmgD3iEu52BO6yz4l4fd3SN/2X9FRGi4SN1+7PWGtRT8t/2CcJhgxJQqutC3eJlGqPY73P4sLdos8vwx6Pw4qdMMUP/Ops2vXsMZ/QTrJBLe X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123564025)(20161123558025)(20161123555025)(20161123562025)(6072148); SRVR:MWHPR12MB1245; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1245; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1245; 4:O+SpQ208zdzTo3DoTc+trl1pcxsZk0A1jBCz4o7PvT0IdpOinkXQNc7rv0lw3CUpCNcg/4WwIMLPY1tUn7NVHXu+5MGV9OyMi5uufTrc1fKJQAiH1/zIJd2RC8kzSuvCa6yV2Wg86RnUPxDRH/MtS5HOTkvMv+7B7r4XUruVBNXArdR8vbWW7ho5UeGbSa+7U9Ne/nzT0RVmwM7uN2MCZcbVq9ua9U5hKqBOWnuJLCpW7NifHH2eAQomlJBDe5U/fJ/bzR429iXrP7JKm1HNamcIGreUTs8X/5C/Hd6EEACjFbkwiE9xQxea0yrY87ALlI/YNkD1Z2kBBY9nSortsdgwpOJSnSYFvC39617wNFSywM+SXr+wvwK7n8FNKPPcLQn7qKsEFtF6cvOAok6BWilpSnof1PY+JwWaALpJ8MgbM+mas4+T/4qjd1lyqVe5reOglaNUZst1XzlYo0t01aNg2bJ3PzjjHmUxwZA2zrM7huWttZ1gQrfTyUMQIqAVb6tMPVo+qHpsVxuZe8ozus+fF++KsHadouQ9MNk5Kgq+iEfPQouvL5y/Tx1UXl9EmALnZvkpfGKgC6r0VZfyA6phg+FMwVjFnFK48KBWjYYQA4+uHkciLsl0U4PNFu0f X-Forefront-PRVS: 02135EB356 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(7916002)(39860400002)(39840400002)(39410400002)(39450400003)(39850400002)(209900001)(189002)(199003)(101416001)(66066001)(2906002)(47776003)(189998001)(4326007)(305945005)(53416004)(2351001)(105586002)(106356001)(6306002)(50986999)(42186005)(450100001)(5003940100001)(25786008)(92566002)(68736007)(7736002)(50466002)(50226002)(3846002)(6116002)(48376002)(966004)(6486002)(97736004)(81156014)(8676002)(81166006)(36756003)(110136004)(38730400002)(33646002)(6916009)(6666003)(86362001)(53376002)(53936002)(5660300001)(6606295002)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1245; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1245; 23:tiRIRNzTE7+zo97QZf+orwP7iW1ZhZ51D2g4BOejB?= =?us-ascii?Q?BpNA73zhPmvRTSoORoC8fl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4+x6Nettxh5v2m6P2qdUyriy2FfPSe/dYe8pcOoKPROr3cw==; 24:hUAhiuWJh4NrrU7DYDSyMFBrj/gdjAo6rMUYU7bHSWT3VdVwqrqPYVclDgfRv8pcci3VvOiErK7cgBFA+3Jqc5SOfkh9BmVZBMV2dnL6GY0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1245; 7:d6fsjoH8F//TnK1KINPAYIHnRvCBiQhg9KIgkCt6nBY9wPAA/MPHBvy8j+4VxbV9v8Al4QEWfkDzmINp6WybmuFLQaI7GOv6C8bOCds5RYPpzl2tKMSnR4p0yWttxOb4mijEFRhLaK9In9QUyh2Vg24Dbj+RDrSqO+WJiS9U6GkL/GhjanqYR6b12ClvTbVk1gN00d1LJ6E0ZAdVuoJfcmzFPkcwm3J4TLrI3KQZzziwz+pdxSrT0U1pgo165H11m23jpYg574MP8D8+IXQJQquK9kUt0GCT0So0GExnoYflY+QNZLYQPPqKM9irGuBbza4vnKFLlXMPI9VjRXYN3z1VPWQZxyVtNTHxnugp/RM//x6OmUT4wsLMGPjVSoCyhRuKi6h8TyITjQ1y3+VTQDb6jpPRNzu18oOQkMzbOxYbHvo3OITCcJL/s5rATrX34CxP94H9mWOIKnk4wQ3Joe/1o0ZMuG4hYadmzshAKHOWIcjWepNuwiM8znTNUBh8ly46TC9O8SGAv4vOM/1s+Q==; 20:F0cm8F7JPIHf9pJPB68yfInA82ElxsxYavM33+hHju0CllFMzY7b9+tFz2EfkDFJjyy8xBvSEVcvUkJAw1FgF+K23XHD29cPR09wvkoi3ThrrZcxdIlActhQP+jUF/H1tTgXV40H36l/YibRCWm/75ZFnasTjSkbHKRB/9fDMzzil4CBgjlpnjwxe3Ldj8Jo1ZPxa1xpBXw8Mpx/hYZ8y6PWXsgfjhKOgOc/aEvq517oVhqGvBeJwlz1QFhaSrtN X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2017 16:40:39.2218 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1245 Subject: [PATCH v3 0/6] DxeBmDmaLib (BmDmaLib class) library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2017 16:40:41 -0000 Content-Type: text/plain This series provides an abstraction layer for Bus-master DMA operations as currently implemented by the PciHostBridgeDxe driver. The intent is to then allow override of this library as may be required by specific hardware implementations, such as AMD's Secure Encrypted Virtualization (SEV). Please refer to the RFC discussion for SEV here: http://marc.info/?l=linux-mm&m=147190814023863&w=2 This new (BmDmaLib class) library is cloned from the existing DmaLib with an additional DmaAbove4GB (BOOLEAN) parameter for the Map and Allocate interfaces, so that decisions can be made about the need to allocate DMA buffers below the 4GB boundary. NOTE: The abstraction layer is intended for Bus-master (DMA capable) devices, and not restricted to the PCI Root-Bridge use-case. Thus the rationale for not using EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION types. Changes since RFC_v2: - Include the actual DxeBmDmaLib library code that was untentionally missing in the previous [RFC v2 1/6] submission. - Minor cleanup on commit messages. Leo Duran (6): MdeModulePkg: Add DxeBmDmaLib (BmDmaLib class) library ArmVirtPkg: Resolve BmDmaLib class for PciHostBridgeDxe driver CorebootPayloadPkg: Resolve BmDmaLib class for PciHostBridgeDxe driver MdeModulePkg: Resolve BmDmaLib class for PciHostBridgeDxe driver OvmfPkg: Resolve BmDmaLib class for PciHostBridgeDxe driver MdeModulePkg: Modify PciHostBridgeDxe to use new BmDmaLib class library ArmVirtPkg/ArmVirtQemu.dsc | 1 + ArmVirtPkg/ArmVirtQemuKernel.dsc | 1 + CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc | 1 + CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 1 + .../Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf | 1 + .../Bus/Pci/PciHostBridgeDxe/PciRootBridge.h | 13 +- .../Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c | 272 ++++------------ MdeModulePkg/Include/Library/BmDmaLib.h | 161 ++++++++++ MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.c | 351 +++++++++++++++++++++ MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf | 41 +++ MdeModulePkg/MdeModulePkg.dsc | 3 + OvmfPkg/OvmfPkgIa32.dsc | 1 + OvmfPkg/OvmfPkgIa32X64.dsc | 1 + OvmfPkg/OvmfPkgX64.dsc | 1 + 14 files changed, 629 insertions(+), 220 deletions(-) create mode 100644 MdeModulePkg/Include/Library/BmDmaLib.h create mode 100644 MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.c create mode 100644 MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf -- 1.9.1