[PATCH 28/63] powerpc: Add endian annotations to lppaca, slb_shadow and dtl_entry

2013-08-06 Thread Anton Blanchard
Add endian annotation to various hypervisor structures which are defined as big endian. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/lppaca.h | 50 +++ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/include/asm

[PATCH 41/63] powerpc: Add little endian support for word-at-a-time functions

2013-08-06 Thread Anton Blanchard
The powerpc word-at-a-time functions are big endian specific. Bring in the x86 version in order to support little endian builds. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/word-at-a-time.h | 71 +++ 1 file changed, 71 insertions(+) diff --git a/arch

[PATCH 42/63] powerpc: Set MSR_LE bit on little endian builds

2013-08-06 Thread Anton Blanchard
We need to set MSR_LE in kernel and userspace for little endian builds Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/reg.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index a312e0c

[PATCH 43/63] powerpc: Reset MSR_LE on signal entry

2013-08-06 Thread Anton Blanchard
We always take signals in big endian which is wrong. Signals should be taken in native endian. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/signal_32.c | 3 ++- arch/powerpc/kernel/signal_64.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH 44/63] powerpc: Include the appropriate endianness header

2013-08-06 Thread Anton Blanchard
From: Ian Munsie This patch will have powerpc include the appropriate generic endianness header depending on what the compiler reports. Signed-off-by: Ian Munsie Signed-off-by: Anton Blanchard --- arch/powerpc/include/uapi/asm/byteorder.h | 4 1 file changed, 4 insertions(+) diff --git

[PATCH 45/63] powerpc: endian safe trampoline

2013-08-06 Thread Anton Blanchard
From: Benjamin Herrenschmidt Create a trampoline that works in either endian and flips to the expected endian. Use it for primary and secondary thread entry as well as RTAS and OF call return. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm

[PATCH 46/63] powerpc: Add endian safe trampoline to pseries secondary thread entry

2013-08-06 Thread Anton Blanchard
We might need to flip endian when starting secondary threads via RTAS. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/head_64.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 065d10f..2ae41ab 100644 --- a/arch

[PATCH 47/63] pseries: Add H_SET_MODE to change exception endianness

2013-08-06 Thread Anton Blanchard
On little endian builds call H_SET_MODE so exceptions have the correct endianness. We need a better hook to handle flipping back into big endian mode on a kexec, but insert it into the mmu teardown callback for now. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/hvcall.h

[PATCH 48/63] powerpc/kvm/book3s_hv: Add little endian guest support

2013-08-06 Thread Anton Blanchard
the entire MSR to use. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/kernel/asm-offsets.c | 1 + arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 +- arch/powerpc/kvm/book3s_hv.c| 44 + arch/powerpc

[PATCH 49/63] powerpc: Remove open coded byte swap macro in alignment handler

2013-08-06 Thread Anton Blanchard
Use swab64/32/16 instead of open coding it. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/align.c | 36 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c index 52e5758..573728b

[PATCH 50/63] powerpc: Remove hard coded FP offsets in alignment handler

2013-08-06 Thread Anton Blanchard
The alignment handler assumes big endian ordering when selecting the low word of a 64bit floating point value. Use the existing union which works in both little and big endian. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/align.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 51/63] powerpc: Alignment handler shouldn't access VSX registers with TS_FPR

2013-08-06 Thread Anton Blanchard
The TS_FPR macro selects the FPR component of a VSX register (the high doubleword). emulate_vsx is using this macro to get the address of the associated VSX register. This happens to work on big endian, but fails on little endian. Replace it with an explicit array access. Signed-off-by: Anton

[PATCH 52/63] powerpc: Add little endian support to alignment handler

2013-08-06 Thread Anton Blanchard
Handle most unaligned load and store faults in little endian mode. Strings, multiples and VSX are not supported. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/align.c | 93 ++--- 1 file changed, 63 insertions(+), 30 deletions(-) diff --git a

[PATCH 53/63] powerpc: Handle VSX alignment faults in little endian mode

2013-08-06 Thread Anton Blanchard
Things are complicated by the fact that VSX elements are big endian ordered even in little endian mode. 8 byte loads and stores also write to the top 8 bytes of the register. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/align.c | 41 + 1 file

[PATCH 55/63] ibmvscsi: Fix little endian issues

