History

Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux

Pull arm64 fixes from Will Deacon: "It's a lot smaller than last week, with the star of the show being a couple of fixes to head.S addressing a boot regression introduced by the recent overhaul of that code in non-default configurations (i.e. KASLR disabled). The first of those two resolves the issue reported (and bisected) by Mikulus in the wait_on_bit() thread. Summary: - Fix two boot issues caused by the recent head.S rework when !KASLR - Fix calculation of crashkernel memory reservation - Fix bogus error check in PMU IRQ probing code" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: mm: Reserve enough pages for the initial ID map perf/arm_pmu_platform: fix tests for platform_get_irq() failure arm64: head: Ignore bogus KASLR displacement on non-relocatable kernels arm64/kexec: Fix missing extra range for crashkres_low.

Linus Torvalds committed 4 years ago

Commit cf3488f2 parents 42e66b1 5fbc49c4 files · +17 −15Browse files

Unified · Split

4 files
  1. arch/arm64/include/asm/kernel-pgtable.h +13 −13
  2. arch/arm64/kernel/head.S +2 −0
  3. arch/arm64/kernel/machine_kexec_file.c +1 −1
  4. drivers/perf/arm_pmu_platform.c +1 −1
arch/arm64/include/asm/kernel-pgtable.h+13−13
@@ -64,28 +64,28 @@ · 63 unmodified lines
64#define EARLY_KASLR (0)64#define EARLY_KASLR (0)
65#endif65#endif
66 66
67#define EARLY_ENTRIES(vstart, vend, shift) \67#define EARLY_ENTRIES(vstart, vend, shift, add) \
68 ((((vend) - 1) >> (shift)) - ((vstart) >> (shift)) + 1 + EARLY_KASLR)68 ((((vend) - 1) >> (shift)) - ((vstart) >> (shift)) + 1 + add)
69 69
70#define EARLY_PGDS(vstart, vend) (EARLY_ENTRIES(vstart, vend, PGDIR_SHIFT))70#define EARLY_PGDS(vstart, vend, add) (EARLY_ENTRIES(vstart, vend, PGDIR_SHIFT, add))
71 71
72#if SWAPPER_PGTABLE_LEVELS > 372#if SWAPPER_PGTABLE_LEVELS > 3
73#define EARLY_PUDS(vstart, vend) (EARLY_ENTRIES(vstart, vend, PUD_SHIFT))73#define EARLY_PUDS(vstart, vend, add) (EARLY_ENTRIES(vstart, vend, PUD_SHIFT, add))
74#else74#else
75#define EARLY_PUDS(vstart, vend) (0)75#define EARLY_PUDS(vstart, vend, add) (0)
76#endif76#endif
77 77
78#if SWAPPER_PGTABLE_LEVELS > 278#if SWAPPER_PGTABLE_LEVELS > 2
79#define EARLY_PMDS(vstart, vend) (EARLY_ENTRIES(vstart, vend, SWAPPER_TABLE_SHIFT))79#define EARLY_PMDS(vstart, vend, add) (EARLY_ENTRIES(vstart, vend, SWAPPER_TABLE_SHIFT, add))
80#else80#else
81#define EARLY_PMDS(vstart, vend) (0)81#define EARLY_PMDS(vstart, vend, add) (0)
82#endif82#endif
83 83
84#define EARLY_PAGES(vstart, vend) ( 1 /* PGDIR page */ \84#define EARLY_PAGES(vstart, vend, add) ( 1 /* PGDIR page */ \
85 + EARLY_PGDS((vstart), (vend)) /* each PGDIR needs a next level page table */ \85 + EARLY_PGDS((vstart), (vend), add) /* each PGDIR needs a next level page table */ \
86 + EARLY_PUDS((vstart), (vend)) /* each PUD needs a next level page table */ \86 + EARLY_PUDS((vstart), (vend), add) /* each PUD needs a next level page table */ \
87 + EARLY_PMDS((vstart), (vend))) /* each PMD needs a next level page table */87 + EARLY_PMDS((vstart), (vend), add)) /* each PMD needs a next level page table */
88#define INIT_DIR_SIZE (PAGE_SIZE * EARLY_PAGES(KIMAGE_VADDR, _end))88#define INIT_DIR_SIZE (PAGE_SIZE * EARLY_PAGES(KIMAGE_VADDR, _end, EARLY_KASLR))
89 89
90/* the initial ID map may need two extra pages if it needs to be extended */90/* the initial ID map may need two extra pages if it needs to be extended */
91#if VA_BITS < 4891#if VA_BITS < 48
@@ -93,7 +93,7 @@ · 1 unmodified line
93#else93#else
94#define INIT_IDMAP_DIR_SIZE (INIT_IDMAP_DIR_PAGES * PAGE_SIZE)94#define INIT_IDMAP_DIR_SIZE (INIT_IDMAP_DIR_PAGES * PAGE_SIZE)
95#endif95#endif
96#define INIT_IDMAP_DIR_PAGES EARLY_PAGES(KIMAGE_VADDR, _end + MAX_FDT_SIZE + SWAPPER_BLOCK_SIZE)96#define INIT_IDMAP_DIR_PAGES EARLY_PAGES(KIMAGE_VADDR, _end + MAX_FDT_SIZE + SWAPPER_BLOCK_SIZE, 1)
97 97
98/* Initial memory map size */98/* Initial memory map size */
99#if ARM64_KERNEL_USES_PMD_MAPS99#if ARM64_KERNEL_USES_PMD_MAPS
arch/arm64/kernel/head.S+2−0
@@ -371,7 +371,9 @@ SYM_FUNC_END(create_idmap) · 370 unmodified lines
371SYM_FUNC_START_LOCAL(create_kernel_mapping)371SYM_FUNC_START_LOCAL(create_kernel_mapping)
372 adrp x0, init_pg_dir372 adrp x0, init_pg_dir
373 mov_q x5, KIMAGE_VADDR // compile time __va(_text)373 mov_q x5, KIMAGE_VADDR // compile time __va(_text)
374#ifdef CONFIG_RELOCATABLE
374 add x5, x5, x23 // add KASLR displacement375 add x5, x5, x23 // add KASLR displacement
376#endif
375 adrp x6, _end // runtime __pa(_end)377 adrp x6, _end // runtime __pa(_end)
376 adrp x3, _text // runtime __pa(_text)378 adrp x3, _text // runtime __pa(_text)
377 sub x6, x6, x3 // _end - _text379 sub x6, x6, x3 // _end - _text
arch/arm64/kernel/machine_kexec_file.c+1−1
@@ -47,7 +47,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz) · 46 unmodified lines
47 u64 i;47 u64 i;
48 phys_addr_t start, end;48 phys_addr_t start, end;
49 49
50 nr_ranges = 1; /* for exclusion of crashkernel region */50 nr_ranges = 2; /* for exclusion of crashkernel region */
51 for_each_mem_range(i, &start, &end)51 for_each_mem_range(i, &start, &end)
52 nr_ranges++;52 nr_ranges++;
53 53
drivers/perf/arm_pmu_platform.c+1−1
@@ -117,7 +117,7 @@ static int pmu_parse_irqs(struct arm_pmu *pmu) · 116 unmodified lines
117 117
118 if (num_irqs == 1) {118 if (num_irqs == 1) {
119 int irq = platform_get_irq(pdev, 0);119 int irq = platform_get_irq(pdev, 0);
120 if (irq && irq_is_percpu_devid(irq))120 if ((irq > 0) && irq_is_percpu_devid(irq))
121 return pmu_parse_percpu_irq(pmu, irq);121 return pmu_parse_percpu_irq(pmu, irq);
122 }122 }
123 123

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t