[RFC v3 22/23] Documentation: PowerPC specific updates to memory protection keys

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

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

2017-06-21 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 files changed, 13 inse

[PATCH 00/17] cxlflash: LUN provisioning support and miscellaneous fixes

2017-06-21 Thread Uma Krishnan
This patch series contains miscellaneous fixes and several enhancements such as LUN provisioning support, WS16 unmap and AFU debug capabilities. This series is intended for 4.13 and is bisectable. Matthew R. Ochs (8): cxlflash: Separate AFU internal command handling from AFU sync specifics

[PATCH 01/17] cxlflash: Combine the send queue locks

2017-06-21 Thread Uma Krishnan
Currently there are separate spin locks for the two supported I/O queueing models. This makes it difficult to serialize with paths outside the enqueue path. As a design simplification and to support serialization with enqueue operations, move to only a single lock that is used for enqueueing regar

[PATCH 02/17] cxlflash: Update cxlflash_afu_sync() to return errno

2017-06-21 Thread Uma Krishnan
The cxlflash_afu_sync() routine returns a negative one to indicate any kind of failure. This makes it impossible to establish why the error occurred. Update the return codes to clearly indicate the failure cause to the caller. Signed-off-by: Uma Krishnan --- drivers/scsi/cxlflash/main.c | 11 ++

[PATCH 03/17] cxlflash: Reset hardware queue context via specified register

2017-06-21 Thread Uma Krishnan
Per the SISLite specification, context_reset() writes 0x1 to the LSB of the reset register. When the AFU processes this reset request, it is expected to clear the bit after reset is complete. The current implementation simply checks that the entire value read back is not 1, instead of masking off t

[PATCH 04/17] cxlflash: Schedule asynchronous reset of the host

2017-06-21 Thread Uma Krishnan
A context reset failure indicates the AFU is in a bad state. At present, when such a situation occurs, no further action is taken. This leaves the adapter in an unusable state with no recoverable actions. To avoid this situation, context reset failures will be escalated to a host reset operation.

[PATCH 05/17] cxlflash: Handle AFU sync failures

2017-06-21 Thread Uma Krishnan
AFU sync operations are not currently evaluated for failure. This is acceptable for paths where there is not a dependency on the AFU being consistent with the host. Examples include link reset events and LUN cleanup operations. On paths where there is a dependency, such as a LUN open, a sync failur

[PATCH 06/17] cxlflash: Track pending scsi commands in each hardware queue

2017-06-21 Thread Uma Krishnan
Currently, there is no book keeping of the pending scsi commands in the cxlflash driver. This lack of tracking in-flight requests is too restrictive and requires a heavy-hammer reset each time an adapter error is encountered. Additionally, it does not allow for commands to be properly retried. In

[PATCH 07/17] cxlflash: Flush pending commands in cleanup path

2017-06-21 Thread Uma Krishnan
When the AFU is reset in an error path, pending scsi commands can be silently dropped without completion or a formal abort. This puts the onus on the cxlflash driver to notify mid-layer and indicating that the command can be retried. Once the card has been quiesced, the hardware send queue lock is

[PATCH 08/17] cxlflash: Add scsi command abort handler

2017-06-21 Thread Uma Krishnan
To date, CXL flash devices do not support a single command abort operation. Instead, the SISLite specification provides a context reset operation to cleanup all pending commands for a given context. When a context reset is successful, it is guaranteed that the AFU has aborted all currently pending

[PATCH 09/17] cxlflash: Create character device to provide host management interface

2017-06-21 Thread Uma Krishnan
The cxlflash driver currently lacks host management interface. Future devices supported by cxlflash will provide a variety of host-wide management functions. Examples include LUN provisioning, hardware debug support, and firmware download. In order to provide a way to manage the device, a characte

[PATCH 10/17] cxlflash: Separate AFU internal command handling from AFU sync specifics

2017-06-21 Thread Uma Krishnan
From: "Matthew R. Ochs" To date the only supported internal AFU command is AFU sync. The logic to send an internal AFU command is embedded in the specific AFU sync handler and would need to be duplicated for new internal AFU commands. In order to support new internal AFU commands, separate code

