From nobody Thu Apr 2 06:08:46 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 BAB752BEC20; Wed, 11 Feb 2026 14:14:41 +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=1770819282; cv=none; b=MfdacRlhYC3j/65Elkxkn8cQNGZ7heKa8A6nZ4l61GDg7xnimt9wllJNZYomNAoOHGtOnTNSI0lrwdthSUfsid0+o8/hTjKcbXMRilUxJUsk3qjbpWr7xkYOy7/FjfYi01U2hrzYwv/PYzDD1n84dQJ6ZzdGlQlpYuCFlqEnLGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770819282; c=relaxed/simple; bh=/Zbhu2RURXstbyfQDbeI6zgK+b2t5jauoCm0kDegmEI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GAvdsOCz5QvRuJfkubQxivzLIKbL6TqQOAWt71XJxTEp5tpLsUBil8QdrKxFIMIbDF7uodIDu9nZBnVd+GMPbByN/pX1RJmqXFj9DJom30Du9f1HxyR1Od4H9T+YK1yEHQFcbJ9qRIiUvt6RQRdLfyHRJhGldkVLLY5HGlZDOjg= 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=FT9AP11Z; 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="FT9AP11Z" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61B1gTxK2771696; Wed, 11 Feb 2026 14:14: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=nZ3DtYU6oaP7UVk4P zUNWALcciYCvdSqiN7dJ9VBjQ0=; b=FT9AP11Z+GCNfyF5lav+mCn3P9v+8aSza lMI0b0Ge4bjElNawf6zvpIGpXP/rU2a28nD0+WDthkqDL7Ul/0kvci9tkmhtJUyc xe358SlIoVjWqGVohKo9r7rfmbjvRwQ6iJyFLBqslxD3uHj5Wx+cFGSU3GPZhTte k+7T1LHv5XTcTolBXr5CUTVeGAsr6a8A+vy36hIJGfMZzWvRD3iknfx5LhTztH8P f5k5Ib/tmi88uisq1S+7/GSEcZ7682v96OxJhcOMWqu0BKh7OzxDTo0RmaS61bpb MXJy3VB9GgSOh49nlaOqghPfT4DxsPwsbg1m3bUnABW73VnZe6VSA== 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 4c696wy13s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:04 +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 61BBA3LT001847; Wed, 11 Feb 2026 14:14:03 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4c6je25spj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:03 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61BEDxTO59769306 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Feb 2026 14:13:59 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8FEC020040; Wed, 11 Feb 2026 14:13:59 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 050B62004D; Wed, 11 Feb 2026 14:13:59 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Feb 2026 14:13:58 +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 v9 1/6] x86/vdso: Fix DWARF generation for getrandom() Date: Wed, 11 Feb 2026 15:13:52 +0100 Message-ID: <20260211141357.271402-2-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211141357.271402-1-jremus@linux.ibm.com> References: <20260211141357.271402-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-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=WZYBqkhX c=1 sm=1 tr=0 ts=698c8ead 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=rsc5PF6bQGhcUx5MhlsA:9 a=2JgSa4NbpEOStq-L5dxp:22 a=NdAtdrkLVvyUPsUoGJp4:22 X-Proofpoint-GUID: coOlGK5_Y3eioVjFxn1dt-jFO-6QXvjH X-Proofpoint-ORIG-GUID: hCiBiAg_lSUcbnUCAx289HQUzG6fCHkp X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjExMDEwNyBTYWx0ZWRfX2URJV1E8ko/V FYOQMGVlZpMxXxdGg9YmrhVbUUEC99giRAiNLHyPm6TJGCSYZAOBPL3g0Q1mB+br2n/IOiPaOSL OaSumIDOrcUrdU7Lb+zF6eoHEcK+hVidv3PV/kdQec4Bnj/jAq93gUKvY1EnC4h3mSKfUBUQWS3 L1wBJzwcxTeT6PmNX5CdS6Jmf4YGHzLzO+Ep1wxYd0osZaaMuLyHob071b1rwIGsgKERKp9Dp/X tzApMzOMBdHt02bysDTv0YQ0voHL0RY4ZG2IpfnO3+PvhhTIOrS/sr61M3ph+FAqLWa2k5aErYe /TKcYXJ1JOFaBXWTzjlAXo08wAs+VVtIU55hUqeSY1joNSx+pMW93SwgTyt/zIKUAWd/EpD4XB9 le0veV4Poz/qdFd9Hqh0VQxadQ+1rb4LAHKyi6mqNBK/RfDYktYxVs0aZBeVXVokBi2NLl9bGQn KumaDRN5X6qvgdLfSqw== 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-11_01,2026-02-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 phishscore=0 bulkscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602110107 Content-Type: text/plain; charset="utf-8" From: Josh Poimboeuf Add CFI annotations to the VDSO implementation of getrandom() so it will have valid DWARF unwinding metadata. Fixes: 33385150ac45 ("x86: vdso: Wire up getrandom() vDSO implementation") Signed-off-by: Josh Poimboeuf Signed-off-by: Steven Rostedt (Google) Acked-by: H. Peter Anvin (Intel) Signed-off-by: Jens Remus --- arch/x86/entry/vdso/vdso64/vgetrandom-chacha.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/entry/vdso/vdso64/vgetrandom-chacha.S b/arch/x86/entr= y/vdso/vdso64/vgetrandom-chacha.S index bcba5639b8ee..cc82da9216fb 100644 --- a/arch/x86/entry/vdso/vdso64/vgetrandom-chacha.S +++ b/arch/x86/entry/vdso/vdso64/vgetrandom-chacha.S @@ -4,7 +4,7 @@ */ =20 #include -#include +#include =20 .section .rodata, "a" .align 16 @@ -22,7 +22,7 @@ CONSTANTS: .octa 0x6b20657479622d323320646e61707865 * rcx: number of 64-byte blocks to write to output */ SYM_FUNC_START(__arch_chacha20_blocks_nostack) - + CFI_STARTPROC .set output, %rdi .set key, %rsi .set counter, %rdx @@ -175,4 +175,5 @@ SYM_FUNC_START(__arch_chacha20_blocks_nostack) pxor temp,temp =20 ret + CFI_ENDPROC SYM_FUNC_END(__arch_chacha20_blocks_nostack) --=20 2.51.0 From nobody Thu Apr 2 06:08:46 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 E0F6F33A708; Wed, 11 Feb 2026 14:14:59 +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=1770819301; cv=none; b=CBP8YuMivoiZt9ipDLM08IVyLLXfG9TLFXS9mazOalGopg43Jc5WaAFuNgZlh9IHX3rfkChZ8gQ4sYIsgS29YWzijn9RKl2pWmLOLaJB/rSt0m+H5QFK2FgNRv9EMR4AjW1ABN+fz1WSfamhtfRVBEVbtoonBXg0Nitq+awSpdk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770819301; c=relaxed/simple; bh=JX5DB7kuIFLTsjbACmu21PvGbIRTip8UGIdm1g5XdgQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kluiXuHMDsRHp8avJrFyZZ5H9ebEuitY2VfPbyTDrRGNyUZ9caCwvMDCoWaXfAVSJWkuspzpHHUp65Z5AssPjsRuHInyhzSxdZRQBVmpdq0ua+kV5T3BtG9G+BsmuZLylAjswG6l5d8zIIDG5uFqsLnfnqppVEePligcokx/d9Y= 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=kz3/r5BN; 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="kz3/r5BN" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61AMPxUu091358; Wed, 11 Feb 2026 14:14:06 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=cSiBsMiyvS7cygGX5 2RlC3XdEyvxbuMMGQjKtYeDTPg=; b=kz3/r5BNvOSuPyChC5xPDRz+Snhhv+bl6 ubTrEO9TxQhY3Fixxws+ivvSF87HDzy+8XbDr/Yua2mN0+d6x6wSSKhvi09OxgVu mebMiZ9Hz615vzeiGu861YEWc5kIDHsyV/NIwRhmA4nkYul4zMYODpwy+vhotGYl zhelUsKlkmJCgBtAI2STG2LIRDBHSzLfvHJFpSjwWR2Xy0A3atHcGAqHMwXjRtoY c8QJu1sZn7uHefU+H7dCWWNAe2+6rtwMuhMS/gncg8RpOEdPV8/1DPL+kE8DQmt5 0KOUj94zunLDkcvd+e6hcXDt2zz94++nk/i2TgY3oaHNOaw6RxXSA== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4c696uhfmg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:05 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61BAomEB019258; Wed, 11 Feb 2026 14:14:04 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4c6hxk5wag-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:03 +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 61BEE0OH59113890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Feb 2026 14:14:00 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2FAD920043; Wed, 11 Feb 2026 14:14:00 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9822F2004F; Wed, 11 Feb 2026 14:13:59 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Feb 2026 14:13:59 +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 v9 2/6] x86/asm: Avoid emitting DWARF CFI for non-VDSO Date: Wed, 11 Feb 2026 15:13:53 +0100 Message-ID: <20260211141357.271402-3-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211141357.271402-1-jremus@linux.ibm.com> References: <20260211141357.271402-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-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=YZiwJgRf c=1 sm=1 tr=0 ts=698c8ead cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==: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-ORIG-GUID: x44cYHj-o3vU4pGpJe8M9L_He5W8_tnK X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjExMDEwNyBTYWx0ZWRfXxH/OxxGB55JO qBUnCbUmHRLSbbJAIZu+XQXLey7Y2Ch+IBMyV2QNdzdRzH6UvzIMEiciXzVh9wR4Uy9RCMFIvBw x3MeMCK64plX9iWAL+GCBFZpSkVpapzcKbCAAYJmTKt2slOMOMlki2Z3T1WzO26sun6KfBDPRKV oT0bo0zlZOxZn5zdvei7LBvNiL6wVgBhKLh5Lq+9Bz35NuRoH+rwp9V7SfB51VbMgCLKxrOOvT8 2i4BFQlnaNQIeqm78PmOSqIivRwTahmfJaOg0v5c3O+LuCON08U/Lq/L9dpoSPxdMs2gaRC/S+I ks62tke4+92z14Y1f6OT+YygLXEFae6Sp4Cj4JeJ573ncloPaaFfaA99Sxm9+nv7X5nQfPxFa7J GEsYTYQdRP6+LOOkoK3Alt0P6n2J/GwJ3bEErSlBntqfnNSdmPQdut7e57hGhs5HGSxiztJDIG8 qpCHOTDyntY9XeiN1eA== X-Proofpoint-GUID: RUCt7kZLLE97Paz9uCofjiQX3_DqMij0 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-11_01,2026-02-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 impostorscore=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602110107 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 --- 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 From nobody Thu Apr 2 06:08:46 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 C2BE92BEFE1; Wed, 11 Feb 2026 14:14:41 +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=1770819283; cv=none; b=f+vKy5xU64McsyT2vw1elGo5uw0d5JqRkRlUBUD6PK8qB9LbwB8aOlb4gOdQryLdZ4FaoDYdTANZnVDFKDzmFZzRZsoUUQqBxKCWU/t6bR/gNJ6jgJaUqRLbAsDuC2HtnO4uIORdgNGDDLOCqBdejCgqcMGmgmuWhoNp8w+GKJ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770819283; c=relaxed/simple; bh=xLG7r8n3u/HFWDr86oo9GnbzCkRw3K/7fGDlG/Y1ow0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t8TPua9zRQiDdg3UlSjXEaAPh5WkqkD1F+MIPGjEe0WMd4QAWzHLqclxQY4BT0v1e0ms//u2axhYSQzQTD1lh3GNjs61vaBUfJbeK89euuSRwf4M/gvp19jkNIDGktl8MYCDYjYHrtx3Kanqa/5yoyhAyTi2FtJ1Bah6v6YQ6Zk= 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=T8HlXSnQ; 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="T8HlXSnQ" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61BB8MYn3537614; Wed, 11 Feb 2026 14:14:07 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=ozqt9kYUw9hKvY7/d WXgcYglieEexRsyUqSs+6cTMXw=; b=T8HlXSnQm8958TE0+FY/7Z8lGqsIJcSOU Fpe4XHm5+Hk1Wh48s3Nu+Qs27sUAQWbbdEiSaTdnHHxemzmWOqNR2vyn84/W0Lba L9gv/3nwzKrWtGDXdfYQGpaAFR6BKoWohG+kcQMvX7K2CibVXMYD2NSW7Mti8NeN S4EhcPy3w9ehVwTM475ARDAwzXxbA4JmQIcLIsdT99A0YoXNkWgOFIWBxXEg/w+P QXjxz6RPnbEBeMt7Z5AsuJZcSPQG2id498MSFDDcFbcju7sweyuA3tVFv3gSK6iF 3hfZ+CZ2aT4KJAJt8YvrLCjqeKLMWljYAHI9YWRKnFr2JK/KpjnYA== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4c696v6xkx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:05 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61BDecK9008390; Wed, 11 Feb 2026 14:14:05 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4c6g3ye5v0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:04 +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 61BEE0Vk59113894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Feb 2026 14:14:00 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BE7D820040; Wed, 11 Feb 2026 14:14:00 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 357C72004E; Wed, 11 Feb 2026 14:14:00 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Feb 2026 14:14:00 +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 v9 3/6] x86/asm: Use CFI_* macros in SYM_FUNC_* macros so they can be added to VDSO Date: Wed, 11 Feb 2026 15:13:54 +0100 Message-ID: <20260211141357.271402-4-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211141357.271402-1-jremus@linux.ibm.com> References: <20260211141357.271402-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-Reinject: loops=2 maxloops=12 X-Proofpoint-GUID: Ml6Orn5IoSUyqD7K0i-cbu4RT4xWxx24 X-Proofpoint-ORIG-GUID: 6FoFqX8emWMKU_rzeo9BmrQoP8H49iiL X-Authority-Analysis: v=2.4 cv=JdWxbEKV c=1 sm=1 tr=0 ts=698c8eae cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=HSAZBKcgB-AHDwtM:21 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=i3XSr9hboEKZ3AC0laIA:9 a=2JgSa4NbpEOStq-L5dxp:22 a=NdAtdrkLVvyUPsUoGJp4:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjExMDEwNyBTYWx0ZWRfX+tDqH2ueBFOq SgsoqkdqLsioevjTt3MUZYUwSCmrWyIQ/UQAUAKmsUwjVoax6+PeAw38nx5xebaxiuUd97etfhI f6HunCA/YO+qk0F+V/Z+wNPoFWhfFwkQStGN9uQ1uQBIZEFoMEovfyRH4TalQPDCP+UnG65wJCB 11qZw0R5PJg0AOUnxA/GcccMZfptHGDBs4s4iFWfPp6EsEBN7NnRF25wiG19Y+syTwwo1+BPkt2 qSkB29jHUnImE5NV2Qn16BuNhZ8rhUksj0V9+krG+AiGZprfbWqyvVFNDu2SjNpPF5+ICQTlMsQ YmiRzP5TKWpWm6KHM4kE6rXCMKB/vMJyuyBDw1TPe9UmlqQhwTR4d+VyA3Xbno5Y7/2c6s0Pgbh ng6HvsqIUKRI2VdBsEwJ586E4M38LcnlBiGspG0ocvpe7AEmcKTbPcHhrF+cH8q669fkWMfUkwy JHi52k7sV626ypWTXbA== 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-11_01,2026-02-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 impostorscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602110107 Content-Type: text/plain; charset="utf-8" From: Josh Poimboeuf Add CFI_STARTPROC and CFI_ENDPROC annotations to the SYM_FUNC_* macros so the VDSO asm functions don't need to add them manually. Note this only affects VDSO, the CFI_* macros are empty for the kernel proper. Signed-off-by: Josh Poimboeuf Signed-off-by: Steven Rostedt (Google) Acked-by: H. Peter Anvin (Intel) Signed-off-by: Jens Remus --- arch/x86/entry/vdso/common/vdso-layout.lds.S | 2 +- .../x86/entry/vdso/vdso64/vgetrandom-chacha.S | 2 -- arch/x86/entry/vdso/vdso64/vsgx.S | 4 --- arch/x86/include/asm/linkage.h | 33 +++++++++++++++---- arch/x86/include/asm/vdso.h | 1 - 5 files changed, 28 insertions(+), 14 deletions(-) diff --git a/arch/x86/entry/vdso/common/vdso-layout.lds.S b/arch/x86/entry/= vdso/common/vdso-layout.lds.S index a1e30be3e83d..856b8b9d278c 100644 --- a/arch/x86/entry/vdso/common/vdso-layout.lds.S +++ b/arch/x86/entry/vdso/common/vdso-layout.lds.S @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0 */ -#include +#include #include #include =20 diff --git a/arch/x86/entry/vdso/vdso64/vgetrandom-chacha.S b/arch/x86/entr= y/vdso/vdso64/vgetrandom-chacha.S index cc82da9216fb..a33212594731 100644 --- a/arch/x86/entry/vdso/vdso64/vgetrandom-chacha.S +++ b/arch/x86/entry/vdso/vdso64/vgetrandom-chacha.S @@ -22,7 +22,6 @@ CONSTANTS: .octa 0x6b20657479622d323320646e61707865 * rcx: number of 64-byte blocks to write to output */ SYM_FUNC_START(__arch_chacha20_blocks_nostack) - CFI_STARTPROC .set output, %rdi .set key, %rsi .set counter, %rdx @@ -175,5 +174,4 @@ SYM_FUNC_START(__arch_chacha20_blocks_nostack) pxor temp,temp =20 ret - CFI_ENDPROC SYM_FUNC_END(__arch_chacha20_blocks_nostack) diff --git a/arch/x86/entry/vdso/vdso64/vsgx.S b/arch/x86/entry/vdso/vdso64= /vsgx.S index 37a3d4c02366..c0342238c976 100644 --- a/arch/x86/entry/vdso/vdso64/vsgx.S +++ b/arch/x86/entry/vdso/vdso64/vsgx.S @@ -24,8 +24,6 @@ .section .text, "ax" =20 SYM_FUNC_START(__vdso_sgx_enter_enclave) - /* Prolog */ - .cfi_startproc push %rbp .cfi_adjust_cfa_offset 8 .cfi_rel_offset %rbp, 0 @@ -143,8 +141,6 @@ SYM_FUNC_START(__vdso_sgx_enter_enclave) jle .Lout jmp .Lenter_enclave =20 - .cfi_endproc - _ASM_VDSO_EXTABLE_HANDLE(.Lenclu_eenter_eresume, .Lhandle_exception) =20 SYM_FUNC_END(__vdso_sgx_enter_enclave) diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h index 9d38ae744a2e..9d7f90c57451 100644 --- a/arch/x86/include/asm/linkage.h +++ b/arch/x86/include/asm/linkage.h @@ -40,6 +40,10 @@ =20 #ifdef __ASSEMBLER__ =20 +#ifndef LINKER_SCRIPT +#include +#endif + #if defined(CONFIG_MITIGATION_RETHUNK) && !defined(__DISABLE_EXPORTS) && != defined(BUILD_VDSO) #define RET jmp __x86_return_thunk #else /* CONFIG_MITIGATION_RETPOLINE */ @@ -112,34 +116,51 @@ # define SYM_FUNC_ALIAS_MEMFUNC SYM_FUNC_ALIAS #endif =20 +#define __SYM_FUNC_START \ + CFI_STARTPROC ASM_NL + +#define __SYM_FUNC_END \ + CFI_ENDPROC ASM_NL + /* SYM_TYPED_FUNC_START -- use for indirectly called globals, w/ CFI type = */ #define SYM_TYPED_FUNC_START(name) \ SYM_TYPED_START(name, SYM_L_GLOBAL, SYM_F_ALIGN) \ + __SYM_FUNC_START \ ENDBR =20 /* SYM_FUNC_START -- use for global functions */ #define SYM_FUNC_START(name) \ - SYM_START(name, SYM_L_GLOBAL, SYM_F_ALIGN) + SYM_START(name, SYM_L_GLOBAL, SYM_F_ALIGN) \ + __SYM_FUNC_START =20 /* SYM_FUNC_START_NOALIGN -- use for global functions, w/o alignment */ #define SYM_FUNC_START_NOALIGN(name) \ - SYM_START(name, SYM_L_GLOBAL, SYM_A_NONE) + SYM_START(name, SYM_L_GLOBAL, SYM_A_NONE) \ + __SYM_FUNC_START =20 /* SYM_FUNC_START_LOCAL -- use for local functions */ #define SYM_FUNC_START_LOCAL(name) \ - SYM_START(name, SYM_L_LOCAL, SYM_F_ALIGN) + SYM_START(name, SYM_L_LOCAL, SYM_F_ALIGN) \ + __SYM_FUNC_START =20 /* SYM_FUNC_START_LOCAL_NOALIGN -- use for local functions, w/o alignment = */ #define SYM_FUNC_START_LOCAL_NOALIGN(name) \ - SYM_START(name, SYM_L_LOCAL, SYM_A_NONE) + SYM_START(name, SYM_L_LOCAL, SYM_A_NONE) \ + __SYM_FUNC_START =20 /* SYM_FUNC_START_WEAK -- use for weak functions */ #define SYM_FUNC_START_WEAK(name) \ - SYM_START(name, SYM_L_WEAK, SYM_F_ALIGN) + SYM_START(name, SYM_L_WEAK, SYM_F_ALIGN) \ + __SYM_FUNC_START =20 /* SYM_FUNC_START_WEAK_NOALIGN -- use for weak functions, w/o alignment */ #define SYM_FUNC_START_WEAK_NOALIGN(name) \ - SYM_START(name, SYM_L_WEAK, SYM_A_NONE) + SYM_START(name, SYM_L_WEAK, SYM_A_NONE) \ + __SYM_FUNC_START + +#define SYM_FUNC_END(name) \ + __SYM_FUNC_END \ + SYM_END(name, SYM_T_FUNC) =20 /* * Expose 'sym' to the startup code in arch/x86/boot/startup/, by emitting= an diff --git a/arch/x86/include/asm/vdso.h b/arch/x86/include/asm/vdso.h index e8afbe9faa5b..498ac423741c 100644 --- a/arch/x86/include/asm/vdso.h +++ b/arch/x86/include/asm/vdso.h @@ -2,7 +2,6 @@ #ifndef _ASM_X86_VDSO_H #define _ASM_X86_VDSO_H =20 -#include #include #include =20 --=20 2.51.0 From nobody Thu Apr 2 06:08:46 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 A8D6F1F5821; Wed, 11 Feb 2026 14:14:41 +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=1770819282; cv=none; b=IUpf7aXTrSLmDWOgYNiC6zVv/zoJ5J+qGyTZGiKyLIOr5JqmmNEHjKKWxjFxg4YMng27QC27M8QcfjCj5R61o94YFAtryO6Rr/l5XPHFc4NihVIT6hvxx6mMVGqvxbEwQ6NaElfE98f5l3nH8aMYUTNOFJXt8fjITbjTZhu3DJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770819282; c=relaxed/simple; bh=oq0FWBveUGSeMhAcXcysR6Ct95jkvRt2c4zuz73D7JY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t8XPbDin60LHCwf5rl5asP01G4OeDon3qJS2u97XAjJqHzeOMkg/vFFJkVvT+ZSXnSmWNyjuroNFK+Lvff2qpSas19iTTn0n2HoCgtLRJVCKmcqCJvMiqOyL9l/KIV+tJfHTClo95DTHKZpaXAblZdQXvHJNILzN1R6uEuaRPK4= 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=aX6wkzsO; 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="aX6wkzsO" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61B1m5jN565607; Wed, 11 Feb 2026 14:14:07 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=Zcp5Naq2FPjOG1kV+ prJJdfvki9PYjEAiotKE3UfUD8=; b=aX6wkzsOomJrnSmZTnsjodoMr2cJgje9G neRJdVXnwNsAICQIey5kLmYoRnzsSmWGdq0oDBjiCsqyu4B6QsZXiK+EkLEmtv9s gp9zKxXAnPfElnNdgNYxySwl8/7XORzEvkNKfmPRl70HWXIwGcw6qcjxKzG+5xr8 CFy8V8L7hG8qAorXM9ZAJl0cWVcN1NuIOMFmgzqTo45/cWiHthQIyI6u9baR24NC JVZ148EOh1IIRgOSYfOkWmIHsIoK8f4ti48UKdJZx4YaVu/Dwib0XVF1zvx/FIjL Hv8xURBqOGa91hvNL09m2SPSTJmlqu/HAC5cbO3hRUF94CPZEL9aA== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4c696wy13y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:06 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 61B9v0YZ019277; Wed, 11 Feb 2026 14:14:05 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4c6hxk5waj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:05 +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 61BEE12x28967514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Feb 2026 14:14:01 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5584220040; Wed, 11 Feb 2026 14:14:01 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C61F220043; Wed, 11 Feb 2026 14:14:00 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Feb 2026 14:14:00 +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 v9 4/6] x86/vdso: Use SYM_FUNC_{START,END} in __kernel_vsyscall() Date: Wed, 11 Feb 2026 15:13:55 +0100 Message-ID: <20260211141357.271402-5-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211141357.271402-1-jremus@linux.ibm.com> References: <20260211141357.271402-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-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=WZYBqkhX c=1 sm=1 tr=0 ts=698c8eae cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==: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=lbqDleH5ITP0AWbVeFgA:9 a=2JgSa4NbpEOStq-L5dxp:22 a=NdAtdrkLVvyUPsUoGJp4:22 X-Proofpoint-GUID: kz4-PgsEcTSzm-2r0wzqb-Lk3s4dyfyA X-Proofpoint-ORIG-GUID: O-HOHeIoS3U04pkYu2_SbRe2Ovc3uHRr X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjExMDEwNyBTYWx0ZWRfX+Eyu6SdqHHJY OnDHDX8s6SkYNUyTyuWAMGkV+wFFcvS75c8fY5jaUoHjOPJ8bn/cQRJPN2ALRxeGbShs1cdFcWZ H9UTcg2vGHAsnkBOtn/kZE1STpq05s11yUFOqFPCNMyi5F0eSPK5TypLqeaoswFGynJE6YDOyBb 7QCVhuNAyqWYaGiS3AsPooE5qDpItfFxdAy8mTfpxPbELI8RM9X2mnBeopUXGjeR+FcdsOJ1bX3 gY+GY3APOnbaRV+IQf8ViygA9vXk6/gLLHLQdI4brNZ/QLjNWc3xCsG056Z1iCdYVPvniqG9bRF 6OR62eLELk0N2lW9liqlHwaMHhtVfJOhdQm6aHRi9lNVpqDQi3vGFd3kSh0R9Y/apLGXaAeO8Cj e4sWWsBiKu1p5yZRs7vqY6poa5WS0tWQyYsnMunhL2OVd2sBGc+aKlBoGqmnIeo1mcZFfH2gSme xmbh7DTQIFuVXTtKMHw== 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-11_01,2026-02-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 phishscore=0 bulkscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602110107 Content-Type: text/plain; charset="utf-8" From: Josh Poimboeuf Use SYM_FUNC_{START,END} instead of all the boilerplate. No functional change. Signed-off-by: Josh Poimboeuf Signed-off-by: Steven Rostedt (Google) Acked-by: H. Peter Anvin (Intel) Signed-off-by: Jens Remus --- arch/x86/entry/vdso/vdso32/system_call.S | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch/x86/entry/vdso/vdso32/system_call.S b/arch/x86/entry/vdso= /vdso32/system_call.S index 9157cf9c5749..a90f4f7de396 100644 --- a/arch/x86/entry/vdso/vdso32/system_call.S +++ b/arch/x86/entry/vdso/vdso32/system_call.S @@ -9,11 +9,7 @@ #include =20 .text - .globl __kernel_vsyscall - .type __kernel_vsyscall,@function - ALIGN -__kernel_vsyscall: - CFI_STARTPROC +SYM_FUNC_START(__kernel_vsyscall) =20 /* * If using int $0x80, there is no reason to muck about with the @@ -85,7 +81,5 @@ SYM_INNER_LABEL(int80_landing_pad, SYM_L_GLOBAL) CFI_RESTORE ecx CFI_ADJUST_CFA_OFFSET -4 RET - CFI_ENDPROC - - .size __kernel_vsyscall,.-__kernel_vsyscall +SYM_FUNC_END(__kernel_vsyscall) .previous --=20 2.51.0 From nobody Thu Apr 2 06:08:46 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 5DD982BCF43; Wed, 11 Feb 2026 14:14:18 +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=1770819259; cv=none; b=GNqFonqjTZO0gQNbcYjquDv8EW/Ux25zhZAR5kMPXIyLRUe2MRb1NCsBZYMfdNfDvpIZ5Tp+tL57lpJdwn5kRFMKqsD1rp8RdcXJ6oufL/VKvDyVmeZY0iHmWdG0pMW6wR4eAsEJIesupVd+Fp/RaHKHc8iBsiDL9qWeolFUoik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770819259; c=relaxed/simple; bh=SDVEHIVGeJRga/cenvkjR0/NXUnkcS502IutEhhhYro=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rO6+Qv6PW/Bnu0MqbQ3KvSH/RVF3TGe4khlWumQQA8dqAoGUTbuSbzdVcZ8bgAVZYcRvpsesoTQDJHIkdUUrwQxWuRpiulnrqGQ3ZRJy9vj9V6X0U3OrR8EkIIEEYq5x9buLcecWDpWVe1BEUCskK80473VkGbhniNS3W3WWdKk= 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=OtHCEJS9; 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="OtHCEJS9" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61ANslr2470140; Wed, 11 Feb 2026 14:14:07 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=qiH+5t/dirTrzjD9Z dtQxW3Rb7kBj9PpVkHn0IEvdoQ=; b=OtHCEJS9FYwWQwev3XdeyV80sYiX60gha 1o/sM9KcwYWvyQ8bAD3QYfkFgHibOqhVyYfH1+YFimppjc0nl6BEpUnydRmJfHxI Vha+nJjpbJM6+kswkEvy4AJUmYLP0/PKZpboICxCFaGP8mRmpUSIRS0ScOn4SOpH hDdwG9eLauie4j1MHHe0dPE74SstV5E+7OEBKOYhLhe9BagCycw7qERpzBAqCzV6 zIDGYgr/W0AsSPK/Cnf+ScRCjBtq9o/Y917pFiH0OWOuTdU7O9V6EQafh7UHn48E JlkKfJuWyHolj8NAvKTN05URL7lLlk/2zM010EhPPpa74Z+/1hiVA== 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 4c696wy141-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:06 +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 61BCt5Jh002567; Wed, 11 Feb 2026 14:14:05 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4c6fqsp93s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:05 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61BEE2Wm44171750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Feb 2026 14:14:02 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E128920040; Wed, 11 Feb 2026 14:14:01 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5DA172004B; Wed, 11 Feb 2026 14:14:01 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Feb 2026 14:14:01 +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 v9 5/6] x86/vdso: Use CFI macros in __vdso_sgx_enter_enclave() Date: Wed, 11 Feb 2026 15:13:56 +0100 Message-ID: <20260211141357.271402-6-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211141357.271402-1-jremus@linux.ibm.com> References: <20260211141357.271402-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=WZYBqkhX c=1 sm=1 tr=0 ts=698c8eae cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==: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=zHpKlsP_3zAlDdbrjxAA:9 a=2JgSa4NbpEOStq-L5dxp:22 a=NdAtdrkLVvyUPsUoGJp4:22 X-Proofpoint-GUID: yaSfy3Y2S2nZC2d5EupOPnVwvtL2ZOYD X-Proofpoint-ORIG-GUID: yaSfy3Y2S2nZC2d5EupOPnVwvtL2ZOYD X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjExMDEwNyBTYWx0ZWRfXz+3TUP9I9FB+ mSytwbvWbAr+l1482s09TggHikYA11hlHEPTZ28cxfVt1dMz+e9/xafBI7kDDlISioSELkRqu4F 1FwknobKOFUOTb3ATrvFXKJmwfhDlJvFov8pdAS/ly829RO5yuHQOPhjqoUgQ/Rh/YPIyFv9C6W 8cDf50a/gYSS305gKbsKALv+bBShmyNaR5BwYrSUjbiYWqoc9mWF1SDEXMIjIl3MWeLMTqy2Lr1 JiitKqxcf1WsPkzx/ZI4+nW1DawkoEJ77691qtszjQR2c265uQIWKyAC4uxg2P3XJBbnPwMSfLp ZnWVyFaTqWrHLD8n/dGIOidxfDLXseJxZrNN+9zSbXIMjZyxwKhZjhmdYZDuM2xm5A5zkdb/y+f JV8OdxMLywBFiXS9sUfmyfUQuETHAurUCPmdYsOjvX6Ubg12vcDl5bs7LuyurdqoI5mJsmomBF4 SIQdDgNwM97883w0aUQ== 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-11_01,2026-02-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 phishscore=0 bulkscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602110107 Content-Type: text/plain; charset="utf-8" From: Josh Poimboeuf Use the CFI macros instead of the raw .cfi_* directives to be consistent with the rest of the VDSO asm. It's also easier on the eyes. No functional changes. Signed-off-by: Josh Poimboeuf Signed-off-by: Steven Rostedt (Google) Acked-by: H. Peter Anvin (Intel) Signed-off-by: Jens Remus --- arch/x86/entry/vdso/vdso64/vsgx.S | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/x86/entry/vdso/vdso64/vsgx.S b/arch/x86/entry/vdso/vdso64= /vsgx.S index c0342238c976..76efbeb1e287 100644 --- a/arch/x86/entry/vdso/vdso64/vsgx.S +++ b/arch/x86/entry/vdso/vdso64/vsgx.S @@ -25,12 +25,12 @@ =20 SYM_FUNC_START(__vdso_sgx_enter_enclave) push %rbp - .cfi_adjust_cfa_offset 8 - .cfi_rel_offset %rbp, 0 + CFI_ADJUST_CFA_OFFSET 8 + CFI_REL_OFFSET %rbp, 0 mov %rsp, %rbp - .cfi_def_cfa_register %rbp + CFI_DEF_CFA_REGISTER %rbp push %rbx - .cfi_rel_offset %rbx, -8 + CFI_REL_OFFSET %rbx, -8 =20 mov %ecx, %eax .Lenter_enclave: @@ -77,13 +77,11 @@ SYM_FUNC_START(__vdso_sgx_enter_enclave) .Lout: pop %rbx leave - .cfi_def_cfa %rsp, 8 + CFI_DEF_CFA %rsp, 8 RET =20 - /* The out-of-line code runs with the pre-leave stack frame. */ - .cfi_def_cfa %rbp, 16 - .Linvalid_input: + CFI_DEF_CFA %rbp, 16 mov $(-EINVAL), %eax jmp .Lout =20 --=20 2.51.0 From nobody Thu Apr 2 06:08:46 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 352D633B6F0; Wed, 11 Feb 2026 14:14:42 +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=1770819284; cv=none; b=J38m+4waubLrZZ1hz0DEht527sunB6D13galW3xcCgf1lJprym3tBDKS6ufqk9A1KfLfl2nhFBhcMhAw0Bn4Tr/QzKCxnRme9g0GnaROsRG6/686K9oPe2lOGvuzrNvvr7ZamoUpdZZn8Ouom4P7PZOMotgnFbzOph++dJJ4LC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770819284; c=relaxed/simple; bh=1T4x+TsJdYs3juadV6MkYCv31mT4YeU46mBx9tK28j0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N1cdMxBbOWGBLgX/TbZcw5NxGH9Q4GUGJa22qY+8tuGpwC6U1XUI+2A3FR34/GTVNY222OuY2ZIDDBURSywi0tqFoI6q7Vfq4iJ5rQQj6u63P+JHy4q//g3VNkvFqSnySLOYd9g32C/uziQA+6EfdheQk3PR82K8f51Htc5ymOM= 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=UhE6gbKu; 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="UhE6gbKu" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61AMN58T247099; Wed, 11 Feb 2026 14:14:08 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=Q3Xt6rhgAo9PMTm2P CN8mvAUz0apI+pbZI385wxspwE=; b=UhE6gbKuuBYtiX1wPvAncyAppLquVqzkP ZnRVK5jfbyI/B1LZc5vW6nhk4VqWUzEuG/nkLgLRgi7gp8KJGYX/nBZKQuHEn5WC 8Rvel6z2himbFdyrktWTDIei4P9PwVt0fL5T+DmlZDI69atDDZnWfZUTHKmHbO8Z U/c1bbh28qouPMdCD6d7slsXS7QR/j8sMehYyIsnbN0LM/VgGKiiljpDBU99Rftn 5bGYv/B3NwLxpWFYoGK7kf9Jkjpc/sqS2LlbuuKWspRIlGYbMAtAdMvCCJw31eiM ewe0rS/enuI2fWdOAD+SiAQ7qQseZZR6dEaCb9RKLqSSCqm94h11A== 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 4c696uy0n5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:07 +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 61BEDuF7001420; Wed, 11 Feb 2026 14:14:06 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4c6gqn63td-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Feb 2026 14:14:06 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 61BEE2ln44171754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Feb 2026 14:14:02 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 82E2A20040; Wed, 11 Feb 2026 14:14:02 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E903D20043; Wed, 11 Feb 2026 14:14:01 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Feb 2026 14:14:01 +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 v9 6/6] x86/vdso: Enable sframe generation in VDSO Date: Wed, 11 Feb 2026 15:13:57 +0100 Message-ID: <20260211141357.271402-7-jremus@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260211141357.271402-1-jremus@linux.ibm.com> References: <20260211141357.271402-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-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjExMDEwNyBTYWx0ZWRfX7HSPJ61QxQJs +1eDrcApiym3Em4pW7xtFyg71gjw14Gqf+uGMziZuGfsVtHoZ/IFuWlerRQMZ4UWlA8Niup5GqP omxcAy8HxkPSznYU09FCa2yYg0dDP+3FxAIpInemNApHDQthBPpRcXJwxyw75qBzZpgh8cMIBhc VCpD1VFf+n5hyKvSjLD1Rq/iAG7UcRmq6Fxqu66U6WToInRtV6nDzLYUWoydaGHzgZWke3bMutd n2GUPG41SAYiYqKFWP5JwQzI8T9clSC26qDFG6O4q/Hd16yoQ4UjmI1Ux3yZqzp/71tISW6sTXM SGOgYnwDkEUh5uGMn+1Z0OzejSOcjP+qkqhQeNpRrIWg5Msd8d9l3nRaJsZN4Ho6pX0GMzvpoWP cQYu8FH51DyJvsXvk1L/s0ubI5z0esJ/JEqQZ+j03/ccPPoZaOW5iZKgv+Sy/DhYF/5re2Yv8Td UA/wxfSyFQ1TptNpilQ== X-Proofpoint-ORIG-GUID: x6hV9bK3Cg9x2EG9Dvt43keP7ljRBpqb X-Proofpoint-GUID: 1bRUXk3Z-0Yr6vbsGSG9vxB2aqhunltn X-Authority-Analysis: v=2.4 cv=O+Y0fR9W c=1 sm=1 tr=0 ts=698c8eb0 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VwQbUJbxAAAA:8 a=meVymXHHAAAA:8 a=VnNF1IyMAAAA:8 a=Jhyzjtp1HSYqCdt93m4A:9 a=2JgSa4NbpEOStq-L5dxp:22 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-11_01,2026-02-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 adultscore=0 malwarescore=0 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602110107 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. Starting with binutils 2.46 both GNU assembler and GNU linker exclusively support generating and merging .sframe in SFrame V3 format. For x86 SFrame is only supported for x86-64. Not for x86-32 nor x32. Test whether the assembler supports option '--gsframe-3' to explicitly select SFrame V3 format. Note that testing using Kconfig macro 'as-option' is not sufficient, as GNU assembler will accept the option for any target, regardless of whether it is actually capable to generate .sframe for it, as long the input does not trigger the generation. Therefore it is necessary to use Kconfig macro 'as-instr' to provide minimal CFI directives that trigger generation of .sframe. For x86-64 VDSO, only if supported by the assembler, generate .sframe, collect it, mark it as KEEP, and generate a GNU_SFRAME program table entry. For x86-32 and x32 VDSOs, given SFrame is not supported, do not generate any .sframe nor GNU_SFRAME program table entry. Instead explicitly discard any .sframe. The latter is required for x32 VDSO, as it is built from x86-64 VDSO objects (potentially with .sframe) converted to x32. In this regard discarding .sframe also prevents potential issues with linkers, such as GNU linker prior to binutils 2.46 commit 7487c98ff07a ("x32: Allow R_X86_64_PC64 for SFrame V3"), that do not support R_X86_64_PC64 relocations in x32, like those found in .sframe in SFrame V3 format. [ Jens Remus: Add support for SFrame V3. Prevent GNU_SFRAME program table entry to empty .sframe section. Reword commit message. ] Signed-off-by: Josh Poimboeuf Signed-off-by: Steven Rostedt (Google) Signed-off-by: Jens Remus --- Notes (jremus): Changes in v9: - Always define KEEP_SFRAME to either true/false in specific VDSO linker scripts and use #if instead of #ifdef in common one. (Peter) - Reword commit message to provide more details. arch/Kconfig | 7 +++++++ arch/x86/entry/vdso/common/vdso-layout.lds.S | 15 +++++++++++++++ arch/x86/entry/vdso/vdso32/vdso32.lds.S | 3 +++ arch/x86/entry/vdso/vdso64/Makefile | 1 + arch/x86/entry/vdso/vdso64/vdso64.lds.S | 2 ++ arch/x86/entry/vdso/vdso64/vdsox32.lds.S | 6 ++++++ 6 files changed, 34 insertions(+) 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..c486b07b195a 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 +#if KEEP_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. @@ -80,6 +87,10 @@ SECTIONS *(.discard) *(.discard.*) *(__bug_table) +#if !KEEP_SFRAME + *(.sframe) + *(.sframe.*) +#endif } } =20 @@ -89,6 +100,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 +116,9 @@ PHDRS dynamic PT_DYNAMIC PF_R; note PT_NOTE PF_R; eh_frame_hdr PT_GNU_EH_FRAME PF_R; +#if KEEP_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/vdso32/vdso32.lds.S b/arch/x86/entry/vdso/= vdso32/vdso32.lds.S index 8a853543fc0d..3a161f8e9c2d 100644 --- a/arch/x86/entry/vdso/vdso32/vdso32.lds.S +++ b/arch/x86/entry/vdso/vdso32/vdso32.lds.S @@ -11,6 +11,9 @@ =20 #define BUILD_VDSO32 =20 +/* Discard .sframe if any. SFrame does not support x86-32. */ +#define KEEP_SFRAME 0 + #include "common/vdso-layout.lds.S" =20 /* The ELF entry point can be used to set the AT_SYSINFO value. */ 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/entry/vdso/vdso64/vdso64.lds.S b/arch/x86/entry/vdso/= vdso64/vdso64.lds.S index 5ce3f2b6373a..6685cf385fc1 100644 --- a/arch/x86/entry/vdso/vdso64/vdso64.lds.S +++ b/arch/x86/entry/vdso/vdso64/vdso64.lds.S @@ -9,6 +9,8 @@ =20 #define BUILD_VDSO64 =20 +#define KEEP_SFRAME IS_ENABLED(CONFIG_AS_SFRAME) + #include "common/vdso-layout.lds.S" =20 /* diff --git a/arch/x86/entry/vdso/vdso64/vdsox32.lds.S b/arch/x86/entry/vdso= /vdso64/vdsox32.lds.S index 3dbd20c8dacc..5270fd0bdd0f 100644 --- a/arch/x86/entry/vdso/vdso64/vdsox32.lds.S +++ b/arch/x86/entry/vdso/vdso64/vdsox32.lds.S @@ -9,6 +9,12 @@ =20 #define BUILD_VDSOX32 =20 +/* + * Discard .sframe from x86-64 compiles. SFrame does not support x32 and + * it contains R_X86_64_PC64 relocations, which linkers may not expect. + */ +#define KEEP_SFRAME 0 + #include "common/vdso-layout.lds.S" =20 /* --=20 2.51.0