Skip to content

Commit 5e30c16

Browse files
kevin-brodsky-armctmarinas
authored andcommitted
Documentation: arm64: Update memory.rst for TBI
Most of memory.rst was written very early, at a time where TBI (Top Byte Ignore) was not enabled. Nowadays TBI0 is always enabled, and TBI1 may be enabled, depending on the kernel configuration. This means that VA bits 63:56 cannot generally be assumed to have any particular value. Regardless of TBI, TTBRx selection is done based on bit 55; update memory.rst accordingly. Signed-off-by: Kevin Brodsky <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 83a7eef commit 5e30c16

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

Documentation/arch/arm64/memory.rst

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ ARMv8.2 adds optional support for Large Virtual Address space. This is
1818
only available when running with a 64KB page size and expands the
1919
number of descriptors in the first level of translation.
2020

21-
User addresses have bits 63:48 set to 0 while the kernel addresses have
22-
the same bits set to 1. TTBRx selection is given by bit 63 of the
23-
virtual address. The swapper_pg_dir contains only kernel (global)
24-
mappings while the user pgd contains only user (non-global) mappings.
25-
The swapper_pg_dir address is written to TTBR1 and never written to
26-
TTBR0.
21+
TTBRx selection is given by bit 55 of the virtual address. The
22+
swapper_pg_dir contains only kernel (global) mappings while the user pgd
23+
contains only user (non-global) mappings. The swapper_pg_dir address is
24+
written to TTBR1 and never written to TTBR0.
2725

2826

2927
AArch64 Linux memory layout with 4KB pages + 4 levels (48-bit)::
@@ -65,29 +63,29 @@ Translation table lookup with 4KB pages::
6563
+--------+--------+--------+--------+--------+--------+--------+--------+
6664
|63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0|
6765
+--------+--------+--------+--------+--------+--------+--------+--------+
68-
| | | | | |
69-
| | | | | v
70-
| | | | | [11:0] in-page offset
71-
| | | | +-> [20:12] L3 index
72-
| | | +-----------> [29:21] L2 index
73-
| | +---------------------> [38:30] L1 index
74-
| +-------------------------------> [47:39] L0 index
75-
+-------------------------------------------------> [63] TTBR0/1
66+
| | | | | |
67+
| | | | | v
68+
| | | | | [11:0] in-page offset
69+
| | | | +-> [20:12] L3 index
70+
| | | +-----------> [29:21] L2 index
71+
| | +---------------------> [38:30] L1 index
72+
| +-------------------------------> [47:39] L0 index
73+
+----------------------------------------> [55] TTBR0/1
7674

7775

7876
Translation table lookup with 64KB pages::
7977

8078
+--------+--------+--------+--------+--------+--------+--------+--------+
8179
|63 56|55 48|47 40|39 32|31 24|23 16|15 8|7 0|
8280
+--------+--------+--------+--------+--------+--------+--------+--------+
83-
| | | | |
84-
| | | | v
85-
| | | | [15:0] in-page offset
86-
| | | +----------> [28:16] L3 index
87-
| | +--------------------------> [41:29] L2 index
88-
| +-------------------------------> [47:42] L1 index (48-bit)
89-
| [51:42] L1 index (52-bit)
90-
+-------------------------------------------------> [63] TTBR0/1
81+
| | | | |
82+
| | | | v
83+
| | | | [15:0] in-page offset
84+
| | | +----------> [28:16] L3 index
85+
| | +--------------------------> [41:29] L2 index
86+
| +-------------------------------> [47:42] L1 index (48-bit)
87+
| [51:42] L1 index (52-bit)
88+
+----------------------------------------> [55] TTBR0/1
9189

9290

9391
When using KVM without the Virtualization Host Extensions, the

0 commit comments

Comments
 (0)