[PATCH 0/7] Serialise oopses, BUGs, WARNs, dump_stack, soft lockups and hard lockups

2015-02-23 Thread Anton Blanchard
the series: A trivial module to create concurrent WARNs, BUGs and oopses: http://ozlabs.org/~anton/junkcode/warnstorm.tar.gz And one to create concurrent soft and hard lockups: http://ozlabs.org/~anton/junkcode/badguy.tar.gz Anton Blanchard (7): Add die_spin_lock_{irqsave,irqrestore

[PATCH 1/7] Add die_spin_lock_{irqsave,irqrestore}

2015-02-23 Thread Anton Blanchard
Many architectures have their own oops locking code that allows the lock to be taken recursively. Create a common version. Avoid creating generic locking functions, so they can't be abused in other parts of the kernel. Signed-off-by: Anton Blanchard --- include/linux/die_lock.h

[PATCH 2/7] powerpc: Use die_spin_lock_{irqsave,irqrestore}

2015-02-23 Thread Anton Blanchard
Replace the powerpc specific oops locking with the common one. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/traps.c | 24 +++- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 19e4744

[PATCH 3/7] arm: Use die_spin_lock_{irqsave,irqrestore}

2015-02-23 Thread Anton Blanchard
Replace the ARM specific oops locking with the common one. Signed-off-by: Anton Blanchard --- arch/arm/kernel/traps.c | 26 +++--- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 788e23f..3e3469d 100644

[PATCH 5/7] watchdog: Serialise soft lockup errors with die_spin_lock_{irqsave, irqrestore}

2015-02-23 Thread Anton Blanchard
A simple kernel module was used to create concurrent soft and hard lockups: http://ozlabs.org/~anton/junkcode/badguy.tar.gz Signed-off-by: Anton Blanchard --- kernel/watchdog.c | 4 1 file changed, 4 insertions(+) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 70bf118..dd161e3

[PATCH 4/7] x86: Use die_spin_lock_{irqsave,irqrestore}

2015-02-23 Thread Anton Blanchard
Replace the x86 specific oops locking with the common one. Signed-off-by: Anton Blanchard --- arch/x86/kernel/dumpstack.c | 26 +++--- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index b74ebc7

[PATCH 6/7] dump_stack: Serialise dump_stack with die_spin_lock_{irqsave, irqrestore}

2015-02-23 Thread Anton Blanchard
Remove another version of a recursive lock in dump_stack. Signed-off-by: Anton Blanchard --- lib/dump_stack.c | 40 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/lib/dump_stack.c b/lib/dump_stack.c index 6745c62..f64ee3c 100644 --- a/lib

[PATCH 7/7] powerpc: Serialise BUG and WARNs with die_spin_lock_{irqsave, irqrestore}

2015-02-23 Thread Anton Blanchard
A simple kernel module was used to create concurrent WARNs and BUGs: http://ozlabs.org/~anton/junkcode/warnstorm.tar.gz Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/traps.c | 44 1 file changed, 36 insertions(+), 8 deletions(-) diff --git

Re: [kexec-lite 1/3] Add dependencies to the readme

2015-09-09 Thread Anton Blanchard
Thanks Joel, all three applied! Anton ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] purgatory/arch/ppc64: Reset primary cpu endian to big-endian

2015-09-09 Thread Anton Blanchard
rget kernel can boot whether or not it includes > > FIXUP_ENDIAN. > > > > This mirrors commit 150b14e7 in kexec-lite. > > > > Signed-off-by: Samuel Mendoza-Jonas > > I would value a review from one of the PPC folks. Looks good to me. You can add: Acked-by: A

Re: -mprofile-kernel vs. notrace in ppc64(le) Linux kernels

2015-09-26 Thread Anton Blanchard
Hi, > On Sat, Sep 26, 2015 at 04:30:08PM +0200, Torsten Duwe wrote: > > As I mentioned earlier this year, it's a bad idea to call _mcount > > from MMU helper functions (e.g. hash_page...), when the > > profiling/tracing/ live-patching/whatever framewok might in turn > > cause another such fault. J

[PATCH 01/19] powerpc: Don't disable kernel FP/VMX/VSX MSR bits on context switch

2015-10-27 Thread Anton Blanchard
microbenchmark using yield(): http://ozlabs.org/~anton/junkcode/context_switch2.c ./context_switch2 --test=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

[PATCH 02/19] powerpc: Don't disable MSR bits in do_load_up_transact_*() functions

2015-10-27 Thread Anton Blanchard
Similar to the non TM load_up_*() functions, don't disable the MSR bits on the way out. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/fpu.S| 4 arch/powerpc/kernel/vector.S | 4 2 files changed, 8 deletions(-) diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/k

[PATCH 03/19] powerpc: Create context switch helpers save_sprs() and restore_sprs()

2015-10-27 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 --test=yield 0 0 shows an improvement of almost 10% on POWER8. Signed-off-by: Anton Blanchard

[PATCH 04/19] powerpc: Remove redundant mflr in _switch

2015-10-27 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 e84e5bc..c8b4225 100644 --- a/arch/powerpc/kernel

[PATCH 05/19] powerpc: Remove UP only lazy floating point and vector optimisations

2015-10-27 Thread Anton Blanchard
UP and SMP, but in preparation for that remove these UP only optimisations. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/processor.h | 6 -- arch/powerpc/include/asm/switch_to.h | 8 --- arch/powerpc/kernel/fpu.S| 35 --- arch/powerpc/kernel/head_fsl_booke.S

[PATCH 06/19] powerpc: Simplify TM restore checks

2015-10-27 Thread Anton Blanchard
Instead of having multiple giveup_*_maybe_transactional() functions, separate out the TM check into a new function called check_if_tm_restore_required(). This will make it easier to optimise the giveup_*() functions in a subsequent patch. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel

[PATCH 07/19] powerpc: Create mtmsrd_isync()

2015-10-27 Thread Anton Blanchard
mtmsrd_isync() will do an mtmsrd followed by an isync on older processors. On newer processors we avoid the isync via a feature fixup. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/reg.h | 8 arch/powerpc/kernel/process.c | 30 ++ 2 files

[PATCH 08/19] powerpc: Remove NULL task struct pointer checks in FP and vector code

2015-10-27 Thread Anton Blanchard
We used to allow giveup_*() to be called with a NULL task struct pointer. Now those cases are handled in the caller we can remove the checks. We can also remove giveup_altivec_notask() which is also unused. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/switch_to.h | 1 - arch

[PATCH 09/19] powerpc: Move part of giveup_fpu,altivec,spe into c

2015-10-27 Thread Anton Blanchard
Move the MSR modification into new c functions. Removing it from the low level functions will allow us to avoid costly MSR writes by batching them up. Move the check_if_tm_restore_required() check into these new functions. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/switch_to.h

[PATCH 10/19] powerpc: Move part of giveup_vsx into c

2015-10-27 Thread Anton Blanchard
functions, and allows us to use flush_vsx_to_thread() in the signal code. Move the check_if_tm_restore_required() check in. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/process.c | 28 +++- arch/powerpc/kernel/signal_32.c | 4 ++-- arch/powerpc/kernel/signal_64.c

[PATCH 11/19] crypto: vmx: Only call enable_kernel_vsx()

2015-10-27 Thread Anton Blanchard
With the recent change to enable_kernel_vsx(), we no longer need to call enable_kernel_fp() and enable_kernel_altivec(). Signed-off-by: Anton Blanchard --- drivers/crypto/vmx/aes.c | 3 --- drivers/crypto/vmx/aes_cbc.c | 3 --- drivers/crypto/vmx/aes_ctr.c | 3 --- drivers/crypto/vmx

[PATCH 12/19] powerpc: Create msr_check_and_{set,clear}()

2015-10-27 Thread Anton Blanchard
Create helper functions to set and clear MSR bits after first checking if they are already set. Grouping them will make it easy to avoid the MSR writes in a subsequent optimisation. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/process.c | 107

[PATCH 13/19] powerpc: Create disable_kernel_{fp,altivec,vsx,spe}()

2015-10-27 Thread Anton Blanchard
for a debug boot option that does this and catches bad uses in other areas of the kernel. Signed-off-by: Anton Blanchard --- arch/powerpc/crypto/aes-spe-glue.c | 1 + arch/powerpc/crypto/sha1-spe-glue.c | 1 + arch/powerpc/crypto/sha256-spe-glue.c| 1 + arch/powerpc/includ

[PATCH 14/19] powerpc: Add ppc_strict_facility_enable boot option

2015-10-27 Thread Anton Blanchard
Add a boot option that strictly manages the MSR unavailable bits. This catches kernel uses of FP/Altivec/SPE that would otherwise corrupt user state. Signed-off-by: Anton Blanchard --- Documentation/kernel-parameters.txt | 6 ++ arch/powerpc/include/asm/reg.h | 9 + arch

[PATCH 15/19] powerpc: Remove fp_enable() and vec_enable(), use msr_check_and_{set, clear}()

2015-10-27 Thread Anton Blanchard
More consolidation of our MSR available bit handling. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/processor.h | 2 -- arch/powerpc/kernel/fpu.S| 16 arch/powerpc/kernel/process.c| 6 -- arch/powerpc/kernel/vector.S | 10

[PATCH 16/19] powerpc: create giveup_all()

2015-10-27 Thread Anton Blanchard
improvement of 3% on POWER8. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/switch_to.h | 1 + arch/powerpc/kernel/process.c| 75 arch/powerpc/kvm/book3s_pr.c | 17 +--- 3 files changed, 63 insertions(+), 30 deletions(-) diff

[PATCH 17/19] powerpc: create flush_all_to_thread()

2015-10-27 Thread Anton Blanchard
Create a single function that flushes everything (FP, VMX, VSX, SPE). Doing this all at once means we only do one MSR write. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/switch_to.h | 1 + arch/powerpc/kernel/process.c| 22 ++ arch/powerpc/kvm

[PATCH 18/19] powerpc: Rearrange __switch_to()

2015-10-27 Thread Anton Blanchard
Most of __switch_to() is housekeeping, TLB batching, timekeeping etc. Move these away from the more complex and critical context switching code. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/process.c | 52 +-- 1 file changed, 26 insertions

[PATCH 19/19] powerpc: clean up asm/switch_to.h

2015-10-27 Thread Anton Blanchard
Remove a bunch of unnecessary fallback functions and group things in a more logical way. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/switch_to.h | 39 ++-- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/arch/powerpc/include/asm

Re: [PATCH 3/9] powerpc32: checksum_wrappers_64 becomes checksum_wrappers

2015-10-28 Thread Anton Blanchard
Hi Scott, > I wonder why it was 64-bit specific in the first place. I think it was part of a series where I added my 64bit assembly checksum routines, and I didn't step back and think that the wrapper code would be useful on 32 bit. Anton ___ Linuxppc-

[PATCH 00/19] Context switch improvements

2015-10-28 Thread Anton Blanchard
sister functions. Scott: There are changes to the SPE code here which I have only been able to compile test. Anton -- Anton Blanchard (19): powerpc: Don't disable kernel FP/VMX/VSX MSR bits on context switch powerpc: Don't disable MSR bits in do_load_up_transact_*() functions power

[PATCH 01/19] powerpc: Don't disable kernel FP/VMX/VSX MSR bits on context switch

2015-10-28 Thread Anton Blanchard
microbenchmark using yield(): http://ozlabs.org/~anton/junkcode/context_switch2.c ./context_switch2 --test=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

[PATCH 02/19] powerpc: Don't disable MSR bits in do_load_up_transact_*() functions

2015-10-28 Thread Anton Blanchard
Similar to the non TM load_up_*() functions, don't disable the MSR bits on the way out. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/fpu.S| 4 arch/powerpc/kernel/vector.S | 4 2 files changed, 8 deletions(-) diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/k

[PATCH 03/19] powerpc: Create context switch helpers save_sprs() and restore_sprs()

2015-10-28 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 --test=yield 0 0 shows an improvement of almost 10% on POWER8. Signed-off-by: Anton Blanchard

[PATCH 04/19] powerpc: Remove redundant mflr in _switch

2015-10-28 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 e84e5bc..c8b4225 100644 --- a/arch/powerpc/kernel

[PATCH 05/19] powerpc: Remove UP only lazy floating point and vector optimisations

2015-10-28 Thread Anton Blanchard
UP and SMP, but in preparation for that remove these UP only optimisations. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/processor.h | 6 -- arch/powerpc/include/asm/switch_to.h | 8 --- arch/powerpc/kernel/fpu.S| 35 --- arch/powerpc/kernel/head_fsl_booke.S

[PATCH 06/19] powerpc: Simplify TM restore checks

2015-10-28 Thread Anton Blanchard
Instead of having multiple giveup_*_maybe_transactional() functions, separate out the TM check into a new function called check_if_tm_restore_required(). This will make it easier to optimise the giveup_*() functions in a subsequent patch. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel

[PATCH 07/19] powerpc: Create mtmsrd_isync()

2015-10-28 Thread Anton Blanchard
mtmsrd_isync() will do an mtmsrd followed by an isync on older processors. On newer processors we avoid the isync via a feature fixup. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/reg.h | 8 arch/powerpc/kernel/process.c | 30 ++ 2 files

[PATCH 08/19] powerpc: Remove NULL task struct pointer checks in FP and vector code

2015-10-28 Thread Anton Blanchard
We used to allow giveup_*() to be called with a NULL task struct pointer. Now those cases are handled in the caller we can remove the checks. We can also remove giveup_altivec_notask() which is also unused. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/switch_to.h | 1 - arch

[PATCH 09/19] powerpc: Move part of giveup_fpu,altivec,spe into c

2015-10-28 Thread Anton Blanchard
Move the MSR modification into new c functions. Removing it from the low level functions will allow us to avoid costly MSR writes by batching them up. Move the check_if_tm_restore_required() check into these new functions. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/switch_to.h

[PATCH 12/19] powerpc: Create msr_check_and_{set,clear}()

2015-10-28 Thread Anton Blanchard
Create helper functions to set and clear MSR bits after first checking if they are already set. Grouping them will make it easy to avoid the MSR writes in a subsequent optimisation. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/process.c | 107

[PATCH 10/19] powerpc: Move part of giveup_vsx into c

2015-10-28 Thread Anton Blanchard
functions, and allows us to use flush_vsx_to_thread() in the signal code. Move the check_if_tm_restore_required() check in. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/process.c | 28 +++- arch/powerpc/kernel/signal_32.c | 4 ++-- arch/powerpc/kernel/signal_64.c

[PATCH 16/19] powerpc: create giveup_all()

2015-10-28 Thread Anton Blanchard
improvement of 3% on POWER8. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/switch_to.h | 1 + arch/powerpc/kernel/process.c| 75 arch/powerpc/kvm/book3s_pr.c | 17 +--- 3 files changed, 63 insertions(+), 30 deletions(-) diff

[PATCH 17/19] powerpc: create flush_all_to_thread()

2015-10-28 Thread Anton Blanchard
Create a single function that flushes everything (FP, VMX, VSX, SPE). Doing this all at once means we only do one MSR write. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/switch_to.h | 1 + arch/powerpc/kernel/process.c| 22 ++ arch/powerpc/kernel

[PATCH 15/19] powerpc: Remove fp_enable() and vec_enable(), use msr_check_and_{set, clear}()

2015-10-28 Thread Anton Blanchard
More consolidation of our MSR available bit handling. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/processor.h | 2 -- arch/powerpc/kernel/fpu.S| 16 arch/powerpc/kernel/process.c| 6 -- arch/powerpc/kernel/vector.S | 10

[PATCH 18/19] powerpc: Rearrange __switch_to()

2015-10-28 Thread Anton Blanchard
Most of __switch_to() is housekeeping, TLB batching, timekeeping etc. Move these away from the more complex and critical context switching code. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/process.c | 52 +-- 1 file changed, 26 insertions

[PATCH 13/19] powerpc: Create disable_kernel_{fp,altivec,vsx,spe}()

2015-10-28 Thread Anton Blanchard
for a debug boot option that does this and catches bad uses in other areas of the kernel. Signed-off-by: Anton Blanchard --- arch/powerpc/crypto/aes-spe-glue.c | 1 + arch/powerpc/crypto/sha1-spe-glue.c | 1 + arch/powerpc/crypto/sha256-spe-glue.c| 1 + arch/powerpc/includ

[PATCH 11/19] crypto: vmx: Only call enable_kernel_vsx()

2015-10-28 Thread Anton Blanchard
With the recent change to enable_kernel_vsx(), we no longer need to call enable_kernel_fp() and enable_kernel_altivec(). Signed-off-by: Anton Blanchard --- drivers/crypto/vmx/aes.c | 3 --- drivers/crypto/vmx/aes_cbc.c | 3 --- drivers/crypto/vmx/aes_ctr.c | 3 --- drivers/crypto/vmx

[PATCH 19/19] powerpc: clean up asm/switch_to.h

2015-10-28 Thread Anton Blanchard
Remove a bunch of unnecessary fallback functions and group things in a more logical way. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/switch_to.h | 35 ++- arch/powerpc/kernel/process.c| 2 +- 2 files changed, 11 insertions(+), 26

[PATCH 14/19] powerpc: Add ppc_strict_facility_enable boot option

2015-10-28 Thread Anton Blanchard
Add a boot option that strictly manages the MSR unavailable bits. This catches kernel uses of FP/Altivec/SPE that would otherwise corrupt user state. Signed-off-by: Anton Blanchard --- Documentation/kernel-parameters.txt | 6 ++ arch/powerpc/include/asm/reg.h | 9 + arch

Re: [PATCH 1/5] powerpc: Print MSR TM bits in oops message

2015-11-16 Thread Anton Blanchard
Hi, > > +{ > > + if (val & (MSR_TM | MSR_TS_S | MSR_TS_T)) { > > + printk(",TM["); > > + printbits(val, msr_tm_bits, ""); > > + printk("]"); > > I suspect all these individual printks are going to behave badly if > we have multiple cpus crashing simultaneously. But

Re: [PATCH] cxl: Fix build failure due to -Wunused-variable behaviour change

2015-11-25 Thread Anton Blanchard
Hi Torsten, > > -ccflags-y := -Werror > > +ccflags-y := -Werror -Wno-unused-const-variable > > JFYI, my gcc-4.3 does not like this switch. > What's the minimum compiler version to build this code? -Werror is such a moving target. I'm also seeing issues when building with clang, eg: drivers/misc

[PATCH] powerpc: Avoid -maltivec when using clang integrated assembler

2015-11-25 Thread Anton Blanchard
Check the assembler supports -maltivec by wrapping it with call as-option. Signed-off-by: Anton Blanchard --- arch/powerpc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 96efd82..76a315d 100644 --- a/arch/powerpc

[PATCH] powerpc/vdso: Remove sys_ni_syscall and sys_call_table prototypes

2015-12-03 Thread Anton Blanchard
Prototypes for sys_ni_syscall and sys_call_table are available in header files, so remove the prototypes in c code. This was noticed when building with -flto, because the prototype for sys_ni_syscall doesn't match the function and we get a compiler error. Signed-off-by: Anton Blan

[PATCH] powerpc: Call restore_sprs() on initial context switch

2015-12-08 Thread Anton Blanchard
This means restore_sprs() is not getting called. Add a call to it in ret_from_fork() and ret_from_kernel_thread(). Signed-off-by: Anton Blanchard Fixes: 152d523e6307 ("powerpc: Create context switch helpers save_sprs() and restore_sprs()") --- arch/powerpc/kernel/entry_32.S | 20 ++

[PATCH] powerpc: Fix DSCR inheritance over fork()

2015-12-09 Thread Anton Blanchard
working around this in the testcase, it is a kernel bug. Fix it by copying the current DSCR to the child, instead of what we had in the thread struct at last context switch. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/process.c | 2 +- tools/testing

Re: [PATCH 2/2] powerpc: Copy only required pieces of the mm_context_t to the paca

2015-12-09 Thread Anton Blanchard
> Currently we copy the whole mm_context_t to the paca but only access a > few bits of it. This is wasteful of space paca and also takes quite > some time in the hot path of context switching. > > This patch pulls in only the required bits from the mm_context_t to > the paca and on context switch

[PATCH] powerpc: Call check_if_tm_restore_required() in enable_kernel_*()

2015-12-10 Thread Anton Blanchard
Commit a0e72cf12b1a ("powerpc: Create msr_check_and_{set,clear}()") removed a call to check_if_tm_restore_required() in the enable_kernel_*() functions. Add them back in. Fixes: a0e72cf12b1a ("powerpc: Create msr_check_and_{set,clear}()") Reported-by: Rashmica Gupta

[PATCH v2] powerpc: Call restore_sprs() before _switch()

2015-12-10 Thread Anton Blanchard
rn through ret_from_fork() or ret_from_kernel_thread(). This means restore_sprs() is not getting called for new tasks. Fix this by moving restore_sprs() before _switch(). Signed-off-by: Anton Blanchard Fixes: 152d523e6307 ("powerpc: Create context switch helpers save_sprs() and restore_sprs()&qu

[PATCH] powerpc/vdso: Fix multiple issues with sys_call_table

2020-03-05 Thread Anton Blanchard
function descriptor and sys_call_table[] holds pointers to the instruction text. Fix this by using dereference_kernel_function_descriptor(). Cc: sta...@vger.kernel.org Signed-off-by: Anton Blanchard --- diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index b9a108411c0d

Re: [PATCH] powerpc/64s/radix: Fix !SMP build

2020-03-05 Thread Anton Blanchard
Thanks Nick, > Signed-off-by: Nicholas Piggin Tested-by: Anton Blanchard > --- > arch/powerpc/mm/book3s64/radix_pgtable.c | 1 + > arch/powerpc/mm/book3s64/radix_tlb.c | 7 ++- > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/arc

[PATCH] powerpc/Makefiles: Fix clang/llvm build

2018-08-20 Thread Anton Blanchard
From: Anton Blanchard Commit 15a3204d24a3 ("powerpc/64s: Set assembler machine type to POWER4") passes -mpower4 to the assembler. We have more recent instructions in our assembly files, but gas permits them. The clang/llvm integrated assembler is more strict, and we get a build fai

[PATCH] powerpc/64: Remove static branch hints from memset()

2018-08-20 Thread Anton Blanchard
From: Anton Blanchard Static branch hints override dynamic branch prediction on recent POWER CPUs. We should only use them when we are overwhelmingly sure of the direction. Signed-off-by: Anton Blanchard --- arch/powerpc/lib/mem_64.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

Re: [PATCH] powerpc/Makefiles: Fix clang/llvm build

2018-08-20 Thread Anton Blanchard
Hi Michael, > This breaks GCC 4.6.3 at least, which we still support: > > Assembler messages: > Error: invalid switch -mpower8 > Error: unrecognized option -mpower8 > ../scripts/mod/empty.c:1:0: fatal error: error closing -: Broken > pipe Yuck. We have POWER8 instructions in our assembly

[PATCH 1/2] powerpc/time: Use clockevents_register_device(), fixing an issue with large decrementer

2018-09-28 Thread Anton Blanchard
We currently cap the decrementer clockevent at 4 seconds, even on systems with large decrementer support. Fix this by converting the code to use clockevents_register_device() which calculates the upper bound based on the max_delta passed in. Signed-off-by: Anton Blanchard --- arch/powerpc

[PATCH 2/2] powerpc/time: Only cap decrementer when watchdog is enabled

2018-09-28 Thread Anton Blanchard
If CONFIG_PPC_WATCHDOG is enabled, we always cap the decrementer to 0x7fff. As suggested by Nick, add a run time check of the watchdog cpumask, so if it is disabled we use the large decrementer. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/time.c | 4 +++- 1 file changed, 3

Re: [PATCH 2/2] powerpc/time: Only cap decrementer when watchdog is enabled

2018-10-01 Thread Anton Blanchard
Hi Nick, > Thanks for tracking this down. It's a fix for my breakage > > a7cba02deced ("powerpc: allow soft-NMI watchdog to cover timer > interrupts with large decrementers") > > Taking another look... what I had expected here is the timer subsystem > would have stopped the decrementer device af

[PATCH 1/2] powerpc/time: Use clockevents_register_device(), fixing an issue with large decrementer

2018-10-01 Thread Anton Blanchard
We currently cap the decrementer clockevent at 4 seconds, even on systems with large decrementer support. Fix this by converting the code to use clockevents_register_device() which calculates the upper bound based on the max_delta passed in. Signed-off-by: Anton Blanchard --- arch/powerpc

[PATCH 2/2] powerpc/time: Add set_state_oneshot_stopped decrementer callback

2018-10-01 Thread Anton Blanchard
s and we end up with 0x7fff even on a large decrementer capable system. As suggested by Nick, add a set_state_oneshot_stopped callback so we program the decrementer with decrementer_max if there are no future events. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/time.c | 1 + 1

[PATCH] powerpc: Add doorbell tracepoints

2018-10-02 Thread Anton Blanchard
When analysing sources of OS jitter, I noticed that doorbells cannot be traced. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/trace.h | 16 arch/powerpc/kernel/dbell.c | 3 +++ 2 files changed, 19 insertions(+) diff --git a/arch/powerpc/include/asm/trace.h

Re: [PATCH] powerpc: Add doorbell tracepoints

2018-10-03 Thread Anton Blanchard
Hi Russell, > snowpatch builds failed for this patch on all 64-bit configurations > (ppc64e, ppc64 and ppc64le) with the following: Thanks! Stupid bug on my part, need more quilt ref. Update to follow. Anton > arch/powerpc/kernel/dbell.c:85:9: error: undefined identifier > 'trace_doorbell_entry

[PATCH] powerpc: Add doorbell tracepoints

2018-10-03 Thread Anton Blanchard
When analysing sources of OS jitter, I noticed that doorbells cannot be traced. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/trace.h | 16 arch/powerpc/kernel/dbell.c | 3 +++ 2 files changed, 19 insertions(+) diff --git a/arch/powerpc/include/asm/trace.h

Re: [PATCH] powerpc/time: Fix clockevent_decrementer initalisation for PR KVM

2018-10-20 Thread Anton Blanchard
signing back to decrementer_clockevent the mult > and shift values. Thanks Michael, I missed that completely. Acked-by: Anton Blanchard Anton > > Fixes: 8b78fdb045de ("powerpc/time: Use > clockevents_register_device(), fixing an issue with large > decrementer") Signed-

Re: [RFC PATCH 02/10] fadump: Reserve the memory for firmware assisted dump.

2011-08-30 Thread Anton Blanchard
Hi Mahesh, Just a few comments. > +#define RMR_START0x0 > +#define RMR_END (0x1UL << 28) /* 256 MB */ What if the RMO is bigger than 256MB? Should we be using ppc64_rma_size? > +#ifdef DEBUG > +#define PREFIX "fadump: " > +#define DBG(fmt...) printk(KERN_ERR P

Re: [RFC PATCH 03/10] fadump: Register for firmware assisted dump.

2011-08-30 Thread Anton Blanchard
Hi, > +static void fadump_show_config(void) > +{ > + DBG("Support for firmware-assisted dump (fadump): %s\n", > + (fw_dump.fadump_supported ? "present" : "no support")); > + > + if (!fw_dump.fadump_supported) > + return; > + > + DBG("Fadump enabled:

Re: [RFC PATCH 05/10] fadump: Convert firmware-assisted cpu state dump data into elf notes.

2011-08-30 Thread Anton Blanchard
> diff --git a/kernel/panic.c b/kernel/panic.c > index 6923167..1965b50 100644 > --- a/kernel/panic.c > +++ b/kernel/panic.c > @@ -49,6 +49,15 @@ static long no_blink(int state) > long (*panic_blink)(int state); > EXPORT_SYMBOL(panic_blink); > > +#ifdef CONFIG_FA_DUMP > +/* > + * provide an em

[PATCH] powerpc: Fix deadlock in icswx code

2011-09-14 Thread Anton Blanchard
ead of using the mmap_sem to keep mm_users constant, take the page table spinlock. Signed-off-by: Anton Blanchard Cc: --- diff --git a/arch/powerpc/mm/mmu_context_hash64.c b/arch/powerpc/mm/mmu_context_hash64.c index 3bafc3d..4ff587e 100644 --- a/arch/powerpc/mm/mmu_context_ha

[PATCH] memory hotplug: Refuse to add unaligned memory regions

2011-09-14 Thread Anton Blanchard
RAM Return -EINVAL instead of creating these bad regions. Signed-off-by: Anton Blanchard --- Index: linux-build/drivers/base/memory.c === --- linux-build.orig/drivers/base/memory.c 2011-08-11 08:25:55.005941391 +1000 +++ li

Re: [PATCH 0/5] ppc64 scheduler fixes

2011-09-19 Thread Anton Blanchard
Hi Peter, > On Mon, 2011-07-25 at 12:33 +1000, Anton Blanchard wrote: > > Here are a set of ppc64 scheduler fixes that help with some > > multi node performance issues. > > They look fine to me. I'll probably ping you when I'll rip out all > that SD_NODES_P

Re: [PATCH] powerpc: Fix deadlock in icswx code

2011-09-27 Thread Anton Blanchard
Hi Jimi, > It would really help me a lot if you could review and maybe merge > this with my earlier patch that splits this file. > All it does is split.. I > promise. You don't have to take the other stuff.. yet :) Sorry it took so long to get to this.

Re: [PATCH 1/3 v2] powerpc: Split ICSWX ACOP and PID processing

2011-09-27 Thread Anton Blanchard
Hi Jimi, > Some processors, like embedded, that already have a PID register that > is managed by the system. This patch separates the ACOP and PID > processing into separate files so that the ACOP code can be shared. > > Signed-off-by: Jimi Xenidis Looks good. Acked-by:

[PATCH] powerpc: Add System RAM to /proc/iomem

2011-11-02 Thread Anton Blanchard
We've resisted adding System RAM to /proc/iomem because it is the wrong place for it. Unfortunately we continue to find tools that rely on this behaviour so give up and add it in. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/mm/

[PATCH 0/4] PowerPC time fixes

2011-11-02 Thread Anton Blanchard
Switch to using the common clockevents_calc_mult_shift and clocksource_register_hz functions, and do some cleanup along the way. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/4] powerpc/time: Use clockevents_calc_mult_shift

2011-11-02 Thread Anton Blanchard
We can use clockevents_calc_mult_shift instead of doing all the work ourselves. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/kernel/time.c === --- linux-build.orig/arch/powerpc/kernel/time.c 2011-11-03 10:19

[PATCH 2/4] powerpc/time: Use clocksource_register_hz

2011-11-02 Thread Anton Blanchard
Use clocksource_register_hz which calculates the shift/mult factors for us. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/kernel/time.c === --- linux-build.orig/arch/powerpc/kernel/time.c 2011-11-03 10:19

[PATCH 3/4] powerpc/time: Remove unnecessary sanity check of decrementer expiration

2011-11-02 Thread Anton Blanchard
The clockevents code uses max_delta_ns to avoid calling a clockevent with too large a value. Remove the redundant version of this in the timer_interrupt code. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/kernel/time.c

[PATCH 4/4] powerpc/time: Fix some style issues

2011-11-02 Thread Anton Blanchard
Fix some formatting issues and use the DECREMENTER_MAX define instead of 0x7fff. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/kernel/time.c === --- linux-build.orig/arch/powerpc/kernel/time.c 2011-11-03 10

[PATCH] powerpc: Copy down exception vectors after feature fixups

2011-11-14 Thread Anton Blanchard
we added POWERNV (breaks everyone). Signed-off-by: Anton Blanchard Cc: [v3.0+] --- Index: linux-build/arch/powerpc/include/asm/sections.h === --- linux-build.orig/arch/powerpc/include/asm/sections.h2011-09-06 17:24

[PATCH] powerpc: panic if we can't instantiate RTAS

2011-11-14 Thread Anton Blanchard
g and failing in mysterious ways we should just panic up front if RTAS exists and we can't allocate space for it. Signed-off-by: Anton Blanchard --- Index: linux-powerpc/arch/powerpc/kernel/prom_init.c === --- linux-powerpc.orig/ar

[PATCH 0/6] ppc time fixes

2011-11-23 Thread Anton Blanchard
Here is a roll up of various time fixes I have pending. Anton ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/6] powerpc/time: Handle wrapping of decrementer

2011-11-23 Thread Anton Blanchard
cause of the lockup. We already keep track of the timebase of the next event so use that to work out if we should trigger a decrementer exception. Signed-off-by: Anton Blanchard Cc: sta...@kernel.org --- - I'd like to get this into -stable if possible since the reports are coming in on 3.

[PATCH 2/6] powerpc/time: Use clockevents_calc_mult_shift

2011-11-23 Thread Anton Blanchard
We can use clockevents_calc_mult_shift instead of doing all the work ourselves. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/kernel/time.c === --- linux-build.orig/arch/powerpc/kernel/time.c 2011-11-17 10:11

[PATCH 3/6] powerpc/time: Use clocksource_register_hz

2011-11-23 Thread Anton Blanchard
Use clocksource_register_hz which calculates the shift/mult factors for us. Also remove the shift = 22 assumption in vsyscall_update - thanks to Paul Mackerras and John Stultz for catching that. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/kernel/time.c

[PATCH 4/6] powerpc/time: Remove unnecessary sanity check of decrementer expiration

2011-11-23 Thread Anton Blanchard
The clockevents code uses max_delta_ns to avoid calling a clockevent with too large a value. Remove the redundant version of this in the timer_interrupt code. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/kernel/time.c

[PATCH 5/6] powerpc/time: Fix some style issues

2011-11-23 Thread Anton Blanchard
Fix some formatting issues and use the DECREMENTER_MAX define instead of 0x7fff. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/kernel/time.c === --- linux-build.orig/arch/powerpc/kernel/time.c 2011-11-24 16

[PATCH 6/6] powerpc/time: Optimise decrementer_check_overflow

2011-11-23 Thread Anton Blanchard
beq-cr7,6c <.arch_local_irq_restore+0x6c> ... 6c: ld r30,-16(r1) 70: blr Unfortunately we still setup a local TOC (due to -mminimal-toc). Yet another sign we should be moving to -mcmodel=medium. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/k

[PATCH] powerpc: Decode correct MSR bits in oops output

2011-11-24 Thread Anton Blanchard
completeness add the rest of the bits in. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/kernel/process.c === --- linux-build.orig/arch/powerpc/kernel/process.c 2011-11-25 13:22:24.294919094 +1100 +++ linux-build/arch

[PATCH] powerpc: Harden xics hypervisor backend

2011-11-24 Thread Anton Blanchard
continue on. Add some more information to the debug messages as well. Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc/sysdev/xics/icp-hv.c === --- linux-build.orig/arch/powerpc/sysdev/xics/icp-hv.c 2011-11-25 14:01

[PATCH] powerpc: Atomically output each stack frame line in show_stack

2011-11-24 Thread Anton Blanchard
From: Milton Miller show_stack uses up to 4 printks per line and other CPUs using printk can corrupt the output. This patch calls printk once per stack frame line to produce more readable output. Signed-off-by: Milton Miller Signed-off-by: Anton Blanchard --- Index: linux-build/arch/powerpc

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