Skip to content

Commit ef52648

Browse files
committed
Add H csr vsip,hegeie,hideleg,hie,hip,hvip,vsie,vsscratch,hgeip
1 parent 5cb2bd9 commit ef52648

File tree

9 files changed

+396
-0
lines changed

9 files changed

+396
-0
lines changed

arch/csr/H/hgeie.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
3+
$schema: "csr_schema.json#"
4+
kind: csr
5+
name: hgeie
6+
long_name: Hypervisor Guest External Interrupt Enable Register
7+
description: |
8+
The hgeie register is an HSXLEN-bit read/write register that contains enable bits for the guest external interrupts at this hart. Guest external interrupt number i corresponds with bit i in hgeie.
9+
10+
Guest external interrupts represent interrupts directed to individual virtual machines at VS-level. If a RISC-V platform supports placing a physical device under the direct control of a guest OS with minimal hypervisor intervention (known as pass-through or direct assignment between a virtual machine and the physical device), then, in such circumstance, interrupts from the device are intended for a specific virtual machine.
11+
12+
[Note]
13+
Support for guest external interrupts requires an interrupt controller that can collect virtual-machine-directed interrupts separately from other interrupts.
14+
15+
The number of bits implemented in hgeie for guest external interrupts is UNSPECIFIED and may be zero. This number is known as GEILEN. The least-significant bits are implemented first, apart from bit 0. Hence, if GEILEN is nonzero, bits GEILEN:1 shall be writable in hgeie, and all other bit positions shall be read-only zeros.
16+
17+
Register hgeie selects the subset of guest external interrupts that cause a supervisor-level (HS-level) guest external interrupt. The enable bits in hgeie do not affect the VS-level external interrupt signal selected from hgeip by hstatus.VGEIN.
18+
address: 0x607
19+
priv_mode: S
20+
definedBy: H
21+
length: SXLEN
22+
fields:
23+
GEI_ENABLE:
24+
location_rv32: 31-1
25+
location_rv64: 63-1
26+
type: RW
27+
reset_value: 0
28+
description: |
29+
The number of bits implemented in hgeie for guest external interrupts is UNSPECIFIED and may be zero. This number is known as GEILEN. The least-significant bits are implemented first, apart from bit 0. Hence, if GEILEN is nonzero, bits GEILEN:1 shall be writable in hgeie, and all other bit positions shall be read-only zeros in hgeie.
30+
Register hgeie selects the subset of guest external interrupts that cause a supervisor-level (HS-level) guest external interrupt. The enable bits in hgeie do not affect the VS-level external interrupt signal selected from hgeip by hstatus.VGEIN.

arch/csr/H/hgeip.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
3+
$schema: "csr_schema.json#"
4+
kind: csr
5+
name: hgeip
6+
long_name: Hypervisor Guest External Interrupt Pending Register
7+
description: |
8+
The hgeip register is an HSXLEN-bit read-only register, formatted as that indicates pending guest external interrupts for this hart.
9+
10+
Guest external interrupts represent interrupts directed to individual virtual machines at VS-level.
11+
If a RISC-V platform supports placing a physical device under the direct control of a guest OS with minimal hypervisor intervention (known as pass-through or direct assignment between a virtual machine and the physical device), then, in such circumstance, interrupts from the device are intended for a specific virtual machine.
12+
Each bit of hgeip summarizes all pending interrupts directed to one virtual hart, as collected and reported by an interrupt controller. To distinguish specific pending interrupts from multiple devices, software must query the interrupt controller.
13+
14+
The number of bits implemented in hgeip and hgeie for guest external interrupts is UNSPECIFIED and may be zero.
15+
This number is known as GEILEN. The least-significant bits are implemented first, apart from bit 0. Hence, if GEILEN is nonzero, bits GEILEN:1 shall be writable in hgeie, and all other bit positions shall be read-only zeros in both hgeip and hgeie
16+
address: 0xE12
17+
priv_mode: S
18+
definedBy: H
19+
length: SXLEN
20+
fields:
21+
GEI_PENDING:
22+
location_rv32: 31-1
23+
location_rv64: 63-1
24+
type: RO
25+
reset_value: 0
26+
description: |
27+
Each bit of hgeip summarizes all pending interrupts directed to one virtual hart, as collected and reported by an interrupt controller.
28+
To distinguish specific pending interrupts from multiple devices, software must query the interrupt controller.
29+
30+
The number of bits implemented in hgeip and hgeie for guest external interrupts is UNSPECIFIED and may be zero. This number is known as GEILEN.
31+
The least-significant bits are implemented first, apart from bit 0.
32+
Hence, if GEILEN is nonzero, bits GEILEN:1 shall be writable in hgeie, and all other bit positions shall be read-only zeros in both hgeip and hgeie.

arch/csr/H/hideleg.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
3+
$schema: "csr_schema.json#"
4+
kind: csr
5+
name: hideleg
6+
long_name: Hypervisor Interrupt Delegation Register
7+
description: |
8+
Register hideleg is an HSXLEN-bit read/write register. By default, all traps at any privilege level are handled in M-mode, though M-mode usually uses the medeleg and mideleg CSRs to delegate some traps to HS-mode.
9+
The hedeleg and hideleg CSRs allow these traps to be further delegated to a VS-mode guest; their layout is the same as medeleg and mideleg.
10+
An interrupt that has been delegated to HS-mode (using mideleg) is further delegated to VS-mode if the corresponding hideleg bit is set.
11+
Among bits 15:0 of hideleg, bits 10, 6, and 2 (corresponding to the standard VS-level interrupts) are writable, and bits 12, 9, 5, and 1 (corresponding to the standard S-level interrupts) are read-only zeros.
12+
address: 0x603
13+
priv_mode: S
14+
definedBy: H
15+
length: SXLEN
16+
fields:
17+
SSI:
18+
location: 1
19+
type: RO
20+
reset_value: 0
21+
description: Supervisor Software Interrupt
22+
23+
VSSI:
24+
location: 2
25+
type: RW
26+
reset_value: 0
27+
description: Virtual Supervisor Software Interrupt
28+
29+
STI:
30+
location: 5
31+
type: RO
32+
reset_value: 0
33+
description: Supervisor Timer Interrupt
34+
35+
VSTI:
36+
location: 6
37+
type: RW
38+
reset_value: 0
39+
description: Virtual Supervisor Timer Interrupt
40+
41+
SEI:
42+
location: 9
43+
type: RO
44+
reset_value: 0
45+
description: Supervisor External Interrupt
46+
47+
VSEI:
48+
location: 10
49+
type: RW
50+
reset_value: 0
51+
description: Virtual Supervisor External Interrupt
52+
53+
SGEI:
54+
location: 12
55+
type: RW
56+
reset_value: 0
57+
description: Supervisor Guest External Interrupt

arch/csr/H/hie.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
3+
$schema: "csr_schema.json#"
4+
kind: csr
5+
name: hie
6+
long_name: Hypervisor Interrupt Enable Register
7+
description: |
8+
The `hie` register is a read/write register in HS-mode that enables interrupts.
9+
It corresponds to the enable bits for VS-level and hypervisor-specific interrupts, and supplements
10+
the HS-level `sie` register.
11+
address: 0x604
12+
priv_mode: S
13+
definedBy: H
14+
length: SXLEN
15+
fields:
16+
SGEIE:
17+
location: 12
18+
type: RW-H
19+
reset_value: 0
20+
description: |
21+
Hypervisor guest external interrupt enable bit. When set, allows external interrupts to be delivered
22+
to VS-mode based on the `hgeie` setting.
23+
24+
VSEIE:
25+
location: 10
26+
type: RW-H
27+
reset_value: 0
28+
description: |
29+
VS-level external interrupt enable bit. When set, allows external interrupts directed to VS-level
30+
to be processed based on the configuration in `hvip` and other platform-specific sources.
31+
32+
VSTIE:
33+
location: 6
34+
type: RW-H
35+
reset_value: 0
36+
description: |
37+
VS-level timer interrupt enable bit. When set, allows VS-level timer interrupts to be processed
38+
based on the `hvip` configuration and any platform-specific timer interrupts.
39+
40+
VSSIE:
41+
location: 2
42+
type: RW-H
43+
reset_value: 0
44+
description: |
45+
VS-level software interrupt enable bit. When set, allows software interrupts directed to VS-level
46+
to be processed, based on the configuration in `hvip`.
47+
48+
reserved:
49+
location: 15-13
50+
type: RO
51+
reset_value: 0
52+
description: |
53+
Reserved bits, must always be zero.

arch/csr/H/hip.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
3+
$schema: "csr_schema.json#"
4+
kind: csr
5+
name: hip
6+
long_name: Hypervisor Interrupt Pending Register
7+
description: |
8+
The `hip` register is an HSXLEN-bit read/write register that indicates pending interrupts at the hypervisor level.
9+
It contains interrupt-pending bits for both VS-level and hypervisor-specific interrupts.
10+
address: 0x608
11+
priv_mode: S
12+
definedBy: H
13+
length: SXLEN
14+
fields:
15+
SGEIP:
16+
location: 12
17+
type: RO
18+
reset_value: 0
19+
description: |
20+
Pending interrupt bit for supervisor guest external interrupts (SGEI).
21+
This bit is 1 if and only if the logical AND of `hgeip` and `hgeie` is nonzero.
22+
23+
VSEIP:
24+
location: 10
25+
type: RO
26+
reset_value: 0
27+
description: |
28+
Pending interrupt bit for VS-level external interrupts (VSEI).
29+
This bit is the logical OR of `vseip` from `hvip`, the interrupt from `hgeip` selected by `hstatus.VGEIN`,
30+
and any other external interrupt signal directed to VS-level.
31+
32+
VSTIP:
33+
location: 6
34+
type: RO
35+
reset_value: 0
36+
description: |
37+
Pending interrupt bit for VS-level timer interrupts (VSTI).
38+
This bit is the logical OR of `vstip` from `hvip` and any other timer interrupt directed to VS-level.
39+
40+
VSSIP:
41+
location: 2
42+
type: RO
43+
reset_value: 0
44+
description: |
45+
Pending interrupt bit for VS-level software interrupts (VSSI).
46+
This bit is an alias of the `vssip` bit in `hvip`.

arch/csr/H/hvip.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
3+
$schema: "csr_schema.json#"
4+
kind: csr
5+
name: hvip
6+
long_name: Hypervisor Virtual Interrupt Pending Register
7+
description: |
8+
The `hvip` register is an HSXLEN-bit read/write register that a hypervisor can write to indicate virtual interrupts intended for VS-mode.
9+
It contains interrupt-pending bits for virtual interrupts such as VS-level external interrupts, timer interrupts, and software interrupts.
10+
address: 0x645
11+
priv_mode: S
12+
definedBy: H
13+
length: SXLEN
14+
fields:
15+
VSEIP:
16+
location: 10
17+
type: RW
18+
reset_value: 0
19+
description: |
20+
Pending interrupt bit for VS-level external interrupts. This bit is writable and
21+
is set to 1 to assert a VS-level external interrupt.
22+
23+
VSTIP:
24+
location: 6
25+
type: RW
26+
reset_value: 0
27+
description: |
28+
Pending interrupt bit for VS-level timer interrupts. This bit is writable and
29+
is set to 1 to assert a VS-level timer interrupt.
30+
31+
VSSIP:
32+
location: 2
33+
type: RW
34+
reset_value: 0
35+
description: |
36+
Pending interrupt bit for VS-level software interrupts. This bit is writable and
37+
is set to 1 to assert a VS-level software interrupt.
38+
39+
reserved_6_15:
40+
location: 6
41+
type: RO
42+
reset_value: 0
43+
description: |
44+
Reserved bits. These bits must always be zero and are not writable.

