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

Pull powerpc fixes from Michael Ellerman:
"Some more powerpc fixes for 5.3:

- Wire up the new clone3 syscall.

- A fix for the PAPR SCM nvdimm driver, to fix a crash when firmware
gives us a device that's attached to a non-online NUMA node.

- A fix for a boot failure on 32-bit with KASAN enabled.

- Three fixes for implicit fall through warnings, some of which are
errors for us due to -Werror.

Thanks to: Aneesh Kumar K.V, Christophe Leroy, Kees Cook, Santosh
Sivaraj, Stephen Rothwell"

* tag 'powerpc-5.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/kasan: fix early boot failure on PPC32
drivers/macintosh/smu.c: Mark expected switch fall-through
powerpc/spe: Mark expected switch fall-throughs
powerpc/nvdimm: Pick nearby online node if the device node is not online
powerpc/kvm: Fall through switch case explicitly
powerpc: Wire up clone3 syscall

+53 -5
+1
arch/powerpc/include/asm/unistd.h
··· 49 49 #define __ARCH_WANT_SYS_FORK 50 50 #define __ARCH_WANT_SYS_VFORK 51 51 #define __ARCH_WANT_SYS_CLONE 52 + #define __ARCH_WANT_SYS_CLONE3 52 53 53 54 #endif /* __ASSEMBLY__ */ 54 55 #endif /* _ASM_POWERPC_UNISTD_H_ */
+4
arch/powerpc/kernel/align.c
··· 176 176 ret |= __get_user_inatomic(temp.v[1], p++); 177 177 ret |= __get_user_inatomic(temp.v[2], p++); 178 178 ret |= __get_user_inatomic(temp.v[3], p++); 179 + /* fall through */ 179 180 case 4: 180 181 ret |= __get_user_inatomic(temp.v[4], p++); 181 182 ret |= __get_user_inatomic(temp.v[5], p++); 183 + /* fall through */ 182 184 case 2: 183 185 ret |= __get_user_inatomic(temp.v[6], p++); 184 186 ret |= __get_user_inatomic(temp.v[7], p++); ··· 261 259 ret |= __put_user_inatomic(data.v[1], p++); 262 260 ret |= __put_user_inatomic(data.v[2], p++); 263 261 ret |= __put_user_inatomic(data.v[3], p++); 262 + /* fall through */ 264 263 case 4: 265 264 ret |= __put_user_inatomic(data.v[4], p++); 266 265 ret |= __put_user_inatomic(data.v[5], p++); 266 + /* fall through */ 267 267 case 2: 268 268 ret |= __put_user_inatomic(data.v[6], p++); 269 269 ret |= __put_user_inatomic(data.v[7], p++);
+8
arch/powerpc/kernel/entry_32.S
··· 597 597 stw r0,_TRAP(r1) /* register set saved */ 598 598 b sys_clone 599 599 600 + .globl ppc_clone3 601 + ppc_clone3: 602 + SAVE_NVGPRS(r1) 603 + lwz r0,_TRAP(r1) 604 + rlwinm r0,r0,0,0,30 /* clear LSB to indicate full */ 605 + stw r0,_TRAP(r1) /* register set saved */ 606 + b sys_clone3 607 + 600 608 .globl ppc_swapcontext 601 609 ppc_swapcontext: 602 610 SAVE_NVGPRS(r1)
+5
arch/powerpc/kernel/entry_64.S
··· 487 487 bl sys_clone 488 488 b .Lsyscall_exit 489 489 490 + _GLOBAL(ppc_clone3) 491 + bl save_nvgprs 492 + bl sys_clone3 493 + b .Lsyscall_exit 494 + 490 495 _GLOBAL(ppc32_swapcontext) 491 496 bl save_nvgprs 492 497 bl compat_sys_swapcontext
+1 -1
arch/powerpc/kernel/syscalls/syscall.tbl
··· 516 516 432 common fsmount sys_fsmount 517 517 433 common fspick sys_fspick 518 518 434 common pidfd_open sys_pidfd_open 519 - # 435 reserved for clone3 519 + 435 nospu clone3 ppc_clone3
+1
arch/powerpc/kvm/book3s_32_mmu.c
··· 239 239 case 2: 240 240 case 6: 241 241 pte->may_write = true; 242 + /* fall through */ 242 243 case 3: 243 244 case 5: 244 245 case 7:
+5 -2
arch/powerpc/mm/kasan/kasan_init_32.c
··· 21 21 __set_pte_at(&init_mm, va, ptep, pfn_pte(PHYS_PFN(pa), prot), 0); 22 22 } 23 23 24 - static int kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_end) 24 + static int __ref kasan_init_shadow_page_tables(unsigned long k_start, unsigned long k_end) 25 25 { 26 26 pmd_t *pmd; 27 27 unsigned long k_cur, k_next; ··· 35 35 if ((void *)pmd_page_vaddr(*pmd) != kasan_early_shadow_pte) 36 36 continue; 37 37 38 - new = pte_alloc_one_kernel(&init_mm); 38 + if (slab_is_available()) 39 + new = pte_alloc_one_kernel(&init_mm); 40 + else 41 + new = memblock_alloc(PTE_FRAG_SIZE, PTE_FRAG_SIZE); 39 42 40 43 if (!new) 41 44 return -ENOMEM;
+27 -2
arch/powerpc/platforms/pseries/papr_scm.c
··· 275 275 NULL, 276 276 }; 277 277 278 + static inline int papr_scm_node(int node) 279 + { 280 + int min_dist = INT_MAX, dist; 281 + int nid, min_node; 282 + 283 + if ((node == NUMA_NO_NODE) || node_online(node)) 284 + return node; 285 + 286 + min_node = first_online_node; 287 + for_each_online_node(nid) { 288 + dist = node_distance(node, nid); 289 + if (dist < min_dist) { 290 + min_dist = dist; 291 + min_node = nid; 292 + } 293 + } 294 + return min_node; 295 + } 296 + 278 297 static int papr_scm_nvdimm_init(struct papr_scm_priv *p) 279 298 { 280 299 struct device *dev = &p->pdev->dev; 281 300 struct nd_mapping_desc mapping; 282 301 struct nd_region_desc ndr_desc; 283 302 unsigned long dimm_flags; 303 + int target_nid, online_nid; 284 304 285 305 p->bus_desc.ndctl = papr_scm_ndctl; 286 306 p->bus_desc.module = THIS_MODULE; ··· 339 319 340 320 memset(&ndr_desc, 0, sizeof(ndr_desc)); 341 321 ndr_desc.attr_groups = region_attr_groups; 342 - ndr_desc.numa_node = dev_to_node(&p->pdev->dev); 343 - ndr_desc.target_node = ndr_desc.numa_node; 322 + target_nid = dev_to_node(&p->pdev->dev); 323 + online_nid = papr_scm_node(target_nid); 324 + ndr_desc.numa_node = online_nid; 325 + ndr_desc.target_node = target_nid; 344 326 ndr_desc.res = &p->res; 345 327 ndr_desc.of_node = p->dn; 346 328 ndr_desc.provider_data = p; ··· 360 338 ndr_desc.res, p->dn); 361 339 goto err; 362 340 } 341 + if (target_nid != online_nid) 342 + dev_info(dev, "Region registered with target node %d and online node %d", 343 + target_nid, online_nid); 363 344 364 345 return 0; 365 346
+1
drivers/macintosh/smu.c
··· 852 852 break; 853 853 case SMU_I2C_TRANSFER_COMBINED: 854 854 cmd->info.devaddr &= 0xfe; 855 + /* fall through */ 855 856 case SMU_I2C_TRANSFER_STDSUB: 856 857 if (cmd->info.sublen > 3) 857 858 return -EINVAL;