[PATCH] powerpc/pseries: Quieten relocation on exceptions warning

2014-11-02 Thread Anton Blanchard
exceptions), it has been now added on some POWER7 configurations (which does not). Check for H_P2 and print an informational message instead. Signed-off-by: Anton Blanchard --- arch/powerpc/platforms/pseries/setup.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch

[PATCH] powerpc: Add ppc64 hard lockup detector support

2014-11-04 Thread Anton Blanchard
ns we might take multiple PMU exceptions per second per hardware thread even if our hard lockup timeout is 10 seconds. It can be enabled via a boot option, or via procfs. Signed-off-by: Anton Blanchard --- arch/Kconfig | 2 +- arch/powerpc/Kconfig | 1 + arch/po

[PATCH] powerpc: Bad NULL pointer check in udbg_uart_getc_poll

2014-11-10 Thread Anton Blanchard
Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/udbg_16550.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c index 6e7c492..3faf393 100644 --- a/arch/powerpc/kernel/udbg_16550.c +++ b/arch/powe

[PATCH] powerpc: 32 bit getcpu VDSO function uses 64 bit instructions

2014-11-26 Thread Anton Blanchard
I used some 64 bit instructions when adding the 32 bit getcpu VDSO function. Fix it. Fixes: 18ad51dd342a ("powerpc: Add VDSO version of getcpu") Cc: sta...@vger.kernel.org Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/vdso32/getcpu.S | 4 ++-- 1 file changed, 2 insert

KVM XICS bug

2014-11-30 Thread Anton Blanchard
Hi, I've been seeing intermittent hangs when booting a KVM guest on a busy box. Both host and guest are mainline (3.18-rc6). The backtrace looks like: INFO: rcu_sched self-detected stall on CPU { 7} (t=8404 jiffies g=-299 c=-300 q=79) Task dump for CPU 7: swapper/7 R running task1184

[PATCH] KVM: PPC: Enable in kernel XICS emulation by default

2014-11-30 Thread Anton Blanchard
The in kernel XICS emulation is faster than doing it all in QEMU and it has got a lot of testing, so enable it by default Signed-off-by: Anton Blanchard --- arch/powerpc/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig index

[PATCH] kthread: kthread_bind fails to enforce CPU affinity (fixes kernel BUG at kernel/smpboot.c:134!)

2014-12-07 Thread Anton Blanchard
t of task_thread_info(p)->cpu. Fixes: e2912009fb7b ("sched: Ensure set_task_cpu() is never called on blocked tasks") Cc: sta...@vger.kernel.org Signed-off-by: Anton Blanchard --- kernel/kthread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/kthread.c b/kern

Re: [PATCH] kthread: kthread_bind fails to enforce CPU affinity (fixes kernel BUG at kernel/smpboot.c:134!)

2014-12-07 Thread Anton Blanchard
Hi Linus, > The __set_task_cpu() function does various other things too: > > set_task_rq(p, cpu); > #ifdef CONFIG_SMP > /* > * After ->cpu is set up to a new value, task_rq_lock(p, ...) > can be > * successfuly executed on another CPU. We must ensure that > up

Re: [PATCH] kthread: kthread_bind fails to enforce CPU affinity (fixes kernel BUG at kernel/smpboot.c:134!)

2014-12-08 Thread Anton Blanchard
Hi Ingo, > So we cannot call set_task_cpu() because in the normal life time > of a task the ->cpu value gets set on wakeup. So if a task is > blocked right now, and its affinity changes, it ought to get a > correct ->cpu selected on wakeup. The affinity mask and the > current value of ->cpu g

[PATCH] powerpc: secondary CPUs signal to master before setting active and online (fixes kernel BUG at kernel/smpboot.c:134!)

2014-12-08 Thread Anton Blanchard
he active and online bits aren't set we choose some other CPU to run on. Cc: sta...@vger.kernel.org Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/smp.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c ind

Re: [PATCH 1/3] powerpc: Don't use local named register variable in current_thread_info

2014-12-16 Thread Anton Blanchard
Hi Alex, > Git bisect managed to point me to this commit as the offender for > OOPSes on e5500 and e6500 (and maybe the G4 as well, not sure). > > Doing a git revert of this commit on top of linus/master makes things > work fine for me again. Ouch, sorry for that, I'll work to reproduce. What gc

Re: [1/5] powerpc: Fix handling of DSCR related facility unavailable exception

2014-12-17 Thread Anton Blanchard
Hi Anshuman, > Yeah I wanted to convert all these tests which are related to DSCR > into individual self tests for powerpc. All these test cases have > Anton Blanchard and IBM's copyright on it but they are licensed with > GPL V2. Not sure whether Anton needs to okay this be

Re: [PATCH 1/3] powerpc: Don't use local named register variable in current_thread_info

2014-12-17 Thread Anton Blanchard
On Thu, 18 Dec 2014 16:11:54 +1100 Michael Ellerman wrote: > On Wed, 2014-12-17 at 02:16 +0100, Alexander Graf wrote: > > On 31.10.14 04:47, Anton Blanchard wrote: > > > LLVM doesn't support local named register variables and is > > > unlikely to. current_thr

[PATCH] powernv: Fix OPAL tracepoint code

2015-01-06 Thread Anton Blanchard
9f63530bb6 ("powernv: Add OPAL tracepoints") Cc: # v3.17+ Signed-off-by: Anton Blanchard --- arch/powerpc/platforms/powernv/opal-wrappers.S | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S in

[PATCH 1/2] jump_label: Allow jump labels to be used in assembly

2015-01-06 Thread Anton Blanchard
To use jump labels in assembly we need the HAVE_JUMP_LABEL define, so we select a fallback version if the toolchain does not support them. Modify linux/jump_label.h so it can be included by assembly files. We also need to add -DCC_HAVE_ASM_GOTO to KBUILD_AFLAGS. Signed-off-by: Anton Blanchard

[PATCH 2/2] powerpc: Include linux/jump_label.h to get HAVE_JUMP_LABEL define

2015-01-06 Thread Anton Blanchard
c9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL") Signed-off-by: Anton Blanchard --- arch/powerpc/platforms/pseries/hvCall.S | 2 +- arch/powerpc/platforms/pseries/lpar.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/ar

Re: [PATCH 1/3] powerpc: Don't use local named register variable in current_thread_info

