From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0614.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4a::614]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A72F38178B for ; Mon, 9 Jan 2017 16:17:17 -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=2Y2X/xhr1/vYSGrz1Y21Vi2Ptz/QMw8HKMsNN1QWIUo=; b=TI/ya+iWHqzRkDx0cGLvUb1o/5K+c868TwciPAD/UgWBONp2y4bRia8zye/Q29mrYxFZIyHooJQALe6Z3RwQ2BmqMe4XCv7z0Veu+2ZkIev6yf2wmLuEj/KEAK6dTxNwbdb2D9TjhN9Cd+M5GsC6Iur0eLQr2rp/CxzUSuu64IQ= 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 BN6PR12MB1234.namprd12.prod.outlook.com (10.168.227.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Tue, 10 Jan 2017 00:17:15 +0000 From: Leo Duran To: CC: , , , , , , , , Leo Duran Date: Mon, 9 Jan 2017 18:16:55 -0600 Message-ID: <1484007421-15462-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: DM5PR19CA0004.namprd19.prod.outlook.com (10.175.226.142) To BN6PR12MB1234.namprd12.prod.outlook.com (10.168.227.20) X-MS-Office365-Filtering-Correlation-Id: fba39244-ed21-438a-b1a1-08d438ee0895 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN6PR12MB1234; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1234; 3:U96qmQxnrvWdgjFdeFNuC/x80PRvyBDUwDqynYwcFhmIZOyrEIuDT8ClMTIP6Ac3Poh0DQI2ta7E24nv05V5e0QWddlVOBG9++4dfpe5fyKAMjGw5gU4dm+HARO/aIkirBpzI22rylD45u9fxf0++45i3wHG1kZ+PzwUlZrWfwlcR8EQgyNs9oJ80T6mjFUBMHbhbF/c3MepU8A+IJKpKKqzCZFgPyWruPIWsvwORsQIsRX77dhCmLIwh3gMj8vfG6Kgnia4XYoc/JHKWmw0ww==; 25:YFlyPLJPWJrsZiSegbHWBve/+x7iRGROuAKHY6xYZEAVoA22H1Cwa6JumtAya7p0yJSBZUvHUSEJ8OPEhiok5sFtdXhOUPdqpWVWf2adOEY9u5NZElZO6aw+VDteYC5D14/obCf1Tdgg+jRQiCZQaC+k7a/f9GITjsd9TVg6BRHKiVWi48lJc+KylGP8R/mk5o3+gQaX8zDTuESui7Mme9ew4/9sWFRzM+BACrYs1+/IOE+IW+lH3AJdFWd9FHfppYpjDfJIBNroxTohQXDtZ0gDME5WPuf1CvKfzHeV1NIIKYEYssdf9iciS31aNoVbfT7Fy3txn24XCLe5ouTQDWaMphIhugc190SY+fAdCMNMu2VtCNXyXSpPa92RJKShwn6FqfLJK8CrAqQW+83A1+nbqyhFp4Vcr6dpEvSxP9z/K+jXU4X0yUxVYOPJrSARyU4Zs8neQzBP+QaVthmheg== X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1234; 31:UFP930FitIEQt53iH2/c37IZCEsqc/g3n50okDWZNmM60v4jux6AmuVQKTopf1lf6z3a6WV9fngDET/0yRfjCjeY0sMT603Fm3jf4EOFQdURFp3o7yIF0gtqkCnxgZUwA7/MZSxsIymWMjU+0ZWzadcL9dHyn4wtS4ZQuk4TsEI+Je7uMNU9lrtXfqQtmBEty2RwKDB3+4ngs5/wIGMSMdWHbOJLFy1nsqz5bZ5GwKM5uB04tV1KfdaQf4qd15ei; 20:2JFx43e5d+lzD5eoCqnC42XIH1OMogmjMVuewDmkyWsim4ZRkQ1mzHvnZQOLHosIKhkwN5B9jJFy0+eObemNMlgwVHMviXirz9EmZv9IoGWp3M9PCyySEQ55L4om3ft5TmpfVvOE2MJHTv7Z6SiHI72N/5IzVkqojOlYaP+fR1OfCxKpDoyF63tPdhkzJ2tPOpeo1VUy3CZldWpesImv4Yv0o90IxIDk8cwXotWadd3InvjFzaSzH0GE8ZpWOHDchMWa7jX2X4Lk1W9IVoq5U8YMavgJnFZIOzGjMtqhfgFJaG9XcPYdQdqoGLcJ7qmHEhbBLogrJDgZ935yrvAvwFQWlXBkyWcQwVrv7xG72Atd/dcgUnpfadjN/uYD0Er8cgPrWz3u3C4ftvS+A6M6ySz5tgqgVZPXHd2oLLt2ArnEpGYMVyd8hBtOXHRwNMvXzt1efaL5fvMG/qDXnBgvCo7JC+0zHl0ndM2+F6JJLHuAd5z/mRCnCW48qEWD6N7V X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:BN6PR12MB1234; BCL:0; PCL:0; RULEID:; SRVR:BN6PR12MB1234; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1234; 4:HY8PMMYJ5skO7guGQGe0ymPAUlt+mCL4OLF4GIjwp72VK8F0GlI5eHDGD0n87QpdT8MUEtdsFIweDjxEi7spnn8qbakyDAyUW6zWFSGeA61WQ7CVcmCdS6YKzp3ea7NRzkrD7hg4tKDwTlvWji2XZaOUmuR7Tp4V4i7rhfFvGMyfC+DG++WIiiSnBUuzd197VKb4qZ4Caiu7JMQehfnks2p8vm7JjXBFiRi3AEQIJttCDkrcWFZVTBVRbu6fNy0i46pWPIpsSVgrAEuZn9o4UhTepv63vcsH8HaBZcHuXI8cvaXdgurfi7vhmVTrTtAFc6oU/v3rNFTlAxjvYDa98lY8W6HaSVzQA/vvrx7L72Hk0ZFwSqnItnZGG6rWf7QF1mSPNhFbqKFygLskE5BfGgrod2kaTHtrFH8ZcoY5ADs8YS6QnxANkpyRDfdk2H0+KUqAPcSW4oekQcBvOD3bhLI57hl597bWw5tWwOwoLHYaNfcq+NsBnMiSb2Weu+Q3fzMbPsFVsrSXV+mWUFAtri/ye+MLRbahhKeBcMNdIf9NL68Bb5qRvY6+vSBB+uBHb4uk8fw+n0y5QtepZlHUsiq2zU3XhFG4/iXYdrwrzqo= X-Forefront-PRVS: 01834E39B7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(7916002)(39860400002)(39850400002)(39450400003)(39840400002)(39410400002)(189002)(199003)(4326007)(50986999)(47776003)(42186005)(50226002)(53416004)(66066001)(106356001)(105586002)(2351001)(5660300001)(33646002)(25786008)(54906002)(5003940100001)(97736004)(50466002)(110136003)(81166006)(92566002)(38730400001)(6486002)(48376002)(6666003)(8676002)(81156014)(6916009)(36756003)(6116002)(68736007)(189998001)(101416001)(2906002)(3846002)(7736002)(86362001)(305945005)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1234; 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; BN6PR12MB1234; 23:gySiUJcozJT2CiqBUqEpdxGuodJS5ueairaWL701P?= =?us-ascii?Q?uPEvSspY0C4M1ij8GfZHIKsopq6Yw/SaeIm49UZ4cRFEndDgiDpHZVWxgWqO?= =?us-ascii?Q?+QJP/o9Yx0B6h+OVaTKF0sQmywf81LJvnHOh7gQa2TPq/CCkVNdOvMl+A6z0?= =?us-ascii?Q?DIX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FtX?= =?us-ascii?Q?wuN6JG/YqPsdoEVze3Sihq8n03OSzSnm0LAoQlv8Njcq1ceFPFB5rwLDfV5t?= =?us-ascii?Q?wnuLIx9cHXybvAohNqaIWyG0ax7sRauZWfLO9a3WlbcGIZdgHOoooeC1vpFF?= =?us-ascii?Q?OJmw3p2mbOHRh/KNVE5Kgo8NHTkMyJaPtiD?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1234; 6:9LA3Z1RrZEAZ+ESKaIdgW6WtHDxt8ZVfvrLaLa5/x/qOAYQxDhtWDUh5U1133PcRNhMnST4diT0rG+jRonT8r6FRgd1G23fRzL52u8stHpEpMtYk8kPxQj7Lpz/PcCd+SOE0BuYQw0WiKGjCcyT9sA+DQp/lxsfR5zV/7lhGre1YnA9fhy5rgc7tIWJbmtDSm6OtkdstMQwe3HX4qOl16EA//oapdqdr7WQ73PJcSlHWoLpIF6DTGncuLhPqMhzrqZJHC52tCi6Tyn3EsnHKTK8po1NFB0yAJsDifyymi6naTTQL02FeyAggowP+A7njTfa/aXWi20He8kk9rNsptrJ20sZXIWBDKLxXc7zBquBXGSODwsIAzrNHS+Q5hEWNswg1usxoYmSTEqLKhT8uMIeIh688INVFO6WYvryc2eiINvPJafqOEwpQhQ9QUIO8Nw76osp1vLGNVR2uBDg2bw==; 5:RUy3iE824wJZ9jDRaC9xmCMd2O9+Hjb382gpIcLGCyKL6+si90FmR61d+y1/VnUSj63uKn1Tv4+TXu0inMP9GwcK63Z5qRmYbQF7aFqCrI2FMBEVsfAYuNT9u2b6GeRUYSAPdzLlUCVvZXaBc046twIU8LGEaYmXbOZrW+grgXw=; 24:xQ29fJSho6/lVcxPvj6f+j6GSyLj3rYJT8OEoPbhst141SdDRpMVkzrCELhgSePgH/mO99eGTa3p/aaMAmAsH8RuuICQpTGfENvmLA6SNBk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1234; 7:ggU9DI+RzDbyRN7f6CWvOAZknni38w2TSCjafzQH91IfguvCrwC8njjMTvY9KjnZXpspU2esmgmodJFaENcHlXQW90FYT5XoKgucBlhUz4eu9lw02irxcJsYBTiTCDFvH1Cj/TaHbE9wt5YWal+zs9TEe9XvnL5h94BhR/AzujInze+TOa+S4reeFdpU0jeHtYTKLIGjUjhOO6Fn5GNCizCJEyt4ylto9Uc5l8FDd5UvZlgG/7PUYLa1ceW1XArOhu9fbrrSOcDTex+FL8IUxAqncFhN9R2t8cdxehGLfmchD+657/MSy3DRlao5CbrhmXPVRKzRa7bRTKo5nz4pmMm+VFEeeIPm7n0D0zSYF9nfUJSTmXVxgnWcB6f+BbFHYPU6OzCNaGcjttHIqso9feNcacrezW2A8wIEeUeDlLuE1m3WNvmdlfB6I+pynfxJ6Hr5Mhmw65EOExghqjmZJA==; 20:ZFVXe1rLyPUoibAZMOkGYyP1vjA5CD/tSQ0DqRQ9g8WA7GChWrli4isQEI7aW5RKufBxFi6cdYIRe3LQsXTDZ1n9lgFELIJkO52dbWAFv7juj18KSERz9wVo6ZgvciJS/Rz+AfIwP2US6VXMRnx1jNpFQ2Zcbu5hk7o4IE4iZ+HMC6ZGq4Eo0m+ro7Aa/tzayVewxDToex7X3oCrP30Tdr6uzBb6ZRkDtCAMNRPOu9oneVeoo++3robH/M7+jaYo X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2017 00:17:15.6806 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1234 Subject: [RFC 0/6] DxeBmDmaLib 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: Tue, 10 Jan 2017 00:17:17 -0000 Content-Type: text/plain This patch-set provides an abstraction layer for DMA operations 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). This new (BmDmaLib class) library is modeled after the existing DmaLib plus an extra DmaAbove4GB (BOOLEAN) parameter in the Map and Allocate interfaces, so that decisions can be made about the need to allocate DMA buffers below the 4GB boundary. Leo Duran (6): MdeModulePkg: Add DxeBmDmaLib library ArmVirtPkg: Modify .DSC files that include PciHostBridgeDxe driver CorebootPayloadPkg: Modify .DSC files that include PciHostBridgeDxe driver MdeModulePkg: Modify .DSC files that include PciHostBridgeDxe driver OvmfPkg: Modify .DSC files that include PciHostBridgeDxe driver MdeModulePkg: Modify PciHostBridgeDxe to use new BmDmaLib 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