diff options
| -rw-r--r-- | arch/arm64/include/asm/memory.h | 11 | ||||
| -rw-r--r-- | include/linux/memblock.h | 3 | ||||
| -rw-r--r-- | mm/memblock.c | 11 |
3 files changed, 20 insertions, 5 deletions
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index e1ec947e7c0c..0c656850eeea 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h | |||
| @@ -332,6 +332,17 @@ static inline void *phys_to_virt(phys_addr_t x) | |||
| 332 | #define virt_addr_valid(kaddr) \ | 332 | #define virt_addr_valid(kaddr) \ |
| 333 | (_virt_addr_is_linear(kaddr) && _virt_addr_valid(kaddr)) | 333 | (_virt_addr_is_linear(kaddr) && _virt_addr_valid(kaddr)) |
| 334 | 334 | ||
| 335 | /* | ||
| 336 | * Given that the GIC architecture permits ITS implementations that can only be | ||
| 337 | * configured with a LPI table address once, GICv3 systems with many CPUs may | ||
| 338 | * end up reserving a lot of different regions after a kexec for their LPI | ||
| 339 | * tables (one per CPU), as we are forced to reuse the same memory after kexec | ||
| 340 | * (and thus reserve it persistently with EFI beforehand) | ||
| 341 | */ | ||
| 342 | #if defined(CONFIG_EFI) && defined(CONFIG_ARM_GIC_V3_ITS) | ||
| 343 | # define INIT_MEMBLOCK_RESERVED_REGIONS (INIT_MEMBLOCK_REGIONS + NR_CPUS + 1) | ||
| 344 | #endif | ||
| 345 | |||
| 335 | #include <asm-generic/memory_model.h> | 346 | #include <asm-generic/memory_model.h> |
| 336 | 347 | ||
| 337 | #endif | 348 | #endif |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 64c41cf45590..859b55b66db2 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
| @@ -29,9 +29,6 @@ extern unsigned long max_pfn; | |||
| 29 | */ | 29 | */ |
| 30 | extern unsigned long long max_possible_pfn; | 30 | extern unsigned long long max_possible_pfn; |
| 31 | 31 | ||
| 32 | #define INIT_MEMBLOCK_REGIONS 128 | ||
| 33 | #define INIT_PHYSMEM_REGIONS 4 | ||
| 34 | |||
| 35 | /** | 32 | /** |
| 36 | * enum memblock_flags - definition of memory region attributes | 33 | * enum memblock_flags - definition of memory region attributes |
| 37 | * @MEMBLOCK_NONE: no special request | 34 | * @MEMBLOCK_NONE: no special request |
diff --git a/mm/memblock.c b/mm/memblock.c index 022d4cbb3618..ea31045ba704 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
| @@ -26,6 +26,13 @@ | |||
| 26 | 26 | ||
| 27 | #include "internal.h" | 27 | #include "internal.h" |
| 28 | 28 | ||
| 29 | #define INIT_MEMBLOCK_REGIONS 128 | ||
| 30 | #define INIT_PHYSMEM_REGIONS 4 | ||
| 31 | |||
| 32 | #ifndef INIT_MEMBLOCK_RESERVED_REGIONS | ||
| 33 | # define INIT_MEMBLOCK_RESERVED_REGIONS INIT_MEMBLOCK_REGIONS | ||
| 34 | #endif | ||
| 35 | |||
| 29 | /** | 36 | /** |
| 30 | * DOC: memblock overview | 37 | * DOC: memblock overview |
| 31 | * | 38 | * |
| @@ -92,7 +99,7 @@ unsigned long max_pfn; | |||
| 92 | unsigned long long max_possible_pfn; | 99 | unsigned long long max_possible_pfn; |
| 93 | 100 | ||
| 94 | static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; | 101 | static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; |
| 95 | static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock; | 102 | static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_RESERVED_REGIONS] __initdata_memblock; |
| 96 | #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP | 103 | #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP |
| 97 | static struct memblock_region memblock_physmem_init_regions[INIT_PHYSMEM_REGIONS] __initdata_memblock; | 104 | static struct memblock_region memblock_physmem_init_regions[INIT_PHYSMEM_REGIONS] __initdata_memblock; |
| 98 | #endif | 105 | #endif |
| @@ -105,7 +112,7 @@ struct memblock memblock __initdata_memblock = { | |||
| 105 | 112 | ||
| 106 | .reserved.regions = memblock_reserved_init_regions, | 113 | .reserved.regions = memblock_reserved_init_regions, |
| 107 | .reserved.cnt = 1, /* empty dummy entry */ | 114 | .reserved.cnt = 1, /* empty dummy entry */ |
| 108 | .reserved.max = INIT_MEMBLOCK_REGIONS, | 115 | .reserved.max = INIT_MEMBLOCK_RESERVED_REGIONS, |
| 109 | .reserved.name = "reserved", | 116 | .reserved.name = "reserved", |
| 110 | 117 | ||
| 111 | #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP | 118 | #ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP |
