From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 02AF721D492F4 for ; Wed, 13 Sep 2017 23:29:42 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP; 13 Sep 2017 23:32:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,391,1500966000"; d="scan'208";a="900120800" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 13 Sep 2017 23:32:40 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 13 Sep 2017 23:32:38 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 13 Sep 2017 23:32:38 -0700 Received: from shsmsx151.ccr.corp.intel.com ([169.254.3.98]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.219]) with mapi id 14.03.0319.002; Thu, 14 Sep 2017 14:32:36 +0800 From: "Zeng, Star" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [edk2] [PATCH 00/11] Add IOMMU PEI support. Thread-Index: AQHTKLR2uTOt5R1XEUWHxTlYuefifKKynk0w//99qACAAdkNwA== Date: Thu, 14 Sep 2017 06:32:35 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B9528B9@SHSMSX151.ccr.corp.intel.com> References: <1504883034-22060-1-git-send-email-jiewen.yao@intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B940CE2@shsmsx102.ccr.corp.intel.com> <74D8A39837DF1E4DA445A8C0B3885C503A9ABAA4@shsmsx102.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503A9ABAA4@shsmsx102.ccr.corp.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 00/11] Add IOMMU PEI support. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2017 06:29:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng -----Original Message----- From: Yao, Jiewen=20 Sent: Wednesday, September 13, 2017 6:19 PM To: Zeng, Star ; edk2-devel@lists.01.org Subject: RE: [edk2] [PATCH 00/11] Add IOMMU PEI support. Good question. Yes, I think we can put all VTd related components to IntelSiliconPkg/Featu= re/VTd. Once we finished the review, I would submit another patch to move all compo= nents to the new location. Thank you Yao Jiewen > -----Original Message----- > From: Zeng, Star > Sent: Wednesday, September 13, 2017 6:14 PM > To: Yao, Jiewen ; edk2-devel@lists.01.org > Cc: Zeng, Star > Subject: RE: [edk2] [PATCH 00/11] Add IOMMU PEI support. >=20 > I have been confused by where should new module be put for some time. > When should a new module be put at XXXPkg/Universal? For example,=20 > MdeModule/Universal, UefiCpuPkg/Universal, .... > When should a new module be put at XXXPkg/Feature? For example,=20 > UefiCpuPkg/Feature. > When should a new module be put at the root of a package folder? For=20 > example, UefiCpuPkg/PiSmmCpuDxeSmm, IntelSiliconPkg/IntelVTdDxe, .... >=20 > Is it better or not to put IntelVTdDxe, PlatformVTdSampleDxe and new=20 > IntelVTdPmrPei, PlatformVTdInfoSamplePei in=20 > IntelSiliconPkg/Feature/VTd together? >=20 >=20 > Thanks, > Star > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of=20 > Jiewen Yao > Sent: Friday, September 8, 2017 11:04 PM > To: edk2-devel@lists.01.org > Subject: [edk2] [PATCH 00/11] Add IOMMU PEI support. >=20 > This series patch added IOMMU PEI support. > It is also posted to https://github.com/jyao1/edk2/tree/IoMmuPpi. >=20 > 1) Patch 1 and 2 add EDKII_IOMMU_PPI. > It is similar to EDKII_IOMMU_PROTOCOL. >=20 > 2) Patch 3 and 4 add Intel VTD PMR register support for DXE phase IntelVT= dDxe. > This is to prepare handle PMR usage in PEI phase. >=20 > 3) Patch 5 and 6 add EDKII_VTD_INFO_PPI. > This PPI is to provide Intel VTD information in PEI. > In DXE, the VTd driver can get VTD info from ACPI DMAR table. > But in PEI, there is no way to get VTD info before. > VTD_INFO_PPI is added to resolve the problem. >=20 > 4) Patch 7 and 8 add IntelVTdPmrPei driver. > This driver consumes EDKII_VTD_INFO_PPI and produces IOMMU_PPI. > It enables VTD PMR register to provide DMA protection. > The PMR based DMA protection is a simple solution to mark 2 regions=20 > can be DMA protected. > The IntelVTdPmrPei allocates a small chunk buffer for DMA and protect=20 > the rest memory. >=20 > 5) Patch 9 and 10 add a sample VTdInfo PEI driver. > It provides a sample to show how to report VTd info in PEI phase. >=20 > 6) Patch 11 updates XhciPei driver to consume IOMMU_PPI. > If the IOMMU_PPI is present, XhciPei will use IOMMU_PPI to allocate=20 > DMA buffer. Or the XhciPei will still use old way -=20 > PeiServiceAllocatePage to allocate DRAM as DMA buffer. > This is the first PEI device driver consuming IOMMU_PPI to show the conce= pt. > The rest PEI device drivers will be updated in separated patches. >=20 >=20 > This series patch is validated on Intel Kabylake Platform. > 1) We can use XHCI to do file transfer in PEI phase, > 2) We can still use XHCI in DXE phase, such as shell environment. > 3) If the device driver does not consume IOMMU_PPI, the DMA fails. >=20 > Jiewen Yao (11): > MdeModulePkg/Include: Add IOMMU_PPI. > MdeModulePkg/Dec: Add IOMMU_PPI GUID. > IntelSiliconPkg/Vtd.h: Add definition for PMR. > IntelSiliconPkg/VTdDxe: Disable PMR > IntelSiliconPkg/include: Add VTD_INFO PPI. > IntelSiliconPkg/dec: Add VTD_INFO PPI GUID > IntelSiliconPkg: Add IntelVTdPmrPei. > IntelSiliconPkg/dsc: Add IntelVTdPmrPeim. > IntelSiliconPkg: Add PlatformVTdInfoSamplePei. > IntelSiliconPkg/dsc: Add PlatformVTdInfoSamplePei. > MdeModulePkg/XhciPei: Support IoMmu. >=20 > IntelSiliconPkg/Include/IndustryStandard/Vtd.h > | 6 + > IntelSiliconPkg/Include/Ppi/VtdInfo.h > | 40 ++ > IntelSiliconPkg/IntelSiliconPkg.dec > | 3 + > IntelSiliconPkg/IntelSiliconPkg.dsc > | 10 + > IntelSiliconPkg/IntelVTdDxe/VtdReg.c > | 51 +- > IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmr.c > | 314 ++++++++++ > IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmrPei.c > | 615 ++++++++++++++++++++ > IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmrPei.h > | 68 +++ > IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmrPei.inf > | 59 ++ > IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmrPei.uni > | 20 + > IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmrPeiExtra.uni > | 20 + > IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c > | 65 +++ > IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf > | 51 ++ > IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.uni > | 20 + > =20 > IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePeiExtra > .uni > | 20 + > MdeModulePkg/Bus/Pci/XhciPei/DmaMem.c > | 249 ++++++++ > MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.c > | 55 +- > MdeModulePkg/Bus/Pci/XhciPei/UsbHcMem.h > | 9 +- > MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c > | 55 +- > MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.h > | 107 ++++ > MdeModulePkg/Bus/Pci/XhciPei/XhciPei.inf > | 3 + > MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c > | 47 +- > MdeModulePkg/Bus/Pci/XhciPei/XhciSched.h > | 1 + > MdeModulePkg/Include/Ppi/IoMmu.h > | 196 +++++++ > MdeModulePkg/MdeModulePkg.dec > | 3 + > 25 files changed, 2052 insertions(+), 35 deletions(-) create mode=20 > 100644 IntelSiliconPkg/Include/Ppi/VtdInfo.h > create mode 100644 IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmr.c > create mode 100644 IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmrPei.c > create mode 100644 IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmrPei.h > create mode 100644 IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmrPei.inf > create mode 100644 IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmrPei.uni > create mode 100644=20 > IntelSiliconPkg/IntelVTdPmrPei/IntelVTdPmrPeiExtra.uni > create mode 100644 > IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.c > create mode 100644 > IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf > create mode 100644 > IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.uni > create mode 100644 > IntelSiliconPkg/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePeiExtra > .uni create mode 100644 MdeModulePkg/Bus/Pci/XhciPei/DmaMem.c > create mode 100644 MdeModulePkg/Include/Ppi/IoMmu.h >=20 > -- > 2.7.4.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel