Message ID | 20240412144718.4191286-1-jremus@linux.ibm.com |
---|---|
Headers |
Return-Path: <binutils-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A11F2385828E for <patchwork@sourceware.org>; Fri, 12 Apr 2024 14:49:36 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id D3F92385840C for <binutils@sourceware.org>; Fri, 12 Apr 2024 14:47:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D3F92385840C 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 D3F92385840C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712933259; cv=none; b=Q2Ebz+fPbpHcmmIzZj6IYpl74yg6Md4tav3yIllrQr4fvNhKfpE4EgTZSbg+1l+ps0+qEf/wcFSACVbVc8jp/U9g+xKa2Nk4OfZJae0hmX7tSoXpr+xtblU4Bs2nkeHLss7ZsEOQYcavRI8nR0E6DC45y0Z79Q6Q9vxM31er+p0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712933259; c=relaxed/simple; bh=Pa/zFabPZtorlNhyd6HU1iT0G7x3XFoalWedRGwwUsY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=jCtZ9tLajCK49NxiooXfQapMgJpYCvJYXgoDFfs3TKpidyAwZNmf+jabuY0F5aS5OzUaPO64yTFn6h0ipgDxfcqpQmYIQt27nmD/3VshGbSyfZhoPpny0AIc9HQCPGM0Hwtz7th+FyZyFNyn2luLjUbZNNZFAkEP2DMQXi/gD/E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43CEg3xA023089; Fri, 12 Apr 2024 14:47:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=kMpVgttzHnTGhyUvkrUhHGiBdcuu3itqJJkUeNvq0pY=; b=M+DzST6KKD3Yw4JfM69LD+AW1x16LCkWPwPhQWKn5WMeqEPdYKNqYalgK8pzsbDaUMp5 7yldZ3nbWNRCKxnYA27H5GZ/8sNK4tuw2HFMqNrCHDzH6L8o2Yl50kqaSbF+OUdJUxhk MMx+EyV470TjCQCSpRaev7l0G/s/xEUkRIS2qXAO9swf3jir4kJm0AQUHv8SlQeFhCFq k8nrFhAVQe+OPZ54IN5VvQDUyGkbiI7JM958PrsU8p/t3NX7YMqLTcDU2o5ACElFPSjM C10ZqQC5rYMkGrGoO9ia3Hu8Yflm+hxcIIb081gdDDW3wZFGLFr2jgDaxVgBoRQpPWhf 8Q== 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 3xf5gug6w8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Apr 2024 14:47:32 +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 43CDemwx013539; Fri, 12 Apr 2024 14:47:27 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3xbgqu2nfq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Apr 2024 14:47:27 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 43CElM1848497136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Apr 2024 14:47:24 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 529562004B; Fri, 12 Apr 2024 14:47:22 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 36B1520040; Fri, 12 Apr 2024 14:47:22 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 12 Apr 2024 14:47:22 +0000 (GMT) From: Jens Remus <jremus@linux.ibm.com> To: binutils@sourceware.org, Indu Bhagat <indu.bhagat@oracle.com> Cc: Jens Remus <jremus@linux.ibm.com>, Andreas Krebbel <krebbel@linux.ibm.com> Subject: [PATCH v3 00/15] sframe: Enhancements to SFrame info generation Date: Fri, 12 Apr 2024 16:47:03 +0200 Message-Id: <20240412144718.4191286-1-jremus@linux.ibm.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Me-lQCaTmCUXmcFFw1RSKgozxUURgM2J X-Proofpoint-ORIG-GUID: Me-lQCaTmCUXmcFFw1RSKgozxUURgM2J 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-12_11,2024-04-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 adultscore=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404120107 X-Spam-Status: No, score=-6.3 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org |
Series |
sframe: Enhancements to SFrame info generation
|
|
Message
Jens Remus
April 12, 2024, 2:47 p.m. UTC
As suggested by Indu I have split my RFC V2 patch series to add initial support to generate SFrame information on s390x into: 1. This series consisting of all the generic preparatory cleanups, enhancements, and fixes to the generation of SFrame information in the assembler. 2. A separate RFC series on top with the actual "s390: Initial support to generate SFrame info from CFI directives in assembler", which I am going to send soon. Since the original patch series was at V2 I am sending both as V3. Patches 1 and 2 are minor cleanups/enhancements to the existing SFrame support on AArch64 and x86 AMD64. Patch 3 enables readelf/objdump to dump the SFrame fixed offsets from CFA to the frame pointer (FP) and return address (RA). Patch 4 (new in v3) changes readelf/objdump to display 'f' in the SFrame RA tracking column, if the architecture is using a fixed RA offset. Additionally it corrects the logic to display 'u' in the SFrame FP tracking column. Patch 5 enhances an SFrame warning message to print the human readable DWARF call frame instruction name. Patches 6 and 7 resolve issues that cause the assembler to either generate bad SFrame FDE or to silently skip it. Both issues would be triggered by s390-specific SFrame error test cases introduced by the separate patch series. Patch 8 refactors SFrame CFI opcode DW_CFA_register processing into a separate function. This harmonizes the CFI opcode processing. Patch 9 adds verbose assembler warning messages when generation of SFrame FDE is skipped. Patch 10 (new in v3) resolves an issue that causes the assembler to generate bad SFrame FDE in case the FP without RA was saved on the stack, which the SFrame format cannot represent. I will send two alternative solution proposals as RFC. Patch 11 (new in v3) skips SFrame FDE for .cfi_window_save on all architectures except AArch64, which multiplexed it with .cfi_negate_ra_state. Patches 12 and 13 (both new in v3) resolve issues where generation of SFrame FDE was unnecessarily skipped. Path 14 (new in v3) adds tests for the SFrame RA tracking predicate to places where it was missing to align the logic. Patch 14 (new in v3) is a minor enhancement to add checks that the architecture-dependent RA tracking is correctly configured. Changes v2 -> v3: - Additional patches as noted in cover letter and patch notes. - Reword further SFrame macro, variable, and function descriptions to align with those previously touched. - Align description of definition in source with declaration in header. - Updated gas synthesized CFI test cases for x86 AMD64 to test for architecture-specific fixed RA offset instead of using a pattern. - Updated ld SFrame test cases for x86 AMD64 to test for architecture- specific fixed RA offset. - Updated SFrame warning message texts as suggested by Indu, except for the .cfi_def_cfa[_register] ones. - Do not test sframe_ra_tracking_p when determining the SFrame register name in sframe_register_name. The RA register name does not depend on whether RA tracking is used or not. - Corrected formatting of ChangeLog in commit message. Changes v1 -> v2: - Resolved a regression reported by Linaro-TCWG-CI on AArch64 in one of the generic ld SFrame test cases. The test case contained a .cfi_def_cfa directive, specifying a CFA base register number that is not necessarily a SFrame SP/FP register number on all architectures. This caused the changes from patch 6 to skip SFrame FDE generation on AArch64 (and s390x aswell) with a warning, causing the test case to fail. Thanks and regards, Jens Jens Remus (15): x86: Remove unused SFrame CFI RA register variable gas: Enhance arch-specific SFrame configuration descriptions readelf/objdump: Dump SFrame CFA fixed FP and RA offsets readelf/objdump: Display SFrame fixed RA offset as 'f' in dump gas: Print DWARF call frame insn name in SFrame warning message gas: Skip SFrame FDE if CFI specifies non-FP/SP base register gas: Warn if SFrame FDE is skipped due to non-default return column gas: Refactor SFrame CFI opcode DW_CFA_register processing gas: User readable warnings if SFrame FDE is not generated gas: Skip SFrame FDE if FP without RA on stack gas: Skip SFrame FDE if .cfi_window_save gas: Don't skip SFrame FDE if .cfi_register specifies RA w/o tracking gas: Don't skip SFrame FDE if .cfi_register specifies SP register gas: Test predicate whether SFrame RA tracking is used gas: Validate SFrame RA tracking and fixed RA offset gas/config/tc-aarch64.c | 6 +- gas/config/tc-aarch64.h | 12 +- gas/config/tc-i386.c | 6 +- gas/config/tc-i386.h | 10 +- gas/gen-sframe.c | 244 +++++++++++++++--- gas/gen-sframe.h | 2 + .../gas/cfi-sframe/cfi-sframe-common-1.d | 2 + .../gas/cfi-sframe/cfi-sframe-common-2.d | 2 + .../gas/cfi-sframe/cfi-sframe-common-3.d | 2 + .../gas/cfi-sframe/cfi-sframe-common-4.d | 6 +- .../gas/cfi-sframe/cfi-sframe-common-5.d | 6 +- .../gas/cfi-sframe/cfi-sframe-common-6.d | 6 +- .../gas/cfi-sframe/cfi-sframe-common-7.d | 6 +- .../gas/cfi-sframe/cfi-sframe-common-8.d | 4 +- .../gas/cfi-sframe/cfi-sframe-x86_64-1.d | 9 +- gas/testsuite/gas/cfi-sframe/common-empty-1.d | 4 +- gas/testsuite/gas/cfi-sframe/common-empty-2.d | 4 +- gas/testsuite/gas/cfi-sframe/common-empty-3.d | 3 + .../gas/scfi/x86_64/scfi-cfi-sections-1.d | 11 +- .../gas/scfi/x86_64/scfi-dyn-stack-1.d | 11 +- ld/testsuite/ld-sframe/discard.s | 1 - ld/testsuite/ld-x86-64/sframe-plt-1.d | 9 +- ld/testsuite/ld-x86-64/sframe-simple-1.d | 17 +- libsframe/sframe-dump.c | 18 +- 24 files changed, 310 insertions(+), 91 deletions(-)