[v5 1/2] lib/raid6: Build proper files on corresponding arch

2017-04-27 Thread Matt Brown
Previously the raid6 test Makefile did not correctly build the files for testing on PowerPC. This patch fixes the bug, so that all appropriate files for PowerPC are built. This patch also fixes the missing and mismatched ifdef statements to allow the altivec.uc file to be built correctly.

[PATCH 2/2] v1 powerpc/powernv: Enable removal of memory for in memory tracing

2017-04-27 Thread Rashmica Gupta
Some powerpc hardware features may want to gain access to a chunk of undisturbed real memory. This update provides a means to unplug said memory from the kernel with a set of debugfs calls. By writing an integer containing the size of memory to be unplugged into

[PATCH 1/2] powerpc/powernv: Add config option for removal of memory

2017-04-27 Thread Rashmica Gupta
Signed-off-by: Rashmica Gupta --- arch/powerpc/platforms/powernv/Kconfig | 4 arch/powerpc/platforms/powernv/Makefile | 1 + 2 files changed, 5 insertions(+) diff --git a/arch/powerpc/platforms/powernv/Kconfig b/arch/powerpc/platforms/powernv/Kconfig index

Re: [PATCH] powerpc/xive: Fix/improve verbose debug output

2017-04-27 Thread Benjamin Herrenschmidt
On Fri, 2017-04-28 at 13:07 +1000, Michael Ellerman wrote: > Benjamin Herrenschmidt writes: > > > The existing verbose debug code doesn't build when enabled. > > So why don't we convert all the DBG_VERBOSE() to pr_devel()? pr_devel provides a bunch of debug at

Re: [PATCH v3] cxl: mask slice error interrupts after first occurrence

2017-04-27 Thread Andrew Donnellan
On 28/04/17 13:20, Alastair D'Silva wrote: From: Alastair D'Silva In some situations, a faulty AFU slice may create an interrupt storm, rendering the machine unusable. Since these interrupts are informational only, present the interrupt once, then mask it off to prevent

linux-next: build failure after merge of the kvm-ppc tree

2017-04-27 Thread Stephen Rothwell
Hi Paul, After merging the kvm-ppc tree, today's linux-next build (powerpc ppc64_defconfig) failed like this: arch/powerpc/kvm/book3s_xive.c: In function 'xive_debugfs_init': arch/powerpc/kvm/book3s_xive.c:1852:52: error: 'powerpc_debugfs_root' undeclared (first use in this function)

Re: [PATCH] powerpc/pseries hotplug: prevent the reserved mem from removing

2017-04-27 Thread Liu ping fan
On Fri, Apr 28, 2017 at 2:06 AM, Hari Bathini wrote: > Hi Pingfan, > > > On Thursday 27 April 2017 01:13 PM, Pingfan Liu wrote: >> >> E.g after fadump reserves mem regions, these regions should not be removed >> before fadump explicitly free them. >> Signed-off-by:

[PATCH v3] cxl: mask slice error interrupts after first occurrence

2017-04-27 Thread Alastair D'Silva
From: Alastair D'Silva In some situations, a faulty AFU slice may create an interrupt storm, rendering the machine unusable. Since these interrupts are informational only, present the interrupt once, then mask it off to prevent it from being retriggered until the card is

Re: [PATCH] powerpc/xive: Fix/improve verbose debug output

2017-04-27 Thread Michael Ellerman
Benjamin Herrenschmidt writes: > The existing verbose debug code doesn't build when enabled. So why don't we convert all the DBG_VERBOSE() to pr_devel()? If there's non-verbose debug that we think would be useful to differentiate from verbose then those could be

Re: [PATCH] Enabled pstore write for powerpc

2017-04-27 Thread Michael Ellerman
Kees Cook writes: > On Thu, Apr 27, 2017 at 4:33 AM, Ankit Kumar wrote: >> After commit c950fd6f201a kernel registers pstore write based on flag set. >> Pstore write for powerpc is broken as flags(PSTORE_FLAGS_DMESG) is not set >> for >> powerpc

