From nobody Sat Feb 7 08:02:32 2026 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 97EAA35CB9A; Tue, 27 Jan 2026 15:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769528043; cv=none; b=pkWyQ6FseYvnWq9OZVJPOf+ddUQc5RxktjWP0U1059/Il4hSbuTW9dTyOo1YeNlQszWz/VmYCm2wO3GoRnBkANjqcTlGrPzURcpDGX6qVsV0OAIBz0ZfUj2ojJomVHe+bmdMpsZdVRWbhMcnBVqoaCuZq72vV9sjAvyFfaUUS4k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769528043; c=relaxed/simple; bh=9DLKdTXoFCuhtc89mZMGllNE0yoAFFhZ91M2fyML8lA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bzpIOw1IAZyPB3mXgAbKtB5mYwde+dFKvz/6FQ13GNrec1eanp1hvRJ3f5jWmVfziIAagRzDecjw6MHz9ckTT+8GD7bCvdNTq2Wqzyte2ovdVvi9nyJjZV+JUL+VMcvdQn1N50sI+90JwvccEFq+zGoisN5E96+liCIWiTUs9zw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=izXTh/Qc; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="izXTh/Qc" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 60R4dY1S032521; Tue, 27 Jan 2026 15:33:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=hwRBNCHKaC4Z+b+Og bDactYuIMHhkLAQK6b65sb5zKo=; b=izXTh/QcsYomxXLC4BtdhecoibANGmhkA C+6PKlpGI+DQ2EGGRQkGSG1oEUvflg6u2xhYk+Q675l6NyYIxdLV7hZ48w0J95Kv yEPo2yW3UsovnDXaA8+EA/7coLEn5VT1IT6LF30XWa7+7tg/zks1gJyejmqx02C7 OlmWc90acwqZJRRx98VKcHqjikEIv+D0/DvfmvIdxr6wBnwUI/8wpXmxgszg8TsI kDILB14f7xt7cvfRCl4BPCL+2378qOHl9G6FQ6QFwFgdWjmHfnONKa5YjeS/TZCI 9MwU8eDSX/A4XhSdAGn/2QNKNVOIOD2hC3a+rLAqm9qlT7UysR1eA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bvnrte42u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:39 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 60RErwEA017974; Tue, 27 Jan 2026 15:33:38 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bvnrte42q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:38 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 60RF0BC6018303; Tue, 27 Jan 2026 15:33:37 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4bwb41rx1t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:37 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 60RFXXZ044499356 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jan 2026 15:33:33 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BAACE20040; Tue, 27 Jan 2026 15:33:33 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7352D2004E; Tue, 27 Jan 2026 15:33:33 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 27 Jan 2026 15:33:33 +0000 (GMT) From: Jens Remus To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-s390@vger.kernel.org, bpf@vger.kernel.org, x86@kernel.org, Steven Rostedt Cc: Jens Remus , Heiko Carstens , Vasily Gorbik , Ilya Leoshkevich , Josh Poimboeuf , Masami Hiramatsu , Mathieu Desnoyers , Peter Zijlstra , Ingo Molnar , Jiri Olsa , Arnaldo Carvalho de Melo , Namhyung Kim , Thomas Gleixner , Andrii Nakryiko , Indu Bhagat , "Jose E. Marchesi" , Beau Belgrave , Linus Torvalds , Andrew Morton , Florian Weimer , Kees Cook , "Carlos O'Donell" , Sam James , Dylan Hatch Subject: [RFC PATCH v1 1/5] unwind_user: Enable arch-specific signal frame unwinders Date: Tue, 27 Jan 2026 16:33:27 +0100 Message-ID: <20260127153331.2902504-2-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260127153331.2902504-1-jremus@linux.ibm.com> References: <20260127153331.2902504-1-jremus@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: nVRWLN5-QqZctx4hlKVy5MA3mvaUNbQl X-Authority-Analysis: v=2.4 cv=Uptu9uwB c=1 sm=1 tr=0 ts=6978dad3 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=6XKp6n-VjBup7wJUbcIA:9 X-Proofpoint-ORIG-GUID: 6sOBiRvTAc1dmvB3im-sLZpbTwqraB4L X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI3MDEyMSBTYWx0ZWRfXwjafthCE2cNu XyFru7ZdTZDpYjOWbD8UWXKLbpDd+hNrKJ/8WIFYZJzrS7JsktTkpW0/oOWdxgJbd1rmkhuHbeE mSy6Tqj+oBx6zUyyXej//O9E6ixZ53BSGh9V7L+pQ+EiD3opKCvXV3ZDpVY0ob3GifIUsflsTPx 5dM2UpdzocmM5hxebPev/9lJjFceK5uQEJf7+1KGCXJVtVjG8RlAX6uO1pYuljsclllIuh15rqJ e9LGN/E5cw6EZDNzQjfmaOzpoD2KT+mjfohMxH8mo04oULyiYyd/bTGP2HbsUG9ph3iLZc+rc0x FDsOmwQXO8sBhVW3cWC9ctMmPOrkGzepRPH8qVurfBE+Xhei/jmKeQB4NR0mvmYvn9oHmpjtgQn zKx0aS7cVNgwDzVVFv9fBx+8KBbdZpxUOAiMPmTq107+vm4Q0vOGtDvYMLkg0s7XxIyQf8v5B49 TpFEnto+p7TLqH4vn2A== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-27_03,2026-01-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 phishscore=0 adultscore=0 impostorscore=0 bulkscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2601150000 definitions=main-2601270121 Content-Type: text/plain; charset="utf-8" Add a signal flag to struct unwind_user_frame, which indicates whether the frame is a signal frame. If set unwind_user_common_next() uses an architecture-specific unwind_user_signal_next() implementation to unwind the frame. user unwind sframe will make use of the signal flag in a subsequent commit. Signed-off-by: Jens Remus --- arch/x86/include/asm/unwind_user.h | 6 ++++-- include/linux/unwind_user.h | 9 +++++++++ include/linux/unwind_user_types.h | 1 + kernel/unwind/user.c | 4 ++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/unwind_user.h b/arch/x86/include/asm/unwi= nd_user.h index f5e9fbcdae28..21cb9eeb2503 100644 --- a/arch/x86/include/asm/unwind_user.h +++ b/arch/x86/include/asm/unwind_user.h @@ -67,7 +67,8 @@ static inline int unwind_user_get_reg(unsigned long *val,= unsigned int regnum) .offset =3D -2*(ws), \ }, \ .sp_off =3D 0, \ - .outermost =3D false, + .outermost =3D false, \ + .signal =3D false, =20 #define ARCH_INIT_USER_FP_ENTRY_FRAME(ws) \ .cfa =3D { \ @@ -82,7 +83,8 @@ static inline int unwind_user_get_reg(unsigned long *val,= unsigned int regnum) .rule =3D UNWIND_USER_RULE_RETAIN,\ }, \ .sp_off =3D 0, \ - .outermost =3D false, + .outermost =3D false, \ + .signal =3D false, =20 static inline int unwind_user_fp_get_frame(struct unwind_user_state *state, struct unwind_user_frame *frame) diff --git a/include/linux/unwind_user.h b/include/linux/unwind_user.h index f65b0573b3a5..eb5de4cb5bd6 100644 --- a/include/linux/unwind_user.h +++ b/include/linux/unwind_user.h @@ -34,6 +34,15 @@ static inline int unwind_user_get_reg(unsigned long *val= , unsigned int regnum) #define unwind_user_get_reg unwind_user_get_reg #endif =20 +#ifndef unwind_user_signal_next +static inline int unwind_user_signal_next(struct unwind_user_state *state) +{ + WARN_ON_ONCE(1); + return -EINVAL; +} +#define unwind_user_signal_next unwind_user_signal_next +#endif + int unwind_user(struct unwind_stacktrace *trace, unsigned int max_entries); =20 #endif /* _LINUX_UNWIND_USER_H */ diff --git a/include/linux/unwind_user_types.h b/include/linux/unwind_user_= types.h index fac8f470b597..3985706d7851 100644 --- a/include/linux/unwind_user_types.h +++ b/include/linux/unwind_user_types.h @@ -68,6 +68,7 @@ struct unwind_user_frame { struct unwind_user_rule_data fp; s32 sp_off; bool outermost; + bool signal; }; =20 struct unwind_user_state { diff --git a/kernel/unwind/user.c b/kernel/unwind/user.c index a64ceb4a2bf6..b9a3b59e8282 100644 --- a/kernel/unwind/user.c +++ b/kernel/unwind/user.c @@ -32,6 +32,10 @@ static int unwind_user_next_common(struct unwind_user_st= ate *state, { unsigned long cfa, sp, fp, ra; =20 + /* Use signal frame unwinder for signal frames. */ + if (frame->signal) + return unwind_user_signal_next(state); + /* Stop unwinding when reaching an outermost frame. */ if (frame->outermost) { state->done =3D true; --=20 2.51.0 From nobody Sat Feb 7 08:02:32 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 72E9A2DFA46; Tue, 27 Jan 2026 15:33:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769528040; cv=none; b=DC7fBe6+j5j4AU7rxIJA4V2dezsE6wgHlIv/O+xlxSz9a5u94ePEifNiZTIbu1IGXzteJM2zOYU/4lk/H6FeGKB+kIDQbOqjtCpHmr5y83fAW7uPCkwELoBnpoRaCdgzm2F/2kyeX43PABRVuVcjQz/gwA243f8MjoPcxzJIqac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769528040; c=relaxed/simple; bh=8EpHxZmbo5MA89kwaBMFvsr5o9QT3VveoDjwUfOUgBE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZTPLr5TGkwXj/AytfDjCl0gtUh/uYbyrmlsLc+KAlQ4nwREvUWyzib6xbIWegUUGVoqhya0YWFkFTvlnZGvpa/vtSB6nPeHgnZq5ygB9hI/QTUtE5fUJROKCIRS4Rd1zZU/+UjsUoLKESJA2m6hKGdg+wyAIqcgFu5ns9ykZVg4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=Wh4gcOtU; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Wh4gcOtU" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 60R7xVZj021517; Tue, 27 Jan 2026 15:33:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=A6LNSorwzVv4H5Mhx oq3cEEmuKyMfMFGQ0xYyBTQIzg=; b=Wh4gcOtUlcxviEzQI7qHSGK6ylDMHEGaX UHrFXrMQIaH6eb4iNOOo9Qx/BjmRUWg7Gf3R8fFzf/a4xNDFtKmGCO/Ab1A6LVE6 fE9g5tpVs5U3e7h34jUQlEmcCDIZh/3m85fdMBdcj0jmdVeqRJc7qMk1plw8+/Qj OYcueNumLGcnZgNDzzsZvR4zkbChNvgtWXH4OXKEJMYS10mlW+cflpHjwXSRa9jc DcTSLMS/ghMXqHK8S79p9NVy3fMa6h+Yzj4Z2gWPX2/kewHV+Ezil/lIZUH0nvsx Owouv8nzKelRR6pqbYVFdRi2jOr+VwIrM2MDYXLJL8F86OHhUsToA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bvkgmmnnc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:39 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 60RFJc72000308; Tue, 27 Jan 2026 15:33:39 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bvkgmmnmy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:39 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 60RDXlxe026805; Tue, 27 Jan 2026 15:33:38 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4bw9wk94jf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:38 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 60RFXYR217826170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jan 2026 15:33:34 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1187E20040; Tue, 27 Jan 2026 15:33:34 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1C4020043; Tue, 27 Jan 2026 15:33:33 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 27 Jan 2026 15:33:33 +0000 (GMT) From: Jens Remus To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-s390@vger.kernel.org, bpf@vger.kernel.org, x86@kernel.org, Steven Rostedt Cc: Jens Remus , Heiko Carstens , Vasily Gorbik , Ilya Leoshkevich , Josh Poimboeuf , Masami Hiramatsu , Mathieu Desnoyers , Peter Zijlstra , Ingo Molnar , Jiri Olsa , Arnaldo Carvalho de Melo , Namhyung Kim , Thomas Gleixner , Andrii Nakryiko , Indu Bhagat , "Jose E. Marchesi" , Beau Belgrave , Linus Torvalds , Andrew Morton , Florian Weimer , Kees Cook , "Carlos O'Donell" , Sam James , Dylan Hatch Subject: [RFC PATCH v1 2/5] unwind_user/sframe: Add support for signal frame indication Date: Tue, 27 Jan 2026 16:33:28 +0100 Message-ID: <20260127153331.2902504-3-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260127153331.2902504-1-jremus@linux.ibm.com> References: <20260127153331.2902504-1-jremus@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=Gr1PO01C c=1 sm=1 tr=0 ts=6978dad3 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=2aD4vtywDDCJo0oALMAA:9 X-Proofpoint-GUID: 7V0RLH_uAxNet9SNUFsSWHiZ3uiWnj5f X-Proofpoint-ORIG-GUID: zWvwnW9BxTrisa8ZJ1QcNz7HD8q0pL7K X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI3MDEyNSBTYWx0ZWRfX4gj2vaKP5sGl j10QJ+t5anyfJa8nl2vSyXDe3LnULkBHEuvNVuz52n6zKXVIIFihkcEdOXrV6ANdnOHxLxuYtPc 4XLo0W5gprSAT/M9xbT3wO/fZ1HU5OyJG2e9jfQ2+QC2qgNZRuhxXYoc04pgVH9HqeGr1vMsbpE YwcvuJkl3fHQJcS1BVklp7gmSjWyck+l8mHbgEaor+eoA9jgK5Yuoj2RdahoVY5anfdKch3yCr2 8khSpefxYHhBce99Uw6yvuEX0rLrKYgwmA3rpaZiYtiR/f/TZAEkq8AcWiCNPQWiSH+913BPU1t f9DgCFOfnb2KAgxr0Gf9pSToymbo9L1/S0WJKPQJE1GW+VWs6XRFb//8VFH4Vs4M9AUZoI1Z1Fi OLOQFwkI1o3d/h1JIzzNVAVW/qvejxiII44c37yl+GrAxSIxcJw9Zc+shplUDqaZ7IozpGs3mcR zyBT2xomHdHC9uMRAGg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-27_03,2026-01-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 suspectscore=0 impostorscore=0 phishscore=0 malwarescore=0 adultscore=0 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2601150000 definitions=main-2601270125 Content-Type: text/plain; charset="utf-8" SFrame V3 represents the assembler directive .cfi_signal_frame using a SFrame FDE flag. Note that a SFrame FDE with this particular flag set may have no SFrame FREs. Introduce a SFRAME_V3_FDE_SIGNAL_P() helper macro. Use it in __find_fre() to populate the signal flag in struct unwind_user_frame, even if there are no FREs. Signed-off-by: Jens Remus --- kernel/unwind/sframe.c | 8 +++++++- kernel/unwind/sframe.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kernel/unwind/sframe.c b/kernel/unwind/sframe.c index 21283e3bda42..9fd2fc1572cc 100644 --- a/kernel/unwind/sframe.c +++ b/kernel/unwind/sframe.c @@ -446,6 +446,7 @@ static __always_inline int __find_fre(struct sframe_sec= tion *sec, struct unwind_user_frame *frame) { unsigned char fde_pctype =3D SFRAME_V3_FDE_PCTYPE(fde->info); + bool signal =3D SFRAME_V3_FDE_SIGNAL_P(fde->info); struct sframe_fre_internal *fre, *prev_fre =3D NULL; struct sframe_fre_internal fres[2]; unsigned long fre_addr; @@ -486,8 +487,11 @@ static __always_inline int __find_fre(struct sframe_se= ction *sec, prev_fre =3D fre; } =20 - if (!prev_fre) + if (!prev_fre) { + if (signal) + goto signal; return -EINVAL; + } fre =3D prev_fre; =20 ret =3D __read_fre_datawords(sec, fde, fre); @@ -500,6 +504,8 @@ static __always_inline int __find_fre(struct sframe_sec= tion *sec, sframe_init_rule_data(&frame->fp, fre->fp_ctl, fre->fp_off); frame->sp_off =3D SFRAME_SP_OFFSET; frame->outermost =3D SFRAME_V3_FRE_RA_UNDEFINED_P(fre->info); +signal: + frame->signal =3D signal; =20 return 0; } diff --git a/kernel/unwind/sframe.h b/kernel/unwind/sframe.h index 8a5322e95403..78432857f84c 100644 --- a/kernel/unwind/sframe.h +++ b/kernel/unwind/sframe.h @@ -65,6 +65,7 @@ struct sframe_fda_v3 { #define SFRAME_V3_FDE_FRE_TYPE(info) ((info) & 0xf) #define SFRAME_V3_FDE_PCTYPE(info) (((info) >> 4) & 0x1) #define SFRAME_V3_AARCH64_FDE_PAUTH_KEY(info) (((info) >> 5) & 0x1) +#define SFRAME_V3_FDE_SIGNAL_P(info) (((info) >> 7) & 0x1) =20 #define SFRAME_FDE_TYPE_REGULAR 0 #define SFRAME_FDE_TYPE_FLEXIBLE 1 --=20 2.51.0 From nobody Sat Feb 7 08:02:32 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 D45112E62C3; Tue, 27 Jan 2026 15:33:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769528039; cv=none; b=jj3iSn3YXLaAbUqYx9lsWBuxGuMbFdWpps2FRBLKMSaeGGX1fxvYR7P7XSQhgHdPsAZ6fOPAaeQJDOA9o/l0TY1KoIJW5KZlhOZFP6pGMR5nrBmVjzjnIe/FiHgKcq6KzUbVoLfBHsQ1ylIEcaNkFOjeS+IM034cxn0g1TsyR6A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769528039; c=relaxed/simple; bh=fckhmEHCu07z8Mxu4nptZTCsNrlx4U4UfODG2qNYOg8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uUu8QGuSc4zJ1ITdCHTFY3XlYu7HXaiqPOxf7sB9phh1Tb2l2C7KKlb41b6WEOK03gSd3ce+qnFXuS//cf889XDOFGB6r/eCGppA8jZQrraxun89msGJ93llAbviiqtvWePi/nr8XgZFDn0xRQAsVhdPMJSbNnwkMpfQJOZX4CU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=ajPwMbf5; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="ajPwMbf5" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 60R6iIkV015740; Tue, 27 Jan 2026 15:33:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=QZ99OWNmMBbUEI/up S6Lh/Pr3C7xmJcHJQVJOuXZK4Q=; b=ajPwMbf5t+HJKMFljln0ZDk5HV+yBxiyo AN8y6ysrBrh6Yov6dj9cekMV1wjIKOOTMV8elnCWRH/J+sXgQeQEywsRVlhN0pp5 FZd0ScQQPx+UHXUMzdvPg/IDQGuXIOcopKpvqS9Tp5IY9QWUk0Mq5LGoBfCf/e+8 HTRtRjccvcZzQ58Vff3b9w34Qgx4YsBpDinwT3vX7limAC66uh+dBZHoVhiSbKKU 4z07P3nw+UYGYT9mBC34HJN5Ay5Vt+PwSRWRHH4wBL5OR1EPhrOZY7Cyppw8MoOG S7Ji4wkYvyi3PGg4OaS8E/gaqdLtD931R3uJpPsyE8QQz5cWS2NJg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bvkgmmnnf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:39 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 60RFXdlo028803; Tue, 27 Jan 2026 15:33:39 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bvkgmmnmx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:39 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 60REjchQ018399; Tue, 27 Jan 2026 15:33:38 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4bwb41rx1u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:38 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 60RFXYXi17826174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jan 2026 15:33:34 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5A3F920043; Tue, 27 Jan 2026 15:33:34 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 16A8F2004E; Tue, 27 Jan 2026 15:33:34 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 27 Jan 2026 15:33:34 +0000 (GMT) From: Jens Remus To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-s390@vger.kernel.org, bpf@vger.kernel.org, x86@kernel.org, Steven Rostedt Cc: Jens Remus , Heiko Carstens , Vasily Gorbik , Ilya Leoshkevich , Josh Poimboeuf , Masami Hiramatsu , Mathieu Desnoyers , Peter Zijlstra , Ingo Molnar , Jiri Olsa , Arnaldo Carvalho de Melo , Namhyung Kim , Thomas Gleixner , Andrii Nakryiko , Indu Bhagat , "Jose E. Marchesi" , Beau Belgrave , Linus Torvalds , Andrew Morton , Florian Weimer , Kees Cook , "Carlos O'Donell" , Sam James , Dylan Hatch Subject: [RFC PATCH v1 3/5] s390/vdso: Annotate __kernel_[rt_]sigreturn as signal frames Date: Tue, 27 Jan 2026 16:33:29 +0100 Message-ID: <20260127153331.2902504-4-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260127153331.2902504-1-jremus@linux.ibm.com> References: <20260127153331.2902504-1-jremus@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=Gr1PO01C c=1 sm=1 tr=0 ts=6978dad3 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=zNkqyI7T-dXuitzZt0UA:9 X-Proofpoint-GUID: SY8BXNk1xyheiTHU5IBxjM5Ph5-Sya8r X-Proofpoint-ORIG-GUID: _BjtumY_aMyvFAWO4fAwnrAaACY4d7u3 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI3MDEyNSBTYWx0ZWRfX1DV/G7FoRixL PWN30h/Qeq3E5KxxA5Qix73RlQto54TqjoelNNP8ldv9Gqf+Y66qh59LUOAplvSXv0xC6bNkBH8 UHeB9lLvxvvHFD7Armf+Ul8TlaW3AtpCyaQcB9AIMMJ+yGuyS1RikwWG9ECh7eqsucNuyGHAkLd 5Cqk3JB0+Au8MUPwk+7iJyNApXXhSQ97RKDkZnX1uR07NMSg8gp3aYMT7HfvD2jrvCYuNEcX3Nk mHp42IJc8At5mZ2TiXjlZWGxrWUcZFQyy+O6G/ERVAhyO0UfXWR0L8zdPxJKiIrYBJRypV5egbS gkNIvhvwXkWDjhdTkmwu8vInRUDwOhqeFtqTH7MmfqgwcSTY0LJ4918SMEsbguML4eGCyP6MfDc dwufAqHukGY1C9vaTe2YeYsQw3Stiq2S8ow/p/RaFeE/ldSFi9DWvRdbhiiycl5At6RtHDNibLV lpcL/1fS6mcKAV3L39g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-27_03,2026-01-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 suspectscore=0 impostorscore=0 phishscore=0 malwarescore=0 adultscore=0 spamscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2601150000 definitions=main-2601270125 Content-Type: text/plain; charset="utf-8" The GNU assembler supports CFI directive .cfi_signal_frame with binutils 2.17+. Use it to annotate the vDSO functions __kernel_sigreturn() and __kernel_rt_sigreturn() as signal frames. This enables generation of SFrame stack trace information for the vDSO to likewise annotate these functions for use in stack tracers, such as the kernel unwind user sframe. Signed-off-by: Jens Remus --- arch/s390/include/asm/dwarf.h | 3 +++ arch/s390/kernel/vdso/vdso_user_wrapper.S | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/s390/include/asm/dwarf.h b/arch/s390/include/asm/dwarf.h index 2f148b15fd7d..e5663d6b11db 100644 --- a/arch/s390/include/asm/dwarf.h +++ b/arch/s390/include/asm/dwarf.h @@ -35,6 +35,8 @@ #define CFI_VAL_OFFSET nocfi #endif =20 +#define CFI_SIGNAL_FRAME .cfi_signal_frame + #else /* !BUILD_VDSO */ =20 /* @@ -49,6 +51,7 @@ #define CFI_RESTORE nocfi #define CFI_REL_OFFSET nocfi #define CFI_VAL_OFFSET nocfi +#define CFI_SIGNAL_FRAME nocfi =20 #endif /* !BUILD_VDSO */ =20 diff --git a/arch/s390/kernel/vdso/vdso_user_wrapper.S b/arch/s390/kernel/v= dso/vdso_user_wrapper.S index aa06c85bcbd3..757503929ab0 100644 --- a/arch/s390/kernel/vdso/vdso_user_wrapper.S +++ b/arch/s390/kernel/vdso/vdso_user_wrapper.S @@ -47,6 +47,17 @@ SYM_FUNC_START(__kernel_\func) SYM_FUNC_END(__kernel_\func) .endm =20 +.macro vdso_syscall_sf func,syscall +SYM_FUNC_START(__kernel_\func) + CFI_STARTPROC simple + CFI_SIGNAL_FRAME + svc \syscall + /* Trap, if syscall returns, which shouldn't happen */ + .insn e,0x0000 + CFI_ENDPROC +SYM_FUNC_END(__kernel_\func) +.endm + vdso_syscall restart_syscall,__NR_restart_syscall -vdso_syscall sigreturn,__NR_sigreturn -vdso_syscall rt_sigreturn,__NR_rt_sigreturn +vdso_syscall_sf sigreturn,__NR_sigreturn +vdso_syscall_sf rt_sigreturn,__NR_rt_sigreturn --=20 2.51.0 From nobody Sat Feb 7 08:02:32 2026 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 EED5E2652B2; Tue, 27 Jan 2026 15:33:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769528040; cv=none; b=s+N2goXYkiezcUBnkX/mTJlA48Kx/R6D6wcUgQ18iA23vIdL5A9lqhEJ303s47o0Xsaa9HYz/mV1iFBhqdKEZDHixNyEScz6EcTSXDgGmlkoVtdl1t7GZkpm5Se+3fDF9XuDPnNX2wxWWM8r9G/yoXkxX2EDzYDg1mUQ5r9TP7k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769528040; c=relaxed/simple; bh=6wF8XaQDxfz966svEGjEX62SHz+yu4PVfqIF2EC8+bI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dgunWYQWc0EZ591YKrGCwkeZpavYEnZKSdrU4Y1ue24LSmUEJ69OeeaZmODxgeoU+BPB2R00fd9E850n3cWAVijuU9pG2571G3fK1m9yFijQi/w4m+6aHdnjaFIQiUFI2JpenegfaDDzwtWYU7ToEqZPZ+IrnJiOMB7xANZ98ok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=Jp2Mj893; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Jp2Mj893" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 60R4IfNG010997; Tue, 27 Jan 2026 15:33:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=q9xWw3J6O/0w+A2Ag FzZG5+Z1M2XrO4YIdPqlsT8BVk=; b=Jp2Mj8932FMCdb+TT6aofLZAlp0RJ/sHQ XKip5bXq91kQnG8RBx+mjQvGBpi1CkSyDvwcbjhg5LI+Y46pTJXlB4DvvAVP0yFz JMOXgRnP24VeIPtl6ZClJcsWfTfxFHol0XWRBpLP98MdTU78B43GEVAM9ru5L6B3 skrhIUlPzvAs6gnDUIYCYORk2ogRJs4uBQ2+pQi88DBINt+CrGFfxsUmC4U6W/3j Qb1sJgxiROtF+byU+QRvfX05vX6r+DffOpMD30F0L+tWgdN2QGhVLzlcuTE7xWqA ewNBV6qofLVvA/VcyxgFefiOCILji4DSceCSTQQliFtjBKtIVQU5w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bvnt7p63h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:40 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 60RFTQ8b013023; Tue, 27 Jan 2026 15:33:40 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bvnt7p63b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:39 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 60RDaigl026334; Tue, 27 Jan 2026 15:33:38 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4bw9wk94jj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:38 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 60RFXY8617826178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jan 2026 15:33:34 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A56D220043; Tue, 27 Jan 2026 15:33:34 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 60C4C20040; Tue, 27 Jan 2026 15:33:34 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 27 Jan 2026 15:33:34 +0000 (GMT) From: Jens Remus To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-s390@vger.kernel.org, bpf@vger.kernel.org, x86@kernel.org, Steven Rostedt Cc: Jens Remus , Heiko Carstens , Vasily Gorbik , Ilya Leoshkevich , Josh Poimboeuf , Masami Hiramatsu , Mathieu Desnoyers , Peter Zijlstra , Ingo Molnar , Jiri Olsa , Arnaldo Carvalho de Melo , Namhyung Kim , Thomas Gleixner , Andrii Nakryiko , Indu Bhagat , "Jose E. Marchesi" , Beau Belgrave , Linus Torvalds , Andrew Morton , Florian Weimer , Kees Cook , "Carlos O'Donell" , Sam James , Dylan Hatch Subject: [RFC PATCH v1 4/5] s390/signal: Move struct [rt_]sigframe to asm/sigframe.h Date: Tue, 27 Jan 2026 16:33:30 +0100 Message-ID: <20260127153331.2902504-5-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260127153331.2902504-1-jremus@linux.ibm.com> References: <20260127153331.2902504-1-jremus@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Qb4EApp12JCRn_T5hpvaHaPXdJqDRXMm X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI3MDEyNSBTYWx0ZWRfX3Wku2S3ysnWv m1+BsFGQEBmf/HQAYi0Aw26JFSB5L4JCqGkNCmFOjBU9BnNChHUM8YSEmJNcBmbF19mJKjWJd19 sH7SSYSiVHNgVvBewPQMW/Ag+fM927aK79TL/kmpuGFXeq64XVY7vYJLzc6QWK5/OaJymQdsDOr aspLIliNQuQQrybuHE0vRnzx/9UUE1jJ7+M/3SHTlULd7oah43PpUKpMZT7QN3Ra/HF41M83Gw3 7OrbLSM/ZeESAR8ntJiHzaS4ibEY8E8AG4REh5SLC+td8kghD5WLalb/8BbaM8p54Kfx/a/p/k1 996JleWH+drlaA++ntq1rVBrCMAZAuGJWfo9wtcrivWJaSkqVm7at1vNfYSVTSH0yxAj4hGpw8t DnOaGHQ+SLcM3qiNSpr/iCtTtu26Ng3xlTNmSivMvscpdSBAJO1uHSKlkl4IoPhLq+peuI0Sr7c OIIeSDJFudjMBsJk5gw== X-Authority-Analysis: v=2.4 cv=Zs3g6t7G c=1 sm=1 tr=0 ts=6978dad4 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=vr68hYBkSomNBJpq4wcA:9 X-Proofpoint-ORIG-GUID: hpKplGUd3QhEkBUect78SS6ekHow8NrU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-27_03,2026-01-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2601150000 definitions=main-2601270125 Content-Type: text/plain; charset="utf-8" This enables use of struct sigframe and struct rt_sigframe elsewhere, such as unwind user. Signed-off-by: Jens Remus --- arch/s390/include/asm/sigframe.h | 78 ++++++++++++++++++++++++++++++++ arch/s390/kernel/signal.c | 71 +---------------------------- 2 files changed, 79 insertions(+), 70 deletions(-) create mode 100644 arch/s390/include/asm/sigframe.h diff --git a/arch/s390/include/asm/sigframe.h b/arch/s390/include/asm/sigfr= ame.h new file mode 100644 index 000000000000..7539fd802675 --- /dev/null +++ b/arch/s390/include/asm/sigframe.h @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef _ASM_S390_SIGFRAME_H +#define _ASM_S390_SIGFRAME_H + +#include +#include + +/* + * Layout of an old-style signal-frame: + * ----------------------------------------- + * | save area (_SIGNAL_FRAMESIZE) | + * ----------------------------------------- + * | struct sigcontext | + * | oldmask | + * | _sigregs * | + * ----------------------------------------- + * | _sigregs with | + * | _s390_regs_common | + * | _s390_fp_regs | + * ----------------------------------------- + * | int signo | + * ----------------------------------------- + * | _sigregs_ext with | + * | gprs_high 64 byte (opt) | + * | vxrs_low 128 byte (opt) | + * | vxrs_high 256 byte (opt) | + * | reserved 128 byte (opt) | + * ----------------------------------------- + * | __u16 svc_insn | + * ----------------------------------------- + * The svc_insn entry with the sigreturn system call opcode does not + * have a fixed position and moves if gprs_high or vxrs exist. + * Future extensions will be added to _sigregs_ext. + */ +struct sigframe +{ + __u8 callee_used_stack[__SIGNAL_FRAMESIZE]; + struct sigcontext sc; + _sigregs sregs; + int signo; + _sigregs_ext sregs_ext; + __u16 svc_insn; /* Offset of svc_insn is NOT fixed! */ +}; + +/* + * Layout of an rt signal-frame: + * ----------------------------------------- + * | save area (_SIGNAL_FRAMESIZE) | + * ----------------------------------------- + * | svc __NR_rt_sigreturn 2 byte | + * ----------------------------------------- + * | struct siginfo | + * ----------------------------------------- + * | struct ucontext_extended with | + * | unsigned long uc_flags | + * | struct ucontext *uc_link | + * | stack_t uc_stack | + * | _sigregs uc_mcontext with | + * | _s390_regs_common | + * | _s390_fp_regs | + * | sigset_t uc_sigmask | + * | _sigregs_ext uc_mcontext_ext | + * | gprs_high 64 byte (opt) | + * | vxrs_low 128 byte (opt) | + * | vxrs_high 256 byte (opt)| + * | reserved 128 byte (opt) | + * ----------------------------------------- + * Future extensions will be added to _sigregs_ext. + */ +struct rt_sigframe +{ + __u8 callee_used_stack[__SIGNAL_FRAMESIZE]; + __u16 svc_insn; + struct siginfo info; + struct ucontext_extended uc; +}; + +#endif /* _ASM_S390_SIGFRAME_H */ diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index 4874de5edea0..42675066399f 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c @@ -32,78 +32,9 @@ #include #include #include +#include #include "entry.h" =20 -/* - * Layout of an old-style signal-frame: - * ----------------------------------------- - * | save area (_SIGNAL_FRAMESIZE) | - * ----------------------------------------- - * | struct sigcontext | - * | oldmask | - * | _sigregs * | - * ----------------------------------------- - * | _sigregs with | - * | _s390_regs_common | - * | _s390_fp_regs | - * ----------------------------------------- - * | int signo | - * ----------------------------------------- - * | _sigregs_ext with | - * | gprs_high 64 byte (opt) | - * | vxrs_low 128 byte (opt) | - * | vxrs_high 256 byte (opt) | - * | reserved 128 byte (opt) | - * ----------------------------------------- - * | __u16 svc_insn | - * ----------------------------------------- - * The svc_insn entry with the sigreturn system call opcode does not - * have a fixed position and moves if gprs_high or vxrs exist. - * Future extensions will be added to _sigregs_ext. - */ -struct sigframe -{ - __u8 callee_used_stack[__SIGNAL_FRAMESIZE]; - struct sigcontext sc; - _sigregs sregs; - int signo; - _sigregs_ext sregs_ext; - __u16 svc_insn; /* Offset of svc_insn is NOT fixed! */ -}; - -/* - * Layout of an rt signal-frame: - * ----------------------------------------- - * | save area (_SIGNAL_FRAMESIZE) | - * ----------------------------------------- - * | svc __NR_rt_sigreturn 2 byte | - * ----------------------------------------- - * | struct siginfo | - * ----------------------------------------- - * | struct ucontext_extended with | - * | unsigned long uc_flags | - * | struct ucontext *uc_link | - * | stack_t uc_stack | - * | _sigregs uc_mcontext with | - * | _s390_regs_common | - * | _s390_fp_regs | - * | sigset_t uc_sigmask | - * | _sigregs_ext uc_mcontext_ext | - * | gprs_high 64 byte (opt) | - * | vxrs_low 128 byte (opt) | - * | vxrs_high 256 byte (opt)| - * | reserved 128 byte (opt) | - * ----------------------------------------- - * Future extensions will be added to _sigregs_ext. - */ -struct rt_sigframe -{ - __u8 callee_used_stack[__SIGNAL_FRAMESIZE]; - __u16 svc_insn; - struct siginfo info; - struct ucontext_extended uc; -}; - /* Store registers needed to create the signal frame */ static void store_sigregs(void) { --=20 2.51.0 From nobody Sat Feb 7 08:02:32 2026 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 EEDD827FB35; Tue, 27 Jan 2026 15:33:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769528040; cv=none; b=FOdHhq01i3u3qg6P83Z/dNjwJm+5TlNviFvmCuD7HJd/BmNfqpuJGF7sHTgz2ZwiZ7yGERigIvJQImZYv/iR5Ox12YbH/H6FBpgy+FqLxO7ZPw7a5Ozccx9GRHyhx9/6eJt+Rv3ICZwDYt598rlnMb6J9PFBig+0tbgPtlZhAB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769528040; c=relaxed/simple; bh=86jpirqaQmUPCyz8o+dsbMp2rt2TgCVsRD8m15jXVwo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MGZabkAyIa+1qQZR4ZWiXWf/mNokxA3gSvYAdKEza83TugUD6GHylToxDpZq+SRy5nNzhp7Uv6D/vIWVSi8QQpdwdC/H3ggfzYZmd2kf3abclOt5HJvzBdaD6W71nX8JLm+ZWD/7kNErzg+SP7WIkTmKT9rE4HazDf/XCZQfsDs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=K+x4OCS3; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="K+x4OCS3" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 60R80wYD010200; Tue, 27 Jan 2026 15:33:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=FZ8S4pktqaByy4bmM ZjsAmN/DAuj1dp0vk/8CjYYzGk=; b=K+x4OCS3ZZ75agk3mpGHGE2+vedZv/CpE sD1NjiKh/TlkmNpdhhlB4597f+J5FAktRHxoKV5rjdEIP20R2Q5lnWPvg/ZU98XX kXkox+i28VZnhlniPC0YSDJxJv8PAQQLozUZtACwwmpQP4Gh8b//3EDE8q9mA3Jl vGfI1svoATSlb8IfwCHLFXs6xy7wr5axAjMe9qKxt3cBoRe5JmpCZY2hjyToxa+4 rZfAd2dgWEoAEVifZz9fzH89S/eyHeNZcSCLuQ2Lo4nXMLbomIXb/OT9LOzW9OE9 RX60sOnQp9GDIb31c/rXzkBnV1KeZ35cS5ns7Ir4wn9QZ2S1NY/9A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bvnrte437-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:41 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 60RFTbBk027291; Tue, 27 Jan 2026 15:33:40 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bvnrte42y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:40 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 60RDnlDV026333; Tue, 27 Jan 2026 15:33:39 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4bw9wk94jk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:33:38 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 60RFXZZW51118590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jan 2026 15:33:35 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F24D720040; Tue, 27 Jan 2026 15:33:34 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AD4EB2004B; Tue, 27 Jan 2026 15:33:34 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 27 Jan 2026 15:33:34 +0000 (GMT) From: Jens Remus To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-s390@vger.kernel.org, bpf@vger.kernel.org, x86@kernel.org, Steven Rostedt Cc: Jens Remus , Heiko Carstens , Vasily Gorbik , Ilya Leoshkevich , Josh Poimboeuf , Masami Hiramatsu , Mathieu Desnoyers , Peter Zijlstra , Ingo Molnar , Jiri Olsa , Arnaldo Carvalho de Melo , Namhyung Kim , Thomas Gleixner , Andrii Nakryiko , Indu Bhagat , "Jose E. Marchesi" , Beau Belgrave , Linus Torvalds , Andrew Morton , Florian Weimer , Kees Cook , "Carlos O'Donell" , Sam James , Dylan Hatch Subject: [RFC PATCH v1 5/5] s390/unwind_user: Enable signal frame unwinding of user space Date: Tue, 27 Jan 2026 16:33:31 +0100 Message-ID: <20260127153331.2902504-6-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260127153331.2902504-1-jremus@linux.ibm.com> References: <20260127153331.2902504-1-jremus@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Egw92gpmw21Tk624x5Mdz0ym_tBI3ZKX X-Authority-Analysis: v=2.4 cv=Uptu9uwB c=1 sm=1 tr=0 ts=6978dad5 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=ZF5zZzGiEMQ9POZBm20A:9 X-Proofpoint-ORIG-GUID: CJduqsfu8ckaT3gi-0pqezvQAKTeBaJV X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI3MDEyMSBTYWx0ZWRfX8rVLt5Xl7ClL FJE/3s2Blo2OpURe8yq6VPsvBVe8Vm9wYW7VMsTOkl+3R8iMgDwIfO0HawD+LZFSHhIbtjGE6rw ENwL1lXVV95OGhAdVze4bcQHr/0nfstMuJW3KARqIkIVh2JoUD2r4iRLdoELlTDkiTTJem7r4C9 mM9xRSTJJUSyEs4szmvbxYlNX0oM+uBDQhkOs+5OIPQpgu/ZNlAzPHaNghd688/H156RYgnNfGk bzqhhciShiGtDxjAHq0JOHwG8FiE5LVbeXl/Fu/lah2CHn9NfpeTGearhtnSgTqzHg0gx9qj5yH dHmBDjjvhdSlUrHEFXBjIPR3JwaGWFIG5VMjkeVNL9jHQ7LqFTk7S4QlCSpDI3hXCikONv41kqk fwQFsl+iaZ4zbycUYSFIPlVZeTnvpRBN+cdvgSdme6f8PtJkDyWI9NPuzx0zyovY9fg2mgKNoD8 E/zXH/m+B4NHAgarMIw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-27_03,2026-01-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 phishscore=0 adultscore=0 impostorscore=0 bulkscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2601150000 definitions=main-2601270121 Content-Type: text/plain; charset="utf-8" Provide a s390-specific implementation of unwind_user_signal_next(), that unwinds from a (RT) signal frame. Signed-off-by: Jens Remus --- arch/s390/include/asm/unwind_user.h | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/arch/s390/include/asm/unwind_user.h b/arch/s390/include/asm/un= wind_user.h index a7b97ea01c26..8f5524a24ae1 100644 --- a/arch/s390/include/asm/unwind_user.h +++ b/arch/s390/include/asm/unwind_user.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include =20 @@ -67,6 +68,62 @@ static inline int arch_unwind_user_get_reg(unsigned long= *val, } #define unwind_user_get_reg arch_unwind_user_get_reg =20 +#define SVC_OPCODE 0x0a +#define INSN_SVC_SIGRETURN ((SVC_OPCODE << 8) | __NR_sigreturn) +#define INSN_SVC_RT_SIGRETURN ((SVC_OPCODE << 8) | __NR_rt_sigreturn) + +static inline int unwind_user_signal_next(struct unwind_user_state *state) +{ + unsigned short insn; + const _sigregs __user *sr; + unsigned long sp, fp, ra; + + /* ABI requires IP to be 2-byte aligned. */ + if (state->ip & 1) + return -EINVAL; + + if (__get_user(insn, (unsigned short __user *)state->ip)) + return -EINVAL; + + /* + * A signal frame has the instruction pointer pointing to + * svc $__NR_sigreturn or svc $__NR_rt_sigreturn + */ + switch (insn) { + case INSN_SVC_SIGRETURN: + /* New-style non-RT frame. */ + const struct sigframe __user *sf; + + sf =3D (struct sigframe __user *)state->sp; + if (__get_user(sr, (_sigregs __user **)&sf->sc.sregs)) + return -EINVAL; + break; + case INSN_SVC_RT_SIGRETURN: + /* New-style RT frame. */ + const struct rt_sigframe __user *rt_sf; + + rt_sf =3D (struct rt_sigframe __user *)state->sp; + sr =3D (_sigregs __user *)&rt_sf->uc.uc_mcontext; + break; + default: + return -EINVAL; + } + + if (__get_user(sp, (unsigned long __user *)&sr->regs.gprs[15])) + return -EINVAL; + if (__get_user(fp, (unsigned long __user *)&sr->regs.gprs[11])) + return -EINVAL; + if (__get_user(ra, (unsigned long __user *)&sr->regs.psw.addr)) + return -EINVAL; + + state->ip =3D ra; + state->sp =3D sp; + state->fp =3D fp; + state->topmost =3D false; + return 0; +} +#define unwind_user_signal_next unwind_user_signal_next + #endif /* CONFIG_UNWIND_USER */ =20 #ifdef CONFIG_HAVE_UNWIND_USER_FP --=20 2.51.0