diff --git a/src/binary-encoding.adoc b/src/binary-encoding.adoc index 46c6e9a..86334c3 100644 --- a/src/binary-encoding.adoc +++ b/src/binary-encoding.adoc @@ -98,6 +98,20 @@ If an SBI function needs to pass a shared memory physical address range to the SBI implementation (or higher privilege mode), then this physical memory address range MUST satisfy the following requirements: +* The SBI implementation MUST check that the specified physical memory range + is composed of valid physical addresses and return SBI_ERR_INVALID_ADDRESS + when any address in the range is not valid. + +NOTE: A valid address is one that only sets bits allowed by the platform's + physical memory layout and the RISC-V ISA. As an SBI implementation may + further restrict the allowed range, it may return a generic SBI_ERR_FAILED + (instead of SBI_ERR_INVALID_ADDRESS) when input is invalid with respect to + its specific limits. Returning SBI_ERR_FAILED instead of + SBI_ERR_INVALID_ADDRESS, in this case, is not a violation of the above + specification because the SBI implementation should detect the distinct case + of violating the more strict range first, making it appropriate to return the + error associated with the strict-range case immediately. + * The SBI implementation MUST check that the supervisor-mode software is  allowed to access the specified physical memory range with the access   type requested (read and/or write). diff --git a/src/ext-debug-triggers.adoc b/src/ext-debug-triggers.adoc index d45564f..d77f608 100644 --- a/src/ext-debug-triggers.adoc +++ b/src/ext-debug-triggers.adoc @@ -121,6 +121,8 @@ The possible error codes returned in `sbiret.error` are shown in and `shmem_phys_hi` parameters does not satisfy the requirements described in <<_shared_memory_physical_address_range_parameter>>. +| SBI_ERR_FAILED | The request failed for unspecified or unknown other + reasons. |=== === Function: Read triggers (FID #2) diff --git a/src/ext-nested-acceleration.adoc b/src/ext-nested-acceleration.adoc index d7e14ba..2952df1 100644 --- a/src/ext-nested-acceleration.adoc +++ b/src/ext-nested-acceleration.adoc @@ -399,6 +399,8 @@ The possible error codes returned in `sbiret.error` are shown in and `shmem_phys_hi` parameters does not satisfy the requirements described in <<_shared_memory_physical_address_range_parameter>>. +| SBI_ERR_FAILED | The request failed for unspecified or unknown other + reasons. |=== === Function: Synchronize shared memory CSRs (FID #2) diff --git a/src/ext-pmu.adoc b/src/ext-pmu.adoc index a7ad196..e0e898b 100644 --- a/src/ext-pmu.adoc +++ b/src/ext-pmu.adoc @@ -585,6 +585,8 @@ The possible error codes returned in `sbiret.error` are shown in and `shmem_phys_hi` parameters is not writable or does not satisfy other requirements of <<_shared_memory_physical_address_range_parameter>>. +| SBI_ERR_FAILED | The request failed for unspecified or unknown other + reasons. |=== === Function Listing diff --git a/src/ext-sse.adoc b/src/ext-sse.adoc index 963fecb..4e23d93 100644 --- a/src/ext-sse.adoc +++ b/src/ext-sse.adoc @@ -357,6 +357,8 @@ In case of an error, the possible error codes are shown in the `output_phys_lo` and `output_phys_hi` parameters does not satisfy the requirements described in <<_shared_memory_physical_address_range_parameter>>. +| SBI_ERR_FAILED | The read failed for unspecified or unknown other + reasons. |=== === Function: Write software event attributes (FID #1) @@ -402,6 +404,8 @@ The possible error codes returned in `sbiret.error` are shown in `input_phys_lo` and `input_phys_hi` parameters does not satisfy the requirements described in <<_shared_memory_physical_address_range_parameter>>. +| SBI_ERR_FAILED | The write failed for unspecified or unknown other + reasons. |=== === Function: Register a software event (FID #2)