diff options
Diffstat (limited to 'arch/arm64/include')
-rw-r--r-- | arch/arm64/include/asm/memory.h | 11 | ||||
-rw-r--r-- | arch/arm64/include/asm/pgtable-2level-hwdef.h | 4 | ||||
-rw-r--r-- | arch/arm64/include/asm/pgtable.h | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index 20925bcf4e2a..37762175896f 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h | |||
@@ -33,18 +33,23 @@ | |||
33 | #define UL(x) _AC(x, UL) | 33 | #define UL(x) _AC(x, UL) |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * PAGE_OFFSET - the virtual address of the start of the kernel image. | 36 | * PAGE_OFFSET - the virtual address of the start of the kernel image (top |
37 | * (VA_BITS - 1)) | ||
37 | * VA_BITS - the maximum number of bits for virtual addresses. | 38 | * VA_BITS - the maximum number of bits for virtual addresses. |
38 | * TASK_SIZE - the maximum size of a user space task. | 39 | * TASK_SIZE - the maximum size of a user space task. |
39 | * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area. | 40 | * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area. |
40 | * The module space lives between the addresses given by TASK_SIZE | 41 | * The module space lives between the addresses given by TASK_SIZE |
41 | * and PAGE_OFFSET - it must be within 128MB of the kernel text. | 42 | * and PAGE_OFFSET - it must be within 128MB of the kernel text. |
42 | */ | 43 | */ |
43 | #define PAGE_OFFSET UL(0xffffffc000000000) | 44 | #ifdef CONFIG_ARM64_64K_PAGES |
45 | #define VA_BITS (42) | ||
46 | #else | ||
47 | #define VA_BITS (39) | ||
48 | #endif | ||
49 | #define PAGE_OFFSET (UL(0xffffffffffffffff) << (VA_BITS - 1)) | ||
44 | #define MODULES_END (PAGE_OFFSET) | 50 | #define MODULES_END (PAGE_OFFSET) |
45 | #define MODULES_VADDR (MODULES_END - SZ_64M) | 51 | #define MODULES_VADDR (MODULES_END - SZ_64M) |
46 | #define EARLYCON_IOBASE (MODULES_VADDR - SZ_4M) | 52 | #define EARLYCON_IOBASE (MODULES_VADDR - SZ_4M) |
47 | #define VA_BITS (39) | ||
48 | #define TASK_SIZE_64 (UL(1) << VA_BITS) | 53 | #define TASK_SIZE_64 (UL(1) << VA_BITS) |
49 | 54 | ||
50 | #ifdef CONFIG_COMPAT | 55 | #ifdef CONFIG_COMPAT |
diff --git a/arch/arm64/include/asm/pgtable-2level-hwdef.h b/arch/arm64/include/asm/pgtable-2level-hwdef.h index 0a8ed3f94e93..2593b490c56a 100644 --- a/arch/arm64/include/asm/pgtable-2level-hwdef.h +++ b/arch/arm64/include/asm/pgtable-2level-hwdef.h | |||
@@ -21,10 +21,10 @@ | |||
21 | * 8192 entries of 8 bytes each, occupying a 64KB page. Levels 0 and 1 are not | 21 | * 8192 entries of 8 bytes each, occupying a 64KB page. Levels 0 and 1 are not |
22 | * used. The 2nd level table (PGD for Linux) can cover a range of 4TB, each | 22 | * used. The 2nd level table (PGD for Linux) can cover a range of 4TB, each |
23 | * entry representing 512MB. The user and kernel address spaces are limited to | 23 | * entry representing 512MB. The user and kernel address spaces are limited to |
24 | * 512GB and therefore we only use 1024 entries in the PGD. | 24 | * 4TB in the 64KB page configuration. |
25 | */ | 25 | */ |
26 | #define PTRS_PER_PTE 8192 | 26 | #define PTRS_PER_PTE 8192 |
27 | #define PTRS_PER_PGD 1024 | 27 | #define PTRS_PER_PGD 8192 |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * PGDIR_SHIFT determines the size a top-level page table entry can map. | 30 | * PGDIR_SHIFT determines the size a top-level page table entry can map. |
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index f0bebc5e22cd..17bd3af0a117 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
@@ -33,7 +33,7 @@ | |||
33 | /* | 33 | /* |
34 | * VMALLOC and SPARSEMEM_VMEMMAP ranges. | 34 | * VMALLOC and SPARSEMEM_VMEMMAP ranges. |
35 | */ | 35 | */ |
36 | #define VMALLOC_START UL(0xffffff8000000000) | 36 | #define VMALLOC_START (UL(0xffffffffffffffff) << VA_BITS) |
37 | #define VMALLOC_END (PAGE_OFFSET - UL(0x400000000) - SZ_64K) | 37 | #define VMALLOC_END (PAGE_OFFSET - UL(0x400000000) - SZ_64K) |
38 | 38 | ||
39 | #define vmemmap ((struct page *)(VMALLOC_END + SZ_64K)) | 39 | #define vmemmap ((struct page *)(VMALLOC_END + SZ_64K)) |