Skip to content

Commit 83d0928

Browse files
committed
feat(csr): add H-mode CSRs vsip, hegeie, hideleg, hie, hip, hvip, vsie, vsscratch, hgeip
1 parent 810ef93 commit 83d0928

File tree

9 files changed

+416
-0
lines changed

9 files changed

+416
-0
lines changed

spec/std/isa/csr/H/hgeie.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
4+
# yaml-language-server: $schema=../../../../schemas/csr_schema.json
5+
6+
$schema: "csr_schema.json#"
7+
kind: csr
8+
name: hgeie
9+
long_name: Hypervisor Guest External Interrupt Enable Register
10+
description: |
11+
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.
12+
13+
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.
14+
15+
[Note]
16+
Support for guest external interrupts requires an interrupt controller that can collect virtual-machine-directed interrupts separately from other interrupts.
17+
18+
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.
19+
20+
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.
21+
address: 0x607
22+
priv_mode: S
23+
definedBy: H
24+
length: SXLEN
25+
fields:
26+
GEI_ENABLE:
27+
location_rv32: 31-1
28+
location_rv64: 63-1
29+
type: RW
30+
reset_value: 0
31+
description: |
32+
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.
33+
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.

spec/std/isa/csr/H/hgeip.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
4+
# yaml-language-server: $schema=../../../../schemas/csr_schema.json
5+
6+
$schema: "csr_schema.json#"
7+
kind: csr
8+
name: hgeip
9+
long_name: Hypervisor Guest External Interrupt Pending Register
10+
description: |
11+
The hgeip register is an HSXLEN-bit read-only register, formatted as that indicates pending guest external interrupts for this hart.
12+
13+
Guest external interrupts represent interrupts directed to individual virtual machines at VS-level.
14+
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.
15+
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.
16+
17+
The number of bits implemented in hgeip and hgeie for guest external interrupts is UNSPECIFIED and may be zero.
18+
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
19+
address: 0xE12
20+
priv_mode: S
21+
definedBy: H
22+
length: SXLEN
23+
fields:
24+
GEI_PENDING:
25+
location_rv32: 31-1
26+
location_rv64: 63-1
27+
type: RO
28+
reset_value: 0
29+
description: |
30+
Each bit of hgeip summarizes all pending interrupts directed to one virtual hart, as collected and reported by an interrupt controller.
31+
To distinguish specific pending interrupts from multiple devices, software must query the interrupt controller.
32+
33+
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.
34+
The least-significant bits are implemented first, apart from bit 0.
35+
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.

spec/std/isa/csr/H/hideleg.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
4+
# yaml-language-server: $schema=../../../../schemas/csr_schema.json
5+
6+
$schema: "csr_schema.json#"
7+
kind: csr
8+
name: hideleg
9+
long_name: Hypervisor Interrupt Delegation Register
10+
description: |
11+
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.
12+
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.
13+
An interrupt that has been delegated to HS-mode (using mideleg) is further delegated to VS-mode if the corresponding hideleg bit is set.
14+
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.
15+
address: 0x603
16+
priv_mode: S
17+
definedBy: H
18+
length: SXLEN
19+
fields:
20+
SSI:
21+
location: 1
22+
type: RO
23+
reset_value: 0
24+
long_name: Supervisor Software Interrupt
25+
description: Supervisor Software Interrupt
26+
27+
VSSI:
28+
location: 2
29+
type: RW
30+
reset_value: 0
31+
long_name: Virtual Supervisor Software Interrupt
32+
description: Virtual Supervisor Software Interrupt
33+
34+
STI:
35+
location: 5
36+
type: RO
37+
reset_value: 0
38+
long_name: Supervisor Timer Interrupt
39+
description: Supervisor Timer Interrupt
40+
41+
VSTI:
42+
location: 6
43+
type: RW
44+
reset_value: 0
45+
long_name: Virtual Supervisor Timer Interrupt
46+
description: Virtual Supervisor Timer Interrupt
47+
48+
SEI:
49+
location: 9
50+
type: RO
51+
reset_value: 0
52+
long_name: Supervisor External Interrupt
53+
description: Supervisor External Interrupt
54+
55+
VSEI:
56+
location: 10
57+
type: RW
58+
reset_value: 0
59+
long_name: Virtual Supervisor External Interrupt
60+
description: Virtual Supervisor External Interrupt
61+
62+
SGEI:
63+
location: 12
64+
type: RW
65+
reset_value: 0
66+
long_name: Supervisor Guest External Interrupt
67+
description: Supervisor Guest External Interrupt

spec/std/isa/csr/H/hie.yaml

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

spec/std/isa/csr/H/hip.yaml

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

spec/std/isa/csr/H/hvip.yaml

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

spec/std/isa/csr/H/vsie.yaml

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

0 commit comments

Comments
 (0)