[PATCH] powerpc: conditionally compile platform-specific serial drivers

2017-06-27 Thread Hannes Reinecke
mpsc.c and mpc52xx-psc.c are platform-specific serial drivers, and should be compiled for the respective platforms only. Signed-off-by: Hannes Reinecke --- arch/powerpc/boot/Makefile | 7 --- arch/powerpc/boot/serial.c | 4 2 files changed, 8 insertions(+), 3

Re: [RFC 2/4] libnvdimm: Add a device-tree interface

2017-06-27 Thread Oliver
Hi Mark, Thanks for the review and sorry, I really should have added more context. I was originally just going to send this to the linux-nvdimm list, but I figured the wider device-tree community might be interested too. Preamble: Non-volatile DIMMs (nvdimms) are otherwise normal DDR DIMMs that

Re: [PATCH v2] powerpc/powernv: Enable PCI peer-to-peer

2017-06-27 Thread Frederic Barrat
Le 27/06/2017 à 14:32, David Laight a écrit : From: Frederic Barrat Sent: 26 June 2017 19:09 P9 has support for PCI peer-to-peer, enabling a device to write in the mmio space of another device directly, without interrupting the CPU. This patch adds support for it on powernv, by adding a new

Re: [PATCH v2] fsl/fman: add dependency on HAS_DMA

2017-06-27 Thread David Miller
From: Madalin Bucur Date: Mon, 26 Jun 2017 18:47:00 +0300 > A previous commit (5567e989198b5a8d) inserted a dependency on DMA > API that requires HAS_DMA to be added in Kconfig. > > Signed-off-by: Madalin Bucur Applied, thank you.

Re: [PATCH] powerpc/nvram: use memdup_user

2017-06-27 Thread Kees Cook
On Fri, Apr 28, 2017 at 6:45 PM, Geliang Tang wrote: > Use memdup_user() helper instead of open-coding to simplify the code. > > Signed-off-by: Geliang Tang Thanks! Applied for -next. -Kees > --- > arch/powerpc/kernel/nvram_64.c | 14

Re: [PATCH 6/7] drm/tilcdc: clean up ifdef hacks around iowrite64

2017-06-27 Thread Arnd Bergmann
On Mon, Jun 26, 2017 at 6:26 PM, Logan Gunthorpe wrote: > Hi Jyri, > > Thanks for the ack. However, I'm reworking this patch set to use the > include/linux/io-64-nonatomic* headers which will explicitly devolve > into two 32-bit transfers. It's not clear whether this is

[PATCH v4 7/9] powerpc/mm/hash: Implement mark_rodata_ro() for hash

2017-06-27 Thread Balbir Singh
With hash we update the bolted pte to mark it read-only. We rely on the MMU_FTR_KERNEL_RO to generate the correct permissions for read-only text. The radix implementation just prints a warning in this implementation Signed-off-by: Balbir Singh ---

RE: [v3] drivers:soc:fsl:qbman:qman.c: Sleep instead of stuck hacking jiffies.

2017-06-27 Thread Leo Li
> -Original Message- > From: Scott Wood [mailto:o...@buserror.net] > Sent: Saturday, June 24, 2017 9:47 PM > To: Karim Eshapa > Cc: Roy Pledge ; linux-ker...@vger.kernel.org; > Claudiu Manoil ; colin.k...@canonical.com;

RE: [PATCH] soc/qman: Sleep instead of stuck hacking jiffies.

2017-06-27 Thread Leo Li
> -Original Message- > From: Linuxppc-dev [mailto:linuxppc-dev- > bounces+leoli=freescale@lists.ozlabs.org] On Behalf Of David Laight > Sent: Monday, June 26, 2017 10:55 AM > To: 'Karim Eshapa' ; o...@buserror.net > Cc: Roy Pledge ;

Re: [RFC v4 09/17] powerpc: call the hash functions with the correct pkey value

2017-06-27 Thread Aneesh Kumar K.V
On Tuesday 27 June 2017 03:41 PM, Ram Pai wrote: Pass the correct protection key value to the hash functions on page fault. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/pkeys.h | 11 +++ arch/powerpc/mm/hash_utils_64.c | 4 arch/powerpc/mm/mem.c

Re: [next-20170609] Oops while running CPU off-on (cpuset.c/cpuset_can_attach)

2017-06-27 Thread Tejun Heo
Hello, Abdul. Sorry about the long delay. On Mon, Jun 12, 2017 at 04:53:42PM +0530, Abdul Haleem wrote: > linux-next kernel crashed while running CPU offline and online. > > Machine: Power 8 LPAR > Kernel : 4.12.0-rc4-next-20170609 > gcc : version 5.2.1 > config: attached > testcase: CPU off/on

RE: [PATCH] fsl/fman: add dependency on HAS_DMA

2017-06-27 Thread Madalin-cristian Bucur
> -Original Message- > From: geert.uytterhoe...@gmail.com [mailto:geert.uytterhoe...@gmail.com] > On Behalf Of Geert Uytterhoeven > Sent: Monday, June 26, 2017 7:17 PM > To: Fabio Estevam > Cc: Madalin-cristian Bucur ; > net...@vger.kernel.org;

[PATCH 1/2] powerpc/smp: Do not BUG_ON if invalid CPU during kick

2017-06-27 Thread Santosh Sivaraj
During secondary start, we do not need to BUG_ON if an invalid CPU number is passed. We already print an error if secondary cannot be started, so just return an error instead. Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/smp.c| 3 ++-

[PATCH v4 4/9] powerpc/xmon: Add patch_instruction() support for xmon

2017-06-27 Thread Balbir Singh
Move from mwrite() to patch_instruction() for xmon for breakpoint addition and removal. Signed-off-by: Balbir Singh --- arch/powerpc/xmon/xmon.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c

[PATCH v4 3/9] powerpc/kprobes/optprobes: Move over to patch_instruction

2017-06-27 Thread Balbir Singh
With text moving to read-only migrate optprobes to using the patch_instruction infrastructure. Without this optprobes will fail and complain. Signed-off-by: Balbir Singh --- arch/powerpc/kernel/optprobes.c | 58 ++--- 1 file changed, 37

RE: [PATCH 1/2] fsl/fman: propagate dma_ops

2017-06-27 Thread Madalin-cristian Bucur
> -Original Message- > From: geert.uytterhoe...@gmail.com [mailto:geert.uytterhoe...@gmail.com] > On Behalf Of Geert Uytterhoeven > Sent: Monday, June 26, 2017 7:24 PM > To: Madalin-cristian Bucur > Cc: net...@vger.kernel.org; David S. Miller ;

[PATCH v4 2/9] powerpc/kprobes: Move kprobes over to patch_instruction

2017-06-27 Thread Balbir Singh
arch_arm/disarm_probe use direct assignment for copying instructions, replace them with patch_instruction Signed-off-by: Balbir Singh --- arch/powerpc/kernel/kprobes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/kprobes.c

Re: [PATCH v4 3/9] powerpc/kprobes/optprobes: Move over to patch_instruction

2017-06-27 Thread Christophe LEROY
Le 27/06/2017 à 09:48, Balbir Singh a écrit : With text moving to read-only migrate optprobes to using the patch_instruction infrastructure. Without this optprobes will fail and complain. Signed-off-by: Balbir Singh Didn't Michael picked it up already ? Christophe

Re: [PATCH] kallsyms: optimize kallsyms_lookup_name() for a few cases

2017-06-27 Thread Naveen N. Rao
On 2017/04/27 11:21AM, Masami Hiramatsu wrote: > On Thu, 27 Apr 2017 01:38:10 +0530 > "Naveen N. Rao" wrote: > > > Michael Ellerman wrote: > > > "Naveen N. Rao" writes: > > >> diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c >

[RFC v4 00/17] powerpc: Memory Protection Keys

2017-06-27 Thread Ram Pai
Memory protection keys enable applications to protect its address space from inadvertent access or corruption from itself. The overall idea: A process allocates a key and associates it with a address range withinits address space. The process than can dynamically set

[PATCH 2/2] powerpc/smp: Convert NR_CPUS to nr_cpu_ids

2017-06-27 Thread Santosh Sivaraj
nr_cpu_ids can be limited by nr_cpus boot parameter, whereas NR_CPUS is a compile time constant, which shouldn't be compared against during cpu kick. Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/smp.c| 2 +- arch/powerpc/platforms/cell/smp.c| 2 +-

[PATCH v4 5/9] powerpc/vmlinux.lds: Align __init_begin to 16M

2017-06-27 Thread Balbir Singh
For CONFIG_STRICT_KERNEL_RWX align __init_begin to 16M. We use 16M since its the larger of 2M on radix and 16M on hash for our linear mapping. The plan is to have .text, .rodata and everything upto __init_begin marked as RX. Note we still have executable read only data. We could further align

[PATCH v4 6/9] powerpc/platform/pseries/lpar: Fix updatepp and updateboltedpp

2017-06-27 Thread Balbir Singh
PAPR has pp0 in bit 55, currently we assumed that bit pp0 is bit 0 (all bits in IBM order). This patch fixes the pp0 bits for both these routines that use H_PROTECT. (e58e87a powerpc/mm: Update _PAGE_KERNEL_RO) Signed-off-by: Balbir Singh ---

[PATCH v4 8/9] powerpc/mm/radix: Implement mark_rodata_ro() for radix

2017-06-27 Thread Balbir Singh
The patch splits the linear page mapping such that the ones with kernel text are mapped as 2M and others are mapped with the largest possible size - 1G. The downside of this is that we split a 1G mapping into 512 2M mappings for the kernel, but in the absence of that we cannot support R/O areas in

Re: [PATCH v4 1/9] powerpc/lib/code-patching: Use alternate map for patch_instruction()

2017-06-27 Thread Christophe LEROY
Le 27/06/2017 à 09:48, Balbir Singh a écrit : This patch creates the window using text_poke_area, allocated via get_vm_area(). text_poke_area is per CPU to avoid locking. text_poke_area for each cpu is setup using late_initcall, prior to setup of these alternate mapping areas, we continue to

[PATCH v4 1/9] powerpc/lib/code-patching: Use alternate map for patch_instruction()

2017-06-27 Thread Balbir Singh
This patch creates the window using text_poke_area, allocated via get_vm_area(). text_poke_area is per CPU to avoid locking. text_poke_area for each cpu is setup using late_initcall, prior to setup of these alternate mapping areas, we continue to use direct write to change/modify kernel text. With

[PATCH v4 0/9] Provide STRICT_KERNEL_RWX for powerpc

2017-06-27 Thread Balbir Singh
Provide STRICT_KERNEL_RWX for PPC64/BOOK3S These patches enable RX mappings of kernel text. rodata is mapped RX as well as a trade-off, there are more details in the patch description As a prerequisite for R/O text, patch_instruction is moved over to using a separate mapping that allows write to

Re: [PATCH] powerpc/perf: Add POWER9 alternate PM_RUN_CYC and PM_RUN_INST_CMPL events

2017-06-27 Thread Madhavan Srinivasan
On Monday 19 June 2017 05:21 AM, Anton Blanchard wrote: From: Anton Blanchard Similar to POWER8, POWER9 can count run cycles and run instructions completed on more than one PMU. Acked-by: Madhavan Srinivasan Signed-off-by: Anton Blanchard

Re: [PATCH v3 4/6] powerpc/mm: Add devmap support for ppc64

