Re: [PATCH v3] powerpc: mm: support ARCH_MMAP_RND_BITS

2017-04-16 Thread Bhupesh SHARMA
On Thu, Apr 13, 2017 at 12:39 PM, Balbir Singh wrote: >>> >>> Yes. It was derived from TASK_SIZE : >>> >>> http://lxr.free-electrons.com/source/arch/powerpc/include/asm/processor.h#L105 >>> >> >> That is getting update to 128TB by default and conditionally to 512TB >> > > Since this is compile tim

Re: [PATCH] selftests/powerpc/mm: Add a test for virtual address mapping

2017-04-16 Thread Aneesh Kumar K.V
Anshuman Khandual writes: > This verifies virtual address mapping below and above the > 128TB range and makes sure that address returned are within > the expected range depending upon the hint passed from the > user space. > > Signed-off-by: Anshuman Khandual > --- > Tested this on latest ppc-ne

Re: [PATCH] powerpc/64s: Minor fix for MCE TLB flush for radix

2017-04-16 Thread Aneesh Kumar K.V
Nicholas Piggin writes: > The TLB flush for radix first flushes TLB for radix configuration, > then flushes for hash configuration. The second flush is unnecessary > but does not affect correctness. > > Fixes: 1a472c9dba6b9 ("powerpc/mm/radix: Add tlbflush routines") > Signed-off-by: Nicholas Pig

Re: [PATCH v3 1/6] powerpc/perf: Define big-endian version of perf_mem_data_src

2017-04-16 Thread Madhavan Srinivasan
On Thursday 13 April 2017 06:53 PM, Michael Ellerman wrote: Peter Zijlstra writes: On Tue, Apr 11, 2017 at 07:21:05AM +0530, Madhavan Srinivasan wrote: From: Sukadev Bhattiprolu perf_mem_data_src is an union that is initialized via the ->val field and accessed via the bitmap fields. For t

Re: [PATCH v3 1/6] powerpc/perf: Define big-endian version of perf_mem_data_src

2017-04-16 Thread Madhavan Srinivasan
On Thursday 13 April 2017 06:08 PM, Peter Zijlstra wrote: On Tue, Apr 11, 2017 at 07:21:05AM +0530, Madhavan Srinivasan wrote: From: Sukadev Bhattiprolu perf_mem_data_src is an union that is initialized via the ->val field and accessed via the bitmap fields. For this to work on big endian pl

Re: [PATCH] selftests/powerpc/mm: Add a test for virtual address mapping

2017-04-16 Thread Anshuman Khandual
On 04/15/2017 01:48 AM, Michal Suchanek wrote: > Hello, > > On Wed, 12 Apr 2017 15:11:12 +0530 > Anshuman Khandual wrote: > >> This verifies virtual address mapping below and above the >> 128TB range and makes sure that address returned are within >> the expected range depending upon the hint pa

[PATCH v8 11/12] powerpc: Add new set of soft_disable_mask_ functions

2017-04-16 Thread Madhavan Srinivasan
To support disabling and enabling of irq with PMI, set of new powerpc_local_irq_pmu_save() and powerpc_local_irq_restore() functions are added. And powerpc_local_irq_save() implemented, by adding a new soft_disable_mask manipulation function soft_disable_mask_or_return(). Local_irq_pmu_* macros ar

[PATCH v8 09/12] powerpc: Add support to mask perf interrupts and replay them

2017-04-16 Thread Madhavan Srinivasan
Two new bit mask field "IRQ_DISABLE_MASK_PMU" is introduced to support the masking of PMI and "IRQ_DISABLE_MASK_ALL" to aid interrupt masking checking. Couple of new irq #defs "PACA_IRQ_PMI" and "SOFTEN_VALUE_0xf0*" added to use in the exception code to check for PMI interrupts. In the masked_int

[PATCH v8 12/12] powerpc: rewrite local_t using soft_irq

2017-04-16 Thread Madhavan Srinivasan
Local atomic operations are fast and highly reentrant per CPU counters. Used for percpu variable updates. Local atomic operations only guarantee variable modification atomicity wrt the CPU which owns the data and these needs to be executed in a preemption safe way. Here is the design of this patch

[PATCH v8 08/12] powerpc: Add support to take additional parameter in MASKABLE_* macro

2017-04-16 Thread Madhavan Srinivasan
To support addition of "bitmask" to MASKABLE_* macros, factor out the EXCPETION_PROLOG_1 macro. Make it explicit the interrupt masking supported by a gievn interrupt handler. Patch correspondingly extends the MASKABLE_* macros with an addition's parameter. "bitmask" parameter is passed to SOFTEN_T

[PATCH v8 10/12] powerpc:Add new kconfig IRQ_DEBUG_SUPPORT

2017-04-16 Thread Madhavan Srinivasan
New Kconfig is added "CONFIG_IRQ_DEBUG_SUPPORT" to add warn_on to alert the invalid transitions. Also moved the code under the CONFIG_TRACE_IRQFLAGS in arch_local_irq_restore() to new Kconfig. Reviewed-by: Nicholas Piggin Signed-off-by: Madhavan Srinivasan --- arch/powerpc/Kconfig | 4

[PATCH v8 07/12] powerpc: Avoid using EXCEPTION_PROLOG_1 macro in MASKABLE_*

2017-04-16 Thread Madhavan Srinivasan
Currently we use both EXCEPTION_PROLOG_1 and __EXCEPTION_PROLOG_1 in the MASKABLE_* macros. As a cleanup, this patch makes MASKABLE_* to use only __EXCEPTION_PROLOG_1. There is not logic change. Reviewed-by: Nicholas Piggin Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/excepti

[PATCH v8 05/12] powerpc: reverse the soft_enable logic

2017-04-16 Thread Madhavan Srinivasan
"paca->soft_enabled" is used as a flag to mask some of interrupts. Currently supported flags values and their details: soft_enabledMSR[EE] 0 0 Disabled (PMI and HMI not masked) 1 1 Enabled "paca->soft_enabled" is initialized to 1 to make the interripts

[PATCH v8 06/12] powerpc: Rename soft_enabled to soft_disable_mask

2017-04-16 Thread Madhavan Srinivasan
Rename the paca->soft_enabled to paca->soft_disable_mask as it is no more used as a flag for interrupt state. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/hw_irq.h | 26 +- arch/powerpc/include/asm/kvm_ppc.h | 2 +- arch/powerpc/include/asm/paca.h

[PATCH v8 03/12] powerpc: Use soft_enabled_set api to update paca->soft_enabled

2017-04-16 Thread Madhavan Srinivasan
Force use of soft_enabled_set() wrapper to update paca-soft_enabled wherever possisble. Also add a new wrapper function, soft_enabled_set_return(), added to force the paca->soft_enabled updates. Reviewed-by: Nicholas Piggin Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/hw_irq.

[PATCH v8 04/12] powerpc: Add soft_enabled manipulation functions

2017-04-16 Thread Madhavan Srinivasan
Add new soft_enabled_* manipulation function and implement arch_local_* using the soft_enabled_* wrappers. Reviewed-by: Nicholas Piggin Signed-off-by: Madhavan Srinivasan --- arch/powerpc/include/asm/hw_irq.h | 32 ++-- 1 file changed, 14 insertions(+), 18 deletions(

[PATCH v8 02/12] powerpc: move set_soft_enabled() and rename

2017-04-16 Thread Madhavan Srinivasan
Move set_soft_enabled() from powerpc/kernel/irq.c to asm/hw_irq.c, to force updates to paca-soft_enabled done via these access function. Add "memory" clobber to hint compiler since paca->soft_enabled memory is the target here Renaming it as soft_enabled_set() will make namespaces works better as p

[PATCH v8 01/12] powerpc: Add #defs for paca->soft_enabled flags

2017-04-16 Thread Madhavan Srinivasan
Two #defs IRQ_DISABLE_LEVEL_NONE and IRQ_DISABLE_LEVEL_LINUX are added to be used when updating paca->soft_enabled. Replace the hardcoded values used when updating paca->soft_enabled with IRQ_DISABLE_MASK_* #def. No logic change. Reviewed-by: Nicholas Piggin Signed-off-by: Madhavan Srinivasan --

[PATCH v8 00/12]powerpc: "paca->soft_enabled" based local atomic operation implementation

2017-04-16 Thread Madhavan Srinivasan
Local atomic operations are fast and highly reentrant per CPU counters. Used for percpu variable updates. Local atomic operations only guarantee variable modification atomicity wrt the CPU which owns the data and these needs to be executed in a preemption safe way. Here is the design of the patchs

Re: [PATCH v7 01/11] powerpc: move set_soft_enabled() and rename

2017-04-16 Thread Madhavan Srinivasan
On Friday 14 April 2017 04:24 AM, Michael Ellerman wrote: Madhavan Srinivasan writes: @@ -269,7 +263,7 @@ notrace void arch_local_irq_restore(unsigned long en) replay = __check_irq_replay(); /* We can soft-enable now */ - set_soft_enabled(IRQ_DISABLE_MASK_NONE); + s

[PATCH] powerpc/64s: Minor fix for MCE TLB flush for radix

2017-04-16 Thread Nicholas Piggin
The TLB flush for radix first flushes TLB for radix configuration, then flushes for hash configuration. The second flush is unnecessary but does not affect correctness. Fixes: 1a472c9dba6b9 ("powerpc/mm/radix: Add tlbflush routines") Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/mce_pow