[binutils-gdb] RISC-V: Add support for Smpmpmt v0.6 extension

Jeff Law via Binutils-cvs <[email protected]> Wed, 24 Jun 2026 14:50:35 +0000 (GMT)
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e56bd09181016800870de47c1f3a1091f71d9120

commit e56bd09181016800870de47c1f3a1091f71d9120
Author: Jerry Zhang Jian <[email protected]>
Date:   Wed Jun 24 08:49:11 2026 -0600

    RISC-V: Add support for Smpmpmt v0.6 extension
    
    This implements the Smpmpmt (PMP-based Memory Types) extension,
    version 1.0[1].
    
    The Smpmpmt extension provides a mechanism to control memory
    attributes at the granularity of PMP regions, analogous to Svpbmt
    but associated with PMP registers rather than page-table entries.
    
    The extension is currently in frozen state[2].
    
    [1] https://github.com/riscv/riscv-isa-manual/blob/smpmpmt/src/smpmpmt.adoc
    [2] https://riscv.atlassian.net/browse/RVS-2948
    
    [JL] Since this patch was originally posted, the spec has moved to v1.0.  I've
    adjusted the patch & ChangeLog accordingly.
    
    bfd/ChangeLog:
    
            * elfxx-riscv.c: Add Smpmpmt v1.6 extension.
    
    gas/ChangeLog:
    
            * NEWS: Updated.
            * testsuite/gas/riscv/march-help.l: Ditto.
    
    Signed-off-by: Jerry Zhang Jian <[email protected]>

Diff:
---
 bfd/elfxx-riscv.c                    | 1 +
 gas/NEWS                             | 2 +-
 gas/testsuite/gas/riscv/march-help.l | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 19e97776f1f..961c44a9206 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1579,6 +1579,7 @@ static const struct riscv_supported_ext riscv_supported_std_s_ext[] =
   {"smcntrpmf",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smctr",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smepmp",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"smpmpmt",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smrnmi",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smdbltrp",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
diff --git a/gas/NEWS b/gas/NEWS
index 186ee96c687..4c55a544f25 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -6,7 +6,7 @@
   and will be removed in a future release.
 
 * Add support for RISC-V standard extensions:
-  zalasr v1.0, svrsw60t59b v1.0, zvabd v1.0.
+  zalasr v1.0, svrsw60t59b v1.0, zvabd v1.0, smpmpmt v1.0.
 
 * Add support for RISC-V vendor extensions:
   SpacemiT: xsmtvdot v1.0, xsmtvdotii v1.0.
diff --git a/gas/testsuite/gas/riscv/march-help.l b/gas/testsuite/gas/riscv/march-help.l
index df970a5c75d..a04d720d5b4 100644
--- a/gas/testsuite/gas/riscv/march-help.l
+++ b/gas/testsuite/gas/riscv/march-help.l
@@ -126,6 +126,7 @@ All available -march extensions for RISC-V:
 	smcntrpmf                               1.0
 	smctr                                   1.0
 	smepmp                                  1.0
+	smpmpmt                                 0.6
 	smrnmi                                  1.0
 	smstateen                               1.0
 	smdbltrp                                1.0