From: Baruch Siach <baruch@tkos.co.il>
To: Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>
Cc: "Baruch Siach" <baruch@tkos.co.il>,
"Robin Murphy" <robin.murphy@arm.com>,
iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-s390@vger.kernel.org, "Petr Tesařík" <petr@tesarici.cz>,
"Ramon Fried" <ramon@neureality.ai>,
"Elad Nachman" <enachman@marvell.com>
Subject: [PATCH v3 0/3] dma: support DMA zone starting above 4GB
Date: Mon, 29 Jul 2024 13:51:23 +0300 [thread overview]
Message-ID: <cover.1722249878.git.baruch@tkos.co.il> (raw)
DMA zones code assumes that DMA lower limit is zero. When there is no RAM
below 4GB, arm64 platform code sets DMA/DMA32 zone limits to cover the entire
RAM[0].
My target platform has RAM starting at 32GB. Devices with 30-bit DMA mask are
mapped to 1GB at the bottom of RAM, between 32GB - 33GB. DMA zone over the
entire RAM breaks DMA allocation for these devices.
In response to a previous RFC hack[1] Catalin Marinas suggested to add a
separate offset value as base address for the DMA zone, and then refined the
suggestion to use start of RAM[3]. This RFC series attempts to implement that
suggestion.
With this series applied, the DMA zone covers the right RAM range for my
platform.
v3:
* Rebase on v6.11-rc1.
* Drop zone_dma_base. Use memblock_start_of_DRAM() instead.
* Drop DT patches. Low DMA range limit no longer needed.
* Add patch to improve dma_direct_optimal_gfp_mask() heuristics as Catalin
suggested.
RFC v2:
* Add patch from Catalin[2] changing zone_dma_bits to zone_dma_limit to
simplify subsequent patches
* Test on real hardware
RFC v1: https://lore.kernel.org/all/cover.1703683642.git.baruch@tkos.co.il/
[0] See commit 791ab8b2e3db ("arm64: Ignore any DMA offsets in the
max_zone_phys() calculation")
[1] https://lore.kernel.org/all/9af8a19c3398e7dc09cfc1fbafed98d795d9f83e.1699464622.git.baruch@tkos.co.il/
[2] https://lore.kernel.org/all/ZZ2HnHJV3gdzu1Aj@arm.com/
[3] https://lore.kernel.org/all/ZnH-VU2iz9Q2KLbr@arm.com/
Baruch Siach (2):
dma-mapping: improve DMA zone selection
dma-direct: use RAM start to offset zone_dma_limit
Catalin Marinas (1):
dma-mapping: replace zone_dma_bits by zone_dma_limit
arch/arm64/mm/init.c | 34 +++++++++++++---------------------
arch/powerpc/mm/mem.c | 9 ++++-----
arch/s390/mm/init.c | 2 +-
include/linux/dma-direct.h | 2 +-
kernel/dma/direct.c | 15 ++++++++-------
kernel/dma/pool.c | 3 ++-
kernel/dma/swiotlb.c | 4 ++--
7 files changed, 31 insertions(+), 38 deletions(-)
--
2.43.0
WARNING: multiple messages have this Message-ID (diff)
From: Baruch Siach <baruch@tkos.co.il>
To: Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>
Cc: linux-s390@vger.kernel.org, "Baruch Siach" <baruch@tkos.co.il>,
"Ramon Fried" <ramon@neureality.ai>,
"Petr Tesařík" <petr@tesarici.cz>,
"Robin Murphy" <robin.murphy@arm.com>,
linux-kernel@vger.kernel.org, iommu@lists.linux.dev,
"Elad Nachman" <enachman@marvell.com>,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 0/3] dma: support DMA zone starting above 4GB
Date: Mon, 29 Jul 2024 13:51:23 +0300 [thread overview]
Message-ID: <cover.1722249878.git.baruch@tkos.co.il> (raw)
DMA zones code assumes that DMA lower limit is zero. When there is no RAM
below 4GB, arm64 platform code sets DMA/DMA32 zone limits to cover the entire
RAM[0].
My target platform has RAM starting at 32GB. Devices with 30-bit DMA mask are
mapped to 1GB at the bottom of RAM, between 32GB - 33GB. DMA zone over the
entire RAM breaks DMA allocation for these devices.
In response to a previous RFC hack[1] Catalin Marinas suggested to add a
separate offset value as base address for the DMA zone, and then refined the
suggestion to use start of RAM[3]. This RFC series attempts to implement that
suggestion.
With this series applied, the DMA zone covers the right RAM range for my
platform.
v3:
* Rebase on v6.11-rc1.
* Drop zone_dma_base. Use memblock_start_of_DRAM() instead.
* Drop DT patches. Low DMA range limit no longer needed.
* Add patch to improve dma_direct_optimal_gfp_mask() heuristics as Catalin
suggested.
RFC v2:
* Add patch from Catalin[2] changing zone_dma_bits to zone_dma_limit to
simplify subsequent patches
* Test on real hardware
RFC v1: https://lore.kernel.org/all/cover.1703683642.git.baruch@tkos.co.il/
[0] See commit 791ab8b2e3db ("arm64: Ignore any DMA offsets in the
max_zone_phys() calculation")
[1] https://lore.kernel.org/all/9af8a19c3398e7dc09cfc1fbafed98d795d9f83e.1699464622.git.baruch@tkos.co.il/
[2] https://lore.kernel.org/all/ZZ2HnHJV3gdzu1Aj@arm.com/
[3] https://lore.kernel.org/all/ZnH-VU2iz9Q2KLbr@arm.com/
Baruch Siach (2):
dma-mapping: improve DMA zone selection
dma-direct: use RAM start to offset zone_dma_limit
Catalin Marinas (1):
dma-mapping: replace zone_dma_bits by zone_dma_limit
arch/arm64/mm/init.c | 34 +++++++++++++---------------------
arch/powerpc/mm/mem.c | 9 ++++-----
arch/s390/mm/init.c | 2 +-
include/linux/dma-direct.h | 2 +-
kernel/dma/direct.c | 15 ++++++++-------
kernel/dma/pool.c | 3 ++-
kernel/dma/swiotlb.c | 4 ++--
7 files changed, 31 insertions(+), 38 deletions(-)
--
2.43.0
next reply other threads:[~2024-07-29 10:51 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 10:51 Baruch Siach [this message]
2024-07-29 10:51 ` [PATCH v3 0/3] dma: support DMA zone starting above 4GB Baruch Siach
2024-07-29 10:51 ` [PATCH v3 1/3] dma-mapping: improve DMA zone selection Baruch Siach
2024-07-29 10:51 ` Baruch Siach
2024-07-29 10:51 ` [PATCH v3 2/3] dma-mapping: replace zone_dma_bits by zone_dma_limit Baruch Siach
2024-07-29 10:51 ` Baruch Siach
2024-07-29 20:20 ` kernel test robot
2024-07-29 20:20 ` kernel test robot
2024-07-30 2:12 ` Nathan Chancellor
2024-07-30 2:12 ` Nathan Chancellor
2024-07-30 15:34 ` Christoph Hellwig
2024-07-30 15:34 ` Christoph Hellwig
2024-08-01 1:24 ` Nathan Chancellor
2024-08-01 1:24 ` Nathan Chancellor
2024-08-01 13:44 ` Christoph Hellwig
2024-08-01 13:44 ` Christoph Hellwig
2024-08-01 15:22 ` Nathan Chancellor
2024-08-01 15:22 ` Nathan Chancellor
2024-07-31 17:26 ` Catalin Marinas
2024-07-31 17:26 ` Catalin Marinas
2024-07-29 10:51 ` [PATCH v3 3/3] dma-direct: use RAM start to offset zone_dma_limit Baruch Siach
2024-07-29 10:51 ` Baruch Siach
2024-07-31 17:33 ` Catalin Marinas
2024-07-31 17:33 ` Catalin Marinas
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=cover.1722249878.git.baruch@tkos.co.il \
--to=baruch@tkos.co.il \
--cc=catalin.marinas@arm.com \
--cc=enachman@marvell.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=m.szyprowski@samsung.com \
--cc=petr@tesarici.cz \
--cc=ramon@neureality.ai \
--cc=robin.murphy@arm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.