2017-06-27 Thread Oliver
On Tue, Jun 27, 2017 at 12:33 PM, Michael Ellerman wrote: > kbuild test robot writes: > >> Hi Oliver, >> >> [auto build test ERROR on powerpc/next] >> [also build test ERROR on v4.12-rc6 next-20170623] >> [if your patch is applied to the wrong git tree,

Re: [PATCH v4 2/9] powerpc/kprobes: Move kprobes over to patch_instruction

2017-06-27 Thread Christophe LEROY
Le 27/06/2017 à 09:48, Balbir Singh a écrit : arch_arm/disarm_probe use direct assignment for copying instructions, replace them with patch_instruction Signed-off-by: Balbir Singh Didn't Michael picked it up already ? Christophe --- arch/powerpc/kernel/kprobes.c

[PATCH v4 9/9] powerpc/Kconfig: Enable STRICT_KERNEL_RWX

2017-06-27 Thread Balbir Singh
We have the basic support in the form of patching R/O text sections, linker scripts for extending alignment of text data. We've also got mark_rodata_ro() NOTE: There is a temporary work-around for disabling STRICT_KERNEL_RWX if CONFIG_HIBERNATION is enabled Signed-off-by: Balbir Singh

Re: [PATCH 1/2] powerpc/fadump: return 0 on re-registration

2017-06-27 Thread Michal Suchánek
On Mon, 26 Jun 2017 16:06:00 +0200 Michal Suchanek wrote: > When fadump is already registered return success. > > Currently EEXIST is returned which is difficult to handle race-free in > userspace when shell scripts are used. If multiple writers are trying > to write '1'

[RFC v4 02/17] mm: ability to disable execute permission on a key at creation

2017-06-27 Thread Ram Pai
Currently sys_pkey_create() provides the ability to disable read and write permission on the key, at creation. powerpc has the hardware support to disable execute on a pkey as well.This patch enhances the interface to let disable execute at key creation time. x86 does not allow this.

[RFC v4 07/17] powerpc: make the hash functions protection-key aware

2017-06-27 Thread Ram Pai
Prepare the hash functions to be aware of protection keys. This key will later be used to program the HPTE. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/hash.h | 2 +- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 14 ++-

[RFC v4 17/17] procfs: display the protection-key number associated with a vma

2017-06-27 Thread Ram Pai
Display the pkey number associated with the vma in smaps of a task. The key will be seen as below: VmFlags: rd wr mr mw me dw ac key=0 Signed-off-by: Ram Pai --- Documentation/filesystems/proc.txt | 3 ++- fs/proc/task_mmu.c | 22 +++--- 2

[RFC v4 03/17] x86: key creation with PKEY_DISABLE_EXECUTE disallowed

2017-06-27 Thread Ram Pai
x86 does not support disabling execute permissions on a pkey. Signed-off-by: Ram Pai --- arch/x86/kernel/fpu/xstate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index c24ac1e..d582631 100644 ---

[RFC v4 12/17] powerpc: Deliver SEGV signal on pkey violation

2017-06-27 Thread Ram Pai
The value of the AMR register at the time of exception is made available in gp_regs[PT_AMR] of the siginfo. The value of the pkey, whose protection got violated, is made available in si_pkey field of the siginfo structure. Signed-off-by: Ram Pai ---

[RFC v4 16/17] Documentation: PowerPC specific updates to memory protection keys

2017-06-27 Thread Ram Pai
Add documentation updates that capture PowerPC specific changes. Signed-off-by: Ram Pai --- Documentation/vm/protection-keys.txt | 89 1 file changed, 69 insertions(+), 20 deletions(-) diff --git a/Documentation/vm/protection-keys.txt

Re: [RFC v4 01/17] mm: introduce an additional vma bit for powerpc pkey

2017-06-27 Thread Balbir Singh
On Tue, 2017-06-27 at 03:11 -0700, Ram Pai wrote: > Currently there are only 4bits in the vma flags to support 16 keys > on x86. powerpc supports 32 keys, which needs 5bits. This patch > introduces an addition bit in the vma flags. > > Signed-off-by: Ram Pai > --- >

Re: [PATCH v4 1/9] powerpc/lib/code-patching: Use alternate map for patch_instruction()

2017-06-27 Thread Balbir Singh
On Tue, 2017-06-27 at 10:32 +0200, Christophe LEROY wrote: > > Le 27/06/2017 à 09:48, Balbir Singh a écrit : > > This patch creates the window using text_poke_area, allocated > > via get_vm_area(). text_poke_area is per CPU to avoid locking. > > text_poke_area for each cpu is setup using

Re: [PATCH] kernel/power/suspend: use CONFIG_HAVE_SET_MEMORY for include condition

2017-06-27 Thread Balbir Singh
On Tue, Jun 27, 2017 at 7:07 AM, Rafael J. Wysocki wrote: > On Monday, June 26, 2017 01:34:52 PM Balbir Singh wrote: >> On Sat, Jun 3, 2017 at 11:27 PM, Pavel Machek wrote: >> > On Sat 2017-06-03 20:52:32, Balbir Singh wrote: >> >> Kbuild reported a build

[RFC v4 04/17] powerpc: Implement sys_pkey_alloc and sys_pkey_free system call

2017-06-27 Thread Ram Pai
Sys_pkey_alloc() allocates and returns available pkey Sys_pkey_free() frees up the pkey. Total 32 keys are supported on powerpc. However pkey 0,1 and 31 are reserved. So effectively we have 29 pkeys. Each key can be initialized to disable read, write and execute permissions. On powerpc a

[RFC v4 11/17] powerpc: Handle exceptions caused by pkey violation

2017-06-27 Thread Ram Pai
Handle Data and Instruction exceptions caused by memory protection-key. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mmu_context.h | 12 ++ arch/powerpc/include/asm/reg.h | 2 +- arch/powerpc/mm/fault.c| 20 +

[RFC 1/4] libnvdimm: add to_{nvdimm,nd_region}_dev()

2017-06-27 Thread Oliver O'Halloran
struct device contains the ->of_node pointer so that devices can be assoicated with the device-tree node that created them on DT platforms. libnvdimm hides the struct device for regions and nvdimm devices inside of an opaque structure so this patch adds accessors for each to allow the of_nvdimm

Re: [PATCH backport pre-4.9] powerpc/slb: Force a full SLB flush when we insert for a bad EA

2017-06-27 Thread Greg Kroah-Hartman
On Thu, Jun 22, 2017 at 04:52:51PM +1000, Michael Ellerman wrote: > 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

Re: [PATCH v4 3/9] powerpc/kprobes/optprobes: Move over to patch_instruction

2017-06-27 Thread Balbir Singh
On Tue, 2017-06-27 at 10:34 +0200, Christophe LEROY wrote: > > Le 27/06/2017 à 09:48, Balbir Singh a écrit : > > With text moving to read-only migrate optprobes to using > > the patch_instruction infrastructure. Without this optprobes > > will fail and complain. > > > > Signed-off-by: Balbir

Re: [RFC v4 03/17] x86: key creation with PKEY_DISABLE_EXECUTE disallowed

2017-06-27 Thread Balbir Singh
On Tue, 2017-06-27 at 03:11 -0700, Ram Pai wrote: > x86 does not support disabling execute permissions on a pkey. > > Signed-off-by: Ram Pai > --- > arch/x86/kernel/fpu/xstate.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/kernel/fpu/xstate.c

[RFC v4 06/17] powerpc: Implementation for sys_mprotect_pkey() system call

2017-06-27 Thread Ram Pai
This system call, associates the pkey with vma corresponding to the given address range. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mman.h| 8 ++- arch/powerpc/include/asm/pkeys.h | 17 ++- arch/powerpc/include/asm/systbl.h | 1 +

[RFC v4 08/17] powerpc: Program HPTE key protection bits

2017-06-27 Thread Ram Pai
Map the PTE protection key bits to the HPTE key protection bits, while creating HPTE entries. Signed-off-by: Ram Pai --- Makefile | 2 +- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 5 + arch/powerpc/include/asm/pkeys.h

[RFC 4/4] powerpc/powernv: Create platform devs for nvdimm buses

2017-06-27 Thread Oliver O'Halloran
Scan the devicetree for nonvolatile-memory buses and instantiate a platform device for them. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/opal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms/powernv/opal.c

[RFC 3/4] powerpc: Add pmem API support

2017-06-27 Thread Oliver O'Halloran
Adds powerpc64 implementations of: memcpy_flushcache() arch_wb_cache_pmem() arch_invalidate_pmem() Which form the architecture-specific portition of the persistent memory API. These functions provide cache-management primitives for the DAX drivers and libNVDIMM.

[RFC v4 01/17] mm: introduce an additional vma bit for powerpc pkey

2017-06-27 Thread Ram Pai
Currently there are only 4bits in the vma flags to support 16 keys on x86. powerpc supports 32 keys, which needs 5bits. This patch introduces an addition bit in the vma flags. Signed-off-by: Ram Pai --- fs/proc/task_mmu.c | 6 +- include/linux/mm.h | 18

Re: [RFC 2/4] libnvdimm: Add a device-tree interface

2017-06-27 Thread Mark Rutland
Hi, On Tue, Jun 27, 2017 at 08:28:49PM +1000, Oliver O'Halloran wrote: > A fairly bare-bones set of device-tree bindings so libnvdimm can be used > on powerpc and other, less cool, device-tree based platforms. ;) > Cc: devicet...@vger.kernel.org > Signed-off-by: Oliver O'Halloran

[RFC v4 05/17] powerpc: store and restore the pkey state across context switches

2017-06-27 Thread Ram Pai
Store and restore the AMR, IAMR and UMOR register state of the task before scheduling out and after scheduling in, respectively. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/processor.h | 5 + arch/powerpc/kernel/process.c| 18 ++ 2 files

[RFC v4 09/17] powerpc: call the hash functions with the correct pkey value

2017-06-27 Thread Ram Pai
Pass the correct protection key value to the hash functions on page fault. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/pkeys.h | 11 +++ arch/powerpc/mm/hash_utils_64.c | 4 arch/powerpc/mm/mem.c| 6 ++ 3 files changed, 21

[RFC v4 15/17] Documentation: Move protecton key documentation to arch neutral directory

2017-06-27 Thread Ram Pai
Since PowerPC and Intel both support memory protection keys, moving the documenation to arch-neutral directory. Signed-off-by: Ram Pai --- Documentation/vm/protection-keys.txt | 85 +++ Documentation/x86/protection-keys.txt | 85

[RFC 2/4] libnvdimm: Add a device-tree interface

2017-06-27 Thread Oliver O'Halloran
A fairly bare-bones set of device-tree bindings so libnvdimm can be used on powerpc and other, less cool, device-tree based platforms. Cc: devicet...@vger.kernel.org Signed-off-by: Oliver O'Halloran --- The current bindings are essentially this: nonvolatile-memory {

Patch "powerpc/slb: Force a full SLB flush when we insert for a bad EA" has been added to the 3.18-stable tree

2017-06-27 Thread gregkh
This is a note to let you know that I've just added the patch titled powerpc/slb: Force a full SLB flush when we insert for a bad EA to the 3.18-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch

RE: [PATCH v2] powerpc/powernv: Enable PCI peer-to-peer

2017-06-27 Thread David Laight
From: Frederic Barrat > Sent: 26 June 2017 19:09 > P9 has support for PCI peer-to-peer, enabling a device to write in the > mmio space of another device directly, without interrupting the CPU. > > This patch adds support for it on powernv, by adding a new API to be > called by drivers. The

[RFC v4 10/17] powerpc: Macro the mask used for checking DSI exception

2017-06-27 Thread Ram Pai
Replace the magic number used to check for DSI exception with a meaningful value. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/reg.h | 7 ++- arch/powerpc/kernel/exceptions-64s.S | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git

[RFC v4 13/17] selftest: Move protecton key selftest to arch neutral directory

2017-06-27 Thread Ram Pai
Signed-off-by: Ram Pai --- tools/testing/selftests/vm/Makefile |1 + tools/testing/selftests/vm/pkey-helpers.h | 219 tools/testing/selftests/vm/protection_keys.c | 1395 + tools/testing/selftests/x86/Makefile |2

[RFC v4 14/17] selftest: PowerPC specific test updates to memory protection keys

2017-06-27 Thread Ram Pai
Abstracted out the arch specific code into the header file, and added powerpc specific changes. a) added 4k-backed hpte, memory allocator, powerpc specific. b) added three test case where the key is associated after the page is accessed/allocated/mapped. c) cleaned up the code to make

Re: [RFC v4 00/17] powerpc: Memory Protection Keys

2017-06-27 Thread Balbir Singh
On Tue, 2017-06-27 at 03:11 -0700, Ram Pai wrote: > Memory protection keys enable applications to protect its > address space from inadvertent access or corruption from > itself. > > The overall idea: > > A process allocates a key and associates it with > a address range withinits

Patch "powerpc/slb: Force a full SLB flush when we insert for a bad EA" has been added to the 4.4-stable tree

2017-06-27 Thread gregkh
This is a note to let you know that I've just added the patch titled powerpc/slb: Force a full SLB flush when we insert for a bad EA to the 4.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch

Re: [RFC v4 02/17] mm: ability to disable execute permission on a key at creation

2017-06-27 Thread Balbir Singh
On Tue, 2017-06-27 at 03:11 -0700, Ram Pai wrote: > Currently sys_pkey_create() provides the ability to disable read > and write permission on the key, at creation. powerpc has the > hardware support to disable execute on a pkey as well.This patch > enhances the interface to let disable execute

Re: powernv/npu-dma.c: Add explicit flush when sending an ATSD

2017-06-27 Thread Michael Ellerman
On Tue, 2017-06-20 at 08:37:28 UTC, Alistair Popple wrote: > NPU2 requires an extra explicit flush to an active GPU PID when sending > address translation shoot downs (ATSDs) to reliably flush the GPU TLB. This > patch adds just such a flush at the end of each sequence of ATSDs. > > We can safely

