CSR Bit Fields

RISC-V vsctrctl CSR Register

Address 0x24EPrivilege Hypervisor direct / VS aliasAccess HRW / 64-bit; RV32 explicit access reaches only bits 31:0, with no vsctrctlhHypervisor and virtualization CSRs

vsctrctl (0x24E) is the 64-bit VS-mode CTR control CSR when H is implemented; when V=1 it substitutes for sctrctl.

Field Map

Understand vsctrctl By Bit Fields

25 key fields
0

U

RW

Selects transfer recording in VU-mode; this field is mandatory writable.

U (bit 0) — Selects transfer recording in VU-mode; this field is mandatory writable.

What This Field Controls

  • - Selects transfer recording in VU-mode; this field is mandatory writable.

Common Values

00

VU-mode recording is not selected.

11

VU-mode recording is selected.

Open Official Manual
1

S

RW

Selects transfer recording in VS-mode; this field is mandatory writable.

S (bit 1) — Selects transfer recording in VS-mode; this field is mandatory writable.

What This Field Controls

  • - Selects transfer recording in VS-mode; this field is mandatory writable.

Common Values

00

VS-mode recording is not selected.

11

VS-mode recording is selected.

Open Official Manual
6:2

WPRI

WPRI / RO0

Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

WPRI (bits 6:2) — Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

What This Field Controls

  • - Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
7

RASEMU

RW if implemented; otherwise RO0

Enables Return Address Stack (RAS) emulation mode; when set, calls are recorded, returns pop entries, co-routine swaps act as a return plus call, other transfer types are inhibited, and bits 47:32 plus xTE are ignored.

RASEMU (bit 7) — Enables Return Address Stack (RAS) emulation mode; when set, calls are recorded, returns pop entries, co-routine swaps act as a return plus call, other transfer types are inhibited, and bits 47:32 plus xTE are ignored.

What This Field Controls

  • - Enables Return Address Stack (RAS) emulation mode; when set, calls are recorded, returns pop entries, co-routine swaps act as a return plus call, other transfer types are inhibited, and bits 47:32 plus xTE are ignored.

Common Values

00

Use normal CTR recording behavior.

11

Enable RAS-emulation recording behavior and ignore the transfer filters and external-trap enable bits.

Open Official Manual
8

STE

RW if implemented; otherwise RO0

When VS-mode recording is not selected, permits recording external traps to VS-mode; if external-trap recording is implemented and H is implemented, vsctrctl.STE must be implemented.

STE (bit 8) — When VS-mode recording is not selected, permits recording external traps to VS-mode; if external-trap recording is implemented and H is implemented, vsctrctl.STE must be implemented.

What This Field Controls

  • - When VS-mode recording is not selected, permits recording external traps to VS-mode; if external-trap recording is implemented and H is implemented, vsctrctl.STE must be implemented.

Common Values

00

Do not additionally permit recording external traps to VS-mode.

11

Permit recording external traps to VS-mode.

Open Official Manual
10:9

WPRI

WPRI / RO0

Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

WPRI (bits 10:9) — Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

What This Field Controls

  • - Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
11

BPFRZ

RW

Sets sctrstatus.FROZEN when a breakpoint exception traps to VS-mode; this field is mandatory writable.

BPFRZ (bit 11) — Sets sctrstatus.FROZEN when a breakpoint exception traps to VS-mode; this field is mandatory writable.

What This Field Controls

  • - Sets sctrstatus.FROZEN when a breakpoint exception traps to VS-mode; this field is mandatory writable.

Common Values

00

Breakpoint traps do not trigger this automatic freeze.

11

A qualifying breakpoint trap sets FROZEN.

Open Official Manual
12

LCOFIFRZ

RW if implemented; otherwise RO0

Sets sctrstatus.FROZEN when a local-counter-overflow interrupt traps to VS-mode; it must be writable when Sscofpmf is implemented.

LCOFIFRZ (bit 12) — Sets sctrstatus.FROZEN when a local-counter-overflow interrupt traps to VS-mode; it must be writable when Sscofpmf is implemented.

What This Field Controls

  • - Sets sctrstatus.FROZEN when a local-counter-overflow interrupt traps to VS-mode; it must be writable when Sscofpmf is implemented.

Common Values

00

LCOFI traps do not trigger this automatic freeze.

11

A qualifying LCOFI trap sets FROZEN.

Open Official Manual
32:13

WPRI

WPRI / RO0

Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

WPRI (bits 32:13) — Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

What This Field Controls

  • - Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
33

EXCINH

RW if implemented; otherwise RO0

Inhibits recording exceptions.

EXCINH (bit 33) — Inhibits recording exceptions.

What This Field Controls

  • - Inhibits recording exceptions.

Common Values

00

Do not inhibit exceptions recording through this bit.

11

Inhibit exceptions recording.

Open Official Manual
34

INTRINH

RW if implemented; otherwise RO0

Inhibits recording interrupts.

INTRINH (bit 34) — Inhibits recording interrupts.

What This Field Controls

  • - Inhibits recording interrupts.

Common Values

00

Do not inhibit interrupts recording through this bit.

11

Inhibit interrupts recording.

Open Official Manual
35

TRETINH

RW if implemented; otherwise RO0

Inhibits recording trap returns.

TRETINH (bit 35) — Inhibits recording trap returns.

What This Field Controls

  • - Inhibits recording trap returns.

Common Values

00

Do not inhibit trap returns recording through this bit.

11

Inhibit trap returns recording.

Open Official Manual
36

NTBREN

RW if implemented; otherwise RO0

Enables recording not-taken branches; this is an enable bit rather than an inhibit bit.

NTBREN (bit 36) — Enables recording not-taken branches; this is an enable bit rather than an inhibit bit.

What This Field Controls

  • - Enables recording not-taken branches; this is an enable bit rather than an inhibit bit.

Common Values

00

Do not record not-taken branches.

11

Record qualifying not-taken branches.

Open Official Manual
37

TKBRINH

RW if implemented; otherwise RO0

Inhibits recording taken branches.

TKBRINH (bit 37) — Inhibits recording taken branches.

What This Field Controls

  • - Inhibits recording taken branches.

Common Values

00

Do not inhibit taken branches recording through this bit.

11

Inhibit taken branches recording.

Open Official Manual
39:38

WPRI

WPRI / RO0

Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

WPRI (bits 39:38) — Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

What This Field Controls

  • - Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
40

INDCALLINH

RW if implemented; otherwise RO0

Inhibits recording indirect calls.

INDCALLINH (bit 40) — Inhibits recording indirect calls.

What This Field Controls

  • - Inhibits recording indirect calls.

Common Values

00

Do not inhibit indirect calls recording through this bit.

11

Inhibit indirect calls recording.

Open Official Manual
41

DIRCALLINH

RW if implemented; otherwise RO0

Inhibits recording direct calls.

DIRCALLINH (bit 41) — Inhibits recording direct calls.

What This Field Controls

  • - Inhibits recording direct calls.

Common Values

00

Do not inhibit direct calls recording through this bit.

11

Inhibit direct calls recording.

Open Official Manual
42

INDJMPINH

RW if implemented; otherwise RO0

Inhibits recording indirect jumps without linkage.

INDJMPINH (bit 42) — Inhibits recording indirect jumps without linkage.

What This Field Controls

  • - Inhibits recording indirect jumps without linkage.

Common Values

00

Do not inhibit indirect jumps without linkage recording through this bit.

11

Inhibit indirect jumps without linkage recording.

Open Official Manual
43

DIRJMPINH

RW if implemented; otherwise RO0

Inhibits recording direct jumps without linkage.

DIRJMPINH (bit 43) — Inhibits recording direct jumps without linkage.

What This Field Controls

  • - Inhibits recording direct jumps without linkage.

Common Values

00

Do not inhibit direct jumps without linkage recording through this bit.

11

Inhibit direct jumps without linkage recording.

Open Official Manual
44

CORSWAPINH

RW if implemented; otherwise RO0

Inhibits recording co-routine swaps.

CORSWAPINH (bit 44) — Inhibits recording co-routine swaps.

What This Field Controls

  • - Inhibits recording co-routine swaps.

Common Values

00

Do not inhibit co-routine swaps recording through this bit.

11

