[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251113014656.2605447-19-samuel.holland@sifive.com>
Date: Wed, 12 Nov 2025 17:45:31 -0800
From: Samuel Holland <samuel.holland@...ive.com>
To: Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <pjw@...nel.org>,
linux-riscv@...ts.infradead.org,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>,
linux-mm@...ck.org
Cc: devicetree@...r.kernel.org,
Suren Baghdasaryan <surenb@...gle.com>,
linux-kernel@...r.kernel.org,
Mike Rapoport <rppt@...nel.org>,
Michal Hocko <mhocko@...e.com>,
Conor Dooley <conor@...nel.org>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Alexandre Ghiti <alex@...ti.fr>,
Emil Renner Berthing <kernel@...il.dk>,
Rob Herring <robh+dt@...nel.org>,
Vlastimil Babka <vbabka@...e.cz>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>,
Samuel Holland <samuel.holland@...ive.com>
Subject: [PATCH v3 18/22] riscv: Fix logic for selecting DMA_DIRECT_REMAP
DMA_DIRECT_REMAP allows the kernel to make pages coherent for DMA by
remapping them in the page tables with a different pgprot_t value. On
RISC-V, this is supported by the page-based memory type extensions
(Svpbmt and Xtheadmae). It is independent from the software cache
maintenance extensions (Zicbom and Xtheadcmo).
Signed-off-by: Samuel Holland <samuel.holland@...ive.com>
---
Changes in v3:
- New patch for v3
arch/riscv/Kconfig | 2 +-
arch/riscv/Kconfig.errata | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index fadec20b87a8..cf5a4b5cdcd4 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -598,6 +598,7 @@ config RISCV_ISA_SVPBMT
depends on 64BIT && MMU
depends on RISCV_ALTERNATIVE
default y
+ select DMA_DIRECT_REMAP
help
Add support for the Svpbmt ISA-extension (Supervisor-mode:
page-based memory types) in the kernel when it is detected at boot.
@@ -811,7 +812,6 @@ config RISCV_ISA_ZICBOM
depends on RISCV_ALTERNATIVE
default y
select RISCV_DMA_NONCOHERENT
- select DMA_DIRECT_REMAP
help
Add support for the Zicbom extension (Cache Block Management
Operations) and enable its use in the kernel when it is detected
diff --git a/arch/riscv/Kconfig.errata b/arch/riscv/Kconfig.errata
index aca9b0cfcfec..46a353a266e5 100644
--- a/arch/riscv/Kconfig.errata
+++ b/arch/riscv/Kconfig.errata
@@ -108,6 +108,7 @@ config ERRATA_THEAD
config ERRATA_THEAD_MAE
bool "Apply T-Head's memory attribute extension (XTheadMae) errata"
depends on ERRATA_THEAD && 64BIT && MMU
+ select DMA_DIRECT_REMAP
select RISCV_ALTERNATIVE_EARLY
default y
help
@@ -119,7 +120,6 @@ config ERRATA_THEAD_MAE
config ERRATA_THEAD_CMO
bool "Apply T-Head cache management errata"
depends on ERRATA_THEAD && MMU
- select DMA_DIRECT_REMAP
select RISCV_DMA_NONCOHERENT
select RISCV_NONSTANDARD_CACHE_OPS
default y
--
2.47.2
Powered by blists - more mailing lists