From a369b8db18160750ae587307b53ca6a865786db6 Mon Sep 17 00:00:00 2001 From: Tariq Kurd Date: Tue, 17 Dec 2024 16:54:43 +0100 Subject: [PATCH 1/2] clarify invalid address handling --- src/riscv-integration.adoc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/riscv-integration.adoc b/src/riscv-integration.adoc index 23823276..62163ba8 100644 --- a/src/riscv-integration.adoc +++ b/src/riscv-integration.adoc @@ -491,16 +491,21 @@ the address. The tag of the capability written to <> is cleared if either check fails. Additionally, when MODE=Vectored the capability has its tag bit cleared if the -capability address + 4 x HICAUSE is not within the representable bounds. +capability address + 4 x HICAUSE is not within the <>. HICAUSE is the largest exception cause value that the implementation can write -to <> when an interrupt is taken. +to <> or <>/<> when an interrupt is taken. NOTE: When MODE=Vectored, it is only required that address + 4 x HICAUSE is -within representable bounds instead of the capability's bounds. This ensures +within the <> instead of the capability's bounds. +This ensures that software is not forced to allocate a capability granting access to more memory for the trap-vector than necessary to handle the trap causes that actually occur in the system. +NOTE: If either the capability address _or_ the capability address + 4 x HICAUSE are +invalid then the <> rules are followed which may require +the tag being cleared. + [#mscratch, reftext="mscratch"] ==== Machine Scratch Register (mscratch) From 940c3cf6365b8db7a85a041d54a5386117ffb547 Mon Sep 17 00:00:00 2001 From: Tariq Kurd Date: Wed, 18 Dec 2024 09:35:42 +0100 Subject: [PATCH 2/2] improve wording --- src/riscv-integration.adoc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/riscv-integration.adoc b/src/riscv-integration.adoc index 62163ba8..a232febd 100644 --- a/src/riscv-integration.adoc +++ b/src/riscv-integration.adoc @@ -502,9 +502,11 @@ that software is not forced to allocate a capability granting access to more memory for the trap-vector than necessary to handle the trap causes that actually occur in the system. -NOTE: If either the capability address _or_ the capability address + 4 x HICAUSE are -invalid then the <> rules are followed which may require -the tag being cleared. +NOTE: When MODE=Vectored, if either the capability address _or_ the capability +address + 4 x HICAUSE are invalid then the <> rules +are followed which may require the tag to be cleared. In particular, if any part +of the range is in the invalid address space then clearing the tag is strongly +recommended. [#mscratch, reftext="mscratch"] ==== Machine Scratch Register (mscratch)