CSR Bit Fields

RISC-V vstopei CSR Register

Address 0x25CPrivilege Hypervisor direct / VS aliasAccess HRW / VSXLENHypervisor and virtualization CSRs

vstopei is a VS top external interrupt claim CSR.

Field Map

Understand vstopei By Bit Fields

1 key fields
VSXLEN-1:0

VSTOPEI

Read / claim

Read format is bits 26:16 interrupt identity and bits 10:0 interrupt priority (same as identity), with all other bits zero; a zero read means no external interrupt satisfies pending, enabled, and threshold conditions.

VSTOPEI (bits VSXLEN-1:0) — Read format is bits 26:16 interrupt identity and bits 10:0 interrupt priority (same as identity), with all other bits zero; a zero read means no external interrupt satisfies pending, enabled, and threshold conditions.

What This Field Controls

  • - Read format is bits 26:16 interrupt identity and bits 10:0 interrupt priority (same as identity), with all other bits zero; a zero read means no external interrupt satisfies pending, enabled, and threshold conditions.

Common Values

0No claimable interrupt

No external interrupt in the guest interrupt file is both pending and enabled, or eithreshold is nonzero and no interrupt identity is below the threshold.

bits 26:16 / 10:0interrupt identity / priority

Bits 26:16 report the external interrupt minor identity; bits 10:0 report the same value as priority. Writing vstopei ignores the written value and claims the pending bit selected by the current readable value.

Open Official Manual
Official Basis & Search Notes

vstopei is the AIA VS top external interrupt CSR. It interacts with a guest interrupt file only when an IMSIC guest interrupt file exists and hstatus.VGEIN selects a valid guest file; reads report the highest-priority pending-and-enabled external interrupt and writes claim the current readable value.

vstopei address, access class, and width are checked against the official CSR tables: 0x25C, HRW, VSXLEN.
AIA defines vstopei as present only with an IMSIC; if hstatus.VGEIN is not a valid guest interrupt file, M/HS access to vstopei or VS access through stopei raises the specified exception.
The read format is bits 26:16 interrupt identity and bits 10:0 priority (same as identity), with all other bits zero; the value is not affected by eidelivery, mie, sie, hie, hgeie, or vsie.
On writes, the written value is ignored and the current readable value selects which pending bit is cleared; a zero readable value makes the write have no effect.
mstateen0.IMSIC and hstateen0.IMSIC can restrict lower-privilege or VM access to IMSIC guest interrupt file state.

What To Check First When Reading This CSR

  • - AIA lists vstopei's separate CSR address as HRW, VSXLEN wide, and present only with an IMSIC as a top external interrupt CSR.
  • - vstopei interacts with the guest interrupt file only when H is implemented and hstatus.VGEIN is the number of an implemented guest interrupt file; otherwise M/HS access to the separate CSR raises an illegal-instruction exception and VS access through stopei raises a virtual-instruction exception.
  • - The value read from vstopei is not affected by eidelivery, mie, sie, hie, hgeie, or vsie; it is computed from the guest interrupt file eip/eie arrays and eithreshold.

Risk Checks Before Writing

  • - Writing vstopei claims the interrupt identity selected by the current readable value, while the written data itself is ignored; if the readable value is zero, the write has no effect.

Put It Back Into A Real Flow

1

Confirm that AIA, IMSIC, and H are implemented, and that hstatus.VGEIN selects an implemented guest interrupt file.

2

A zero read means no external interrupt is both pending and enabled, or eithreshold is nonzero and none of those interrupts has an identity below it; a nonzero value reports identity in bits 26:16 and the same priority in bits 10:0.

3

Use one CSR read/write instruction to read and claim together, avoiding a separate read/write race with a newly arriving higher-priority interrupt.

FAQ

What AIA state does vstopei represent?

vstopei is the top external interrupt CSR for an IMSIC guest interrupt file, used to report and claim the minor identity of a VS-level external interrupt.

Can state-enable CSRs control access to vstopei?

Yes. vstopei is IMSIC state; when Smstateen/Ssstateen and AIA are implemented, mstateen0.IMSIC and hstateen0.IMSIC can restrict lower-privilege or VM access to that state.