Skip to content

Commit

Permalink
src/mte_vatag: define lowest and highest virtual addresses for U and S
Browse files Browse the repository at this point in the history
Provide a clear definition for minimum and maximum virtual address for
U and S mode.

Signed-off-by: Deepak Gupta <[email protected]>
  • Loading branch information
deepak0414 committed Jan 4, 2025
1 parent b740c14 commit d52e9d8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/mte_vatag.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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`
|===

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.

0 comments on commit d52e9d8

Please sign in to comment.