Re: [PATCH 0/8] Support for 24x7 hcall interface version 2

2017-06-27 Thread Michael Ellerman
Thiago Jung Bauermann writes: > Hello, > > The hypervisor interface to access 24x7 performance counters (which collect > performance information from system power on to system power off) has been > extended in POWER9 adding new fields to the request and result

Re: [PATCH] powerpc/powernv: Tell OPAL about our MMU mode

2017-06-27 Thread Michael Ellerman
Benjamin Herrenschmidt writes: > That will allow OPAL to configure the CPU in an optimal way. > > Signed-off-by: Benjamin Herrenschmidt > --- > > The matching OPAL change has been sent to the skiboot list. > > Setting those bits in the

Re: [PATCH backport pre-4.9] powerpc/slb: Force a full SLB flush when we insert for a bad EA

2017-06-27 Thread Michael Ellerman
Greg Kroah-Hartman writes: > On Thu, Jun 22, 2017 at 04:52:51PM +1000, Michael Ellerman wrote: >> 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

Re: [PATCH] powerpc/powernv: Rework local TLB flush for boot and MCE on POWER9

2017-06-27 Thread Nicholas Piggin
On Wed, 28 Jun 2017 08:21:55 +0530 "Aneesh Kumar K.V" wrote: > Nicholas Piggin writes: > > > There are two cases outside the normal address space management > > where a CPU's local TLB is to be flushed: > > > > 1. Host boot; in case

