From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on060c.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe46::60c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 518B481C1C for ; Thu, 12 Jan 2017 08:05:01 -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=OklaBGNM+ZCZiP9wQhwLBT4irQQSniFg74rFlil1i5E=; b=r/El773RCJthO/khxYSQnnsMZUKMRLdobTC2itvfRNJRl3vfgxJBD8iU3/tcFxYx1UuPMnCGwn9aYk5x6bIvxQSiJY1GLQXDvhMpb+Qk97UKZgXbp53yej8bquoOO4YZGRnWN7hnIpO+CgshJmbYAAg4XLFCKqALnxaSPwXjbP4= Received: from DM5PR12MB1243.namprd12.prod.outlook.com (10.168.237.22) by BLUPR12MB0657.namprd12.prod.outlook.com (10.163.217.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Thu, 12 Jan 2017 16:04:58 +0000 Received: from DM5PR12MB1243.namprd12.prod.outlook.com ([10.168.237.22]) by DM5PR12MB1243.namprd12.prod.outlook.com ([10.168.237.22]) with mapi id 15.01.0829.017; Thu, 12 Jan 2017 16:04:57 +0000 From: "Duran, Leo" To: 'Laszlo Ersek' , "edk2-devel@ml01.01.org" CC: "feng.tian@intel.com" , "Singh, Brijesh" , "ard.biesheuvel@linaro.org" , "jordan.l.justen@intel.com" , "prince.agyeman@intel.com" , "star.zeng@intel.com" Thread-Topic: [edk2] [RFC 0/6] DxeBmDmaLib Thread-Index: AQHSatbmixG1lw81KE2gJcHLpfiMS6E0nReAgABmPlA= Date: Thu, 12 Jan 2017 16:04:57 +0000 Message-ID: References: <1484007421-15462-1-git-send-email-leo.duran@amd.com> <30b8330d-1fcb-f3f3-5ced-5d4651745cca@redhat.com> In-Reply-To: <30b8330d-1fcb-f3f3-5ced-5d4651745cca@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; x-originating-ip: [165.204.77.1] x-microsoft-exchange-diagnostics: 1; BLUPR12MB0657; 7:R1/66LyQvnKW/x8zKvrhL2qWF/WN/pTGSEoAK8GaXq0IxxnJfV1NTqpvdpEX6/AGTU65Jv5J1DTTkeNbKqzxZVI4Nfp+36qID7SB2homIJWJD9LQpG15MHPCdfk5nkqXpGvHFyco2CN2SX94UDVKxxBhkI+HZ7xknA3JmY7W/shYr638VlSKB0iNnl7Fx5OE95uxNiXli7QkSa1aIa7AI2LzRtzn9cn65bQOln7Lf/VE5Ur10N9GPyW6iBh8wHhzRusNeGqhkufEDZ8hhWG+xxsv9fRQOf+R9vKmMqDHfIKkByafBaGrT17WNdoF7IfNCDkmJVUGbfiCUZMdHQ7fdYN4bAav75Fl2AEBkiVLY/qFMFZ3kkS6mT/m4doiMtpftCS3t047jYvxJfcsctVObmc94J7QKoZ/wMx+E/Oqs+ProvhiHfCQnRi7UC+SAwBtGsuK2QeNDBOvaRHYhcpAJg==; 20:DOc64MbYFq5bwp9dGiPAZ1aFrj7FzxKtuS5ni1GoWR1VDuBBQPPwMwqSNoIflb03s0ux52dQoYbOr0jpjBoFGaPVEHx7yot4FWLp/6qtQAxWLN30kU+8SiTukuqsMT2+eNFnvPZY2YyT/tblEGN/Z8Yepn2EjcF3HL82B5OUzymCObapmqW5GgUwCMQeH9gVkIrzKroDi/3lzpLdBY9ruYm1X4dD37ocOSZTKkAalkY7yNUyU6Gh9VcW6x4PkO7N x-forefront-antispam-report: SFV:SKI; SCL:-1SFV:NSPM; SFS:(10009020)(6009001)(6029001)(7916002)(39450400003)(39860400002)(39850400002)(39410400002)(39840400002)(377454003)(24454002)(13464003)(189002)(199003)(106356001)(5001770100001)(97736004)(189998001)(50986999)(86362001)(7736002)(105586002)(54356999)(2501003)(106116001)(33656002)(6116002)(92566002)(101416001)(76176999)(305945005)(81166006)(2900100001)(8936002)(5660300001)(7696004)(8676002)(3846002)(102836003)(81156014)(74316002)(25786008)(54906002)(55016002)(6436002)(6506006)(9686003)(229853002)(2950100002)(99286003)(77096006)(38730400001)(122556002)(4326007)(66066001)(3280700002)(3660700001)(2906002)(68736007)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0657; H:DM5PR12MB1243.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; x-ms-office365-filtering-correlation-id: 53e7e301-e792-4183-9c4f-08d43b04c141 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BLUPR12MB0657; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148); SRVR:BLUPR12MB0657; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0657; x-forefront-prvs: 018577E36E received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jan 2017 16:04:57.2461 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0657 Subject: Re: [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: Thu, 12 Jan 2017 16:05:01 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@redhat.com] > Sent: Thursday, January 12, 2017 3:51 AM > To: Duran, Leo ; edk2-devel@ml01.01.org > Cc: feng.tian@intel.com; Singh, Brijesh ; > ard.biesheuvel@linaro.org; jordan.l.justen@intel.com; > prince.agyeman@intel.com; star.zeng@intel.com > Subject: Re: [edk2] [RFC 0/6] DxeBmDmaLib >=20 > On 01/10/17 01:16, Leo Duran wrote: > > 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. >=20 > * Ard, I remember you worked on >=3D4GB DMA stuff before, can you please > look over this series? >=20 > * Leo, can you confirm that patches #1 and #6 implement nothing more than > code movement? If they implement more than that (judging from the new > DmaAbove4GB parameter above), can you specify how exactly? >=20 > The source code changes in patches #2 and #5 look okay, but before I'm > comfortable acking them, I'd like to understand the scope of the code > movement between #1 and #6. [Duran, Leo]=20 Laszlo, it's more than just code movement. - Patch#1 clones the existing implementation from PciHostBridgeDxe, but the ported code is simplified a bit by the addition of the 'DmaAbove4G= B' parameter. - Patch#6 removes the ported code from PciHostBridgeDxe to leverage the lib= rary. >=20 > * Also, I suggest the following subject line template for patches #2 thro= ugh > #5: >=20 > XxxPkg: resolve BmDmaLib class for PciHostBridgeDxe driver >=20 > * For patch #1, I suggest restricting the client module types to DXE_DRIV= ER in > the INF file: >=20 > LIBRARY_CLASS =3D BmDmaLib|DXE_DRIVER >=20 > Thanks > Laszlo [Duran, Leo]=20 OK, sounds good to me. Thanks. >=20 >=20 > > > > 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 > >