From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0630.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4a::630]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C6760821CC for ; Thu, 2 Mar 2017 10:46:46 -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=e0RnKmGVubOB6/rtMq3Sub843d5jZYE0csVPP2Ip0Ho=; b=BWv6yJUa79ZeRKClxK7lMVI0W6rzz1Sn2DsLnZR78UbGXB5AGSfmqdZRG/g6eE96YYFwf+GFMh9nYXCmSaodCKxapfuj4PuZ5Klziw1txxosF7DwpjkuhdePiFxjvRNjqMG4QHncD7IVEuzbC6RgFlf7kX3eKrAf+KYQW7ipdZ8= Authentication-Results: ml01.01.org; dkim=none (message not signed) header.d=none;ml01.01.org; dmarc=none action=none header.from=amd.com; Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Thu, 2 Mar 2017 18:46:45 +0000 From: Leo Duran To: CC: Leo Duran Date: Thu, 2 Mar 2017 12:46:30 -0600 Message-ID: <1488480396-32358-1-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR17CA0027.namprd17.prod.outlook.com (10.173.128.141) To CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) X-MS-Office365-Filtering-Correlation-Id: fe7fff72-10bb-4954-f04e-08d4619c79f0 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 3:OpYbwdsTMj1YFJ5bsvmFyc6ytUtl9uZzeaC73FQyvV0kSC3PPe8CeYavBM11wEBtB1WkSyUuZIzV7Qgxu3psFXiZYDeyaxJ1lVTdxSJtxyVtMbjAbLAyOHvqzy71DwuMDeo8lsdovgjj8Iwh8sUbEyDiKM3zbUZ2vlqUWl/GOLXmdog+hjRvtzgM4Qa/xjjx0FP3uktGeUk9xXXgkgRhGvg3vqo7HQf+rWeeWmGAIkHv8hGQj+/N71iyxo82uJC/ozdY1XebQr1KbNChLX0T+cfHJl8D7FMzmtGW+guuJtY=; 25:tRzIrLY8dOAkusGhMPITod8bylA3OS1XL6/HvxcZje17c/Pou4xumA0af9/H1OLOQlkDq3PSzx/9/AgBOpDMIut259TozAc6yWyjYK4LXHJvf9Pgd5cL4cb4v0GF3fckSrvO0S2kyzN6BZUnNiHNDMcmEuWaOpzsMlfa2ZfXu+2iIZs1VFuY8HDyGCSqzRc3wVCW0abrJTEF8PFku6RcLQYwzVRujuUT/kTOPXXPlCJKmLNT4tf3dSWTX6IOQrhqpdfI/KdEJvmoQJoyoIUmg0WHqsLkznYJWsSeKbH6fkvAVATEiVXSXFliV5sBOmTsSy0xAHb1/I+4ncUDQYYmxRQB4rNILSnkZ3PC/S6n5E9LAEwmHUGhCKZ99H+chCvJPvJ2YyyUrNEpOWJyRzWWGuBXj0qfY00XQKvF+7MZ0usAKxpxMzdWgLm44g52Vah4VD8gabksVLEVtero6ie7CA== X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 31:nHUM8AoynVESgZ39i1Sbj3A7xbBkcW8/B4zwbestG9SuJv0tRTwzck3iJ8PW3t/NeVCrtr2bDlYTd81eubW+qNg0s+Ff/CChfy2su70RsHOqmSme8dq586Isgq55ctmuPCuleJPecr3MnlTlYr4/cQgJgGtHwQ9Zevpmh/mHN5IYBiQpN02wGYhtT4045aJDWu4Vx5pyCOKWYoJoE0111uQJPjiFalKGLss8xf+OvErL7leFAzhFzrW2G2fmATp0; 20:BNfhnTneo16ptIJ+F1qwuuzdN+GpbKADAVlsrgw5tZle7HhOgSiWcYc/3Gn9QqeZoGLJ7XXQETjJTlhZsDts8y8A25/kew1JqiHANk9IlLjVJxnLfWsBVXBxT98XOK3H2ylclB01kX+X7Jvwq/3uz0Zm171s4rhxFEdO23cpYnxzf9Q72pUjgrqVlgl80jyoBY1plG6rN+9PiC3v7/gdiyVIBap+T3dzUEJsi2mjVlFhqFgKFNaRgiluzYHFKOVcw5cPk+RNc0B6wUmqUjb2TLimJ2QRRFvMjcQpw0LZ1YLQUPyp8+uyZSDc9c92Lgi+curTv4cGkDOjYotoUstFas9cjV//Xvi1d9F1JpXvslFNAB0dYURT7YdQ1INfCnD2YS6Xyc6fIpwhWvdbfqVw/f8tiSE3RxW7V7iJQDi2k7CqVnuhhmflul1thfPsfDPlDx7KO8PCaQpujuU6WTcJDTaWN2e/OOQqm0G49UatDijAQ8/cZ8Ot8FeyC9eibwpu 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)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(20161123558025)(6072148); SRVR:CY4PR12MB1239; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 4:8w4KTaIltcuJBHcsTBGpAMDqVcxRsF8g0H/PqUCMFSj51QtbUdnwMv5N3ZPWO7oKeQzVFuPkt92QXXyIV4H+r2nEQ7kIWLAXlt81ssUvSf2mPWWWE+mRK6VcMS+IX05LiWRk9n/z4D+sL5N9AFDV7XLl1Cs4e/+emcx/sfut2XpAr6asrBnGxcyztoRpVvFDpBAJu6RdLL4ovh0ewHseNpZrFTJ0RkS28gOZmuf1alCbWzh6l38LuChksLWPf6FYvxymuJcers1Tdw3hJ0FssY+XztpSROhUunSO+3XwQLHFqveqZU1w8EEaRN7yWoiAm/S1cqBWEnfvKyXntxzNGMhA4KP3ULYCqpW1Ro6VUMF6nYQbVbLodtU7AxYLNb1jvHoQ6oMScKKfSgtS8ct4+PBq12PAoRhZXLnYRLq97L4HxQrBBetBkgW/F+4uNxI9+sDLms1f7qhP4B0TMjgYyb98NE71z9Kk1UWOBOYAvksDqeI4RQBd8OlY0X+daax/JhXJ11oeFzJ3pySuEocM+043tQpsdOo8iLuvQRx/XyWMKT0KJBsBC3wRzPvNTMaUWH5Uvn7Blgj0KWoMM+MfbzJmQe4otWMh/sNZU9nRCfqctDhHygf0d0n6fVFOCxsu X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(7916002)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(209900001)(6486002)(2906002)(50986999)(25786008)(6116002)(189998001)(6666003)(7736002)(36756003)(6916009)(3846002)(305945005)(5660300001)(66066001)(50226002)(42186005)(53416004)(47776003)(4326008)(48376002)(50466002)(966004)(33646002)(81166006)(92566002)(8676002)(450100001)(6306002)(53376002)(110136004)(38730400002)(5003940100001)(86362001)(53936002)(2351001)(427584002)(19627235001)(6606295002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1239; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1239; 23:B1GGTI42k3u3Jk6wgyoMZvnxMU5Nzqw5WAKScl4D0?= =?us-ascii?Q?xbON80AUylzVGoT7xXbq4xj+Z0+8t/8QLzXD7y3fEE9ee/+sOLCjQUqmYj07?= =?us-ascii?Q?T4n0bBz+7U94n9kke9OaqhgTDBudpy15rryEiecgTSyEGFJ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nvZrKikaMVGjNJV/vRxVkcPfWjU365yKeg?= =?us-ascii?Q?a3GFLe7PzhB+Ob4qUAgUskr0AgaliMH1PtLHWUFSsruNZv1xegE02aZSdEc1?= =?us-ascii?Q?kzkf+QUJkpbPULB4f5qdh2jf5ZFcII3yhtJyFHyA1PgW++eCUoeX8EULVVhY?= =?us-ascii?Q?zV5ZE3yfdjH/VoKSUQ9AltacOHkUKdKgFix?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 6:+vs4KrW6KPk04e8lT9GXjvj/xrNJaaPpc0WSKtk8y9q2aUqIo05GDecMldgnMiP+G03/CH0amixc3KpIn21M52YMPhMkDVon7+fJDAS/g40Td4xX3CIPi3CQ1qtH13ftdb+J/0mBZvS7LMdW+aLRjUTMkouqqFNVT+vsQ3WlOjS+C86uCOlKnggq64gxIKxANM4ERRc2QbA6Nzzo9fnn2vP4zt1mQIlMm2SLHdqbwgmOzu9Rr6oGffDruTH/Q8X0XVG7e0IYw7ynXCReeQbI/pVPAtv0YqrhnhznquJE5+XHs1zcuG4WFeaKbiYgt+fI4YRbmOjpJmHxWD0C+W5e82e6fz8g3ucFOIk0qSWuB6xm1QgffXrGVbS/dN0hlUQYyyfriGcBuy77Qdvm8AYiUufIJ2jj7VaXcd0lWmDyoBY=; 5:oJlDxKldfEOVsozdcLgQY2ZFUpQRL1FOwExhYtc0SaHdPGjS1nVCGGapT03m0+cIuzsi8CX0RroiO2cTj3B0fJQUE52ozPuEh1egkX/WhgD2FZxDtK1pNmoSwQ1XrPZ35k+EulHKeMmPGru8xscRWw==; 24:fvb8K5GM9M2+Omi+Odr4Z7tri2s1UBcTHcngt/Tpsjos3a4Id6YJ0tYj89KXviyQ/ZpEIUZ7c117YbEUVCF+fcOvC6Vgi9GwmmWBBS4ERXc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 7:jGrFAfwWgnU1o5GNp8ieRAgwMrb6+WSqmPht91m40gtJVL5efWn/Hw2raNocYTq02Vp4kwq+dw8N1mYiKx6Y5JKHRuphvlcHcK6puXGNMHlu3rjdM8SuiP+hVxpEw8SBvvVym0okKAYhziQ2mizHVs+Tv6Z7lfVPqp0YEJDhX2ww8qhydhYurom69o/1Fkzcr0Ks2+UXkry+VJLqNxZAiaV+hEITs0HTvJkSkzT0EW8ZAXQOGQpKtnYniNL5TtYphh4DXJK34HyMbHxrTnwYllsI6h/OLKUCP6I5XmfsaN2BP6xgFaH+xpUYyg9RtE63KuxLShz8cXLVXn0YtoMMKw==; 20:VLaK5K2rGTXt6a/JoMgwynM3n+cKZz4ww1iTufMwk1E0ti6iF9EZeO9q6m8RwVffCBQl4XdHh/fuf2nol2ZMsv4T7QSq+5GW83hqbpx/s2vh/2YKxov2ggd4EMiRWB5gGdi9B9iAmzMNSVF6OXpimLjaPMI11/IFFKnLAmZI5tfYtVXRcYDd0q995hy8z4A1EWqPQN2ZD2ue7HO9hfRnbDEtfx8dDLOtIjRNi/HpmvbTzpCnA4awbrYp9cje+34R X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 18:46:45.3237 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1239 Subject: [PATCH v4 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, 02 Mar 2017 18:46:47 -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 v3: - Add copyright notice on changed files. - Re-order parameters on BmDmaFreeBuffer(), consistent with gBS->FreePages(). 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 | 2 + ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 + CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc | 3 + CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 3 + .../Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf | 1 + .../Bus/Pci/PciHostBridgeDxe/PciRootBridge.h | 15 +- .../Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c | 274 ++++------------ 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 | 2 + OvmfPkg/OvmfPkgIa32X64.dsc | 2 + OvmfPkg/OvmfPkgX64.dsc | 2 + 14 files changed, 642 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 -- 2.7.4