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

2013-09-22 Thread Anton Blanchard
From: Alistair Popple alist...@popple.id.au Signed-off-by: Alistair Popple alist...@popple.id.au --- 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

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

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

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

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- 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

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

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- 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

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

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/platforms/powernv/pci-ioda.c | 31 +-- arch/powerpc/platforms/powernv/pci.c | 27 +-- 2 files changed, 30

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

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

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

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org The powernv exception handlers are not ready to take exceptions in little endian mode, so disable them. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- arch/powerpc/platforms/powernv/opal.c | 2 ++ 1 file changed, 2

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

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- 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

[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 an...@samba.org --- arch/powerpc/include/asm/opal.h | 4 ++-- arch/powerpc/platforms/powernv/opal-rtc.c | 19 ++- 2 files

[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 an...@samba.org --- arch/powerpc/include/asm/opal.h | 22 +++--- arch/powerpc/platforms/powernv/opal.c | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c | 6

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

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

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

2013-09-22 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org --- 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

[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 an...@samba.org Cc: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/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 an...@samba.org Cc: Alexander Graf ag...@suse.de --- 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
, CROSS_COMPILE must point to a suitable toolchain (compiled for the powerpc64le-linux and powerpcle-linux targets). Signed-off-by: Ian Munsie imun...@au1.ibm.com Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/Makefile | 24 +--- arch/powerpc/boot

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

2013-08-20 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 an...@samba.org --- Index: b/arch/powerpc/kernel/align.c === --- a/arch/powerpc/kernel/align.c +++ b

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

2013-08-20 Thread Anton Blanchard
of a potentially unlimited amount of kernel memory. Signed-off-by: Anton Blanchard an...@samba.org --- Index: b/arch/powerpc/kernel/align.c === --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc/kernel/align.c @@ -651,6 +651,10 @@ static int

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 could

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 { \

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

2013-08-09 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? AFAICS you are using 0x20 in the 7th byte as the lock bit

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 change the

[PATCH 00/63] 64bit PowerPC little endian support

2013-08-06 Thread Anton Blanchard
over the next day. Anton -- Alistair Popple (4): powerpc: More little endian fixes for prom.c powerpc: More little endian fixes for setup-common.c powerpc: Little endian fixes for legacy_serial.c powerpc: Make NUMA device node code endian safe Anton Blanchard (53): powerpc: Align p_toc

[PATCH 01/63] powerpc: Align p_toc

2013-08-06 Thread Anton Blanchard
p_toc is an 8 byte relative offset to the TOC that we place in the text section. This means it is only 4 byte aligned where it should be 8 byte aligned. Add an explicit alignment. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/head_64.S | 1 + 1 file changed, 1 insertion

[PATCH 03/63] powerpc: Wrap MSR macros with parentheses

2013-08-06 Thread Anton Blanchard
Not having parentheses around a macro is asking for trouble. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/reg.h | 8 arch/powerpc/include/asm/reg_booke.h | 8 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/powerpc

[PATCH 04/63] powerpc: Remove SAVE_VSRU and REST_VSRU macros

2013-08-06 Thread Anton Blanchard
We always use VMX loads and stores to manage the high 32 VSRs. Remove these unused macros. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/ppc_asm.h | 13 - 1 file changed, 13 deletions(-) diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc

[PATCH 07/63] powerpc: Fix a number of sparse warnings

2013-08-06 Thread Anton Blanchard
Address some of the trivial sparse warnings in arch/powerpc. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/legacy_serial.c | 2 +- arch/powerpc/kernel/pci-common.c| 4 ++-- arch/powerpc/kernel/pci_64.c| 2 +- arch/powerpc

[PATCH 05/63] powerpc: Simplify logic in include/uapi/asm/elf.h

2013-08-06 Thread Anton Blanchard
Simplify things by putting all the 32bit and 64bit defines together instead of in two spots. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/uapi/asm/elf.h | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/include/uapi

[PATCH 06/63] powerpc/pseries: Simplify H_GET_TERM_CHAR

2013-08-06 Thread Anton Blanchard
plpar_get_term_char is only used once and just adds a layer of complexity to H_GET_TERM_CHAR. plpar_put_term_char isn't used at all so we can remove it. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/platforms/pseries/hvconsole.c | 12 +--- arch/powerpc/platforms

[PATCH 08/63] powerpc/pci: Don't use bitfield for force_32bit_msi

2013-08-06 Thread Anton Blanchard
Fix a sparse warning about force_32bit_msi being a one bit bitfield. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/pci-bridge.h | 2 +- arch/powerpc/kernel/pci_64.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include

[PATCH 10/63] powerpc: Make prom.c device tree accesses endian safe

2013-08-06 Thread Anton Blanchard
From: Ian Munsie imun...@au1.ibm.com On PowerPC the device tree is always big endian, but the CPU could be either, so add be32_to_cpu where appropriate and change the types of device tree data to __be32 etc to allow sparse to locate endian issues. Signed-off-by: Ian Munsie imun...@au1.ibm.com

[PATCH 09/63] powerpc: Stop using non-architected shared_proc field in lppaca

2013-08-06 Thread Anton Blanchard
to set the shared_proc bit. While here, remove the ugly bitfield. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/lppaca.h | 18 ++ arch/powerpc/include/asm/spinlock.h | 2 +- arch/powerpc/kernel/lparcfg.c

[PATCH 11/63] powerpc: More little endian fixes for prom.c

2013-08-06 Thread Anton Blanchard
From: Alistair Popple alist...@popple.id.au Signed-off-by: Alistair Popple alist...@popple.id.au --- arch/powerpc/kernel/prom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index d072f67..987a4fb 100644 ---

[PATCH 13/63] powerpc: Make cache info device tree accesses endian safe

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/setup_64.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index b3b5fd3..00dfcc5 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b

[PATCH 12/63] powerpc: Make RTAS device tree accesses endian safe

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/rtas.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 80b5ef4..98b26af 100644 --- a/arch/powerpc/kernel/rtas.c

[PATCH 15/63] powerpc: Make logical to real cpu mapping code endian safe

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/setup-common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 63d051f..ee0e055 100644 --- a/arch/powerpc/kernel/setup

[PATCH 14/63] powerpc: Make RTAS calls endian safe

2013-08-06 Thread Anton Blanchard
RTAS expects arguments in the call buffer to be big endian so we need to byteswap on little endian builds Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/rtas.h | 8 arch/powerpc/kernel/rtas.c | 38 +++--- 2 files changed

[PATCH 02/63] powerpc: handle unaligned ldbrx/stdbrx

2013-08-06 Thread Anton Blanchard
to catch ldbrx/stdbrx. Signed-off-by: Anton Blanchard an...@samba.org Cc: sta...@vger.kernel.org --- arch/powerpc/kernel/align.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c index ee5b690..52e5758 100644 --- a/arch/powerpc

[PATCH 16/63] powerpc: More little endian fixes for setup-common.c

2013-08-06 Thread Anton Blanchard
From: Alistair Popple alist...@popple.id.au Signed-off-by: Alistair Popple alist...@popple.id.au --- arch/powerpc/kernel/setup-common.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index

[PATCH 18/63] powerpc: Fix some endian issues in xics code

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/sysdev/xics/xics-common.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/sysdev/xics/xics-common.c b/arch/powerpc/sysdev/xics/xics-common.c index 9049d9f..fe0cca4 100644 --- a/arch

[PATCH 17/63] powerpc: Add some endian annotations to time and xics code

2013-08-06 Thread Anton Blanchard
Fix a couple of sparse warnings. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/time.c| 2 +- arch/powerpc/sysdev/xics/icp-native.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c

[PATCH 20/63] powerpc: Make device tree accesses in cache info code endian safe

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/cacheinfo.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c index 9262cf2..6549327 100644 --- a/arch/powerpc/kernel/cacheinfo.c

[PATCH 19/63] powerpc: of_parse_dma_window should take a __be32 *dma_window

2013-08-06 Thread Anton Blanchard
We pass dma_window to of_parse_dma_window as a void * and then run through hoops to cast it back to a u32 array. In the process we lose endian annotation. Simplify it by just passing a __be32 * down. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/prom.h| 5

[PATCH 21/63] powerpc: Make prom_init.c endian safe

2013-08-06 Thread Anton Blanchard
From: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/prom_init.c | 253 +++- 1 file changed, 147 insertions(+), 106 deletions

[PATCH 22/63] powerpc: Make device tree accesses in HVC VIO console endian safe

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- drivers/tty/hvc/hvc_vio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c index 0c62980..c791b18 100644 --- a/drivers/tty/hvc/hvc_vio.c +++ b/drivers/tty/hvc/hvc_vio.c

[PATCH 24/63] powerpc: Make OF PCI device tree accesses endian safe

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/pci-common.c | 6 +++--- arch/powerpc/kernel/pci_of_scan.c | 23 +-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c

[PATCH 23/63] powerpc: Make device tree accesses in VIO subsystem endian safe

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/vio.c | 31 +-- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index 31875a6..78a3506 100644 --- a/arch/powerpc/kernel/vio.c

[PATCH 25/63] powerpc: Make PCI device node device tree accesses endian safe

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/pci_dn.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index df03844..1f61fab 100644 --- a/arch/powerpc/kernel/pci_dn.c

[PATCH 26/63] powerpc: Little endian fixes for legacy_serial.c

2013-08-06 Thread Anton Blanchard
From: Alistair Popple alist...@popple.id.au Signed-off-by: Alistair Popple alist...@popple.id.au --- arch/powerpc/kernel/legacy_serial.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index

[PATCH 27/63] powerpc: Make NUMA device node code endian safe

2013-08-06 Thread Anton Blanchard
From: Alistair Popple alist...@popple.id.au The device tree is big endian so make sure we byteswap on little endian. We assume any pHyp calls also return big endian results in memory. Signed-off-by: Alistair Popple alist...@popple.id.au --- arch/powerpc/mm/numa.c | 100

[PATCH 30/63] powerpc: Emulate instructions in little endian mode

2013-08-06 Thread Anton Blanchard
Alistair noticed we got a SIGILL on userspace mfpvr instructions. Remove the little endian check in the emulation code, it is probably there to protect against the old pseudo little endian implementations but doesn't make sense for real little endian. Signed-off-by: Anton Blanchard

[PATCH 29/63] powerpc: Fix little endian lppaca, slb_shadow and dtl_entry

2013-08-06 Thread Anton Blanchard
The lppaca, slb_shadow and dtl_entry hypervisor structures are big endian, so we have to byte swap them in little endian builds. LE KVM hosts will also need to be fixed but for now add an #error to remind us. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/asm

[PATCH 31/63] powerpc: Little endian SMP IPI demux

2013-08-06 Thread Anton Blanchard
Add little endian support for demuxing SMP IPIs Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/smp.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 98822400..bcdb706

[PATCH 32/63] powerpc/pseries: Fix endian issues in H_GET_TERM_CHAR/H_PUT_TERM_CHAR

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/platforms/pseries/hvconsole.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/pseries/hvconsole.c b/arch/powerpc/platforms/pseries/hvconsole.c index aa0aa37..ef6d59a 100644

[PATCH 33/63] powerpc: Fix little endian coredumps

2013-08-06 Thread Anton Blanchard
We need to set ELF_DATA correctly on LE coredumps. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/uapi/asm/elf.h | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/uapi/asm/elf.h b/arch/powerpc/include/uapi/asm/elf.h index

[PATCH 34/63] powerpc: Make rwlocks endian safe

2013-08-06 Thread Anton Blanchard
Our ppc64 spinlocks and rwlocks use a trick where a lock token and the paca index are placed in the lock with a single store. Since we are using two u16s they need adjusting for little endian. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/paca.h | 5

[PATCH 35/63] powerpc: Fix endian issues in VMX copy loops

2013-08-06 Thread Anton Blanchard
Fix the permute loops for little endian. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/lib/copyuser_power7.S | 54 + arch/powerpc/lib/memcpy_power7.S | 55 ++ 2 files changed, 63 insertions(+), 46

[PATCH 38/63] powerpc: PTRACE_PEEKUSR/PTRACE_POKEUSER of FPR registers in little endian builds

2013-08-06 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 an...@samba.org --- arch/powerpc/kernel/ptrace.c | 8

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

2013-08-06 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 36/63] powerpc: Book 3S MMU little endian support

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/mmu-hash64.h | 4 +-- arch/powerpc/mm/hash_native_64.c | 46 --- arch/powerpc/mm/hash_utils_64.c | 38 ++--- 3 files changed, 46 insertions(+), 42

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

2013-08-06 Thread Anton Blanchard
this on save and restore. Signed-off-by: Anton Blanchard an...@samba.org --- 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

[PATCH 40/63] powerpc: Support endian agnostic MMIO

2013-08-06 Thread Anton Blanchard
) for that case is 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 imun...@au1.ibm.com Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/io.h | 67

[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 an...@samba.org --- arch/powerpc/include/asm/lppaca.h | 50 +++ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/arch/powerpc

[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 an...@samba.org --- arch/powerpc/include/asm/word-at-a-time.h | 71 +++ 1 file changed, 71 insertions

[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 an...@samba.org --- 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

[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 an...@samba.org --- 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

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

2013-08-06 Thread Anton Blanchard
From: Ian Munsie imun...@au1.ibm.com This patch will have powerpc include the appropriate generic endianness header depending on what the compiler reports. Signed-off-by: Ian Munsie imun...@au1.ibm.com Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/uapi/asm/byteorder.h

[PATCH 45/63] powerpc: endian safe trampoline

2013-08-06 Thread Anton Blanchard
-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/ppc_asm.h | 31 ++- arch/powerpc/kernel/entry_64.S | 36 arch/powerpc/kernel/head_64.S | 2 ++ 3 files changed, 52 insertions(+), 17 deletions(-) diff --git

[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 an...@samba.org --- 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

[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 an...@samba.org --- arch/powerpc/include/asm

[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 an...@samba.org --- 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 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 an...@samba.org --- 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

[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 an...@samba.org --- arch/powerpc/kernel/align.c | 4 ++-- 1 file changed, 2 insertions

[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 an...@samba.org --- arch/powerpc/kernel/align.c | 93 ++--- 1 file changed, 63 insertions(+), 30 deletions

[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 an...@samba.org --- arch/powerpc/kernel/align.c | 41

[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 an...@samba.org --- drivers/scsi/ibmvscsi/ibmvscsi.c | 153 ++- drivers/scsi/ibmvscsi/viosrp.h | 46 ++-- 2 files changed, 108 insertions

[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 an...@samba.org --- drivers/net/ethernet/ibm/ibmveth.c | 4 ++-- drivers/net/ethernet/ibm/ibmveth.h | 19 --- 2 files changed, 18 insertions(+), 5 deletions(-) diff

[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 an...@samba.org --- drivers/scsi/Kconfig | 1 - 1 file changed, 1

[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 an...@samba.org --- arch/powerpc/Kconfig| 3 +++ arch/powerpc/include/asm/checksum.h | 5 + arch/powerpc/kernel

[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 an...@samba.org --- arch/powerpc/include/asm/string.h | 4 arch/powerpc/kernel/ppc_ksyms.c | 2 ++ arch/powerpc/lib/Makefile

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

2013-08-06 Thread Anton Blanchard
to a suitable toolchain (compiled for the powerpc64le-linux and powerpcle-linux targets). Signed-off-by: Ian Munsie imun...@au1.ibm.com Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/Makefile | 24 +--- arch/powerpc/boot/Makefile

[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 an...@samba.org --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[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 an...@samba.org --- arch/powerpc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Makefile

[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 an...@samba.org --- arch/powerpc/configs/pseries_le_defconfig | 347 ++ 1 file

[PATCH] powerpc: Align p_toc

2013-07-31 Thread Anton Blanchard
p_toc is an 8 byte relative offset to the TOC that we place in the text section. This means it is only 4 byte aligned where it should be 8 byte aligned. Add an explicit alignment. Signed-off-by: Anton Blanchard an...@samba.org --- Index: b/arch/powerpc/kernel/head_64.S

[PATCH] powerpc: Remove SAVE_VSRU and REST_VSRU macros

2013-07-31 Thread Anton Blanchard
We always use VMX loads and stores to manage the high 32 VSRs. Remove these unused macros. Signed-off-by: Anton Blanchard an...@samba.org --- Index: b/arch/powerpc/include/asm/ppc_asm.h === --- a/arch/powerpc/include/asm/ppc_asm.h

[PATCH] powerpc: On POWERNV enable PPC_DENORMALISATION by default

2013-07-31 Thread Anton Blanchard
We want PPC_DENORMALISATION enabled when POWERNV is enabled, so update the Kconfig. Signed-off-by: Anton Blanchard an...@samba.org --- Index: b/arch/powerpc/Kconfig === --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig

[PATCH] powerpc: handle unaligned ldbrx/stdbrx

2013-07-30 Thread Anton Blanchard
to catch ldbrx/stdbrx. Signed-off-by: Anton Blanchard an...@samba.org Cc: sta...@kernel.org --- Index: b/arch/powerpc/kernel/align.c === --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc/kernel/align.c @@ -764,6 +764,16 @@ int

Re: [PATCH] of: Feed entire flattened device tree into the random pool

2013-07-28 Thread Anton Blanchard
Hi, be32_to_cpu(initial_boot_params-totalsize); Ouch, thanks Grant. Anton -- We feed the entire DMI table into the random pool to provide better random data during early boot, so do the same with the flattened device tree. Signed-off-by: Anton Blanchard an...@samba.org --- v3: Fix endian

Re: [PATCH] module: ppc64 module CRC relocation fix causes perf issues

2013-07-25 Thread Anton Blanchard
Hi Neil, Sorry I'm a bit late to the thread, I've ben swamped. Has someone tested this with kexec/kdump? Thats why the origional patch was created, because when kexec loads the kernel at a different physical address, the relocations messed with the module crc's, and modules couldn't load

SIGSTKSZ/MINSIGSTKSZ too small on 64bit

2013-07-25 Thread Anton Blanchard
Hi, Alan has been looking at a glibc test fail. His analysis shows SEGVs in signal handlers using sigaltstack, and that MINSIGSTKSZ and SIGSTKSZ are too small. We increased the size of rt_sigframe in commit 2b0a576d15e0 (powerpc: Add new transactional memory state to the signal context) but

Re: [PATCH] module: ppc64 module CRC relocation fix causes perf issues

2013-07-24 Thread Anton Blanchard
Hi Scott, I'm not really sure what it's supposed to look like when perf annotate works. It spits a bunch of unreadable[1] dark-blue-on-black assembly code at me, all with 0.00 : in the left column. Oh, wait -- some lines have 100.00 : on the left, in even-more-unreadable

[PATCH] powerpc: Feed entire flattened device tree into the random pool

2013-07-24 Thread Anton Blanchard
We feed the entire DMI table into the random pool to provide better random data during early boot, so do the same with the flattened device tree. Signed-off-by: Anton Blanchard an...@samba.org --- It might be worth doing this somewhere common, but the only place I could find

[PATCH] of: Feed entire flattened device tree into the random pool

2013-07-24 Thread Anton Blanchard
better random data during early boot, so do the same with the flattened device tree. Signed-off-by: Anton Blanchard an...@samba.org --- v2: move to drivers/of/fdt.c as suggested by Michael Ellerman Index: b/drivers/of/fdt.c

Re: [PATCH] module: ppc64 module CRC relocation fix causes perf issues

2013-07-17 Thread Anton Blanchard
Hi Scott, What specifically should I do to test it? Could you double check perf annotate works? I'm 99% sure it will but that is what was failing on ppc64. Anton ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org

[PATCH] module: ppc64 module CRC relocation fix causes perf issues

2013-07-14 Thread Anton Blanchard
in that case. Signed-off-by: Anton Blanchard an...@samba.org Cc: sta...@kernel.org --- This bug was originally reported on Fedora 19 (3.9.x), so I've marked it for stable. Index: b/arch/powerpc/include/asm/module.h === --- a/arch

[PATCH] powerpc: Print instruction when logging unhandled exceptions

2013-06-06 Thread Anton Blanchard
It is often useful to see the instruction that caused an unhandled exception. Signed-off-by: Anton Blanchard an...@samba.org --- We print all ones if the get_user fails, do we want to go to the added effort of printing like we do in the oops code? Index: b/arch/powerpc/kernel/traps.c

Re: [PATCH 5/5] net: Block MSG_CMSG_COMPAT in send(m)msg and recv(m)msg

2013-06-05 Thread Anton Blanchard
Hi, This is causing a regression on 64bit powerpc with 32bit usermode. When I hit userspace, udev is broken and I suspect all networking is broken as well. Can we please revert 1be374a0518a288147c6a7398792583200a67261 upstream? Found via bisect. Doesn't this patch break

[PATCH] powerpc: Align thread-fpr to 16 bytes

2013-06-04 Thread Anton Blanchard
On newer CPUs we use VSX loads and stores to the thread-fpr array. For best performance we need to ensure 16 byte alignment. Signed-off-by: Anton Blanchard an...@samba.org --- Index: b/arch/powerpc/include/asm/processor.h

Re: [PATCH] powerpc: provide __bswapdi2

2013-05-13 Thread Anton Blanchard
On Fri, 10 May 2013 22:18:27 +0100 David Woodhouse dw...@infradead.org wrote: From: David Woodhouse david.woodho...@intel.com Some versions of GCC apparently expect this to be provided by libgcc. Thanks Dave. We were discussing this with Alan Modra and he doesn't think the 64bit target

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