-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional wide instructions #3
Comments
Does "lddw dst, map" mean to set dst to the memory address of the map, or to the id of the map, or to the fd of the map, or what?
To confirm, this has to be a map fd, not a map id? So runtimes without a map fd available cannot use this instruction? (E.g., Windows has map ids that are u32 but no map fds in the kernel.)
by "lddw dst, kernel var" does that mean the 64-bit value of the variable? or the BTF id of the variable? or the memory address of the variable?
Similar question, what does this mean?
Other than what the verifier does, offhand this looks to be the same as src == 0, meaning "lddw dst, imm". Correct?
Is a "map index" the same thing as the map id as used by libbpf/bpftool/etc? Or is it the index into the maps defined by the executing program? |
The instruction is converted into a load of the memory address of the map into the destination register:
thus becoming a regular
The kernel uses a file descriptor here. It could probably work just the same with another identifier, however, given that Linux also has a notion of map ids, this could lead to confusion. Maybe
This converts into a load of the memory address of the kernel variable into the destination register.
In that case, this loads a pointer to a function in the BPF program, which cannot be reused directly but can be passed to
No, this would be the same as
For
|
Then shouldn't your PR instead say:
for consistency with |
@qmonnet Do you know if all these are supported in all ISA versions, i.e. even with |
These instructions were added a few years apart so I'm pretty sure they're not all in the same ISA version. Would need to check kernel versions and to run that against the dates of the different ISA versions in clang, I suppose, but I haven't had time to do it yet. |
So I don't think that the Here's a chronology of the different LLVM
|
tools/ebpf-checks: Multiple improvements to the scripts
Quentin writes:
The PR has:
0x18 (src == 0) | lddw dst, imm | dst = imm
0x18 (src == 1) | lddw dst, map | dst = imm with imm == map fd
0x18 (src == 2) | lddw dst, map value | dst = map[0] + insn[1].imm with insn[0] == map fd
0x18 (src == 3) | lddw dst, kernel var | dst = imm with imm == BTF id of var
0x18 (src == 4) | lddw dst, BPF func | dst = imm with imm == insn offset of BPF callback
0x18 (src == 5) | lddw dst, imm | dst = imm with imm == map index
0x18 (src == 6) | lddw dst, map value | dst = map[0] + insn[1].imm with insn[0] == map index
But what does "map[0]" mean? What does "insn[0]" mean, is that relative to the PC or absolute from the start of the program or what?
Also the ISA does not currently define the existence / meaning of a "map fd" or a "BTF id of var" or a "map index" or a "BPF callback". I'm concerned about adding these to the ISA without definitions.
The text was updated successfully, but these errors were encountered: