From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8CC8921E49023 for ; Wed, 14 Mar 2018 04:28:52 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2018 04:35:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,470,1515484800"; d="scan'208";a="25607763" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 14 Mar 2018 04:35:14 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 14 Mar 2018 04:35:14 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 14 Mar 2018 04:35:14 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.226]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.235]) with mapi id 14.03.0319.002; Wed, 14 Mar 2018 19:35:12 +0800 From: "Wu, Hao A" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , "Zeng, Star" Thread-Topic: [edk2] [PATCH V2 0/6] SourceLevelDebugPkg DebugUsb3: Re-Support IOMMU Thread-Index: AQHTu3eZMyq+c7jCFEmz6aKv9mMrRaPPmfAw Date: Wed, 14 Mar 2018 11:35:12 +0000 Message-ID: References: <1521020038-102684-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1521020038-102684-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH V2 0/6] SourceLevelDebugPkg DebugUsb3: Re-Support IOMMU X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 11:28:52 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The series is good to me. Reviewed-by: Hao Wu Best Regards, Hao Wu > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of St= ar > Zeng > Sent: Wednesday, March 14, 2018 5:34 PM > To: edk2-devel@lists.01.org > Cc: Ni, Ruiyu; Wu, Hao A; Zeng, Star > Subject: [edk2] [PATCH V2 0/6] SourceLevelDebugPkg DebugUsb3: Re-Support > IOMMU >=20 > The patch series is also at > https://github.com/lzeng14/edk2 DebugCommUsb3AfterIOMMUV2 branch. >=20 > Based on the feedbacks from Ray and Hao. > It is V2 of > https://lists.01.org/pipermail/edk2-devel/2018-March/022586.html. > It has no essential difference with V1 about the final code, but > re-arranges the patches to revert old IOMMU support patches and > then re-support IOMMU. >=20 > de8373fa07f87ca735139bb86c51e2c29fb1d956 could not handle two cases. > 1. For the case that the USB3 debug port instance and DMA buffers are > from PEI HOB with IOMMU enabled, it was to reallocate the DMA buffers > by AllocateAddress with the memory type accessible by SMM environment. > But reallocating the DMA buffers by AllocateAddress may fail. >=20 > 2. At S3 resume, after the code is transferred to PiSmmCpuDxeSmm from > S3Resume2Pei, HOB is still needed to be used for DMA operation, but > PiSmmCpuDxeSmm has no way to get the HOB at S3 resume. >=20 > The patch is to re-support IOMMU. > For PEI, allocate granted DMA buffer from IOMMU PPI, register IOMMU PPI > notification to reinitialize hardware with granted DMA buffer if IOMMU > PPI is not present yet. > For DXE, map DMA buffer by PciIo in PciIo notification for early DXE, > and register DxeSmmReadyToLock notification to reinitialize hardware > with granted DXE DMA buffer accessible by SMM environment for late DXE. >=20 > DebugAgentLib has been managing the instance as Handle in > HOB/SystemTable. The Handle(instance) from DebugAgentLib can be used > directly in DebugCommunicationLibUsb3. Then DebugCommunicationLibUsb3 > could get consistent Handle(instance) from DebugAgentLib. >=20 > Cc: Ruiyu Ni > Cc: Hao Wu >=20 > Star Zeng (6): > Revert "DebugUsb3: Check mUsb3Instance before dereferencing it" > Revert "DebugUsb3: Fix GCC build failures" > Revert "DebugUsb3: Support IOMMU" > SourceLevelDebugPkg DebugUsb3: Re-Fix GCC build failures > SourceLevelDebugPkg DebugCommUsb3: Refine some formats/comments > SourceLevelDebugPkg DebugUsb3: Re-Support IOMMU >=20 > .../DebugCommunicationLibUsb3Common.c | 110 +++++- > .../DebugCommunicationLibUsb3Dxe.c | 375 ++++++++++++---= ------ > .../DebugCommunicationLibUsb3Dxe.inf | 11 +- > .../DebugCommunicationLibUsb3Internal.h | 60 +--- > .../DebugCommunicationLibUsb3Pei.c | 50 ++- > .../DebugCommunicationLibUsb3Pei.inf | 4 +- > 6 files changed, 351 insertions(+), 259 deletions(-) >=20 > -- > 2.7.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel