From: Christoph Hellwig <hch@lst.de>
To: iommu@lists.linux-foundation.org
Cc: Guan Xuetao <gxt@pku.edu.cn>, Shawn Anastasio <shawn@anastas.io>,
Russell King <linux@armlinux.org.uk>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Paul Burton <paul.burton@mips.com>,
James Hogan <jhogan@kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
Mark Rutland <mark.rutland@arm.com>
Subject: [PATCH 5/6] arm64: document the choice of page attributes for pgprot_dmacoherent
Date: Mon, 26 Aug 2019 15:25:52 +0200 [thread overview]
Message-ID: <20190826132553.4116-6-hch@lst.de> (raw)
In-Reply-To: <20190826132553.4116-1-hch@lst.de>
Based on an email from Will Deacon.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
---
arch/arm64/include/asm/pgtable.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index 6700371227d1..fd40fb05eb51 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -435,6 +435,14 @@ static inline pmd_t pmd_mkdevmap(pmd_t pmd)
__pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN)
#define pgprot_device(prot) \
__pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRE) | PTE_PXN | PTE_UXN)
+/*
+ * DMA allocations for non-coherent devices use what the Arm architecture calls
+ * "Normal non-cacheable" memory, which permits speculation, unaligned accesses
+ * and merging of writes. This is different from "Device-nGnR[nE]" memory which
+ * is intended for MMIO and thus forbids speculation, preserves access size,
+ * requires strict alignment and can also force write responses to come from the
+ * endpoint.
+ */
#define pgprot_dmacoherent(prot) \
__pgprot_modify(prot, PTE_ATTRINDX_MASK, \
PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN)
--
2.20.1
next prev parent reply other threads:[~2019-08-26 13:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-26 13:25 cleanup the dma_pgprot handling v2 Christoph Hellwig
2019-08-26 13:25 ` [PATCH 1/6] unicore32: remove the unused pgprot_dmacoherent define Christoph Hellwig
2019-08-26 13:25 ` [PATCH 2/6] arm-nommu: " Christoph Hellwig
2019-08-26 13:25 ` [PATCH 3/6] dma-mapping: remove arch_dma_mmap_pgprot Christoph Hellwig
2019-08-27 10:02 ` Paul Burton
2019-08-26 13:25 ` [PATCH 4/6] dma-mapping: make dma_atomic_pool_init self-contained Christoph Hellwig
2019-08-26 13:25 ` Christoph Hellwig [this message]
2019-08-26 13:25 ` [PATCH 6/6] MIPS: document mixing "slightly different CCAs" Christoph Hellwig
2019-08-27 10:03 ` Paul Burton
2019-08-29 15:28 ` cleanup the dma_pgprot handling v2 Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190826132553.4116-6-hch@lst.de \
--to=hch@lst.de \
--cc=catalin.marinas@arm.com \
--cc=geert@linux-m68k.org \
--cc=gxt@pku.edu.cn \
--cc=iommu@lists.linux-foundation.org \
--cc=jhogan@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mark.rutland@arm.com \
--cc=paul.burton@mips.com \
--cc=robin.murphy@arm.com \
--cc=shawn@anastas.io \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).