[PATCH] powernv:idle: Clear r12 on wakeup from stop lite

2017-06-27 Thread Akshay Adiga
pnv_wakeup_noloss expects R12 to contain SRR1 value to determine if the wakeup reason is an HMI in CHECK_HMI_INTERRUPT. When we wakeup with ESL=0, SRR1 will not contain the wakeup reason, so there is no point setting R12 to SRR1. However, we don't set R12 at all and R12 contains garbage, and

[PATCH v4 2/6] powerpc/vmemmap: Reshuffle vmemmap_free()

2017-06-27 Thread Oliver O'Halloran
Removes an indentation level and shuffles some code around to make the following patch cleaner. No functional changes. Reviewed-by: Balbir Singh Signed-off-by: Oliver O'Halloran --- v1 -> v2: Remove broken initialiser --- arch/powerpc/mm/init_64.c | 48

[PATCH v4 4/6] powerpc/mm: Add devmap support for ppc64

2017-06-27 Thread Oliver O'Halloran
Add support for the devmap bit on PTEs and PMDs for PPC64 Book3S. This is used to differentiate device backed memory from transparent huge pages since they are handled in more or less the same manner by the core mm code. Cc: Aneesh Kumar K.V Signed-off-by:

[PATCH v4 3/6] powerpc/vmemmap: Add altmap support

