[PATCH 09/12] powerpc/kvm: Remove obsolete kvm_vm_ioctl_xics_irq declaration

2017-03-19 Thread Benjamin Herrenschmidt
The function doesn't exist anymore Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/kvm_ppc.h | 4 1 file changed, 4 deletions(-) diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index bfef1ae..0c41865 100644 --- a/arch/powerpc/include

[PATCH 03/12] powerpc: Add more PPC bit conversion macros

2017-03-19 Thread Benjamin Herrenschmidt
Add 32 and 8 bit variants Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/bitops.h | 8 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h index bc5fdfd..33a24fd 100644 --- a/arch/powerpc/include/asm/bi

[PATCH 05/12] powerpc/smp: Remove migrate_irq() custom implementation

2017-03-19 Thread Benjamin Herrenschmidt
Some powerpc platforms use this to move IRQs away from a CPU being unplugged. This function has several bugs such as not taking the right locks or failing to NULL check pointers. There's a new generic function doing exactly the same thing without all the bugs, so let's use it instead. Signed-off-

[PATCH 02/12] powerpc: Sync opal-api.h

2017-03-19 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/opal-api.h| 302 - arch/powerpc/include/asm/opal.h| 36 +++ arch/powerpc/platforms/powernv/opal-wrappers.S | 15 ++ 3 files changed, 302 insertions(+), 51 deletions(-) diff --

[PATCH 07/12] powerpc/kvm: Massage order of #include

2017-03-19 Thread Benjamin Herrenschmidt
We traditionally have linux/ before asm/ Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kvm/book3s.c| 8 arch/powerpc/kvm/book3s_hv.c | 18 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3

[PATCH 08/12] powerpc/kvm: Make kvmppc_xics_create_icp static

2017-03-19 Thread Benjamin Herrenschmidt
It's only used within the same file it's defined Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/kvm_ppc.h | 4 arch/powerpc/kvm/book3s_xics.c | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/incl

[PATCH 04/12] powerpc: Add optional smp_ops->prepare_cpu SMP callback

2017-03-19 Thread Benjamin Herrenschmidt
Some platforms (will) need to perform allocations before bringing a new CPU online. Doing it from smp_ops->setup_cpu is the wrong thing to do: - It has no useful failure path (too late) - Calling any allocator will enable interrupts prematurely causing problems with large decrementer among ot

[PATCH 01/12] powerpc: Disable HFSCR:TM if TM not supported

2017-03-19 Thread Benjamin Herrenschmidt
Otherwise KVM guests might mess with it even when told not to causing bad thing interrupts in the host Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_64.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/set

[PATCH 2/2] powerpc/cbe: do not process external or decremeter interrupts from sreset

2017-03-19 Thread Nicholas Piggin
Cell will wake from low power state at the system reset interrupt, with the event encoded in SRR1, rather than waking at the interrupt vector that corresponds to that event. The system reset handler for this platform decodes SRR1 event reason and calls the interrupt handler to process it directly

[PATCH 1/2] powerpc/pasemi: do not process external or decrementer interrupts from sreset

2017-03-19 Thread Nicholas Piggin
PA Semi will wake from low power state at the system reset interrupt, with the event encoded in SRR1, rather than waking at the interrupt vector that corresponds to that event. The system reset handler for this platform decodes SRR1 event reason and calls the interrupt handler to process it direct

[PATCH 0/2] prepare to treat system reset handler as NMI

2017-03-19 Thread Nicholas Piggin
This change was discussed and tested last week. This just splits them up and adds a changelog and SOB tags for merge. Thanks, Nick Nicholas Piggin (2): powerpc/pasemi: do not process external or decrementer interrupts from sreset powerpc/cbe: do not process external or decremeter interrup

[PATCH 7/7] powerpc/64s: idle POWER8 avoid full state loss recovery where possible

2017-03-19 Thread Nicholas Piggin
If not all threads were in winkle, full state loss recovery is not necessary and can be avoided. A previous patch removed this optimisation due to some complexity with the implementation. Re-implement it by counting the number of threads in winkle with the per-core idle state. Only restore full sta

[PATCH 6/7] powerpc/64s: idle do not hold reservation longer than required

2017-03-19 Thread Nicholas Piggin
When taking the core idle state lock, grab it immediately like a regular lock, rather than adding more tests in there. Holding the lock keeps it stable, so there is no need to do it whole holding the reservation. Reviewed-by: Gautham R. Shenoy Signed-off-by: Nicholas Piggin --- arch/powerpc/ker

[PATCH 5/7] powerpc/64s: idle expand core idle state bits

2017-03-19 Thread Nicholas Piggin
In preparation for adding more bits to the core idle state word, move the lock bit up, and unlock by flipping the lock bit rather than masking off all but the thread bits. Add branch hints for atomic operations while we're here. Reviewed-by: Gautham R. Shenoy Signed-off-by: Nicholas Piggin ---

[PATCH 4/7] powerpc/64s: fix POWER9 machine check handler from stop state

2017-03-19 Thread Nicholas Piggin
The ISA specifies power save wakeup can cause a machine check interrupt. The machine check handler currently has code to handle that for POWER8, but POWER9 crashes when trying to execute the P8 style sleep instructions. So queue up the machine check, then call into the idle code to wake up as the

[PATCH 3/7] powerpc/64s: use alternative feature patching

2017-03-19 Thread Nicholas Piggin
This reduces the number of nops for POWER8 Reviewed-by: Gautham R. Shenoy Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/idle_book3s.S | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_b

[PATCH 2/7] powerpc/64s: stop using bit in HSPRG0 to test winkle

