Send again since llvmdev is moved to llvm-dev@xxxxxxxxxxxxxx
On 2015/8/5 9:58, Wangnan (F) wrote:
On 2015/8/4 3:44, Alexei Starovoitov wrote:
On 7/31/15 3:18 AM, Wangnan (F) wrote:
[SNIP]
didn't have time to look at it.
from your llvm patches looks like you've got quite experienced
with it already :)
I'll post 2 LLVM patches by replying this mail. Please have a look and
help me
send them to LLVM if you think my code is correct.
patch 1:
I don't quite understand the purpose of builtin_dwarf_cfa
returning R11. It's a special register seen inside llvm codegen
only. It doesn't have kernel meaning.
Kernel side verifier allows us to do arithmetic computation using two local variable
address or local variable address and R11. Therefore, we can compute the location
of a local variable using:
mark = &my_var_a - __builtin_frame_address(0);
If the stack allocation is fixed (if the location is never reused), the above 'mark'
can be uniquely identify a local variable. That's why I'm interesting in it. However
I'm not sure whether the prerequestion is hold.
patch 2:
do we really need to hack clang?
Can you just define a function that aliases to intrinsic,
like we do for ld_abs/ld_ind ?
void bpf_store_half(void *skb, u64 off, u64 val) asm("llvm.bpf.store.half");
then no extra patches necessary.