[0/1] objdump: Add callx support for BPF CPU v1

Message ID 20240209180734.443763-1-hawkinsw@obs.cr
Headers
Series objdump: Add callx support for BPF CPU v1 |

Message

Will Hawkins Feb. 9, 2024, 6:07 p.m. UTC
  Hello everyone!

First time patch submitter but longtime GNU enthusiast. Thank you for
all the work that you all do to maintain these vital pieces of software
for the community.

I am one of the maintainers of ubpf, a userspace eBPF runtime. As part
of the ISA standardization process at the IETF, Dave Thaler discovered
that clang is now emiting the callx instruction when targeting CPU
versions all the way back to v1. I know from Jose that gcc emits that
instruction in a special mode. 

There is a discussion at the ebpf-for-windows GitHub about adding callx
support to prevail (and other related tools):

https://github.com/microsoft/ebpf-for-windows/issues/3237

This patch adds the ability for objdump to decode the callx instruction
for ELF-encoded binaries targeting CPU v1 and greater.

I tried very hard to follow best practices for creating this patch
submission but I am sure that I did something wrong. Please let me know
what I can do differently or better.

Again, thank you for your effort maintaining these programs for the
community!

Sincerely,
Will

Will Hawkins (1):
  objdump: Add callx support for BPF CPU v1

 include/opcode/bpf.h | 2 +-
 opcodes/bpf-opc.c    | 2 ++
 sim/bpf/bpf-sim.c    | 4 ++++
 3 files changed, 7 insertions(+), 1 deletion(-)
  

Comments

Nick Clifton Feb. 12, 2024, 5:01 p.m. UTC | #1
Hi Will,

> First time patch submitter but long time GNU enthusiast. Thank you for
> all the work that you all do to maintain these vital pieces of software
> for the community.

Welcome on board and thank you contributing.


> I tried very hard to follow best practices for creating this patch
> submission but I am sure that I did something wrong. Please let me know
> what I can do differently or better.

No, no, what you did was excellent.  My only suggestions is that
with your v2 patch you consider adding a new assembler test (or
extending an already existing one) that checks that the instruction
can be assembled and then disassembled.  For example you might
like to add it to gas/testsuite/gas/bpf/call.s (and the associated
call.d file for the disassembly).

Cheers
   Nick