2017-03-19 Thread Nicholas Piggin
The POWER8 idle code has a neat trick of programming the power on engine to restore a low bit into HSPRG0, so idle wakeup code can test and see if it has been programmed this way and therefore lost all state. Restore time can be reduced if winkle has not been reached. However this messes with our

[PATCH 1/7] powerpc/64s: move remaining system reset idle code into idle_book3s.S

2017-03-19 Thread Nicholas Piggin
Should be no functional change. Reviewed-by: Gautham R. Shenoy Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 26 + arch/powerpc/kernel/idle_book3s.S| 73 2 files changed, 49 insertions(+), 50 deletions(-) diff --g

[PATCH 0/7][v3] idle fixes and changes for POWER8 and POWER9

2017-03-19 Thread Nicholas Piggin
Since last time: - Commented machine check handler wakeup to describe why registers are not lost. - Dropped patch to make PACA_THREAD_IDLE_STATE POWER8-only because Gautham will use it for POWER9 DD1. - Removed some leftover debug cruft noticed by Gautham, and re-tested on POWER8. Added some

Re: [patch] KVM: PPC: Book3S HV: check for kmalloc errors in ioctl

2017-03-19 Thread David Gibson
On Fri, Mar 17, 2017 at 11:41:14PM +0300, Dan Carpenter wrote: > kzalloc() won't actually fail because sizeof(*resize) is small, but > static checkers complain. > > Signed-off-by: Dan Carpenter Oops, that's an embarrassing mistake. Acked-by: David Gibson > > diff --git a/arch/powerpc/kvm/boo

Re: [PATCH 4/8] powerpc/64s: fix POWER9 machine check handler from stop state

2017-03-19 Thread Mahesh Jagannath Salgaonkar
On 03/16/2017 06:49 PM, Gautham R Shenoy wrote: > Hi, > > On Thu, Mar 16, 2017 at 11:05:20PM +1000, Nicholas Piggin wrote: >> On Thu, 16 Mar 2017 18:10:48 +0530 >> Mahesh Jagannath Salgaonkar wrote: >> >>> On 03/14/2017 02:53 PM, Nicholas Piggin wrote: The ISA specifies power save wakeup can

Re: [PATCH] powerpc/powernv/cpuidle: Pass correct drv->cpumask for registration

2017-03-19 Thread Vaidyanathan Srinivasan
* Michael Ellerman [2017-03-20 14:05:39]: > Vaidyanathan Srinivasan writes: > > > * Michael Neuling [2017-03-18 16:28:02]: > > > >> Vaidy, > >> > >> Thanks for fixing this. > >> > >> > drv->cpumask defaults to cpu_possible_mask in __cpuidle_driver_init(). > >> > This breaks cpuidle on powern

Re: [PATCH] powerpc/powernv/cpuidle: Pass correct drv->cpumask for registration

2017-03-19 Thread Michael Ellerman
Vaidyanathan Srinivasan writes: > * Michael Neuling [2017-03-18 16:28:02]: > >> Vaidy, >> >> Thanks for fixing this. >> >> > drv->cpumask defaults to cpu_possible_mask in __cpuidle_driver_init(). >> > This breaks cpuidle on powernv where sysfs files are not created for >> > cpus in cpu_possibl

Re: [PATCH 3/7] cxl: Keep track of mm struct associated with a context

2017-03-19 Thread Andrew Donnellan
On 07/03/17 21:57, christophe lombard wrote: @@ -281,7 +212,6 @@ void cxl_handle_fault(struct work_struct *fault_work) if (!ctx->kernel) { mm = get_mem_context(ctx); -/* indicates all the thread in task group have exited */ if (mm == NULL) { pr_devel("

Re: [PATCH V2 1/6] cxl: Remove unused values in bare-metal environment.

2017-03-19 Thread Andrew Donnellan
Reviewed-by: Andrew Donnellan On 14/03/17 22:08, Christophe Lombard wrote: The two fields pid and tid of the structure cxl_irq_info are only used in the guest environment. To avoid confusion, it's not necessary to fill the fields in the bare-metal environment. The PSL Process and Thread Identif

[RFC PATCH 2/3] mm: Let arch choose the initial value of task size

2017-03-19 Thread Aneesh Kumar K.V
As we start supporting larger address space (>128TB), we want to give architecture a control on max task size of an application which is different from the TASK_SIZE. For ex: ppc64 needs to track the base page size of a segment and it is copied from mm_context_t to PACA on each context switch. If w

[RFC PATCH 3/3] powerpc/mm: Enable mappings above 128TB

2017-03-19 Thread Aneesh Kumar K.V
Not all user space application is ready to handle wide addresses. It's known that at least some JIT compilers use higher bits in pointers to encode their information. It collides with valid pointers with 512TB addresses and leads to crashes. To mitigate this, we are not going to allocate virtual

[RFC PATCH 1/3] powerpc/mm: Switch TASK_SIZE check to use mm->task_size

2017-03-19 Thread Aneesh Kumar K.V
--- arch/powerpc/mm/hugetlbpage-radix.c | 4 ++-- arch/powerpc/mm/mmap.c | 12 ++-- arch/powerpc/mm/slice.c | 6 +++--- arch/powerpc/mm/subpage-prot.c | 3 ++- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/mm/hugetlbpage-radi

[GIT PULL] Please pull powerpc/linux.git powerpc-4.11-5 tag

2017-03-19 Thread Michael Ellerman
Hi Linus, Please pull a couple of minor powerpc fixes for 4.11: The following changes since commit fb5fe0fd626c425ed41842c4318aa7ab6f3c2db7: Merge tag 'powerpc-4.11-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux (2017-03-13 19:48:22 -0700) are available in the git reposit