Re: [PATCH v5 1/4] printk/nmi: generic solution for safe printk in NMI

2017-04-27 Thread Sergey Senozhatsky
On (04/27/17 12:14), Steven Rostedt wrote: [..] > I tried this patch. It's better because I get the end of the trace, but > I do lose the beginning of it: > > ** 196358 printk messages dropped ** [ 102.321182] perf-59810 > 12983650us : d_path <-seq_path many thanks! so we now drop

Re: [PATCH v5 1/4] printk/nmi: generic solution for safe printk in NMI

2017-04-27 Thread Sergey Senozhatsky
On (04/20/17 15:11), Petr Mladek wrote: [..] > void printk_nmi_enter(void) > { > - this_cpu_or(printk_context, PRINTK_NMI_CONTEXT_MASK); > + /* > + * The size of the extra per-CPU buffer is limited. Use it > + * only when really needed. > + */ > + if

Re: [PATCH 0/8] Fix clean target warnings

2017-04-27 Thread Shuah Khan
On 04/21/2017 05:14 PM, Shuah Khan wrote: > This patch series consists of changes to lib.mk to allow overriding > common clean target from Makefiles. This fixes warnings when clean > overriding and ignoring warnings. Also fixes splice clean target > removing a script that runs the test from its

Re: [PATCH 3/8] selftests: futex: override clean in lib.mk to fix warnings

2017-04-27 Thread Shuah Khan
On 04/27/2017 03:54 PM, Darren Hart wrote: > On Fri, Apr 21, 2017 at 05:14:45PM -0600, Shuah Khan wrote: >> Add override for lib.mk clean to fix the following warnings from clean >> target run. >> >> Makefile:36: warning: overriding recipe for target 'clean' >> ../lib.mk:55: warning: ignoring old

Re: [PATCH 3/8] selftests: futex: override clean in lib.mk to fix warnings

2017-04-27 Thread Darren Hart
On Fri, Apr 21, 2017 at 05:14:45PM -0600, Shuah Khan wrote: > Add override for lib.mk clean to fix the following warnings from clean > target run. > > Makefile:36: warning: overriding recipe for target 'clean' > ../lib.mk:55: warning: ignoring old recipe for target 'clean' > > Signed-off-by:

Re: [PATCH] Enabled pstore write for powerpc

2017-04-27 Thread Kees Cook
On Thu, Apr 27, 2017 at 4:33 AM, Ankit Kumar wrote: > After commit c950fd6f201a kernel registers pstore write based on flag set. > Pstore write for powerpc is broken as flags(PSTORE_FLAGS_DMESG) is not set for > powerpc architecture. On panic, kernel doesn't write

Re: [PATCH] Enabled pstore write for powerpc

2017-04-27 Thread Anton Blanchard
Hi Ankit, > After commit c950fd6f201a kernel registers pstore write based on flag > set. Pstore write for powerpc is broken as flags(PSTORE_FLAGS_DMESG) > is not set for powerpc architecture. On panic, kernel doesn't write > message to /fs/pstore/dmesg*(Entry doesn't gets created at all). > >

[PATCH 1/1] powerpc/traps : Updated MC for E6500 L1D cache err

2017-04-27 Thread Matt Weber
This patch updates the machine check handler of Linux kernel to handle the e6500 architecture case. In e6500 core, L1 Data Cache Write Shadow Mode (DCWS) register is not implemented but L1 data cache always runs in write shadow mode. So, on L1 data cache parity errors, hardware will automatically

Re: [PATCH] powerpc/pseries hotplug: prevent the reserved mem from removing

2017-04-27 Thread Hari Bathini
Hi Pingfan, On Thursday 27 April 2017 01:13 PM, Pingfan Liu wrote: E.g after fadump reserves mem regions, these regions should not be removed before fadump explicitly free them. Signed-off-by: Pingfan Liu --- arch/powerpc/platforms/pseries/hotplug-memory.c | 5 +++-- 1

Re: [PATCH v5 1/4] printk/nmi: generic solution for safe printk in NMI

2017-04-27 Thread Steven Rostedt
On Thu, 20 Apr 2017 15:11:54 +0200 Petr Mladek wrote: > > >From c530d9dee91c74db5e6a198479e2e63b24cb84a2 Mon Sep 17 00:00:00 2001 > From: Petr Mladek > Date: Thu, 20 Apr 2017 10:52:31 +0200 > Subject: [PATCH] printk: Use the main logbuf in NMI when

[PATCH] crypto: talitos: Extend max key length for SHA384/512-HMAC

2017-04-27 Thread Martin Hicks
The max keysize for both of these is 128, not 96. Before, with keysizes over 96, the memcpy in ahash_setkey() would overwrite memory beyond the key field. Signed-off-by: Martin Hicks --- drivers/crypto/talitos.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PATCH v5 1/4] printk/nmi: generic solution for safe printk in NMI

2017-04-27 Thread Steven Rostedt
On Thu, 27 Apr 2017 17:28:07 +0200 Petr Mladek wrote: > > When I get a chance, I'll see if I can insert a trigger to crash the > > kernel from NMI on another box and see if this patch helps. > > I actually tested it here using this hack: > > diff --cc lib/nmi_backtrace.c >

Re: [PATCH v5 1/4] printk/nmi: generic solution for safe printk in NMI

2017-04-27 Thread Petr Mladek
On Thu 2017-04-27 10:31:18, Steven Rostedt wrote: > On Thu, 27 Apr 2017 15:38:19 +0200 > Petr Mladek wrote: > > > > by the way, > > > does this `nmi_print_seq' bypass even fix anything for Steven? > > > > I think that this is the most important question. > > > > Steven,

Re: [PATCH v5 1/4] printk/nmi: generic solution for safe printk in NMI

2017-04-27 Thread Steven Rostedt
On Thu, 27 Apr 2017 15:38:19 +0200 Petr Mladek wrote: > > by the way, > > does this `nmi_print_seq' bypass even fix anything for Steven? > > I think that this is the most important question. > > Steven, does the patch from >

[PATCH] powerpc/xive: Fix/improve verbose debug output

2017-04-27 Thread Benjamin Herrenschmidt
The existing verbose debug code doesn't build when enabled. This fixes it and generally improves the output to make it more useful. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/sysdev/xive/common.c | 37 ++--- 1 file changed,

Re: [PATCH v5 1/4] printk/nmi: generic solution for safe printk in NMI

2017-04-27 Thread Petr Mladek
On Mon 2017-04-24 11:17:47, Sergey Senozhatsky wrote: > On (04/21/17 14:06), Petr Mladek wrote: > [..] > > > I agree that this_cpu_read(printk_context) covers slightly more than > > > logbuf_lock scope, so we may get positive this_cpu_read(printk_context) > > > with unlocked logbuf_lock, but I

Re: [PATCH v2 2/3] powerpc/kprobes: un-blacklist system_call() from kprobes

2017-04-27 Thread Naveen N. Rao
On 2017/04/27 08:19PM, Michael Ellerman wrote: > "Naveen N. Rao" writes: > > > It is actually safe to probe system_call() in entry_64.S, but only till > > .Lsyscall_exit. To allow this, convert .Lsyscall_exit to a non-local > > symbol __system_call() and

Re: [PATCH v3] KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller

2017-04-27 Thread Michael Ellerman
Paul Mackerras writes: > To get this to compile for all my test configs takes this additional > patch. I test-build configs with PR KVM and not HV (both modular and > built-in) and a config with HV enabled but CONFIG_KVM_XICS=n. Please > squash this into your topic branch.

[RFC PATCH 4.8] powerpc/slb: Force a full SLB flush when we insert for a bad EA

2017-04-27 Thread Michael Ellerman
The SLB miss handler calls slb_allocate_realmode() in order to create an SLB entry for the faulting address. At the very start of that function we check that the faulting Effective Address (EA) is less than PGTABLE_RANGE (ignoring the region), ie. is it an address which could possibly fit in the

[PATCH] Enabled pstore write for powerpc

2017-04-27 Thread Ankit Kumar
After commit c950fd6f201a kernel registers pstore write based on flag set. Pstore write for powerpc is broken as flags(PSTORE_FLAGS_DMESG) is not set for powerpc architecture. On panic, kernel doesn't write message to /fs/pstore/dmesg*(Entry doesn't gets created at all). This patch enables pstore

Re: [PATCH] powerpc/kprobes: refactor kprobe_lookup_name for safer string operations

2017-04-27 Thread Michael Ellerman
"Naveen N. Rao" writes: > Excerpts from Masami Hiramatsu's message of April 26, 2017 10:11: >> On Tue, 25 Apr 2017 21:37:11 +0530 >> "Naveen N. Rao" wrote: >>> - addr = (kprobe_opcode_t *)kallsyms_lookup_name(dot_name); >>> -

Re: [PATCH v2] cxl: Prevent IRQ storm

2017-04-27 Thread Michael Ellerman
Andrew Donnellan writes: > On 27/04/17 11:37, Alastair D'Silva wrote: >> From: Alastair D'Silva >> >> In some situations, a faulty AFU slice may create an interrupt storm, >> rendering the machine unusable. Since these interrupts are

Re: [PATCH 2/7] mm/follow_page_mask: Split follow_page_mask to smaller functions.

2017-04-27 Thread Naoya Horiguchi
On Mon, Apr 17, 2017 at 10:41:41PM +0530, Aneesh Kumar K.V wrote: > Makes code reading easy. No functional changes in this patch. In a followup > patch, we will be updating the follow_page_mask to handle hugetlb hugepd > format > so that archs like ppc64 can switch to the generic version. This

Re: [PATCH 1/7] mm/hugetlb/migration: Use set_huge_pte_at instead of set_pte_at

2017-04-27 Thread Naoya Horiguchi
On Mon, Apr 17, 2017 at 10:41:40PM +0530, Aneesh Kumar K.V wrote: > The right interface to use to set a hugetlb pte entry is set_huge_pte_at. Use > that instead of set_pte_at. > > Signed-off-by: Aneesh Kumar K.V Reviewed-by: Naoya Horiguchi

Re: [PATCH 3/7] mm/hugetlb: export hugetlb_entry_migration helper

2017-04-27 Thread Naoya Horiguchi
On Mon, Apr 17, 2017 at 10:41:42PM +0530, Aneesh Kumar K.V wrote: > We will be using this later from the ppc64 code. Change the return type to > bool. > > Signed-off-by: Aneesh Kumar K.V Reviewed-by: Naoya Horiguchi

Re: powerpc/powernv: Fix missing attr initialisation in opal_export_attrs()

2017-04-27 Thread Michael Ellerman
On Thu, 2017-04-27 at 01:37:32 UTC, Michael Ellerman wrote: > In opal_export_attrs() we dynamically allocate some bin_attributes. They're > allocated with kmalloc() and although we initialise most of the fields, we > don't > initialise write() or mmap(), and in particular we don't initialise the

Re: [v2,1/2] powerpc/mm/radix: Optimise Page Walk Cache flush

2017-04-27 Thread Michael Ellerman
On Wed, 2017-04-26 at 13:27:19 UTC, Michael Ellerman wrote: > Currently we implement flushing of the page walk cache (PWC) by calling > _tlbiel_pid() with a RIC (Radix Invalidation Control) value of 1 which says to > only flush the PWC. > > But _tlbiel_pid() loops over each set (congruence class)

