[PATCH 21/33] powerpc: Fix ABIv2 issue with dereference_function_descriptor

2014-03-25 Thread Anton Blanchard
Don't try and dereference a function descriptor on ABIv2. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/sections.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h index d0e784e..d1bb96d

[PATCH 22/33] powerpc: make module stub code endian independent

2014-03-25 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au By representing them as words, rather than chars, we can avoid endian ifdefs. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- arch/powerpc/kernel/module_64.c | 42 +++-- 1 file changed, 11 insertions(+), 31

[PATCH 23/33] powerpc: modules implement R_PPC64_TOCSAVE relocation.

2014-03-25 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- arch/powerpc/include/uapi/asm/elf.h | 5 - arch/powerpc/kernel/module_64.c | 8 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/uapi/asm/elf.h

[PATCH 24/33] powerpc: EXPORT_SYMBOL(.TOC.)

2014-03-25 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au For the ELFv2 ABI, powerpc introduces a magic symbol .TOC.. depmod then complains that this doesn't resolve (so does modpost, but we could easily fix that). To export this, we need to use asm. modpost and depmod both strip . from symbols for the old

[PATCH 25/33] powerpc: module: handle MODVERSION for .TOC.

2014-03-25 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au For the ELFv2 ABI, powerpc introduces a magic symbol .TOC.. If we don't create a CRC for it (minus the leading ., since we strip that) we get a modpost warning about missing CRC and the CRC array seems to be displaced by 1 so other CRCs mismatch too.

[PATCH 26/33] powerpc: Fix up TOC. for modules.

2014-03-25 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au The kernel resolved the '.TOC.' to a fake symbol, so we need to fix it up to point to our .toc section plus 0x8000. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- arch/powerpc/include/asm/module.h | 1 + arch/powerpc/kernel/module_64.c | 29

[PATCH 27/33] powerpc: Handle new ELFv2 module relocations

2014-03-25 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au The new ELF ABI tends to use R_PPC64_REL16_LO and R_PPC64_REL16_HA relocations (PC-relative), so implement them. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- arch/powerpc/include/uapi/asm/elf.h | 7 ++- arch/powerpc/kernel/module_64.c

[PATCH 28/33] powerpc: modules: comment about de-dotifying symbols when using the ELFv2 ABI.

2014-03-25 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au ELFv2 doesn't use function descriptors, so we don't expect symbols to start with .. But because depmod and modpost strip ., and we have the special symbol .TOC., we still need to do it. Signed-off-by: Rusty Russell ru...@rustcorp.com.au ---

[PATCH 29/33] powerpc: modules: change r2 save/restore offset for ELFv2 ABI.

2014-03-25 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au ELFv2 uses a different stack offset (24 vs 40) to save r2. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- arch/powerpc/kernel/module_64.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git

[PATCH 30/33] powerpc: modules: use r12 for stub jump address.

2014-03-25 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au In ELFv2, r12 is supposed to equal to PC on entry to a function. Our stubs use r11, so change swap that with r12. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- arch/powerpc/kernel/module_64.c | 10 +- 1 file changed, 5 insertions(+), 5

[PATCH 31/33] powerpc: modules: skip r2 setup for ELFv2

2014-03-25 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au ELFv2 doesn't need to set up r2 when calling a function. Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- arch/powerpc/kernel/module_64.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git

[PATCH 32/33] powerpc: modules: implement stubs for ELFv2 ABI.

2014-03-25 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au ELFv2 doesn't use function descriptors, because it doesn't need to load a new r2 when calling into a function. On the other hand, you're supposed to use a local entry point for R_PPC_REL24 branches. Signed-off-by: Rusty Russell ru...@rustcorp.com.au ---

[PATCH 33/33] powerpc: Build little endian ppc64 kernel with ABIv2

2014-03-25 Thread Anton Blanchard
Build the little endian ppc64 kernel with ABIv2 if the toolchain supports it. We can identify an ABIv2 capable toolchain by the -mabi=elfv2 compiler flag. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/Makefile | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff

Re: [PATCH v2] powerpc/powernv: Platform dump interface

2014-03-24 Thread Anton Blanchard
Hi Vasant, On 02/09/2014 02:50 AM, Anton Blanchard wrote: Hi Vasant, +static void free_dump_sg_list(struct opal_sg_list *list) +{ + struct opal_sg_list *sg1; + while (list) { + sg1 = list-next; + kfree(list); + list = sg1; + } + list = NULL

[PATCH] powerpc: Fix KVM hang with CONFIG_KVM_XICS=n

2014-03-20 Thread Anton Blanchard
-off-by: Anton Blanchard an...@samba.org Cc: sta...@vger.kernel.org --- diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 17fc949..7a25d92 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -86,7 +86,7 @@ static void kvmppc_fast_vcpu_kick_hv

[PATCH] powerpc: Use default set of netfilter modules (CONFIG_NETFILTER_ADVANCED=n)

2014-03-15 Thread Anton Blanchard
bridge module which is heavily used in KVM setups. Signed-off-by: Anton Blanchard an...@samba.org --- diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig index e015896..f26b267 100644 --- a/arch/powerpc/configs/ppc64_defconfig +++ b/arch/powerpc/configs

kvmppc_wait_for_nap warnings and KVM host+guest hang on 3.14-rc6*

2014-03-15 Thread Anton Blanchard
Hi, I was testing KVM on an upstream kernel (3.14.0-rc6-00145-ga4ecdf8) with Gregory's emulated MMIO fixes. I ran with 16 cores and 4 threads (matches the host): qemu-system-ppc64 -enable-kvm -smp cores=16,threads=4 -m 32G -M pseries -cpu POWER7 -nographic -nodefaults -monitor stdio -serial

[PATCH] powerpc: compat: 32 bit little endian machine name is ppcle, not ppc

2014-03-05 Thread Anton Blanchard
I noticed this when testing setarch. No, we don't magically support a big endian userspace on a little endian kernel. Signed-off-by: Anton Blanchard an...@samba.org Cc: sta...@vger.kernel.org # v3.10+ --- diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index

ibmveth: Fix endian issues with MAC addresses

2014-03-04 Thread Anton Blanchard
ibmveth_adapter. It's never used so remove it - we don't need another place in the driver where we create endian issues with MAC addresses. Signed-off-by: Anton Blanchard an...@samba.org Cc: sta...@vger.kernel.org --- Index: b/drivers/net/ethernet/ibm/ibmveth.c

[PATCH] powerpc: Align p_dyn, p_rela and p_st symbols

2014-03-03 Thread Anton Blanchard
The 64bit relocation code places a few symbols in the text segment. These symbols are only 4 byte aligned where they need to be 8 byte aligned. Add an explicit alignment. Signed-off-by: Anton Blanchard an...@samba.org Cc: sta...@vger.kernel.org --- diff --git a/arch/powerpc/kernel/reloc_64.S b

[PATCH 1/2] powerpc: Link VDSOs at 0x0

2014-02-11 Thread Anton Blanchard
still have some local symbol resolution issues that will be fixed in a subsequent patch. Signed-off-by: Anton Blanchard an...@samba.org --- diff --git a/arch/powerpc/include/asm/vdso.h b/arch/powerpc/include/asm/vdso.h index 0d9cecd..c53f5f6 100644 --- a/arch/powerpc/include/asm/vdso.h +++ b/arch

[PATCH 2/2] powerpc: Use unstripped VDSO image for more accurate profiling data

2014-02-11 Thread Anton Blanchard
3.20% test[.] main 2.92% test[.] 0037.plt_call.gettimeofday@@GLIBC_2.18 Signed-off-by: Anton Blanchard an...@samba.org --- diff --git a/arch/powerpc/kernel/vdso32/vdso32_wrapper.S b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S index

Re: [PATCH v2] powerpc/powernv: Platform dump interface

2014-02-08 Thread Anton Blanchard
Hi Vasant, +static void free_dump_sg_list(struct opal_sg_list *list) +{ + struct opal_sg_list *sg1; + while (list) { + sg1 = list-next; + kfree(list); + list = sg1; + } + list = NULL; +} + +/* + * Build dump buffer scatter gather

Re: [PATCH 8/8] powerpc: Fix endian issues in crash dump code

2014-01-22 Thread Anton Blanchard
Hi Michael, Not my favourite colour :D What about this instead? We could also add of_property_read_u32(), with an implied index of zero? I don't like the rc handling, but couldn't come up with anything I liked better. Thanks for pointing that out, I didn't realise we had so many

[PATCH] powerpc: Fix endian issues in kexec and crash dump code

2014-01-21 Thread Anton Blanchard
We expose a number of OF properties in the kexec and crash dump code and these need to be big endian. Cc: sta...@vger.kernel.org # v3.13 Signed-off-by: Anton Blanchard an...@samba.org -- diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index 75d4f73

Re: [PATCH] slub: Don't throw away partial remote slabs if there is no local memory

2014-01-08 Thread Anton Blanchard
Hi Andi, Thoughts? It seems like we could hit a similar situation if a machine is balanced but we run out of memory on a single node. Yes I agree, but your patch doesn't seem to attempt to handle this? It doesn't. I was hoping someone with more mm knowledge than I could suggest a

Re: [PATCH] slub: Don't throw away partial remote slabs if there is no local memory

2014-01-08 Thread Anton Blanchard
Hi David, Why not just delete the entire test? Presumably some time a little earlier no local memory was available. Even if there is some available now, it is very likely that some won't be available again in the near future. I agree, the current behaviour seems strange but it has been

Re: [PATCH] slub: Don't throw away partial remote slabs if there is no local memory

2014-01-08 Thread Anton Blanchard
Hi Wanpeng, +if (node_spanned_pages(node)) { s/node_spanned_pages/node_present_pages Thanks, I hadn't come across node_present_pages() before. Anton ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org

Re: [PATCH] powerpc: Make 64-bit non-VMX __copy_tofrom_user bi-endian

2013-12-23 Thread Anton Blanchard
Hi Michael, To try and catch any screw ups in our ppc64 memcpy and copy_tofrom_user loops, I wrote a quick test: http://ozlabs.org/~anton/junkcode/validate_kernel_copyloops.tar.gz Nice! How's this look? Love it! At the moment my other copy_to/from_user tests run against the kernel

[PATCH] ibmveth: Fix more little endian issues

2013-12-23 Thread Anton Blanchard
don't need another place in the driver where we create endian issues with MAC addresses. Signed-off-by: Anton Blanchard an...@samba.org Reviewed-by: Alexander Graf ag...@suse.de --- v2: annotate with __be64 as suggested by Joe diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net

[PATCH] powerpc: Align p_end

2013-12-22 Thread Anton Blanchard
p_end is an 8 byte value embedded in the text section. This means it is only 4 byte aligned when it should be 8 byte aligned. Fix this by adding an explicit alignment. This fixes an issue where POWER7 little endian builds with CONFIG_RELOCATABLE=y fail to boot. Signed-off-by: Anton Blanchard

Re: [PATCH] ibmveth: Fix more little endian issues

2013-12-22 Thread Anton Blanchard
in struct ibmveth_adapter. It's never used so remove it - we don't need another place in the driver where we create endian issues with MAC addresses. Reported-by: Alexander Graf ag...@suse.de Signed-off-by: Anton Blanchard an...@samba.org --- diff --git a/drivers/net/ethernet/ibm/ibmveth.c b

Re: [PATCH] powerpc: Make 64-bit non-VMX __copy_tofrom_user bi-endian

2013-12-18 Thread Anton Blanchard
Hi, [ This is a rare but nasty LE issue. Most of the time we use the POWER7 optimised __copy_tofrom_user_power7 loop, but when it hits an exception we fall back to the base __copy_tofrom_user loop. - Anton ] To try and catch any screw ups in our ppc64 memcpy and copy_tofrom_user loops, I

[PATCH] powerpc: Make 64-bit non-VMX __copy_tofrom_user bi-endian

2013-12-17 Thread Anton Blanchard
. McKenney paul...@linux.vnet.ibm.com Signed-off-by: Anton Blanchard an...@samba.org --- diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S index d73a590..596a285 100644 --- a/arch/powerpc/lib/copyuser_64.S +++ b/arch/powerpc/lib/copyuser_64.S @@ -9,6 +9,14 @@ #include asm

[PATCH] powerpc: Fix endian issues in power7/8 machine check handler

2013-12-15 Thread Anton Blanchard
The SLB save area is shared with the hypervisor and is defined as big endian, so we need to byte swap on little endian builds. Signed-off-by: Anton Blanchard an...@samba.org --- diff --git a/arch/powerpc/kernel/mce_power.c b/arch/powerpc/kernel/mce_power.c index b36e777..27c93f4 100644

[PATCH] powerpc: Make unaligned accesses endian-safe for powerpc

2013-12-15 Thread Anton Blanchard
-off-by: Anton Blanchard an...@samba.org --- diff --git a/arch/powerpc/include/asm/unaligned.h b/arch/powerpc/include/asm/unaligned.h index 5f1b1e3..8296381 100644 --- a/arch/powerpc/include/asm/unaligned.h +++ b/arch/powerpc/include/asm/unaligned.h @@ -4,13 +4,18 @@ #ifdef __KERNEL__

[PATCH] powerpc/powernv: Fix endian issue in opal_xscom_read

2013-12-12 Thread Anton Blanchard
opal_xscom_read uses a pointer to return the data so we need to byteswap it on LE builds. Signed-off-by: Anton Blanchard an...@samba.org --- diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index aded1b8..9873a26 100644 --- a/arch/powerpc/include/asm/opal.h +++ b

[PATCH 0/8] ppc64 little endian bug fixes

2013-12-11 Thread Anton Blanchard
corrupt NVRAM and end up with particular hard to fix issues, since we don't have easy ways to edit the contents of NVRAM. Fixed other endian issues in crash dump, lparcfg and MSI code. Anton Blanchard (7): powerpc: Fix endian issue in setup-common.c powerpc: Fix topology core_id endian issue on LE

[PATCH 2/8] powerpc: Fix endian issue in setup-common.c

2013-12-11 Thread Anton Blanchard
During on LE boot we see: Partition configured for 1073741824 cpus, operating system maximum is 2048. Clearly missing a byteswap here. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/setup-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 4/8] powerpc/pseries: Fix endian issues in /proc/ppc64/lparcfg

2013-12-11 Thread Anton Blanchard
Some obvious issues: cat /proc/ppc64/lparcfg ... partition_id=16777216 ... partition_potential_processors=268435456 Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/platforms/pseries/lparcfg.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch

[PATCH 3/8] powerpc: Fix topology core_id endian issue on LE builds

2013-12-11 Thread Anton Blanchard
cpu_to_core_id() is missing a byteswap: cat /sys/devices/system/cpu/cpu63/topology/core_id 201326592 Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/smp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc

[PATCH 5/8] powerpc/pseries: Fix endian issues in nvram code

2013-12-11 Thread Anton Blanchard
to read it in another we get junk. Make both of these formats big endian, and byteswap as required. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/platforms/pseries/nvram.c | 46 +- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/arch

[PATCH 6/8] powerpc/pseries: Fix PCIE link speed endian issue

2013-12-11 Thread Anton Blanchard
We need to byteswap ibm,pcie-link-speed-stats. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/platforms/pseries/pci.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index

[PATCH 7/8] powerpc/pseries: Fix endian issues in MSI code

2013-12-11 Thread Anton Blanchard
The MSI code is miscalculating quotas in little endian mode. Add required byteswaps to fix this. Before we claimed a quota of 65536, after the patch we see the correct value of 256. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/platforms/pseries/msi.c | 28

[PATCH 8/8] powerpc: Fix endian issues in crash dump code

2013-12-11 Thread Anton Blanchard
A couple more device tree properties that need byte swapping. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/crash_dump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c index

[PATCH] drivers/tty: ehv_bytechan fails to build as a module

2013-12-08 Thread Anton Blanchard
-off-by: Anton Blanchard an...@samba.org --- Index: b/drivers/tty/Kconfig === --- a/drivers/tty/Kconfig +++ b/drivers/tty/Kconfig @@ -366,7 +366,7 @@ config TRACE_SINK Trace data router for MIPI P1149.7 cJTAG standard

[PATCH 0/9] ppc64 little endian updates

2013-11-20 Thread Anton Blanchard
of function descriptors. Rusty's kernel patches allow binaries of either ABI to work, easing the transition. Alistair Popple (1): powerpc: Don't use ELFv2 ABI to build the kernel Anton Blanchard (4): powerpc/pseries: Fix endian issues in pseries EEH code pseries: Add H_SET_MODE to change exception

[PATCH 3/9] powerpc: Add TIF_ELF2ABI flag.

2013-11-20 Thread Anton Blanchard
== binaries using the new ABI. We store this in a thread flag, because we need to set it in core dumps and for signal delivery. Our chief concern is that it doesn't use function descriptors. Signed-off-by: Rusty Russell ru...@rustcorp.com.au Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc

[PATCH 5/9] powerpc: ELF2 binaries launched directly.

2013-11-20 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au No function descriptor, but we set r12 up and set TIF_RESTOREALL as it normally isn't restored on return from syscall. Signed-off-by: Rusty Russell ru...@rustcorp.com.au Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/process.c

[PATCH 6/9] powerpc: ELF2 binaries signal handling

2013-11-20 Thread Anton Blanchard
...@rustcorp.com.au Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/signal_64.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index b3c6157..e66f67b 100644 --- a/arch/powerpc

[PATCH 9/9] powerpc: Add pseries_le_defconfig

2013-11-20 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/configs/pseries_le_defconfig | 352 ++ 1 file changed, 352 insertions(+) create mode 100644 arch/powerpc/configs/pseries_le_defconfig diff --git a/arch/powerpc/configs/pseries_le_defconfig b/arch

[PATCH 1/9] powerpc/pseries: Fix endian issues in pseries EEH code

2013-11-20 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/platforms/pseries/eeh_pseries.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c index 7fbc25b

[PATCH 4/9] powerpc: Set eflags correctly for ELF ABIv2 core dumps.

2013-11-20 Thread Anton Blanchard
From: Rusty Russell ru...@rustcorp.com.au We leave it at zero (though it could be 1) for old tasks. Signed-off-by: Rusty Russell ru...@rustcorp.com.au Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/elf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch

[PATCH 2/9] pseries: Add H_SET_MODE to change exception endianness

2013-11-20 Thread Anton Blanchard
On little endian builds call H_SET_MODE so exceptions have the correct endianness. We need to reset the endian during kexec so do that in the MMU hashtable clear callback. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/include/asm/hvcall.h | 2 ++ arch/powerpc/include

[PATCH 7/9] powerpc: Don't use ELFv2 ABI to build the kernel

2013-11-20 Thread Anton Blanchard
From: Alistair Popple alist...@popple.id.au The kernel doesn't build correctly using the ELFv2 ABI. This patch ensures that the ELFv1 ABI is used when building a kernel with an ELFv2 enabled compiler. Signed-off-by: Alistair Popple alist...@popple.id.au Signed-off-by: Anton Blanchard

[PATCH 8/9] powerpc: Add CONFIG_CPU_LITTLE_ENDIAN kernel config option.

2013-11-20 Thread Anton Blanchard
With the little endian support merged, we can add the CONFIG_CPU_LITTLE_ENDIAN kernel config option. Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/platforms/Kconfig.cputype | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/powerpc/platforms/Kconfig.cputype

[PATCH] powerpc: Wrong DWARF CFI in the kernel vdso for little-endian / ELFv2

2013-11-20 Thread Anton Blanchard
, they just will be ignored. So it seems the simplest fix would be just to always provide CFI for all the fields. Signed-off-by: Ulrich Weigand ulrich.weig...@de.ibm.com Signed-off-by: Anton Blanchard an...@samba.org --- arch/powerpc/kernel/vdso64/sigtramp.S | 16 +++- 1 file changed, 15

Re: linux-next: build failure after merge of the final tree (Linus' tree related - powerpc)

2013-11-20 Thread Anton Blanchard
Hi, After merging the final tree, today's linux-next build (powerpc allyesconfig) failed like this: stdin:1:0: error: -mcall-aixdesc must be big endian Urgh, allyesconfig is building an LE kernel. Ian: do we need to reverse the polarity of the option, and call it CONFIG_CPU_BIG_ENDIAN?

[PATCH] powerpc: allyesconfig should not select CONFIG_CPU_LITTLE_ENDIAN

2013-11-20 Thread Anton Blanchard
Stephen reported a failure in an allyesconfig build. CONFIG_CPU_LITTLE_ENDIAN=y gets set but his toolchain is not new enough to support little endian. We really want to default to a big endian build; Ben suggested using a choice which defaults to CPU_BIG_ENDIAN. Signed-off-by: Anton Blanchard

[PATCH] powerpc: Only print PACATMSCRATCH in oops when TM is active

2013-11-17 Thread Anton Blanchard
If TM is not active there is no need to print PACATMSCRATCH so we can save ourselves a line. Signed-off-by: Anton Blanchard an...@samba.org --- Index: b/arch/powerpc/kernel/process.c === --- a/arch/powerpc/kernel/process.c +++ b

[PATCH] powerpc: ppc64 address space capped at 32TB, mmap randomisation disabled

2013-11-17 Thread Anton Blanchard
and the top of our mmap region is clamped at 32TB This also breaks mmap randomisation since the randomised address is always up near the top of the address space and it gets clamped down to 32TB. Cc: sta...@vger.kernel.org # v3.10+ Signed-off-by: Anton Blanchard an...@samba.org --- diff --git a/arch

[PATCH] powerpc/pseries: duplicate dtl entries sometimes sent to userspace

2013-11-16 Thread Anton Blanchard
the index. To fix this I moved dtl_consumer() after the timebase comparison. Signed-off-by: Anton Blanchard an...@samba.org Cc: sta...@vger.kernel.org --- Index: b/arch/powerpc/kernel/time.c === --- a/arch/powerpc/kernel/time.c +++ b

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

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

2013-11-14 Thread Anton Blanchard
in the stack trace section. Signed-off-by: Anton Blanchard an...@samba.org --- 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

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 switches

[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 an...@samba.org --- diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 6704e2e..c2a566f 100644 --- a/arch

[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 an...@samba.org --- Index: b/arch/powerpc/configs/ppc64_defconfig === --- a/arch/powerpc/configs/ppc64_defconfig +++ b/arch/powerpc/configs

[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 an...@samba.org --- Index: b/arch/powerpc/configs/pseries_defconfig === --- a/arch/powerpc/configs/pseries_defconfig +++ b/arch/powerpc

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

2013-10-21 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- 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

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

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

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

2013-10-17 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org --- 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

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

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

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 displayed on a

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

2013-10-01 Thread Anton Blanchard
a quantum implementation of PowerPC, this commit instead uses register r9 to do the adjusting, leaving r7's pointer uncorrupted. Signed-off-by: Paul E. McKenney paul...@linux.vnet.ibm.com Signed-off-by: Anton Blanchard an...@samba.org Cc: sta...@vger.kernel.org --- Index: b/arch/powerpc/lib

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

2013-10-01 Thread Anton Blanchard
of these registers 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 paul...@linux.vnet.ibm.com Signed-off-by: Anton Blanchard an...@samba.org Cc: sta...@vger.kernel.org

[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 an...@samba.org --- Index: b/arch/powerpc/platforms/powernv/setup.c === --- a/arch/powerpc/platforms

[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 an...@samba.org --- Index: le-kernel/arch/powerpc/include/asm/xor.h

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

2013-09-22 Thread Anton Blanchard
for 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 an...@samba.org --- arch/powerpc/lib/copyuser_power7.S | 54 + arch/powerpc/lib/memcpy_power7.S | 55 ++ 2 files changed, 63 insertions(+), 46

[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 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

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

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

2013-09-22 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 06/39] powerpc: Support endian agnostic MMIO

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

[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 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 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 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 10/39] powerpc: Include the appropriate endianness header

2013-09-22 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 11/39] powerpc: endian safe trampoline

2013-09-22 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 | 3 +++ 3 files changed, 53 insertions(+), 17 deletions(-) diff --git

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

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

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

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

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

[PATCH 20/39] powerpc: Little endian fixes for platforms/powernv/opal.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/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

[PATCH 21/39] powerpc: Little endian fix for arch/powerpc/platforms/powernv/pci.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.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

[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 alist...@popple.id.au Signed-off-by: Alistair Popple alist...@popple.id.au --- 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

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