Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Pull arm64 fixes from Will Deacon:
"There's no real pattern to the fixes, but the main one fixes our
pmd_leaf() definition to resolve a NULL dereference on the migration
path.

- Fix PMU event validation in the absence of any event counters

- Fix allmodconfig build using clang in conjunction with binutils

- Fix definitions of pXd_leaf() to handle PROT_NONE entries

- More typo fixes"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: mm: fix p?d_leaf()
arm64: fix typos in comments
arm64: Improve HAVE_DYNAMIC_FTRACE_WITH_REGS selection for clang
arm_pmu: Validate single/group leader events

+18 -11
+12 -3
arch/arm64/Kconfig
··· 175 175 select HAVE_DEBUG_KMEMLEAK 176 176 select HAVE_DMA_CONTIGUOUS 177 177 select HAVE_DYNAMIC_FTRACE 178 - select HAVE_DYNAMIC_FTRACE_WITH_REGS \ 179 - if $(cc-option,-fpatchable-function-entry=2) 180 178 select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY \ 181 179 if DYNAMIC_FTRACE_WITH_REGS 182 180 select HAVE_EFFICIENT_UNALIGNED_ACCESS ··· 225 227 select TRACE_IRQFLAGS_SUPPORT 226 228 help 227 229 ARM 64-bit (AArch64) Linux support. 230 + 231 + config CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS 232 + def_bool CC_IS_CLANG 233 + # https://github.com/ClangBuiltLinux/linux/issues/1507 234 + depends on AS_IS_GNU || (AS_IS_LLVM && (LD_IS_LLD || LD_VERSION >= 23600)) 235 + select HAVE_DYNAMIC_FTRACE_WITH_REGS 236 + 237 + config GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS 238 + def_bool CC_IS_GCC 239 + depends on $(cc-option,-fpatchable-function-entry=2) 240 + select HAVE_DYNAMIC_FTRACE_WITH_REGS 228 241 229 242 config 64BIT 230 243 def_bool y ··· 687 678 default y 688 679 help 689 680 This options adds the workaround for ARM Cortex-A510 erratum ARM64_ERRATUM_2051678. 690 - Affected Coretex-A510 might not respect the ordering rules for 681 + Affected Cortex-A510 might not respect the ordering rules for 691 682 hardware update of the page table's dirty bit. The workaround 692 683 is to not enable the feature on affected CPUs. 693 684
+2 -2
arch/arm64/include/asm/pgtable.h
··· 535 535 PMD_TYPE_TABLE) 536 536 #define pmd_sect(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \ 537 537 PMD_TYPE_SECT) 538 - #define pmd_leaf(pmd) pmd_sect(pmd) 538 + #define pmd_leaf(pmd) (pmd_present(pmd) && !pmd_table(pmd)) 539 539 #define pmd_bad(pmd) (!pmd_table(pmd)) 540 540 541 541 #define pmd_leaf_size(pmd) (pmd_cont(pmd) ? CONT_PMD_SIZE : PMD_SIZE) ··· 625 625 #define pud_none(pud) (!pud_val(pud)) 626 626 #define pud_bad(pud) (!pud_table(pud)) 627 627 #define pud_present(pud) pte_present(pud_pte(pud)) 628 - #define pud_leaf(pud) pud_sect(pud) 628 + #define pud_leaf(pud) (pud_present(pud) && !pud_table(pud)) 629 629 #define pud_valid(pud) pte_valid(pud_pte(pud)) 630 630 631 631 static inline void set_pud(pud_t *pudp, pud_t pud)
+4 -6
drivers/perf/arm_pmu.c
··· 400 400 if (!validate_event(event->pmu, &fake_pmu, leader)) 401 401 return -EINVAL; 402 402 403 + if (event == leader) 404 + return 0; 405 + 403 406 for_each_sibling_event(sibling, leader) { 404 407 if (!validate_event(event->pmu, &fake_pmu, sibling)) 405 408 return -EINVAL; ··· 492 489 local64_set(&hwc->period_left, hwc->sample_period); 493 490 } 494 491 495 - if (event->group_leader != event) { 496 - if (validate_group(event) != 0) 497 - return -EINVAL; 498 - } 499 - 500 - return 0; 492 + return validate_group(event); 501 493 } 502 494 503 495 static int armpmu_event_init(struct perf_event *event)