History

Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull EFI fixes from Ingo Molnar: "This tree reverts a GICv3 commit (which was broken) and fixes it in another way, by adding a memblock build-time entries quirk for ARM64" * 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi/arm: Revert "Defer persistent reservations until after paging_init()" arm64, mm, efi: Account for GICv3 LPI tables in static memblock reserve table

Linus Torvalds committed 7 years ago

Commit 2fee0362 parents 8d33316 582a32e7 files · +20 −20Browse files

Unified · Split

7 files
  1. arch/arm64/include/asm/memory.h +11 −0
  2. arch/arm64/kernel/setup.c +0 −1
  3. drivers/firmware/efi/efi.c +0 −4
  4. drivers/firmware/efi/libstub/arm-stub.c +0 −3
  5. include/linux/efi.h +0 −7
  6. include/linux/memblock.h +0 −3
  7. mm/memblock.c +9 −2
arch/arm64/include/asm/memory.h+11−0
@@ -332,6 +332,17 @@ static inline void *phys_to_virt(phys_addr_t x) · 331 unmodified lines
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#endif348#endif
arch/arm64/kernel/setup.c+0−1
@@ -313,7 +313,6 @@ void __init setup_arch(char **cmdline_p) · 312 unmodified lines
313 arm64_memblock_init();313 arm64_memblock_init();
314 314
315 paging_init();315 paging_init();
316 efi_apply_persistent_mem_reservations();
317 316
318 acpi_table_upgrade();317 acpi_table_upgrade();
319 318
drivers/firmware/efi/efi.c+0−4
@@ -592,11 +592,7 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz, · 591 unmodified lines
592 592
593 early_memunmap(tbl, sizeof(*tbl));593 early_memunmap(tbl, sizeof(*tbl));
594 }594 }
595 return 0;
596}
597 595
598int __init efi_apply_persistent_mem_reservations(void)
599{
600 if (efi.mem_reserve != EFI_INVALID_TABLE_ADDR) {596 if (efi.mem_reserve != EFI_INVALID_TABLE_ADDR) {
601 unsigned long prsv = efi.mem_reserve;597 unsigned long prsv = efi.mem_reserve;
602 598
drivers/firmware/efi/libstub/arm-stub.c+0−3
@@ -75,9 +75,6 @@ void install_memreserve_table(efi_system_table_t *sys_table_arg) · 74 unmodified lines
75 efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID;75 efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID;
76 efi_status_t status;76 efi_status_t status;
77 77
78 if (IS_ENABLED(CONFIG_ARM))
79 return;
80
81 status = efi_call_early(allocate_pool, EFI_LOADER_DATA, sizeof(*rsv),78 status = efi_call_early(allocate_pool, EFI_LOADER_DATA, sizeof(*rsv),
82 (void **)&rsv);79 (void **)&rsv);
83 if (status != EFI_SUCCESS) {80 if (status != EFI_SUCCESS) {
include/linux/efi.h+0−7
@@ -1198,8 +1198,6 @@ static inline bool efi_enabled(int feature) · 1197 unmodified lines
1198extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);1198extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
1199 1199
1200extern bool efi_is_table_address(unsigned long phys_addr);1200extern bool efi_is_table_address(unsigned long phys_addr);
1201
1202extern int efi_apply_persistent_mem_reservations(void);
1203#else1201#else
1204static inline bool efi_enabled(int feature)1202static inline bool efi_enabled(int feature)
1205{1203{
@@ -1218,11 +1216,6 @@ static inline bool efi_is_table_address(unsigned long phys_addr) · 12 unmodified lines
1218{1216{
1219 return false;1217 return false;
1220}1218}
1221
1222static inline int efi_apply_persistent_mem_reservations(void)
1223{
1224 return 0;
1225}
1226#endif1219#endif
1227 1220
1228extern int efi_status_to_err(efi_status_t status);1221extern int efi_status_to_err(efi_status_t status);
include/linux/memblock.h+0−3
@@ -29,9 +29,6 @@ extern unsigned long max_pfn; · 28 unmodified lines
29 */29 */
30extern unsigned long long max_possible_pfn;30extern 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 attributes33 * enum memblock_flags - definition of memory region attributes
37 * @MEMBLOCK_NONE: no special request34 * @MEMBLOCK_NONE: no special request
mm/memblock.c+9−2
@@ -26,6 +26,13 @@ · 25 unmodified lines
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 overview37 * DOC: memblock overview
31 *38 *
@@ -92,7 +99,7 @@ unsigned long max_pfn; · 60 unmodified lines
92unsigned long long max_possible_pfn;99unsigned long long max_possible_pfn;
93 100
94static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock;101static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock;
95static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS] __initdata_memblock;102static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_RESERVED_REGIONS] __initdata_memblock;
96#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP103#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP
97static struct memblock_region memblock_physmem_init_regions[INIT_PHYSMEM_REGIONS] __initdata_memblock;104static struct memblock_region memblock_physmem_init_regions[INIT_PHYSMEM_REGIONS] __initdata_memblock;
98#endif105#endif
@@ -105,7 +112,7 @@ struct memblock memblock __initdata_memblock = { · 6 unmodified lines
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_MAP118#ifdef CONFIG_HAVE_MEMBLOCK_PHYS_MAP