[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <555A3027.7060803@plumgrid.com>
Date: Mon, 18 May 2015 11:32:07 -0700
From: Alexei Starovoitov <ast@...mgrid.com>
To: "Wangnan (F)" <wangnan0@...wei.com>,
Namhyung Kim <namhyung@...nel.org>
CC: paulus@...ba.org, a.p.zijlstra@...llo.nl, mingo@...hat.com,
acme@...nel.org, jolsa@...nel.org, dsahern@...il.com,
daniel@...earbox.net, brendan.d.gregg@...il.com,
masami.hiramatsu.pt@...achi.com, lizefan@...wei.com,
linux-kernel@...r.kernel.org, pi3orama@....com
Subject: Re: [RFC PATCH v3 16/37] bpf tools: Collect eBPF programs from their
own sections
On 5/18/15 5:47 AM, Wangnan (F) wrote:
>
>
>>> + prog->insns_cnt = size / sizeof(struct bpf_insn);
>>> + memcpy(prog->insns, data,
>>> + prog->insns_cnt * sizeof(struct bpf_insn));
>> Doesn't the data need to be swapped?
>>
>> Thanks,
>> Namhyung
>>
>
> I'm not very sure, since they are instructions. Byte order of
> instructions and byte order of data
> are not always same. Think about ARM. Therefore another choice is to
> swap them in kernel,
> keep user-kernel interface clean.
>
> Alexei Starovoitov, do you think we should use uniformed instruction
> byte order in both big and little
> endian kernel on user-kernel interface, or let userspace feed swapped
> instructions to kernel if
> endianess is not match?
see my reply to the other patch. endianness is the job of llvm.
Let's fix it there.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists