Skip to content

Instantly share code, notes, and snippets.

View bjoto's full-sized avatar

Björn Töpel bjoto

View GitHub Profile
// https://lwn.net/Articles/679137/
// make csum && ./csum
// cc csum.c -o csum
// generic: ffe3 65507
// x86 : ffffffe3 -29
#include <stdio.h>
typedef unsigned int __wsum;
So, e.g., this program ebpf program is jited to (scroll down)
test_pkt_access.o: file format ELF64-BPF
Disassembly of section test1:
process:
0: b7 00 00 00 02 00 00 00 r0 = 2
1: 61 12 50 00 00 00 00 00 r2 = *(u32 *)(r1 + 80)
2: 61 11 4c 00 00 00 00 00 r1 = *(u32 *)(r1 + 76)
3: bf 13 00 00 00 00 00 00 r3 = r1