Re: [PATCH 2/4] powerpc/kprobes: Do not disable interrupts for optprobes and kprobes_on_ftrace

2017-10-24 Thread Masami Hiramatsu
On Mon, 23 Oct 2017 22:07:39 +0530 "Naveen N. Rao" wrote: > Per Documentation/kprobes.txt, we don't necessarily need to disable > interrupts before invoking the kprobe handlers. Masami submitted > similar changes for x86 via commit a19b2e3d783964 ("kprobes/x86:

Re: [PATCH 1/4] powerpc/kprobes: Disable preemption before invoking probe handler for optprobes

2017-10-24 Thread Masami Hiramatsu
On Mon, 23 Oct 2017 22:07:38 +0530 "Naveen N. Rao" wrote: > Per Documentation/kprobes.txt, probe handlers need to be invoked with > preemption disabled. Update optimized_callback() to do so. Also move > get_kprobe_ctlblk() invocation post preemption disable,

[PATCH V4 0/2] pseries/nodes: Fix issues with memoryless nodes

2017-10-24 Thread Michael Bringmann
From: Michael Bringmann To: linuxppc-dev@lists.ozlabs.org To: linux-ker...@vger.kernel.org Cc: Michael Bringmann Cc: Nathan Fontenot Cc: Michael Ellerman Cc: John Allen

Re: [PATCH] powerpc/tm: Set ckpt_regs.msr before using it.

2017-10-24 Thread Cyril Bur
On Tue, 2017-10-24 at 15:13 -0200, Breno Leitao wrote: > From: Breno Leitao > > On commit commit f48e91e87e67 ("powerpc/tm: Fix FP and VMX register > corruption"), we check ckpt_regs.msr to see if a feature (as VEC, VSX > and FP) is disabled (thus the hot registers might

Re: [PATCH v2 3/8] powerpc/mm: Separate ibm, dynamic-memory data from DT format

2017-10-24 Thread Nathan Fontenot
On 10/24/2017 01:08 AM, Michael Ellerman wrote: > Nathan Fontenot writes: > >> diff --git a/arch/powerpc/mm/drmem.c b/arch/powerpc/mm/drmem.c >> new file mode 100644 >> index ..8ad7cf36b2c4 >> --- /dev/null >> +++ b/arch/powerpc/mm/drmem.c >> @@ -0,0 +1,84

Re: [PATCH V3 2/2] pseries/initnodes: Ensure nodes initialized for hotplug

2017-10-24 Thread kbuild test robot
-enough-nodes-avail-for-operations/20171024-021023 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-allyesconfig (attached as .config) compiler: powerpc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705 reproduce: wget https

[PATCH] powerpc/tm: Make the tm code more readable

2017-10-24 Thread Breno Leitao
As discussed in the mailing list, renaming tm_disabled global variable since it has nothing to do with concept we have been using in tm_enable() and tm_enabled() functions. This will avoid a possible confusion that tm_enable() would change tm_disable variable. I am also taking the opportunity to

Re: [PATCH 08/25] powerpc: sys_pkey_alloc() and sys_pkey_free() system calls

2017-10-24 Thread Ram Pai
On Tue, Oct 24, 2017 at 05:48:15PM +0200, Michael Ellerman wrote: > Ram Pai writes: > > > Finally this patch provides the ability for a process to > > allocate and free a protection key. > > This must be the last patch in the series. > > We don't want to expose a half

Re: [PATCH 20/25] powerpc: Handle exceptions caused by pkey violation

2017-10-24 Thread Ram Pai
On Tue, Oct 24, 2017 at 05:47:38PM +0200, Michael Ellerman wrote: > Ram Pai writes: > > > Handle Data and Instruction exceptions caused by memory > > protection-key. > > > > The CPU will detect the key fault if the HPTE is already > > programmed with the key. > > > >

Re: [PATCH 23/25] powerpc: Deliver SEGV signal on pkey violation

2017-10-24 Thread Ram Pai
On Tue, Oct 24, 2017 at 05:46:38PM +0200, Michael Ellerman wrote: > Ram Pai writes: > > > diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c > > index ec74e20..f2a310d 100644 > > --- a/arch/powerpc/kernel/traps.c > > +++ b/arch/powerpc/kernel/traps.c > >

[PATCH] powerpc/tm: Set ckpt_regs.msr before using it.

2017-10-24 Thread Breno Leitao
From: Breno Leitao On commit commit f48e91e87e67 ("powerpc/tm: Fix FP and VMX register corruption"), we check ckpt_regs.msr to see if a feature (as VEC, VSX and FP) is disabled (thus the hot registers might be bogus during the reclaim), and then copy the previously saved

[PATCH] powerpc/mm: Add a CONFIG option to choose if radix is used by default

2017-10-24 Thread Michael Ellerman
Currently if the hardware supports the radix MMU we will use it, *unless* "disable_radix" is passed on the kernel command line. However some users would like the reverse semantics. ie. The kernel uses the hash MMU by default, unless radix is explicitly requested on the command line. So add a

Re: [PATCH 08/25] powerpc: sys_pkey_alloc() and sys_pkey_free() system calls

2017-10-24 Thread Michael Ellerman
Ram Pai writes: > Finally this patch provides the ability for a process to > allocate and free a protection key. This must be the last patch in the series. We don't want to expose a half working interface to userspace. cheers

Re: [PATCH 19/25] powerpc: implementation for arch_vma_access_permitted()

2017-10-24 Thread Michael Ellerman
Ram Pai writes: > diff --git a/arch/powerpc/mm/pkeys.c b/arch/powerpc/mm/pkeys.c > index 24589d9..21c3b42 100644 > --- a/arch/powerpc/mm/pkeys.c > +++ b/arch/powerpc/mm/pkeys.c > @@ -320,3 +320,46 @@ bool arch_pte_access_permitted(u64 pte, bool write, bool > execute) >

Re: [PATCH 20/25] powerpc: Handle exceptions caused by pkey violation

2017-10-24 Thread Michael Ellerman
Ram Pai writes: > Handle Data and Instruction exceptions caused by memory > protection-key. > > The CPU will detect the key fault if the HPTE is already > programmed with the key. > > However if the HPTE is not hashed, a key fault will not > be detected by the hardware.

Re: [PATCH 22/25] powerpc: capture the violated protection key on fault

2017-10-24 Thread Michael Ellerman
Ram Pai writes: > diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h > index 04b60af..51c89c1 100644 > --- a/arch/powerpc/include/asm/paca.h > +++ b/arch/powerpc/include/asm/paca.h > @@ -97,6 +97,9 @@ struct paca_struct { > struct dtl_entry

Re: [PATCH 23/25] powerpc: Deliver SEGV signal on pkey violation

2017-10-24 Thread Michael Ellerman
Ram Pai writes: > diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c > index ec74e20..f2a310d 100644 > --- a/arch/powerpc/kernel/traps.c > +++ b/arch/powerpc/kernel/traps.c > @@ -265,6 +266,15 @@ void user_single_step_siginfo(struct task_struct *tsk, >

[PATCH v2 3/3] powerpc/64s/radix: Fix process table entry cache invalidation

2017-10-24 Thread Nicholas Piggin
According to the architecture, the process table entry cache must be flushed with tlbie RIC=2. Currently the process table entry is set to invalid right before the PID is returned to the allocator, with no invalidation. This works on existing implementations that are known to not cache the

[PATCH v2 2/3] powerpc/64s/radix: tlbie improve preempt handling

2017-10-24 Thread Nicholas Piggin
Preempt should be consistently disabled for mm_is_thread_local tests, so bring the rest of these under preempt_disable(). Preempt does not need to be disabled for the mm->context.id tests, which allows simplification and removal of gotos. Signed-off-by: Nicholas Piggin ---

[PATCH v2 1/3] powerpc/64s/radix: fix preempt imbalance in TLB flush

2017-10-24 Thread Nicholas Piggin
Signed-off-by: Nicholas Piggin --- arch/powerpc/mm/tlb-radix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/tlb-radix.c b/arch/powerpc/mm/tlb-radix.c index 3a07d7a5e2fe..892544ebc2d2 100644 --- a/arch/powerpc/mm/tlb-radix.c +++

[PATCH v2 0/3] powerpc/64s/radix: misc minor TLB flush fixes

2017-10-24 Thread Nicholas Piggin
*** BLURB HERE *** Nicholas Piggin (3): powerpc/64s/radix: fix preempt imbalance in TLB flush powerpc/64s/radix: tlbie improve preempt handling powerpc/64s/radix: Fix process table entry cache invalidation arch/powerpc/include/asm/mmu_context.h | 4 +++

Re: [PATCH] powerpc/perf: Fix IMC allocation routine

2017-10-24 Thread Guilherme G. Piccoli
On 10/24/2017 06:34 AM, Anju T Sudhakar wrote: > Hi Guilherme, > > Nice catch. > > On Friday 20 October 2017 01:11 AM, Guilherme G. Piccoli wrote: >> When setting nr_cpus=1, we observed a crash in IMC code during boot >> due to a missing allocation: basically, IMC code is taking the number >> of

[PATCH] powerpc/64: set DSCR default initially from SPR

2017-10-24 Thread Nicholas Piggin
Take the DSCR value set by firmware as the dscr_default value, rather than zero. POWER9 recommends DSCR default to a non-zero value. From: Nicholas Piggin --- This has a problem that OS which set the DSCR to non-default then kexec to Linux will be used as our default. I send

[PATCH] drivers/macintosh: Convert timers to use timer_setup()

2017-10-24 Thread Kees Cook
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Benjamin Herrenschmidt Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Kees

[PATCH] powernv: Avoid checkstop on HMI and MCE

2017-10-24 Thread Michael Neuling
On an unrecoverable HMI or MCE only generate an checkstop (via PLATFORM ERROR opal reboot call) when panic_on_oops is set. We currently generate an checkstop as an attempt for the FSP to grab a dump and then reboot us. Unfortunately this never works and no one I've talked to has ever seen a

Re: [PATCH 05/25] powerpc: helper functions to initialize AMR, IAMR and UAMOR registers

2017-10-24 Thread Michael Ellerman
Ram Pai writes: > On Tue, Oct 24, 2017 at 11:55:41AM +0530, Aneesh Kumar K.V wrote: >> Ram Pai writes: >> > + >> > +static void pkey_status_change(int pkey, bool enable) >> > +{ >> > + u64 old_uamor; >> > + >> > + /* reset the AMR and IAMR bits for

Re: [PATCH 01/25] powerpc: initial pkey plumbing

2017-10-24 Thread Michael Ellerman
Ram Pai writes: > On Thu, Oct 19, 2017 at 03:20:36PM +1100, Michael Ellerman wrote: >> Ram Pai writes: >> >> > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig >> > index 9fc3c0b..a4cd210 100644 >> > --- a/arch/powerpc/Kconfig >> > +++

Re: [PATCH 1/4] powerpc/tm: Add commandline option to disable hardware transactional memory

2017-10-24 Thread Michael Ellerman
Breno Leitao writes: > On Sat, Oct 21, 2017 at 11:58:47AM +1100, Michael Neuling wrote: >> On Fri, 2017-10-20 at 09:45 -0200, Breno Leitao wrote: >> > On Thu, Oct 12, 2017 at 09:17:16PM +1100, Michael Ellerman wrote: >> > > diff --git a/arch/powerpc/kernel/prom.c

Re: [4/5] powerpc-pseries: Return directly after a failed kzalloc_node() in iommu_pseries_alloc_group()

2017-10-24 Thread Michael Ellerman
On Wed, 2017-10-18 at 19:26:10 UTC, SF Markus Elfring wrote: > From: Markus Elfring > Date: Wed, 18 Oct 2017 20:15:32 +0200 > > Return directly after a call of the function "kzalloc_node" failed > at the beginning. > > Signed-off-by: Markus Elfring

Re: powerpc/xmon: check before calling xive functions

2017-10-24 Thread Michael Ellerman
On Tue, 2017-10-17 at 18:20:18 UTC, Breno Leitao wrote: > Currently xmon could call XIVE functions from OPAL even if the XIVE is > disabled or does not exist in the system, as in POWER8 machines. This > causes the following exception: > > 1:mon> dx > cpu 0x1: Vector: 700 (Program Check) at

Re: [3/3] powerpc-opal: Fix a typo in a comment line of two file headers

2017-10-24 Thread Michael Ellerman
On Tue, 2017-10-17 at 12:14:00 UTC, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 17 Oct 2017 13:31:42 +0200 > > Fix a word in these descriptions. > > Signed-off-by: Markus Elfring Applied to powerpc next, thanks.

Re: powerpc/mm/radix: Drop unneeded NULL check

2017-10-24 Thread Michael Ellerman
On Mon, 2017-10-16 at 07:11:00 UTC, "Aneesh Kumar K.V" wrote: > From: Michael Ellerman > > We call these functions with non-NULL mm or vma. Hence we can skip the NULL > check in these functions. We also remove now unused function > __local_flush_hugetlb_page(). > >

Re: [5/4] KVM: PPC: Tie KVM_CAP_PPC_HTM to the user-visible TM feature

2017-10-24 Thread Michael Ellerman
On Thu, 2017-10-12 at 11:58:54 UTC, Michael Ellerman wrote: > Currently we use CPU_FTR_TM to decide if the CPU/kernel can support > TM (Transactional Memory), and if it's true we advertise that to > Qemu (or similar) via KVM_CAP_PPC_HTM. > > PPC_FEATURE2_HTM is the user-visible feature bit, which

Re: [1/4] powerpc/tm: Add commandline option to disable hardware transactional memory

2017-10-24 Thread Michael Ellerman
On Thu, 2017-10-12 at 10:17:16 UTC, Michael Ellerman wrote: > From: Cyril Bur > > Currently the kernel relies on firmware to inform it whether or not the > CPU supports HTM and as long as the kernel was built with > CONFIG_PPC_TRANSACTIONAL_MEM=y then it will allow userspace

Re: powerpc/configs: Enable I2C_CHARDEV for pseries and powernv

2017-10-24 Thread Michael Ellerman
On Thu, 2017-10-12 at 02:16:59 UTC, Andrew Donnellan wrote: > i2c-dev provides an interface for userspace programs to interact with I2C > devices, and is very helpful for I2C-related debugging. > > Enable it in pseries_defconfig and powernv_defconfig. It's already enabled > in many other powerpc

Re: powerpc/xmon: Add kstack base to paca dump

2017-10-24 Thread Michael Ellerman
On Mon, 2017-10-09 at 10:59:32 UTC, Michael Ellerman wrote: > When dumping the paca in xmon we currently show kstack. Although it's > not hard it's a bit fiddly to work out what the bounds of the kernel > stack should be based on the kstack value. > > To make life easier and "kstack_base" which

Re: [1/2] powerpc/64s: Move the two FAST_ENDIAN macros next to each other

2017-10-24 Thread Michael Ellerman
On Mon, 2017-10-09 at 10:54:04 UTC, Michael Ellerman wrote: > So we can #ifdef them in the next patch. > > Signed-off-by: Michael Ellerman Series applied to powerpc next. https://git.kernel.org/powerpc/c/5c2511bff47ba7fb09268ee8ebbf52 cheers

Re: powerpc/perf/hv-24x7: Fix incorrect comparison in memord

2017-10-24 Thread Michael Ellerman
On Mon, 2017-10-09 at 10:52:44 UTC, Michael Ellerman wrote: > In the hv-24x7 code there is a function memord() which tries to > implement a sort function return -1, 0, 1. However one of the > conditions is incorrect, such that it can never be true, because we > will have already returned. > > I

Re: cxl: Provide debugfs access to PSL_DEBUG/XSL_DEBUG registers

2017-10-24 Thread Michael Ellerman
On Wed, 2017-09-20 at 06:23:22 UTC, Vaibhav Jain wrote: > Access to PSL/XSL_DEBUG registers on the adapter provides easy access > to the debug facilities provided by PSL/XSL. So this patch adds two > new files (debug, xsl-debug) to the cxl-adapter specific debugfs > folder located at

Re: [v2] axonram: Delete an unnecessary variable initialisation in axon_ram_probe()

2017-10-24 Thread Michael Ellerman
On Tue, 2017-09-05 at 17:11:31 UTC, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 5 Sep 2017 18:47:02 +0200 > > The local variable "rc" will eventually be set only to an error code. > Thus omit the explicit initialisation at the beginning. > >

Re: [v3, 4/6] powerpc: dts: acadia: DT fix s/#interrupts-parent/#interrupt-parent/

2017-10-24 Thread Michael Ellerman
On Fri, 2017-06-02 at 12:38:47 UTC, Geert Uytterhoeven wrote: > Signed-off-by: Geert Uytterhoeven > Acked-by: Rob Herring Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/3d2d4339cc326c427638daa67e264d cheers

Re: [PATCH 03/25] powerpc: track allocation status of all pkeys

2017-10-24 Thread Ram Pai
On Tue, Oct 24, 2017 at 11:58:29AM +0530, Aneesh Kumar K.V wrote: > Ram Pai writes: > + > > +#define mm_set_pkey_is_allocated(mm, pkey) \ > > + (mm_pkey_allocation_map(mm) & pkey_alloc_mask(pkey)) > > + > > > static inline bool mm_pkey_is_allocated(struct mm_struct *mm,

Re: [PATCH 09/25] powerpc: ability to create execute-disabled pkeys

2017-10-24 Thread Ram Pai
On Tue, Oct 24, 2017 at 12:28:35PM +0530, Aneesh Kumar K.V wrote: > Ram Pai writes: > > > On Wed, Oct 18, 2017 at 02:42:56PM +1100, Balbir Singh wrote: > >> On Fri, 8 Sep 2017 15:44:57 -0700 > >> Ram Pai wrote: > >> > >> > powerpc has hardware support

Re: [PATCH 05/25] powerpc: helper functions to initialize AMR, IAMR and UAMOR registers

2017-10-24 Thread Ram Pai
On Tue, Oct 24, 2017 at 11:55:41AM +0530, Aneesh Kumar K.V wrote: > Ram Pai writes: > > > Introduce helper functions that can initialize the bits in the AMR, > > IAMR and UAMOR register; the bits that correspond to the given pkey. > > > > Signed-off-by: Ram Pai

Re: [PATCH 09/25] powerpc: ability to create execute-disabled pkeys

2017-10-24 Thread Aneesh Kumar K.V
Ram Pai writes: > On Wed, Oct 18, 2017 at 02:42:56PM +1100, Balbir Singh wrote: >> On Fri, 8 Sep 2017 15:44:57 -0700 >> Ram Pai wrote: >> >> > powerpc has hardware support to disable execute on a pkey. >> > This patch enables the ability to create

Re: [PATCH 03/25] powerpc: track allocation status of all pkeys

2017-10-24 Thread Aneesh Kumar K.V
Ram Pai writes: + > +#define mm_set_pkey_is_allocated(mm, pkey) \ > + (mm_pkey_allocation_map(mm) & pkey_alloc_mask(pkey)) > + > static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) > { > - return (pkey == 0); > + /* a reserved key is

Re: [PATCH 05/25] powerpc: helper functions to initialize AMR, IAMR and UAMOR registers

2017-10-24 Thread Aneesh Kumar K.V
Ram Pai writes: > Introduce helper functions that can initialize the bits in the AMR, > IAMR and UAMOR register; the bits that correspond to the given pkey. > > Signed-off-by: Ram Pai > --- > arch/powerpc/include/asm/pkeys.h |1 + >

Re: [PATCH v2 3/8] powerpc/mm: Separate ibm, dynamic-memory data from DT format

2017-10-24 Thread Michael Ellerman
Nathan Fontenot writes: > diff --git a/arch/powerpc/mm/drmem.c b/arch/powerpc/mm/drmem.c > new file mode 100644 > index ..8ad7cf36b2c4 > --- /dev/null > +++ b/arch/powerpc/mm/drmem.c > @@ -0,0 +1,84 @@ > +/* > + * Dynamic reconfiguration memory support > + *