From nobody Sun Feb 8 15:28:51 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 706FF30B518; Fri, 6 Feb 2026 19:37:26 +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=1770406646; cv=none; b=Ap+c9gEyrww/OeqnW1fzQI6bWKPYHxRRpTsch4q/bTTX4oahPiz331f51/lfB5wMrj7h2UMQMQlAQ0BqihwAGF/lFZLDeh0hE3Qhe/mKy5EVgxCEZfXGX2cCcrVanWcG7dtaSf+KKyhQtm4O37wGPtWsCG0aQLHfshrjpi8gUvg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770406646; c=relaxed/simple; bh=WYrlunl+GqQTFginmeW4uxp7ctIfUvx9tgcrt+J1B0o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t45+dgWw6XKZMBuFnZMOeuRiFq9cGKyUvv+boEykXkOwM1ZaKv6P8liiZSJZhIiabEt3gMg6S9QKEnZtqeKPe0gtrmFjtQbnaaygL5F/E5VBfcPq3g0fVF+iVqB7T8Qg1Xvx0e3zMoCbdagpCpF0f43N+037WYL2iDie54171bY= 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=DK5QG2gF; 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="DK5QG2gF" 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 616CnfYC027933; Fri, 6 Feb 2026 19:36:52 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=2yoq+h6mZB9/GPSod oD2HiVYMivcoOgmMDda9g822Iw=; b=DK5QG2gFeP36B6l9P0cWE2ELzOP4elYmV JINE5LDx1CfbVoPfOeNN0XVASoDlsu9pBRBqQRUkLXXpNoQQvP+JS3kRJuXmh28U cCqNBs98V2g9MZ8rScWgE4dyguPxjbRLSthIlah+7CPq624kwlzBjbQj+gJ5n8aw 2Br9dhV6/8FBmTq2LMb5+Zzh5dmjD8IxMyiFJc0y43IUhahyTooGj0fU14IY3be4 D/obvFmgBNbkSEr0N4gbZ15DMDM4VIqWp+Z2WNqo/6f9qR5/T7Y1U2KtK/+fTWkk Dn26uojV3Q0j7t/nKCx/K6muJPKxRHKh4pLq3XzB4WSUXmLXCWiXQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4c175na2u5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Feb 2026 19:36:51 +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 616Jaosf004210; Fri, 6 Feb 2026 19:36:50 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 4c175na2u1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Feb 2026 19:36:50 +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 616HqVs3027348; Fri, 6 Feb 2026 19:36:49 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4c1xs1qb4m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Feb 2026 19:36:49 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 616JajdN11796958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Feb 2026 19:36:45 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 17A2420040; Fri, 6 Feb 2026 19:36:45 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 982E320043; Fri, 6 Feb 2026 19:36:44 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 6 Feb 2026 19:36:44 +0000 (GMT) From: Jens Remus To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org, x86@kernel.org, linux-mm@kvack.org, Steven Rostedt Cc: Jens Remus , 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 , Borislav Petkov , Dave Hansen , David Hildenbrand , "H. Peter Anvin" , "Liam R. Howlett" , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Suren Baghdasaryan , Vlastimil Babka , Heiko Carstens , Vasily Gorbik , "Steven Rostedt (Google)" Subject: [PATCH v8 2/6] x86/asm: Avoid emitting DWARF CFI for non-VDSO Date: Fri, 6 Feb 2026 20:36:38 +0100 Message-ID: <20260206193642.1580787-3-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260206193642.1580787-1-jremus@linux.ibm.com> References: <20260206193642.1580787-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: Ga-6PM7vNYrgQgTGQqmjgW5kEaBoxd2x X-Authority-Analysis: v=2.4 cv=VcX6/Vp9 c=1 sm=1 tr=0 ts=698642d3 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VwQbUJbxAAAA:8 a=meVymXHHAAAA:8 a=oGMlB6cnAAAA:8 a=VnNF1IyMAAAA:8 a=zOOTxvlrTZNIKiBVQswA:9 a=2JgSa4NbpEOStq-L5dxp:22 a=NdAtdrkLVvyUPsUoGJp4:22 X-Proofpoint-GUID: 3sQTOCeco3KdfPwBYI8kOe2KzWqP2DUJ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA2MDE0MyBTYWx0ZWRfX495HbASuKkh1 2jcSG9t5Np/glcCp45HbmjjN+bNtpbDMsTEv+VQc7AEhlTvLAktCg4Yc8pXH7ZM7K2wC00DiwGY NEBRmGgqGyHzy+Z+UXdhX/tT7RUUIk8jtnwC5lF2fMVWU8ujFyJfxrHn2PwM8fiKH1FSl2BJZdm Aqzmet/XnhJeJxw4M/VJPuzw+ADjj07XhD/pMR4wLP4Zlu/zQYZ9Y+6eR0MnLaxeynlUXX/FnPK ZA19cBM1FLDBerii/c3XghkzI8dU1W4icvmsX2vcB4T/gIhvO5ZlxVxNn95OY+vlGhmIZmuvR9g unE5IjGF19VxbA8v6ayu1IYbtQ3aHSxlvFfFDkimHymQLcl70Mbqi6bZa6DqxNuq6hOOpoAG2u/ i/GCbYywXM5L0lCYwpUzuHG6ialZoeLQMOZgsAgfLo7IcR2JUrr9DtDeqw9zQbO75AFcPfyM/mZ Zu/9RtAokVe9ALqtvrg== 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-02-06_05,2026-02-05_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2601150000 definitions=main-2602060143 Content-Type: text/plain; charset="utf-8" From: Josh Poimboeuf It was decided years ago that .cfi_* annotations aren't maintainable in the kernel. They were replaced by objtool unwind hints. For the kernel proper, ensure the CFI_* macros don't do anything. On the other hand the VDSO library *does* use them, so user space can unwind through it. Make sure these macros only work for VDSO. They aren't actually being used outside of VDSO anyway, so there's no functional change. [ Jens Remus: Define CFI_SIGNAL_FRAME for !BUILD_VDSO. ] Signed-off-by: Josh Poimboeuf Signed-off-by: Steven Rostedt (Google) Acked-by: H. Peter Anvin (Intel) Signed-off-by: Jens Remus --- Notes (jremus): Changes in v8: - Define CFI_SIGNAL_FRAME for !BUILD_VDSO (new on tip:x86/entry). arch/x86/include/asm/dwarf2.h | 52 ++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h index 09c9684d3ad6..13e2e64ef265 100644 --- a/arch/x86/include/asm/dwarf2.h +++ b/arch/x86/include/asm/dwarf2.h @@ -6,6 +6,15 @@ #warning "asm/dwarf2.h should be only included in pure assembly files" #endif =20 +#ifdef BUILD_VDSO + + /* + * For the vDSO, emit both runtime unwind information and debug + * symbols for the .dbg file. + */ + + .cfi_sections .eh_frame, .debug_frame + #define CFI_STARTPROC .cfi_startproc #define CFI_ENDPROC .cfi_endproc #define CFI_DEF_CFA .cfi_def_cfa @@ -22,21 +31,32 @@ #define CFI_ESCAPE .cfi_escape #define CFI_SIGNAL_FRAME .cfi_signal_frame =20 -#ifndef BUILD_VDSO - /* - * Emit CFI data in .debug_frame sections, not .eh_frame sections. - * The latter we currently just discard since we don't do DWARF - * unwinding at runtime. So only the offline DWARF information is - * useful to anyone. Note we should not use this directive if we - * ever decide to enable DWARF unwinding at runtime. - */ - .cfi_sections .debug_frame -#else - /* - * For the vDSO, emit both runtime unwind information and debug - * symbols for the .dbg file. - */ - .cfi_sections .eh_frame, .debug_frame -#endif +#else /* !BUILD_VDSO */ + +/* + * On x86, these macros aren't used outside VDSO. As well they shouldn't = be: + * they're fragile and very difficult to maintain. + */ + +.macro nocfi args:vararg +.endm + +#define CFI_STARTPROC nocfi +#define CFI_ENDPROC nocfi +#define CFI_DEF_CFA nocfi +#define CFI_DEF_CFA_REGISTER nocfi +#define CFI_DEF_CFA_OFFSET nocfi +#define CFI_ADJUST_CFA_OFFSET nocfi +#define CFI_OFFSET nocfi +#define CFI_REL_OFFSET nocfi +#define CFI_REGISTER nocfi +#define CFI_RESTORE nocfi +#define CFI_REMEMBER_STATE nocfi +#define CFI_RESTORE_STATE nocfi +#define CFI_UNDEFINED nocfi +#define CFI_ESCAPE nocfi +#define CFI_SIGNAL_FRAME nocfi + +#endif /* !BUILD_VDSO */ =20 #endif /* _ASM_X86_DWARF2_H */ --=20 2.51.0