Skip to content

Commit a63f2e7

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: "These are all very simple and self-contained, although the CFI jump-table fix touches the generic linker script as that's where the problematic macro lives. - Fix false positive "sleeping while atomic" warning resulting from the kPTI rework taking a mutex too early. - Fix possible overflow in AMU frequency calculation - Fix incorrect shift in CMN PMU driver which causes problems with newer versions of the IP - Reduce alignment of the CFI jump table to avoid huge kernel images and link errors with !4KiB page size configurations" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: vmlinux.lds.h: CFI: Reduce alignment of jump-table to function alignment perf/arm-cmn: Add more bits to child node address offset field arm64: topology: fix possible overflow in amu_fie_setup() arm64: mm: don't acquire mutex when rewriting swapper
2 parents 1707c39 + 13b0566 commit a63f2e7

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

arch/arm64/kernel/topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static void amu_fie_setup(const struct cpumask *cpus)
237237
for_each_cpu(cpu, cpus) {
238238
if (!freq_counters_valid(cpu) ||
239239
freq_inv_set_max_ratio(cpu,
240-
cpufreq_get_hw_max_freq(cpu) * 1000,
240+
cpufreq_get_hw_max_freq(cpu) * 1000ULL,
241241
arch_timer_get_rate()))
242242
return;
243243
}

arch/arm64/mm/mmu.c

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,6 @@ static void alloc_init_pud(pgd_t *pgdp, unsigned long addr, unsigned long end,
331331
}
332332
BUG_ON(p4d_bad(p4d));
333333

334-
/*
335-
* No need for locking during early boot. And it doesn't work as
336-
* expected with KASLR enabled.
337-
*/
338-
if (system_state != SYSTEM_BOOTING)
339-
mutex_lock(&fixmap_lock);
340334
pudp = pud_set_fixmap_offset(p4dp, addr);
341335
do {
342336
pud_t old_pud = READ_ONCE(*pudp);
@@ -368,15 +362,13 @@ static void alloc_init_pud(pgd_t *pgdp, unsigned long addr, unsigned long end,
368362
} while (pudp++, addr = next, addr != end);
369363

370364
pud_clear_fixmap();
371-
if (system_state != SYSTEM_BOOTING)
372-
mutex_unlock(&fixmap_lock);
373365
}
374366

375-
static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys,
376-
unsigned long virt, phys_addr_t size,
377-
pgprot_t prot,
378-
phys_addr_t (*pgtable_alloc)(int),
379-
int flags)
367+
static void __create_pgd_mapping_locked(pgd_t *pgdir, phys_addr_t phys,
368+
unsigned long virt, phys_addr_t size,
369+
pgprot_t prot,
370+
phys_addr_t (*pgtable_alloc)(int),
371+
int flags)
380372
{
381373
unsigned long addr, end, next;
382374
pgd_t *pgdp = pgd_offset_pgd(pgdir, virt);
@@ -400,8 +392,20 @@ static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys,
400392
} while (pgdp++, addr = next, addr != end);
401393
}
402394

395+
static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys,
396+
unsigned long virt, phys_addr_t size,
397+
pgprot_t prot,
398+
phys_addr_t (*pgtable_alloc)(int),
399+
int flags)
400+
{
401+
mutex_lock(&fixmap_lock);
402+
__create_pgd_mapping_locked(pgdir, phys, virt, size, prot,
403+
pgtable_alloc, flags);
404+
mutex_unlock(&fixmap_lock);
405+
}
406+
403407
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
404-
extern __alias(__create_pgd_mapping)
408+
extern __alias(__create_pgd_mapping_locked)
405409
void create_kpti_ng_temp_pgd(pgd_t *pgdir, phys_addr_t phys, unsigned long virt,
406410
phys_addr_t size, pgprot_t prot,
407411
phys_addr_t (*pgtable_alloc)(int), int flags);

drivers/perf/arm-cmn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#define CMN_CI_CHILD_COUNT GENMASK_ULL(15, 0)
3737
#define CMN_CI_CHILD_PTR_OFFSET GENMASK_ULL(31, 16)
3838

39-
#define CMN_CHILD_NODE_ADDR GENMASK(27, 0)
39+
#define CMN_CHILD_NODE_ADDR GENMASK(29, 0)
4040
#define CMN_CHILD_NODE_EXTERNAL BIT(31)
4141

4242
#define CMN_MAX_DIMENSION 12

include/asm-generic/vmlinux.lds.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,9 @@
543543
*/
544544
#ifdef CONFIG_CFI_CLANG
545545
#define TEXT_CFI_JT \
546-
. = ALIGN(PMD_SIZE); \
546+
ALIGN_FUNCTION(); \
547547
__cfi_jt_start = .; \
548548
*(.text..L.cfi.jumptable .text..L.cfi.jumptable.*) \
549-
. = ALIGN(PMD_SIZE); \
550549
__cfi_jt_end = .;
551550
#else
552551
#define TEXT_CFI_JT

0 commit comments

Comments
 (0)