public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 0/4] ArmPkg: more ArmDmaLib fixes
@ 2016-11-12 13:02 Ard Biesheuvel
  2016-11-12 13:02 ` [PATCH v2 1/4] ArmPkg/ArmDmaLib: use DMA buffer alignment from CPU arch protocol Ard Biesheuvel
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Ard Biesheuvel @ 2016-11-12 13:02 UTC (permalink / raw)
  To: edk2-devel, leif.lindholm; +Cc: Ard Biesheuvel

Using patch #4 in anger (which was the only patch in the v1 submission of
this series) revealed some issues in the ArmDmaLib code related to abuse
of the device address where a CPU physical address (which usually, but
not always translates 1:1 to a CPU virtual address) was dereferenced by
the CPU.

Patch #1 is an unrelated fix that drops the direct dependency on ArmLib.

Patch #2 adds a missing virtual-to-physical conversion (which is required
when DebugUncachedMemoryAllocationLib is in use)

The device address of a DMA mapping is not to be dereferenced by the CPU,
especially not after patch #4 is applied, which allows the bus view and
the CPU view to be shifted by a fixed offset. So patch #3 corrects some
wrong uses of the device address.

Patch #4 is the original patch, with some in-code comments added to further
clarify how the offset should be specified, and why ConvertToPhysicalAddress()
needs to be called before taking this offset into account.  

Ard Biesheuvel (4):
  ArmPkg/ArmDmaLib: use DMA buffer alignment from CPU arch protocol
  ArmPkg/ArmDmaLib: fix incorrect device address of double buffer
  ArmPkg/ArmDmaLib: clean up abuse of device address
  ArmPkg/ArmDmaLib: add support for fixed host-to-device DMA offset

 ArmPkg/ArmPkg.dec                      |  8 +++
 ArmPkg/Library/ArmDmaLib/ArmDmaLib.c   | 51 +++++++++++++-------
 ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf |  3 +-
 3 files changed, 42 insertions(+), 20 deletions(-)

-- 
2.7.4



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

end of thread, other threads:[~2016-11-30 16:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-12 13:02 [PATCH v2 0/4] ArmPkg: more ArmDmaLib fixes Ard Biesheuvel
2016-11-12 13:02 ` [PATCH v2 1/4] ArmPkg/ArmDmaLib: use DMA buffer alignment from CPU arch protocol Ard Biesheuvel
2016-11-14 15:18   ` Leif Lindholm
2016-11-12 13:02 ` [PATCH v2 2/4] ArmPkg/ArmDmaLib: fix incorrect device address of double buffer Ard Biesheuvel
2016-11-14 15:13   ` Leif Lindholm
2016-11-12 13:02 ` [PATCH v2 3/4] ArmPkg/ArmDmaLib: clean up abuse of device address Ard Biesheuvel
2016-11-14 15:16   ` Leif Lindholm
2016-11-15  9:19     ` Ard Biesheuvel
2016-11-15 11:34       ` Ryan Harkin
2016-11-15 13:07         ` Ard Biesheuvel
2016-11-15 18:01           ` Leif Lindholm
2016-11-30 16:45             ` Leif Lindholm
2016-11-12 13:02 ` [PATCH v2 4/4] ArmPkg/ArmDmaLib: add support for fixed host-to-device DMA offset Ard Biesheuvel
2016-11-14 15:17   ` Leif Lindholm

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