From nobody Mon Sep 28 04:51:21 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90AA62E62B3; Wed, 26 Aug 2026 16:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787760412; cv=none; b=Pwra+idkjfd9BZmgRBfy2JLZ9wOUyJ8LvrYrPZjVRTeB4YRLGdn4miZebCD382fGjnslCwbpz3VWlpiaYNdBNK88uWOl5HMSfhUZZbuo6BmclzprWfYekuNwAnCKy0T8xcEF+x95wg/EaxgkaFxCkUsrHQlqVMswWWlIFFJM+pI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787760412; c=relaxed/simple; bh=FafsT4csUaf4RxadGRpATHhYJWC0KXpYpHPv3XQsMss=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lCxmuH2JoNkN5lH9y+1kvHdI3XV+nHp3nt/5kRIvchvWy/zFlT3U7v9EX9fgSSNHEVgRJco4K7qTjOLHYWjtlaSkctu3y5uOmCVmDfh5xFG9b91tjYVGBsDTMrY9d4/KUTM+N0unF3jYw8Q2DCe3LsTlOVI27AOTctg6zRIOLzw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nO2pplol; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nO2pplol" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 157AF1F00A3A; Wed, 26 Aug 2026 16:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787760410; bh=EJdDIyy+4lOGAChPUAxt3Ar9H8Z+4DOnnp8qXsWz7tI=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=nO2pplolF+QUbDqj2B7pDD8qzcQC4ECFNXA3xKqfgIw5omJwRcDiwDX8qmMQXX+2X 8HNuW6MDAL5f5vYzcsSy7sVnBlwRA8LdwUeQKQElISeRtURSAsv8/ZMoU9T1bF39yf nG5WfqrypfDmJlZbZEOyj1uY/YUPxdbGARlg9B1TxGcwjn3OyT55MDjOZzUebcTqkb CREXpRJHaKbKfrzdYMdMHk8XIa3MR8DZAVIfdUj2DcA7T0s5gYg8f3Izetn4enVVjK QGEnt7KbM7QbK4XA/xumyvcXB8cDc0Tbof2dYSOMNzYj3gx59jZXYnfbUdkmOVWeRb xYJAF+CUCGSSA== From: Christian Brauner Date: Wed, 26 Aug 2026 18:06:40 +0200 Subject: [PATCH 1/2] powerpc: remove coredump support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260826-work-spufs-coredump-v1-1-579e72a7ab66@kernel.org> References: <20260826-work-spufs-coredump-v1-0-579e72a7ab66@kernel.org> In-Reply-To: <20260826-work-spufs-coredump-v1-0-579e72a7ab66@kernel.org> To: linux-fsdevel@vger.kernel.org, Arnd Bergmann , Michael Ellerman , Nicholas Piggin Cc: Madhavan Srinivasan , "Christophe Leroy (CS GROUP)" , Kees Cook , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Viro , Jan Kara , "Christian Brauner (Amutable)" X-Mailer: b4 0.17-dev-362b8 X-Developer-Signature: v=1; a=openpgp-sha256; l=18282; i=brauner@kernel.org; h=from:subject:message-id; bh=FafsT4csUaf4RxadGRpATHhYJWC0KXpYpHPv3XQsMss=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMWT18ws7PWR4/tzryMTZ9rMli+Vai/rm804M8lR3tbLUt ojoZM/qKGVhEONikBVTZHFoNwmXW85TsdkoUwNmDisTyBAGLk4BmMgXX0aG15I2+w4dTOEtU5OT C92bGvHr2I+2iT26tq8+X3D043m5l+F/QKsU70dDrQIPyY/F21/4K2fvr0t6cEtqVtMaw1TFmc2 cAA== X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 A task that dumps open spufs context adds a bunch of extra elf notes describing the SPU state. It is the only reason do_coredump() unshares the file descriptor table. We could make this conditional on spufs but eh. Nothing can consume those notes anymore. gdb dropped Cell Broadband Engine debugging in 9.1 and binutils removed it in 2.34. That's about 6 years ago. So no program can actually read an SPU note out of a core file and probably never did in recent history. Note that the IBM Cell blades that shipped the Cell processor were removed in commit 05bf59fbeef3 ("powerpc/cell: Remove support for IBM Cell Blades"). The PlayStation 3 is the only platform left and nothing there produces or reads these notes. So remove it. Signed-off-by: Christian Brauner (Amutable) Acked-by: Arnd Bergmann --- arch/powerpc/Kconfig | 1 - arch/powerpc/include/asm/elf.h | 6 - arch/powerpc/include/asm/spu.h | 3 - arch/powerpc/platforms/cell/Kconfig | 1 - arch/powerpc/platforms/cell/spu_syscalls.c | 20 --- arch/powerpc/platforms/cell/spufs/Makefile | 1 - arch/powerpc/platforms/cell/spufs/coredump.c | 183 -----------------------= ---- arch/powerpc/platforms/cell/spufs/file.c | 114 ----------------- arch/powerpc/platforms/cell/spufs/spufs.h | 12 -- arch/powerpc/platforms/cell/spufs/syscalls.c | 4 - 10 files changed, 345 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 2580e27e4328..40c874fe2f53 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -160,7 +160,6 @@ config PPC select ARCH_HAS_UBSAN select ARCH_HAS_VDSO_ARCH_DATA select ARCH_HAVE_NMI_SAFE_CMPXCHG - select ARCH_HAVE_EXTRA_ELF_NOTES if SPU_BASE select ARCH_KEEP_MEMBLOCK select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE if PPC_RADIX_MMU select ARCH_MIGHT_HAVE_PC_PARPORT diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h index bb4b94444d3e..5dc8c4923eb1 100644 --- a/arch/powerpc/include/asm/elf.h +++ b/arch/powerpc/include/asm/elf.h @@ -123,12 +123,6 @@ extern int arch_setup_additional_pages(struct linux_bi= nprm *bprm, (0x7ff >> (PAGE_SHIFT - 12)) : \ (0x3ffff >> (PAGE_SHIFT - 12))) =20 -#ifdef CONFIG_SPU_BASE -/* Notes used in ET_CORE. Note name is "SPU//". */ -#define NT_SPU 1 - -#endif /* CONFIG_SPU_BASE */ - #ifdef CONFIG_PPC64 =20 #define get_cache_geometry(level) \ diff --git a/arch/powerpc/include/asm/spu.h b/arch/powerpc/include/asm/spu.h index 96ad4510c895..7152285b6268 100644 --- a/arch/powerpc/include/asm/spu.h +++ b/arch/powerpc/include/asm/spu.h @@ -210,15 +210,12 @@ extern long spu_sys_callback(struct spu_syscall_block= *s); =20 /* syscalls implemented in spufs */ struct file; -struct coredump_params; struct spufs_calls { long (*create_thread)(const char __user *name, unsigned int flags, umode_t mode, struct file *neighbor); long (*spu_run)(struct file *filp, __u32 __user *unpc, __u32 __user *ustatus); - int (*coredump_extra_notes_size)(void); - int (*coredump_extra_notes_write)(struct coredump_params *cprm); void (*notify_spus_active)(void); struct module *owner; }; diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/c= ell/Kconfig index db65bfcd1e74..6bd26815c331 100644 --- a/arch/powerpc/platforms/cell/Kconfig +++ b/arch/powerpc/platforms/cell/Kconfig @@ -10,7 +10,6 @@ config SPU_FS tristate "SPU file system" default m depends on PPC_CELL - depends on COREDUMP select SPU_BASE help The SPU file system is used to access Synergistic Processing diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/plat= forms/cell/spu_syscalls.c index 000894e07b02..8be81207e886 100644 --- a/arch/powerpc/platforms/cell/spu_syscalls.c +++ b/arch/powerpc/platforms/cell/spu_syscalls.c @@ -88,26 +88,6 @@ SYSCALL_DEFINE3(spu_run,int, fd, __u32 __user *, unpc, _= _u32 __user *, ustatus) return calls->spu_run(fd_file(arg), unpc, ustatus); } =20 -#ifdef CONFIG_COREDUMP -int elf_coredump_extra_notes_size(void) -{ - CLASS(spufs_calls, calls)(); - if (!calls) - return 0; - - return calls->coredump_extra_notes_size(); -} - -int elf_coredump_extra_notes_write(struct coredump_params *cprm) -{ - CLASS(spufs_calls, calls)(); - if (!calls) - return 0; - - return calls->coredump_extra_notes_write(cprm); -} -#endif - void notify_spus_active(void) { struct spufs_calls *calls; diff --git a/arch/powerpc/platforms/cell/spufs/Makefile b/arch/powerpc/plat= forms/cell/spufs/Makefile index 52e4c80ec8d0..60319d4ff25a 100644 --- a/arch/powerpc/platforms/cell/spufs/Makefile +++ b/arch/powerpc/platforms/cell/spufs/Makefile @@ -4,7 +4,6 @@ obj-$(CONFIG_SPU_FS) +=3D spufs.o spufs-y +=3D inode.o file.o context.o syscalls.o spufs-y +=3D sched.o backing_ops.o hw_ops.o run.o gang.o spufs-y +=3D switch.o fault.o lscsa_alloc.o -spufs-$(CONFIG_COREDUMP) +=3D coredump.o =20 # magic for the trace events CFLAGS_sched.o :=3D -I$(src) diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/pl= atforms/cell/spufs/coredump.c deleted file mode 100644 index 301ee7d8b7df..000000000000 --- a/arch/powerpc/platforms/cell/spufs/coredump.c +++ /dev/null @@ -1,183 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * SPU core dump code - * - * (C) Copyright 2006 IBM Corp. - * - * Author: Dwayne Grant McConnell - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "spufs.h" - -static int spufs_ctx_note_size(struct spu_context *ctx, int dfd) -{ - int i, sz, total =3D 0; - char *name; - char fullname[80]; - - for (i =3D 0; spufs_coredump_read[i].name !=3D NULL; i++) { - name =3D spufs_coredump_read[i].name; - sz =3D spufs_coredump_read[i].size; - - sprintf(fullname, "SPU/%d/%s", dfd, name); - - total +=3D sizeof(struct elf_note); - total +=3D roundup(strlen(fullname) + 1, 4); - total +=3D roundup(sz, 4); - } - - return total; -} - -static int match_context(const void *v, struct file *file, unsigned fd) -{ - struct spu_context *ctx; - if (file->f_op !=3D &spufs_context_fops) - return 0; - ctx =3D SPUFS_I(file_inode(file))->i_ctx; - if (ctx->flags & SPU_CREATE_NOSCHED) - return 0; - return fd + 1; -} - -/* - * The additional architecture-specific notes for Cell are various - * context files in the spu context. - * - * This function iterates over all open file descriptors and sees - * if they are a directory in spufs. In that case we use spufs - * internal functionality to dump them without needing to actually - * open the files. - */ -/* - * descriptor table is not shared, so files can't change or go away. - */ -static struct spu_context *coredump_next_context(int *fd) -{ - struct spu_context *ctx =3D NULL; - struct file *file; - int n =3D iterate_fd(current->files, *fd, match_context, NULL); - if (!n) - return NULL; - *fd =3D n - 1; - - file =3D fget_raw(*fd); - if (file) { - ctx =3D SPUFS_I(file_inode(file))->i_ctx; - get_spu_context(ctx); - fput(file); - } - - return ctx; -} - -int spufs_coredump_extra_notes_size(void) -{ - struct spu_context *ctx; - int size =3D 0, rc, fd; - - fd =3D 0; - while ((ctx =3D coredump_next_context(&fd)) !=3D NULL) { - rc =3D spu_acquire_saved(ctx); - if (rc) { - put_spu_context(ctx); - break; - } - - rc =3D spufs_ctx_note_size(ctx, fd); - spu_release_saved(ctx); - if (rc < 0) { - put_spu_context(ctx); - break; - } - - size +=3D rc; - - /* start searching the next fd next time */ - fd++; - put_spu_context(ctx); - } - - return size; -} - -static int spufs_arch_write_note(struct spu_context *ctx, int i, - struct coredump_params *cprm, int dfd) -{ - size_t sz =3D spufs_coredump_read[i].size; - char fullname[80]; - struct elf_note en; - int ret; - - sprintf(fullname, "SPU/%d/%s", dfd, spufs_coredump_read[i].name); - en.n_namesz =3D strlen(fullname) + 1; - en.n_descsz =3D sz; - en.n_type =3D NT_SPU; - - if (!dump_emit(cprm, &en, sizeof(en))) - return -EIO; - if (!dump_emit(cprm, fullname, en.n_namesz)) - return -EIO; - if (!dump_align(cprm, 4)) - return -EIO; - - if (spufs_coredump_read[i].dump) { - ret =3D spufs_coredump_read[i].dump(ctx, cprm); - if (ret < 0) - return ret; - } else { - char buf[32]; - - ret =3D snprintf(buf, sizeof(buf), "0x%.16llx", - spufs_coredump_read[i].get(ctx)); - if (ret >=3D sizeof(buf)) - return sizeof(buf); - - /* count trailing the NULL: */ - if (!dump_emit(cprm, buf, ret + 1)) - return -EIO; - } - - dump_skip_to(cprm, roundup(cprm->pos - ret + sz, 4)); - return 0; -} - -int spufs_coredump_extra_notes_write(struct coredump_params *cprm) -{ - struct spu_context *ctx; - int fd, j, rc; - - fd =3D 0; - while ((ctx =3D coredump_next_context(&fd)) !=3D NULL) { - rc =3D spu_acquire_saved(ctx); - if (rc) - return rc; - - for (j =3D 0; spufs_coredump_read[j].name !=3D NULL; j++) { - rc =3D spufs_arch_write_note(ctx, j, cprm, fd); - if (rc) { - spu_release_saved(ctx); - return rc; - } - } - - spu_release_saved(ctx); - - /* start searching the next fd next time */ - fd++; - } - - return 0; -} diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platfo= rms/cell/spufs/file.c index de7494748fec..98c47bafaf67 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -9,7 +9,6 @@ =20 #undef DEBUG =20 -#include #include #include #include @@ -130,14 +129,6 @@ static ssize_t spufs_attr_write(struct file *file, con= st char __user *buf, return ret; } =20 -static ssize_t spufs_dump_emit(struct coredump_params *cprm, void *buf, - size_t size) -{ - if (!dump_emit(cprm, buf, size)) - return -EIO; - return size; -} - #define DEFINE_SPUFS_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt) \ static int __fops ## _open(struct inode *inode, struct file *file) \ { \ @@ -180,12 +171,6 @@ spufs_mem_release(struct inode *inode, struct file *fi= le) return 0; } =20 -static ssize_t -spufs_mem_dump(struct spu_context *ctx, struct coredump_params *cprm) -{ - return spufs_dump_emit(cprm, ctx->ops->get_ls(ctx), LS_SIZE); -} - static ssize_t spufs_mem_read(struct file *file, char __user *buffer, size_t size, loff_t *pos) @@ -466,13 +451,6 @@ spufs_regs_open(struct inode *inode, struct file *file) return 0; } =20 -static ssize_t -spufs_regs_dump(struct spu_context *ctx, struct coredump_params *cprm) -{ - return spufs_dump_emit(cprm, ctx->csa.lscsa->gprs, - sizeof(ctx->csa.lscsa->gprs)); -} - static ssize_t spufs_regs_read(struct file *file, char __user *buffer, size_t size, loff_t *pos) @@ -523,13 +501,6 @@ static const struct file_operations spufs_regs_fops = =3D { .llseek =3D generic_file_llseek, }; =20 -static ssize_t -spufs_fpcr_dump(struct spu_context *ctx, struct coredump_params *cprm) -{ - return spufs_dump_emit(cprm, &ctx->csa.lscsa->fpcr, - sizeof(ctx->csa.lscsa->fpcr)); -} - static ssize_t spufs_fpcr_read(struct file *file, char __user * buffer, size_t size, loff_t * pos) @@ -953,15 +924,6 @@ spufs_signal1_release(struct inode *inode, struct file= *file) return 0; } =20 -static ssize_t spufs_signal1_dump(struct spu_context *ctx, - struct coredump_params *cprm) -{ - if (!ctx->csa.spu_chnlcnt_RW[3]) - return 0; - return spufs_dump_emit(cprm, &ctx->csa.spu_chnldata_RW[3], - sizeof(ctx->csa.spu_chnldata_RW[3])); -} - static ssize_t __spufs_signal1_read(struct spu_context *ctx, char __user *= buf, size_t len) { @@ -1086,15 +1048,6 @@ spufs_signal2_release(struct inode *inode, struct fi= le *file) return 0; } =20 -static ssize_t spufs_signal2_dump(struct spu_context *ctx, - struct coredump_params *cprm) -{ - if (!ctx->csa.spu_chnlcnt_RW[4]) - return 0; - return spufs_dump_emit(cprm, &ctx->csa.spu_chnldata_RW[4], - sizeof(ctx->csa.spu_chnldata_RW[4])); -} - static ssize_t __spufs_signal2_read(struct spu_context *ctx, char __user *= buf, size_t len) { @@ -1924,15 +1877,6 @@ static const struct file_operations spufs_caps_fops = =3D { .release =3D single_release, }; =20 -static ssize_t spufs_mbox_info_dump(struct spu_context *ctx, - struct coredump_params *cprm) -{ - if (!(ctx->csa.prob.mb_stat_R & 0x0000ff)) - return 0; - return spufs_dump_emit(cprm, &ctx->csa.prob.pu_mb_R, - sizeof(ctx->csa.prob.pu_mb_R)); -} - static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf, size_t len, loff_t *pos) { @@ -1962,15 +1906,6 @@ static const struct file_operations spufs_mbox_info_= fops =3D { .llseek =3D generic_file_llseek, }; =20 -static ssize_t spufs_ibox_info_dump(struct spu_context *ctx, - struct coredump_params *cprm) -{ - if (!(ctx->csa.prob.mb_stat_R & 0xff0000)) - return 0; - return spufs_dump_emit(cprm, &ctx->csa.priv2.puint_mb_R, - sizeof(ctx->csa.priv2.puint_mb_R)); -} - static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf, size_t len, loff_t *pos) { @@ -2005,13 +1940,6 @@ static size_t spufs_wbox_info_cnt(struct spu_context= *ctx) return (4 - ((ctx->csa.prob.mb_stat_R & 0x00ff00) >> 8)) * sizeof(u32); } =20 -static ssize_t spufs_wbox_info_dump(struct spu_context *ctx, - struct coredump_params *cprm) -{ - return spufs_dump_emit(cprm, &ctx->csa.spu_mailbox_data, - spufs_wbox_info_cnt(ctx)); -} - static ssize_t spufs_wbox_info_read(struct file *file, char __user *buf, size_t len, loff_t *pos) { @@ -2059,15 +1987,6 @@ static void spufs_get_dma_info(struct spu_context *c= tx, } } =20 -static ssize_t spufs_dma_info_dump(struct spu_context *ctx, - struct coredump_params *cprm) -{ - struct spu_dma_info info; - - spufs_get_dma_info(ctx, &info); - return spufs_dump_emit(cprm, &info, sizeof(info)); -} - static ssize_t spufs_dma_info_read(struct file *file, char __user *buf, size_t len, loff_t *pos) { @@ -2112,15 +2031,6 @@ static void spufs_get_proxydma_info(struct spu_conte= xt *ctx, } } =20 -static ssize_t spufs_proxydma_info_dump(struct spu_context *ctx, - struct coredump_params *cprm) -{ - struct spu_proxydma_info info; - - spufs_get_proxydma_info(ctx, &info); - return spufs_dump_emit(cprm, &info, sizeof(info)); -} - static ssize_t spufs_proxydma_info_read(struct file *file, char __user *bu= f, size_t len, loff_t *pos) { @@ -2580,27 +2490,3 @@ const struct spufs_tree_descr spufs_dir_debug_conten= ts[] =3D { { ".ctx", &spufs_ctx_fops, 0444, }, {}, }; - -const struct spufs_coredump_reader spufs_coredump_read[] =3D { - { "regs", spufs_regs_dump, NULL, sizeof(struct spu_reg128[128])}, - { "fpcr", spufs_fpcr_dump, NULL, sizeof(struct spu_reg128) }, - { "lslr", NULL, spufs_lslr_get, 19 }, - { "decr", NULL, spufs_decr_get, 19 }, - { "decr_status", NULL, spufs_decr_status_get, 19 }, - { "mem", spufs_mem_dump, NULL, LS_SIZE, }, - { "signal1", spufs_signal1_dump, NULL, sizeof(u32) }, - { "signal1_type", NULL, spufs_signal1_type_get, 19 }, - { "signal2", spufs_signal2_dump, NULL, sizeof(u32) }, - { "signal2_type", NULL, spufs_signal2_type_get, 19 }, - { "event_mask", NULL, spufs_event_mask_get, 19 }, - { "event_status", NULL, spufs_event_status_get, 19 }, - { "mbox_info", spufs_mbox_info_dump, NULL, sizeof(u32) }, - { "ibox_info", spufs_ibox_info_dump, NULL, sizeof(u32) }, - { "wbox_info", spufs_wbox_info_dump, NULL, 4 * sizeof(u32)}, - { "dma_info", spufs_dma_info_dump, NULL, sizeof(struct spu_dma_info)}, - { "proxydma_info", spufs_proxydma_info_dump, - NULL, sizeof(struct spu_proxydma_info)}, - { "object-id", NULL, spufs_object_id_get, 19 }, - { "npc", NULL, spufs_npc_get, 19 }, - { NULL }, -}; diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platf= orms/cell/spufs/spufs.h index d33787c57c39..612b5075d0ec 100644 --- a/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/arch/powerpc/platforms/cell/spufs/spufs.h @@ -232,13 +232,9 @@ extern const struct spufs_tree_descr spufs_dir_debug_c= ontents[]; =20 /* system call implementation */ extern struct spufs_calls spufs_calls; -struct coredump_params; long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status); long spufs_create(const struct path *nd, struct dentry *dentry, unsigned i= nt flags, umode_t mode, struct file *filp); -/* ELF coredump callbacks for writing SPU ELF notes */ -extern int spufs_coredump_extra_notes_size(void); -extern int spufs_coredump_extra_notes_write(struct coredump_params *cprm); =20 extern const struct file_operations spufs_context_fops; =20 @@ -335,14 +331,6 @@ void spufs_stop_callback(struct spu *spu, int irq); void spufs_mfc_callback(struct spu *spu); void spufs_dma_callback(struct spu *spu, int type); =20 -struct spufs_coredump_reader { - char *name; - ssize_t (*dump)(struct spu_context *ctx, struct coredump_params *cprm); - u64 (*get)(struct spu_context *ctx); - size_t size; -}; -extern const struct spufs_coredump_reader spufs_coredump_read[]; - extern int spu_init_csa(struct spu_state *csa); extern void spu_fini_csa(struct spu_state *csa); extern int spu_save(struct spu_state *prev, struct spu *spu); diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/pl= atforms/cell/spufs/syscalls.c index ea4ba1b6ce6a..b6de37150e73 100644 --- a/arch/powerpc/platforms/cell/spufs/syscalls.c +++ b/arch/powerpc/platforms/cell/spufs/syscalls.c @@ -82,8 +82,4 @@ struct spufs_calls spufs_calls =3D { .spu_run =3D do_spu_run, .notify_spus_active =3D do_notify_spus_active, .owner =3D THIS_MODULE, -#ifdef CONFIG_COREDUMP - .coredump_extra_notes_size =3D spufs_coredump_extra_notes_size, - .coredump_extra_notes_write =3D spufs_coredump_extra_notes_write, -#endif }; --=20 2.53.0 From nobody Mon Sep 28 04:51:21 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BE393112BD; Wed, 26 Aug 2026 16:06:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787760415; cv=none; b=Axvj/6xe5PJpvL26TS0jb8xWVrDu0aml8LiZxE23GLcBjnUWZ77xDtOUdzjFX+CjFdBGA+2T4PB4pBRykEtoHk7h5b+lNbEu9yg1J+7yJy/ixELw1CUqQYKkbZrgJZbJJf/zGeT5W9TQ92oct0FLESM7d8gZrmiJnqhFdptqHok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787760415; c=relaxed/simple; bh=K84TbfxfceCW8PndmuLZov84ig4iyficrU4Ck6RdOao=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sDi45gsdutRQBDgH2EUFBaVfog9T6WupzAvP6Pg7HGAqngsLq4Yx5VtrZq+j8BvMtM9cROhKg9WQQy4gGhAIjsoai3FkUX1WCDCAzYDPd4T7feCMYKjQzIqW4JcvmlaaeP/NmC5sAMtl32uSTdj1ebVK6mRIE7oca3lxW8glI2s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XgnOTYOn; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XgnOTYOn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C192B1F000E9; Wed, 26 Aug 2026 16:06:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787760413; bh=cmJCLhannwpQfe0H8AhecB4RfP76TbhEicx9QpJ/hJc=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=XgnOTYOnVRzH0wZzLVRnQR05xwQjWrrl7AVdNnViIQ4Bcyw/EPxZmS4FinZ70OsWY NI+H1W/ghgVhv+9tjU/qcry166sRrHtZkaCW+UlpLBnVQ9SHnm06izP3gjYaDqI94Z EWnE5w1MOosmHr5SwiFYZNNuJWlbDdHMIjbvnM49ihiBoyuxgr7I0yd4RPDerv3xi8 WwFtIZw5piEN/tTVQJpaSXNx6u6g0do/u4YPtzlQ/TpNVAlq17aUNDbfKlLQyDVKx1 QMU6IIYc96dtY/44sPJtZpWLeY1J176+tOKx+Uhglz3h5Tc/OSbh08iP+PJAPMTp00 8Yps6dr390Osg== From: Christian Brauner Date: Wed, 26 Aug 2026 18:06:41 +0200 Subject: [PATCH 2/2] coredump: stop unsharing the file descriptor table Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260826-work-spufs-coredump-v1-2-579e72a7ab66@kernel.org> References: <20260826-work-spufs-coredump-v1-0-579e72a7ab66@kernel.org> In-Reply-To: <20260826-work-spufs-coredump-v1-0-579e72a7ab66@kernel.org> To: linux-fsdevel@vger.kernel.org, Arnd Bergmann , Michael Ellerman , Nicholas Piggin Cc: Madhavan Srinivasan , "Christophe Leroy (CS GROUP)" , Kees Cook , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Viro , Jan Kara , "Christian Brauner (Amutable)" X-Mailer: b4 0.17-dev-362b8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1819; i=brauner@kernel.org; h=from:subject:message-id; bh=K84TbfxfceCW8PndmuLZov84ig4iyficrU4Ck6RdOao=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMWT18wvf21CYzVAq/4Ndf77FU/EJZkmX07z5U1Rnd//95 xASP/1VRykLgxgXg6yYIotDu0m43HKeis1GmRowc1iZQIYwcHEKwETuBjP8j7/41PjNiR/Frurs CzhO/9/V9aSg15/f/2bdrLU317tf+c7wz4x3AXuNAZvI2n6HIMaZ/zJKDCqnq/EwxRxdfvVP0mZ PJgA= X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624 We currently unshare the file descriptor table before we write the coredump. The only code that ever looked at the file descriptor table was the cell spufs coredump support. It walked all file descriptors to find the spufs contexts it would have to dump as extra elf notes. Now that we killed spufs coredumping stop doing that and update the comments referencing spufs as they ave become stale. Signed-off-by: Christian Brauner (Amutable) Acked-by: Arnd Bergmann --- fs/binfmt_elf.c | 4 ++-- fs/coredump.c | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 06d0df105382..db32bb40a867 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -2029,7 +2029,7 @@ static int elf_core_dump(struct coredump_params *cprm) { size_t sz =3D info.size; =20 - /* For cell spufs and x86 xstate */ + /* For x86 xstate */ sz +=3D elf_coredump_extra_notes_size(); =20 phdr4note =3D kmalloc_obj(*phdr4note); @@ -2093,7 +2093,7 @@ static int elf_core_dump(struct coredump_params *cprm) if (!write_note_info(&info, cprm)) goto end_coredump; =20 - /* For cell spufs and x86 xstate */ + /* For x86 xstate */ if (elf_coredump_extra_notes_write(cprm)) goto end_coredump; =20 diff --git a/fs/coredump.c b/fs/coredump.c index ac3cd74808c6..a49f2fd6be28 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -1118,11 +1118,6 @@ static void do_coredump(struct core_name *cn, struct= coredump_params *cprm, if (cn->mask & COREDUMP_REJECT) return; =20 - /* get us an unshared descriptor table; almost always a no-op */ - /* The cell spufs coredump code reads the file descriptor tables */ - if (unshare_files()) - return; - if ((cn->mask & COREDUMP_KERNEL) && !coredump_write(cn, cprm, binfmt)) return; =20 --=20 2.53.0