public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH V2 0/6] SourceLevelDebugPkg DebugUsb3: Re-Support IOMMU
@ 2018-03-14  9:33 Star Zeng
  2018-03-14  9:33 ` [PATCH V2 1/6] Revert "DebugUsb3: Check mUsb3Instance before dereferencing it" Star Zeng
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Star Zeng @ 2018-03-14  9:33 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Ruiyu Ni, Hao Wu

The patch series is also at
https://github.com/lzeng14/edk2 DebugCommUsb3AfterIOMMUV2 branch.

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.

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.

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.

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.

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.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>

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

 .../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(-)

-- 
2.7.0.windows.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-03-14 11:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-14  9:33 [PATCH V2 0/6] SourceLevelDebugPkg DebugUsb3: Re-Support IOMMU Star Zeng
2018-03-14  9:33 ` [PATCH V2 1/6] Revert "DebugUsb3: Check mUsb3Instance before dereferencing it" Star Zeng
2018-03-14  9:33 ` [PATCH V2 2/6] Revert "DebugUsb3: Fix GCC build failures" Star Zeng
2018-03-14  9:33 ` [PATCH V2 3/6] Revert "DebugUsb3: Support IOMMU" Star Zeng
2018-03-14  9:33 ` [PATCH V2 4/6] SourceLevelDebugPkg DebugUsb3: Re-Fix GCC build failures Star Zeng
2018-03-14  9:33 ` [PATCH V2 5/6] SourceLevelDebugPkg DebugCommUsb3: Refine some formats/comments Star Zeng
2018-03-14  9:33 ` [PATCH V2 6/6] SourceLevelDebugPkg DebugUsb3: Re-Support IOMMU Star Zeng
2018-03-14  9:47 ` [PATCH V2 0/6] " Ni, Ruiyu
2018-03-14 11:35 ` Wu, Hao A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox