From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8A42781F0C for ; Sat, 12 Nov 2016 05:02:28 -0800 (PST) Received: by mail-wm0-x229.google.com with SMTP id f82so23446954wmf.1 for ; Sat, 12 Nov 2016 05:02:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=6yN28AMYVs4xh9WcdH9+9eO6k6we8EUnRlyvybA7gOo=; b=RrwTmJbhh1RMEJ2OJALOuCm4CQVJgc5vm7wCaz6qHQc5rCw+oZp99UEoV2msfJYIIW akiMBWZ6LUt2EECNpYXAbubhZO4etdcxSIoCp18Vs6v/guchqxnoprZvLY+edK3XIich Fct/gaFuqiIoak58GEGoQgZ2vQEfIbUZHxso8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6yN28AMYVs4xh9WcdH9+9eO6k6we8EUnRlyvybA7gOo=; b=ShpQ95Ho8LcwTENA404ILVcLpP6cTIW7/JlpPDuaLNyTYsHcNuDUdFo1Pwvrgd9qnS 83hHetOQ1I9zvrRHZ/2RnjwXOLWXNahMd7KZnC4XrtKkDvuINLwPY9iq55EDcIFWhtTd mcIJBD3HEKpC4SSEUgLAsr09sPErBlzjF3tw4hV8q8wpYceHBz/fcaz669pebuPLRlaZ mWV75A+WinS/MhdNJIMEyJsnstfhkBvSrZ6Ovp+FDOOnTdT1LhKXX6wcScVbPKdGGKa6 sXi/Cphe9OJPVj4Pn4qgmQIoi8HdSWyvTvoI+oucDgoRe7lfb8bTUyqHVciV/fbJSaUJ xD9A== X-Gm-Message-State: ABUngvf9GNQbZxzMKU2fOu98FfH/6IYx7dUPmoYFRVSoBmXIE/M87yJBVVjVjpzwz7o38Pxz X-Received: by 10.28.214.84 with SMTP id n81mr2309472wmg.120.1478955751062; Sat, 12 Nov 2016 05:02:31 -0800 (PST) Received: from ards-macbook-pro.access.network ([193.57.185.11]) by smtp.gmail.com with ESMTPSA id e188sm6084212wma.21.2016.11.12.05.02.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 12 Nov 2016 05:02:30 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Cc: Ard Biesheuvel Date: Sat, 12 Nov 2016 14:02:24 +0100 Message-Id: <1478955748-14819-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [PATCH v2 0/4] ArmPkg: more ArmDmaLib fixes 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: Sat, 12 Nov 2016 13:02:28 -0000 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