backports: address jump label and static key support

The ieee802154 subsystem, which we backport, makes use of
net_get_random_once() through net/ieee802154/reassembly.c
and this in turn makes use of the static keys. Static keys
were split out from the jump label support via commit c5905afb
by Ingo through kernel v3.3 -- note that git describe --contains
will disagree and say its v3.5. Jump label support was added by
Jason via commit bf5438fc through kernel v2.6.37 but later
Jason provided static branch optimizations via commit d430d3d7e
added through v3.0. static_key_initialized and STATIC_KEY_CHECK_USE()
were last added by Hannes through kernel v3.13 throughy c4b2c0c5f.

In order to backport static keys and jump label we need to
provide name mapping for kernels that only had jump label support,
but due to the static branch optimizations and since these are
architecture specific we cannot backport them unless we start carrying
around architecture replacement code -- or do some other trickery.
For kernels that lacked jump label support and that don't have the
static branch optimizations we simply carry in the kernel implmentation
that assumes you have no architecture support for jump label which
treats the labels as simply atomic drivers for branches. For older
kernels then we don't backport usage of static_key_initialized and

This does leave a gap of kernels without static key / jump label
support, I tried backporting it but ran into issues quickly. Those
daring to continue to embark on this journey can pick up where
I left off:


I will note that properly backporting this can have implications on how
we backport tracing support as that is the main usage for jump labels.
Real enthusiasts can go ahead an extend this with architecture / kernel
revision specific changes -- but be warned -- we will have hard litmus
test for compilation on backports using ckmake --allyesconfig on all
supported kernels we carry.

This is a long way of saying -- we require at least 3.5 for static
key support, we also support kernels older than 2.6.37 but this goes

mcgrof@ergon ~/linux (git::master)$ git describe --contains bf5438fc

mcgrof@ergon ~/linux (git::master)$ git describe --contains d430d3d7e

mcgrof@ergon ~/linux (git::master)$ git describe --contains c5905afb
v3.5-rc1~120^3~76^2 -- wrong! Its actually v3.3 try:
  git checkout -b static-changes c5905afb; git describe

mcgrof@ergon ~/linux (git::master)$ git describe --contains c4b2c0c5f

Cc: Ingo Molnar <>
Cc: Jason Baron <>
CC: Jason Baron <>
Cc: Hannes Frederic Sowa <>
Cc: Steven Rostedt <>
Cc: Alexander Smirnov <>
Cc: Dmitry Eremin-Solenikov <>
Signed-off-by: Luis R. Rodriguez <>
2 files changed