2013-08-06 Thread Anton Blanchard
The hypervisor is big endian, so little endian kernel builds need to byteswap. Signed-off-by: Anton Blanchard --- drivers/scsi/ibmvscsi/ibmvscsi.c | 153 ++- drivers/scsi/ibmvscsi/viosrp.h | 46 ++-- 2 files changed, 108 insertions(+), 91 deletions

[PATCH 54/63] ibmveth: Fix little endian issues

2013-08-06 Thread Anton Blanchard
The hypervisor is big endian, so little endian kernel builds need to byteswap. Signed-off-by: Anton Blanchard --- drivers/net/ethernet/ibm/ibmveth.c | 4 ++-- drivers/net/ethernet/ibm/ibmveth.h | 19 --- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH 56/63] [SCSI] lpfc: Don't force CONFIG_GENERIC_CSUM on

2013-08-06 Thread Anton Blanchard
Kconfig. If the option exists it is always forced on. Other users of the checksum routines (eg networking code) do not have a select CONFIG_GENERIC_CSUM, so I don't see why the lpfc driver should. Signed-off-by: Anton Blanchard --- drivers/scsi/Kconfig | 1 - 1 file changed, 1 deletion(-)

[PATCH 57/63] powerpc: Use generic checksum code in little endian

2013-08-06 Thread Anton Blanchard
We need to fix some endian issues in our checksum code. For now just enable the generic checksum routines for little endian builds. Signed-off-by: Anton Blanchard --- arch/powerpc/Kconfig| 3 +++ arch/powerpc/include/asm/checksum.h | 5 + arch/powerpc/kernel/ppc_ksyms.c

[PATCH 58/63] powerpc: Use generic memcpy code in little endian

2013-08-06 Thread Anton Blanchard
We need to fix some endian issues in our memcpy code. For now just enable the generic memcpy routine for little endian builds. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/string.h | 4 arch/powerpc/kernel/ppc_ksyms.c | 2 ++ arch/powerpc/lib/Makefile | 9

[PATCH 59/63] powerpc: uname should return ppc64le/ppcle on little endian builds

2013-08-06 Thread Anton Blanchard
We need to distinguish between big endian and little endian environments, so fix uname to return the right thing. Signed-off-by: Anton Blanchard --- arch/powerpc/Makefile | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc

[PATCH 60/63] powerpc: Add ability to build little endian kernels

2013-08-06 Thread Anton Blanchard
toolchain (compiled for the powerpc64le-linux and powerpcle-linux targets). Signed-off-by: Ian Munsie Signed-off-by: Anton Blanchard --- arch/powerpc/Makefile | 24 +--- arch/powerpc/boot/Makefile | 3 ++- arch/powerpc/kernel/vdso32/vdso32.lds.S

[PATCH 61/63] powerpc: Don't set HAVE_EFFICIENT_UNALIGNED_ACCESS on little endian builds

2013-08-06 Thread Anton Blanchard
POWER7 takes alignment exceptions on some unaligned addresses, so disable HAVE_EFFICIENT_UNALIGNED_ACCESS. This fixes an early boot issue in the printk code. Signed-off-by: Anton Blanchard --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc

[PATCH 62/63] powerpc: Work around little endian gcc bug

2013-08-06 Thread Anton Blanchard
Temporarily work around an ICE we are seeing while building in little endian mode: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57134 Signed-off-by: Anton Blanchard --- arch/powerpc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc

[PATCH 63/63] powerpc: Add pseries_le_defconfig

2013-08-06 Thread Anton Blanchard
This is the pseries_defconfig with CONFIG_CPU_LITTLE_ENDIAN enabled and CONFIG_VIRTUALIZATION disabled (required until we fix some endian issues in KVM). Signed-off-by: Anton Blanchard --- arch/powerpc/configs/pseries_le_defconfig | 347 ++ 1 file changed, 347

Re: [PATCH 63/63] powerpc: Add pseries_le_defconfig

2013-08-08 Thread Anton Blanchard
Hi, > The CONFIG_VIRTUALIZATION disabling should be done in the Kconfig not > here. > > I'm not that keen on another defconfig. benh is already talking about > having a powernv defconfig. I'm worried we are going to fragment the > defconfigs. If you want something special like LE, then chang

Re: [PATCH 36/63] powerpc: Book 3S MMU little endian support

2013-08-08 Thread Anton Blanchard
Hi Paul, > On Wed, Aug 07, 2013 at 02:01:53AM +1000, Anton Blanchard wrote: > > > +#ifdef __BIG_ENDIAN__ > > #define HPTE_LOCK_BIT 3 > > +#else > > +#define HPTE_LOCK_BIT (63-3) > > +#endif > > Are you deliberately using a different bit here? AFAI

BUG_ON and gcc don't mix

2013-08-19 Thread Anton Blanchard
Hi, I noticed our BUG_ON macros were taking a large number of instructions. I've built a testcase to analyse it: #if defined(ASMBUG) #define BUG_ON(x) do { \ __asm__ __volatile__("tdnei %0,0\n" : : "r" ((long)(x))); \ } while (0) #elif defined(BUILTIN) #define BUG_ON(x) do { \

[PATCH] powerpc: Never handle VSX alignment exceptions from kernel

2013-08-19 Thread Anton Blanchard
and SPE code have similar issues but already include a user check. Add the same check to emulate_vsx(). Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/kernel/align.c === --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc

Re: [PATCH] powerpc: Never handle VSX alignment exceptions from kernel

2013-08-20 Thread Anton Blanchard
or worse, corruption of a potentially unlimited amount of kernel memory. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/kernel/align.c === --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc/kernel/align.c @@ -65

Re: BUG_ON and gcc don't mix

2013-08-20 Thread Anton Blanchard
Hi David, > I was thinking that you could add the label after the trap and > then use '.long 1b-4'. But you'd have to put the asm outside the > conditional - so that wouldn't work if the condition was more > complicated and the trap had to be out of line. > > If the trap is out of line, then it

[PATCH 00/39] Second round of 64bit PowerPC little endian patches

2013-09-22 Thread Anton Blanchard
arch/powerpc/platforms/powernv/pci.c powerpc: Little endian fix for arch/powerpc/platforms/powernv/pci-p5ioc2.c powerpc: Little endian sparse clean up for arch/powerpc/platforms/powernv/pci-ioda.c Anton Blanchard (22): powerpc: Fix endian issues in VMX copy loops powerpc: Book 3S

[PATCH 01/39] powerpc: Fix endian issues in VMX copy loops

2013-09-22 Thread Anton Blanchard
Fix the permute loops for little endian. Signed-off-by: Anton Blanchard --- arch/powerpc/lib/copyuser_power7.S | 54 + arch/powerpc/lib/memcpy_power7.S | 55 ++ 2 files changed, 63 insertions(+), 46 deletions(-) diff

[PATCH 02/39] powerpc: Book 3S MMU little endian support

2013-09-22 Thread Anton Blanchard
v2: HPTE_LOCK_BIT was wrong in LE, spotted by Paul Mackerras. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/mmu-hash64.h | 4 +-- arch/powerpc/mm/hash_native_64.c | 46 --- arch/powerpc/mm/hash_utils_64.c | 38

[PATCH 03/39] powerpc: Fix offset of FPRs in VSX registers in little endian builds

2013-09-22 Thread Anton Blanchard
The FPRs overlap the high doublewords of the first 32 VSX registers. Fix TS_FPROFFSET and TS_VSRLOWOFFSET so we access the correct fields in little endian mode. If VSX is disabled the FPRs are only one doubleword in length so TS_FPROFFSET needs adjusting in little endian. Signed-off-by: Anton

[PATCH 04/39] powerpc: PTRACE_PEEKUSR/PTRACE_POKEUSER of FPR registers in little endian builds

2013-09-22 Thread Anton Blanchard
FPRs overlap the high 64bits of the first 32 VSX registers. The ptrace FP read/write code assumes big endian ordering and grabs the lowest 64 bits. Fix this by using the TS_FPR macro which does the right thing. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/ptrace.c | 8 1

[PATCH 05/39] powerpc: Little endian builds double word swap VSX state during context save/restore

2013-09-22 Thread Anton Blanchard
on save and restore. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/ppc-opcode.h | 3 +++ arch/powerpc/include/asm/ppc_asm.h| 21 + 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include

[PATCH 06/39] powerpc: Support endian agnostic MMIO

