Webcentive RISC-V Reference

hcounteren

Hypervisor counter enable

Address
0x606
Group
Hypervisor and VS CSRs
Privilege
HRW (privileged spec CSR listing, Hypervisor Trap Setup)
Access
read/write; lowest privilege H (hypervisor, including VS CSRs)
Address range
Standard read/write
Name in riscv-unified-db
Hypervisor Counter Enable

Privileged spec: Hypervisor counter enable

Description

Together with scounteren, delegates control of the hardware performance-monitoring counters to VS/VU-mode

See cycle for a table describing how exceptions occur.

From riscv-unified-db, reformatted.

Fields

FieldBitsTypeDescription
CY0

When all of scounteren.CY, mcounteren.CY, and hcounteren.CY are set, the cycle CSR (an alias of mcycle) is accessible to VU-mode.

When mcounteren.CY and hcounteren.CY are set, the cycle CSR (an alias of mcycle) is accessible to VS-mode.

When hcounteren.CY is clear and mcounteren.CY is set, then any access to cycle in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.CYmcounteren.CYscounteren.CYcycle access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
TM1

When all of scounteren.TM, mcounteren.TM, and hcounteren.TM are set, the time CSR (an alias of mtime memory-mapped CSR) is accessible to VU-mode.

When mcounteren.TM and hcounteren.TM are set, the time CSR (an alias of mtime) is accessible to VS-mode.

When hcounteren.TM is clear and mcounteren.TM is set, then any access to time in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.TMmcounteren.TMscounteren.TMtime access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
IR2

When all of scounteren.IR, mcounteren.IR, and hcounteren.IR are set, the instret CSR (an alias of minstret) is accessible to VU-mode.

When mcounteren.IR and hcounteren.IR are set, the instret CSR (an alias of minstret) is accessible to VS-mode.

When hcounteren.IR is clear and mcounteren.IR is set, then any access to instret in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.IRmcounteren.IRscounteren.IRinstret access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM33

When all of scounteren.HPM3, mcounteren.HPM3, and hcounteren.HPM3 are set, the hpmcounter3 CSR (an alias of mhpmcounter3) is accessible to VU-mode.

When mcounteren.HPM3 and hcounteren.HPM3 are set, the hpmcounter3 CSR (an alias of mhpmcounter3) is accessible to VS-mode.

When hcounteren.HPM3 is clear and mcounteren.HPM3 is set, then any access to hpmcounter3 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM3mcounteren.HPM3scounteren.HPM3hpmcounter3 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM44

When all of scounteren.HPM4, mcounteren.HPM4, and hcounteren.HPM4 are set, the hpmcounter4 CSR (an alias of mhpmcounter4) is accessible to VU-mode.

When mcounteren.HPM4 and hcounteren.HPM4 are set, the hpmcounter4 CSR (an alias of mhpmcounter4) is accessible to VS-mode.

When hcounteren.HPM4 is clear and mcounteren.HPM4 is set, then any access to hpmcounter4 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM4mcounteren.HPM4scounteren.HPM4hpmcounter4 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM55

When all of scounteren.HPM5, mcounteren.HPM5, and hcounteren.HPM5 are set, the hpmcounter5 CSR (an alias of mhpmcounter5) is accessible to VU-mode.

When mcounteren.HPM5 and hcounteren.HPM5 are set, the hpmcounter5 CSR (an alias of mhpmcounter5) is accessible to VS-mode.

When hcounteren.HPM5 is clear and mcounteren.HPM5 is set, then any access to hpmcounter5 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM5mcounteren.HPM5scounteren.HPM5hpmcounter5 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM66

When all of scounteren.HPM6, mcounteren.HPM6, and hcounteren.HPM6 are set, the hpmcounter6 CSR (an alias of mhpmcounter6) is accessible to VU-mode.

When mcounteren.HPM6 and hcounteren.HPM6 are set, the hpmcounter6 CSR (an alias of mhpmcounter6) is accessible to VS-mode.

When hcounteren.HPM6 is clear and mcounteren.HPM6 is set, then any access to hpmcounter6 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM6mcounteren.HPM6scounteren.HPM6hpmcounter6 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM77

When all of scounteren.HPM7, mcounteren.HPM7, and hcounteren.HPM7 are set, the hpmcounter7 CSR (an alias of mhpmcounter7) is accessible to VU-mode.

When mcounteren.HPM7 and hcounteren.HPM7 are set, the hpmcounter7 CSR (an alias of mhpmcounter7) is accessible to VS-mode.

When hcounteren.HPM7 is clear and mcounteren.HPM7 is set, then any access to hpmcounter7 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM7mcounteren.HPM7scounteren.HPM7hpmcounter7 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM88

When all of scounteren.HPM8, mcounteren.HPM8, and hcounteren.HPM8 are set, the hpmcounter8 CSR (an alias of mhpmcounter8) is accessible to VU-mode.

When mcounteren.HPM8 and hcounteren.HPM8 are set, the hpmcounter8 CSR (an alias of mhpmcounter8) is accessible to VS-mode.

When hcounteren.HPM8 is clear and mcounteren.HPM8 is set, then any access to hpmcounter8 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM8mcounteren.HPM8scounteren.HPM8hpmcounter8 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM99

When all of scounteren.HPM9, mcounteren.HPM9, and hcounteren.HPM9 are set, the hpmcounter9 CSR (an alias of mhpmcounter9) is accessible to VU-mode.

When mcounteren.HPM9 and hcounteren.HPM9 are set, the hpmcounter9 CSR (an alias of mhpmcounter9) is accessible to VS-mode.

When hcounteren.HPM9 is clear and mcounteren.HPM9 is set, then any access to hpmcounter9 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM9mcounteren.HPM9scounteren.HPM9hpmcounter9 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM1010

When all of scounteren.HPM10, mcounteren.HPM10, and hcounteren.HPM10 are set, the hpmcounter10 CSR (an alias of mhpmcounter10) is accessible to VU-mode.

When mcounteren.HPM10 and hcounteren.HPM10 are set, the hpmcounter10 CSR (an alias of mhpmcounter10) is accessible to VS-mode.

When hcounteren.HPM10 is clear and mcounteren.HPM10 is set, then any access to hpmcounter10 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM10mcounteren.HPM10scounteren.HPM10hpmcounter10 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM1111

When all of scounteren.HPM11, mcounteren.HPM11, and hcounteren.HPM11 are set, the hpmcounter11 CSR (an alias of mhpmcounter11) is accessible to VU-mode.

When mcounteren.HPM11 and hcounteren.HPM11 are set, the hpmcounter11 CSR (an alias of mhpmcounter11) is accessible to VS-mode.

When hcounteren.HPM11 is clear and mcounteren.HPM11 is set, then any access to hpmcounter11 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM11mcounteren.HPM11scounteren.HPM11hpmcounter11 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM1212

When all of scounteren.HPM12, mcounteren.HPM12, and hcounteren.HPM12 are set, the hpmcounter12 CSR (an alias of mhpmcounter12) is accessible to VU-mode.

When mcounteren.HPM12 and hcounteren.HPM12 are set, the hpmcounter12 CSR (an alias of mhpmcounter12) is accessible to VS-mode.

When hcounteren.HPM12 is clear and mcounteren.HPM12 is set, then any access to hpmcounter12 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM12mcounteren.HPM12scounteren.HPM12hpmcounter12 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM1313

When all of scounteren.HPM13, mcounteren.HPM13, and hcounteren.HPM13 are set, the hpmcounter13 CSR (an alias of mhpmcounter13) is accessible to VU-mode.

When mcounteren.HPM13 and hcounteren.HPM13 are set, the hpmcounter13 CSR (an alias of mhpmcounter13) is accessible to VS-mode.

When hcounteren.HPM13 is clear and mcounteren.HPM13 is set, then any access to hpmcounter13 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM13mcounteren.HPM13scounteren.HPM13hpmcounter13 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM1414

When all of scounteren.HPM14, mcounteren.HPM14, and hcounteren.HPM14 are set, the hpmcounter14 CSR (an alias of mhpmcounter14) is accessible to VU-mode.

When mcounteren.HPM14 and hcounteren.HPM14 are set, the hpmcounter14 CSR (an alias of mhpmcounter14) is accessible to VS-mode.

When hcounteren.HPM14 is clear and mcounteren.HPM14 is set, then any access to hpmcounter14 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM14mcounteren.HPM14scounteren.HPM14hpmcounter14 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM1515

When all of scounteren.HPM15, mcounteren.HPM15, and hcounteren.HPM15 are set, the hpmcounter15 CSR (an alias of mhpmcounter15) is accessible to VU-mode.

When mcounteren.HPM15 and hcounteren.HPM15 are set, the hpmcounter15 CSR (an alias of mhpmcounter15) is accessible to VS-mode.

When hcounteren.HPM15 is clear and mcounteren.HPM15 is set, then any access to hpmcounter15 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM15mcounteren.HPM15scounteren.HPM15hpmcounter15 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM1616

When all of scounteren.HPM16, mcounteren.HPM16, and hcounteren.HPM16 are set, the hpmcounter16 CSR (an alias of mhpmcounter16) is accessible to VU-mode.

When mcounteren.HPM16 and hcounteren.HPM16 are set, the hpmcounter16 CSR (an alias of mhpmcounter16) is accessible to VS-mode.

When hcounteren.HPM16 is clear and mcounteren.HPM16 is set, then any access to hpmcounter16 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM16mcounteren.HPM16scounteren.HPM16hpmcounter16 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM1717

When all of scounteren.HPM17, mcounteren.HPM17, and hcounteren.HPM17 are set, the hpmcounter17 CSR (an alias of mhpmcounter17) is accessible to VU-mode.

When mcounteren.HPM17 and hcounteren.HPM17 are set, the hpmcounter17 CSR (an alias of mhpmcounter17) is accessible to VS-mode.

When hcounteren.HPM17 is clear and mcounteren.HPM17 is set, then any access to hpmcounter17 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM17mcounteren.HPM17scounteren.HPM17hpmcounter17 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM1818

When all of scounteren.HPM18, mcounteren.HPM18, and hcounteren.HPM18 are set, the hpmcounter18 CSR (an alias of mhpmcounter18) is accessible to VU-mode.

When mcounteren.HPM18 and hcounteren.HPM18 are set, the hpmcounter18 CSR (an alias of mhpmcounter18) is accessible to VS-mode.

When hcounteren.HPM18 is clear and mcounteren.HPM18 is set, then any access to hpmcounter18 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM18mcounteren.HPM18scounteren.HPM18hpmcounter18 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM1919

When all of scounteren.HPM19, mcounteren.HPM19, and hcounteren.HPM19 are set, the hpmcounter19 CSR (an alias of mhpmcounter19) is accessible to VU-mode.

When mcounteren.HPM19 and hcounteren.HPM19 are set, the hpmcounter19 CSR (an alias of mhpmcounter19) is accessible to VS-mode.

When hcounteren.HPM19 is clear and mcounteren.HPM19 is set, then any access to hpmcounter19 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM19mcounteren.HPM19scounteren.HPM19hpmcounter19 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM2020

When all of scounteren.HPM20, mcounteren.HPM20, and hcounteren.HPM20 are set, the hpmcounter20 CSR (an alias of mhpmcounter20) is accessible to VU-mode.

When mcounteren.HPM20 and hcounteren.HPM20 are set, the hpmcounter20 CSR (an alias of mhpmcounter20) is accessible to VS-mode.

When hcounteren.HPM20 is clear and mcounteren.HPM20 is set, then any access to hpmcounter20 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM20mcounteren.HPM20scounteren.HPM20hpmcounter20 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM2121

When all of scounteren.HPM21, mcounteren.HPM21, and hcounteren.HPM21 are set, the hpmcounter21 CSR (an alias of mhpmcounter21) is accessible to VU-mode.

When mcounteren.HPM21 and hcounteren.HPM21 are set, the hpmcounter21 CSR (an alias of mhpmcounter21) is accessible to VS-mode.

When hcounteren.HPM21 is clear and mcounteren.HPM21 is set, then any access to hpmcounter21 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM21mcounteren.HPM21scounteren.HPM21hpmcounter21 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM2222

When all of scounteren.HPM22, mcounteren.HPM22, and hcounteren.HPM22 are set, the hpmcounter22 CSR (an alias of mhpmcounter22) is accessible to VU-mode.

When mcounteren.HPM22 and hcounteren.HPM22 are set, the hpmcounter22 CSR (an alias of mhpmcounter22) is accessible to VS-mode.

When hcounteren.HPM22 is clear and mcounteren.HPM22 is set, then any access to hpmcounter22 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM22mcounteren.HPM22scounteren.HPM22hpmcounter22 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM2323

When all of scounteren.HPM23, mcounteren.HPM23, and hcounteren.HPM23 are set, the hpmcounter23 CSR (an alias of mhpmcounter23) is accessible to VU-mode.

When mcounteren.HPM23 and hcounteren.HPM23 are set, the hpmcounter23 CSR (an alias of mhpmcounter23) is accessible to VS-mode.

When hcounteren.HPM23 is clear and mcounteren.HPM23 is set, then any access to hpmcounter23 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM23mcounteren.HPM23scounteren.HPM23hpmcounter23 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM2424

When all of scounteren.HPM24, mcounteren.HPM24, and hcounteren.HPM24 are set, the hpmcounter24 CSR (an alias of mhpmcounter24) is accessible to VU-mode.

When mcounteren.HPM24 and hcounteren.HPM24 are set, the hpmcounter24 CSR (an alias of mhpmcounter24) is accessible to VS-mode.

When hcounteren.HPM24 is clear and mcounteren.HPM24 is set, then any access to hpmcounter24 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM24mcounteren.HPM24scounteren.HPM24hpmcounter24 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM2525

When all of scounteren.HPM25, mcounteren.HPM25, and hcounteren.HPM25 are set, the hpmcounter25 CSR (an alias of mhpmcounter25) is accessible to VU-mode.

When mcounteren.HPM25 and hcounteren.HPM25 are set, the hpmcounter25 CSR (an alias of mhpmcounter25) is accessible to VS-mode.

When hcounteren.HPM25 is clear and mcounteren.HPM25 is set, then any access to hpmcounter25 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM25mcounteren.HPM25scounteren.HPM25hpmcounter25 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM2626

When all of scounteren.HPM26, mcounteren.HPM26, and hcounteren.HPM26 are set, the hpmcounter26 CSR (an alias of mhpmcounter26) is accessible to VU-mode.

When mcounteren.HPM26 and hcounteren.HPM26 are set, the hpmcounter26 CSR (an alias of mhpmcounter26) is accessible to VS-mode.

When hcounteren.HPM26 is clear and mcounteren.HPM26 is set, then any access to hpmcounter26 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM26mcounteren.HPM26scounteren.HPM26hpmcounter26 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM2727

When all of scounteren.HPM27, mcounteren.HPM27, and hcounteren.HPM27 are set, the hpmcounter27 CSR (an alias of mhpmcounter27) is accessible to VU-mode.

When mcounteren.HPM27 and hcounteren.HPM27 are set, the hpmcounter27 CSR (an alias of mhpmcounter27) is accessible to VS-mode.

When hcounteren.HPM27 is clear and mcounteren.HPM27 is set, then any access to hpmcounter27 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM27mcounteren.HPM27scounteren.HPM27hpmcounter27 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM2828

When all of scounteren.HPM28, mcounteren.HPM28, and hcounteren.HPM28 are set, the hpmcounter28 CSR (an alias of mhpmcounter28) is accessible to VU-mode.

When mcounteren.HPM28 and hcounteren.HPM28 are set, the hpmcounter28 CSR (an alias of mhpmcounter28) is accessible to VS-mode.

When hcounteren.HPM28 is clear and mcounteren.HPM28 is set, then any access to hpmcounter28 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM28mcounteren.HPM28scounteren.HPM28hpmcounter28 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM2929

When all of scounteren.HPM29, mcounteren.HPM29, and hcounteren.HPM29 are set, the hpmcounter29 CSR (an alias of mhpmcounter29) is accessible to VU-mode.

When mcounteren.HPM29 and hcounteren.HPM29 are set, the hpmcounter29 CSR (an alias of mhpmcounter29) is accessible to VS-mode.

When hcounteren.HPM29 is clear and mcounteren.HPM29 is set, then any access to hpmcounter29 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM29mcounteren.HPM29scounteren.HPM29hpmcounter29 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM3030

When all of scounteren.HPM30, mcounteren.HPM30, and hcounteren.HPM30 are set, the hpmcounter30 CSR (an alias of mhpmcounter30) is accessible to VU-mode.

When mcounteren.HPM30 and hcounteren.HPM30 are set, the hpmcounter30 CSR (an alias of mhpmcounter30) is accessible to VS-mode.

When hcounteren.HPM30 is clear and mcounteren.HPM30 is set, then any access to hpmcounter30 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM30mcounteren.HPM30scounteren.HPM30hpmcounter30 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed
HPM3131

When all of scounteren.HPM31, mcounteren.HPM31, and hcounteren.HPM31 are set, the hpmcounter31 CSR (an alias of mhpmcounter31) is accessible to VU-mode.

When mcounteren.HPM31 and hcounteren.HPM31 are set, the hpmcounter31 CSR (an alias of mhpmcounter31) is accessible to VS-mode.

When hcounteren.HPM31 is clear and mcounteren.HPM31 is set, then any access to hpmcounter31 in VU-mode or VS-mode causes a VirtualInstruction exception.

Summary:

hcounteren.HPM31mcounteren.HPM31scounteren.HPM31hpmcounter31 access behavior
VS-modeVU-mode
00-IllegalInstructionIllegalInstruction
01-VirtualInstructionVirtualInstruction
10-IllegalInstructionIllegalInstruction
110allowedVirtualInstruction
111allowedallowed

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

Specification and related pages