From b64a6f960b6cd4cd63dc9b30c4e94da77c032eda Mon Sep 17 00:00:00 2001 From: Deepak Gupta Date: Fri, 3 Jan 2025 20:40:32 -0800 Subject: [PATCH] src/mte_vatag: define lowest and highest virtual addresses for U and S Provide a clear definition for minimum and maximum virtual address for U and S mode. Signed-off-by: Deepak Gupta --- src/mte_vatag.adoc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/mte_vatag.adoc b/src/mte_vatag.adoc index b302b19..850dd64 100644 --- a/src/mte_vatag.adoc +++ b/src/mte_vatag.adoc @@ -80,3 +80,21 @@ spanning VITT range. VITT range is defined as below tag_memory_region_end = mc_tag_va(HIGHEST_VADDR_CURR_PRIV) LOWEST_VADDR_CURR_PRIV: Lowest virtual address in current privilege. HIGHEST_VADDR_CURR_PRIV: Highest virtual address in current privilege. + +.Lowest and highest virtual addresses +[width=100%] +[%header, cols="^4,^12"] +|=== +|Privilege level | LOWEST_VADDR_CURR_PRIV | HIGHEST_VADDR_CURR_PRIV +| U | 0 | 2 ^ (VADDR_BITS) - 1 +| S / HS / VS | 2 ^ (VADDR_BITS) | 2 ^ (VADDR_BITS) OR (2 ^ (VADDR_BITS) - 1) +| M | `Impl. defined` | `Impl. defined` +|=== + +VADDR_BITS is virtual addressing bits. VADDR_BITS can be 39, 48 or 57 +depending on Sv39, Sv48 or Sv57 virtual addressing mode in `satp` CSR. + +`Svatag` assumes an even split in address space between user and supervisor +with user address space spanning from zero to maxium positive address while +supervisor address space spanning from minimum negative value to maximum +negative value.