From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0601.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4a::601]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 07CD981C1C for ; Thu, 12 Jan 2017 07:55:06 -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=XjmV7kIBrrB8E5vu0I37vDPRwknU2xQd6ThqhhLpwPk=; b=dhVf7ThMNwfFj7bpw1BVHiRQ+D4/Wu9rp38AE1yIkV7+JInHMO0gZY0EoYaxD5viLPCWlLnjScS4XBm4tKCCYKCN8ihfG3YbZ+rWB6V08Na1VCmpfoJNjwCzNYJPW5aiKyvXbBBcMr8+VUWemOSThFEWzrAcq4Ivl+PvJ7sQ6D8= Received: from DM5PR12MB1243.namprd12.prod.outlook.com (10.168.237.22) by CY1PR12MB0668.namprd12.prod.outlook.com (10.163.238.153) 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 15:55:05 +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 15:55:03 +0000 From: "Duran, Leo" To: "'Ni, Ruiyu'" , "edk2-devel@lists.01.org" CC: "Tian, Feng" , "Singh, Brijesh" , "ard.biesheuvel@linaro.org" , "Justen, Jordan L" , "Agyeman, Prince" , "lersek@redhat.com" , "Zeng, Star" Thread-Topic: [edk2] [RFC 0/6] DxeBmDmaLib Thread-Index: AQHSatbmixG1lw81KE2gJcHLpfiMS6E0WBCAgAClcnA= Date: Thu, 12 Jan 2017 15:55:03 +0000 Message-ID: References: <1484007421-15462-1-git-send-email-leo.duran@amd.com> <734D49CCEBEEF84792F5B80ED585239D5B87C1F3@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5B87C1F3@SHSMSX104.ccr.corp.intel.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; CY1PR12MB0668; 7:0TBHQz0ojDH3uu3ucifUUQ/VI9rzx53Sfcfnl21FuHSMdBcIGgKbmFPRENmgNyrJGsFFrDWZkPceKgIMZiFRHyvdKK5l99p7VSaAN2NStq8NR2CKP60Me5zX4DzSv1R4UjaqHnWj+nWlX5d1R23M9EynNgS93bjgOuxIizLVvRC9X3qm6WDsjDjXjrtHN2jyjKQG3+C1ObVOVquo+FMSrscCEujRvApWADZ6YAP3+S93usUx9rLMNvvdNQSrap8Kk9AUHbeJT+Z+X6AIwA+QpSH9dcyGLL5KtVZYPxj2c1CSTwqG+h/phWVddeymfHY2PaZPP9mMqz1yHHaeWQEWDTSog/SMX+2babuCEJF2Ov6AkJU91so7dtwhBstJqY9k25v1ijwksiNqIuYnXjOZ1aSYunz9l8UmcKwI1qYMGYVZLCywczRMz9tvY6cHlK09buJPof9gFjoR50txBo8jxA==; 20:IpO/Vq6axZR3SEQTXcL2L7f6Gc0cIqtSLgqVhghCiTRvmYtZd/ks92qF2P7bL0IxbZb078ouX9kMwPkEtk4Jm0WTth0SujydaX8Wp0FgOeljCKSnrc7d626zQaJ3PN5MLFs/15DV+fVBA9yCIZwT3BNLimLsuBYgDwlpmA6Jt3XZkbK3dt9SgilRT1Z04D886fMNroHP4NEIYBRIHUNK1Kuk38w089WRSGc0TVtotoNqem0QzY6+7zZLrsuARMZJ x-forefront-antispam-report: SFV:SKI; SCL:-1SFV:NSPM; SFS:(10009020)(6029001)(6009001)(7916002)(39840400002)(39860400002)(39850400002)(39410400002)(39450400003)(209900001)(189002)(199003)(13464003)(377454003)(51444003)(3846002)(9686003)(102836003)(6116002)(8676002)(2501003)(305945005)(54906002)(105586002)(6306002)(81156014)(81166006)(229853002)(8936002)(3280700002)(106356001)(106116001)(68736007)(74316002)(55016002)(6436002)(6506006)(7736002)(99286003)(5001770100001)(97736004)(25786008)(2906002)(189998001)(122556002)(4326007)(7696004)(50986999)(76176999)(15395725005)(54356999)(33656002)(2950100002)(2900100001)(101416001)(66066001)(5660300001)(77096006)(86362001)(3660700001)(92566002)(38730400001)(19627235001)(6606295002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0668; H:DM5PR12MB1243.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; x-ms-office365-filtering-correlation-id: 553252f3-4256-4887-bcc0-08d43b035f42 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR12MB0668; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(162533806227266)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:CY1PR12MB0668; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0668; 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 15:55:03.4081 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0668 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 15:55:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Ni, Ruiyu [mailto:ruiyu.ni@intel.com] > Sent: Wednesday, January 11, 2017 11:44 PM > To: Duran, Leo ; edk2-devel@lists.01.org > Cc: Tian, Feng ; Singh, Brijesh > ; ard.biesheuvel@linaro.org; Justen, Jordan L > ; Agyeman, Prince > ; lersek@redhat.com; Zeng, Star > > Subject: RE: [edk2] [RFC 0/6] DxeBmDmaLib >=20 > Leo, > 1. What does "Bm" stand for in "BmDmaLib"? [Duran, Leo] "Bm" stands for "Bus-master", as in "Bus-master" DMA. > 2. Include/Library/BmDmaLib.h says > " DMA abstraction library APIs. Based on PCI IO protocol DMA > abstractions." > I think that means the BmDmaLib library class knows the PCI IO concep= t. > If so, why not directly use the > EFI_PCI_ROT_BRIDGE_IO_PROTOCOL_OPERATION > enum in this library class API, but invent a new BM_DMA_OPERATION > enum type? [Duran, Leo]=20 It's based on the PCI model, but it's not dependent on or specifically for = PCI. I cloned the existing "Dmalib.h", but added an extra/new parameter, else I'= d have used the existing class. Please see: EmbeddedPkg/Include/Library/DmaLib.h > 3. Can you explain more about AMD's SEV? What will a new instance of this > library > class look like for AMD's SEV? And what will ... for Andrew's usage m= odel? > I am asking this question because I try to understand the needs of th= e > additional > layer of abstraction. I want to make sure the additional layer is gen= eric > enough > not just to meet one silicon feature, but can meet a more wide range = of > silicon > features.=20 [Duran, Leo]=20 On instances of SEV guests, the allocated DMA buffer require no encryption. Our intent is to override the library to then make runtime decisions if SEV= is enabled. Please refer to the RFC discussion here: http://marc.info/?l=3Dlinux-mm&m=3D147190814023863&w=3D2 >=20 > Thanks/Ray >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > Leo Duran > > Sent: Tuesday, January 10, 2017 8:17 AM > > To: edk2-devel@lists.01.org > > Cc: Tian, Feng ; brijesh.singh@amd.com; > > ard.biesheuvel@linaro.org; Justen, Jordan L > > ; Leo Duran ; > Agyeman, > > Prince ; lersek@redhat.com; Zeng, Star > > > > Subject: [edk2] [RFC 0/6] DxeBmDmaLib > > > > 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 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel