Webcentive RISC-V Reference

mseccfg

Machine security configuration register

Address
0x747
Group
Machine-level CSRs
Privilege
MRW (privileged spec CSR listing, Machine Configuration)
Access
read/write; lowest privilege M (machine)
Address range
Standard read/write
Name in riscv-unified-db
Machine Security Configuration

Privileged spec: Machine security configuration register

Description

Machine Security Configuration

From riscv-unified-db, reformatted.

Fields

FieldBitsTypeDescription
MML0RW-R

Machine Mode Lockdown.

MML is a WARL field that changes the interpretation of the pmpcfg.L bit. It is a sticky bit: once set, it cannot be cleared until a PMP reset.

When MML is set:

  1. pmpcfg.L no longer marks a rule as locked and enforced in all modes. Instead, it marks a rule as M-mode-only when set and S/U-mode-only when clear. The formerly reserved encoding pmpcfg.RW=01, and the encoding pmpcfg.LRWX=1111, now encode a Shared-Region.
  2. Adding a rule with executable privileges that is either M-mode-only or a locked Shared-Region is not possible, and such pmpcfg writes are ignored, unless mseccfg.RLB is set.
  3. M-mode can only execute code from regions with a matching M-mode-only rule or a locked Shared-Region rule with executable privileges.

When MML is clear, the combination pmpcfg.RW=01 remains reserved.

MMWP1RW-R

Machine-Mode Allowlist Policy.

MMWP is a WARL field that changes the default PMP policy for M-mode when accessing memory regions that don't have a matching PMP rule. When set, such accesses are denied instead of ignored.

It is a sticky bit: once set, it cannot be cleared until a PMP reset.

RLB2RW-R

Rule Locking Bypass.

RLB is a WARL field that provides a mechanism to temporarily modify locked PMP rules. When RLB is 1, locked PMP rules may be removed or modified, and locked PMP entries may be edited.

When RLB is 0 and pmpcfg.L is 1 in any rule or entry (including disabled entries), RLB remains 0 and any further modifications to RLB are ignored until a PMP reset.

Vendors who don't need this functionality may hardwire this field to 0.

USEED8

Controls access to the seed CSR from U-mode.

SSEED9

Controls access to the seed CSR from S-mode and VS-mode.

Fields from riscv-unified-db; field types computed by IDL functions there are not shown.

Specification and related pages