From nobody Mon Feb 9 05:52:09 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 7941F27E7EB; Tue, 3 Feb 2026 17:21:10 +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=1770139272; cv=none; b=mb+zhi1vidVj9gU+nssDR1UaxoRMu5cq6MbU7wCv2wAu5y4H2UFUqCYndO4lZpyIfcGn5rTqPxVboqiUEavZQbVArr2H+aCkdMhE+JKGPiqCxbvI9T+iUaUiC+BzSvp+JdqyD2hP63DO+4o4zDH1hdVI6ItFhadmAqMwRFbH63w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770139272; c=relaxed/simple; bh=RT16X3Ma5UGVyu7hTXubEX6xVT3ScRWef6HV1vltn50=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZzYMrwzZ6o6T7VPyQW+Ocgti8jhBYxB0kT/5CykjPUk8OCyTrzYWQZKM7x7czy9+HlXsqsGg6v/OE7Wjea257XJXq/t9ffmkVvjtULbUj8SXw9VbE3uVSFO+JVPG9PFLusBlucra35ZfZRTxPiZGGSKnO/taXPyhTFZxOnaG8V8= 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=HRHRgbSR; 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="HRHRgbSR" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 61395d4b032189; Tue, 3 Feb 2026 17:20:09 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=zbEOunzPLvo2IhCRB kf2kXMVwbrggheQV1ILioljlFo=; b=HRHRgbSRlwTPUi0r5qDrskloJi/qp3Cw2 8NVidbY70X4X7Vp8Vrq/YceTzsi7iNKdibYyjk34+H9oIjz4cGdJmpOqkLXC0ZD0 1oLJRIG5H6V+fEVp6F0YrYBUUxU+YlEAwnYS8nyzdv4Ghz/c4jwO4u4KOv/M0erz nGnOfww5JG9rrahI0nU0yAkOJLRLscVL9fz1YUDQA/uhhvkCRycAZfkdxavFg3oU jyzPaxNzyR4bYQ87YrFMH+LJ3d7BsSl8/hY7IsxE2stnpY2MbQWjbJ8AC+ucS2Ix 0u23XmyqOF8KWip0zkR+zBnF8cBjp7AwQ1Dzp25DDZ/1J5HjtYgmg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4c185gv7nw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Feb 2026 17:20:09 +0000 (GMT) Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.0.8) with ESMTP id 613HK8Ap029062; Tue, 3 Feb 2026 17:20:08 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 4c185gv7nq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Feb 2026 17:20:08 +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 613GY0qe027419; Tue, 3 Feb 2026 17:20:07 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4c1xs19qan-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Feb 2026 17:20:07 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 613HK3sL24379850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 3 Feb 2026 17:20:03 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 60BB62004D; Tue, 3 Feb 2026 17:20:03 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D2FCC20043; Tue, 3 Feb 2026 17:20:02 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 3 Feb 2026 17:20:02 +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 v7 6/6] x86/vdso: Enable sframe generation in VDSO Date: Tue, 3 Feb 2026 18:19:57 +0100 Message-ID: <20260203171958.1522030-7-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260203171958.1522030-1-jremus@linux.ibm.com> References: <20260203171958.1522030-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=UdxciaSN c=1 sm=1 tr=0 ts=69822e49 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=meVymXHHAAAA:8 a=VnNF1IyMAAAA:8 a=6udGOm5lhfMXuTISw7IA:9 a=2JgSa4NbpEOStq-L5dxp:22 X-Proofpoint-GUID: VHjt-eRvyhuY4XLUf2QyJfD7buAYFta9 X-Proofpoint-ORIG-GUID: k8yu3lS81fBWOPKqR-jxHpstuWEE1Jhv X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjAzMDEzNSBTYWx0ZWRfXwIQ27Hx9zQQd quiqKbhCnBg/r/j/fdE5Y0oelOhIoUBVBZsmjbL6ak++GlM+L2TDR/g6ppoOHDLEvDyao1UgSIT ryiRqREfnyVEGQg9REeYKztEFqLNkluUKWQwDV3E6wTdHVf2qnBy607vsgQmWGp9xQOLsO+MkEU UnkaeAZjznG/ir7gEDLLTq5WIvFS2tRf15zmt7VkLCAJ4xsb2IdY0VngqRc0bawvrk06mxbOyxX uFxJjvUp+RphFiZn1yBLcuau4FnSYjhI/EnFeiGWoN1SHSdICIJb4Q1SNX0fElkLdK5zeOHZ9Mf 8HAXbAZWupM3w+W9650RMmwwb/KvNmqIGkpJvBrEuNYCccCVTJ4W/uez6aD2u0rfUmIwK+8k1R3 ZhCfYowILeQ8u8MehP73UQF2VILd/qXLCGcKkimHl3mPlxS0YZ5h9KEk63pRKioXw6OODAjKg4S NTfPsKhHbeIHhEekWwg== 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-03_05,2026-02-02_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 bulkscore=0 spamscore=0 phishscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2601150000 definitions=main-2602030135 Content-Type: text/plain; charset="utf-8" From: Josh Poimboeuf Enable sframe generation in the VDSO library so kernel and user space can unwind through it. [ Jens Remus: Add support for SFrame V3. Prevent GNU_SFRAME program table entry to empty .sframe section. ] Signed-off-by: Josh Poimboeuf Signed-off-by: Steven Rostedt (Google) Signed-off-by: Jens Remus --- Notes (jremus): Changes in v7: - Rebase on H. Peter Anvin's vDSO changes on tip:x86/entry. - Simplify adding assembler option -Wa,--gsframe-3. Add for vdso64 only. - Align to .eh_frame and mark .sframe as KEEP in vDSO linker script. Note that GNU linker 2.46 will mark .sframe as KEEP in its default linker script as well. arch/Kconfig | 7 +++++++ arch/x86/entry/vdso/common/vdso-layout.lds.S | 11 +++++++++++ arch/x86/entry/vdso/vdso64/Makefile | 1 + arch/x86/include/asm/dwarf2.h | 5 ++++- 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/arch/Kconfig b/arch/Kconfig index 31220f512b16..8170e492a44c 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -479,6 +479,13 @@ config HAVE_HARDLOCKUP_DETECTOR_ARCH It uses the same command line parameters, and sysctl interface, as the generic hardlockup detectors. =20 +config AS_SFRAME + bool + +config AS_SFRAME3 + def_bool $(as-instr,.cfi_startproc\n.cfi_endproc,-Wa$(comma)--gsframe-3) + select AS_SFRAME + config UNWIND_USER bool =20 diff --git a/arch/x86/entry/vdso/common/vdso-layout.lds.S b/arch/x86/entry/= vdso/common/vdso-layout.lds.S index 856b8b9d278c..421eb4ca9131 100644 --- a/arch/x86/entry/vdso/common/vdso-layout.lds.S +++ b/arch/x86/entry/vdso/common/vdso-layout.lds.S @@ -60,6 +60,13 @@ SECTIONS *(.eh_frame.*) } :text =20 +#ifdef CONFIG_AS_SFRAME + .sframe : { + KEEP (*(.sframe)) + *(.sframe.*) + } :text :sframe +#endif + /* * Text is well-separated from actual data: there's plenty of * stuff that isn't used at runtime in between. @@ -89,6 +96,7 @@ SECTIONS #define PT_GNU_EH_FRAME 0x6474e550 #define PT_GNU_STACK 0x6474e551 #define PT_GNU_PROPERTY 0x6474e553 +#define PT_GNU_SFRAME 0x6474e554 =20 /* * We must supply the ELF program headers explicitly to get just one @@ -104,6 +112,9 @@ PHDRS dynamic PT_DYNAMIC PF_R; note PT_NOTE PF_R; eh_frame_hdr PT_GNU_EH_FRAME PF_R; +#ifdef CONFIG_AS_SFRAME + sframe PT_GNU_SFRAME PF_R; +#endif gnu_stack PT_GNU_STACK PF_RW; gnu_property PT_GNU_PROPERTY PF_R; } diff --git a/arch/x86/entry/vdso/vdso64/Makefile b/arch/x86/entry/vdso/vdso= 64/Makefile index bfffaf1aeecc..459f8026531e 100644 --- a/arch/x86/entry/vdso/vdso64/Makefile +++ b/arch/x86/entry/vdso/vdso64/Makefile @@ -14,6 +14,7 @@ vobjs-$(CONFIG_X86_SGX) +=3D vsgx.o =20 # Compilation flags flags-y :=3D -DBUILD_VDSO64 -m64 -mcmodel=3Dsmall +flags-$(CONFIG_AS_SFRAME3) +=3D -Wa,--gsframe-3 =20 # The location of this include matters! include $(src)/../common/Makefile.include diff --git a/arch/x86/include/asm/dwarf2.h b/arch/x86/include/asm/dwarf2.h index 7cc30500c095..90b42367815e 100644 --- a/arch/x86/include/asm/dwarf2.h +++ b/arch/x86/include/asm/dwarf2.h @@ -12,8 +12,11 @@ * For the vDSO, emit both runtime unwind information and debug * symbols for the .dbg file. */ - +#if defined(__x86_64__) && defined(CONFIG_AS_SFRAME) + .cfi_sections .eh_frame, .debug_frame, .sframe +#else .cfi_sections .eh_frame, .debug_frame +#endif =20 #define CFI_STARTPROC .cfi_startproc #define CFI_ENDPROC .cfi_endproc --=20 2.51.0