2015-01-06 Thread Anton Blanchard
Hi Alan, > Right. This is really an rs6000 backend bug. We describe one of the > indirect calls that go wrong here as > > (call_insn 108 107 109 13 (parallel [ > (set (reg:DI 3 3) > (call (mem:SI (reg:DI 288) [0 *_67 S4 A8]) > (const_int 64 [0x40]

Re: [PATCH 1/2] jump_label: Allow jump labels to be used in assembly

2015-01-07 Thread Anton Blanchard
Hi Steve, > Have you tested this on other archs? Because just looking at x86, it > doesn't seem that asm/jump_label.h can handle being called in > assembly. Since no one is including linux/jump_label.h in assembly yet, nothing should break. We could however add __ASSEMBLY__ protection to all the

[PATCH 1/3] jump_label: Allow asm/jump_label.h to be included in assembly

2015-01-07 Thread Anton Blanchard
(see ARCH_STATIC_BRANCH in the powerpc asm/jump_label.h for an example). Signed-off-by: Anton Blanchard --- arch/arm/include/asm/jump_label.h | 5 ++--- arch/arm64/include/asm/jump_label.h | 8 arch/mips/include/asm/jump_label.h | 7 +++ arch/s390/include/asm/jump_label.h | 3 +++

[PATCH 2/3] jump_label: Allow jump labels to be used in assembly

2015-01-07 Thread Anton Blanchard
To use jump labels in assembly we need the HAVE_JUMP_LABEL define, so we select a fallback version if the toolchain does not support them. Modify linux/jump_label.h so it can be included by assembly files. We also need to add -DCC_HAVE_ASM_GOTO to KBUILD_AFLAGS. Signed-off-by: Anton Blanchard

[PATCH 3/3] powerpc: Include linux/jump_label.h to get HAVE_JUMP_LABEL define

2015-01-07 Thread Anton Blanchard
c9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL") Signed-off-by: Anton Blanchard --- arch/powerpc/platforms/powernv/opal-wrappers.S | 2 +- arch/powerpc/platforms/pseries/hvCall.S| 2 +- arch/powerpc/platforms/pseries/lpar.c | 1 + 3 files changed, 3 insertions(+), 2 dele

[PATCH 1/2] powerpc: Add 64bit optimised memcmp

2015-01-08 Thread Anton Blanchard
Just over 17x faster. Signed-off-by: Anton Blanchard --- arch/powerpc/lib/Makefile| 3 +- arch/powerpc/lib/memcmp_64.S | 233 +++ arch/powerpc/lib/string.S| 2 + 3 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 arch

[PATCH 2/2] powerpc: Add memcmp testcase

2015-01-08 Thread Anton Blanchard
Add a testcase for the new ppc64 memcmp. Signed-off-by: Anton Blanchard --- .../testing/selftests/powerpc/stringloops/Makefile | 21 + .../selftests/powerpc/stringloops/asm/ppc_asm.h| 7 ++ .../selftests/powerpc/stringloops/memcmp_64.S | 1 + .../selftests/powerpc/stringloops

Re: [PATCH 1/2] powerpc: Add 64bit optimised memcmp

2015-01-11 Thread Anton Blanchard
Hi David, > The unrolled loop (deleted) looks excessive. > On a modern cpu with multiple execution units you can usually > manage to get the loop overhead to execute in parallel to the > actual 'work'. > So I suspect that a much simpler 'word at a time' loop will be > almost as fast - especially i

[PATCH] powerpc: Align p_toc

2013-04-28 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 --- Index: b/arch/powerpc/kernel/head_64.S

Re: [PATCH net-next] af_unix: fix a fatal race with bit fields

2013-04-30 Thread Anton Blanchard
Hi Eric, > From: Eric Dumazet > > Using bit fields is dangerous on ppc64, as the compiler uses 64bit > instructions to manipulate them. If the 64bit word includes any > atomic_t or spinlock_t, we can lose critical concurrent changes. > > This is happening in af_unix, where unix_sk(sk)->gc_candi

[PATCH] powerpc: Emulate non privileged DSCR read and write

2013-05-01 Thread Anton Blanchard
one. A simple test was created to verify the fix: http://ozlabs.org/~anton/junkcode/user_dscr_test.c Without the patch we get a SIGILL and it passes with the patch. Signed-off-by: Anton Blanchard Cc: --- Index: b/arch/powerpc/include/asm/ppc-opcode.h

[PATCH] powerpc/kexec: Fix kexec when using VMX optimised memcpy

2013-05-12 Thread Anton Blanchard
that too. Signed-off-by: Anton Blanchard Cc: # 3.6+ --- Index: b/arch/powerpc/kernel/machine_kexec_64.c === --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c @@ -17,6 +17,7 @@ #include

Re: [PATCH] powerpc: provide __bswapdi2

2013-05-12 Thread Anton Blanchard
On Fri, 10 May 2013 22:18:27 +0100 David Woodhouse wrote: > From: David Woodhouse > > 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 should ever emit a call to __bswapdi2. Did you

[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 --- Index: b/arch/powerpc/include/asm/processor.h === --- a/arch/powe

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 compat_s

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

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

2013-07-14 Thread Anton Blanchard
t from the CRCs in that case. Signed-off-by: Anton Blanchard Cc: --- 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/powerpc/includ

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 https://lists.ozlabs.org/li

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

[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 --- It might be worth doing this somewhere common, but the only place I could find (unflatten_device_tree) is almost

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

2013-07-24 Thread Anton Blanchard
pool to provide better random data during early boot, so do the same with the flattened device tree. Signed-off-by: Anton Blanchard --- 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-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 l

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 didn

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 --- v3: Fix endian iss

[PATCH] powerpc: handle unaligned ldbrx/stdbrx

2013-07-30 Thread Anton Blanchard
se to catch ldbrx/stdbrx. Signed-off-by: Anton Blanchard Cc: --- Index: b/arch/powerpc/kernel/align.c === --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc/kernel/align.c @@ -764,6 +764,16 @@ int fix_alignment(struct pt_regs

[PATCH] powerpc: Wrap MSR macros with parentheses

2013-07-30 Thread Anton Blanchard
Not having parentheses around a macro is asking for trouble. Signed-off-by: Anton Blanchard --- Index: b/arch/powerpc/include/asm/reg.h === --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h @@ -115,10

[PATCH] powerpc: Align p_toc

2013-07-30 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 --- Index: b/arch/powerpc/kernel/head_64.S

[PATCH] powerpc: Remove SAVE_VSRU and REST_VSRU macros

2013-07-30 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 --- Index: b/arch/powerpc/include/asm/ppc_asm.h === --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch

[PATCH] powerpc: On POWERNV enable PPC_DENORMALISATION by default

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

[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

Re: [RFC PATCH] powerpc/numa: initialize distance lookup table from drconf path

2015-06-22 Thread Anton Blanchard
Hi Nikunj, > From: Nikunj A Dadhania > > powerpc/numa: initialize distance lookup table from drconf path > > In some situations, a NUMA guest that supports > ibm,dynamic-memory-reconfiguration node will end up having flat NUMA > distances between nodes. This is because of two problems in the >

Re: [RFC PATCH] powerpc/numa: initialize distance lookup table from drconf path

2015-07-01 Thread Anton Blanchard
Hi Nikunj, > > Thanks for the patch. Have we tested that this doesn't regress the > > non dynamic representation? > > Yes, that is tested. And works as expected. Great, you can add: Acked-by: Anton Blanchard Anton ___ Li

[PATCH] powerpc: Add plain English description for alignment exception oopses

2015-07-01 Thread Anton Blanchard
If we take an alignment exception which we cannot fix, the oops currently prints: Unable to handle kernel paging request for unknown fault Lets print something more useful: Unable to handle kernel paging request for unaligned access at address 0xc000f77bba8f Signed-off-by: Anton Blanchard

[PATCH] powerpc: Remove mtmsrd(), use existing mtmsr()

2015-07-06 Thread Anton Blanchard
mtmsr() does the right thing on 32bit and 64bit, so use it everywhere. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/reg.h | 3 +-- arch/powerpc/oprofile/op_model_power4.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm

Re: [kexec-lite PATCH] trampoline: Reset primary cpu endian to big-endian

2015-07-07 Thread Anton Blanchard
Hi Sam, > Older big-endian ppc64 kernels don't include the FIXUP_ENDIAN check, > meaning if we kexec from a little-endian kernel the target kernel will > fail to boot. > Returning to big-endian before we enter the target kernel ensures that > the target kernel can boot whether or not it includes F

Re: [kexec-lite PATCH V2] trampoline: Reset primary cpu endian to big-endian

2015-07-08 Thread Anton Blanchard
Hi Scott, > Is kexec-lite meant to be specific to book3s-64? It was originally built to test book3s-64 kexec. Likely some other issues need fixing for other ppc sub arches, but it is nice to have a very simple kexec. Anton ___ Linuxppc-dev mailing lis

Re: [PATCH] Fix crash due to processing "memory-controller" nodes as "memory"

2015-07-20 Thread Anton Blanchard
Hi Ian, > From: Ian Munsie > > If the system has a PCI device with a memory-controller device node, > kexec-lite would spew hundreds of double free warnings and eventually > segfault. This would result in a "kexec load failed" message from > petitboot. > > This was due to kexec_memory_map() sea

Re: [PATCH] Fix crash due to processing "memory-controller" nodes as "memory"

2015-07-21 Thread Anton Blanchard
... memory-controller@0 { reg = <0x1 0x0 0x0 0x0 0x0>; ... }; }; }; }; Signed-off-by: Ian Munsie Signed-off-by: Anton Blanchard --- kexec_memory_map.c | 6 +++--- 1 file changed,

Re: [PATCH] Fix crash due to processing "memory-controller" nodes as "memory"

2015-07-21 Thread Anton Blanchard
Hi Ian, > > > > Nice catch! I wonder if we should be checking for device_type > > > > "memory". Ben? > > > > > > Yes. That's what Linux does. > > > > Ian: I made that change, and slightly modified your commit message. > > Look ok? > > Looks good to me :) Excellent, I just pushed the fix. Anto

[PATCH 1/3] powerpc: No need to disable kernel FP/VMX/VSX MSR bits on context switch

2015-07-25 Thread Anton Blanchard
kcode/context_switch2.c ./context_switch2 --type=yield --fp 0 0 shows an improvement of almost 3% on POWER8. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/entry_64.S | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/arch/powerpc/kernel/entry_64.S b

[PATCH 2/3] powerpc: Create context switch helpers save_sprs() and restore_sprs()

2015-07-25 Thread Anton Blanchard
can do. - SPR writes are slow, so check that the value is changing before writing it. A context switch microbenchmark using yield(): http://ozlabs.org/~anton/junkcode/context_switch2.c ./context_switch2 --type=yield 0 0 shows an improvement of almost 10% on POWER8. Signed-off-by: Anton Blanchard

[PATCH 3/3] powerpc: Remove redundant mflr in _switch

2015-07-25 Thread Anton Blanchard
No need to execute mflr twice. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/entry_64.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 8428280..f8779f2 100644 --- a/arch/powerpc/kernel

RFC: Reducing the number of non volatile GPRs in the ppc64 kernel

2015-08-04 Thread Anton Blanchard
io is right), but this gives us something to play with. Anton powerpc: Reduce the number of non volatiles GPRs to 8 This requires a hacked gcc. Signed-off-by: Anton Blanchard -- Index: linux.junk/arch/powerpc/include/asm/exception-

Re: RFC: Reducing the number of non volatile GPRs in the ppc64 kernel

2015-08-09 Thread Anton Blanchard
Hi Bill, Segher, > I agree with Segher. We already know we have opportunities to do a > better job with shrink-wrapping (pushing this kind of useless > activity down past early exits), so having examples of code to look > at to improve this would be useful. I'll look out for specific examples. I

Re: RFC: Reducing the number of non volatile GPRs in the ppc64 kernel

2015-08-13 Thread Anton Blanchard
Hi, Here is another instruction trace from a kernel context switch trace. Quite a lot of register and CR save/restore code. Regards, Anton c02943d8 mfcrr12 c02943dc std r20,-96(r1) c02943e0 std r21,-88(r1) c02943e4 rldicl. r9,r4,63,63 c0294

[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 --- arch/powerpc/kernel/head_64.S | 1 + 1 file changed, 1 insertion(+) diff --git

[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 --- 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/include/asm/reg.h b

[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 --- 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/include/asm

[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 --- arch/powerpc/kernel/legacy_serial.c | 2 +- arch/powerpc/kernel/pci-common.c| 4 ++-- arch/powerpc/kernel/pci_64.c| 2 +- arch/powerpc/kernel/setup_64

[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 --- arch/powerpc/include/uapi/asm/elf.h | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/include/uapi/asm/elf.h b

[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 --- arch/powerpc/platforms/pseries/hvconsole.c | 12 +--- arch/powerpc/platforms/ps

[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 --- 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/asm/pci

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

2013-08-06 Thread Anton Blanchard
From: Ian Munsie 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 Acked-by: Grant Likely --- arch/powerpc

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

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

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

2013-08-06 Thread Anton Blanchard
From: Alistair Popple Signed-off-by: Alistair Popple --- 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 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/k

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

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard --- 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/arch/powerpc

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

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard --- 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 +++ b/arch

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

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard --- 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-common.c +++ b

[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 --- arch/powerpc/include/asm/rtas.h | 8 arch/powerpc/kernel/rtas.c | 38 +++--- 2 files changed, 23 insertions

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

2013-08-06 Thread Anton Blanchard
se to catch ldbrx/stdbrx. Signed-off-by: Anton Blanchard Cc: --- 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/kernel/align.c +++ b/arch/powerpc/k

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

2013-08-06 Thread Anton Blanchard
From: Alistair Popple Signed-off-by: Alistair Popple --- 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 ee0e055..3d261c0 100644 --- a/arch/powerpc/kernel

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

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard --- 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/powerpc/sysdev/xics

[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 --- 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 index 65ab9e9

[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 --- 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 +++ b/arch

[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 --- arch/powerpc/include/asm/prom.h| 5 +++-- arch

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

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

[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 --- 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 @@ -404,7

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

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard --- 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 index 22fe401

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

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard --- 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 +++ b/arch

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

2013-08-06 Thread Anton Blanchard
Signed-off-by: Anton Blanchard --- 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 +++ b/arch

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

2013-08-06 Thread Anton Blanchard
From: Alistair Popple Signed-off-by: Alistair Popple --- 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 af1c63f..179beea 100644 --- a/arch/powerpc/kern

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

2013-08-06 Thread Anton Blanchard
From: Alistair Popple 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 --- arch/powerpc/mm/numa.c | 100 + 1 file changed, 5

[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 --- arch/powerpc/include/asm/asm-compat.h

[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 --- 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 100644 --- a/arch

[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 --- 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 --- a/arch/powerpc

[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 --- 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 89fa042..7e39c91

[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 --- arch/powerpc/include/asm/paca.h | 5 + arch/powerpc

[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 --- arch/powerpc/lib/copyuser_power7.S | 54 + arch/powerpc/lib/memcpy_power7.S | 55 ++ 2 files changed, 63 insertions(+), 46 deletions(-) diff

[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 --- arch/powerpc/kernel/ptrace.c | 8 1

[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 --- 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 deletions(-) diff

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

2013-08-06 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 40/63] powerpc: Support endian agnostic MMIO

2013-08-06 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

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