From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 446D0CA5FC4 for ; Wed, 30 Sep 2026 17:35:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=u92NHBseWk0xCVbsdd3r69uqfoDcKPAc7OvgaQJTAck=; b=sb/ERvoL5MrgAuH4haLHUyBDuO 7xVIxLfnlDfLt/MyQ3AeuOUgFShYqzWQ/Br9qQdjRMYiQq4HSjGlmHBOCDD/oC3rbWM9bvB6b4xfL iKkbdYnLY02ONp8BUdisdfsRTI2K43kdsFl5xeZDQfo04+VTQdbZu9fy4b9nz9kzUrimevZzHjRft B2adqL+WhSw/VizdSpz/AHx3Ts4cng6X6g7qv02nP/vKt+ikzYDFTCuzOknki9x77I/Zwg6y5Bfkd JZJPMNncu4hXEkZOvvm4JDYShGbC5mCO8XPkO8+zjwb37+qMyH6oT3pCPQBi3g1OpEcWh7BdR7+Kp gBi3ajvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xByD5-00000006r4k-4Ao7; Wed, 30 Sep 2026 17:35:16 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xByCz-00000006qzD-3yby for linux-arm-kernel@bombadil.infradead.org; Wed, 30 Sep 2026 17:35:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=u92NHBseWk0xCVbsdd3r69uqfoDcKPAc7OvgaQJTAck=; b=adXaARPWTgj8n7iHZQsEjCdROV W8zmf5HHt7Mao2T1Xsaj9C7VgfAqIYmCtnN60ty4xjfTmNSSOIMrnS5FcN7LZGDs9Rko99yv7BDKX fwoj6GEoLjc86AFi2oSQo5NPx7VxzYknzN2LW6UAi8oyF+vES7zq6W7XuUKSLqLsM60hMUcJ2VQ0/ QrzX/7s8ACKRR8D5hwp4mlce+iE3BUcVcsiKtPV3KsdSs2voxGqJPHyz4agDtgYG+Fx1cIkYKJCPf ERGtZi0NKz6KRFNHksuBZGNQCy2NkCfoqVNN5pQrBMcI/aaOedsT4KqnRyzVRj4iHHRvcKaF8evBg OpCaJZmA==; Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by desiato.infradead.org with esmtps (Exim 4.99.2 #2 (Red Hat Linux)) id 1xByCw-000000049An-3w2I for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2026 17:35:08 +0000 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 68UE5f0m3171246; Wed, 30 Sep 2026 17:34:49 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=u92NHBseWk0xCVbsd d3r69uqfoDcKPAc7OvgaQJTAck=; b=pzXxCQyxQUtAcgy1e8FGLm+1l2zIEAebr ibU9OUw3gfDgaQCtcUDwHhPf7wHH59B3lf4Yp1966C0bH5eEMwxVDxmpuLbkP6Yj aQok1zZ9yT5+MHbslJcbyYbGhKJOBATfPEX2JiJwoGTD3MLGCyk6RnPQi5ypJfOC sHeq2q5uMb+vkBFmAxma2kV+FxBt75X2IsosrgLXVgq9c9OjgK2H66aJt5kRd+Pc wbxdyDFQdDltgZMpdmj6sgkUpYB6SL+z+tIIxMkml1rOVAUM6wPT75xqzfiLcxZD zEklEKLSCbBy+qThZZA9oSagLGoFPpO0sc6ugT0+1QWVrOfF8ljgg== 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 4gx5s5eh09-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 30 Sep 2026 17:34:49 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 68UE38Tr3541488; Wed, 30 Sep 2026 17:34:48 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4h0hfpcyv1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2026 17:34:47 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 68UHYhK148497120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Sep 2026 17:34:44 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D232320049; Wed, 30 Sep 2026 17:34:43 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 845752004F; Wed, 30 Sep 2026 17:34:43 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.87.85.9]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 30 Sep 2026 17:34:43 +0000 (GMT) From: Steffen Eiden To: kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Cc: Alexander Gordeev , Andreas Grapentin , Arnd Bergmann , Catalin Marinas , Christian Borntraeger , Claudio Imbrenda , David Hildenbrand , Friedrich Welter , Fuad Tabba , Gautam Gala , Hariharan Mari , Heiko Carstens , Hendrik Brueckner , Ilya Leoshkevich , Janosch Frank , Joey Gouly , Marc Zyngier , Nico Boehr , Nina Schoetterl-Glausch , Oliver Upton , Paolo Bonzini , Sean Christopherson , Suzuki K Poulose , Sven Schnelle , Ulrich Weigand , Vasily Gorbik , Will Deacon , Zenghui Yu Subject: [PATCH v9 05/24] arm64: ptrace: Use constants for compat register numbers Date: Wed, 30 Sep 2026 19:34:20 +0200 Message-ID: <20260930173441.66762-6-seiden@linux.ibm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260930173441.66762-1-seiden@linux.ibm.com> References: <20260930173441.66762-1-seiden@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTMwMDA2OCBTYWx0ZWRfXzYCHepgWDRUk VWp0rHp5A+G8XgDLAUz3gpvOTlIzUJIvTW4MWd6dDvMRXCP0B9ysJbLxG4oGffG19c83ZpeVopv SewSXaI1GdfGcyukIkYZtLUFGwENPNE= X-Authority-Analysis: v=2.4 cv=HJ5WhYtv c=1 sm=1 tr=0 ts=6abd4839 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=VdqzKS8jKosA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VwQbUJbxAAAA:8 a=7CQSdrXTAAAA:8 a=VnNF1IyMAAAA:8 a=8sKaXpLx0aSSeG29UzUA:9 a=a-qgeE7W1pNrGK8U0ZQC:22 X-Proofpoint-GUID: Yqfa859gjKilqCtWyD9-n4HdF-vDJ9dg X-Proofpoint-ORIG-GUID: sRDGFe8E5V8bzRp7R8p2vrAka8iyZ0Bc X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTMwMDA2OCBTYWx0ZWRfX0HI0mMl4VLff Lmmv+O3B+xxnfwL/9jjDnKw/Bh574qcvI/PED6BahUS4o+jGfhmFnezxL1+ucxygxSjedZHqZxv R3I3WQZ8RjhBo6qvrHi+IKw8UX+RjLvBweuSn96KMJQb3B/6aQCwdAwyjxr7lnZXQstmEIbB0DA +ct5s155/gt3ekE++yrPaJH3nd5b4UJuZ2ZCiTobcztqSKStWb9tyMpP/VArgPqMuhWGH9Y4Vs0 MJJhNprA3hOPlFsJx0STIUrcNEcvfcF/htmgY1V6nlAGamBw++JnxqtJ5tvJSw2UPbDZapISc7m 9HsrGNSFHgGCYobAKk3WPV0U4YYPAk2E11egho4bXVJIbWPwM921Hyif53g6l1HtBuHcz8Pv7L1 WON9e7a54UZVH3+yxVf23k0sdeT3NMf4NduhAale+7Wv7JzwNu8F2gjOjq+pFOiJKxBoGCH54Pj vPyfocsA5b41rhKYiDw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-30_03,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 impostorscore=0 phishscore=0 priorityscore=1501 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609300068 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260930_183507_350660_364DB184 X-CRM114-Status: GOOD ( 15.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Define an enum to determine the register number for the mapping from AArch32 and AArch64 registers. This allows for a more flexible use of the register mappings. Reviewed-by: Marc Zyngier Acked-by: Catalin Marinas Signed-off-by: Steffen Eiden --- arch/arm64/include/asm/ptrace.h | 60 ++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h index f7dc5fb9427d..49a83a0636b9 100644 --- a/arch/arm64/include/asm/ptrace.h +++ b/arch/arm64/include/asm/ptrace.h @@ -102,26 +102,48 @@ #define COMPAT_USER_SZ 296 /* Architecturally defined mapping between AArch32 and AArch64 registers */ +enum { + __compat_fp = 11, + __compat_sp = 13, + __compat_lr = 14, + __compat_sp_hyp = 15, + __compat_lr_irq = 16, + __compat_sp_irq = 17, + __compat_lr_svc = 18, + __compat_sp_svc = 19, + __compat_lr_abt = 20, + __compat_sp_abt = 21, + __compat_lr_und = 22, + __compat_sp_und = 23, + __compat_r8_fiq = 24, + __compat_r9_fiq = 25, + __compat_r10_fiq = 26, + __compat_r11_fiq = 27, + __compat_r12_fiq = 28, + __compat_sp_fiq = 29, + __compat_lr_fiq = 30, +}; + #define compat_usr(x) regs[(x)] -#define compat_fp regs[11] -#define compat_sp regs[13] -#define compat_lr regs[14] -#define compat_sp_hyp regs[15] -#define compat_lr_irq regs[16] -#define compat_sp_irq regs[17] -#define compat_lr_svc regs[18] -#define compat_sp_svc regs[19] -#define compat_lr_abt regs[20] -#define compat_sp_abt regs[21] -#define compat_lr_und regs[22] -#define compat_sp_und regs[23] -#define compat_r8_fiq regs[24] -#define compat_r9_fiq regs[25] -#define compat_r10_fiq regs[26] -#define compat_r11_fiq regs[27] -#define compat_r12_fiq regs[28] -#define compat_sp_fiq regs[29] -#define compat_lr_fiq regs[30] +#define compat_fp regs[__compat_fp] +#define compat_sp regs[__compat_sp] +#define compat_lr regs[__compat_lr] +#define compat_sp_hyp regs[__compat_sp_hyp] +#define compat_lr_irq regs[__compat_lr_irq] +#define compat_sp_irq regs[__compat_sp_irq] +#define compat_lr_svc regs[__compat_lr_svc] +#define compat_sp_svc regs[__compat_sp_svc] +#define compat_lr_abt regs[__compat_lr_abt] +#define compat_sp_abt regs[__compat_sp_abt] +#define compat_lr_und regs[__compat_lr_und] +#define compat_sp_und regs[__compat_sp_und] +#define compat_r8_fiq regs[__compat_r8_fiq] +#define compat_r9_fiq regs[__compat_r9_fiq] +#define compat_r10_fiq regs[__compat_r10_fiq] +#define compat_r11_fiq regs[__compat_r11_fiq] +#define compat_r12_fiq regs[__compat_r12_fiq] +#define compat_sp_fiq regs[__compat_sp_fiq] +#define compat_lr_fiq regs[__compat_lr_fiq] static inline unsigned long compat_psr_to_pstate(const unsigned long psr) { -- 2.53.0