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
usage of STATIC_KEY_CHECK_USE().

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:

[0] drvbp1.linux-foundation.org/~mcgrof/examples/2014/04/01/backport-static-keys.patch

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
untested.

mcgrof@ergon ~/linux (git::master)$ git describe --contains bf5438fc
v2.6.37-rc1~214^2~33^2~8

mcgrof@ergon ~/linux (git::master)$ git describe --contains d430d3d7e
v3.0-rc1~404^2~18^2~2

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
v3.13-rc1~105^2~157^2~6

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jason Baron <jbaron@redhat.com>
CC: Jason Baron <jbaron@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: linux-zigbee-devel@lists.sourceforge.net
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2 files changed