From nobody Tue Dec 16 13:22:07 2025 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 DD06A2E5B2D; Mon, 8 Dec 2025 16:04:28 +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=1765209870; cv=none; b=ByZR/EhKtnMzGbmnUZG8LvZ5UYtrlXgDr394+ArP9CZMbUQPaMxl0eeo3u012Pj1VthB++rs6MlFTelNV0NF6xUvEvpfBlz/GFBWCr/lRq3845KEuuYv9BeH8onKhmrRLEUYhL/MWJPhLuOthTsuc5OWzr/pm9+RHO2tkV2QxhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765209870; c=relaxed/simple; bh=J4PyjTWZZy4AMR0cCiyLgwuuJeCOaxRSVWHewOd8ldY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LTu8JDWJp3p6iWlIGBxnoNWfaemZPhktJavolS5IDs3lJ9vrbkec/9jXrrXO7mk0UZWaVG7uRLyIGikqmzv5ai/2sHFiFMRK69+rvrTMnSzedwwidoln5eF+9flavGQZwLj77FDncUj36K60nwfY7mkesW9stg/6Bj4rgMZMlos= 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=LfLvzYQR; 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="LfLvzYQR" 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 5B882Bit005499; Mon, 8 Dec 2025 16:04:00 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=rpg5SPvkgel8a3b1b /FIgAvz7SBPHHvdD/JLyQb5oIY=; b=LfLvzYQRilZ1g+g+kgB3520zUbbdLGXOJ GOZcu8Rgc9/Tubm2DOizMOZOTC5c94Gi1UeC6VNxPMPyvslaKcVNM6PDiBGrTnbb vekRYY1Ju+DFqXVN1iw2gcfWJaKDpsaqFkgY9oxqvPr0UPYK/tMPa3i/++E5YrMO INnEC9bAbidmx2Sv/N2OZJ8Sl5BY8O0xA2juj5XdhFpaDicplt3pZmtR/Nj2Lqz1 upoqeCkzXD2ONFTwoPEuNRYqqzFw3JlI0JGFS+hbvP77gbxGDLfTUt9/vInylsE4 Ui2A2e94U7IsZpInYIKgJj1PCF1BQY1zk6Zf+TAYyz3uvhj/xvJGw== 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 4av9wvgcre-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Dec 2025 16:04:00 +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 5B8CrCOD026887; Mon, 8 Dec 2025 16:03:59 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4aw1h0x5dn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Dec 2025 16:03:59 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5B8G3tQw54722840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Dec 2025 16:03:55 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9A93120040; Mon, 8 Dec 2025 16:03:55 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 51B952004B; Mon, 8 Dec 2025 16:03:55 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 8 Dec 2025 16:03:55 +0000 (GMT) From: Jens Remus To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, x86@kernel.org, Steven Rostedt , Peter Zijlstra Cc: Jens Remus , Josh Poimboeuf , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Mathieu Desnoyers , Indu Bhagat , "Jose E. Marchesi" , Heiko Carstens , Vasily Gorbik , Ilya Leoshkevich , Linus Torvalds Subject: [PATCH v4 1/4] unwind_user: Enhance comments on get CFA, FP, and RA Date: Mon, 8 Dec 2025 17:03:49 +0100 Message-ID: <20251208160352.1363040-2-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251208160352.1363040-1-jremus@linux.ibm.com> References: <20251208160352.1363040-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: MN64_neTpb5r1Xf7D9bWW08PjblZgq8_ X-Proofpoint-ORIG-GUID: MN64_neTpb5r1Xf7D9bWW08PjblZgq8_ X-Authority-Analysis: v=2.4 cv=AdS83nXG c=1 sm=1 tr=0 ts=6936f6f0 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=wP3pNCr1ah4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=GRZQj7fo7pb9Qcd1f_cA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjA2MDAwMCBTYWx0ZWRfX6pEC+FgU+Ndq nKt63ZutUkSFY++ApEV8gHZw63Unp7uohqjxfRcT/KmJB2SbNjw9CeJlTaE+t/dkTOdkegTWDHj 6m6r1aYSps8fXbFa2OWE8WMVZnlUTboWEEffFZJi8nZxdQj23ejyxNVYPTOuoCK+kdztVb+hrL8 f8Wp+is4N3udUbRNZh8VJD+f0SFsBQ62qVUjxynpi9txz9+6FGufqzG+us3QBcuxXPoZWRKV+Ym wuJ5yFJtQpiK2+3kjg2qPxGtVOM4kWwQyOhQE/1nE93OM9AvQGiuJkw+ZZWwCizbj/IEHaM4rdl 3cM83IVQC38YOCY3WHZsQA3HYfx7nVLuluIkHFQ1+frYgdGyCkua+boEBs3lCca3vi366imaclX qMlxfID2Z9a0oK0Nz45GlIozIANjgg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-06_02,2025-12-04_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 priorityscore=1501 spamscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 malwarescore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510240000 definitions=main-2512060000 Content-Type: text/plain; charset="utf-8" Move the comment "Get the Canonical Frame Address (CFA)" to the top of the sequence of statements that actually get the CFA. Reword the comment "Find the Return Address (RA)" to "Get ...", as the statements actually get the RA. Add a respective comment to the statements that get the FP. This will be useful once future commits extend the logic to get the RA and FP. While at it align the comment on the "stack going in wrong direction" check to the following one on the "address is word aligned" check. Signed-off-by: Jens Remus --- kernel/unwind/user.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/unwind/user.c b/kernel/unwind/user.c index 39e270789444..0ca434f86e73 100644 --- a/kernel/unwind/user.c +++ b/kernel/unwind/user.c @@ -31,6 +31,7 @@ static int unwind_user_next_common(struct unwind_user_sta= te *state, { unsigned long cfa, fp, ra; =20 + /* Get the Canonical Frame Address (CFA) */ if (frame->use_fp) { if (state->fp < state->sp) return -EINVAL; @@ -38,11 +39,9 @@ static int unwind_user_next_common(struct unwind_user_st= ate *state, } else { cfa =3D state->sp; } - - /* Get the Canonical Frame Address (CFA) */ cfa +=3D frame->cfa_off; =20 - /* stack going in wrong direction? */ + /* Make sure that stack is not going in wrong direction */ if (cfa <=3D state->sp) return -EINVAL; =20 @@ -50,10 +49,11 @@ static int unwind_user_next_common(struct unwind_user_s= tate *state, if (cfa & (state->ws - 1)) return -EINVAL; =20 - /* Find the Return Address (RA) */ + /* Get the Return Address (RA) */ if (get_user_word(&ra, cfa, frame->ra_off, state->ws)) return -EINVAL; =20 + /* Get the Frame Pointer (FP) */ if (frame->fp_off && get_user_word(&fp, cfa, frame->fp_off, state->ws)) return -EINVAL; =20 --=20 2.51.0 From nobody Tue Dec 16 13:22:07 2025 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 6C321283C83; Mon, 8 Dec 2025 16:04:24 +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=1765209866; cv=none; b=a6ZR+dowpcD6Dfh1BaE1PwmKPO+Gl/eG+yHfQKNpbkaR+5Fbk/ULI3dDVp1s7VWoqtA3tkAwtBJug3y8aFuSDxkoWBL99i8bDXlfqG7zIQyYYyQMpm0IweUyKYgz2RbF5wFArkwPUw/QDJZHFpSB1CdRSvTyGB1ypOKryQqoZ6I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765209866; c=relaxed/simple; bh=9SUoB5P3+wbu/VC/ee1idmz9XakdYQShJohl162A928=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CNpaMbO1rGETaAYIqvHc84XEXbLSihZXvbH3lQMIf1+3ysK9cYfyH+vpz141ZdeWXSb3S9hJJcOj1FvPdnizA6qwgosXVm9N1mtJIBuIGnAZfD7FSFQIflH8+3LneTlgymXs0S2/RtteTxKiPkqvmY/q3pApPMXPPbKx/afWugE= 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=d+x4hXXS; 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="d+x4hXXS" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5B8DwDwW019550; Mon, 8 Dec 2025 16:04:01 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=S397CtIQ2BgwPo3+H 9k4MdgUl5dyw5002+960yfKThM=; b=d+x4hXXSsnTNN9cUW4wv459MLwJkUTwL+ Yix2Iqp3ZvIK/FUAMesO9jQWS2Xtx+DKp2qakze6vYfTdA4tyKK3Qgr46YvO6c0k g8wUGrk0XSZStqQ5DxfmhKVRwJXREmIfIPjZKT47zw0nV0oYGEQiHuXn8XjLQ/9q a0KmnAUjx3YzVv5eEMd4sNkhi2HlKnXNaRH2dEf4BEwIbSIDxrzEE9mqXIRnPsZ1 /HattQiEy7Cp2IwCkXCe74wIGZfdzvj/nT139K1sUclIYRe8bZbnHuJQjQgitcud pBXzDy6P4fNDiAbnp5jsrVSeAMxrChVPFVcwg5FWSsuO7y/J5OWyg== 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 4avc0jrk0s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Dec 2025 16:04:00 +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 5B8CoRNs026799; Mon, 8 Dec 2025 16:03:59 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4aw1h0x5dq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Dec 2025 16:03:59 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5B8G3uhE10879234 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Dec 2025 16:03:56 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E8F2520040; Mon, 8 Dec 2025 16:03:55 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A108120043; Mon, 8 Dec 2025 16:03:55 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 8 Dec 2025 16:03:55 +0000 (GMT) From: Jens Remus To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, x86@kernel.org, Steven Rostedt , Peter Zijlstra Cc: Jens Remus , Josh Poimboeuf , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Mathieu Desnoyers , Indu Bhagat , "Jose E. Marchesi" , Heiko Carstens , Vasily Gorbik , Ilya Leoshkevich , Linus Torvalds Subject: [PATCH v4 2/4] unwind_user/fp: Use dummies instead of ifdef Date: Mon, 8 Dec 2025 17:03:50 +0100 Message-ID: <20251208160352.1363040-3-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251208160352.1363040-1-jremus@linux.ibm.com> References: <20251208160352.1363040-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=Cf8FJbrl c=1 sm=1 tr=0 ts=6936f6f0 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=wP3pNCr1ah4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=pRS0VBzutSDFB64YrXgA:9 X-Proofpoint-ORIG-GUID: Pdrm9UDzr0leYcUom_wL5XuSwXmBDqJO X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjA2MDAxNiBTYWx0ZWRfX2sjUOLFHlvXE EX9qXAjxGBBqFmnau33bSCJ03VRutv0E9+SN9aHBsf1fHHAxmomscg2SM7dkRuQlI6Oym+UEfmo 1j7pXnm8UawmH6EjOGVm/144yprwM5PBib2Rpc9Mcm7xl/6fZ5B3w/v6krFa63QZ3VsGLQ7NYu1 dMsXhD+OTHLDXM6mLmB8cnKlOREM2T3h5dYWggq02Xu2zgC45OXqeeks515p0PWH5mSs7p8CjHG BraS69LpUS/IhGTcVbspUi/C8nXYcNIhKgL09nVh4NhZlMiQfz26K0+x3xuiRuezLWlNagrW34t wfQ56UNIpx1hqc2cdY5F9qBZJRXBm7MakPH/P8xB7MCa5iHSF9m3PlrL+Ovaukg4tnR4l4xq2Sc 9+giL5/mZRV2lOtgrDZomeranSvs7A== X-Proofpoint-GUID: Pdrm9UDzr0leYcUom_wL5XuSwXmBDqJO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-06_02,2025-12-04_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 malwarescore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510240000 definitions=main-2512060016 Content-Type: text/plain; charset="utf-8" This simplifies the code. unwind_user_next_fp() does not need to return -EINVAL if config option HAVE_UNWIND_USER_FP is disabled, as unwind_user_start() will then not select this unwind method and unwind_user_next() will therefore not call it. Provide (1) a dummy definition of ARCH_INIT_USER_FP_FRAME, if the unwind user method HAVE_UNWIND_USER_FP is not enabled, (2) a common fallback definition of unwind_user_at_function_start() which returns false, and (3) a common dummy definition of ARCH_INIT_USER_FP_ENTRY_FRAME. Note that enabling the config option HAVE_UNWIND_USER_FP without defining ARCH_INIT_USER_FP_FRAME triggers a compile error, which is helpful when implementing support for this unwind user method in an architecture. Enabling the config option when providing an arch- specific unwind_user_at_function_start() definition makes it necessary to also provide an arch-specific ARCH_INIT_USER_FP_ENTRY_FRAME definition. Signed-off-by: Jens Remus --- Notes (jremus): Changes in v3: - Remove comment on #endif. (Ingo) =20 Changes in v2: - Add parameter ws to ARCH_INIT_USER_{FP_FRAME|FP_ENTRY_FRAME}. - Provide common fallback of unwind_user_at_function_start(). - Provide common dummy of ARCH_INIT_USER_FP_ENTRY_FRAME. - Reword commit message accordingly. arch/x86/include/asm/unwind_user.h | 1 + include/linux/unwind_user.h | 18 ++++++++++++++++-- kernel/unwind/user.c | 4 ---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/unwind_user.h b/arch/x86/include/asm/unwi= nd_user.h index 12064284bc4e..971ffe937d50 100644 --- a/arch/x86/include/asm/unwind_user.h +++ b/arch/x86/include/asm/unwind_user.h @@ -35,6 +35,7 @@ static inline bool unwind_user_at_function_start(struct p= t_regs *regs) { return is_uprobe_at_func_entry(regs); } +#define unwind_user_at_function_start unwind_user_at_function_start =20 #endif /* CONFIG_HAVE_UNWIND_USER_FP */ =20 diff --git a/include/linux/unwind_user.h b/include/linux/unwind_user.h index 7f7282516bf5..64618618febd 100644 --- a/include/linux/unwind_user.h +++ b/include/linux/unwind_user.h @@ -5,8 +5,22 @@ #include #include =20 -#ifndef ARCH_INIT_USER_FP_FRAME - #define ARCH_INIT_USER_FP_FRAME +#ifndef CONFIG_HAVE_UNWIND_USER_FP + +#define ARCH_INIT_USER_FP_FRAME(ws) + +#endif + +#ifndef ARCH_INIT_USER_FP_ENTRY_FRAME +#define ARCH_INIT_USER_FP_ENTRY_FRAME(ws) +#endif + +#ifndef unwind_user_at_function_start +static inline bool unwind_user_at_function_start(struct pt_regs *regs) +{ + return false; +} +#define unwind_user_at_function_start unwind_user_at_function_start #endif =20 int unwind_user(struct unwind_stacktrace *trace, unsigned int max_entries); diff --git a/kernel/unwind/user.c b/kernel/unwind/user.c index 0ca434f86e73..90ab3c1a205e 100644 --- a/kernel/unwind/user.c +++ b/kernel/unwind/user.c @@ -67,7 +67,6 @@ static int unwind_user_next_common(struct unwind_user_sta= te *state, =20 static int unwind_user_next_fp(struct unwind_user_state *state) { -#ifdef CONFIG_HAVE_UNWIND_USER_FP struct pt_regs *regs =3D task_pt_regs(current); =20 if (state->topmost && unwind_user_at_function_start(regs)) { @@ -81,9 +80,6 @@ static int unwind_user_next_fp(struct unwind_user_state *= state) ARCH_INIT_USER_FP_FRAME(state->ws) }; return unwind_user_next_common(state, &fp_frame); -#else - return -EINVAL; -#endif } =20 static int unwind_user_next(struct unwind_user_state *state) --=20 2.51.0 From nobody Tue Dec 16 13:22:07 2025 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 14A1B26CE2B; Mon, 8 Dec 2025 16:04:21 +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=1765209863; cv=none; b=E0TXpseemQsm0IH8RO5YcEwg0vFPLtFx0bsGWyWi+upxja9L4pZVcmxIIKqQl8UNnx34Dz9XMIdKKbZBAxgpKfKq+zPPCrpFGW7f69MJKYryY3kBnP+VGoejoPwVheCWdgKZo+WctliwRwp7ov0VW+x4n9NhlM5GiPgdeWetBzE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765209863; c=relaxed/simple; bh=jkg8tRwFsBh4lQCKIUPxTfTkJTsnZ3FRJaagjPpOxBs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vs/dMm6NbUqSB00SyJxNTzAwG6t507V6iNLMeQRbVuEglhLJ98UzGRvexJ7fnRiyOLUx7reo4BSYSkiSF3Jaz6UY2Reeeq/0sTAj32bdG+LSae1yuku8jWS4WIlKcmaq2kJP6zAZLyzN8vMtF3y+X/wlRq8NEtp6MtLrc7LLFzI= 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=OIacjhw+; 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="OIacjhw+" 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 5B883t14031236; Mon, 8 Dec 2025 16:04:01 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=cQBdhMIcp6DAZi9Zx Vexr6Oh5CmqajUNW2WLiVkcNP8=; b=OIacjhw+ehZGV6jcZ+fW2qoMDzsqNzob/ UW+91SagcMe8qsSSZDEvu8OYFXxMvSOkIy5SK94NaiUDHYlpdhDVsSUH+XKcc2iV lW1fanOZlwFOKqY6e0RVGYkRaJrI9nBF8VSV4ghkp0t2Qe3HDYQojBynCpDPnu3r AObq8Jh8ECoIRtHWvnxGlqY/+HY+LjT6nP+TKLN1h0YxnRWYuVrRZ+/glZKdE33Y Fp610jCSyDSIgesdC5MBF9hMPWUyILh2m1/0VNiJwSnljyAhlHtvwx/j4EUbRd3E 29+hnMn5+ArlJE+IX45LgrS0/NChMVfy/oG6T/z+G9qV2Q+VVaEAg== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4avc618jy5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Dec 2025 16:04:01 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5B8EFeCA030254; Mon, 8 Dec 2025 16:04:00 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4avxtrxmhw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Dec 2025 16:03:59 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5B8G3uCI25887356 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Dec 2025 16:03:56 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 471A120040; Mon, 8 Dec 2025 16:03:56 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1A632004B; Mon, 8 Dec 2025 16:03:55 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 8 Dec 2025 16:03:55 +0000 (GMT) From: Jens Remus To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, x86@kernel.org, Steven Rostedt , Peter Zijlstra Cc: Jens Remus , Josh Poimboeuf , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Mathieu Desnoyers , Indu Bhagat , "Jose E. Marchesi" , Heiko Carstens , Vasily Gorbik , Ilya Leoshkevich , Linus Torvalds Subject: [PATCH v4 3/4] x86/unwind_user: Guard unwind_user_word_size() by UNWIND_USER Date: Mon, 8 Dec 2025 17:03:51 +0100 Message-ID: <20251208160352.1363040-4-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251208160352.1363040-1-jremus@linux.ibm.com> References: <20251208160352.1363040-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-Spam-Details-Enc: AW1haW4tMjUxMjA2MDAyMCBTYWx0ZWRfX2oN9OtxNAJNU DaaQAYndx34Y1Yi8LhOI+BxJ8xyrwPIvmH+fnE5OPVFv+wq8HJ0qjVVNOhgXL5Wgka/9NUqRAiK F+LvJgqUvcR8g8h5RyzQn4RQwxfaBCXH6bibnGeEY7QP7MpIOOnD4dPaR3KWlTMCMclbYHOhzP5 AsfqSwujk6/QpW81pEHjnULYx8DjjG48XPhOEoAFMDOTjuiOJhsTiyrLavz9vR1a+Se3BB89SnK i0XtdrG7TNnC0QgrqUAscUjOO0XuBQOEpCEBCNhJUM1Yny2SWwZ1FBzO/qfxKcERD+t0+J2YkqG hYaOPfhy+HoYVtndC+w5J+IhmvvAnWbFvnHtg+8RgXPILJCIFx1nj+5tzqYtrL7vFEfl1QIO9ym z4S4s6gK/Xof8z0mDqaFAcp1EI8bCA== X-Proofpoint-GUID: M7IliblS3NP3oFtT1pQZe1W5kBbkMTSD X-Proofpoint-ORIG-GUID: M7IliblS3NP3oFtT1pQZe1W5kBbkMTSD X-Authority-Analysis: v=2.4 cv=O/U0fR9W c=1 sm=1 tr=0 ts=6936f6f1 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=wP3pNCr1ah4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=EUPQYQbpjl04SHwYsagA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-06_02,2025-12-04_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 phishscore=0 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510240000 definitions=main-2512060020 Content-Type: text/plain; charset="utf-8" The unwind user framework in general requires an architecture-specific implementation of unwind_user_word_size() to be present for any unwind method, whether that is fp or a future other method, such as potentially sframe. Guard unwind_user_word_size() by the availability of the UNWIND_USER framework instead of the specific HAVE_UNWIND_USER_FP method. This facilitates to selectively disable HAVE_UNWIND_USER_FP on x86 (e.g. for test purposes) once a new unwind method is added to unwind user. Signed-off-by: Jens Remus --- Notes (jremus): Changes in v3: - Move includes into more common UNWIND_USER guard at the top of the source. asm/ptrace.h is required for struct pt_regs. arch/x86/include/asm/unwind_user.h | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/unwind_user.h b/arch/x86/include/asm/unwi= nd_user.h index 971ffe937d50..7f1229b33d06 100644 --- a/arch/x86/include/asm/unwind_user.h +++ b/arch/x86/include/asm/unwind_user.h @@ -2,23 +2,11 @@ #ifndef _ASM_X86_UNWIND_USER_H #define _ASM_X86_UNWIND_USER_H =20 -#ifdef CONFIG_HAVE_UNWIND_USER_FP +#ifdef CONFIG_UNWIND_USER =20 #include #include =20 -#define ARCH_INIT_USER_FP_FRAME(ws) \ - .cfa_off =3D 2*(ws), \ - .ra_off =3D -1*(ws), \ - .fp_off =3D -2*(ws), \ - .use_fp =3D true, - -#define ARCH_INIT_USER_FP_ENTRY_FRAME(ws) \ - .cfa_off =3D 1*(ws), \ - .ra_off =3D -1*(ws), \ - .fp_off =3D 0, \ - .use_fp =3D false, - static inline int unwind_user_word_size(struct pt_regs *regs) { /* We can't unwind VM86 stacks */ @@ -31,6 +19,22 @@ static inline int unwind_user_word_size(struct pt_regs *= regs) return sizeof(long); } =20 +#endif /* CONFIG_UNWIND_USER */ + +#ifdef CONFIG_HAVE_UNWIND_USER_FP + +#define ARCH_INIT_USER_FP_FRAME(ws) \ + .cfa_off =3D 2*(ws), \ + .ra_off =3D -1*(ws), \ + .fp_off =3D -2*(ws), \ + .use_fp =3D true, + +#define ARCH_INIT_USER_FP_ENTRY_FRAME(ws) \ + .cfa_off =3D 1*(ws), \ + .ra_off =3D -1*(ws), \ + .fp_off =3D 0, \ + .use_fp =3D false, + static inline bool unwind_user_at_function_start(struct pt_regs *regs) { return is_uprobe_at_func_entry(regs); --=20 2.51.0 From nobody Tue Dec 16 13:22:07 2025 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 9A9E92DF131; Mon, 8 Dec 2025 16:04:24 +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=1765209866; cv=none; b=TZVbOW5vx2MW3I2J48yoR1ffdQ7seWk5wfS4vB10akyPYj9oFpbO5Raqh7BRDELAoJkZOnUWaj7z5pGDNTTxEMR8Tcfkg8bPWDUx2aeY5AbkvqsnrWM8sFmQwLLbXDHF9h7uYmWOSO0BukIlkkz28RS7tQV6JvbSg8rcFyVbKZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765209866; c=relaxed/simple; bh=00bHRxShUqHix+Y0pHMMqSsVTIss5SLCtn4lBjUJjV4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rV9xvThUmjlsMGIVFuczVHppfpJaQVyWidAXcCIbtuUeh3yQq+SPnL392xagF14PUdiIa3m9ZVVscsMnRfh+VKSoTCsA43b+Svr6DF+6reZVXUrNVso5dfPwjy4DzjMAYXPQB6UH7dZn8n7sGvRV/KlKmdXX72gUxqXRvNYTIVo= 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=ati0PLst; 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="ati0PLst" 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 5B88eOek031277; Mon, 8 Dec 2025 16:04:02 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=/jwmOufW3UEbDvJkr 0/+cmHyBma1CCf+zH46v9RXjXU=; b=ati0PLstk2R7gBKoOgRYX2M8Y8OnHSaNA ryGKABpyZhgqGtU7kAwAOKncVvOfCG1PdMPK5p1Ctc2mBVNfBd45XtlbmAEsalyn CN0XUu5TVMU0W0V7S7noCXmRc9YIDKY2ZKkvtG76MQmnBVb4jj/HtIebLBlAY0OG 6mju1N8Q7lh+tsOdWWrmsqK1bitKNLgI8RDLt3mVSiBr9j429CpXlIcQkxBTnpm/ HrDDtfHnGlFk9hHg+9jnqIqZ3a1ZXcuk66DgnqC1C1DxSuIy2u7Lx6fHvBdc4llm BNCZkE+4ohnjVnjA4SKAfF0KsBE60vdVscwxpVn3iv+lifPs4LC1g== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4avc7brjf5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Dec 2025 16:04:01 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5B8Epful009044; Mon, 8 Dec 2025 16:04:00 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4avytmpfk8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Dec 2025 16:04:00 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5B8G3uYW25887364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Dec 2025 16:03:56 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9D8AC20040; Mon, 8 Dec 2025 16:03:56 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4D77020043; Mon, 8 Dec 2025 16:03:56 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 8 Dec 2025 16:03:56 +0000 (GMT) From: Jens Remus To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, x86@kernel.org, Steven Rostedt , Peter Zijlstra Cc: Jens Remus , Josh Poimboeuf , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Mathieu Desnoyers , Indu Bhagat , "Jose E. Marchesi" , Heiko Carstens , Vasily Gorbik , Ilya Leoshkevich , Linus Torvalds Subject: [PATCH v4 4/4] x86/unwind_user: Simplify unwind_user_word_size() Date: Mon, 8 Dec 2025 17:03:52 +0100 Message-ID: <20251208160352.1363040-5-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251208160352.1363040-1-jremus@linux.ibm.com> References: <20251208160352.1363040-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-ORIG-GUID: 5vPgliLQDmTeZWPvCGjdEAqB7Ai1wnvY X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjA2MDAyMCBTYWx0ZWRfX2dIgauyK8w+y tssMp5UYHDhv32TiM4/zvc4xxkh75f7xTL92p8ru7ziAlkuG2F4AGM2wW7TTS0i0jxzcLGzukz0 qysuZeTSdSpv5FpCQHrndBgBGM6UB0WEzt5uZBsY9FZ+rs+EqK84HbCWqiqqfVAqzYML8cmdOzh XPzJTlUpv8cfujX7aakjxUUNYBbK7K5d1Udrb3+1KshhUxOjbR3Tqb286ivRicCwHsMWGjkRXvO UbNApFYvC+PfYa7jlc+arRVF2Pl0orZjTGBSNJ5YV9NEPX3wvyZCYVr5Yu8yebPwBSscqaxCTfN tOj2ZsmA+ass00LxXruoosBeh30cRUvh5y/gLJVjsYgZXib5sJuNv63guxgvb0P4pKi/3XCx4zL PY4NzuCti0tC4xUxZDQOhcdN7BK3Cg== X-Proofpoint-GUID: 5vPgliLQDmTeZWPvCGjdEAqB7Ai1wnvY X-Authority-Analysis: v=2.4 cv=FpwIPmrq c=1 sm=1 tr=0 ts=6936f6f1 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=wP3pNCr1ah4A:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=pGLkceISAAAA:8 a=Z4Rwk6OoAAAA:8 a=VnNF1IyMAAAA:8 a=U3zWcbju4HIoyLPczGQA:9 a=HkZW87K1Qel5hWWM3VKY:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-06_02,2025-12-04_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 phishscore=0 clxscore=1015 adultscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510240000 definitions=main-2512060020 Content-Type: text/plain; charset="utf-8" Get rid of superfluous ifdef and return explicit word size depending on 32-bit or 64-bit mode. Suggested-by: Linus Torvalds Signed-off-by: Jens Remus --- Notes (jremus): Changes in v4: - New patch. (Linus) https://lore.kernel.org/all/CAHk-=3Dwh4_BPvniQZqvEQ4cCC3WfvQqruWk0b1Y= ek+0d5S1LuxQ@mail.gmail.com/ =20 This aligns to sizeof_long() in arch/x86/kernel/uprobes.c. arch/x86/include/asm/unwind_user.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/x86/include/asm/unwind_user.h b/arch/x86/include/asm/unwi= nd_user.h index 7f1229b33d06..6e469044e4de 100644 --- a/arch/x86/include/asm/unwind_user.h +++ b/arch/x86/include/asm/unwind_user.h @@ -12,11 +12,7 @@ static inline int unwind_user_word_size(struct pt_regs *= regs) /* We can't unwind VM86 stacks */ if (regs->flags & X86_VM_MASK) return 0; -#ifdef CONFIG_X86_64 - if (!user_64bit_mode(regs)) - return sizeof(int); -#endif - return sizeof(long); + return user_64bit_mode(regs) ? 8 : 4; } =20 #endif /* CONFIG_UNWIND_USER */ --=20 2.51.0