Re: [PATCH bpf-next 6/7] bpftool: Add LLVM as default library for disassembling JIT-ed programs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/09/2022 01:06, Song Liu wrote:
> On Tue, Sep 6, 2022 at 6:46 AM Quentin Monnet <quentin@xxxxxxxxxxxxx> wrote:
>>
> [...]
>> +
>> +static int
>> +init_context(disasm_ctx_t *ctx, const char *arch,
>> +            __maybe_unused const char *disassembler_options,
>> +            __maybe_unused unsigned char *image, __maybe_unused ssize_t len)
>> +{
>> +       char *triple;
>> +
>> +       if (arch) {
>> +               p_err("Architecture %s not supported", arch);
>> +               return -1;
>> +       }
> 
> Does this mean we stop supporting arch by default (prefer llvm
> over bfd)?

We do drop support in practice, because the "arch" is only used for nfp
(we only use this when the program is not using the host architecture,
so when it's offloaded - see ifindex_to_bfd_params() in common.c), and
LLVM has no support for nfp.

Although on second thought, it would probably be cleaner to set the arch
anyway in the snippet above, and to let LLVM return an error if it
doesn't know about it, so that we don't have to update bpftool in the
future if a new arch is used for BPF offload. I can update for the next
iteration.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux