riscv-non-isa / riscv-iommu

RISC-V IOMMU Specification
https://jira.riscv.org/browse/RVG-55
Creative Commons Attribution 4.0 International
72 stars 14 forks source link

Question about configuration check of custom bits in DC #344

Closed viktoryou closed 1 month ago

viktoryou commented 1 month ago

From spec, in Chapter 2.1.4 (Device-context configuration checks)

If any bits or encodings that are reserved for future standard use are set.

How about the bits designated for custom use that hasn't been specified in a implemention?

I notice one confusing point. For msiptp.MODE, when capabilities.MSI_FLAT is 1, DC.msiptp.MODE must be Off or Flat, or else the device context is misconfigured. However, encoding value of 14-15 is designated for custom use. When a custom encoding is effective, I guess the custom mode need to bypass this check.

When the bits or encodings designated for custom use are set without being specified, for example, in device context, would the configuration check fail?

ved-rivos commented 1 month ago

How about the bits designated for custom use that hasn't been specified in a implemention?

Each implementation needs to provide the behavior for the bits designated for custom use.

When a custom encoding is effective, I guess the custom mode need to bypass this check.

An implementation that supports the custom encoding of 14-15 will need to provide the specification for the corresponding checks. The custom implementation may for instance extend the rule in a custom manner to state - it can be Off, Flat, and "custom name".

When the bits or encodings designated for custom use are set without being specified, for example, in device context, would the configuration check fail?

The meaning of a custom bit may be different between two implementations and the behavior for custom bits is provided by the implementation. Software will not set bits and encoding's designated for custom encoding unless it is intimately familiar with the specification provided by that implementation.