perf: Treat attr.config as u64 in perf_swevent_init()

Trinity discovered that we fail to check all 64 bits of
attr.config passed by user space, resulting to out-of-bounds
access of the perf_swevent_enabled array in
sw_perf_event_destroy().

Introduced in commit b0a873ebb ("perf: Register PMU
implementations").

Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: davej@redhat.com
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Link: http://lkml.kernel.org/r/1365882554-30259-1-git-send-email-tt.rantala@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

Change-Id: I605c12090b5860f7b2a62816c1d95ea4880d0244
grouper: Adding ARM compiler flag optimizations

This patch takes into consideration stability while increasing performance.
I've tested this setup for several months now without any noticable side
effects.  These flags are enabled at optimization level -O3.  However with -O3
there's many flags that are known to break things and can sometimes break the
build itself.  The potential for breaking things with -O3 is high.  There is
also flags enabled at -O3 that increase code size, which in turn can increase
memory usage.  Documentation of this can be found on Linaro's website who have
also done extensive testing with this:
http://www.linaro.org/linaro-blog/2011/10/25/compiler-flags-used-to-speed-up-linaro-android-2011-10-and-future-optimizations/
I have not noticed much code size increase using these flags.
About the flags, cited from GNU documentaion:
http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

* -fgcse-after-reload
   When -fgcse-after-reload is enabled, a redundant load elimination pass is
   performed after reload. The purpose of this pass is to clean up redundant
   spilling.

* -fipa-cp-clone
   Perform function cloning to make interprocedural constant propagation
   stronger.  When enabled, interprocedural constant propagation performs
   function cloning when externally visible function can be called with
   constant arguments. Because this optimization can create multiple copies
   of functions, it may significantly increase code size
   (see --param ipcp-unit-growth=value).

* -fpredictive-commoning
   Perform predictive commoning optimization, i.e., reusing computations
   (especially memory loads and stores) performed in previous iterations of
   loops.

* -fsched-spec-load
   Allow speculative motion of some load instructions. This only makes sense
   when scheduling before register allocation, i.e. with -fschedule-insns or
   at -O2 or higher.

* -funswitch-loops
   Move branches with loop invariant conditions out of the loop, with duplicates
   of the loop on both branches (modified according to result of the condition).

* -fvect-cost-model
   Enable cost model for vectorization.

* -march=armv7-a
   Target CPU

* -mfpu=neon
   Target NEON type

* -mtune=cortex-a9
   grouper/tilapia is cortex-a9

* -Os
   Optimize for size to avoid code size increase

Patch set 1: Initial change
Patch set 2: Make a configurable option in to enable in cyanogenmod_grouper_defconfig

Signed-off-by: Paul Beeler <sparksco@gmail.com>
grouper: use common linker script ld

Signed-off-by: Paul Beeler <sparksco@gmail.com>
Enable option to optimize for grouper board

Signed-off-by: Paul Beeler <sparksco@gmail.com>
Merge branch 'cm-10.1' of github.com:hazenme/android_kernel_asus_grouper into cm-10.1