2017-06-27 Thread Oliver O'Halloran
Adds support to powerpc for the altmap feature of ZONE_DEVICE memory. An altmap is a driver provided region that is used to provide the backing storage for the struct pages of ZONE_DEVICE memory. In situations where large amount of ZONE_DEVICE memory is being added to the system the altmap reduces

[PATCH v4 1/6] mm, x86: Add ARCH_HAS_ZONE_DEVICE to Kconfig

2017-06-27 Thread Oliver O'Halloran
Currently ZONE_DEVICE depends on X86_64 and this will get unwieldly as new architectures (and platforms) get ZONE_DEVICE support. Move to an arch selected Kconfig option to save us the trouble. Cc: linux...@kvack.org Acked-by: Ingo Molnar Acked-by: Balbir Singh

[PATCH v4 6/6] powerpc/mm: Enable ZONE_DEVICE on powerpc

2017-06-27 Thread Oliver O'Halloran
Flip the switch. Running around and screaming "IT'S ALIVE" is optional, but recommended. Signed-off-by: Oliver O'Halloran --- v3: Only select when building for 64bit Book3-S --- arch/powerpc/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/Kconfig

Re: [PATCH] powernv:idle: Clear r12 on wakeup from stop lite

2017-06-27 Thread Nicholas Piggin
On Wed, 28 Jun 2017 06:46:49 +0530 Akshay Adiga wrote: > pnv_wakeup_noloss expects R12 to contain SRR1 value to determine if > the wakeup reason is an HMI in CHECK_HMI_INTERRUPT. > > When we wakeup with ESL=0, SRR1 will not contain the wakeup reason, so > there

[PATCH v4 5/6] powerpc/mm: Wire up hpte_removebolted for powernv

2017-06-27 Thread Oliver O'Halloran
From: Anton Blanchard Adds support for removing bolted (i.e kernel linear mapping) mappings on powernv. This is needed to support memory hot unplug operations which are required for the teardown of DAX/PMEM devices. Reviewed-by: Balbir Singh Reviewed-by:

Re: [RFC v4 17/17] procfs: display the protection-key number associated with a vma

2017-06-27 Thread Michael Ellerman
Ram Pai writes: > Display the pkey number associated with the vma in smaps of a task. > The key will be seen as below: > > VmFlags: rd wr mr mw me dw ac key=0 Why wouldn't we just emit a "ProtectionKey:" line like x86 does? See their arch_show_smap(). You should probably

Re: [PATCH] powerpc/powernv: Rework local TLB flush for boot and MCE on POWER9

2017-06-27 Thread Aneesh Kumar K.V
Nicholas Piggin writes: > There are two cases outside the normal address space management > where a CPU's local TLB is to be flushed: > > 1. Host boot; in case something has left stale entries in the > TLB (e.g., kexec). > > 2. Machine check; to clean corrupted TLB