Skip to content

Commit

Permalink
BPF: make 'pseudo' function return pointer
Browse files Browse the repository at this point in the history
'pseudo' function returns u64. However, in fact it returns pointers.
It makes difference for 32-bit systems. The generated IR
has additional trunc instruction, which may make further problems,
remote: when passed to eBPF verifier.

This patch is made to handle similar change in llvm.

Change-Id: I4a691bdfa4b10b207197941c589026997b62f8fe
  • Loading branch information
aszyndela committed Oct 3, 2017
1 parent 6cc9adc commit 8eb8fb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cc/export/helpers.h
Expand Up @@ -381,7 +381,7 @@ u64 load_dword(void *skb, u64 off) {
void bpf_store_byte(void *skb, u64 off, u64 val) asm("llvm.bpf.store.byte");
void bpf_store_half(void *skb, u64 off, u64 val) asm("llvm.bpf.store.half");
void bpf_store_word(void *skb, u64 off, u64 val) asm("llvm.bpf.store.word");
u64 bpf_pseudo_fd(u64, u64) asm("llvm.bpf.pseudo");
void *bpf_pseudo_fd(u64, u64) asm("llvm.bpf.pseudo");

static inline void __attribute__((always_inline))
bpf_store_dword(void *skb, u64 off, u64 val) {
Expand Down

0 comments on commit 8eb8fb2

Please sign in to comment.