[PATCH 11/17] cxlflash: Introduce host ioctl support

2017-06-21 Thread Uma Krishnan
From: "Matthew R. Ochs" As staging for supporting various host management functions, add a host ioctl infrastructure to filter ioctl commands and perform operations that are common for all host ioctls. Also update the cxlflash documentation to create a new section for documenting host ioctls. Si

[PATCH 12/17] cxlflash: Refactor AFU capability checking

2017-06-21 Thread Uma Krishnan
From: "Matthew R. Ochs" The existing AFU capability checking infrastructure is closely tied to the command mode capability bits. In order to support new capabilities, refactor the existing infrastructure to be more generic. Signed-off-by: Matthew R. Ochs Signed-off-by: Uma Krishnan --- driver

[PATCH 13/17] cxlflash: Support LUN provisioning

2017-06-21 Thread Uma Krishnan
From: "Matthew R. Ochs" Adopt the SISLite AFU LUN provisioning capability to allow future CXL Flash adapters the ability to better manage storage. Update the SISLite header with the changes necessary to support LUN provision operations and create a host ioctl interface for user LUN management sof

[PATCH 14/17] cxlflash: Support AFU debug

2017-06-21 Thread Uma Krishnan
From: "Matthew R. Ochs" Adopt the SISLite AFU debug capability to allow future CXL Flash adapters the ability to better debug AFU issues. Update the SISLite header with the changes necessary to support AFU debug operations and create a host ioctl interface for user debug software. Also update the

[PATCH 15/17] cxlflash: Support WS16 unmap

2017-06-21 Thread Uma Krishnan
From: "Matthew R. Ochs" The cxlflash driver supports performing a write-same16 to scrub virtual luns when they are released by a user. To date, AFUs for adapters that are supported by cxlflash do not have the capability to unmap as part of the WS operation. This can lead to fragmented flash devic

[PATCH 16/17] cxlflash: Remove zeroing of private command data

2017-06-21 Thread Uma Krishnan
From: "Matthew R. Ochs" The SCSI core now zeroes the per-command private data area prior to calling into the LLD. Replace the clearing operation that takes place when the private command data reference is obtained with a routine that performs common initializations. The zeroing that takes place i

[PATCH 17/17] cxlflash: Update TMF command processing

2017-06-21 Thread Uma Krishnan
From: "Matthew R. Ochs" Currently, the SCSI command presented to the device reset handler is used to send TMFs to the AFU for a device reset. This behavior is incorrect as the command presented is an actual command and not a special notification. As such, it should only be used for reference and

Re: [PATCH v3 1/6] powerpc64/elfv1: Validate function pointer address in the function descriptor

2017-06-21 Thread Nicholas Piggin
On Thu, 22 Jun 2017 00:08:37 +0530 "Naveen N. Rao" wrote: > Currently, we assume that the function pointer we receive in > ppc_function_entry() points to a function descriptor. However, this is > not always the case. In particular, assembly symbols without the right > annotation do not have an as

Re: [PATCH v3 2/6] powerpc/64s: Convert .L__replay_interrupt_return to a local label

2017-06-21 Thread Nicholas Piggin
On Thu, 22 Jun 2017 00:08:38 +0530 "Naveen N. Rao" wrote: > Commit b48bbb82e2b835 ("powerpc/64s: Don't unbalance the return branch > predictor in __replay_interrupt()") introduced __replay_interrupt_return > symbol with '.L' prefix in hopes of keeping it private. However, due to > the use of LOAD

Re: [PATCH v3 3/6] powerpc/64s: Blacklist system_call() and system_call_common() from kprobes

2017-06-21 Thread Nicholas Piggin
On Thu, 22 Jun 2017 00:08:39 +0530 "Naveen N. Rao" wrote: > Convert some of the symbols into private symbols 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 s

Re: [PATCH v3 4/6] powerpc/64s: Un-blacklist system_call() from kprobes

