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

Pull powerpc fixes from Michael Ellerman:

- Enforce full ordering for ATOMIC operations with BPF_FETCH

- Fix uaccess build errors seen with GCC 13/14

- Fix build errors on ppc32 due to ARCH_HAS_KERNEL_FPU_SUPPORT

- Drop error message from lparcfg guest name lookup

Thanks to Christophe Leroy, Guenter Roeck, Nathan Lynch, Naveen N Rao,
Puranjay Mohan, and Samuel Holland.

* tag 'powerpc-6.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc: Limit ARCH_HAS_KERNEL_FPU_SUPPORT to PPC64
powerpc/uaccess: Use YZ asm constraint for ld
powerpc/uaccess: Fix build errors seen with GCC 13/14
powerpc/pseries/lparcfg: drop error message from guest name lookup
powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH

+54 -3
+1 -1
arch/powerpc/Kconfig
··· 137 137 select ARCH_HAS_GCOV_PROFILE_ALL 138 138 select ARCH_HAS_HUGEPD if HUGETLB_PAGE 139 139 select ARCH_HAS_KCOV 140 - select ARCH_HAS_KERNEL_FPU_SUPPORT if PPC_FPU 140 + select ARCH_HAS_KERNEL_FPU_SUPPORT if PPC64 && PPC_FPU 141 141 select ARCH_HAS_MEMBARRIER_CALLBACKS 142 142 select ARCH_HAS_MEMBARRIER_SYNC_CORE 143 143 select ARCH_HAS_MEMREMAP_COMPAT_ALIGN if PPC_64S_HASH_MMU
+27
arch/powerpc/include/asm/uaccess.h
··· 92 92 : label) 93 93 #endif 94 94 95 + #ifdef CONFIG_CC_IS_CLANG 96 + #define DS_FORM_CONSTRAINT "Z<>" 97 + #else 98 + #define DS_FORM_CONSTRAINT "YZ<>" 99 + #endif 100 + 95 101 #ifdef __powerpc64__ 102 + #ifdef CONFIG_PPC_KERNEL_PREFIXED 96 103 #define __put_user_asm2_goto(x, ptr, label) \ 97 104 __put_user_asm_goto(x, ptr, label, "std") 105 + #else 106 + #define __put_user_asm2_goto(x, addr, label) \ 107 + asm goto ("1: std%U1%X1 %0,%1 # put_user\n" \ 108 + EX_TABLE(1b, %l2) \ 109 + : \ 110 + : "r" (x), DS_FORM_CONSTRAINT (*addr) \ 111 + : \ 112 + : label) 113 + #endif // CONFIG_PPC_KERNEL_PREFIXED 98 114 #else /* __powerpc64__ */ 99 115 #define __put_user_asm2_goto(x, addr, label) \ 100 116 asm goto( \ ··· 181 165 #endif 182 166 183 167 #ifdef __powerpc64__ 168 + #ifdef CONFIG_PPC_KERNEL_PREFIXED 184 169 #define __get_user_asm2_goto(x, addr, label) \ 185 170 __get_user_asm_goto(x, addr, label, "ld") 171 + #else 172 + #define __get_user_asm2_goto(x, addr, label) \ 173 + asm_goto_output( \ 174 + "1: ld%U1%X1 %0, %1 # get_user\n" \ 175 + EX_TABLE(1b, %l2) \ 176 + : "=r" (x) \ 177 + : DS_FORM_CONSTRAINT (*addr) \ 178 + : \ 179 + : label) 180 + #endif // CONFIG_PPC_KERNEL_PREFIXED 186 181 #else /* __powerpc64__ */ 187 182 #define __get_user_asm2_goto(x, addr, label) \ 188 183 asm_goto_output( \
+12
arch/powerpc/net/bpf_jit_comp32.c
··· 900 900 901 901 /* Get offset into TMP_REG */ 902 902 EMIT(PPC_RAW_LI(tmp_reg, off)); 903 + /* 904 + * Enforce full ordering for operations with BPF_FETCH by emitting a 'sync' 905 + * before and after the operation. 906 + * 907 + * This is a requirement in the Linux Kernel Memory Model. 908 + * See __cmpxchg_u32() in asm/cmpxchg.h as an example. 909 + */ 910 + if ((imm & BPF_FETCH) && IS_ENABLED(CONFIG_SMP)) 911 + EMIT(PPC_RAW_SYNC()); 903 912 tmp_idx = ctx->idx * 4; 904 913 /* load value from memory into r0 */ 905 914 EMIT(PPC_RAW_LWARX(_R0, tmp_reg, dst_reg, 0)); ··· 962 953 963 954 /* For the BPF_FETCH variant, get old data into src_reg */ 964 955 if (imm & BPF_FETCH) { 956 + /* Emit 'sync' to enforce full ordering */ 957 + if (IS_ENABLED(CONFIG_SMP)) 958 + EMIT(PPC_RAW_SYNC()); 965 959 EMIT(PPC_RAW_MR(ret_reg, ax_reg)); 966 960 if (!fp->aux->verifier_zext) 967 961 EMIT(PPC_RAW_LI(ret_reg - 1, 0)); /* higher 32-bit */
+12
arch/powerpc/net/bpf_jit_comp64.c
··· 846 846 847 847 /* Get offset into TMP_REG_1 */ 848 848 EMIT(PPC_RAW_LI(tmp1_reg, off)); 849 + /* 850 + * Enforce full ordering for operations with BPF_FETCH by emitting a 'sync' 851 + * before and after the operation. 852 + * 853 + * This is a requirement in the Linux Kernel Memory Model. 854 + * See __cmpxchg_u64() in asm/cmpxchg.h as an example. 855 + */ 856 + if ((imm & BPF_FETCH) && IS_ENABLED(CONFIG_SMP)) 857 + EMIT(PPC_RAW_SYNC()); 849 858 tmp_idx = ctx->idx * 4; 850 859 /* load value from memory into TMP_REG_2 */ 851 860 if (size == BPF_DW) ··· 917 908 PPC_BCC_SHORT(COND_NE, tmp_idx); 918 909 919 910 if (imm & BPF_FETCH) { 911 + /* Emit 'sync' to enforce full ordering */ 912 + if (IS_ENABLED(CONFIG_SMP)) 913 + EMIT(PPC_RAW_SYNC()); 920 914 EMIT(PPC_RAW_MR(ret_reg, _R0)); 921 915 /* 922 916 * Skip unnecessary zero-extension for 32-bit cmpxchg.
+2 -2
arch/powerpc/platforms/pseries/lparcfg.c
··· 371 371 372 372 static void read_lpar_name(struct seq_file *m) 373 373 { 374 - if (read_rtas_lpar_name(m) && read_dt_lpar_name(m)) 375 - pr_err_once("Error can't get the LPAR name"); 374 + if (read_rtas_lpar_name(m)) 375 + read_dt_lpar_name(m); 376 376 } 377 377 378 378 #define SPLPAR_MAXLENGTH 1026*(sizeof(char))