Memory-mapped register interface
The IOMMU provides a memory-mapped programming interface. The memory-mapped registers of each IOMMU are located within a naturally aligned 4-KiB region (a page) of physical address space.
The IOMMU behavior for register accesses where the address is not aligned to
the size of the access, or if the access spans multiple registers, or if the
size of the access is not 4 bytes or 8 bytes, is UNSPECIFIED. A 4 byte access
to an IOMMU register must be single-copy atomic. Whether an 8 byte access to an
IOMMU register is single-copy atomic is UNSPECIFIED, and such an access may
appear, internally to the IOMMU, as if two separate 4 byte accesses — first to
the high half and second to the low half — were performed.
|
The 8-byte IOMMU registers are defined in such a way that software can perform two individual 4-byte accesses, or hardware can perform two independent 4-byte transactions resulting from an 8-byte access, to the high and low halves of the register, in that order, as long as the register semantics, with regard to side-effects, are respected between the two software accesses, or two hardware transactions, respectively. |
The IOMMU registers have little-endian byte order, even for systems where all harts are big-endian-only.
|
Big-endian-configured harts that make use of an IOMMU are expected to implement
the |
If a register is optional, as determined by the corresponding capabilities
register bit being 0, then a read from the memory-mapped register offset of
the register returns 0 and writes to that offset are ignored.
Registers and register fields designated for future standard use must be read-only zero. For forward compatibility, registers and register fields designated for custom use should be implemented as read-only zero if the implementation does not define a custom use for them.
Register layout
| Offset | Name | Size | Description | Is Optional? |
|---|---|---|---|---|
0 |
|
8 |
No |
|
8 |
|
4 |
No |
|
12 |
custom |
4 |
Designated For custom use |
|
16 |
|
8 |
No |
|
24 |
|
8 |
No |
|
32 |
|
4 |
No |
|
36 |
|
4 |
No |
|
40 |
|
8 |
No |
|
48 |
|
4 |
No |
|
52 |
|
4 |
No |
|
56 |
|
8 |
if |
|
64 |
|
4 |
if |
|
68 |
|
4 |
if |
|
72 |
|
4 |
No |
|
76 |
|
4 |
No |
|
80 |
|
4 |
if |
|
84 |
|
4 |
No |
|
88 |
|
4 |
if |
|
92 |
|
4 |
if |
|
96 |
|
8 |
if |
|
104 |
|
248 |
if |
|
352 |
|
248 |
if |
|
600 |
|
8 |
if |
|
608 |
|
8 |
if |
|
616 |
|
8 |
if |
|
624 |
|
4 |
if |
|
628 |
Reserved |
60 |
Reserved for future use
( |
|
688 |
custom |
72 |
Designated for custom use
( |
|
760 |
|
8 |
No |
|
768 |
|
256 |
if |
|
1024 |
Reserved |
3072 |
Reserved for standard use |
Reset behavior
The reset value is 0 for the following registers fields.
-
cqcsr-cqen,cqie,cqon, andbusy -
fqcsr-fqen,fqie,fqon, andbusy -
pqcsr-pqen,pqie,pqon, andbusy -
tr_req_ctl.Go/Busy -
ddtp.busy
The reset value is 0 for the following registers.
-
ipsr
Reset value for ddtp.iommu_mode field must be either Off or Bare.
After a reset the caches (iommu_data_structures.adoc#CACHING) must have no valid entries.
|
The reset value for the |
The reset value is UNSPECIFIED for all other registers and/or fields.
IOMMU capabilities (capabilities)
The capabilities register is a read-only register reporting features supported
by the IOMMU. Each field if not clear indicates the presence of that feature in
the IOMMU. At reset, the register shall contain the IOMMU supported features.
| Bits | Field | Attribute | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7:0 |
|
RO |
The |
|||||||||||||||
8 |
|
RO |
Page-based 32-bit virtual addressing is supported. |
|||||||||||||||
9 |
|
RO |
Page-based 39-bit virtual addressing is supported. |
|||||||||||||||
10 |
|
RO |
Page-based 48-bit virtual addressing is supported. |
|||||||||||||||
11 |
|
RO |
Page-based 57-bit virtual addressing is supported |
|||||||||||||||
13:12 |
reserved |
RO |
Reserved for standard use. |
|||||||||||||||
14 |
|
RO |
PTE Reserved-for-Software Bits 60-59. |
|||||||||||||||
15 |
|
RO |
Page-based memory types. |
|||||||||||||||
16 |
|
RO |
Page-based 34-bit virtual addressing for second-stage address translation is supported. |
|||||||||||||||
17 |
|
RO |
Page-based 41-bit virtual addressing for second-stage address translation is supported. |
|||||||||||||||
18 |
|
RO |
Page-based 50-bit virtual addressing for second-stage address translation is supported. |
|||||||||||||||
19 |
|
RO |
Page-based 59-bit virtual addressing for second-stage address translation is supported. |
|||||||||||||||
20 |
reserved |
RO |
Reserved for standard use. |
|||||||||||||||
21 |
|
RO |
Atomic updates to MRIF is supported. |
|||||||||||||||
22 |
|
RO |
MSI address translation using Pass-through mode MSI PTE is supported. |
|||||||||||||||
23 |
|
RO |
MSI address translation using MRIF mode MSI PTE is supported. |
|||||||||||||||
24 |
|
RO |
Atomic updates to PTE accessed (A) and dirty (D) bit is supported. |
|||||||||||||||
25 |
|
RO |
PCIe Address Translation Services (ATS) and page-request interface (PRI) [5] is supported. |
|||||||||||||||
26 |
|
RO |
Returning guest-physical-address in ATS translation completions is supported. |
|||||||||||||||
27 |
|
RO |
When 0, IOMMU supports one endianness (either little
or big). When 1, IOMMU supports both endianness.
The endianness is defined in the |
|||||||||||||||
29:28 |
|
RO |
IOMMU interrupt generation support.
|
|||||||||||||||
30 |
|
RO |
IOMMU implements a hardware performance monitor. |
|||||||||||||||
31 |
|
RO |
IOMMU supports the translation-request interface |
|||||||||||||||
37:32 |
|
RO |
Physical Address Size supported by the IOMMU. |
|||||||||||||||
38 |
|
RO |
One level PDT with 8-bit process_id supported. |
|||||||||||||||
39 |
|
RO |
Two level PDT with 17-bit process_id supported. |
|||||||||||||||
40 |
|
RO |
Three level PDT with 20-bit process_id supported. |
|||||||||||||||
41 |
|
RO |
Associating QoS IDs with requests is supported. |
|||||||||||||||
42 |
|
RO |
Non-leaf PTE invalidation extension is supported. |
|||||||||||||||
43 |
|
RO |
Address range invalidation extension is supported. |
|||||||||||||||
55:44 |
reserved |
RO |
Reserved for standard use. |
|||||||||||||||
63:56 |
custom |
RO |
Designated for custom use. |
When HPM is 1, the iohpmcycles and the iohpmctr1 registers must be present
and be at least 32-bits wide.
At least one method, MSI or WSI, of generating interrupts from the IOMMU
must be supported.
IOMMU implementations must support the Svnapot standard extension for NAPOT Translation Contiguity.
The physical address space addressable by the IOMMU ranges from 0 to .
|
Hypervisor may provide an SW emulated IOMMU to allow the guest to manage the first-stage page tables for fine grained control on memory accessed by guest controlled devices. A hypervisor that provides such an emulated IOMMU to the guest may retain
control of the second-stage address translation and clear the A hypervisor that provides such an emulated IOMMU to the guest may retain
control of the MSI page tables used to direct MSIs to guest interrupt files in
an IMSIC or to a memory-resident-interrupt-file and clear the |
|
The |
|
The IOMMU is designed to provide a highly modular and extensible set of capabilities allowing implementations to include only the exact set of capabilities required for an application. In addition, implementations may add their own custom extensions to the IOMMU. The IOMMU must support all the virtual memory extensions that are supported by any of the harts in the system. RISC-V platform specifications may mandate a set of IOMMU capabilities that must be provided by an implementation to be compliant to those specifications. |
Features-control register (fctl)
This register must be readable in any implementation. An implementation may allow one or more fields in the register to be writable to support enabling or disabling the feature controlled by that field.
If software enables or disables a feature when the IOMMU is not OFF
(i.e. when ddtp.iommu_mode != Off) then the IOMMU behavior is UNSPECIFIED.
If software enables or disables a feature when the IOMMU in-memory queues
are enabled (i.e. cqcsr.cqon/cqen == 1, fqcsr.fqon/fqen == 1, or
pqcsr.pqon/pqen == 1) then the IOMMU behavior is UNSPECIFIED.
| Bits | Field | Attribute | Description |
|---|---|---|---|
0 |
|
WARL |
When 0, IOMMU accesses to memory resident data structures, as specified in iommu_data_structures.adoc#ENDIAN_CONFIG, accesses made by the IOMMU during command processing or for MSI generation, and accesses to in-memory queues are performed as little-endian accesses and when 1 as big-endian accesses. |
1 |
|
WARL |
When 1, IOMMU interrupts are signaled as wire-signaled-interrupts else they are signaled as message-signaled-interrupts. |
2 |
|
WARL |
Controls the address-translation schemes that may be used for guest physical addresses as defined in iommu_data_structures.adoc#IOHGATP_MODE_ENC-0 and iommu_data_structures.adoc#IOHGATP_MODE_ENC-1. |
15:3 |
reserved |
WPRI |
Reserved for standard use. |
31:16 |
custom |
WPRI |
Designated for custom use. |
Device-directory-table pointer (ddtp)
| Bits | Field | Attribute | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3:0 |
|
WARL |
The IOMMU may be configured to be in the following modes:
|
||||||||||||||||||||||||
4 |
|
RO |
A write to |
||||||||||||||||||||||||
9:5 |
reserved |
WPRI |
Reserved for standard use |
||||||||||||||||||||||||
53:10 |
|
WARL |
Holds the |
||||||||||||||||||||||||
63:54 |
reserved |
WPRI |
Reserved for standard use |
The device-context is 64-bytes in size if capabilities.MSI_FLAT is 1 else it is
32-bytes.
When the iommu_mode is Bare or Off, the PPN field is don’t-care. When
in Bare mode only Untranslated requests are allowed. Translated requests,
Translation request, and PCIe message transactions are unsupported.
All IOMMUs must support Off and Bare mode. An IOMMU is allowed to support a
subset of directory-table levels and device-context widths. At a minimum one
of the modes must be supported.
When the iommu_mode field value is changed to Off the IOMMU guarantees that
in-flight transactions, observed at the time of the write to this field, from devices
connected to the IOMMU will either be processed with the configurations
applicable to the old value of the iommu_mode field or be aborted
(iommu_hw_guidelines.adoc#IOBR_FAULT_RESP). It also ensures that all transactions and previous
requests from devices that have already been processed by the IOMMU are committed
to a global ordering point such that they can be observed by all RISC-V harts,
devices, and IOMMUs in the platform. Software must not change the PPN field
value when transitioning the iommu_mode to Off.
The IOMMU behavior of writing iommu_mode to 1LVL, 2LVL, or 3LVL, when
the previous value of the iommu_mode is not Off or Bare is UNSPECIFIED.
To change DDT levels, the IOMMU must first be transitioned to Bare or Off
state. The behavior resulting from changing the iommu_mode to Bare when the
previous value of the iommu_mode was not Off is UNSPECIFIED.
When an IOMMU is transitioned to Bare or Off state, the IOMMU may retain
information cached from in-memory data structures such as page tables, DDT,
PDT, etc. Software must use suitable invalidation commands to invalidate cached
entries.
|
In RV32, only the low order 32-bits of the register (22-bit |
Command-queue base (cqb)
This 64-bit register (RW) holds the PPN of the root page of the command-queue and number of entries in the queue. Each command is 16 bytes.
The IOMMU behavior on writing cqb when cqcsr.busy or cqon bits are 1 is
UNSPECIFIED. The software recommended sequence to change cqb is to first
disable the command-queue by clearing cqen and wait for both cqcsr.busy and
cqon to be 0 before changing the cqb. The status of bits 31:cqb.LOG2SZ in
cqt following a write to cqb is 0 and the bits cqb.LOG2SZ-1:0 in cqt
assume a valid but otherwise UNSPECIFIED value.
| Bits | Field | Attribute | Description |
|---|---|---|---|
4:0 |
|
WARL |
The |
9:5 |
reserved |
WPRI |
Reserved for standard use |
53:10 |
|
WARL |
Holds the |
63:54 |
reserved |
WPRI |
Reserved for standard use |
|
In RV32, only the low order 32-bits of the register (22-bit |
Command-queue head (cqh)
This 32-bit register (RO) holds the index into the command-queue where the IOMMU will fetch the next command.
| Bits | Field | Attribute | Description |
|---|---|---|---|
31:0 |
|
RO |
Holds the |
Command-queue tail (cqt)
This 32-bit register (RW) holds the index into the command-queue where the software queues the next command for the IOMMU.
| Bits | Field | Attribute | Description |
|---|---|---|---|
31:0 |
|
WARL |
Holds the |
Fault queue base (fqb)
This 64-bit register (RW) holds the PPN of the root page of the fault-queue and number of entries in the queue. Each fault record is 32 bytes.
The IOMMU behavior on writing fqb when fqcsr.busy or fqon bits are 1 is
UNSPECIFIED. The software recommended sequence to change fqb is to first
disable the fault-queue by clearing fqen and wait for both fqcsr.busy and
fqon to be 0 before changing the fqb. The status of bits 31:fqb.LOG2SZ
in fqh following a write to fqb is 0 and the bits fqb.LOG2SZ-1:0 in fqh
assume a valid but otherwise UNSPECIFIED value.
| Bits | Field | Attribute | Description |
|---|---|---|---|
4:0 |
|
WARL |
The |
9:5 |
reserved |
WPRI |
Reserved for standard use |
53:10 |
|
WARL |
Holds the |
63:54 |
reserved |
WPRI |
Reserved for standard use |
|
In RV32, only the low order 32-bits of the register (22-bit |
Fault queue head (fqh)
This 32-bit register (RW) holds the index into the fault-queue where the software will fetch the next fault record.
| Bits | Field | Attribute | Description |
|---|---|---|---|
31:0 |
|
WARL |
Holds the |
Fault queue tail (fqt)
This 32-bit register (RO) holds the index into the fault-queue where the IOMMU queues the next fault record.
| Bits | Field | Attribute | Description |
|---|---|---|---|
31:0 |
|
RO |
Holds the |
Page-request-queue base (pqb)
This 64-bit register (WARL) holds the PPN of the root page of the page-request-queue and number of entries in the queue. Each "Page Request" message is 16 bytes.
The IOMMU behavior on writing pqb when pqcsr.busy or pqon bits are 1 is
UNSPECIFIED. The software recommended sequence to change pqb is to first
disable the page-request-queue by clearing pqen and wait for both pqcsr.busy
and pqon to be 0 before changing the pqb. The status of bits 31:pqb.LOG2SZ
in pqh following a write to pqb is 0 and the bits pqb.LOG2SZ-1:0 in pqh
assume a valid but otherwise UNSPECIFIED value.
| Bits | Field | Attribute | Description |
|---|---|---|---|
4:0 |
|
WARL |
The |
9:5 |
reserved |
WPRI |
Reserved for standard use |
53:10 |
|
WARL |
Holds the |
63:54 |
reserved |
WPRI |
Reserved for standard use |
|
In RV32, only the low order 32-bits of the register (22-bit |
Page-request-queue head (pqh)
This 32-bit register (RW) holds the index into the page-request-queue where software will fetch the next page-request.
| Bits | Field | Attribute | Description |
|---|---|---|---|
31:0 |
|
WARL |
Holds the |
Page-request-queue tail (pqt)
This 32-bit register (RO) holds the index into the page-request-queue where the IOMMU writes the next page-request.
| Bits | Field | Attribute | Description |
|---|---|---|---|
31:0 |
|
RO |
Holds the |
Command-queue CSR (cqcsr)
This 32-bit register (RW) is used to control the operations and report the status of the command-queue.
| Bits | Field | Attribute | Description |
|---|---|---|---|
0 |
|
RW |
The command-queue-enable bit enables the command-
queue when set to 1. |
1 |
|
RW |
Command-queue-interrupt-enable bit enables generation of interrupts from command-queue when set to 1. |
7:2 |
reserved |
WPRI |
Reserved for standard use |
8 |
|
RW1C |
If command-queue access to fetch a command or a memory access made by a command leads to a memory fault, then the command-queue-memory-fault bit is set to 1, and the command-queue stalls until this bit is cleared. To re-enable command processing, software should clear this bit by writing 1. |
9 |
|
RW1C |
If the execution of a command leads to a
timeout (e.g. a command to invalidate device ATC
may timeout waiting for a completion), then the
command-queue sets the |
10 |
|
RW1C |
If an illegal or unsupported command is fetched and
decoded by the command-queue then the command-queue
sets the |
11 |
|
RW1C |
An IOMMU that supports wire-signaled-interrupts
sets the |
15:12 |
reserved |
WPRI |
Reserved for standard use |
16 |
|
RO |
The command-queue is active if |
17 |
|
RO |
A write to |
27:18 |
reserved |
WPRI |
Reserved for standard use. |
31:28 |
custom |
WPRI |
Designated for custom use. |
When cmd_ill or cqmf is 1 in cqcsr, the cqh references the command in the
CQ that caused the error. Previous commands may have completed, timed out, or
their execution aborted by the IOMMU.
|
If software makes the CQ operational again after a |
The cmd_to bit is set when a IOFENCE.C command detects that one or more
previous commands that are specified to have timeouts have timed out but all
other commands previous to the IOFENCE.C have completed. When cmd_to is 1,
cqh references the IOFENCE.C command that detected the timeout.
|
Command-queue being empty does not imply that all commands fetched from the
command-queue have been completed. When the command-queue is requested to be
disabled, an implementation may either complete the already fetched commands
or abort execution of those commands. Software must use an |
Fault queue CSR (fqcsr)
This 32-bit register (RW) is used to control the operations and report the status of the fault-queue.
| Bits | Field | Attribute | Description |
|---|---|---|---|
0 |
|
RW |
The fault-queue enable bit enables the fault-queue
when set to 1. |
1 |
|
RW |
Fault queue interrupt enable bit enables generation of interrupts from fault-queue when set to 1. |
7:2 |
reserved |
WPRI |
Reserved for standard use |
8 |
|
RW1C |
The |
9 |
|
RW1C |
The fault-queue-overflow bit is set to 1 if the
IOMMU needs to queue a fault record but the
fault-queue is full (i.e., |
15:10 |
|
WPRI |
Reserved for standard use |
16 |
|
RO |
The fault-queue is active if |
17 |
|
RO |
Write to |
27:18 |
reserved |
WPRI |
Reserved for standard use. |
31:28 |
custom |
WPRI |
Designated for custom use. |
Page-request-queue CSR (pqcsr)
This 32-bit register (RW) is used to control the operations and report the status of the page-request-queue.
| Bits | Field | Attribute | Description |
|---|---|---|---|
0 |
|
RW |
The page-request-enable bit enables the
page-request-queue when set to 1. |
1 |
|
RW |
The page-request-queue-interrupt-enable bit when set to 1, enables generation of interrupts from page-request-queue. |
7:2 |
reserved |
WPRI |
Reserved for standard use |
8 |
|
RW1C |
The |
9 |
|
RW1C |
The page-request-queue-overflow bit is set to 1
if the page-request queue overflows i.e. IOMMU
needs to queue a "Page Request" message but the
page-request queue is full
(i.e., |
15:10 |
reserved |
WPRI |
Reserved for standard use |
16 |
|
RO |
The page-request is active when |
17 |
|
RO |
A write to |
27:18 |
reserved |
WPRI |
Reserved for standard use |
31:28 |
custom |
WPRI |
Designated for custom use. |
Interrupt pending status register (ipsr)
This 32-bit register (RW1C) reports the pending interrupts which require software service. Each interrupt-pending bit in the register corresponds to a interrupt source in the IOMMU. The interrupt-pending bit in the register once set to 1 stays 1 till software clears that interrupt-pending bit by writing 1 to clear it.
When fctl.WSI is 1, the interrupt-pending bit drives the wire selected by
the corresponding icvec field to signal an interrupt.
When fctl.WSI is 0, the IOMMU signals interrupts using messages. MSI have edge
semantics and an interrupt message is generated when an interrupt-pending bit
transitions from 0 to 1. The address and data for the message are obtained from
the msi_cfg_tbl entry selected by the icvec field corresponding to the
interrupt-pending bit.
| Bits | Field | Attribute | Description |
|---|---|---|---|
0 |
|
RW1C |
The command-queue-interrupt-pending bit is set to
1 if
|
1 |
|
RW1C |
The fault-queue-interrupt-pending bit is set to 1
if
|
2 |
|
RW1C |
The performance-monitoring-interrupt-pending bit is
set to 1 when the |
3 |
|
RW1C |
The page-request-queue-interrupt-pending is set to
1 if
|
7:4 |
reserved |
WPRI |
Reserved for standard use. |
15:8 |
custom |
WPRI |
Designated for custom use. |
31:16 |
reserved |
WPRI |
Reserved for standard use |
If a bit in ipsr is 1 then a write of 1 to the bit transitions the bit from 1→0.
If the conditions to set that bit are still present (See Table 2) or if
they occur after the bit is cleared then that bit transitions again from 0→1.
Performance-monitoring counter overflow status (iocountovf)
The performance-monitoring counter overflow status is a 32-bit read-only
register that contains shadow copies of the OF bits in the iohpmevt1-31
registers - where iocountovf bit X corresponds to iohpmevtX and bit 0
corresponds to the OF bit of iohpmcycles.
This register enables overflow interrupt handler software to quickly and easily determine which counter(s) have overflowed.
| Bits | Field | Attribute | Description |
|---|---|---|---|
0 |
|
RO |
Shadow of |
31:1 |
|
RO |
Shadow of |
Performance-monitoring counter inhibits (iocountinh)
The performance-monitoring counter inhibits is a 32-bit WARL register
that contains bits to inhibit the corresponding counters from counting. Bit X
when set inhibits counting in iohpmctrX and bit 0 inhibits counting in
iohpmcycles.
| Bits | Field | Attribute | Description |
|---|---|---|---|
0 |
|
RW |
When set, |
31:1 |
|
WARL |
When bit X is set, then counting of events in
|
|
When the To initialize an event counter or the cycles counter to a desired value, it should be first inhibited if it is enabled to count. This measure ensures that it does not count during the update process. The inhibition should be removed after the register has been programmed with the desired value. |
Performance-monitoring cycles counter (iohpmcycles)
This 64-bit register is a free running clock cycle counter.
There is no associated iohpmevt0.
| Bits | Field | Attribute | Description |
|---|---|---|---|
62:0 |
|
WARL |
Cycles counter value. |
63 |
|
RW |
Overflow |
The OF bit is set when the iohpmcycles counter overflows, and remains set
until cleared by software. Since iohpmcycles value is an unsigned value,
overflow is defined as unsigned overflow. Note that there is no loss of
information after an overflow since the counter wraps around and keeps counting
while the sticky OF bit remains set.
If the iohpmcycles counter overflows when the OF bit is zero, then a HPM
Counter Overflow interrupt is generated by setting ipsr.pmip bit to 1. If
the OF bit is already one, then no interrupt request is generated. Consequently
the OF bit also functions as a count overflow interrupt disable for the
iohpmcycles.
Performance-monitoring event counters (iohpmctr1-31)
These registers are 64-bit WARL counter registers.
| Bits | Field | Attribute | Description |
|---|---|---|---|
63:0 |
|
WARL |
Event counter value. |
Performance-monitoring event selectors (iohpmevt1-31)
These performance-monitoring event registers are 64-bit RW registers. When a
transaction processed by the IOMMU causes an event that is programmed to count
in a counter then the counter is incremented. In addition to matching events,
the event selector may be programmed with additional filters based on
device_id, process_id, GSCID, and PSCID such that the counter is
incremented conditionally based on the transaction matching these additional
filters. When such device_id based filtering is used, the match may be
configured to be a precise match or a partial match. A partial match allows
transactions with a range of IDs to be counted by the counter.
| Bits | Field | Attribute | Description |
|---|---|---|---|
14:0 |
|
WARL |
Indicates the event to count. A value of 0
indicates no events are counted. |
15 |
|
RW |
When set to 1, partial matching of the
|
35:16 |
|
RW |
|
59:36 |
|
RW |
|
60 |
|
RW |
If set, only transactions with matching
|
61 |
|
RW |
If set, only transactions with matching
|
62 |
|
RW |
Filter ID Type: This field indicates the type
of ID to filter on. When 0, the |
63 |
|
RW |
Overflow status or Interrupt disable |
The table below summarizes the filtering option for events that support filtering by IDs.
IDT |
DV_GSCV |
PV_PSCV |
Operation |
|---|---|---|---|
0/1 |
0 |
0 |
Counter increments. No ID based filtering. |
0 |
0 |
1 |
If the transaction has a valid
|
0 |
1 |
0 |
Counter increments if |
0 |
1 |
1 |
If the transaction has a valid
|
1 |
0 |
1 |
If the transaction has a valid
|
1 |
1 |
0 |
Counter increments if |
1 |
1 |
1 |
Counter increments if |
When filtering by device_id or GSCID is selected and the event supports
ID based filtering, the DMASK field can be used to configure a partial match.
When DMASK is set to 1, partial matching of the DID_GSCID is performed for
the transaction. The lower bits of the DID_GSCID all the way to the first
low order 0 bit (including the 0 bit position itself) are masked.
The following example illustrates the use of DMASK and filtering by device_id.
DMASK |
DID_GSCID |
Comment |
|---|---|---|
0 |
|
One specific seg:bus:dev:func |
1 |
|
seg:bus:dev - any func |
1 |
|
seg:bus - any dev:func |
1 |
|
seg - any bus:dev:func |
The following table lists the standard events that can be counted:
| eventID | Event counted | IDT settings supported |
|---|---|---|
0 |
Do not count |
|
1 |
Untranslated requests |
0 |
2 |
Translated requests |
0 |
3 |
ATS Translation requests |
0 |
4 |
TLB miss |
0/1 |
5 |
Device Directory Walks |
0 |
6 |
Process Directory Walks |
0 |
7 |
First-stage Page Table Walks |
0/1 |
8 |
Second-stage Page Table Walks |
0/1 |
9 - 16383 |
reserved for future standard |
- |
When the programmed IDT setting is not supported for an event then the
associated counter does not increment.
The OF bit is set when the corresponding iohpmctr1-31 counter overflows,
and remains set until cleared by software. Since iohpmctr1-31 values are
unsigned values, overflow is defined as unsigned overflow. Note that there is no
loss of information after an overflow since the counter wraps around and keeps
counting while the sticky OF bit remains set.
If a iohpmctr1-31 counter overflows when the associated OF bit is zero, then
a HPM Counter Overflow interrupt is generated by setting ipsr.pmip bit to 1. If
the OF bit is already one, then no interrupt request is generated. Consequently
the OF bit also functions as a count overflow interrupt disable for the
associated iohpmctr1-31.
|
There are not separate overflow status and overflow interrupt enable bits. In
practice, enabling overflow interrupt generation (by clearing the |
|
In RV32, memory-mapped writes to
Alternatively, the counter may first be inhibited such that no events count during the update and the inhibit removed after the register has been programmed with the desired value. |
|
If |
Translation-request IOVA (tr_req_iova)
The tr_req_iova is a 64-bit register used to implement a
translation-request interface for debug. This register is present when
capabilities.DBG == 1.
| Bits | Field | Attribute | Description |
|---|---|---|---|
11:0 |
reserved |
WPRI |
Reserved for standard use |
63:12 |
|
WARL |
The IOVA virtual page number |
Translation-request control (tr_req_ctl)
The tr_req_ctl is a 64-bit WARL register used to implement a
translation-request interface for debug. This register is present when
capabilities.DBG == 1.
| Bits | Field | Attribute | Description |
|---|---|---|---|
0 |
|
RW1S |
This bit is set to indicate a valid
request has been setup in the
|
1 |
|
WARL |
If set to 1, Privileged Mode access
is requested; otherwise, Privileged Mode access
is not requested. When |
2 |
|
WARL |
If set to 1, execute permission is
requested else execute permission is not
requested. If |
3 |
|
WARL |
If set to 1, read permission is requested. If set to 0, both read and write permissions are requested. |
11:4 |
reserved |
WPRI |
Reserved for standard use |
31:12 |
|
WARL |
If |
32 |
|
WARL |
If set to 1, the |
35:33 |
reserved |
WPRI |
Reserved for standard use. |
39:36 |
custom |
WPRI |
Designated for custom use. |
63:40 |
|
WARL |
This field provides the |
|
In RV32, the high half of the register should be written first, followed by the
low half, which includes the |
Translation-response (tr_response)
The tr_response is a 64-bit RO register used to hold the results
of a translation requested using the translation-request interface.
This register is present when capabilities.DBG == 1.
| Bits | Field | Attribute | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 |
|
RO |
If the process to translate the IOVA detects
a fault then the |
|||||||||||||||
6:1 |
reserved |
RO |
Reserved for standard use |
|||||||||||||||
8:7 |
|
RO |
Memory type determined for the translation
using the PBMT fields in the first-stage and/or
the second-stage page tables used for the
translation. This value of this field is
|
|||||||||||||||
9 |
|
RO |
Translation range size field, when set to 1
indicates that the translation applies to a
range that is larger than 4 KiB and the size
of the translation range is encoded in the
|
|||||||||||||||
53:10 |
|
RO |
If the
|
|||||||||||||||
59:54 |
reserved |
RO |
Reserved for standard use. |
|||||||||||||||
63:60 |
custom |
RO |
Designated for custom use. |
|
An IOMMU implementation is not required to report a superpage translation
or support reporting all possible superpage sizes. An implementation is
allowed to report a 4 KiB translation corresponding to the requested
|
IOMMU QoS ID (iommu_qosid)
The iommu_qosid register fields are defined as follows:
iommu_qosid register fields| Bits | Field | Attribute | Description |
|---|---|---|---|
11:0 |
|
WARL |
|
15:12 |
reserved |
WPRI |
Reserved for standard use. |
27:16 |
|
WARL |
|
31:28 |
reserved |
WPRI |
Reserved for standard use. |
IOMMU-initiated requests for accessing the following data structures use the
value programmed in the RCID and MCID fields of the iommu_qosid register.
-
Device directory table (
DDT) -
Fault queue (
FQ) -
Command queue (
CQ) -
Page-request queue (
PQ) -
IOMMU-initiated MSI (Message-signaled interrupts)
When ddtp.iommu_mode == Bare, all device-originated requests are
associated with the QoS IDs configured in the iommu_qosid register.
Interrupt-cause-to-vector register (icvec)
Interrupt-cause-to-vector register maps a cause to a vector. All causes can be mapped to the same vector or a cause can be given a unique vector.
The vector is used:
-
By an IOMMU that generates interrupts as MSIs, to index into MSI configuration table (
msi_cfg_tbl) to determine the MSI to generate. An IOMMU is capable of generating interrupts as a MSI ifcapabilities.IGS==MSIor ifcapabilities.IGS==BOTH. Whencapabilities.IGS==BOTHthe IOMMU may be configured to generate interrupts as MSI by settingfctl.WSIto 0. -
By an IOMMU that generates WSI, to determine the wire to signal the interrupt. An IOMMU is capable of generating wire-signaled- interrupts if
capabilities.IGS==WSIor ifcapabilities.IGS==BOTH. Whencapabilities.IGS==BOTHthe IOMMU may be configured to generate wire-signaled- interrupts by settingfctl.WSIto 1.
If an implementation only supports a single vector then all bits of this register may be hardwired to 0 (WARL). Likewise if only two vectors are supported then only bit 0 for each cause could be writable.
| Bits | Field | Attribute | Description |
|---|---|---|---|
3:0 |
|
WARL |
The command-queue-interrupt-vector ( |
7:4 |
|
WARL |
The fault-queue-interrupt-vector ( |
11:8 |
|
WARL |
The performance-monitoring-interrupt-vector
( |
15:12 |
|
WARL |
The page-request-queue-interrupt-vector ( |
31:16 |
reserved |
WPRI |
Reserved for standard use. |
63:32 |
custom |
WPRI |
Designated for custom use. |
MSI configuration table (msi_cfg_tbl)
An IOMMU that supports generating IOMMU-originated interrupts
(i.e., capabilities.IGS == MSI or capabilities.IGS == BOTH) as MSIs
implements a MSI configuration table that is indexed by the vector from icvec
to determine a MSI table entry. Each MSI table entry for interrupt vector x
has three registers msi_addr_x, msi_data_x, and msi_vec_ctl_x. These
registers are hardwired to 0 if capabilities.IGS == WSI.
If an access fault is detected on a MSI write using msi_addr_x, then the IOMMU
reports a "IOMMU MSI write access fault" (cause 273) fault, with TTYP set to 0
and iotval set to the value of msi_addr_x.
| bit 63 | bit 0 | Byte Offset |
|---|---|---|
Entry 0: Message address |
+000h |
|
Entry 0: Vector Control |
Entry 0: Message Data |
+008h |
Entry 1: Message address |
+010h |
|
Entry 1: Vector Control |
Entry 1: Message Data |
+018h |
… |
+020h |
|
| Bits | Field | Attribute | Description |
|---|---|---|---|
1:0 |
0 |
RO |
Fixed to 0 |
55:2 |
|
WARL |
Holds the 4-byte aligned MSI address. |
63:56 |
reserved |
WPRI |
Reserved for standard use. |
| Bits | Field | Attribute | Description |
|---|---|---|---|
31:0 |
|
WARL |
Holds the MSI data |
| Bits | Field | Attribute | Description |
|---|---|---|---|
0 |
|
RW |
When the mask bit |
31:1 |
reserved |
WPRI |
Reserved for standard use. |