2017-06-21 Thread Nicholas Piggin
On Thu, 22 Jun 2017 00:08:40 +0530 "Naveen N. Rao" wrote: > It is actually safe to probe system_call() in entry_64.S, but only till > we unset MSR_RI. To allow this, add a new symbol system_call_exit() > after the mtmsrd and blacklist that. Though the mtmsrd instruction > itself is now whiteliste

Re: [PATCH v3 5/6] powerpc/64s: Blacklist functions invoked on a trap

2017-06-21 Thread Nicholas Piggin
On Thu, 22 Jun 2017 00:08:41 +0530 "Naveen N. Rao" wrote: > Blacklist all functions involved while handling a trap. We: > - convert some of the symbols into private symbols, > - remove the duplicate 'restore' symbol, and > - blacklist most functions involved while handling a trap. I'm not sure r

Re: [PATCH v3 6/6] powerpc/64s: Blacklist rtas entry/exit from kprobes

2017-06-21 Thread Nicholas Piggin
On Thu, 22 Jun 2017 00:08:42 +0530 "Naveen N. Rao" wrote: > We can't take traps with relocation off, so blacklist enter_rtas() and > rtas_return_loc(). However, instead of blacklisting all of enter_rtas(), > introduce a new symbol __enter_rtas from where on we can't take a trap > and blacklist th

Re: [PATCH 1/1] futex: remove duplicated code and fix UB

2017-06-21 Thread Darren Hart
On Wed, Jun 21, 2017 at 01:53:18PM +0200, Jiri Slaby wrote: > There is code duplicated over all architecture's headers for > futex_atomic_op_inuser. Namely op decoding, access_ok check for uaddr, > and comparison of the result. > > Remove this duplication and leave up to the arches only the needed

Re: 1M hugepage size being registered on Linux

2017-06-21 Thread Michael Ellerman
Hi Victor, Someone refreshed my memory on this, coffee was involved ... victora writes: > Hi Alistair/Jeremy, > > I am working on a bug related to 1M hugepage size being registered on > Linux (Power 8 Baremetal - Garrison). On those machines the property in the device tree comes straight from

Re: [PATCH V4 2/2] powerpc/powernv : Add support for OPAL-OCC command/response interface

2017-06-21 Thread Shilpasri G Bhat
Hi Cyril, On 06/22/2017 06:28 AM, Cyril Bur wrote: > On Wed, 2017-06-21 at 13:36 +0530, Shilpasri G Bhat wrote: >> In P9, OCC (On-Chip-Controller) supports shared memory based >> commad-response interface. Within the shared memory there is an OPAL >> command buffer and OCC response buffer that can

Re: [PATCH] powerpc/mm/radix: GR field got removed in ISA 3.0B

2017-06-21 Thread Paul Mackerras
On Wed, Jun 21, 2017 at 10:50:12AM +0530, Aneesh Kumar K.V wrote: > The bit position is now marked reserved. Hence don't set the bit to 1. > > Signed-off-by: Aneesh Kumar K.V > --- > arch/powerpc/include/asm/book3s/64/mmu.h | 1 - > arch/powerpc/kvm/book3s_hv.c | 6 +- > arch/pow

Re: [PATCH V4 2/2] powerpc/powernv : Add support for OPAL-OCC command/response interface

2017-06-21 Thread Cyril Bur
On Thu, 2017-06-22 at 09:57 +0530, Shilpasri G Bhat wrote: > Hi Cyril, > > On 06/22/2017 06:28 AM, Cyril Bur wrote: > > On Wed, 2017-06-21 at 13:36 +0530, Shilpasri G Bhat wrote: > > > In P9, OCC (On-Chip-Controller) supports shared memory based > > > commad-response interface. Within the shared m

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

2017-06-21 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 vi

[RESEND PATCH V3] cxl: Export library to support IBM XSL

2017-06-21 Thread Christophe Lombard
This patch exports a in-kernel 'library' API which can be called by other drivers to help interacting with an IBM XSL on a POWER9 system. The XSL (Translation Service Layer) is a stripped down version of the PSL (Power Service Layer) used in some cards such as the Mellanox CX5. Like the PSL, it im

<    1   2