Message ID | 20240212174209.620310-1-hawkinsw@obs.cr |
---|---|
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp68591dyb; Mon, 12 Feb 2024 09:42:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGE0YOERnJC69b9Gnt5CCODZyhhJ4FIe8tn7UtFEyRCnfe0maAhui62fWrUI8SMUuF0ZMgS X-Received: by 2002:a05:6358:921a:b0:178:f497:ab3f with SMTP id d26-20020a056358921a00b00178f497ab3fmr5450582rwb.14.1707759746336; Mon, 12 Feb 2024 09:42:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707759746; cv=pass; d=google.com; s=arc-20160816; b=ueETZQP8CcPdJrS0C6Uc4oc85LFlZe34lL90szSBAoASh1FKEUqwfkyzcu2bTFZ9Gm 976pF5385QYVqF/oPM/IaefxTPO+YoXpjQwONPHYtM2x3SJPMvfHu9dTEwhCGbI4dsw2 hi5IlOthZDDH9/9offyeogmp7U2fqRsGrMNVXlOJ4zO+FeZdqt3kprJpEOYhf9uq49KI H0u75samUBZo3ZyVq633m2/3k4NzIvd5aSNteAdYndfkcaVD2vODvTjZ7itTxIWOw9jI GmXWNwbD4YOsuo0czB0jH7/ZRoLn6+G1x+tmZ4uVrudhZNDXXmy2T45+DfyLQomj3msC JmZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=mTU66pBO67VLeItSeakBX1nrxTE/JIvESprvctvWfl8=; fh=fsE6UNohzKvndaANp0BY8xgEJT3Cv0DJuoyZrObD5qY=; b=Cy2QBWUczWQDdZN39wX+8uQlPKeoxj64CIOMgZcGRsgUkRf9S1FKKt+usrK+XpwT0e 0wbEKr+6vOZhWihVe3IgKR+qPUKAoxe0iZthqvWVJ1fvDNunajwf/Lz7uc5omYQW8EAv C2uGav7l0a7lisu+aGHF0jxTVrd2FzeApx/wpdMDKTGkqBYepM1OtTMDeFgJkAvqufr3 jMdZcPBzJCjcNJnmmnI3EjKCMcKdcJ736v93cPmuEezQDXn3oN96ss2V8MHQpdyu0akg bdkMaYWLosrm6i48vqDJItbHHOkkZGXK6kNl0fsxd5Knh/R6+4g+a/ticT69IxQ6jDtx HbCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@obs-cr.20230601.gappssmtp.com header.s=20230601 header.b=FMBcVMIM; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" X-Forwarded-Encrypted: i=2; AJvYcCVssud071P6rkpaxLa+KhBQOkVJephaPVXoKt02uPnh/afBkN/P0/7UqF3eUvOsuuT//l/y3QJkrExdpYEV/3dnHOlX4w== Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t16-20020ac87390000000b0042c37198699si775320qtp.731.2024.02.12.09.42.26 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 09:42:26 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@obs-cr.20230601.gappssmtp.com header.s=20230601 header.b=FMBcVMIM; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F27BE3858C39 for <ouuuleilei@gmail.com>; Mon, 12 Feb 2024 17:42:25 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by sourceware.org (Postfix) with ESMTPS id 26E223858C2F for <binutils@sourceware.org>; Mon, 12 Feb 2024 17:42:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 26E223858C2F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=obs.cr Authentication-Results: sourceware.org; spf=none smtp.mailfrom=obs.cr ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 26E223858C2F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::832 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707759734; cv=none; b=xOzkod5nKyQh9r4hqQDIT7FIzmFZ/8vT9FGlP1td2NT+qsJ/YiTNmMhQn52FxaLeAqA8XBRaqAwVA1FvzmxkJKKjuGmB35x/b5ru4l0/JMu2u0mUXYV5/Sh5eIRHUmCeC5gbv8TBnFKfaJ381FnA0PKupR+wVecwJ3C5QKVqWO8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707759734; c=relaxed/simple; bh=YQVB4Vyjipq/uLyh954+eGUBNy9XCraqba7bgGWm4cw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jvEgnkLdDnBg8CAtjLdYrcJ9XOTqsbGWrb+aIJ8IsGCMwz9mnc3pbMVbceX08gk3hSZMZJMByXEP9FEUXvB/eezDsKzUAoH4sFvf3CuETl5QTIuPm0DY6g8VLbpOeA+VT9PmDj8pJ2sit2eGSH2CavU2HFfXWbf8Cr7I1CNdA9A= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-42c0960382eso24482781cf.2 for <binutils@sourceware.org>; Mon, 12 Feb 2024 09:42:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=obs-cr.20230601.gappssmtp.com; s=20230601; t=1707759731; x=1708364531; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mTU66pBO67VLeItSeakBX1nrxTE/JIvESprvctvWfl8=; b=FMBcVMIMYMK9Q4sPUzfPFYLzB72fUJImssvA/21ALjxQI28UjOyVJwzLk89dq0PuIO DDCgsoaUP6iqUUJjcoSdpKpGyay6b9X0yJWe5R8TzrHxF2bJrJfdiClxnwwZkeuljU0s y9uMrQH4y5oyBMNFeNkPe23T8BLAb96NSYOhDKhQqHKZy+WZpaDCvioAr/BqoRHJM79S iMP+3C1ODCSzX3Eq1K3baKkRQHxfWqJcH9KX39TRK5+DtvymwmrAQaeXdYsRij7O10WO rXSScni7Pvn4Y+JewYRCafklV2Q4SaWA6KIqD5LStDd/m9jeKGKGASd9xCrwfYKUqgkO p9rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707759731; x=1708364531; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mTU66pBO67VLeItSeakBX1nrxTE/JIvESprvctvWfl8=; b=BdTQTB+XBGblWWQpvRFr3d1kn079NijMg8fC/fsrIJbWuvzqbsF5/zKB+Khb8YC68F dnJEyqKN+M5iN/wtbjn+tpUwHyJvA40QUJ7jhwz99ojw/ENrb6yA23E/CZLMvYM2g8uM Ycball5B7vy1iFLiwTbTuG+61JxHs9hAVRo7bMwtQHxH8UmCLBsM/x069BDDinqZ6GEe rEylY0mgFHbKMU82Mi7imbniYxmxn3Pgro0XoSdpCdZISvcZrNtkiQIL52IdcseFw4HS 4OOTGIaGkeWGeruhv8BYBsYrbZBP+zobaWJD4xnrABEV1x29H5DXXDx5HmIMp+hUD7wu D6YA== X-Gm-Message-State: AOJu0YzW9tpNv2z2knMWWn4YGkccyWx7l7xlw83CuQU05VOWSxqW12up VZjRO+zbxk081oMwpPxrV4+bAwClwy51Ch3gA/7NaSFdxcNZFsh9pZfb1VRGF6fEAUDKeQsmX3w A X-Received: by 2002:a05:622a:106:b0:42c:6a55:9ef0 with SMTP id u6-20020a05622a010600b0042c6a559ef0mr9559087qtw.16.1707759731219; Mon, 12 Feb 2024 09:42:11 -0800 (PST) Received: from borderland.rhod.uc.edu ([129.137.96.2]) by smtp.gmail.com with ESMTPSA id w5-20020ac857c5000000b0042c750bf876sm339604qta.43.2024.02.12.09.42.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 09:42:10 -0800 (PST) From: Will Hawkins <hawkinsw@obs.cr> To: binutils@sourceware.org Cc: Will Hawkins <hawkinsw@obs.cr> Subject: [PATCH v2 0/1] Add BPF callx support to objdump and as Date: Mon, 12 Feb 2024 12:42:05 -0500 Message-ID: <20240212174209.620310-1-hawkinsw@obs.cr> X-Mailer: git-send-email 2.43.0 In-Reply-To: 20240209180734.443763-1-hawkinsw@obs.cr References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790715883593588789 X-GMAIL-MSGID: 1790715883593588789 |
Series |
Add BPF callx support to objdump and as
|
|
Message
Will Hawkins
Feb. 12, 2024, 5:42 p.m. UTC
After additional consideration and discussion with Jose and Dave, it seems like we have determined the way that clang, gcc and binutils need to handle the callx/callr: 1. callr remains with the register holding the target of the jump stored in the dst_reg. 2. callx is added with the register holding the target of the jump stored in the imm32. 3. We have to remove the pseudoc syntax because it is no longer possible to disambiguate between versions of call by simply looking at the parameter. Tests are added/refactored to meet the above. I am more than happy to resend as a separate mailing to the list but sending first as a reply in order to keep list traffic manageable. As I said before, I sincerely appreciate all that you are doing for the community and how welcoming you have been to a first-time contributor. Sincerely, Will Will Hawkins (1): objdump, as: Add callx support for BPF CPU v1 gas/config/tc-bpf.c | 25 ++++++++++++++++++- gas/testsuite/gas/bpf/bpf.exp | 4 +-- .../gas/bpf/{indcall-1.d => callr.d} | 4 +-- .../gas/bpf/{indcall-1.s => callr.s} | 2 +- gas/testsuite/gas/bpf/indcall-1-pseudoc.d | 23 ----------------- gas/testsuite/gas/bpf/indcall-1-pseudoc.s | 13 ---------- include/opcode/bpf.h | 3 ++- opcodes/bpf-dis.c | 6 +++++ opcodes/bpf-opc.c | 4 ++- sim/bpf/bpf-sim.c | 4 +++ 10 files changed, 44 insertions(+), 44 deletions(-) rename gas/testsuite/gas/bpf/{indcall-1.d => callr.d} (90%) rename gas/testsuite/gas/bpf/{indcall-1.s => callr.s} (90%) delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.d delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.s
Comments
Hi Will. [Adding Yonghong and Eduard in CC] > After additional consideration and discussion with Jose and Dave, > it seems like we have determined the way that clang, gcc and binutils > need to handle the callx/callr: > > 1. callr remains with the register holding the target of the jump stored > in the dst_reg. > 2. callx is added with the register holding the target of the jump stored > in the imm32. > 3. We have to remove the pseudoc syntax because it is no longer possible > to disambiguate between versions of call by simply looking at the > parameter. I don't recall reaching any agreement on the above. What is the point of having both callr and callx? The existing callr is generated by GCC in -mxbpf mode. It is an experimental extension that we use in order to be able to run more of the GCC testsuite, so it is always possible to change it to use imm32 instead of dst_reg. I wouldn't personally welcome that change and would much prefer if clang starts using either reg_src or reg_dst, because compromising/reserving endian-dependent 32 whole bits for a register number that only requires 4 bits seems like a waste of insn space that will complicate future ISA extensions. In either case, if we all use the same encoding for the indirect call instruction (I fail to see any reason for not doing so) then point 3. becomes moot. > > Tests are added/refactored to meet the above. > > I am more than happy to resend as a separate mailing to the list but > sending first as a reply in order to keep list traffic manageable. > > As I said before, I sincerely appreciate all that you are doing for > the community and how welcoming you have been to a first-time contributor. > > Sincerely, > Will > > Will Hawkins (1): > objdump, as: Add callx support for BPF CPU v1 > > gas/config/tc-bpf.c | 25 ++++++++++++++++++- > gas/testsuite/gas/bpf/bpf.exp | 4 +-- > .../gas/bpf/{indcall-1.d => callr.d} | 4 +-- > .../gas/bpf/{indcall-1.s => callr.s} | 2 +- > gas/testsuite/gas/bpf/indcall-1-pseudoc.d | 23 ----------------- > gas/testsuite/gas/bpf/indcall-1-pseudoc.s | 13 ---------- > include/opcode/bpf.h | 3 ++- > opcodes/bpf-dis.c | 6 +++++ > opcodes/bpf-opc.c | 4 ++- > sim/bpf/bpf-sim.c | 4 +++ > 10 files changed, 44 insertions(+), 44 deletions(-) > rename gas/testsuite/gas/bpf/{indcall-1.d => callr.d} (90%) > rename gas/testsuite/gas/bpf/{indcall-1.s => callr.s} (90%) > delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.d > delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.s
Hello! First, thank you for the response! On Mon, Feb 12, 2024 at 1:39 PM Jose E. Marchesi <jose.marchesi@oracle.com> wrote: > > > Hi Will. > > [Adding Yonghong and Eduard in CC] > > > After additional consideration and discussion with Jose and Dave, > > it seems like we have determined the way that clang, gcc and binutils > > need to handle the callx/callr: > > > > 1. callr remains with the register holding the target of the jump stored > > in the dst_reg. > > 2. callx is added with the register holding the target of the jump stored > > in the imm32. > > 3. We have to remove the pseudoc syntax because it is no longer possible > > to disambiguate between versions of call by simply looking at the > > parameter. > > I don't recall reaching any agreement on the above. What is the point > of having both callr and callx? Sorry! I was being slightly loose in terms of agreement -- I was reading into your comments in the email between you, me and Dave from earlier this weekend! The only point in having both callr and callx was to allow the gcc encoding to continue to exist in its current form. I assumed that there was a compelling reason and certainly did not want to do anything to interfere with the great work that you are doing! > > The existing callr is generated by GCC in -mxbpf mode. It is an > experimental extension that we use in order to be able to run more of > the GCC testsuite, so it is always possible to change it to use imm32 > instead of dst_reg. > > I wouldn't personally welcome that change and would much prefer if clang > starts using either reg_src or reg_dst, because compromising/reserving > endian-dependent 32 whole bits for a register number that only requires > 4 bits seems like a waste of insn space that will complicate future ISA > extensions. I 100% agree that it is less than ideal. However, it seems like the cat is out of the bag. I am adding Dave who is leading the ISA standardization effort. He and I (and others) have discussed this as recently as this morning. I will let him weigh in on whether or not we have the "power" to push back on clang's choice of how to encode the instructions. > > In either case, if we all use the same encoding for the indirect call > instruction (I fail to see any reason for not doing so) then point > 3. becomes moot. I agree and I really would like that to be the outcome. However, see above (insert smiley face here!) Thank you for responding! Will > > > > > Tests are added/refactored to meet the above. > > > > I am more than happy to resend as a separate mailing to the list but > > sending first as a reply in order to keep list traffic manageable. > > > > As I said before, I sincerely appreciate all that you are doing for > > the community and how welcoming you have been to a first-time contributor. > > > > Sincerely, > > Will > > > > Will Hawkins (1): > > objdump, as: Add callx support for BPF CPU v1 > > > > gas/config/tc-bpf.c | 25 ++++++++++++++++++- > > gas/testsuite/gas/bpf/bpf.exp | 4 +-- > > .../gas/bpf/{indcall-1.d => callr.d} | 4 +-- > > .../gas/bpf/{indcall-1.s => callr.s} | 2 +- > > gas/testsuite/gas/bpf/indcall-1-pseudoc.d | 23 ----------------- > > gas/testsuite/gas/bpf/indcall-1-pseudoc.s | 13 ---------- > > include/opcode/bpf.h | 3 ++- > > opcodes/bpf-dis.c | 6 +++++ > > opcodes/bpf-opc.c | 4 ++- > > sim/bpf/bpf-sim.c | 4 +++ > > 10 files changed, 44 insertions(+), 44 deletions(-) > > rename gas/testsuite/gas/bpf/{indcall-1.d => callr.d} (90%) > > rename gas/testsuite/gas/bpf/{indcall-1.s => callr.s} (90%) > > delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.d > > delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.s
On Mon, Feb 12, 2024 at 5:25 PM Will Hawkins <hawkinsw@obs.cr> wrote: > > Hello! > > First, thank you for the response! > > On Mon, Feb 12, 2024 at 1:39 PM Jose E. Marchesi > <jose.marchesi@oracle.com> wrote: > > > > > > Hi Will. > > > > [Adding Yonghong and Eduard in CC] > > > > > After additional consideration and discussion with Jose and Dave, > > > it seems like we have determined the way that clang, gcc and binutils > > > need to handle the callx/callr: > > > > > > 1. callr remains with the register holding the target of the jump stored > > > in the dst_reg. > > > 2. callx is added with the register holding the target of the jump stored > > > in the imm32. > > > 3. We have to remove the pseudoc syntax because it is no longer possible > > > to disambiguate between versions of call by simply looking at the > > > parameter. > > > > I don't recall reaching any agreement on the above. What is the point > > of having both callr and callx? > > Sorry! I was being slightly loose in terms of agreement -- I was > reading into your comments in the email between you, me and Dave from > earlier this weekend! > > The only point in having both callr and callx was to allow the gcc > encoding to continue to exist in its current form. I assumed that > there was a compelling reason and certainly did not want to do > anything to interfere with the great work that you are doing! > > > > > The existing callr is generated by GCC in -mxbpf mode. It is an > > experimental extension that we use in order to be able to run more of > > the GCC testsuite, so it is always possible to change it to use imm32 > > instead of dst_reg. > > > > I wouldn't personally welcome that change and would much prefer if clang > > starts using either reg_src or reg_dst, because compromising/reserving > > endian-dependent 32 whole bits for a register number that only requires > > 4 bits seems like a waste of insn space that will complicate future ISA > > extensions. > > I 100% agree that it is less than ideal. However, it seems like the > cat is out of the bag. I am adding Dave who is leading the ISA > standardization effort. He and I (and others) have discussed this as > recently as this morning. I will let him weigh in on whether or not we > have the "power" to push back on clang's choice of how to encode the > instructions. > > > > > In either case, if we all use the same encoding for the indirect call > > instruction (I fail to see any reason for not doing so) then point > > 3. becomes moot. > > I agree and I really would like that to be the outcome. However, see > above (insert smiley face here!) > I just reviewed some mailing traffic from another list and it looks like the folks at clang/llvm are going to change the way that they encode the callx instruction! Great news! I will make a (simpler) updated patch to binutils once those changes are in llvm and we can verify them. Thank you again for your response, Jose! Will > Thank you for responding! > > Will > > > > > > > > > Tests are added/refactored to meet the above. > > > > > > I am more than happy to resend as a separate mailing to the list but > > > sending first as a reply in order to keep list traffic manageable. > > > > > > As I said before, I sincerely appreciate all that you are doing for > > > the community and how welcoming you have been to a first-time contributor. > > > > > > Sincerely, > > > Will > > > > > > Will Hawkins (1): > > > objdump, as: Add callx support for BPF CPU v1 > > > > > > gas/config/tc-bpf.c | 25 ++++++++++++++++++- > > > gas/testsuite/gas/bpf/bpf.exp | 4 +-- > > > .../gas/bpf/{indcall-1.d => callr.d} | 4 +-- > > > .../gas/bpf/{indcall-1.s => callr.s} | 2 +- > > > gas/testsuite/gas/bpf/indcall-1-pseudoc.d | 23 ----------------- > > > gas/testsuite/gas/bpf/indcall-1-pseudoc.s | 13 ---------- > > > include/opcode/bpf.h | 3 ++- > > > opcodes/bpf-dis.c | 6 +++++ > > > opcodes/bpf-opc.c | 4 ++- > > > sim/bpf/bpf-sim.c | 4 +++ > > > 10 files changed, 44 insertions(+), 44 deletions(-) > > > rename gas/testsuite/gas/bpf/{indcall-1.d => callr.d} (90%) > > > rename gas/testsuite/gas/bpf/{indcall-1.s => callr.s} (90%) > > > delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.d > > > delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.s
On 2/12/24 2:38 PM, Will Hawkins wrote: > On Mon, Feb 12, 2024 at 5:25 PM Will Hawkins <hawkinsw@obs.cr> wrote: >> Hello! >> >> First, thank you for the response! >> >> On Mon, Feb 12, 2024 at 1:39 PM Jose E. Marchesi >> <jose.marchesi@oracle.com> wrote: >>> >>> Hi Will. >>> >>> [Adding Yonghong and Eduard in CC] >>> >>>> After additional consideration and discussion with Jose and Dave, >>>> it seems like we have determined the way that clang, gcc and binutils >>>> need to handle the callx/callr: >>>> >>>> 1. callr remains with the register holding the target of the jump stored >>>> in the dst_reg. >>>> 2. callx is added with the register holding the target of the jump stored >>>> in the imm32. >>>> 3. We have to remove the pseudoc syntax because it is no longer possible >>>> to disambiguate between versions of call by simply looking at the >>>> parameter. >>> I don't recall reaching any agreement on the above. What is the point >>> of having both callr and callx? >> Sorry! I was being slightly loose in terms of agreement -- I was >> reading into your comments in the email between you, me and Dave from >> earlier this weekend! >> >> The only point in having both callr and callx was to allow the gcc >> encoding to continue to exist in its current form. I assumed that >> there was a compelling reason and certainly did not want to do >> anything to interfere with the great work that you are doing! >> >>> The existing callr is generated by GCC in -mxbpf mode. It is an >>> experimental extension that we use in order to be able to run more of >>> the GCC testsuite, so it is always possible to change it to use imm32 >>> instead of dst_reg. >>> >>> I wouldn't personally welcome that change and would much prefer if clang >>> starts using either reg_src or reg_dst, because compromising/reserving >>> endian-dependent 32 whole bits for a register number that only requires >>> 4 bits seems like a waste of insn space that will complicate future ISA >>> extensions. >> I 100% agree that it is less than ideal. However, it seems like the >> cat is out of the bag. I am adding Dave who is leading the ISA >> standardization effort. He and I (and others) have discussed this as >> recently as this morning. I will let him weigh in on whether or not we >> have the "power" to push back on clang's choice of how to encode the >> instructions. >> >>> In either case, if we all use the same encoding for the indirect call >>> instruction (I fail to see any reason for not doing so) then point >>> 3. becomes moot. >> I agree and I really would like that to be the outcome. However, see >> above (insert smiley face here!) >> > I just reviewed some mailing traffic from another list and it looks > like the folks at clang/llvm are going to change the way that they > encode the callx instruction! Great news! > > I will make a (simpler) updated patch to binutils once those changes > are in llvm and we can verify them. the llvm patch: https://github.com/llvm/llvm-project/pull/81546 Could you help double check encoding is the same as gcc? Thanks! > > Thank you again for your response, Jose! > Will > > >> Thank you for responding! >> >> Will >> >>>> Tests are added/refactored to meet the above. >>>> >>>> I am more than happy to resend as a separate mailing to the list but >>>> sending first as a reply in order to keep list traffic manageable. >>>> >>>> As I said before, I sincerely appreciate all that you are doing for >>>> the community and how welcoming you have been to a first-time contributor. >>>> >>>> Sincerely, >>>> Will >>>> >>>> Will Hawkins (1): >>>> objdump, as: Add callx support for BPF CPU v1 >>>> >>>> gas/config/tc-bpf.c | 25 ++++++++++++++++++- >>>> gas/testsuite/gas/bpf/bpf.exp | 4 +-- >>>> .../gas/bpf/{indcall-1.d => callr.d} | 4 +-- >>>> .../gas/bpf/{indcall-1.s => callr.s} | 2 +- >>>> gas/testsuite/gas/bpf/indcall-1-pseudoc.d | 23 ----------------- >>>> gas/testsuite/gas/bpf/indcall-1-pseudoc.s | 13 ---------- >>>> include/opcode/bpf.h | 3 ++- >>>> opcodes/bpf-dis.c | 6 +++++ >>>> opcodes/bpf-opc.c | 4 ++- >>>> sim/bpf/bpf-sim.c | 4 +++ >>>> 10 files changed, 44 insertions(+), 44 deletions(-) >>>> rename gas/testsuite/gas/bpf/{indcall-1.d => callr.d} (90%) >>>> rename gas/testsuite/gas/bpf/{indcall-1.s => callr.s} (90%) >>>> delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.d >>>> delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.s
On Mon, Feb 12, 2024 at 5:50 PM Yonghong Song <yonghong.song@linux.dev> wrote: > > > On 2/12/24 2:38 PM, Will Hawkins wrote: > > On Mon, Feb 12, 2024 at 5:25 PM Will Hawkins <hawkinsw@obs.cr> wrote: > >> Hello! > >> > >> First, thank you for the response! > >> > >> On Mon, Feb 12, 2024 at 1:39 PM Jose E. Marchesi > >> <jose.marchesi@oracle.com> wrote: > >>> > >>> Hi Will. > >>> > >>> [Adding Yonghong and Eduard in CC] > >>> > >>>> After additional consideration and discussion with Jose and Dave, > >>>> it seems like we have determined the way that clang, gcc and binutils > >>>> need to handle the callx/callr: > >>>> > >>>> 1. callr remains with the register holding the target of the jump stored > >>>> in the dst_reg. > >>>> 2. callx is added with the register holding the target of the jump stored > >>>> in the imm32. > >>>> 3. We have to remove the pseudoc syntax because it is no longer possible > >>>> to disambiguate between versions of call by simply looking at the > >>>> parameter. > >>> I don't recall reaching any agreement on the above. What is the point > >>> of having both callr and callx? > >> Sorry! I was being slightly loose in terms of agreement -- I was > >> reading into your comments in the email between you, me and Dave from > >> earlier this weekend! > >> > >> The only point in having both callr and callx was to allow the gcc > >> encoding to continue to exist in its current form. I assumed that > >> there was a compelling reason and certainly did not want to do > >> anything to interfere with the great work that you are doing! > >> > >>> The existing callr is generated by GCC in -mxbpf mode. It is an > >>> experimental extension that we use in order to be able to run more of > >>> the GCC testsuite, so it is always possible to change it to use imm32 > >>> instead of dst_reg. > >>> > >>> I wouldn't personally welcome that change and would much prefer if clang > >>> starts using either reg_src or reg_dst, because compromising/reserving > >>> endian-dependent 32 whole bits for a register number that only requires > >>> 4 bits seems like a waste of insn space that will complicate future ISA > >>> extensions. > >> I 100% agree that it is less than ideal. However, it seems like the > >> cat is out of the bag. I am adding Dave who is leading the ISA > >> standardization effort. He and I (and others) have discussed this as > >> recently as this morning. I will let him weigh in on whether or not we > >> have the "power" to push back on clang's choice of how to encode the > >> instructions. > >> > >>> In either case, if we all use the same encoding for the indirect call > >>> instruction (I fail to see any reason for not doing so) then point > >>> 3. becomes moot. > >> I agree and I really would like that to be the outcome. However, see > >> above (insert smiley face here!) > >> > > I just reviewed some mailing traffic from another list and it looks > > like the folks at clang/llvm are going to change the way that they > > encode the callx instruction! Great news! > > > > I will make a (simpler) updated patch to binutils once those changes > > are in llvm and we can verify them. > > the llvm patch: > https://github.com/llvm/llvm-project/pull/81546 > Could you help double check encoding is the same as gcc? I would be more than happy to do so! It will be a few hours, but I will absolutely look at it ASAP! Better yet, I will pull that patch, build an LLVM and give it a try to double check. Thank you for working so quickly, Yonghong! Will > > Thanks! > > > > > Thank you again for your response, Jose! > > Will > > > > > >> Thank you for responding! > >> > >> Will > >> > >>>> Tests are added/refactored to meet the above. > >>>> > >>>> I am more than happy to resend as a separate mailing to the list but > >>>> sending first as a reply in order to keep list traffic manageable. > >>>> > >>>> As I said before, I sincerely appreciate all that you are doing for > >>>> the community and how welcoming you have been to a first-time contributor. > >>>> > >>>> Sincerely, > >>>> Will > >>>> > >>>> Will Hawkins (1): > >>>> objdump, as: Add callx support for BPF CPU v1 > >>>> > >>>> gas/config/tc-bpf.c | 25 ++++++++++++++++++- > >>>> gas/testsuite/gas/bpf/bpf.exp | 4 +-- > >>>> .../gas/bpf/{indcall-1.d => callr.d} | 4 +-- > >>>> .../gas/bpf/{indcall-1.s => callr.s} | 2 +- > >>>> gas/testsuite/gas/bpf/indcall-1-pseudoc.d | 23 ----------------- > >>>> gas/testsuite/gas/bpf/indcall-1-pseudoc.s | 13 ---------- > >>>> include/opcode/bpf.h | 3 ++- > >>>> opcodes/bpf-dis.c | 6 +++++ > >>>> opcodes/bpf-opc.c | 4 ++- > >>>> sim/bpf/bpf-sim.c | 4 +++ > >>>> 10 files changed, 44 insertions(+), 44 deletions(-) > >>>> rename gas/testsuite/gas/bpf/{indcall-1.d => callr.d} (90%) > >>>> rename gas/testsuite/gas/bpf/{indcall-1.s => callr.s} (90%) > >>>> delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.d > >>>> delete mode 100644 gas/testsuite/gas/bpf/indcall-1-pseudoc.s