Inhibit co-routine swaps recording.

Open Official Manual
45

RETINH

RW if implemented; otherwise RO0

Inhibits recording function returns.

RETINH (bit 45) — Inhibits recording function returns.

What This Field Controls

  • - Inhibits recording function returns.

Common Values

00

Do not inhibit function returns recording through this bit.

11

Inhibit function returns recording.

Open Official Manual
46

INDLJMPINH

RW if implemented; otherwise RO0

Inhibits recording other indirect jumps with linkage.

INDLJMPINH (bit 46) — Inhibits recording other indirect jumps with linkage.

What This Field Controls

  • - Inhibits recording other indirect jumps with linkage.

Common Values

00

Do not inhibit other indirect jumps with linkage recording through this bit.

11

Inhibit other indirect jumps with linkage recording.

Open Official Manual
47

DIRLJMPINH

RW if implemented; otherwise RO0

Inhibits recording other direct jumps with linkage.

DIRLJMPINH (bit 47) — Inhibits recording other direct jumps with linkage.

What This Field Controls

  • - Inhibits recording other direct jumps with linkage.

Common Values

00

Do not inhibit other direct jumps with linkage recording through this bit.

11

Inhibit other direct jumps with linkage recording.

Open Official Manual
59:48

WPRI

WPRI / RO0

Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

WPRI (bits 59:48) — Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

What This Field Controls

  • - Reserved. Software ignores reads and preserves these bits on writes; undefined implementations are read-only zero.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
63:60

Custom

WARL

WARL custom bits; value 0 must correspond to standard CTR behavior.

Custom (bits 63:60) — WARL custom bits; value 0 must correspond to standard CTR behavior.

What This Field Controls

  • - WARL custom bits; value 0 must correspond to standard CTR behavior.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
Official Basis & Search Notes

vsctrctl is the guest-visible CTR control copy. When V=1 it substitutes for sctrctl so a guest can configure VS/VU recording and filtering; when V=0 those guest settings do not affect host CTR behavior.

Address/access/width: 0x24E, HRW, 64-bit; RV32 cannot access xctrctl[63:32], and no vsctrctlh exists.
S, U, and BPFRZ are mandatory writable; other fields are optional and read zero when unimplemented; if external-trap recording and H are implemented, vsctrctl.STE must be implemented.
mstateen0.CTR and hstateen0.CTR can restrict CTR state access; when clear, VS accesses to supervisor CTR state raise the specified exceptions.
vsctrctl controls guest CTR configuration only; CTR entry-register state does not have a separate V=1 copy.

What To Check First When Reading This CSR

  • - vsctrctl's separate CSR address is HRW in the official table; only M/HS can directly access that separate address.
  • - When V=1, guest reads and writes of sctrctl are substituted with vsctrctl; direct VS/VU access to the separate vsctrctl address raises a virtual-instruction exception.
  • - If the relevant Smstateen/Ssstateen bits are clear, mstateen0.CTR or hstateen0.CTR can cause an illegal-instruction or virtual-instruction exception before the access proceeds.

Risk Checks Before Writing

  • - Writing xctrctl resets the CTR cycle counter; RV32 software cannot write vsctrctl[63:32].
  • - Unimplemented optional fields read as zero; Custom[3:0] value 0 must preserve standard behavior.
  • - On virtualization-mode transitions, except for the specified enable/xTE/freeze combinations, filter fields use the values from vsctrctl.

Put It Back Into A Real Flow

1

Confirm that H, Smctr/Ssctr, and Sscsrind are implemented, and check state-enable gates.

2

In a V=1 guest, configure VS/VU recording enables, STE, freeze, and filter fields through the sctrctl alias.

3

Read CTR entries through vsiselect/vsireg* or the siselect/sireg* aliases; sctrstatus.FROZEN and depth remain shared supervisor CTR state.

FAQ

How is vsctrctl related to sctrctl?

When H is implemented, vsctrctl is the VS-mode version of sctrctl; when V=1, accesses to sctrctl are substituted with vsctrctl.

Can RV32 access the high 32 bits of vsctrctl?

No. The spec states that RV32 cannot access xctrctl[63:32], and no vsctrctlh high-half CSR is defined.