From nobody Wed Aug 26 07:24:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1786567104; cv=none; d=zohomail.com; s=zohoarc; b=FtOs7f8NI2mAI+yiRoqdCU8ZtyCC02o5ce7Ey2DlDRHmf2y3PA8KuEvDjbGzB/zbZJy9BObQnxeT64yrP5K4ln/dLrAMG+I2YjBDWJkKe2QOqVIoXXlAepCFNsdcJRmHkBjZtwgKxuaNwpQQBmpOr01Nshb+oKFu2ea6FOcEQLk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786567104; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/lI7aCOnAv3DkQWd/BGkdXQ91OenFVJOSM6SdZu6WCk=; b=YYHdmSxrH5TQle3LkF6mWiyquWAli7byHnPqKhpS0snF3SWHuCBAPlCS/wH1lKue5WYQ7tmucJP5elYiEsO+Ro+emZ5QfET9C7cLuKVdCEDcX7ctHF9FAQuP4DcR4lufqy42OQ9vHNSnRlB5mcw3p+DVkZtI8yWuIGc+KwgLGlE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786567104613137.7101780615551; Wed, 12 Aug 2026 13:38:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuFhm-0007WM-BC; Wed, 12 Aug 2026 16:37:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhk-0007Tw-O3 for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:40 -0400 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhj-0001EP-0T for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:40 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 9647C41EEF; Wed, 12 Aug 2026 20:37:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 126B01F000E9; Wed, 12 Aug 2026 20:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786567050; bh=/lI7aCOnAv3DkQWd/BGkdXQ91OenFVJOSM6SdZu6WCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PCIZaaNx90ZL0oUQWcoVFD8Gr1Zqpfl+MN+lmCQF/Av6mjsOg9N1O7H8zVkSSxMy0 9k2Qcvak6WCaS+jl01iU8kba7bCsT9MadDLaY0mpXnkB417shqqhLU2YGGHKViLD5M 9RJRA7r7Shzymec3n56opEw2i4nxVnwejoKQDi1UTe5f8Yqe3IVDCz98an3vL0w9EI RrWW09nu6AqtK6vSn5mOb3H21cA6OfgBtzWgbjnUSnhvgzHPDex10DpxYXNNNp4ANM Xbhv7UBuGFgoDDpuMDbcLE4mVJYBpJ9vaI+PfZhtAMZF9L+FvNkl5b0HPgzhFY7alo S1MKAOcL1Ft0g== From: Helge Deller To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matt Turner , Laurent Vivier , Helge Deller Subject: [PULL 1/7] linux-user: implement mount_setattr(2) Date: Wed, 12 Aug 2026 22:37:19 +0200 Message-ID: <20260812203725.10694-2-deller@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260812203725.10694-1-deller@kernel.org> References: <20260812203725.10694-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=deller@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.104, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1786567106324158500 Content-Type: text/plain; charset="utf-8" From: Matt Turner mount_setattr() was in the syscall tables but had no implementation, so guests always got -ENOSYS. systemd uses it when setting up per-unit credential mounts, which fails the affected units with EXIT_CREDENTIALS. struct mount_attr is an extensible struct like open_how, so handle it the same way openat2() does: reject sizes smaller than the ver0 struct and require any unknown trailing bytes to be zero. All of its fields are 64-bit, and the MOUNT_ATTR_* and MS_* propagation values are identical on every target, so only the byte order needs fixing up. Signed-off-by: Matt Turner Reviewed-by: Helge Deller Signed-off-by: Helge Deller --- linux-user/strace.list | 3 +++ linux-user/syscall.c | 44 +++++++++++++++++++++++++++++++++++++++ linux-user/syscall_defs.h | 13 ++++++++++++ 3 files changed, 60 insertions(+) diff --git a/linux-user/strace.list b/linux-user/strace.list index 25ace05187..e952f15d20 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1737,3 +1737,6 @@ #ifdef TARGET_NR_fspick { TARGET_NR_fspick, "fspick", "%s(%d,%s,%d)", NULL, NULL }, #endif +#ifdef TARGET_NR_mount_setattr +{ TARGET_NR_mount_setattr, "mount_setattr", "%s(%d,%s,%d,%p,%d)", NULL, NU= LL }, +#endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index dc028686f4..cfa68dfbdb 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9735,6 +9735,13 @@ _syscall5(int, sys_move_mount, int, __from_dfd, cons= t char *, __from_pathname, int, __to_dfd, const char *, __to_pathname, unsigned int, flag) #endif =20 +#if defined(TARGET_NR_mount_setattr) && defined(__NR_mount_setattr) +#define __NR_sys_mount_setattr __NR_mount_setattr +_syscall5(int, sys_mount_setattr, int, dfd, const char *, path, + unsigned int, flags, struct mount_attr_ver0 *, uattr, + size_t, usize) +#endif + #if defined(TARGET_NR_fsopen) && defined(__NR_fsopen) #define __NR_sys_fsopen __NR_fsopen _syscall2(int, sys_fsopen, const char *, fs_name, unsigned int, flags); @@ -14480,6 +14487,43 @@ static abi_long do_syscall1(CPUArchState *cpu_env,= int num, abi_long arg1, return do_map_shadow_stack(cpu_env, arg1, arg2, arg3); #endif =20 +#if defined(TARGET_NR_mount_setattr) && defined(__NR_mount_setattr) + case TARGET_NR_mount_setattr: + { + struct mount_attr_ver0 attr =3D {}; + abi_ulong usize =3D arg5; + + if (usize < sizeof(struct target_mount_attr_ver0)) { + return -TARGET_EINVAL; + } + ret =3D copy_struct_from_user(&attr, sizeof(attr), arg4, usize= ); + if (ret) { + if (ret =3D=3D -TARGET_E2BIG) { + qemu_log_mask(LOG_UNIMP, + "Unimplemented mount_setattr mount_attr " + "size: " TARGET_ABI_FMT_lu "\n", usize); + } + return ret; + } + /* + * MOUNT_ATTR_* and the MS_* propagation flags have the same + * values on all targets, so only byte order needs fixing up. + */ + attr.attr_set =3D tswap64(attr.attr_set); + attr.attr_clr =3D tswap64(attr.attr_clr); + attr.propagation =3D tswap64(attr.propagation); + attr.userns_fd =3D tswap64(attr.userns_fd); + + p =3D lock_user_string(arg2); + if (!p) { + return -TARGET_EFAULT; + } + ret =3D get_errno(sys_mount_setattr(arg1, p, arg3, &attr, + sizeof(attr))); + unlock_user(p, arg2, 0); + } + return ret; +#endif #if defined(TARGET_NR_fsopen) && defined(__NR_fsopen) case TARGET_NR_fsopen: { diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index e033c7db34..e28853c93b 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2770,6 +2770,19 @@ struct target_open_how_ver0 { abi_ullong mode; abi_ullong resolve; }; +/* from kernel's include/uapi/linux/mount.h */ +struct mount_attr_ver0 { + uint64_t attr_set; + uint64_t attr_clr; + uint64_t propagation; + uint64_t userns_fd; +}; +struct target_mount_attr_ver0 { + abi_ullong attr_set; + abi_ullong attr_clr; + abi_ullong propagation; + abi_ullong userns_fd; +}; #ifndef RESOLVE_NO_MAGICLINKS #define RESOLVE_NO_MAGICLINKS 0x02 #endif --=20 2.54.0 From nobody Wed Aug 26 07:24:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1786567133; cv=none; d=zohomail.com; s=zohoarc; b=GF3n/6wN3etYOyj5yTUmvcWKjX1L2glfJYVf/7MYbj8Vox6jWikD3E0fHLidwKYvc9DETAGrRTYVD5hpPYrnHHNOEeCtD33Pe7TMLe83SoyLkcSgNBFvYbV60zSMxWfcSplhlK234nRFe/RbkQHpJVV7C2bFPDf1PiHIjVyou78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786567133; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0ySLC0onq2KT+3OSCY0ERN2rwLalUp40XUDPmU/u6rQ=; b=MsSkjsymuL4cR6nVWca0I2Nnu/AMPnw+0SOecNFjUxI3kUv/R8RcjdFKa0B639jMWxfH2vUtf8owaBbUobYuTmjqBuuu9phv1qnwWwImLgiWcHabYJQJ1dP0V2wS8PylKyrf6Nd0Ejg7lpFWkXxfrP9w1FgIIO9pTwRUWaXyPGM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786567133018645.5513724896082; Wed, 12 Aug 2026 13:38:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuFhq-0007gd-5n; Wed, 12 Aug 2026 16:37:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhn-0007aU-1Z for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:43 -0400 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhl-0001EU-DV for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:42 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 9C836600AD; Wed, 12 Aug 2026 20:37:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E162C1F000E9; Wed, 12 Aug 2026 20:37:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786567052; bh=0ySLC0onq2KT+3OSCY0ERN2rwLalUp40XUDPmU/u6rQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=J3mTZiLUKS9b8imD8wjhE2D4TbeM6MQUvDfDEPOfUEze6CVthqqDxgSMiiTnLznIk T7ShyShvGZatspcqBgTfV3ZqF3f9ebjpEsalETbWAG3sYEU07JkrmrjcIolQo1jdSd hHv94KfZOx1jKzQD5QLRl4fWJvBCT9vnLPupLGkIT6m6DWkL7KboQlGAHKpALWHwCo tFdz0eatRZMyOfDzEnBch0L3iF28TznD34AW3VCB6y0AKmXnPOqV3h6qQhC7ExSQDL HNBb4ImYyeMnF5ZG5GZ535DhNAzJWW39QCej6AXLmDdNXSsX+nUHwxmDe6V4N/+CQ8 5wf2tqDFyh1Wg== From: Helge Deller To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matt Turner , Laurent Vivier , Helge Deller Subject: [PULL 2/7] linux-user: support writing floating-point registers to a core dump Date: Wed, 12 Aug 2026 22:37:20 +0200 Message-ID: <20260812203725.10694-3-deller@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260812203725.10694-1-deller@kernel.org> References: <20260812203725.10694-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c04:e001:324:0:1991:8:25; envelope-from=deller@kernel.org; helo=tor.source.kernel.org X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.104, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1786567134463158500 Content-Type: text/plain; charset="utf-8" From: Matt Turner Write an NT_FPREGSET note for targets that opt in: a target_elf.h that defines HAVE_ELF_CORE_FPREGS and target_elf_fpregset_t, and supplies an elf_core_copy_fpregs() beside the existing elf_core_copy_regs(). Signed-off-by: Matt Turner Reviewed-by: Helge Deller Signed-off-by: Helge Deller --- linux-user/elfload.c | 19 +++++++++++++++++++ linux-user/loader.h | 3 +++ 2 files changed, 22 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index e7c56af8ed..88508deac5 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1887,6 +1887,17 @@ static void fill_elf_note_phdr(struct elf_phdr *phdr= , size_t sz, off_t offset) bswap_phdr(phdr, 1); } =20 +#ifdef HAVE_ELF_CORE_FPREGS +static void fill_fpregset_note(void *data, CPUState *cpu) +{ + /* Fill locally and copy: note memory is only aligned to 4. */ + target_elf_fpregset_t fpregs =3D {}; + + elf_core_copy_fpregs(&fpregs, cpu_env(cpu)); + memcpy(data, &fpregs, sizeof(fpregs)); +} +#endif + static void fill_prstatus_note(void *data, CPUState *cpu, int signr) { /* @@ -2166,6 +2177,9 @@ static int elf_core_dump(int signr, const CPUArchStat= e *env) offset +=3D size_note("CORE", ts->info->auxv_len); offset +=3D size_note("CORE", sizeof(struct target_elf_prpsinfo)); offset +=3D size_note("CORE", sizeof(struct target_elf_prstatus)) * cp= us; +#ifdef HAVE_ELF_CORE_FPREGS + offset +=3D size_note("CORE", sizeof(target_elf_fpregset_t)) * cpus; +#endif note_size =3D offset - note_offset; data_offset =3D TARGET_PAGE_ALIGN(offset); =20 @@ -2222,6 +2236,11 @@ static int elf_core_dump(int signr, const CPUArchSta= te *env) dptr =3D fill_note(&hptr, NT_PRSTATUS, "CORE", sizeof(struct target_elf_prstatus)); fill_prstatus_note(dptr, cpu_iter, cpu_iter =3D=3D cpu ? signr= : 0); +#ifdef HAVE_ELF_CORE_FPREGS + dptr =3D fill_note(&hptr, NT_FPREGSET, "CORE", + sizeof(target_elf_fpregset_t)); + fill_fpregset_note(dptr, cpu_iter); +#endif } =20 if (dump_write(fd, header, data_offset) < 0) { diff --git a/linux-user/loader.h b/linux-user/loader.h index da9ad28db5..5ddd140276 100644 --- a/linux-user/loader.h +++ b/linux-user/loader.h @@ -109,6 +109,9 @@ bool init_guest_commpage(void); =20 struct target_elf_gregset_t; void elf_core_copy_regs(struct target_elf_gregset_t *, const CPUArchState = *); +/* Only defined by a target whose target_elf.h sets HAVE_ELF_CORE_FPREGS. = */ +struct target_elf_fpregset_t; +void elf_core_copy_fpregs(struct target_elf_fpregset_t *, const CPUArchSta= te *); =20 typedef struct { const uint8_t *image; --=20 2.54.0 From nobody Wed Aug 26 07:24:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1786567105; cv=none; d=zohomail.com; s=zohoarc; b=aPxYREOex6OBIpP1dzxZQbfm9yHHPESP4gd+aj5KbGOIgyaD9XJEm4OvRoNfxNdBlYShM/yZGf8P3AcIJgSxCwC5EP5xkxbQLaHvw0ryWbaOFZJ437XuS98RELnuP1KjqJWxyFeB2RXoArq9Ds87FdA3RJVA3SC99QFxJ7YYXIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786567105; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ML/9EklhVG178lADzV1R1N47WRV27fg9z6lhzVxQorI=; b=TqjuzKkjS2/wc+Ap8+pHr8cyr5ERkJtS1Enn4beto4kmEO8g4m39lsuvpM5Q0E3ntI5KUAEmvQXT3ROp2HbEiYTu5KNe0sboMQvvlE9RtRuAsNZk8Nte6eYdP5o7XDSbaonLzhkGjkfjLMecNtZi1yysJFuTp2T73nhnExji89U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178656710533654.082825586057766; Wed, 12 Aug 2026 13:38:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuFhl-0007U5-9b; Wed, 12 Aug 2026 16:37:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhj-0007S4-0n for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:39 -0400 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhh-0001Ee-6M for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:38 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 4C26B41FEF; Wed, 12 Aug 2026 20:37:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC1231F000E9; Wed, 12 Aug 2026 20:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786567054; bh=ML/9EklhVG178lADzV1R1N47WRV27fg9z6lhzVxQorI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HVaxFSlQirX5Nu445Pc6el51L47g3qsmk18CRmDFpObXA0JnakLublNSkAO3v7Mho xaSaoCoGk2a4bwqBS1D8zXwzgJeLXTQq4onLUgbWtEY+0DaDxcDMtPkOQs109lNROP u0+I5qyJh17DYoTXJ9NzcuRC/dJSlzwTHXNzA67sJUZ81zOKJQ5EbQrB61JhAQWSO5 pwOIbz0gcysM6iRBBn2bzhmmrKHr5PXBF9iQcIzI9BgCYrDirUrnW9ccAZy2KdP/ZR C+sCpf7BNXyUPwvZ5gGdaxSX3DDFwLbzhwPUBhh3rN8j0kBKfPzddKgmgHKO5d/B/r 0+C17OGde7Q+Q== From: Helge Deller To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matt Turner , Laurent Vivier , Helge Deller Subject: [PULL 3/7] linux-user/alpha: write the floating-point registers to a core dump Date: Wed, 12 Aug 2026 22:37:21 +0200 Message-ID: <20260812203725.10694-4-deller@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260812203725.10694-1-deller@kernel.org> References: <20260812203725.10694-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=deller@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.104, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1786567106289158500 Content-Type: text/plain; charset="utf-8" From: Matt Turner A guest core carried only the general-purpose registers, so a debugger opening one reported every floating-point register as unavailable -- including the arguments of the function that crashed. Implement HAVE_ELF_CORE_FPREGS for Alpha: define target_elf_fpregset_t to match the kernel's layout ($f0-$f30 plus the control register in the slot $f31 would occupy) and fill it from elf_core_copy_fpregs(). Checked with lldb on a core from a program that faults with live values in $f16 and $f17: both read back correctly, as does the control register. Signed-off-by: Matt Turner Reviewed-by: Helge Deller Signed-off-by: Helge Deller --- linux-user/alpha/elfload.c | 10 ++++++++++ linux-user/alpha/target_elf.h | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/linux-user/alpha/elfload.c b/linux-user/alpha/elfload.c index 7be9e466b6..c2517516ad 100644 --- a/linux-user/alpha/elfload.c +++ b/linux-user/alpha/elfload.c @@ -32,3 +32,13 @@ const char *get_elf_cpu_model(uint32_t eflags) { return "ev67"; } + +void elf_core_copy_fpregs(target_elf_fpregset_t *r, const CPUAlphaState *e= nv) +{ + int i; + + for (i =3D 0; i < 31; i++) { + r->fpr[i] =3D tswap64(env->fir[i]); + } + r->fpcr =3D tswap64(cpu_alpha_load_fpcr((CPUAlphaState *)env)); +} diff --git a/linux-user/alpha/target_elf.h b/linux-user/alpha/target_elf.h index dd90c6f783..5efe7f3174 100644 --- a/linux-user/alpha/target_elf.h +++ b/linux-user/alpha/target_elf.h @@ -19,6 +19,17 @@ * r0-r30 at indices 0-30, pc at 31, ps at 32. * r31 (hardwired zero) is not stored; pc occupies index 31. */ +/* + * The floating-point note holds $f0 through $f30 and then the control + * register in the slot $f31 would occupy; $f31 reads as zero. + */ +#define HAVE_ELF_CORE_FPREGS 1 + +typedef struct target_elf_fpregset_t { + uint64_t fpr[31]; /* $f0-$f30 */ + uint64_t fpcr; /* the slot for $f31 */ +} target_elf_fpregset_t; + typedef struct target_elf_gregset_t { abi_ulong regs[31]; /* integer registers r0-r30 [0..30] */ abi_ulong pc; /* program counter [31] */ --=20 2.54.0 From nobody Wed Aug 26 07:24:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1786567104; cv=none; d=zohomail.com; s=zohoarc; b=nvt+IfKDK0AowzqAtcgMtD5MvPdJD47BaTsQ2GP3jRtVQ/yhwLwSQ6R+n8HF7kbYhqUpgJAon4BFNTRCOmGwXRd/yZWp7tTxIxt4i/duG6drwoP3V9nnkKoir+6oY4SFxFeWekOe/Q37OMWcKW+3h4d9HBJKlDKuDAI41KXbJE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786567104; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=l9mybwz/TyY+oyBh3FK+zP6geKy0Ld5o+RX6e2KU+gs=; b=SyEyhNgoBjPRXGC2q1KPXVnKvQoPIjMBc66/pwSySOyFKbOyteRFs/Y/PViV3e2IyEjSJM+KkCRI+gnlZQ/I1aWDwQIJ6OJ3GHJFk/jBwf2Fvc1MMvhw2tQVbsSF6SALQTQfW8uy1YQDeWwTL0ov2KWrfEIkVxH4PadettPCUZI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786567104424111.11560679619834; Wed, 12 Aug 2026 13:38:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuFhl-0007UP-AC; Wed, 12 Aug 2026 16:37:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhk-0007TE-3f for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:40 -0400 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhh-0001Ek-Cw for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:39 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 2C75C4345E; Wed, 12 Aug 2026 20:37:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9666D1F00A3A; Wed, 12 Aug 2026 20:37:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786567056; bh=l9mybwz/TyY+oyBh3FK+zP6geKy0Ld5o+RX6e2KU+gs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mzRT4v0UP+zCIb50s3u7PnoeIR4o+tgOZfsSBAf2bNr5AigHUYghMf5UUeXbDx/TH /MsSJbBU0ikAKMuwwVFLMdroJd6u1F2or1AZc8wrzJv9e2ivLTCVJeu+2B0EZU2/Ag XezX0mKgPb7HglLZE3daK0axWtVH9yI5y/kRtFnOy2QSulrCm/nhO7/GbN0nhnv9jZ fzQwhP6x3hHIISsvCEMrwG+IC+Soe5OUzQZYlj7Nr1XlqAb8l3Eh5l7Z6AZKJRJ+Kg ZRL0iCtBZ1sLFaQkAugt7DkbcvGrQz13QEX7n6ZUkv9LPvDmzP7cD7Uv1t7FyM7FkV M3L8qaJfc4Bbg== From: Helge Deller To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matt Turner , Laurent Vivier , Helge Deller Subject: [PULL 4/7] linux-user/mips: write the floating-point registers to a core dump Date: Wed, 12 Aug 2026 22:37:22 +0200 Message-ID: <20260812203725.10694-5-deller@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260812203725.10694-1-deller@kernel.org> References: <20260812203725.10694-1-deller@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=172.234.252.31; envelope-from=deller@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.104, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1786567106345158500 From: Matt Turner Write an NT_FPREGSET note for MIPS and MIPS64, matching the kernel's elf_fpregset_t layout (ELF_NFPREG =3D 33): fpr[0..31] hold f0-f31, and fcsr occupies the low 32 bits of slot 32. The pad field rounds the struct to 33 =C3=97 8 bytes =3D 264 bytes. Signed-off-by: Matt Turner Reviewed-by: Helge Deller Signed-off-by: Helge Deller --- linux-user/mips/elfload.c | 8 ++++++++ linux-user/mips/target_elf.h | 13 +++++++++++++ linux-user/mips64/target_elf.h | 13 +++++++++++++ 3 files changed, 34 insertions(+) diff --git a/linux-user/mips/elfload.c b/linux-user/mips/elfload.c index ce2c4514f3..1d62ae0a4d 100644 --- a/linux-user/mips/elfload.c +++ b/linux-user/mips/elfload.c @@ -130,6 +130,14 @@ const char *get_elf_base_platform(CPUState *cs) =20 #undef MATCH_PLATFORM_INSN =20 +void elf_core_copy_fpregs(target_elf_fpregset_t *r, const CPUMIPSState *en= v) +{ + for (int i =3D 0; i < 32; i++) { + r->fpr[i] =3D tswap64(env->active_fpu.fpr[i].d); + } + r->fcsr =3D tswap32(env->active_fpu.fcr31); +} + /* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ #ifndef TARGET_MIPS64 void elf_core_copy_regs(target_elf_gregset_t *r, const CPUMIPSState *env) diff --git a/linux-user/mips/target_elf.h b/linux-user/mips/target_elf.h index 157306f7a0..426f905d3a 100644 --- a/linux-user/mips/target_elf.h +++ b/linux-user/mips/target_elf.h @@ -26,4 +26,17 @@ typedef struct target_elf_gregset_t { }; } target_elf_gregset_t; =20 +#define HAVE_ELF_CORE_FPREGS 1 + +/* + * Matches the kernel's elf_fpregset_t (ELF_NFPREG =3D 33): + * fpr[0..31] hold f0-f31; fcsr occupies the low 32 bits of slot 32. + * pad rounds the struct to 33 =C3=97 8 bytes =3D 264 bytes. + */ +typedef struct target_elf_fpregset_t { + uint64_t fpr[32]; + uint32_t fcsr; + uint32_t pad; +} target_elf_fpregset_t; + #endif diff --git a/linux-user/mips64/target_elf.h b/linux-user/mips64/target_elf.h index 061471a0f1..efb5d97563 100644 --- a/linux-user/mips64/target_elf.h +++ b/linux-user/mips64/target_elf.h @@ -32,4 +32,17 @@ typedef struct target_elf_gregset_t { }; } target_elf_gregset_t; =20 +#define HAVE_ELF_CORE_FPREGS 1 + +/* + * Matches the kernel's elf_fpregset_t (ELF_NFPREG =3D 33): + * fpr[0..31] hold f0-f31; fcsr occupies the low 32 bits of slot 32. + * pad rounds the struct to 33 =C3=97 8 bytes =3D 264 bytes. + */ +typedef struct target_elf_fpregset_t { + uint64_t fpr[32]; + uint32_t fcsr; + uint32_t pad; +} target_elf_fpregset_t; + #endif --=20 2.54.0 From nobody Wed Aug 26 07:24:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1786567105; cv=none; d=zohomail.com; s=zohoarc; b=C47gkR88ahEa8nlGESIa6K/5dtIKgP5Yk5BFRKV9EBOrmMDK/yQlSOvU3QhaM3dP9nX6VvoukCiZrv0aWn15n/BsfcPnq2fmHIUeBHEYl9O8w0Wridv31lmqGU3awYqUKM5/OFTra24u4HpcS/RlMpxFERTpC80EWLIOj5IM4bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786567105; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=b1gjecfvURvkgSi1nzn8dMG1W4cgP5DdTO5dvb8Q3ZE=; b=nu/pza2/aW3/0odt4Fl2orNtey2o2BspxvNkj81PyH6LyE1vk/RnokKwIGrxaJsQyQ04FMHyqWHH90QA8GhPWnqwXCPPZcN/VEfheV+og0eh4c8v5F2vZKSdxmIaVN2Cs4oRkbcyT73OeQACuSMmoUBa4AP4xQ+Rc3YhMbUXl1Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786567105790312.74314070326295; Wed, 12 Aug 2026 13:38:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuFhn-0007aL-B7; Wed, 12 Aug 2026 16:37:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhk-0007Tm-DA for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:40 -0400 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhi-0001FD-Sw for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:40 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 018A043D16; Wed, 12 Aug 2026 20:37:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 712121F000E9; Wed, 12 Aug 2026 20:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786567057; bh=b1gjecfvURvkgSi1nzn8dMG1W4cgP5DdTO5dvb8Q3ZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RvApI3vznDrY/f5yxclAA+tvuyepxu/Mqp57EeMwhXJENktKjHp0eeFdYcV7ac79w 0GSPGL3sZJea5gPxg2uZIU6GtEM7sz6VwyA3+vvlHwPzYMZUmaBRqWlDK5RDGOUA7F 5WXBecJtjGMrJfcVXITJQ/fwFjMsq0ZEoRF5VNR31sId6HdHA1OBvgLh8vbIS5DsjD z8dHmbnbjAtnxwAayJPdimS4gphl6vxwuYCiFXLNPtHSJoaV2LD5uU8Nyx43xdG7h9 mEYlTPi9Qq7sTeLXiRtndqTOOgADPp2D9Iddtf3/NYhhlFgQ4aTe/co6oMw0ZGCJ6A X5CSOWXHc5h5w== From: Helge Deller To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matt Turner , Laurent Vivier , Helge Deller Subject: [PULL 5/7] linux-user/hppa: write the floating-point registers to a core dump Date: Wed, 12 Aug 2026 22:37:23 +0200 Message-ID: <20260812203725.10694-6-deller@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260812203725.10694-1-deller@kernel.org> References: <20260812203725.10694-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=172.234.252.31; envelope-from=deller@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.104, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1786567107693158500 Content-Type: text/plain; charset="utf-8" From: Matt Turner Write an NT_FPREGSET note for HPPA, matching the kernel's elf_fpregset_t layout (ELF_NFPREG =3D 32): fr0-fr31 as 64-bit values. Signed-off-by: Matt Turner Reviewed-by: Helge Deller Signed-off-by: Helge Deller --- linux-user/hppa/elfload.c | 7 +++++++ linux-user/hppa/target_elf.h | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/linux-user/hppa/elfload.c b/linux-user/hppa/elfload.c index ff4301b2ed..dd5b0b380e 100644 --- a/linux-user/hppa/elfload.c +++ b/linux-user/hppa/elfload.c @@ -17,6 +17,13 @@ const char *get_elf_platform(CPUState *cs) return "PARISC"; } =20 +void elf_core_copy_fpregs(target_elf_fpregset_t *r, const CPUArchState *en= v) +{ + for (int i =3D 0; i < 32; i++) { + r->fpr[i] =3D tswap64(env->fr[i]); + } +} + void elf_core_copy_regs(target_elf_gregset_t *r, const CPUArchState *env) { int i; diff --git a/linux-user/hppa/target_elf.h b/linux-user/hppa/target_elf.h index 22547b1437..4357873aff 100644 --- a/linux-user/hppa/target_elf.h +++ b/linux-user/hppa/target_elf.h @@ -39,4 +39,13 @@ typedef struct target_elf_gregset_t { #define STACK_ALIGNMENT 64 #define VDSO_HEADER "vdso.c.inc" =20 +#define HAVE_ELF_CORE_FPREGS 1 + +/* + * Matches the kernel's elf_fpregset_t (ELF_NFPREG =3D 32): fr0-fr31. + */ +typedef struct target_elf_fpregset_t { + uint64_t fpr[32]; +} target_elf_fpregset_t; + #endif --=20 2.54.0 From nobody Wed Aug 26 07:24:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1786567104; cv=none; d=zohomail.com; s=zohoarc; b=RNAgA6l2o3rCWN7mjG4oL/3/WpKBo42IphG9Y2/B8KNMQ8O1lbPf1BEsLYflS6ePFsek0L91NVnXIIe0Jr6xAvN1NImdTJaoN1pj5na1NtwLBbFd0JXEL0P+mZ+XZUk80Cu3SFfLpf2hTQzcQzvB3cSFznGmXGbRZ1QNRnQ2uDI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786567104; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=2H7HVfwqlDxoeLXTzIQpGxDP5wgRXBpmf4KDHNqccOE=; b=B8HSJf+NtFoYXLTEHQg8vRIlvLfnE8QtI/uRpFhwcs22AD7ceYjA8AfTxWGwq8Tal4XF91nno9eIY1NjjJWpxmz259elD+Lb1+AKqFhMNFbAOm5fbE7yiQNfT7k7eo0TNJaUD3XpMJM197wSAyNQA356btjT8ROlI6dd1IhabeE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786567104489388.44365806724943; Wed, 12 Aug 2026 13:38:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuFhp-0007fU-G8; Wed, 12 Aug 2026 16:37:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhm-0007XT-G6 for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:42 -0400 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhk-0001Fg-MP for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:41 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id CFC4240388; Wed, 12 Aug 2026 20:37:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CA091F000E9; Wed, 12 Aug 2026 20:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786567059; bh=2H7HVfwqlDxoeLXTzIQpGxDP5wgRXBpmf4KDHNqccOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OmsqnO4jW/VM/haUOgAINDVRNjvzdD8wfyDmUVdVv9PY1oCGvgL0dGvkJs6vRdf6S A4mxOicrh/XjkFsxO6PldcRNYgi+FF2XXeGz2aaeovjbxdX1trWV4qyNKxYJXOI+nz DdiYi+4J7rwlaxqoZfxN4rdfgZHJiMIJCg8IFqQ/N6sf2+SvtFsAUDvnmbh8QhxAgw 39yxV+Z9TKdPx/JTHw9x18Em6Aywdf80attVmTb6O8klICil3q2VVNG3fhMOCwKI7a d5+wfJrC5tJkJJ/NmNZjpuNnwR2441VM5i6RlsMQg0YGPFJ6qL4APXhDO3JUZ8zwWW thSQ5tuAZSr6g== From: Helge Deller To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matt Turner , Laurent Vivier , Helge Deller Subject: [PULL 6/7] linux-user/riscv: write the floating-point registers to a core dump Date: Wed, 12 Aug 2026 22:37:24 +0200 Message-ID: <20260812203725.10694-7-deller@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260812203725.10694-1-deller@kernel.org> References: <20260812203725.10694-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=deller@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.104, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1786567106261158500 Content-Type: text/plain; charset="utf-8" From: Matt Turner Write an NT_FPREGSET note for RISC-V, matching struct __riscv_d_ext_state from uapi/asm/ptrace.h: f0-f31 as 64-bit values followed by fcsr. Signed-off-by: Matt Turner Reviewed-by: Helge Deller Signed-off-by: Helge Deller --- linux-user/riscv/elfload.c | 9 +++++++++ linux-user/riscv/target_elf.h | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/linux-user/riscv/elfload.c b/linux-user/riscv/elfload.c index afe103a631..1bc8beacb1 100644 --- a/linux-user/riscv/elfload.c +++ b/linux-user/riscv/elfload.c @@ -11,6 +11,15 @@ const char *get_elf_cpu_model(uint32_t eflags) return "max"; } =20 +void elf_core_copy_fpregs(target_elf_fpregset_t *r, const CPURISCVState *e= nv) +{ + for (int i =3D 0; i < 32; i++) { + r->fpr[i] =3D tswap64(env->fpr[i]); + } + r->fcsr =3D tswap32(((uint32_t)env->frm << FSR_RD_SHIFT) | + (riscv_cpu_get_fflags((CPURISCVState *)env) << FSR_A= EXC_SHIFT)); +} + void elf_core_copy_regs(target_elf_gregset_t *r, const CPURISCVState *env) { r->pc =3D tswapal(env->pc); diff --git a/linux-user/riscv/target_elf.h b/linux-user/riscv/target_elf.h index 859f726578..185b81a2db 100644 --- a/linux-user/riscv/target_elf.h +++ b/linux-user/riscv/target_elf.h @@ -27,4 +27,15 @@ typedef struct target_elf_gregset_t { abi_ulong regs[31]; } target_elf_gregset_t; =20 +#define HAVE_ELF_CORE_FPREGS 1 + +/* + * Matches struct __riscv_d_ext_state from uapi/asm/ptrace.h: + * f0-f31 as 64-bit values followed by fcsr. + */ +typedef struct target_elf_fpregset_t { + uint64_t fpr[32]; + uint32_t fcsr; +} target_elf_fpregset_t; + #endif --=20 2.54.0 From nobody Wed Aug 26 07:24:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1786567136; cv=none; d=zohomail.com; s=zohoarc; b=Ah5ZzUiaT5RlyV+3zQswmPaXpCsqNvyNqYotZ0GYzLoKkQJHOgNNGu48bjDbnYqGn59XvRf0lFIR2QNLvxkv8ddS3ofnFGZrLT4/sU0pa6fpLOUzt/9LlOTmtoIgwoxqp6HyFbDwUZr8JPLJ+/+6tp21PGGF+VfhsSjGKY5+lSY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786567136; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dicr7kXHpKoGDmwM+D7ifwOf8SSs+dBKXD26tHCiMFk=; b=Wa9QdHdJ7x/X1hJ6fjHO3hAZlJ115mm6nBmpjJ9Cdpg8gtG70E40etfqiY0AVPfEEtO3+JyPwQLr5iEi2ZeqwNM+xMN1cRTtRfvcYX+AUOeVHktaMZeLbPxDmIRyH4UgSIZRuELihV/nN6RQaGhHZt+9FZn0O8ruaPQgFoy3NGw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786567136166768.8139463165521; Wed, 12 Aug 2026 13:38:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuFhq-0007gX-0b; Wed, 12 Aug 2026 16:37:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhn-0007dT-RK for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:43 -0400 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wuFhm-0001Gb-FO for qemu-devel@nongnu.org; Wed, 12 Aug 2026 16:37:43 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id D69D9600AF; Wed, 12 Aug 2026 20:37:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26DDE1F000E9; Wed, 12 Aug 2026 20:37:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786567061; bh=dicr7kXHpKoGDmwM+D7ifwOf8SSs+dBKXD26tHCiMFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Suz+ewCooaxaEByR04MDrvYe/ffK9eT613QeB7sMoAb12/nPX3xxVQba906cpV8lA 9cDm9YIfIUzTLJGabpSWlMFT+o1xCauuOG2hl/Mk68jKrYbYAzlW6PfHq5qoEANHZ8 eh5JQeWCfwntGOp6JPi3oSyrZ40zUeyNQ39yHM7r45fYLD/zUx9NJ3awfoxUX5N8PD n1W44aIjH3ePWSjScINKhegI2WgDZCAAlBXSilwQ+hzGrG2or6qLsJbV5Ep/0prM5B x0cLePxFabT4aQYdQQ8ZLeivXOix3XDf+eLG53S0Aq0vlMvu6/GPGQWKHcQwSapKt+ I6grWsYxR4p3g== From: Helge Deller To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Matt Turner , Laurent Vivier , Helge Deller Subject: [PULL 7/7] linux-user/sh4: write the floating-point registers to a core dump Date: Wed, 12 Aug 2026 22:37:25 +0200 Message-ID: <20260812203725.10694-8-deller@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260812203725.10694-1-deller@kernel.org> References: <20260812203725.10694-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c04:e001:324:0:1991:8:25; envelope-from=deller@kernel.org; helo=tor.source.kernel.org X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.104, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1786567138280158500 Content-Type: text/plain; charset="utf-8" From: Matt Turner Write an NT_FPREGSET note for SH4, matching struct user_fpu_struct from arch/sh/include/asm/user.h: fr0-fr15, xf0-xf15, fpscr, fpul. Signed-off-by: Matt Turner Reviewed-by: Helge Deller Signed-off-by: Helge Deller --- linux-user/sh4/elfload.c | 10 ++++++++++ linux-user/sh4/target_elf.h | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/linux-user/sh4/elfload.c b/linux-user/sh4/elfload.c index f03ce49e7d..41601626ca 100644 --- a/linux-user/sh4/elfload.c +++ b/linux-user/sh4/elfload.c @@ -52,6 +52,16 @@ abi_ulong get_elf_hwcap(CPUState *cs) return hwcap; } =20 +void elf_core_copy_fpregs(target_elf_fpregset_t *r, const CPUSH4State *env) +{ + for (int i =3D 0; i < 16; i++) { + r->fpregs[i] =3D tswap32(env->fregs[i]); + r->xfpregs[i] =3D tswap32(env->fregs[16 + i]); + } + r->fpscr =3D tswap32(env->fpscr); + r->fpul =3D tswap32(env->fpul); +} + void elf_core_copy_regs(target_elf_gregset_t *r, const CPUSH4State *env) { for (int i =3D 0; i < 16; i++) { diff --git a/linux-user/sh4/target_elf.h b/linux-user/sh4/target_elf.h index 3fcb63d409..5923022036 100644 --- a/linux-user/sh4/target_elf.h +++ b/linux-user/sh4/target_elf.h @@ -25,4 +25,16 @@ typedef struct target_elf_gregset_t { struct target_pt_regs pt; } target_elf_gregset_t; =20 +#define HAVE_ELF_CORE_FPREGS 1 + +/* + * Matches struct user_fpu_struct from arch/sh/include/asm/user.h. + */ +typedef struct target_elf_fpregset_t { + uint32_t fpregs[16]; + uint32_t xfpregs[16]; + uint32_t fpscr; + uint32_t fpul; +} target_elf_fpregset_t; + #endif --=20 2.54.0