Message ID | 20250107-fix_objdump_partial_insn-v4-0-5bca13284275@rivosinc.com |
---|---|
Headers |
Return-Path: <gdb-patches-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 AA85F3857BA5 for <patchwork@sourceware.org>; Tue, 7 Jan 2025 21:37:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA85F3857BA5 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=MN6DADb+ X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id B98F53858416 for <gdb-patches@sourceware.org>; Tue, 7 Jan 2025 21:35:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B98F53858416 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B98F53858416 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736285757; cv=none; b=RJutej5Oa+JIFlMW0+ImIoPfvLtack/WeQLCMbb2EcDp/bpZP6tSvOL2HqYiUCnW/kaNLHun65EIFQV2yYzgDRKJhrJhDihyMhu7q/Qo1Y4ef4DpgZZ0iMYjFfJVM2TzrXHc97j0yofKds4O+01I21axYTb4UAKfu4gB9RIBwfI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736285757; c=relaxed/simple; bh=Z6CyqEBiduUT5qbYc27KduZvfbZzsZW0eh+fMT50Sm4=; h=DKIM-Signature:From:Subject:Date:Message-Id:MIME-Version:To; b=cJ/hu+O4wEeG2ZuoHV0LXGyuprRGAmCNDMgVOkfYEISCqOlBhNiUwjYJwzjzkPoz/zsNMw9gHrukmtFG3Wt6bVd13zB01kkja0YNV3NfPLoZHFhF2Xk7YcLhmqDfiYPPSx9t6RiKHOQ47rICs3qZbBF1OJg+1zwviFSnsv2bvwg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-2166022c5caso210767705ad.2 for <gdb-patches@sourceware.org>; Tue, 07 Jan 2025 13:35:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1736285757; x=1736890557; darn=sourceware.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=o8I3KWvdcoFzGTGR6swsrEp0kPjStHUwpeIvDYMDd3k=; b=MN6DADb+7KLtQ8i5tabn5aWNJvtorofuJgQ1jAQM/S6pWZds8RC6O7E2RxEnDqKUEi O2SpMHZbxrSCsOD0Qp89rwrpivieji9vNd4gxrGosCUxRJ+PX0XErqbo8vBQy5u1bsdL KMqr/W6JBhHQZUAKw/g0Mo2cj0hXXnbLdTLu+MDMmVWLd6fFuFlSjTOi0HzFA/E5Xher k/6eVoVoWZMPba465ZiwYDcp6OQn82BsrWdVFYE9yqzQkTPQYU361WF9L6SOLjNST/TM x0OHi24skHq6/xDXKANtpOpue49Kbf+Gd4J5EUvZBCUY8fJi84HwB1tDjqQuL66feHBs +DTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736285757; x=1736890557; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o8I3KWvdcoFzGTGR6swsrEp0kPjStHUwpeIvDYMDd3k=; b=qfLqpAI/gHy5ptfBJJPxMHU/aJriGziAuiJVKUQq39mtDkbL+n4p6ZVZ6dJyyOt3oO ZumrcYU4GFpYFbULzPT1LKDzINKposRnuiK7zcFzjVAy3xVJD95O6aoA4rLGb13JT7c7 e5z2XFcTRMhySHXNboIqYhJ9IlihPGHy6CczgZ+mF+CClO9vCF0pXX444z0+e6nB88O+ chkJsRM11NYzQkm2L8UhMqsnUE8ev9MfDwkzddvI42IU9ILt+zLhpXCFTJcagKtyhqJP da1+yEIEuxTR7dZwDqzQz6qJ1BGAg58QW7wPNTuiBedWJDF8DwTw+SF8QwVleu9rZrT8 VbYg== X-Gm-Message-State: AOJu0YwhJR1ULnYYEd6FtF98lD15rulkvM9afk3eGhN5jsnwXurO8Lhk pCMobRcBgTKitVrTUd2SKyZiwHwnlWqeLgaL1mAAcpPTRgFeeK90yxyBO/zSsFU= X-Gm-Gg: ASbGncsNkK67F4cr0t78AV9aVu2bn3ZKjZ5n9ODEcud4LFnAjNH6lceywrJ1bfO+ETv TmsF3urlsyBdJ0RFKWDq9Z4RHHkzVBNIX90hYYtRiEirvRoBDDZFaALckTx0fFpikkac0EJK1om C8do8uddUmdxcJHs//3GYSChvHus/CAaxKJYGGIjPk737TYP8ssMwf6J53U9Pw3KFQVrCCzygSl rfiNnv0xm0BYwQOkwkHwR2Xa8ETfJSjdbf0hAwQpEWgZvR6rte05tzFlcNhuky57VGFwj6G X-Google-Smtp-Source: AGHT+IHLhWSH8BeQxN0UbzFzyMTq1BjZmgCtoEA2QOO9BKPENvl47Wzk5/PRNswLxs55q/40xQf7zw== X-Received: by 2002:a05:6a20:c70a:b0:1dc:37a:8dc0 with SMTP id adf61e73a8af0-1e88cfd5b94mr1364311637.21.1736285756770; Tue, 07 Jan 2025 13:35:56 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb851sm33951646b3a.132.2025.01.07.13.35.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 13:35:56 -0800 (PST) From: Charlie Jenkins <charlie@rivosinc.com> Subject: [PATCH v4 0/2] RISC-V: Fix display of partial instructions Date: Tue, 07 Jan 2025 13:35:43 -0800 Message-Id: <20250107-fix_objdump_partial_insn-v4-0-5bca13284275@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAC+efWcC/33NQY7CMAxA0augrCdonDQlZcU9EKrS2gWPhqRKI AKh3p0AG4SA5bfs54tIFJmSWM4uIlLmxMGXqH5mot85vyXJWFqoX1UBKJADn9rQ/eFxP7ajiwd 2/y375GVTkdL1oLHTVpTzMVLZvdPrTekdp0OI5/unDLfpA1WgP6MZJMiFq5paU20MmlXkHBL7f t6Hvbi5WT1b9RdLFcsiWesADHb9G0s/W80XSxcLDWHjBruwCC/WNE1Xz3XEBFsBAAA= X-Change-ID: 20241121-fix_objdump_partial_insn-94e236f3db38 To: jiawei <jiawei@iscas.ac.cn>, Nelson Chu <nelson@rivosinc.com>, Charlie Jenkins <charlie@rivosinc.com>, Jan Beulich <jbeulich@suse.com>, Andrew Burgess <aburgess@redhat.com> Cc: gdb-patches <gdb-patches@sourceware.org>, Binutils <binutils@sourceware.org> X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2993; i=charlie@rivosinc.com; h=from:subject:message-id; bh=Z6CyqEBiduUT5qbYc27KduZvfbZzsZW0eh+fMT50Sm4=; b=owGbwMvMwCHWx5hUnlvL8Y3xtFoSQ3rtPJOp5cySSwKOR1qWiJxPSt1zR+7vzax9qi9fnJ6tw f/713r9jlIWBjEOBlkxRRaeaw3MrXf0y46Klk2AmcPKBDKEgYtTACYid4aR4Wlo5/ksz607H6fz 252J+W7/3lumINVEuW+L7+a3Mrr/2Bn+B7cFbd351dedZe1l9cOzft3+KZy4tUHBwWL3TgVG7Tw XDgA= X-Developer-Key: i=charlie@rivosinc.com; a=openpgp; fpr=7D834FF11B1D8387E61C776FFB10D1F27D6B1354 X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
Series |
RISC-V: Fix display of partial instructions
|
|
Message
Charlie Jenkins
Jan. 7, 2025, 9:35 p.m. UTC
When testing linux perf, I noticed that this behavior of objdump has
changed. Before this patch and running `perf test` on riscv the
following test fails due to objdump not returning all of the expected
bytes.
Bytes read differ from those read by objdump
buf1 (dso):
0x97 0xf7 0x11 0x00 0x93 0x87 0xc7 0x7c 0x22 0x85 0x7c 0xec 0xef 0x50 0x80 0x12
0xa6 0x85 0xce 0x86 0x4a 0x86 0x22 0x85 0xef 0x50 0x40 0x40 0xa2 0x84 0x1d 0xc9
0x7c 0x58 0x85 0x8b 0x85 0xc3 0x1c 0x40 0xa1 0x8b 0x89 0xcf 0x83 0x27 0x04 0x0c
0x63 0x51 0xf0 0x04 0x97 0xf7 0x11 0x00 0x93 0x87 0x07 0x45 0xbe 0x86 0x58 0x70
0x74 0xec 0x7c 0xf3 0xa2 0x70 0x02 0x74 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 0x64
0x45 0x61 0x82 0x80 0x22 0x85 0xef 0x50 0x50 0x52 0x22 0x85 0xef 0x00 0xb1 0x39
0xa2 0x70 0x02 0x74 0x81 0x44 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 0x64 0x45 0x61
0x82 0x80 0x97 0x06 0x12 0x00 0x93 0x86 0xa6 0x8a 0x97 0xf7 0x11 0x00 0x93 0x87
buf2 (objdump):
0x97 0xf7 0x11 0x00 0x93 0x87 0xc7 0x7c 0x22 0x85 0x7c 0xec 0xef 0x50 0x80 0x12
0xa6 0x85 0xce 0x86 0x4a 0x86 0x22 0x85 0xef 0x50 0x40 0x40 0xa2 0x84 0x1d 0xc9
0x7c 0x58 0x85 0x8b 0x85 0xc3 0x1c 0x40 0xa1 0x8b 0x89 0xcf 0x83 0x27 0x04 0x0c
0x63 0x51 0xf0 0x04 0x97 0xf7 0x11 0x00 0x93 0x87 0x07 0x45 0xbe 0x86 0x58 0x70
0x74 0xec 0x7c 0xf3 0xa2 0x70 0x02 0x74 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 0x64
0x45 0x61 0x82 0x80 0x22 0x85 0xef 0x50 0x50 0x52 0x22 0x85 0xef 0x00 0xb1 0x39
0xa2 0x70 0x02 0x74 0x81 0x44 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 0x64 0x45 0x61
0x82 0x80 0x97 0x06 0x12 0x00 0x93 0x86 0xa6 0x8a 0x97 0xf7 0x11 0x00 0xad 0x00
---- end(-1) ----
24: Object code reading : FAILED!
After this patch, this test case no longer fails, as objdump returns the
expected values.
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
---
Changes in v4:
- Added test cases
- Changed wording of "disassembly" to "display" (Jan)
- Link to v3: https://lore.kernel.org/r/20241219-fix_objdump_partial_insn-v3-1-d5ed9af878d1@rivosinc.com
Changes in v3:
- More formatting issues (Nelson)
- Link to v2: https://lore.kernel.org/r/20241216-fix_objdump_partial_insn-v2-1-8de88a115dbc@rivosinc.com
Changes in v2:
- Fix comment spacing (Jiawei)
- Link to v1: https://lore.kernel.org/r/20241213-fix_objdump_partial_insn-v1-1-7a4963e655d5@rivosinc.com
---
Charlie Jenkins (2):
RISC-V: Fix display of partial instructions
RISC-V: Add partial instruction display tests
gas/testsuite/gas/riscv/dis-partial-insn-byte.d | 11 +++++
gas/testsuite/gas/riscv/dis-partial-insn-short.d | 11 +++++
gas/testsuite/gas/riscv/dis-partial-insn-word.d | 11 +++++
gas/testsuite/gas/riscv/dis-partial-insn.s | 2 +
opcodes/riscv-dis.c | 53 ++++++++++++++++++++++--
5 files changed, 84 insertions(+), 4 deletions(-)
---
base-commit: 978324718990b6b371d4eeeba02cfe13a0ebf120
change-id: 20241121-fix_objdump_partial_insn-94e236f3db38
Comments
Thanks Charlie for working on this. Already passed regressions and committed. Nelson On Wed, Jan 8, 2025 at 5:35 AM Charlie Jenkins <charlie@rivosinc.com> wrote: > When testing linux perf, I noticed that this behavior of objdump has > changed. Before this patch and running `perf test` on riscv the > following test fails due to objdump not returning all of the expected > bytes. > > Bytes read differ from those read by objdump > buf1 (dso): > 0x97 0xf7 0x11 0x00 0x93 0x87 0xc7 0x7c 0x22 0x85 0x7c 0xec 0xef 0x50 0x80 > 0x12 > 0xa6 0x85 0xce 0x86 0x4a 0x86 0x22 0x85 0xef 0x50 0x40 0x40 0xa2 0x84 0x1d > 0xc9 > 0x7c 0x58 0x85 0x8b 0x85 0xc3 0x1c 0x40 0xa1 0x8b 0x89 0xcf 0x83 0x27 0x04 > 0x0c > 0x63 0x51 0xf0 0x04 0x97 0xf7 0x11 0x00 0x93 0x87 0x07 0x45 0xbe 0x86 0x58 > 0x70 > 0x74 0xec 0x7c 0xf3 0xa2 0x70 0x02 0x74 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 > 0x64 > 0x45 0x61 0x82 0x80 0x22 0x85 0xef 0x50 0x50 0x52 0x22 0x85 0xef 0x00 0xb1 > 0x39 > 0xa2 0x70 0x02 0x74 0x81 0x44 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 0x64 0x45 > 0x61 > 0x82 0x80 0x97 0x06 0x12 0x00 0x93 0x86 0xa6 0x8a 0x97 0xf7 0x11 0x00 0x93 > 0x87 > > buf2 (objdump): > 0x97 0xf7 0x11 0x00 0x93 0x87 0xc7 0x7c 0x22 0x85 0x7c 0xec 0xef 0x50 0x80 > 0x12 > 0xa6 0x85 0xce 0x86 0x4a 0x86 0x22 0x85 0xef 0x50 0x40 0x40 0xa2 0x84 0x1d > 0xc9 > 0x7c 0x58 0x85 0x8b 0x85 0xc3 0x1c 0x40 0xa1 0x8b 0x89 0xcf 0x83 0x27 0x04 > 0x0c > 0x63 0x51 0xf0 0x04 0x97 0xf7 0x11 0x00 0x93 0x87 0x07 0x45 0xbe 0x86 0x58 > 0x70 > 0x74 0xec 0x7c 0xf3 0xa2 0x70 0x02 0x74 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 > 0x64 > 0x45 0x61 0x82 0x80 0x22 0x85 0xef 0x50 0x50 0x52 0x22 0x85 0xef 0x00 0xb1 > 0x39 > 0xa2 0x70 0x02 0x74 0x81 0x44 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 0x64 0x45 > 0x61 > 0x82 0x80 0x97 0x06 0x12 0x00 0x93 0x86 0xa6 0x8a 0x97 0xf7 0x11 0x00 0xad > 0x00 > > ---- end(-1) ---- > 24: Object code reading : FAILED! > > After this patch, this test case no longer fails, as objdump returns the > expected values. > > Signed-off-by: Charlie Jenkins <charlie@rivosinc.com> > > --- > Changes in v4: > - Added test cases > - Changed wording of "disassembly" to "display" (Jan) > - Link to v3: > https://lore.kernel.org/r/20241219-fix_objdump_partial_insn-v3-1-d5ed9af878d1@rivosinc.com > > Changes in v3: > - More formatting issues (Nelson) > - Link to v2: > https://lore.kernel.org/r/20241216-fix_objdump_partial_insn-v2-1-8de88a115dbc@rivosinc.com > > Changes in v2: > - Fix comment spacing (Jiawei) > - Link to v1: > https://lore.kernel.org/r/20241213-fix_objdump_partial_insn-v1-1-7a4963e655d5@rivosinc.com > > --- > Charlie Jenkins (2): > RISC-V: Fix display of partial instructions > RISC-V: Add partial instruction display tests > > gas/testsuite/gas/riscv/dis-partial-insn-byte.d | 11 +++++ > gas/testsuite/gas/riscv/dis-partial-insn-short.d | 11 +++++ > gas/testsuite/gas/riscv/dis-partial-insn-word.d | 11 +++++ > gas/testsuite/gas/riscv/dis-partial-insn.s | 2 + > opcodes/riscv-dis.c | 53 > ++++++++++++++++++++++-- > 5 files changed, 84 insertions(+), 4 deletions(-) > --- > base-commit: 978324718990b6b371d4eeeba02cfe13a0ebf120 > change-id: 20241121-fix_objdump_partial_insn-94e236f3db38 > -- > - Charlie > >