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 'powerpc-6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

- Reinstate support for little endian ELFv1 binaries, which it turns
out still exist in the wild.

- Revert a change which used asm goto for WARN_ON/__WARN_FLAGS, as it
lead to dead code generation and seemed to trigger compiler bugs in
some edge cases.

- Fix a deadlock in the pseries VAS code, between live migration and
the driver's mmap handler.

- Disable KCOV instrumentation in the powerpc KASAN code.

Thanks to Andrew Donnellan, Benjamin Gray, Christophe Leroy, Haren
Myneni, Russell Currey, and Uwe Kleine-König.

* tag 'powerpc-6.5-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
Revert "powerpc/64s: Remove support for ELFv1 little endian userspace"
powerpc/kasan: Disable KCOV in KASAN code
powerpc/512x: lpbfifo: Convert to platform remove callback returning void
powerpc/crypto: Add gitignore for generated P10 AES/GCM .S files
Revert "powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto"
powerpc/pseries/vas: Hold mmap_mutex after mmap lock during window close

+29 -80
+3
arch/powerpc/crypto/.gitignore
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + aesp10-ppc.S 3 + ghashp10-ppc.S
+13 -56
arch/powerpc/include/asm/bug.h
··· 4 4 #ifdef __KERNEL__ 5 5 6 6 #include <asm/asm-compat.h> 7 - #include <asm/extable.h> 8 7 9 8 #ifdef CONFIG_BUG 10 9 11 10 #ifdef __ASSEMBLY__ 12 11 #include <asm/asm-offsets.h> 13 12 #ifdef CONFIG_DEBUG_BUGVERBOSE 14 - .macro __EMIT_BUG_ENTRY addr,file,line,flags 13 + .macro EMIT_BUG_ENTRY addr,file,line,flags 15 14 .section __bug_table,"aw" 16 15 5001: .4byte \addr - . 17 16 .4byte 5002f - . ··· 22 23 .previous 23 24 .endm 24 25 #else 25 - .macro __EMIT_BUG_ENTRY addr,file,line,flags 26 + .macro EMIT_BUG_ENTRY addr,file,line,flags 26 27 .section __bug_table,"aw" 27 28 5001: .4byte \addr - . 28 29 .short \flags ··· 30 31 .previous 31 32 .endm 32 33 #endif /* verbose */ 33 - 34 - .macro EMIT_WARN_ENTRY addr,file,line,flags 35 - EX_TABLE(\addr,\addr+4) 36 - __EMIT_BUG_ENTRY \addr,\file,\line,\flags 37 - .endm 38 - 39 - .macro EMIT_BUG_ENTRY addr,file,line,flags 40 - .if \flags & 1 /* BUGFLAG_WARNING */ 41 - .err /* Use EMIT_WARN_ENTRY for warnings */ 42 - .endif 43 - __EMIT_BUG_ENTRY \addr,\file,\line,\flags 44 - .endm 45 34 46 35 #else /* !__ASSEMBLY__ */ 47 36 /* _EMIT_BUG_ENTRY expects args %0,%1,%2,%3 to be FILE, LINE, flags and ··· 60 73 "i" (sizeof(struct bug_entry)), \ 61 74 ##__VA_ARGS__) 62 75 63 - #define WARN_ENTRY(insn, flags, label, ...) \ 64 - asm_volatile_goto( \ 65 - "1: " insn "\n" \ 66 - EX_TABLE(1b, %l[label]) \ 67 - _EMIT_BUG_ENTRY \ 68 - : : "i" (__FILE__), "i" (__LINE__), \ 69 - "i" (flags), \ 70 - "i" (sizeof(struct bug_entry)), \ 71 - ##__VA_ARGS__ : : label) 72 - 73 76 /* 74 77 * BUG_ON() and WARN_ON() do their best to cooperate with compile-time 75 78 * optimisations. However depending on the complexity of the condition ··· 72 95 } while (0) 73 96 #define HAVE_ARCH_BUG 74 97 75 - #define __WARN_FLAGS(flags) do { \ 76 - __label__ __label_warn_on; \ 77 - \ 78 - WARN_ENTRY("twi 31, 0, 0", BUGFLAG_WARNING | (flags), __label_warn_on); \ 79 - barrier_before_unreachable(); \ 80 - __builtin_unreachable(); \ 81 - \ 82 - __label_warn_on: \ 83 - break; \ 84 - } while (0) 98 + #define __WARN_FLAGS(flags) BUG_ENTRY("twi 31, 0, 0", BUGFLAG_WARNING | (flags)) 85 99 86 100 #ifdef CONFIG_PPC64 87 101 #define BUG_ON(x) do { \ ··· 85 117 } while (0) 86 118 87 119 #define WARN_ON(x) ({ \ 88 - bool __ret_warn_on = false; \ 89 - do { \ 90 - if (__builtin_constant_p((x))) { \ 91 - if (!(x)) \ 92 - break; \ 120 + int __ret_warn_on = !!(x); \ 121 + if (__builtin_constant_p(__ret_warn_on)) { \ 122 + if (__ret_warn_on) \ 93 123 __WARN(); \ 94 - __ret_warn_on = true; \ 95 - } else { \ 96 - __label__ __label_warn_on; \ 97 - \ 98 - WARN_ENTRY(PPC_TLNEI " %4, 0", \ 99 - BUGFLAG_WARNING | BUGFLAG_TAINT(TAINT_WARN), \ 100 - __label_warn_on, \ 101 - "r" ((__force long)(x))); \ 102 - break; \ 103 - __label_warn_on: \ 104 - __ret_warn_on = true; \ 105 - } \ 106 - } while (0); \ 124 + } else { \ 125 + BUG_ENTRY(PPC_TLNEI " %4, 0", \ 126 + BUGFLAG_WARNING | BUGFLAG_TAINT(TAINT_WARN), \ 127 + "r" (__ret_warn_on)); \ 128 + } \ 107 129 unlikely(__ret_warn_on); \ 108 130 }) 109 131 ··· 106 148 #ifdef __ASSEMBLY__ 107 149 .macro EMIT_BUG_ENTRY addr,file,line,flags 108 150 .endm 109 - .macro EMIT_WARN_ENTRY addr,file,line,flags 110 - .endm 111 151 #else /* !__ASSEMBLY__ */ 112 152 #define _EMIT_BUG_ENTRY 113 - #define _EMIT_WARN_ENTRY 114 153 #endif 115 154 #endif /* CONFIG_BUG */ 155 + 156 + #define EMIT_WARN_ENTRY EMIT_BUG_ENTRY 116 157 117 158 #include <asm-generic/bug.h> 118 159
-6
arch/powerpc/include/asm/elf.h
··· 12 12 13 13 /* 14 14 * This is used to ensure we don't load something for the wrong architecture. 15 - * 64le only supports ELFv2 64-bit binaries (64be supports v1 and v2). 16 15 */ 17 - #if defined(CONFIG_PPC64) && defined(CONFIG_CPU_LITTLE_ENDIAN) 18 - #define elf_check_arch(x) (((x)->e_machine == ELF_ARCH) && \ 19 - (((x)->e_flags & 0x3) == 0x2)) 20 - #else 21 16 #define elf_check_arch(x) ((x)->e_machine == ELF_ARCH) 22 - #endif 23 17 #define compat_elf_check_arch(x) ((x)->e_machine == EM_PPC) 24 18 25 19 #define CORE_DUMP_USE_REGSET
+1 -5
arch/powerpc/include/asm/thread_info.h
··· 183 183 #define clear_tsk_compat_task(tsk) do { } while (0) 184 184 #endif 185 185 186 - #ifdef CONFIG_PPC64 187 - #ifdef CONFIG_CPU_BIG_ENDIAN 186 + #if defined(CONFIG_PPC64) 188 187 #define is_elf2_task() (test_thread_flag(TIF_ELF2ABI)) 189 - #else 190 - #define is_elf2_task() (1) 191 - #endif 192 188 #else 193 189 #define is_elf2_task() (0) 194 190 #endif
+2 -7
arch/powerpc/kernel/traps.c
··· 1508 1508 1509 1509 if (!(regs->msr & MSR_PR) && /* not user-mode */ 1510 1510 report_bug(bugaddr, regs) == BUG_TRAP_TYPE_WARN) { 1511 - const struct exception_table_entry *entry; 1512 - 1513 - entry = search_exception_tables(bugaddr); 1514 - if (entry) { 1515 - regs_set_return_ip(regs, extable_fixup(entry) + regs->nip - bugaddr); 1516 - return; 1517 - } 1511 + regs_add_return_ip(regs, 4); 1512 + return; 1518 1513 } 1519 1514 1520 1515 if (cpu_has_feature(CPU_FTR_DEXCR_NPHIE) && user_mode(regs)) {
+1
arch/powerpc/mm/kasan/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 3 KASAN_SANITIZE := n 4 + KCOV_INSTRUMENT := n 4 5 5 6 obj-$(CONFIG_PPC32) += init_32.o 6 7 obj-$(CONFIG_PPC_8xx) += 8xx.o
+2 -4
arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
··· 477 477 return ret; 478 478 } 479 479 480 - static int mpc512x_lpbfifo_remove(struct platform_device *pdev) 480 + static void mpc512x_lpbfifo_remove(struct platform_device *pdev) 481 481 { 482 482 unsigned long flags; 483 483 struct dma_device *dma_dev = lpbfifo.chan->device; ··· 494 494 free_irq(lpbfifo.irq, &pdev->dev); 495 495 irq_dispose_mapping(lpbfifo.irq); 496 496 dma_release_channel(lpbfifo.chan); 497 - 498 - return 0; 499 497 } 500 498 501 499 static const struct of_device_id mpc512x_lpbfifo_match[] = { ··· 504 506 505 507 static struct platform_driver mpc512x_lpbfifo_driver = { 506 508 .probe = mpc512x_lpbfifo_probe, 507 - .remove = mpc512x_lpbfifo_remove, 509 + .remove_new = mpc512x_lpbfifo_remove, 508 510 .driver = { 509 511 .name = DRV_NAME, 510 512 .of_match_table = mpc512x_lpbfifo_match,
+7 -2
arch/powerpc/platforms/pseries/vas.c
··· 744 744 } 745 745 746 746 task_ref = &win->vas_win.task_ref; 747 + /* 748 + * VAS mmap (coproc_mmap()) and its fault handler 749 + * (vas_mmap_fault()) are called after holding mmap lock. 750 + * So hold mmap mutex after mmap_lock to avoid deadlock. 751 + */ 752 + mmap_write_lock(task_ref->mm); 747 753 mutex_lock(&task_ref->mmap_mutex); 748 754 vma = task_ref->vma; 749 755 /* ··· 758 752 */ 759 753 win->vas_win.status |= flag; 760 754 761 - mmap_write_lock(task_ref->mm); 762 755 /* 763 756 * vma is set in the original mapping. But this mapping 764 757 * is done with mmap() after the window is opened with ioctl. ··· 767 762 if (vma) 768 763 zap_vma_pages(vma); 769 764 770 - mmap_write_unlock(task_ref->mm); 771 765 mutex_unlock(&task_ref->mmap_mutex); 766 + mmap_write_unlock(task_ref->mm); 772 767 /* 773 768 * Close VAS window in the hypervisor, but do not 774 769 * free vas_window struct since it may be reused