powerpc: Avoid load of static chain register when calling nested functions through a pointer on 64bit

The ppc64 ABI has a static chain register (r11) which is only used
when calling nested functions through a pointer. Considering that
we take a dim view of nested functions in the kernel, we have a lot
of unnecessary overhead here.

gcc 4.7 has an option to disable loading of r11 so lets use it.

If hell freezes over and hipsters manage to litter the kernel
with nested functions, gcc will give us an error message and
won't simply compile bad code:

    You cannot take the address of a nested function if you use
    the -mno-pointers-to-nested-functions option.

Furthermore our kernel module trampolines don't setup the static
chain register so adding this option and forcing gcc to error out
makes even more sense.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
(cherry picked from commit 98679fb0927cee2084caddc5277326f18642a58b)

Conflicts:
	arch/powerpc/Makefile
powerpc: Remove extra zeros from 32 bit CPU features definitions

These are 32 bit, so no need to have a bunch of wasted 0s.

The 0s saved here can be put to better use elsewhere, like at the end of my pay
check.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
(cherry picked from commit cde4d494af5fe69527bdec3de1a2816830977d44)

Conflicts:
	arch/powerpc/include/asm/cputable.h
powerpc: Repack 64bit CPU features to remove holes

This frees up 7 bits for crazy new CPU features.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
(cherry picked from commit 1580b3b873d37d3ce70b195ae5522f95fec533c9)
powerpc: Add helper functions set the DAWR and CIABR using set_mode

These are just wrappers around the new set_mode HCALL.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
(cherry picked from commit 376a8646a2d50b56b5aa80eea720258b95db3cad)
powerpc: Add DAWR CPU feature bit definition

.. and add it to POWER8 cpu features.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
(cherry picked from commit 79879c17d4af34e1d87fc3d9e1cc7803dcae153b)
powerpc: Add DAWR/X SPR number definitions

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
(cherry picked from commit a8190a59e7440a7e3f7c0889d72a13e157988b3c)
powerpc: Hardware breakpoints rewrite to handle non DABR breakpoint registers

This is a rewrite so that we don't assume we are using the DABR throughout the
code.  We now use the arch_hw_breakpoint to store the breakpoint in a generic
manner in the thread_struct, rather than storing the raw DABR value.

The ptrace GET/SET_DEBUGREG interface currently passes the raw DABR in from
userspace.  We keep this functionality, so that future changes (like the POWER8
DAWR), will still fake the DABR to userspace.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
(cherry picked from commit 9422de3e953d0e60eb95f5430a9dd803eec1c6d7)

Conflicts:
	arch/powerpc/include/asm/debug.h
	arch/powerpc/include/asm/processor.h
	arch/powerpc/xmon/xmon.c
powerpc: Add the DAWR support to the set_break()

This adds DAWR supoprt to the set_break().

It does both bare metal and PAPR versions of setting the DAWR.

There is still some work we can do to make full use of the watchpoint but that
will come later.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
(cherry picked from commit bf99de36e48678c61adb697496e0364c610bbbfc)

Conflicts:
	arch/powerpc/platforms/pseries/setup.c