From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 8D2413858D35 for ; Tue, 16 Apr 2024 16:07:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8D2413858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8D2413858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713283674; cv=none; b=PnqHsm6bTBXIPo1C2EzLsYQYnjYG8EZp3G+oYNxOMivbUqS/rhjdZikubkHzhYVcPgAH4ng9ipCUlyfr+7czwtm5FffvJBUak3zmHRRxTPgBHwUt9cE/v4E1Tpdi+CcPtTaWD7PZdGntj9dIUUompA7hFEBxnACXVALKZK7IpE0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713283674; c=relaxed/simple; bh=dVCL09RZOHOfesWJy0263ohbnvJ/UM9hct6SpiCblkQ=; h=DKIM-Signature:Message-ID:Date:Subject:To:From:MIME-Version; b=FtqSsSCfIuzp7iflVyG2g8jqa6L3x59AAm2g2z36StpCAooEjDzMwli78eWlrAxxW4kxEfn+dK2FVqTcBhs5D5SVDNDf1Vm+Ah1GTLJI0RKySdP1djDcXN92/a2Ar5QxW6lcvGJmrBoQC98fhbgo6qj42SlF5/KljcuBogT5Gyk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43GG2Ceg019993; Tue, 16 Apr 2024 16:07:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=mDUtKFA8wrBe9yZg0bZWb2/5WvWNZia5Nf7EXCt7ago=; b=diOiYC4N+vlLFUFYpNI3kLNr2ACPeOLhJApCE7VtwfrDWn12/HFxpEsT+zAJbYuOVVUE WgqvIwxP0VGHNbZhLDBdyh61Fg12AXyW3N8ORNv8m8NIr39fEfp39YWFjfvvGPMuq+Yp zTGEF7T05I5aFdpRclngZT+/UeHCLq3q5yvJ3zTm24E6NJRi4fP35rIlRX9y11zW2MUU V8BvoptcMkJHaeExdkl35Embr42cTf+YuUaKsTmLbr4gaBY8C1CX4STlRO2pTdkLL30W 0nZIARDsgS1qLWsguglXR0QxhAE6VG/cq0wpAafti2ytVuWgwCPyLA7i30Rl9yS0u2lT Tw== 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 3xhvg7g0hk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 16:07:39 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 43GFOpm3018206; Tue, 16 Apr 2024 16:07:38 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3xg4ct7ajq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 16:07:38 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 43GG7Sad30278184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Apr 2024 16:07:30 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EF66E2004D; Tue, 16 Apr 2024 16:07:27 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 956B720040; Tue, 16 Apr 2024 16:07:27 +0000 (GMT) Received: from [9.179.9.38] (unknown [9.179.9.38]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 16 Apr 2024 16:07:27 +0000 (GMT) Message-ID: <5ffe1a0f-e2f6-4795-b648-d67ec3cc327a@linux.ibm.com> Date: Tue, 16 Apr 2024 18:07:26 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v3 2/2] s390: SFrame track FP/RA saved in register To: binutils@sourceware.org, Indu Bhagat Cc: Andreas Krebbel References: <20240412163625.965517-1-jremus@linux.ibm.com> <20240412163625.965517-3-jremus@linux.ibm.com> From: Jens Remus Content-Language: en-US Organization: IBM Deutschland Research & Development GmbH In-Reply-To: <20240412163625.965517-3-jremus@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ckcA0LxP4NF8BUGxCa7kph8isxa163f2 X-Proofpoint-ORIG-GUID: ckcA0LxP4NF8BUGxCa7kph8isxa163f2 Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-16_13,2024-04-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 mlxscore=0 malwarescore=0 impostorscore=0 spamscore=0 bulkscore=0 adultscore=0 clxscore=1015 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404160099 X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Am 12.04.2024 um 18:36 schrieb Jens Remus: > GCC on s390x, when in a leaf function, can be observed to save the > frame pointer (FP) and/or return address (RA) register in a floating- > point registers (FPR) instead of on the stack. This is declared using > the following CFI directive: > > .cfi_register , > > SFrame cannot represent the FP and/or RA being saved in another > register. It does only track the CFA base register (SP/FP), CFA offset > from CFA base register, and FP and RA save area offsets from CFA. > > On s390x the FP and/or RA are only saved in another FPR when in a leaf > function. That is a function that does not call any other functions. > Therefore it can ever only be the topmost function in a call chain. > During function return, if the RA would be restored into a non-default > RA register, the function would also only ever be the topmost function > on the call stack. > An unwinder by default has access to all registers of the function that > if the topmost on the call stack. Therefore no further information would > be required for those registers. > > Represent the FP/RA in another register on s390, by encoding the > register number shifted by one to the left with the least-significant > bit set in the offset as follows: > > offset = (regno << 1) | 1 > > Add s390-specific SFrame (error) test cases for FP/RA being saved in > FPRs in leaf-function. > > gas/ > * gen-sframe.c (s390_sframe_xlate_do_register): New s390- > specific function to represent FP/RA in another register on > s390. > (sframe_xlate_do_register): Invoke s390_sframe_xlate_do_register > on s390. > > libsframe/ > * sframe-dump.c (is_sframe_abi_arch_s390): New helper to test > whether ABI/arch is s390. > (dump_sframe_func_with_fres): Dump FP/RA in another register on > s390. > > gas/testsuite/ > * gas/cfi-sframe/cfi-sframe.exp: Update s390-specific SFrame > (error) test cases. > * gas/cfi-sframe/cfi-sframe-s390-3.s: New s390-specific SFrame > test case for FP/RA saved in register on s390. > * gas/cfi-sframe/cfi-sframe-s390-3.d: Likewise. > * gas/cfi-sframe/cfi-sframe-s390-err-6.s: New s390-specific > SFrame error test case for FP without RA saved in register. > * gas/cfi-sframe/cfi-sframe-s390-err-6.d: Likewise. > * gas/cfi-sframe/cfi-sframe-s390-err-3.s: s390-specific SFrame > error test case 3 no longer triggers an error and is renamed as > test case 4. > * gas/cfi-sframe/cfi-sframe-s390-err-3.d: Likewise. > * gas/cfi-sframe/cfi-sframe-s390-4.s: Likewise. > * gas/cfi-sframe/cfi-sframe-s390-4.d: Likewise. Added expected > SFrame dump output. I will fix the indentation in the next version. > > Signed-off-by: Jens Remus > > * gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-4.d: # GCL: missing file > * gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-3.d -> gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-6.d: # GCL: missing file > * gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-err-3.s -> gas/testsuite/gas/cfi-sframe/cfi-sframe-s390-4.s: # GCL: missing file Above three lines have erroneously creeped in, while experimenting with custom (prepare-)commit-msg Git hooks to generate/validate the GNU Changelog entries. (sigh!) I will remove them in the next version. > --- ... Regards, Jens -- Jens Remus Linux on Z Development (D3303) and z/VSE Support +49-7031-16-1128 Office jremus@de.ibm.com IBM IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294 IBM Data Privacy Statement: https://www.ibm.com/privacy/