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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull more arm64 updates from Catalin Marinas:
"A mix of fixes and clean-ups that turned up too late for the first
pull request:

- Restore terminal stack frame records. Their previous removal caused
traces which cross secondary_start_kernel to terminate one entry
too late, with a spurious "0" entry.

- Fix boot warning with pseudo-NMI due to the way we manipulate the
PMR register.

- ACPI fixes: avoid corruption of interrupt mappings on watchdog
probe failure (GTDT), prevent unregistering of GIC SGIs.

- Force SPARSEMEM_VMEMMAP as the only memory model, it saves with
having to test all the other combinations.

- Documentation fixes and updates: tagged address ABI exceptions on
brk/mmap/mremap(), event stream frequency, update booting
requirements on the configuration of traps"

* tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
arm64: kernel: Update the stale comment
arm64: Fix the documented event stream frequency
arm64: entry: always set GIC_PRIO_PSR_I_SET during entry
arm64: Explicitly document boot requirements for SVE
arm64: Explicitly require that FPSIMD instructions do not trap
arm64: Relax booting requirements for configuration of traps
arm64: cpufeatures: use min and max
arm64: stacktrace: restore terminal records
arm64/vdso: Discard .note.gnu.property sections in vDSO
arm64: doc: Add brk/mmap/mremap() to the Tagged Address ABI Exceptions
psci: Remove unneeded semicolon
ACPI: irq: Prevent unregistering of GIC SGIs
ACPI: GTDT: Don't corrupt interrupt mappings on watchdow probe failure
arm64: Show three registers per line
arm64: remove HAVE_DEBUG_BUGVERBOSE
arm64: alternative: simplify passing alt_region
arm64: Force SPARSEMEM_VMEMMAP as the only memory management model
arm64: vdso32: drop -no-integrated-as flag