2013-09-22 Thread Anton Blanchard
intentional to bring the attention of anyone doing a 64bit little endian port. 64bit big endian is unaffected. [ Added 64 bit versions - Anton ] Signed-off-by: Ian Munsie Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/io.h | 67 +++ 1 file changed, 49

[PATCH 07/39] powerpc: Add little endian support for word-at-a-time functions

2013-09-22 Thread Anton Blanchard
The powerpc word-at-a-time functions are big endian specific. Bring in the x86 version in order to support little endian builds. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/word-at-a-time.h | 71 +++ 1 file changed, 71 insertions(+) diff --git a/arch

[PATCH 08/39] powerpc: Set MSR_LE bit on little endian builds

2013-09-22 Thread Anton Blanchard
We need to set MSR_LE in kernel and userspace for little endian builds Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/reg.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 10d1ef0

[PATCH 09/39] powerpc: Reset MSR_LE on signal entry

2013-09-22 Thread Anton Blanchard
We always take signals in big endian which is wrong. Signals should be taken in native endian. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/signal_32.c | 3 ++- arch/powerpc/kernel/signal_64.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH 10/39] powerpc: Include the appropriate endianness header

2013-09-22 Thread Anton Blanchard
From: Ian Munsie This patch will have powerpc include the appropriate generic endianness header depending on what the compiler reports. Signed-off-by: Ian Munsie Signed-off-by: Anton Blanchard --- arch/powerpc/include/uapi/asm/byteorder.h | 4 1 file changed, 4 insertions(+) diff --git

[PATCH 11/39] powerpc: endian safe trampoline

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt Create a trampoline that works in either endian and flips to the expected endian. Use it for primary and secondary thread entry as well as RTAS and OF call return. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm

[PATCH 12/39] powerpc: Remove open coded byte swap macro in alignment handler

2013-09-22 Thread Anton Blanchard
Use swab64/32/16 instead of open coding it. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/align.c | 36 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c index a27ccd5..af830df

[PATCH 13/39] powerpc: Remove hard coded FP offsets in alignment handler

2013-09-22 Thread Anton Blanchard
The alignment handler assumes big endian ordering when selecting the low word of a 64bit floating point value. Use the existing union which works in both little and big endian. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/align.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 14/39] powerpc: Alignment handler shouldn't access VSX registers with TS_FPR

2013-09-22 Thread Anton Blanchard
The TS_FPR macro selects the FPR component of a VSX register (the high doubleword). emulate_vsx is using this macro to get the address of the associated VSX register. This happens to work on big endian, but fails on little endian. Replace it with an explicit array access. Signed-off-by: Anton

[PATCH 16/39] powerpc: Handle VSX alignment faults in little endian mode

2013-09-22 Thread Anton Blanchard
Things are complicated by the fact that VSX elements are big endian ordered even in little endian mode. 8 byte loads and stores also write to the top 8 bytes of the register. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/align.c | 41 + 1 file

[PATCH 15/39] powerpc: Add little endian support to alignment handler

2013-09-22 Thread Anton Blanchard
Handle most unaligned load and store faults in little endian mode. Strings, multiples and VSX are not supported. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/align.c | 93 ++--- 1 file changed, 63 insertions(+), 30 deletions(-) diff --git a

[PATCH 17/39] powerpc: Use generic checksum code in little endian

2013-09-22 Thread Anton Blanchard
We need to fix some endian issues in our checksum code. For now just enable the generic checksum routines for little endian builds. Signed-off-by: Anton Blanchard --- arch/powerpc/Kconfig| 3 +++ arch/powerpc/include/asm/checksum.h | 5 + arch/powerpc/kernel/ppc_ksyms.c

[PATCH 18/39] powerpc: Use generic memcpy code in little endian

2013-09-22 Thread Anton Blanchard
We need to fix some endian issues in our memcpy code. For now just enable the generic memcpy routine for little endian builds. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/string.h | 4 arch/powerpc/kernel/ppc_ksyms.c | 2 ++ arch/powerpc/lib/Makefile | 9

[PATCH 19/39] powerpc: uname should return ppc64le/ppcle on little endian builds

2013-09-22 Thread Anton Blanchard
We need to distinguish between big endian and little endian environments, so fix uname to return the right thing. Signed-off-by: Anton Blanchard --- arch/powerpc/Makefile | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc

[PATCH 20/39] powerpc: Little endian fixes for platforms/powernv/opal.c

2013-09-22 Thread Anton Blanchard
From: Alistair Popple Signed-off-by: Alistair Popple --- arch/powerpc/platforms/powernv/opal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 2911abe..4ffa75e 100644 --- a/arch/powerpc/plat

[PATCH 21/39] powerpc: Little endian fix for arch/powerpc/platforms/powernv/pci.c

2013-09-22 Thread Anton Blanchard
From: Alistair Popple Signed-off-by: Alistair Popple --- arch/powerpc/platforms/powernv/pci.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index a28d3b5..9122215 100644 --- a/arch/powerp

[PATCH 23/39] powerpc: Little endian sparse clean up for arch/powerpc/platforms/powernv/pci-ioda.c

2013-09-22 Thread Anton Blanchard
From: Alistair Popple Signed-off-by: Alistair Popple --- arch/powerpc/platforms/powernv/pci-ioda.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 74a5a57..9a903ed 100644 --- a/a

[PATCH 22/39] powerpc: Little endian fix for arch/powerpc/platforms/powernv/pci-p5ioc2.c

2013-09-22 Thread Anton Blanchard
From: Alistair Popple Signed-off-by: Alistair Popple --- arch/powerpc/platforms/powernv/pci-p5ioc2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c b/arch/powerpc/platforms/powernv/pci-p5ioc2.c index b68db63..f8b4bd8 100644 -

[PATCH 24/39] powerpc/powernv: Fix endian issues in OPAL RTC driver

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/powernv/opal-rtc.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/platforms/powernv/opal-rtc.c b/arch/powerpc/platforms/powernv/opal-rtc.c index 2aa7641..dbfdba3 100644 --- a/

[PATCH 25/39] powerpc/powernv: Fix endian issues in OPAL ICS backend

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/sysdev/xics/ics-opal.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/sysdev/xics/ics-opal.c b/arch/powerpc/sysdev/xics/ics-opal.c index 39d7221..3c6ee1b 1006

[PATCH 26/39] powerpc/powernv: Make OPAL NVRAM device tree accesses endian safe

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/powernv/opal-nvram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/opal-nvram.c b/arch/powerpc/platforms/powernv/opal-nvram.c index 3f83e1a..ac

[PATCH 27/39] powerpc/powernv: Fix endian issues in powernv PCI code

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/powernv/pci-ioda.c | 31 +-- arch/powerpc/platforms/powernv/pci.c | 27 +-- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/arc

[PATCH 28/39] powerpc/powernv: Fix endian issues in OPAL console and udbg backend

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/opal.h | 8 arch/powerpc/platforms/powernv/opal.c | 28 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/include/asm/opal.h b

[PATCH 30/39] powerpc/powernv: Don't register exception handlers in little endian mode

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt The powernv exception handlers are not ready to take exceptions in little endian mode, so disable them. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/powernv/opal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/platforms/powe

[PATCH 29/39] powerpc/powernv: Fix OPAL entry and exit in little endian mode

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/powernv/opal-wrappers.S | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S inde

[PATCH 31/39] powerpc/powernv: More little endian issues in OPAL RTC driver

2013-09-22 Thread Anton Blanchard
Sparse caught an issue where opal_set_rtc_time was incorrectly byteswapping. Also fix a number of sparse warnings. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/opal.h | 4 ++-- arch/powerpc/platforms/powernv/opal-rtc.c | 19 ++- 2 files changed, 12

[PATCH 32/39] powerpc/powernv: Fix some PCI sparse errors and one LE bug

2013-09-22 Thread Anton Blanchard
pnv_pci_setup_bml_iommu was missing a byteswap of a device tree property. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/opal.h | 22 +++--- arch/powerpc/platforms/powernv/opal.c | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 6 +++--- arch

[PATCH 33/39] powerpc/hvsi: Fix endian issues in HVSI driver

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/hvsi.h | 16 drivers/tty/hvc/hvsi_lib.c | 25 - 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/arch/powerpc/include/asm/hvsi.h b/arch/p

[PATCH 34/39] tty/hvc_opal: powerpc: Make OPAL HVC device tree accesses endian safe

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt Signed-off-by: Benjamin Herrenschmidt --- drivers/tty/hvc/hvc_opal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c index cd69b48..6496872 100644 --- a/drivers/tty/hvc/hvc_opal.c +++ b/

[PATCH 35/39] KVM: PPC: Disable KVM on little endian builds

2013-09-22 Thread Anton Blanchard
There are a number of KVM issues with little endian builds. We are working on fixing them, but in the meantime disable it. Signed-off-by: Anton Blanchard Cc: Alexander Graf --- arch/powerpc/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc

[PATCH 36/39] powerpc/kvm/book3s_hv: Add little endian guest support

2013-09-22 Thread Anton Blanchard
the entire MSR to use. Signed-off-by: Anton Blanchard Cc: Alexander Graf --- arch/powerpc/include/asm/kvm_host.h | 1 + arch/powerpc/kernel/asm-offsets.c | 1 + arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 +- arch/powerpc/kvm/book3s_hv.c| 44

[PATCH 37/39] powerpc: Add ability to build little endian kernels

2013-09-22 Thread Anton Blanchard
point to a suitable toolchain (compiled for the powerpc64le-linux and powerpcle-linux targets). Signed-off-by: Ian Munsie Signed-off-by: Anton Blanchard --- arch/powerpc/Makefile | 24 +--- arch/powerpc/boot/Makefile | 3 ++- arch/powerpc/kernel

[PATCH 38/39] powerpc: Don't set HAVE_EFFICIENT_UNALIGNED_ACCESS on little endian builds

2013-09-22 Thread Anton Blanchard
POWER7 takes alignment exceptions on some unaligned addresses, so disable HAVE_EFFICIENT_UNALIGNED_ACCESS. This fixes an early boot issue in the printk code. Signed-off-by: Anton Blanchard --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc

[PATCH 39/39] powerpc: Work around little endian gcc bug

2013-09-22 Thread Anton Blanchard
Temporarily work around an ICE we are seeing while building in little endian mode: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57134 Signed-off-by: Anton Blanchard --- arch/powerpc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc

[PATCH] powerpc: Add VMX optimised xor for RAID5

2013-09-25 Thread Anton Blanchard
: 15801.600 MB/sec I tested this against an array created without the patch, and also verified it worked as expected on a little endian kernel. Signed-off-by: Anton Blanchard --- Index: le-kernel/arch/powerpc/include/asm/xor.h

[PATCH] powerpc/powernv: Reduce panic timeout from 180s to 10s

2013-09-26 Thread Anton Blanchard
We made this change to pseries in 2011 and I think it makes sense to do the same on powernv. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/platforms/powernv/setup.c === --- a/arch/powerpc/platforms/powernv/setup.c +++ b

[PATCH] powerpc: Fix parameter clobber in csum_partial_copy_generic()

2013-09-30 Thread Anton Blanchard
ntation of PowerPC, this commit instead uses register r9 to do the adjusting, leaving r7's pointer uncorrupted. Signed-off-by: Paul E. McKenney Signed-off-by: Anton Blanchard Cc: sta...@vger.kernel.org --- Index: b/arch/powerpc/li

[PATCH] Restore registers on error exit from csum_partial_copy_generic()

2013-10-01 Thread Anton Blanchard
ers in the presumably rare event of an access exception within that loop. This commit therefore restores these register on error exit from the loop. Signed-off-by: Paul E. McKenney Signed-off-by: Anton Blanchard Cc: sta...@vger.kernel.org --- Index: b/arch/powerpc/lib/che

Re: [PATCH] powerpc/powernv: Reduce panic timeout from 180s to 10s

2013-10-08 Thread Anton Blanchard
> > > We made this change to pseries in 2011 and I think it makes > > > sense to do the same on powernv. > > > > I'd vote we set it to 10s for all 64-bit machines in > > arch/powerpc/kernel/setup_64.c. > > Why is 64-bit relevant? And wouldn't such a short delay be a problem > if the crash is di

[PATCH] powerpc: Add VMX optimised xor for RAID5

2013-10-14 Thread Anton Blanchard
altivec : 15801.600 MB/sec I tested this against an array created without the patch, and also verified it worked as expected on a little endian kernel. Signed-off-by: Anton Blanchard --- Index: le-kernel/arch/powerpc/include/asm/xor.h

[PATCH] powerpc: Use 32 bit loads and stores when operating on condition register values

2013-10-14 Thread Anton Blanchard
The condition register (CR) is a 32 bit quantity so we should use 32 bit loads and stores. Signed-off-by: Anton Blanchard --- diff --git a/arch/powerpc/kernel/tm.S b/arch/powerpc/kernel/tm.S index cd809ea..432cf54 100644 --- a/arch/powerpc/kernel/tm.S +++ b/arch/powerpc/kernel/tm.S @@ -107,7

Re: [PATCH] powerpc: Use 32 bit loads and stores when operating on condition register values

2013-10-14 Thread Anton Blanchard
Hi Paul, > Does this make any practical difference or fix any bugs, or is this > just for aesthetics? There is talk of the other 32 bits of that word being used for a stack canary in a future ABI revision. So right now it is just cosmetic, but it could be important in the future. I guess it cou

powerpc: Fix little endian issue in OF PCI scan

2013-10-17 Thread Anton Blanchard
This issue was causing the QEMU emulated USB device to fail dring PCI probe. Signed-off-by: Anton Blanchard --- diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c index 4368ec6..ac0b034 100644 --- a/arch/powerpc/kernel/pci_of_scan.c +++ b/arch/powerpc

[PATCH] powerpc/pseries: Fix endian issues in pseries iommu code

2013-10-17 Thread Anton Blanchard
Signed-off-by: Anton Blanchard --- diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 0307901..f253361 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -52,7 +52,7 @@ static void

[PATCH] powerpc/pseries: Fix dedicated processor partition detection

2013-10-19 Thread Anton Blanchard
back to using the old method. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/include/asm/lppaca.h === --- a/arch/powerpc/include/asm/lppaca.h +++ b/arch/powerpc/include/asm/lppaca.h @@ -84,8 +84,8 @@ struct lppaca

[PATCH] powerpc: Use -mcpu=power7 on ppc64 little endian builds

2013-10-21 Thread Anton Blanchard
Using -mcpu=power7 allows gcc to use a number of new instructions including 64 bit byte reversed loads. Signed-off-by: Anton Blanchard --- diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 6704e2e..c2a566f 100644 --- a/arch/powerpc/platforms

[PATCH 1/3] powerpc: sync ppc64, ppc64e and pseries configs

2013-10-21 Thread Anton Blanchard
Run savedefconfig over the ppc64, ppc64e and pseries config Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/configs/ppc64_defconfig === --- a/arch/powerpc/configs/ppc64_defconfig +++ b/arch/powerpc/configs/ppc64_defconfig

[PATCH 2/3] powerpc: Enable multipath modules on ppc64 and pseries

2013-10-21 Thread Anton Blanchard
Enable a few modules required to boot on a POWER multipath box. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/configs/pseries_defconfig === --- a/arch/powerpc/configs/pseries_defconfig +++ b/arch/powerpc/configs

[PATCH 3/3] powerpc: Enable virtio on ppc64 and pseries configs

2013-10-21 Thread Anton Blanchard
Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/configs/pseries_defconfig === --- a/arch/powerpc/configs/pseries_defconfig +++ b/arch/powerpc/configs/pseries_defconfig @@ -127,6 +127,7 @@ CONFIG_BLK_DEV_LOOP=y

Re: [PATCH] powerpc: memcpy optimization for 64bit LE

2013-11-06 Thread Anton Blanchard
Hi, > > Unaligned stores take alignment exceptions on POWER7 running in > > little-endian. This is a dumb little-endian base memcpy that > > prevents unaligned stores. It is replaced by the VMX memcpy at boot. > > Is this any faster than the generic version? Once booted the feature fixup code s

[PATCH] powerpc: print DAR and DSISR on machine check oopses

2013-11-14 Thread Anton Blanchard
Machine check exceptions set DAR and DSISR, so print them in our oops output. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/kernel/process.c === --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c

[PATCH] powerpc: Remove a few lines of oops output

2013-11-14 Thread Anton Blanchard
igned-off-by: Anton Blanchard --- PACATMSCRATCH is a long and not very descriptive name. It appears to be an MSR so should it instead be called TM_MSR? Also, could we save a line and only print it if MSR_TM_ACTIVE()? Index: b/arch/powerpc/kernel/proc

[PATCH 1/3] powerpc: Run savedefconfig over pseries, ppc64 and ppc64e defconfig

2012-12-12 Thread Anton Blanchard
No changes, just update the configs with savedefconfig. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/configs/ppc64_defconfig === --- a/arch/powerpc/configs/ppc64_defconfig +++ b/arch/powerpc/configs/ppc64_defconfig

[PATCH 2/3] powerpc: Cleanup NLS config options on pseries, ppc64 and ppc64e defconfig

2012-12-12 Thread Anton Blanchard
Set CONFIG_NLS_DEFAULT to utf8. The distros do this (eg ppc64 FC17 and RHEL6) as well as the x86 defconfigs. Userspace these days is most likely to expect utf8 anyway. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/configs/ppc64_defconfig

[PATCH 3/3] powerpc: Enable devtmpfs, EFI partition support and tmpfs ACLs on pseries, ppc64 and ppc64e defconfig

2012-12-12 Thread Anton Blanchard
We need devtmpfs enabled to boot on recent versions of Fedora. EFI partitions will be useful for large block devices. tmpfs ACL support is used by some distros for managing access to devices. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/configs/pseries_defconfig

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

2012-12-12 Thread Anton Blanchard
odule 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 --- Index: b/arch/powerpc/Makefile === --- a/arch/powerpc/Makefile

Re: [PATCH] powerpc: POWER7 optimised memcpy using VMX and enhanced prefetch

2012-12-17 Thread Anton Blanchard
Hi Jimi, > I know this is a little late, but shouldn't these power7 specific > thingies be in "obj-$(CONFIG_PPC_BOOK3S_64)". The reason I ask is > that my compiler pukes on "dcbtst" and as I deal with that I wanted > to point this out. I guess we could do that. It's a bit strange your assembler

[PATCH 1/4] audit: Syscall rules are not applied to existing processes on non-x86

2013-01-08 Thread Anton Blanchard
audit record. Signed-off-by: Anton Blanchard Cc: # 3.3+ --- Index: b/include/linux/audit.h === --- a/include/linux/audit.h +++ b/include/linux/audit.h @@ -119,7 +119,7 @@ static inline void audit_syscall_en

[PATCH 2/4] powerpc: Remove static branch prediction in 64bit traced syscall path

2013-01-08 Thread Anton Blanchard
Some distros enable auditing by default which forces us through the syscall trace path. Remove the static branch prediction in our 64bit syscall handler and let the hardware do the prediction. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/kernel/entry_64.S

[PATCH 3/4] powerpc: Optimise 64bit syscall auditing entry path

2013-01-08 Thread Anton Blanchard
subsequent patch. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/kernel/entry_64.S === --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S @@ -34,6 +34,12 @@ #include #include +/* Avoid __ASSEMBLER__

[PATCH 4/4] powerpc: Optimise 64bit syscall auditing exit path

2013-01-08 Thread Anton Blanchard
on a POWER7 box: http://ozlabs.org/~anton/junkcode/null_syscall.c Baseline: 920.6 cycles Patched: 719.6 cycles An improvement of 22%. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/kernel/entry_64.S === --- a/arch/po

Re: [PATCH 1/4] audit: Syscall rules are not applied to existing processes on non-x86

2013-02-06 Thread Anton Blanchard
Hi, Just following up on this. I've had a few people complaining about audit being broken on ppc64 and it would be nice to fix. Anton -- On Wed, 9 Jan 2013 10:46:17 +1100 Anton Blanchard wrote: > > Commit b05d8447e782 (audit: inline audit_syscall_entry to reduce > burden on

[PATCH] powerpc: Fix -mcmodel=medium breakage in prom_init.c

2013-03-12 Thread Anton Blanchard
Signed-off-by: Anton Blanchard --- Thanks Aaro for reporting this, and Alexander for an initial fix. This tested ok for me with both a new and an old toolchain, but would appreciate if you could double check it fixes your issues too. diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel

Re: [PATCH] [RFC] powerpc: Add VDSO version of time

2013-04-18 Thread Anton Blanchard
hange and with Michael's comments covered (decent changelog entry and Signed-off-by): Acked-by: Anton Blanchard Anton ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

<    1   2   3   4   5   6   7   8   9   10   >