diff options
author | Suzuki K. Poulose <suzuki.poulose@arm.com> | 2015-10-19 09:19:30 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2015-10-19 12:53:26 -0400 |
commit | c265af51c5f17ec5c0cf0d960133bd6fe5f39eb9 (patch) | |
tree | 5eec359c8588aeab79324f7f52e5f0c3b6ae942d | |
parent | 686e783869d37935510b4d2c266948677be82665 (diff) |
arm64: Calculate size for idmap_pg_dir at compile time
Now that we can calculate the number of levels required for
mapping a va width, reserve exact number of pages that would
be required to cover the idmap. The idmap should be able to handle
the maximum physical address size supported.
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Suzuki K. Poulose <suzuki.poulose@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r-- | arch/arm64/include/asm/kernel-pgtable.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/kernel-pgtable.h b/arch/arm64/include/asm/kernel-pgtable.h index 4e08faabd9e4..a459714ee29e 100644 --- a/arch/arm64/include/asm/kernel-pgtable.h +++ b/arch/arm64/include/asm/kernel-pgtable.h | |||
@@ -39,16 +39,19 @@ | |||
39 | * map to pte level. The swapper also maps the FDT (see __create_page_tables | 39 | * map to pte level. The swapper also maps the FDT (see __create_page_tables |
40 | * for more information). Note that the number of ID map translation levels | 40 | * for more information). Note that the number of ID map translation levels |
41 | * could be increased on the fly if system RAM is out of reach for the default | 41 | * could be increased on the fly if system RAM is out of reach for the default |
42 | * VA range, so 3 pages are reserved in all cases. | 42 | * VA range, so pages required to map highest possible PA are reserved in all |
43 | * cases. | ||
43 | */ | 44 | */ |
44 | #if ARM64_SWAPPER_USES_SECTION_MAPS | 45 | #if ARM64_SWAPPER_USES_SECTION_MAPS |
45 | #define SWAPPER_PGTABLE_LEVELS (CONFIG_PGTABLE_LEVELS - 1) | 46 | #define SWAPPER_PGTABLE_LEVELS (CONFIG_PGTABLE_LEVELS - 1) |
47 | #define IDMAP_PGTABLE_LEVELS (ARM64_HW_PGTABLE_LEVELS(PHYS_MASK_SHIFT) - 1) | ||
46 | #else | 48 | #else |
47 | #define SWAPPER_PGTABLE_LEVELS (CONFIG_PGTABLE_LEVELS) | 49 | #define SWAPPER_PGTABLE_LEVELS (CONFIG_PGTABLE_LEVELS) |
50 | #define IDMAP_PGTABLE_LEVELS (ARM64_HW_PGTABLE_LEVELS(PHYS_MASK_SHIFT)) | ||
48 | #endif | 51 | #endif |
49 | 52 | ||
50 | #define SWAPPER_DIR_SIZE (SWAPPER_PGTABLE_LEVELS * PAGE_SIZE) | 53 | #define SWAPPER_DIR_SIZE (SWAPPER_PGTABLE_LEVELS * PAGE_SIZE) |
51 | #define IDMAP_DIR_SIZE (3 * PAGE_SIZE) | 54 | #define IDMAP_DIR_SIZE (IDMAP_PGTABLE_LEVELS * PAGE_SIZE) |
52 | 55 | ||
53 | /* Initial memory map size */ | 56 | /* Initial memory map size */ |
54 | #if ARM64_SWAPPER_USES_SECTION_MAPS | 57 | #if ARM64_SWAPPER_USES_SECTION_MAPS |