arch/csr/H/vsie.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
3+
$schema: "csr_schema.json#"
4+
kind: csr
5+
name: vsie
6+
address: 0x204
7+
virtual_address: 0x144
8+
long_name: Virtual Supervisor Interrupt Enable
9+
description: |
10+
The vsie register is a VSXLEN-bit read/write register that is VS-mode’s version of
11+
supervisor CSR sie. When V=1, vsie substitutes for the usual sie, so instructions that
12+
normally read or modify sie actually access vsie instead. However, interrupts directed to
13+
HS-level continue to be indicated in the HS-level sip register, not in vsip, when V=1.
14+
15+
When bit 13 of hideleg is zero, vsie.LCOFIE is read-only zero. Else, vsie.LCOFIE is an alias of sie.LCOFIE.
16+
When bit 10 of hideleg is zero, vsie.SEIE is read-only zero. Else, vsie.SEIE is an alias of hie.VSEIE.
17+
When bit 6 of hideleg is zero, vsie.STIE is read-only zero. Else, vsie.STIE is an alias of hie.VSTIE.
18+
When bit 2 of hideleg is zero, vsie.SSIE is read-only zero. Else, vsie.SSIE is an alias of hie.VSSIE.
19+
priv_mode: VS
20+
definedBy: H
21+
length: VSXLEN
22+
fields:
23+
SSIE:
24+
location: 1
25+
type: RW-H
26+
reset_value: UNDEFINED_LEGAL
27+
alias: hie.VSSIE[0]
28+
description: |
29+
SSIE. Read-only zero when hideleg[2] is 0. Else, alias of hie.VSSIE.
30+
31+
STIE:
32+
location: 5
33+
type: RW-H
34+
reset_value: UNDEFINED_LEGAL
35+
alias: hie.VSTIE[0]
36+
description: |
37+
STIE. Read-only zero when hideleg[6] is 0. Else, alias of hie.VSTIE.
38+
39+
SEIE:
40+
location: 9
41+
type: RW-H
42+
reset_value: UNDEFINED_LEGAL
43+
alias: hie.VSEIE[0]
44+
description: |
45+
SEIE. Read-only zero when hideleg[10] is 0. Else, alias of hie.VSEIE.
46+
47+
LCOFIE:
48+
location: 13
49+
type: RW-H
50+
reset_value: UNDEFINED_LEGAL
51+
alias: sie.LCOFIE[0]
52+
description: |
53+
LCOFIE. Read-only zero when hideleg[13] is 0. Else, alias of sie.LCOFIE.

arch/csr/H/vsip.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# yaml-language-server: $schema=../../../schemas/csr_schema.json
2+
3+
$schema: "csr_schema.json#"
4+
kind: csr
5+
name: vsip
6+
address: 0x244
7+
virtual_address: 0x144
8+
long_name: Virtual Supervisor Interrupt Pending
9+
description: |
10+
The `vsip` register is a VSXLEN-bit read/write register that is VS-mode’s version of the `sip` CSR.
11+
When V=1, instructions that normally access `sip` instead access `vsip`. It holds the pending
12+
interrupt status for supervisor-level traps in a virtualized environment.
13+
14+
However, interrupts directed to HS-level continue to be indicated in the HS-level `sip` register,
15+
not in `vsip`, when V=1.
16+
17+
The standard portion (bits 15:0) includes individual interrupt-pending bits.
18+
priv_mode: VS
19+
definedBy: H
20+
length: VSXLEN
21+
fields:
22+
SSIP:
23+
location: 1
24+
type: RW-H
25+
reset_value: UNDEFINED_LEGAL
26+
alias: hip.VSSIP[0]
27+
description: |
28+
*Supervisor Software Interrupt Pending*
29+
30+
Indicates a pending software interrupt at the supervisor level.
31+
Read-only zero when `hideleg[2] == 0`, else aliased to `hip.VSSIP[0]`.
32+
33+
STIP:
34+
location: 5
35+
type: RW-H
36+
reset_value: UNDEFINED_LEGAL
37+
alias: hip.VSTIP[0]
38+
description: |
39+
*Supervisor Timer Interrupt Pending*
40+
41+
Indicates a pending timer interrupt at the supervisor level.
42+
Read-only zero when `hideleg[6] == 0`, else aliased to `hip.VSTIP[0]`.
43+
44+
SEIP:
45+
location: 9
46+
type: RW-H
47+
reset_value: UNDEFINED_LEGAL
48+
alias: hip.VSEIP[0]
49+
description: |
50+
*Supervisor External Interrupt Pending*
51+
52+
Indicates a pending external interrupt at the supervisor level.
53+
Read-only zero when `hideleg[10] == 0`, else aliased to `hip.VSEIP[0]`.
54+
55+
LCOFIP:
56+
location: 13
57+
type: RW-H
58+
reset_value: UNDEFINED_LEGAL
59+
alias: sip.LCOFIP[0]
60+
description: |
61+
*Local Counter Overflow Interrupt Pending*
62+
63+
Indicates an overflow of a local counter.
64+
Read-only zero when `hideleg[13] == 0`, else aliased to `sip.LCOFIP[0]`.

0 commit comments

Comments
 (0)