Re: powerpc/powernv: Fix oops on P9 DD1 in cause_ipi()

2017-04-27 Thread Michael Ellerman
On Wed, 2017-04-26 at 10:57:47 UTC, Michael Ellerman wrote: > Recently we merged the native xive support for Power9, and then separately > some > reworks for doorbell IPI support. In isolation both series were OK, but the > merged result had a bug in one case. > > On P9 DD1 we use

Re: [REBASED,v4,1/2] powerpc: split ftrace bits into a separate file

2017-04-27 Thread Michael Ellerman
On Tue, 2017-04-25 at 13:55:53 UTC, "Naveen N. Rao" wrote: > entry_*.S now includes a lot more than just kernel entry/exit code. As a > first step at cleaning this up, let's split out the ftrace bits into > separate files. Also move all related tracing code into a new trace/ > subdirectory. > >

Re: powerpc/mm: Fix possible out-of-bounds shift in arch_mmap_rnd()

2017-04-27 Thread Michael Ellerman
On Tue, 2017-04-25 at 12:09:41 UTC, Michael Ellerman wrote: > The recent patch to add runtime configuration of the ASLR limits added a bug > in > arch_mmap_rnd() where we may shift an integer (32-bits) by up to 33 bits, > leading to undefined behaviour. > > In practice it exhibits as every

Re: [v2] powerpc/mm: Fix page table dump build on PPC32

2017-04-27 Thread Michael Ellerman
On Tue, 2017-04-18 at 06:20:13 UTC, Christophe Leroy wrote: > On PPC32 (ex: mpc885_ads_defconfig), page table dump compilation > fails as follows. This is because the memory layout is slightly > different on PPC32. This patch adapts it. > > CC arch/powerpc/mm/dump_linuxpagetables.o >

Re: powerpc/mm: Rename table dump file name

2017-04-27 Thread Michael Ellerman
On Tue, 2017-04-18 at 06:20:15 UTC, Christophe Leroy wrote: > Page table dump debugfs file is named 'kernel_page_tables' on > all other architectures implementing it, while is is named > 'kernel_pagetables' on powerpc. This patch renames it. > > Signed-off-by: Christophe Leroy

Re: [v2] powerpc/mm: Fix missing page attributes in page table dump

2017-04-27 Thread Michael Ellerman
On Fri, 2017-04-14 at 05:45:16 UTC, Christophe Leroy wrote: > On some targets, _PAGE_RW is 0 and this is _PAGE_RO which is used. > There is also _PAGE_SHARED that is missing. > > Signed-off-by: Christophe Leroy Applied to powerpc next, thanks.

Re: powerpc/mm: On PPC32, display 32 bits addresses in page table dump

2017-04-27 Thread Michael Ellerman
On Thu, 2017-04-13 at 12:41:40 UTC, Christophe Leroy wrote: > Signed-off-by: Christophe Leroy Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/e1f2c9d97d932812d17509e86246c6 cheers

Re: [PATCH v2 2/3] powerpc/kprobes: un-blacklist system_call() from kprobes

2017-04-27 Thread Michael Ellerman
"Naveen N. Rao" writes: > It is actually safe to probe system_call() in entry_64.S, but only till > .Lsyscall_exit. To allow this, convert .Lsyscall_exit to a non-local > symbol __system_call() and blacklist that symbol, rather than > system_call(). I'm not sure

Re: [PATCH v3] KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller

2017-04-27 Thread Paul Mackerras
To get this to compile for all my test configs takes this additional patch. I test-build configs with PR KVM and not HV (both modular and built-in) and a config with HV enabled but CONFIG_KVM_XICS=n. Please squash this into your topic branch. Paul. diff --git a/arch/powerpc/kvm/Kconfig

[PATCH v5 3/3] kdump: Protect vmcoreinfo data under the crash memory

2017-04-27 Thread Xunlei Pang
Currently vmcoreinfo data is updated at boot time subsys_initcall(), it has the risk of being modified by some wrong code during system is running. As a result, vmcore dumped may contain the wrong vmcoreinfo. Later on, when using "crash", "makedumpfile", etc utility to parse this vmcore, we

[PATCH v5 2/3] powerpc/fadump: Use the correct VMCOREINFO_NOTE_SIZE for phdr

2017-04-27 Thread Xunlei Pang
vmcoreinfo_max_size stands for the vmcoreinfo_data, the correct one we should use is vmcoreinfo_note whose total size is VMCOREINFO_NOTE_SIZE. Like explained in commit 77019967f06b ("kdump: fix exported size of vmcoreinfo note"), it should not affect the actual function, but we better fix it,

[PATCH v5 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section

2017-04-27 Thread Xunlei Pang
As Eric said, "what we need to do is move the variable vmcoreinfo_note out of the kernel's .bss section. And modify the code to regenerate and keep this information in something like the control page. Definitely something like this needs a page all to itself, and ideally far away from any other

[PATCH] powerpc/pseries hotplug: prevent the reserved mem from removing

2017-04-27 Thread Pingfan Liu
E.g after fadump reserves mem regions, these regions should not be removed before fadump explicitly free them. Signed-off-by: Pingfan Liu --- arch/powerpc/platforms/pseries/hotplug-memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

[PATCH v2 2/3] powerpc/kprobes: un-blacklist system_call() from kprobes

2017-04-27 Thread Naveen N. Rao
It is actually safe to probe system_call() in entry_64.S, but only till .Lsyscall_exit. To allow this, convert .Lsyscall_exit to a non-local symbol __system_call() and blacklist that symbol, rather than system_call(). Reviewed-by: Masami Hiramatsu Signed-off-by: Naveen N.

[PATCH v2 3/3] powerpc/kprobes: blacklist functions invoked on a trap

2017-04-27 Thread Naveen N. Rao
Blacklist all functions involved while handling a trap. We: - convert some of the labels into private labels, - remove the duplicate 'restore' label, and - blacklist most functions involved while handling a trap. Reviewed-by: Masami Hiramatsu Signed-off-by: Naveen N. Rao

[PATCH v2 1/3] powerpc/kprobes: cleanup system_call_common and blacklist it from kprobes

2017-04-27 Thread Naveen N. Rao
Convert some of the labels into private labels and blacklist system_call_common() and system_call() from kprobes. We can't take a trap at parts of these functions as either MSR_RI is unset or the kernel stack pointer is not yet setup. Reviewed-by: Masami Hiramatsu

[PATCH v2 0/3] powerpc: build out kprobes blacklist

2017-04-27 Thread Naveen N. Rao
v2 changes: - Patches 3 and 4 from the previous series have been merged. - Updated to no longer blacklist functions involved with stolen time accounting. v1: https://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg117514.html -- This is the second in the series of patches to build out an

Re: [PATCH v4 2/3] powerpc/fadump: Use the correct VMCOREINFO_NOTE_SIZE for phdr

2017-04-27 Thread Mahesh Jagannath Salgaonkar
On 04/26/2017 12:41 PM, Dave Young wrote: > Ccing ppc list > On 04/20/17 at 07:39pm, Xunlei Pang wrote: >> vmcoreinfo_max_size stands for the vmcoreinfo_data, the >> correct one we should use is vmcoreinfo_note whose total >> size is VMCOREINFO_NOTE_SIZE. >> >> Like explained in commit

Re: [PATCH 0/4] powerpc: build out kprobes blacklist

2017-04-27 Thread Naveen N. Rao
On 2017/04/27 11:24AM, Masami Hiramatsu wrote: > Hello Naveen, > > On Tue, 25 Apr 2017 22:04:05 +0530 > "Naveen N. Rao" wrote: > > > This is the second in the series of patches to build out an appropriate > > kprobes blacklist. This series blacklists