+87 -92
+32 -1
Documentation/arm64/booting.rst
··· 277 277 278 278 - SCR_EL3.FGTEn (bit 27) must be initialised to 0b1. 279 279 280 + For CPUs with Advanced SIMD and floating point support: 281 + 282 + - If EL3 is present: 283 + 284 + - CPTR_EL3.TFP (bit 10) must be initialised to 0b0. 285 + 286 + - If EL2 is present and the kernel is entered at EL1: 287 + 288 + - CPTR_EL2.TFP (bit 10) must be initialised to 0b0. 289 + 290 + For CPUs with the Scalable Vector Extension (FEAT_SVE) present: 291 + 292 + - if EL3 is present: 293 + 294 + - CPTR_EL3.EZ (bit 8) must be initialised to 0b1. 295 + 296 + - ZCR_EL3.LEN must be initialised to the same value for all CPUs the 297 + kernel is executed on. 298 + 299 + - If the kernel is entered at EL1 and EL2 is present: 300 + 301 + - CPTR_EL2.TZ (bit 8) must be initialised to 0b0. 302 + 303 + - CPTR_EL2.ZEN (bits 17:16) must be initialised to 0b11. 304 + 305 + - ZCR_EL2.LEN must be initialised to the same value for all CPUs the 306 + kernel will execute on. 307 + 280 308 The requirements described above for CPU mode, caches, MMUs, architected 281 309 timers, coherency and system registers apply to all CPUs. All CPUs must 282 - enter the kernel in the same exception level. 310 + enter the kernel in the same exception level. Where the values documented 311 + disable traps it is permissible for these traps to be enabled so long as 312 + those traps are handled transparently by higher exception levels as though 313 + the values documented were set. 283 314 284 315 The boot loader is expected to enter the kernel on each CPU in the 285 316 following manner:
+1 -1
Documentation/arm64/elf_hwcaps.rst
··· 74 74 75 75 HWCAP_EVTSTRM 76 76 The generic timer is configured to generate events at a frequency of 77 - approximately 100KHz. 77 + approximately 10KHz. 78 78 79 79 HWCAP_AES 80 80 Functionality implied by ID_AA64ISAR0_EL1.AES == 0b0001.
+6
Documentation/arm64/tagged-address-abi.rst
··· 113 113 114 114 - ``shmat()`` and ``shmdt()``. 115 115 116 + - ``brk()`` (since kernel v5.6). 117 + 118 + - ``mmap()`` (since kernel v5.6). 119 + 120 + - ``mremap()``, the ``new_address`` argument (since kernel v5.6). 121 + 116 122 Any attempt to use non-zero tagged pointers may result in an error code 117 123 being returned, a (fatal) signal being raised, or other modes of 118 124 failure.
+1 -10
arch/arm64/Kconfig
··· 170 170 select HAVE_CMPXCHG_DOUBLE 171 171 select HAVE_CMPXCHG_LOCAL 172 172 select HAVE_CONTEXT_TRACKING 173 - select HAVE_DEBUG_BUGVERBOSE 174 173 select HAVE_DEBUG_KMEMLEAK 175 174 select HAVE_DMA_CONTIGUOUS 176 175 select HAVE_DYNAMIC_FTRACE ··· 1060 1061 config ARCH_SPARSEMEM_ENABLE 1061 1062 def_bool y 1062 1063 select SPARSEMEM_VMEMMAP_ENABLE 1063 - 1064 - config ARCH_SPARSEMEM_DEFAULT 1065 - def_bool ARCH_SPARSEMEM_ENABLE 1066 - 1067 - config ARCH_SELECT_MEMORY_MODEL 1068 - def_bool ARCH_SPARSEMEM_ENABLE 1069 - 1070 - config ARCH_FLATMEM_ENABLE 1071 - def_bool !NUMA 1064 + select SPARSEMEM_VMEMMAP 1072 1065 1073 1066 config HW_PERF_EVENTS 1074 1067 def_bool y
+3
arch/arm64/include/asm/daifflags.h
··· 131 131 if (interrupts_enabled(regs)) 132 132 trace_hardirqs_on(); 133 133 134 + if (system_uses_irq_prio_masking()) 135 + gic_write_pmr(regs->pmr_save); 136 + 134 137 /* 135 138 * We can't use local_daif_restore(regs->pstate) here as 136 139 * system_has_prio_mask_debugging() won't restore the I bit if it can
+1 -1
arch/arm64/include/asm/kernel-pgtable.h
··· 136 136 * has a direct correspondence, and needs to appear sufficiently aligned 137 137 * in the virtual address space. 138 138 */ 139 - #if defined(CONFIG_SPARSEMEM_VMEMMAP) && ARM64_MEMSTART_SHIFT < SECTION_SIZE_BITS 139 + #if ARM64_MEMSTART_SHIFT < SECTION_SIZE_BITS 140 140 #define ARM64_MEMSTART_ALIGN (1UL << SECTION_SIZE_BITS) 141 141 #else 142 142 #define ARM64_MEMSTART_ALIGN (1UL << ARM64_MEMSTART_SHIFT)
+2 -2
arch/arm64/include/asm/memory.h
··· 345 345 */ 346 346 #define ARCH_PFN_OFFSET ((unsigned long)PHYS_PFN_OFFSET) 347 347 348 - #if !defined(CONFIG_SPARSEMEM_VMEMMAP) || defined(CONFIG_DEBUG_VIRTUAL) 348 + #if defined(CONFIG_DEBUG_VIRTUAL) 349 349 #define page_to_virt(x) ({ \ 350 350 __typeof__(x) __page = x; \ 351 351 void *__addr = __va(page_to_phys(__page)); \ ··· 365 365 u64 __addr = VMEMMAP_START + (__idx * sizeof(struct page)); \ 366 366 (struct page *)__addr; \ 367 367 }) 368 - #endif /* !CONFIG_SPARSEMEM_VMEMMAP || CONFIG_DEBUG_VIRTUAL */ 368 + #endif /* CONFIG_DEBUG_VIRTUAL */ 369 369 370 370 #define virt_addr_valid(addr) ({ \ 371 371 __typeof__(addr) __addr = __tag_reset(addr); \
-3
arch/arm64/include/asm/sparsemem.h
··· 5 5 #ifndef __ASM_SPARSEMEM_H 6 6 #define __ASM_SPARSEMEM_H 7 7 8 - #ifdef CONFIG_SPARSEMEM 9 8 #define MAX_PHYSMEM_BITS CONFIG_ARM64_PA_BITS 10 9 11 10 /* ··· 25 26 */ 26 27 #define SECTION_SIZE_BITS 27 27 28 #endif /* CONFIG_ARM64_64K_PAGES */ 28 - 29 - #endif /* CONFIG_SPARSEMEM*/ 30 29 31 30 #endif
+2 -3
arch/arm64/kernel/alternative.c
··· 133 133 } while (cur += d_size, cur < end); 134 134 } 135 135 136 - static void __nocfi __apply_alternatives(void *alt_region, bool is_module, 137 - unsigned long *feature_mask) 136 + static void __nocfi __apply_alternatives(struct alt_region *region, bool is_module, 137 + unsigned long *feature_mask) 138 138 { 139 139 struct alt_instr *alt; 140 - struct alt_region *region = alt_region; 141 140 __le32 *origptr, *updptr; 142 141 alternative_cb_t alt_cb; 143 142
+3 -2
arch/arm64/kernel/cpufeature.c
··· 68 68 #include <linux/sort.h> 69 69 #include <linux/stop_machine.h> 70 70 #include <linux/types.h> 71 + #include <linux/minmax.h> 71 72 #include <linux/mm.h> 72 73 #include <linux/cpu.h> 73 74 #include <linux/kasan.h> ··· 695 694 ret = ftrp->safe_val; 696 695 break; 697 696 case FTR_LOWER_SAFE: 698 - ret = new < cur ? new : cur; 697 + ret = min(new, cur); 699 698 break; 700 699 case FTR_HIGHER_OR_ZERO_SAFE: 701 700 if (!cur || !new) 702 701 break; 703 702 fallthrough; 704 703 case FTR_HIGHER_SAFE: 705 - ret = new > cur ? new : cur; 704 + ret = max(new, cur); 706 705 break; 707 706 default: 708 707 BUG();
+1 -1
arch/arm64/kernel/cpuidle.c
··· 29 29 30 30 /** 31 31 * arm_cpuidle_suspend() - function to enter a low-power idle state 32 - * @arg: argument to pass to CPU suspend operations 32 + * @index: argument to pass to CPU suspend operations 33 33 * 34 34 * Return: 0 on success, -EOPNOTSUPP if CPU suspend hook not initialized, CPU 35 35 * operations back-end error code otherwise.
-17
arch/arm64/kernel/entry-common.c
··· 230 230 { 231 231 unsigned long far = read_sysreg(far_el1); 232 232 233 - /* 234 - * The CPU masked interrupts, and we are leaving them masked during 235 - * do_debug_exception(). Update PMR as if we had called 236 - * local_daif_mask(). 237 - */ 238 - if (system_uses_irq_prio_masking()) 239 - gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET); 240 - 241 233 arm64_enter_el1_dbg(regs); 242 234 if (!cortex_a76_erratum_1463225_debug_handler(regs)) 243 235 do_debug_exception(far, esr, regs); ··· 396 404 /* Only watchpoints write FAR_EL1, otherwise its UNKNOWN */ 397 405 unsigned long far = read_sysreg(far_el1); 398 406 399 - if (system_uses_irq_prio_masking()) 400 - gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET); 401 - 402 407 enter_from_user_mode(); 403 408 do_debug_exception(far, esr, regs); 404 409 local_daif_restore(DAIF_PROCCTX_NOIRQ); ··· 403 414 404 415 static void noinstr el0_svc(struct pt_regs *regs) 405 416 { 406 - if (system_uses_irq_prio_masking()) 407 - gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET); 408 - 409 417 enter_from_user_mode(); 410 418 cortex_a76_erratum_1463225_svc_handler(); 411 419 do_el0_svc(regs); ··· 478 492 479 493 static void noinstr el0_svc_compat(struct pt_regs *regs) 480 494 { 481 - if (system_uses_irq_prio_masking()) 482 - gic_write_pmr(GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET); 483 - 484 495 enter_from_user_mode(); 485 496 cortex_a76_erratum_1463225_svc_handler(); 486 497 do_el0_svc_compat(regs);
+5 -16
arch/arm64/kernel/entry.S
··· 285 285 stp lr, x21, [sp, #S_LR] 286 286 287 287 /* 288 - * For exceptions from EL0, terminate the callchain here. 288 + * For exceptions from EL0, create a terminal frame record. 289 289 * For exceptions from EL1, create a synthetic frame record so the 290 290 * interrupted code shows up in the backtrace. 291 291 */ 292 292 .if \el == 0 293 - mov x29, xzr 293 + stp xzr, xzr, [sp, #S_STACKFRAME] 294 294 .else 295 295 stp x29, x22, [sp, #S_STACKFRAME] 296 - add x29, sp, #S_STACKFRAME 297 296 .endif 297 + add x29, sp, #S_STACKFRAME 298 298 299 299 #ifdef CONFIG_ARM64_SW_TTBR0_PAN 300 300 alternative_if_not ARM64_HAS_PAN ··· 314 314 alternative_if ARM64_HAS_IRQ_PRIO_MASKING 315 315 mrs_s x20, SYS_ICC_PMR_EL1 316 316 str x20, [sp, #S_PMR_SAVE] 317 + mov x20, #GIC_PRIO_IRQON | GIC_PRIO_PSR_I_SET 318 + msr_s SYS_ICC_PMR_EL1, x20 317 319 alternative_else_nop_endif 318 320 319 321 /* Re-enable tag checking (TCO set on exception entry) */ ··· 552 550 #endif 553 551 .endm 554 552 555 - .macro gic_prio_irq_setup, pmr:req, tmp:req 556 - #ifdef CONFIG_ARM64_PSEUDO_NMI 557 - alternative_if ARM64_HAS_IRQ_PRIO_MASKING 558 - orr \tmp, \pmr, #GIC_PRIO_PSR_I_SET 559 - msr_s SYS_ICC_PMR_EL1, \tmp 560 - alternative_else_nop_endif 561 - #endif 562 - .endm 563 - 564 553 .macro el1_interrupt_handler, handler:req 565 - gic_prio_irq_setup pmr=x20, tmp=x1 566 554 enable_da 567 555 568 556 mov x0, sp ··· 582 590 .endm 583 591 584 592 .macro el0_interrupt_handler, handler:req 585 - gic_prio_irq_setup pmr=x20, tmp=x0 586 593 user_exit_irqoff 587 594 enable_da 588 595 ··· 779 788 SYM_CODE_START_LOCAL(el1_error) 780 789 kernel_entry 1 781 790 mrs x1, esr_el1 782 - gic_prio_kentry_setup tmp=x2 783 791 enable_dbg 784 792 mov x0, sp 785 793 bl do_serror ··· 789 799 kernel_entry 0 790 800 el0_error_naked: 791 801 mrs x25, esr_el1 792 - gic_prio_kentry_setup tmp=x2 793 802 user_exit_irqoff 794 803 enable_dbg 795 804 mov x0, sp
+3 -6
arch/arm64/kernel/process.c
··· 294 294 i = top_reg; 295 295 296 296 while (i >= 0) { 297 - printk("x%-2d: %016llx ", i, regs->regs[i]); 298 - i--; 297 + printk("x%-2d: %016llx", i, regs->regs[i]); 299 298 300 - if (i % 2 == 0) { 301 - pr_cont("x%-2d: %016llx ", i, regs->regs[i]); 302 - i--; 303 - } 299 + while (i-- % 3) 300 + pr_cont(" x%-2d: %016llx", i, regs->regs[i]); 304 301 305 302 pr_cont("\n"); 306 303 }
+6 -4
arch/arm64/kernel/stacktrace.c
··· 68 68 unsigned long fp = frame->fp; 69 69 struct stack_info info; 70 70 71 - /* Terminal record; nothing to unwind */ 72 - if (!fp) 73 - return -ENOENT; 74 - 75 71 if (fp & 0xf) 76 72 return -EINVAL; 77 73 ··· 127 131 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 128 132 129 133 frame->pc = ptrauth_strip_insn_pac(frame->pc); 134 + 135 + /* 136 + * This is a terminal record, so we have finished unwinding. 137 + */ 138 + if (!frame->fp && !frame->pc) 139 + return -ENOENT; 130 140 131 141 return 0; 132 142 }
+7 -1
arch/arm64/kernel/vdso/vdso.lds.S
··· 31 31 .gnu.version_d : { *(.gnu.version_d) } 32 32 .gnu.version_r : { *(.gnu.version_r) } 33 33 34 + /* 35 + * Discard .note.gnu.property sections which are unused and have 36 + * different alignment requirement from vDSO note sections. 37 + */ 38 + /DISCARD/ : { 39 + *(.note.GNU-stack .note.gnu.property) 40 + } 34 41 .note : { *(.note.*) } :text :note 35 42 36 43 . = ALIGN(16); ··· 55 48 PROVIDE(end = .); 56 49 57 50 /DISCARD/ : { 58 - *(.note.GNU-stack) 59 51 *(.data .data.* .gnu.linkonce.d.* .sdata*) 60 52 *(.bss .sbss .dynbss .dynsbss) 61 53 *(.eh_frame .eh_frame_hdr)
-8
arch/arm64/kernel/vdso32/Makefile
··· 10 10 11 11 # Same as cc-*option, but using CC_COMPAT instead of CC 12 12 ifeq ($(CONFIG_CC_IS_CLANG), y) 13 - COMPAT_GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE_COMPAT)elfedit)) 14 - COMPAT_GCC_TOOLCHAIN := $(realpath $(COMPAT_GCC_TOOLCHAIN_DIR)/..) 15 - 16 13 CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%)) 17 - CC_COMPAT_CLANG_FLAGS += --prefix=$(COMPAT_GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE_COMPAT)) 18 - CC_COMPAT_CLANG_FLAGS += -no-integrated-as -Qunused-arguments 19 - ifneq ($(COMPAT_GCC_TOOLCHAIN),) 20 - CC_COMPAT_CLANG_FLAGS += --gcc-toolchain=$(COMPAT_GCC_TOOLCHAIN) 21 - endif 22 14 23 15 CC_COMPAT ?= $(CC) 24 16 CC_COMPAT += $(CC_COMPAT_CLANG_FLAGS)
+2 -6
arch/arm64/mm/init.c
··· 221 221 int pfn_valid(unsigned long pfn) 222 222 { 223 223 phys_addr_t addr = PFN_PHYS(pfn); 224 + struct mem_section *ms; 224 225 225 226 /* 226 227 * Ensure the upper PAGE_SHIFT bits are clear in the ··· 231 230 */ 232 231 if (PHYS_PFN(addr) != pfn) 233 232 return 0; 234 - 235 - #ifdef CONFIG_SPARSEMEM 236 - { 237 - struct mem_section *ms; 238 233 239 234 if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) 240 235 return 0; ··· 250 253 */ 251 254 if (!early_section(ms)) 252 255 return pfn_section_valid(ms, pfn); 253 - } 254 - #endif 256 + 255 257 return memblock_is_map_memory(addr); 256 258 } 257 259 EXPORT_SYMBOL(pfn_valid);
-2
arch/arm64/mm/mmu.c
··· 1113 1113 } 1114 1114 #endif 1115 1115 1116 - #ifdef CONFIG_SPARSEMEM_VMEMMAP 1117 1116 #if !ARM64_SWAPPER_USES_SECTION_MAPS 1118 1117 int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, 1119 1118 struct vmem_altmap *altmap) ··· 1176 1177 free_empty_tables(start, end, VMEMMAP_START, VMEMMAP_END); 1177 1178 #endif 1178 1179 } 1179 - #endif /* CONFIG_SPARSEMEM_VMEMMAP */ 1180 1180 1181 1181 static inline pud_t *fixmap_pud(unsigned long addr) 1182 1182 {
-2
arch/arm64/mm/ptdump.c
··· 51 51 { FIXADDR_TOP, "Fixmap end" }, 52 52 { PCI_IO_START, "PCI I/O start" }, 53 53 { PCI_IO_END, "PCI I/O end" }, 54 - #ifdef CONFIG_SPARSEMEM_VMEMMAP 55 54 { VMEMMAP_START, "vmemmap start" }, 56 55 { VMEMMAP_START + VMEMMAP_SIZE, "vmemmap end" }, 57 - #endif 58 56 { -1, NULL }, 59 57 }; 60 58
+6 -4
drivers/acpi/arm64/gtdt.c
··· 329 329 int index) 330 330 { 331 331 struct platform_device *pdev; 332 - int irq = map_gt_gsi(wd->timer_interrupt, wd->timer_flags); 332 + int irq; 333 333 334 334 /* 335 335 * According to SBSA specification the size of refresh and control ··· 338 338 struct resource res[] = { 339 339 DEFINE_RES_MEM(wd->control_frame_address, SZ_4K), 340 340 DEFINE_RES_MEM(wd->refresh_frame_address, SZ_4K), 341 - DEFINE_RES_IRQ(irq), 341 + {}, 342 342 }; 343 343 int nr_res = ARRAY_SIZE(res); 344 344 ··· 348 348 349 349 if (!(wd->refresh_frame_address && wd->control_frame_address)) { 350 350 pr_err(FW_BUG "failed to get the Watchdog base address.\n"); 351 - acpi_unregister_gsi(wd->timer_interrupt); 352 351 return -EINVAL; 353 352 } 354 353 354 + irq = map_gt_gsi(wd->timer_interrupt, wd->timer_flags); 355 + res[2] = (struct resource)DEFINE_RES_IRQ(irq); 355 356 if (irq <= 0) { 356 357 pr_warn("failed to map the Watchdog interrupt.\n"); 357 358 nr_res--; ··· 365 364 */ 366 365 pdev = platform_device_register_simple("sbsa-gwdt", index, res, nr_res); 367 366 if (IS_ERR(pdev)) { 368 - acpi_unregister_gsi(wd->timer_interrupt); 367 + if (irq > 0) 368 + acpi_unregister_gsi(wd->timer_interrupt); 369 369 return PTR_ERR(pdev); 370 370 } 371 371
+5 -1
drivers/acpi/irq.c
··· 75 75 { 76 76 struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id, 77 77 DOMAIN_BUS_ANY); 78 - int irq = irq_find_mapping(d, gsi); 78 + int irq; 79 79 80 + if (WARN_ON(acpi_irq_model == ACPI_IRQ_MODEL_GIC && gsi < 16)) 81 + return; 82 + 83 + irq = irq_find_mapping(d, gsi); 80 84 irq_dispose_mapping(irq); 81 85 } 82 86 EXPORT_SYMBOL_GPL(acpi_unregister_gsi);
+1 -1
drivers/firmware/psci/psci.c
··· 139 139 return -EINVAL; 140 140 case PSCI_RET_DENIED: 141 141 return -EPERM; 142 - }; 142 + } 143 143 144 144 return -EINVAL; 145 145 }