Fix: annotate bytecode interpreter for kernel stack validator
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 15 Jun 2016 18:39:41 +0000 (14:39 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 15 Jun 2016 18:43:34 +0000 (14:43 -0400)
commit63155590d2c1a2183028d536e338886411f8f50d
tree5b1c8d53c1c6c6a248a667a724f53a5c73436ec3
parent6c09dd948f549d9a4c9008f6036e0ebf7e7839a6
Fix: annotate bytecode interpreter for kernel stack validator

With gcc 6.1.1, kernel 4.6, with
CONFIG_STACK_VALIDATION=y, building lttng-modules master
at commit 6c09dd94 gives this warning:

lttng-modules/lttng-filter-interpreter.o: warning: objtool:
lttng_filter_interpret_bytecode()+0x58: sibling call from
callable instruction with changed frame pointer

This object implements a bytecode interpreter using an explicit
jump table.

If we define "INTERPRETER_USE_SWITCH" at the top of the file,
thus using the switch-case fallback implementation, the
warning vanishes.

We use an explicit jump table rather than a switch case whenever
possible for performance reasons.

Unfortunately objtool doesn't know how to validate this type of jump
table. So to avoid the warning we need to add an annotation to tell
objtool to ignore it.

Kernel developers has to annotate __bpf_prog_run() in the kernel for the
same reason.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-filter-interpreter.c
wrapper/frame.h [new file with mode: 0644]
This page took 0.025828 seconds and 4 git commands to generate.