Re: [PATCH 00/19] KVM: PPC: Book3S HV: add XIVE native exploitation mode

2019-02-05 Thread Cédric Le Goater
On 2/6/19 2:18 AM, David Gibson wrote: > On Wed, Feb 06, 2019 at 09:13:15AM +1100, Paul Mackerras wrote: >> On Tue, Feb 05, 2019 at 12:31:28PM +0100, Cédric Le Goater wrote: >> As for nesting, I suggest for the foreseeable future we stick to XICS >> emulation in nested guests. > >

Re: [PATCH 06/19] KVM: PPC: Book3S HV: add a GET_ESB_FD control to the XIVE native device

2019-02-05 Thread Cédric Le Goater
On 2/6/19 2:23 AM, David Gibson wrote: > On Tue, Feb 05, 2019 at 01:55:40PM +0100, Cédric Le Goater wrote: >> On 2/5/19 6:28 AM, David Gibson wrote: >>> On Mon, Feb 04, 2019 at 12:30:39PM +0100, Cédric Le Goater wrote: On 2/4/19 5:45 AM, David Gibson wrote: > On Mon, Jan 07, 2019 at

Re: [PATCH 15/19] KVM: PPC: Book3S HV: add get/set accessors for the source configuration

2019-02-05 Thread Cédric Le Goater
On 2/6/19 2:24 AM, David Gibson wrote: > On Wed, Feb 06, 2019 at 12:23:29PM +1100, David Gibson wrote: >> On Tue, Feb 05, 2019 at 02:03:11PM +0100, Cédric Le Goater wrote: >>> On 2/5/19 6:32 AM, David Gibson wrote: On Mon, Feb 04, 2019 at 05:07:28PM +0100, Cédric Le Goater wrote: > On

[PATCH] powerpc/powernv/idle: Restore IAMR after idle

2019-02-05 Thread Russell Currey
Without restoring the IAMR after idle, execution prevention on POWER9 with Radix MMU is overwritten and the kernel can freely execute userspace without faulting. This is necessary when returning from any stop state that modifies user state, as well as hypervisor state. To test how this fails

[PATCH v2] powerpc/perf: Use PVR rather than oprofile field to determine CPU version

2019-02-05 Thread Rashmica Gupta
Currently the perf CPU backend drivers detect what CPU they're on using cur_cpu_spec->oprofile_cpu_type. Although that works, it's a bit crufty to be using oprofile related fields, especially seeing as oprofile is more or less unused these days. It also means perf is reliant on the fragile logic

[PATCH] powerpc/perf: Use PVR rather than oprofile field to determine CPU version

2019-02-05 Thread Rashmica Gupta
Currently the perf CPU backend drivers detect what CPU they're on using cur_cpu_spec->oprofile_cpu_type. Although that works, it's a bit crufty to be using oprofile related fields, especially seeing as oprofile is more or less unused these days. It also means perf is reliant on the fragile logic

linux-next: manual merge of the akpm-current tree with the powerpc-fixes tree

2019-02-05 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the akpm-current tree got a conflict in: arch/powerpc/mm/pgtable-book3s64.c between commit: 579b9239c1f3 ("powerpc/radix: Fix kernel crash with mremap()") from the powerpc-fixes tree and commit: 41bde21e85a7 ("arch/powerpc/mm: Nest MMU workaround for

Re: [PATCH 1/4] powerpc/64s: Clear on-stack exception marker upon exception return

2019-02-05 Thread Michael Ellerman
Balbir Singh writes: > On Tue, Feb 5, 2019 at 10:24 PM Michael Ellerman wrote: >> Balbir Singh writes: >> > On Sat, Feb 2, 2019 at 12:14 PM Balbir Singh wrote: >> >> On Tue, Jan 22, 2019 at 10:57:21AM -0500, Joe Lawrence wrote: >> >> > From: Nicolai Stange >> >> > >> >> > The ppc64 specific

Re: [PATCH] powerpc/powernv/npu: Remove redundant change_pte() hook

2019-02-05 Thread Balbir Singh
On Tue, Feb 5, 2019 at 2:52 PM Alistair Popple wrote: > > On Thursday, 31 January 2019 12:11:06 PM AEDT Andrea Arcangeli wrote: > > On Thu, Jan 31, 2019 at 06:30:22PM +0800, Peter Xu wrote: > > > The change_pte() notifier was designed to use as a quick path to > > > update secondary MMU PTEs on

Re: [PATCH 1/4] powerpc/64s: Clear on-stack exception marker upon exception return

2019-02-05 Thread Balbir Singh
On Tue, Feb 5, 2019 at 10:24 PM Michael Ellerman wrote: > > Balbir Singh writes: > > On Sat, Feb 2, 2019 at 12:14 PM Balbir Singh wrote: > >> > >> On Tue, Jan 22, 2019 at 10:57:21AM -0500, Joe Lawrence wrote: > >> > From: Nicolai Stange > >> > > >> > The ppc64 specific implementation of the

Re: [PATCH 00/19] KVM: PPC: Book3S HV: add XIVE native exploitation mode

2019-02-05 Thread David Gibson
On Wed, Feb 06, 2019 at 09:13:15AM +1100, Paul Mackerras wrote: > On Tue, Feb 05, 2019 at 12:31:28PM +0100, Cédric Le Goater wrote: > > >>> As for nesting, I suggest for the foreseeable future we stick to XICS > > >>> emulation in nested guests. > > >> > > >> ok. so no kernel_irqchip at all. hmm.

Re: [PATCH 15/19] KVM: PPC: Book3S HV: add get/set accessors for the source configuration

2019-02-05 Thread David Gibson
On Wed, Feb 06, 2019 at 12:23:29PM +1100, David Gibson wrote: > On Tue, Feb 05, 2019 at 02:03:11PM +0100, Cédric Le Goater wrote: > > On 2/5/19 6:32 AM, David Gibson wrote: > > > On Mon, Feb 04, 2019 at 05:07:28PM +0100, Cédric Le Goater wrote: > > >> On 2/4/19 6:21 AM, David Gibson wrote: > > >>>

Re: [PATCH 06/19] KVM: PPC: Book3S HV: add a GET_ESB_FD control to the XIVE native device

2019-02-05 Thread David Gibson
On Tue, Feb 05, 2019 at 01:55:40PM +0100, Cédric Le Goater wrote: > On 2/5/19 6:28 AM, David Gibson wrote: > > On Mon, Feb 04, 2019 at 12:30:39PM +0100, Cédric Le Goater wrote: > >> On 2/4/19 5:45 AM, David Gibson wrote: > >>> On Mon, Jan 07, 2019 at 07:43:18PM +0100, Cédric Le Goater wrote: >

Re: [PATCH 15/19] KVM: PPC: Book3S HV: add get/set accessors for the source configuration

2019-02-05 Thread David Gibson
On Tue, Feb 05, 2019 at 02:03:11PM +0100, Cédric Le Goater wrote: > On 2/5/19 6:32 AM, David Gibson wrote: > > On Mon, Feb 04, 2019 at 05:07:28PM +0100, Cédric Le Goater wrote: > >> On 2/4/19 6:21 AM, David Gibson wrote: > >>> On Mon, Jan 07, 2019 at 07:43:27PM +0100, Cédric Le Goater wrote: >

Re: [PATCH 17/19] KVM: PPC: Book3S HV: add get/set accessors for the VP XIVE state

2019-02-05 Thread David Gibson
On Tue, Feb 05, 2019 at 12:58:54PM +0100, Cédric Le Goater wrote: > On 2/5/19 6:33 AM, David Gibson wrote: > > On Mon, Feb 04, 2019 at 07:57:26PM +0100, Cédric Le Goater wrote: > >> On 2/4/19 6:26 AM, David Gibson wrote: > >>> On Mon, Jan 07, 2019 at 08:10:04PM +0100, Cédric Le Goater wrote: >

Re: [PATCH] mtd: powernv: SPDX and comment fixups

2019-02-05 Thread Stewart Smith
Joel Stanley writes: > converts the powernv flash driver to use SPDX, and adds some > clarifying comments that came out of a discussion on how the mtd driver > works. > > Signed-off-by: Joel Stanley We probably don't need to mention the dim dark corners of the FFS format and I kind of wish it'd

[PATCH] mtd: powernv: SPDX and comment fixups

2019-02-05 Thread Joel Stanley
This converts the powernv flash driver to use SPDX, and adds some clarifying comments that came out of a discussion on how the mtd driver works. Signed-off-by: Joel Stanley --- drivers/mtd/devices/powernv_flash.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff

[PATCH net] net: fsl_ucc_hdlc: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles

2019-02-05 Thread Yang Wei
From: Yang Wei dev_consume_skb_irq() should be called in hdlc_tx_done() when skb xmit done. It makes drop profiles(dropwatch, perf) more friendly. Signed-off-by: Yang Wei --- drivers/net/wan/fsl_ucc_hdlc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH 00/19] KVM: PPC: Book3S HV: add XIVE native exploitation mode

2019-02-05 Thread Paul Mackerras
On Tue, Feb 05, 2019 at 12:31:28PM +0100, Cédric Le Goater wrote: > >>> As for nesting, I suggest for the foreseeable future we stick to XICS > >>> emulation in nested guests. > >> > >> ok. so no kernel_irqchip at all. hmm. > > I was confused with what Paul calls 'XICS emulation'. It's not the

[PATCH v2] powerpc/mm: move a KERN_WARNING message to pr_debug()

2019-02-05 Thread Laurent Vivier
resize_hpt_for_hotplug() reports a warning when it cannot increase the hash page table ("Unable to resize hash page table to target order") but this is not blocking and can make user thinks something has not worked properly. As we move the message to the debug area, report again the ENODEV error.

Re: [PATCH] powerpc/mm: move a KERN_WARNING message to KERN_DEBUG

2019-02-05 Thread Christophe Leroy
Le 05/02/2019 à 19:03, Laurent Vivier a écrit : resize_hpt_for_hotplug() reports a warning when it cannot increase the hash page table ("Unable to resize hash page table to target order") but this is not blocking and can make user thinks something has not worked properly. If the operation

Re: [PATCH 16/19] KVM: PPC: Book3S HV: add get/set accessors for the EQ configuration

2019-02-05 Thread Cédric Le Goater
On 2/4/19 6:24 AM, David Gibson wrote: > On Mon, Jan 07, 2019 at 07:43:28PM +0100, Cédric Le Goater wrote: >> These are used to capture the XIVE END table of the KVM device. It >> relies on an OPAL call to retrieve from the XIVE IC the EQ toggle bit >> and index which are updated by the HW when

[PATCH] powerpc/mm: move a KERN_WARNING message to KERN_DEBUG

2019-02-05 Thread Laurent Vivier
resize_hpt_for_hotplug() reports a warning when it cannot increase the hash page table ("Unable to resize hash page table to target order") but this is not blocking and can make user thinks something has not worked properly. If the operation cannot be done the real error message will be reported

Re: [PATCHv6 1/4] dt-bindings: add DT binding for the layerscape PCIe controller with EP mode

2019-02-05 Thread Lorenzo Pieralisi
On Tue, Jan 22, 2019 at 02:33:25PM +0800, Xiaowei Bao wrote: > Add the documentation for the Device Tree binding for the layerscape PCIe > controller with EP mode. > > Signed-off-by: Xiaowei Bao > Reviewed-by: Minghuan Lian > Reviewed-by: Zhiqiang Hou > Reviewed-by: Rob Herring > --- > v2: >

Re: [PATCH v3 1/2] mm: add probe_user_read()

2019-02-05 Thread Murilo Opsfelder Araujo
Hi, Christophe. On Wed, Jan 16, 2019 at 04:59:27PM +, Christophe Leroy wrote: > In powerpc code, there are several places implementing safe > access to user data. This is sometimes implemented using > probe_kernel_address() with additional access_ok() verification, > sometimes with get_user()

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-02-05 Thread Michael S. Tsirkin
On Tue, Feb 05, 2019 at 08:24:07AM +0100, Christoph Hellwig wrote: > On Mon, Feb 04, 2019 at 04:38:21PM -0500, Michael S. Tsirkin wrote: > > It was designed to make, when set, as many guests as we can work > > correctly, and it seems to be successful in doing exactly that. > > > > Unfortunately

Re: [RFC PATCH] powerpc: fix get_arch_dma_ops() for NTB devices

2019-02-05 Thread Christoph Hellwig
On Tue, Feb 05, 2019 at 10:20:32PM +1100, Michael Ellerman wrote: > get_dma_ops() falls into arch-dependant get_arch_dma_ops(), which > historically returns NULL on PowerPC. Therefore dma_set_mask() fails. > This affects Switchtec (and probably other) NTB devices, that they fail > to initialize. >

[PATCH 2/8] perf mem/c2c: Fix perf_mem_events to support powerpc

2019-02-05 Thread Arnaldo Carvalho de Melo
From: Ravi Bangoria PowerPC hardware does not have a builtin latency filter (--ldlat) for the "mem-load" event and perf_mem_events by default includes "/ldlat=30/" which is causing a failure on PowerPC. Refactor the code to support "perf mem/c2c" on PowerPC. This patch depends on kernel side

Re: [PATCH] powerpc/prom_init: add __init markers to all functions

2019-02-05 Thread Masahiro Yamada
On Tue, Feb 5, 2019 at 7:33 PM Michael Ellerman wrote: > > Masahiro Yamada writes: > > > It is fragile to rely on the compiler's optimization to avoid the > > section mismatch. Some functions may not be necessarily inlined > > when the compiler's inlining heuristic changes. > > > > Add __init

Re: [PATCH 09/19] KVM: PPC: Book3S HV: add a SET_SOURCE control to the XIVE native device

2019-02-05 Thread Cédric Le Goater
On 2/5/19 6:35 AM, David Gibson wrote: > On Mon, Feb 04, 2019 at 08:07:20PM +0100, Cédric Le Goater wrote: >> On 2/4/19 5:57 AM, David Gibson wrote: >>> On Mon, Jan 07, 2019 at 07:43:21PM +0100, Cédric Le Goater wrote: > [snip] + sb = kvmppc_xive_create_src_block(xive, irq); +

Re: [PATCH 06/19] KVM: PPC: Book3S HV: add a GET_ESB_FD control to the XIVE native device

2019-02-05 Thread Cédric Le Goater
On 2/5/19 6:28 AM, David Gibson wrote: > On Mon, Feb 04, 2019 at 12:30:39PM +0100, Cédric Le Goater wrote: >> On 2/4/19 5:45 AM, David Gibson wrote: >>> On Mon, Jan 07, 2019 at 07:43:18PM +0100, Cédric Le Goater wrote: This will let the guest create a memory mapping to expose the ESB MMIO

Re: [PATCH 15/19] KVM: PPC: Book3S HV: add get/set accessors for the source configuration

2019-02-05 Thread Cédric Le Goater
On 2/5/19 6:32 AM, David Gibson wrote: > On Mon, Feb 04, 2019 at 05:07:28PM +0100, Cédric Le Goater wrote: >> On 2/4/19 6:21 AM, David Gibson wrote: >>> On Mon, Jan 07, 2019 at 07:43:27PM +0100, Cédric Le Goater wrote: Theses are use to capure the XIVE EAS table of the KVM device, the

Re: [RFC/WIP] powerpc: Fix 32-bit handling of MSR_EE on exceptions

2019-02-05 Thread Benjamin Herrenschmidt
On Tue, 2019-02-05 at 10:45 +0100, Christophe Leroy wrote: > > > I tested it on the 8xx with the below changes in addition. No issue seen > > > so far. > > > > Thanks ! > > > > I'll merge that in. > > I'm currently working on a refactorisation and simplification of > exception and syscall entry

Re: [RFC/WIP] powerpc: Fix 32-bit handling of MSR_EE on exceptions

2019-02-05 Thread Christophe Leroy
Le 20/12/2018 à 06:40, Benjamin Herrenschmidt a écrit : Hi folks ! Why trying to figure out why we had occasionally lockdep barf about interrupt state on ppc32 (440 in my case but I could reproduce on e500 as well using qemu), I realized that we are still doing something rather gothic and

Re: [PATCH 17/19] KVM: PPC: Book3S HV: add get/set accessors for the VP XIVE state

2019-02-05 Thread Cédric Le Goater
On 2/5/19 6:33 AM, David Gibson wrote: > On Mon, Feb 04, 2019 at 07:57:26PM +0100, Cédric Le Goater wrote: >> On 2/4/19 6:26 AM, David Gibson wrote: >>> On Mon, Jan 07, 2019 at 08:10:04PM +0100, Cédric Le Goater wrote: At a VCPU level, the state of the thread context interrupt management

Re: [PATCH] hugetlb: allow to free gigantic pages regardless of the configuration

2019-02-05 Thread Alex Ghiti
On 2/5/19 6:23 AM, Michael Ellerman wrote: Alexandre Ghiti writes: From: Alexandre Ghiti On systems without CMA or (MEMORY_ISOLATION && COMPACTION) activated but that support gigantic pages, boottime reserved gigantic pages can not be freed at all. This patchs simply enables the possibility

[PATCH v16 21/21] powerpc: clean stack pointers naming

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy Some stack pointers used to also be thread_info pointers and were called tp. Now that they are only stack pointers, rename them sp. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/irq.c | 17 +++--

[PATCH v16 20/21] powerpc/64: Replace CURRENT_THREAD_INFO with PACA_CURRENT_TI

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy Now that current_thread_info is located at the beginning of 'current' task struct, CURRENT_THREAD_INFO macro is not really needed any more. This patch replaces it by loads of the value at PACA_CURRENT_TI(r13). Signed-off-by: Christophe Leroy [mpe: Add PACA_CURRENT_TI

[PATCH v16 19/21] powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy Now that thread_info is similar to task_struct, its address is in r2 so CURRENT_THREAD_INFO() macro is useless. This patch removes it. This patch also moves the 'tovirt(r2, r2)' down just before the reactivation of MMU translation, so that we keep the physical address of

[PATCH v16 18/21] powerpc: 'current_set' is now a table of task_struct pointers

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy The table of pointers 'current_set' has been used for retrieving the stack and current. They used to be thread_info pointers as they were pointing to the stack and current was taken from the 'task' field of the thread_info. Now, the pointers of 'current_set' table are now

[PATCH v16 17/21] powerpc: regain entire stack space

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy thread_info is not anymore in the stack, so the entire stack can now be used. There is also no risk anymore of corrupting task_cpu(p) with a stack overflow so the patch removes the test. When doing this, an explicit test for NULL stack pointer is needed in validate_sp()

[PATCH v16 16/21] powerpc: Activate CONFIG_THREAD_INFO_IN_TASK

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy This patch activates CONFIG_THREAD_INFO_IN_TASK which moves the thread_info into task_struct. Moving thread_info into task_struct has the following advantages: - It protects thread_info from corruption in the case of stack overflows. - Its address is harder to

[PATCH v16 15/21] powerpc/idle/6xx: Use r1 with CURRENT_THREAD_INFO()

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy Make sure CURRENT_THREAD_INFO() is used with r1 which is the virtual address of the stack, in order to ease the switch to r2 when we enable THREAD_INFO_IN_TASK, as we have no register having the phys address of current. Signed-off-by: Christophe Leroy [mpe: Split out of

[PATCH v16 14/21] powerpc: Use task_stack_page() in current_pt_regs()

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy Change current_pt_regs() to use task_stack_page() rather than current_thread_info() so that it keeps working once we enable THREAD_INFO_IN_TASK. Signed-off-by: Christophe Leroy [mpe: Split out of large patch] Signed-off-by: Michael Ellerman ---

[PATCH v16 13/21] powerpc: Use linux/thread_info.h in processor.h

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy When we enable THREAD_INFO_IN_TASK we will remove our definition of current_thread_info(). Instead it will come from linux/thread_info.h So switch processor.h to include the latter, so that it can continue to find current_thread_info(). Signed-off-by: Christophe Leroy

[PATCH v16 12/21] powerpc: Use sizeof(struct thread_info) in INIT_SP_LIMIT

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy Currently INIT_SP_LIMIT uses sizeof(init_thread_info), but that symbol won't exist when we enable THREAD_INFO_IN_TASK. So just use the sizeof the type which is the same value but will continue to work. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin [mpe:

[PATCH v16 11/21] powerpc/64: Use task_stack_page() to initialise paca->kstack

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy Rather than using the thread info use task_stack_page() to initialise paca->kstack, that way it will work with THREAD_INFO_IN_TASK. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin [mpe: Split out of larger patch] Signed-off-by: Michael Ellerman ---

[PATCH v16 10/21] powerpc: Update comments in preparation for THREAD_INFO_IN_TASK

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy Update a few comments that talk about current_thread_info() in preparation for THREAD_INFO_IN_TASK. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin [mpe: Split out of larger patch] Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/reg.h |

[PATCH v16 09/21] powerpc: Replace current_thread_info()->task with current

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy We have a few places that use current_thread_info()->task to access current. This won't work with THREAD_INFO_IN_TASK so fix them now. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin [mpe: Split out of larger patch] Signed-off-by: Michael Ellerman ---

[PATCH v16 08/21] powerpc: Don't use CURRENT_THREAD_INFO to find the stack

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy A few places use CURRENT_THREAD_INFO, or the C version, to find the stack. This will no longer work with THREAD_INFO_IN_TASK so change them to find the stack in other ways. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin [mpe: Split out of larger patch]

[PATCH v16 07/21] powerpc: call_do_[soft]irq() takes a pointer to the stack

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy The purpose of the pointer given to call_do_softirq() and call_do_irq() is to point the new stack. Currently that's the same thing as the thread_info, but won't be with THREAD_INFO_IN_TASK. So change the parameter to void* and rename it 'sp'. Signed-off-by: Christophe

[PATCH v16 06/21] powerpc: Rename THREAD_INFO to TASK_STACK

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy This patch renames THREAD_INFO to TASK_STACK, because it is in fact the offset of the pointer to the stack in task_struct so this pointer will not be impacted by the move of THREAD_INFO. Also make it available on 64-bit, as we'll need it there when we activate

[PATCH v16 05/21] powerpc: prep stack walkers for THREAD_INFO_IN_TASK

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy [text copied from commit 9bbd4c56b0b6 ("arm64: prep stack walkers for THREAD_INFO_IN_TASK")] When CONFIG_THREAD_INFO_IN_TASK is selected, task stacks may be freed before a task is destroyed. To account for this, the stacks are refcounted, and when manipulating the stack

[PATCH v16 04/21] powerpc: Only use task_struct 'cpu' field on SMP

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy When moving to CONFIG_THREAD_INFO_IN_TASK, the thread_info 'cpu' field gets moved into task_struct and only defined when CONFIG_SMP is set. This patch ensures that TI_CPU is only used when CONFIG_SMP is set and that task_struct 'cpu' field is not used directly out of SMP

[PATCH v16 03/21] powerpc: Avoid circular header inclusion in mmu-hash.h

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy When activating CONFIG_THREAD_INFO_IN_TASK, linux/sched.h includes asm/current.h. This generates a circular dependency. To avoid that, asm/processor.h shall not be included in mmu-hash.h. In order to do that, this patch moves into a new header called asm/task_size_64/32.h

[PATCH v16 02/21] powerpc/32: Fix CONFIG_VIRT_CPU_ACCOUNTING_NATIVE for 40x/booke

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy 40x/booke have another path to reach 3f from transfer_to_handler, make sure it also calls ACCOUNT_CPU_USER_ENTRY() when CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is selected. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/entry_32.S |

[PATCH v16 01/21] powerpc/irq: use memblock functions returning virtual address

2019-02-05 Thread Michael Ellerman
From: Christophe Leroy Since only the virtual address of allocated blocks is used, lets use functions returning directly virtual address. Those functions have the advantage of also zeroing the block. Suggested-by: Mike Rapoport Acked-by: Mike Rapoport Signed-off-by: Christophe Leroy

[PATCH v16 00/21] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK

2019-02-05 Thread Michael Ellerman
The purpose of this series is to activate CONFIG_THREAD_INFO_IN_TASK which moves the thread_info into task_struct. Moving thread_info into task_struct has the following advantages: - It protects thread_info from corruption in the case of stack overflows. - Its address is harder to

Re: [PATCH 00/19] KVM: PPC: Book3S HV: add XIVE native exploitation mode

2019-02-05 Thread Cédric Le Goater
>>> As for nesting, I suggest for the foreseeable future we stick to XICS >>> emulation in nested guests. >> >> ok. so no kernel_irqchip at all. hmm. I was confused with what Paul calls 'XICS emulation'. It's not the QEMU XICS emulated device but the XICS-over-XIVE KVM device, the KVM XICS

Re: powerpc/papr_scm: Use the correct bind address

2019-02-05 Thread Michael Ellerman
On Thu, 2019-01-31 at 01:53:47 UTC, Oliver O'Halloran wrote: > When binding an SCM volume to a physical address the hypervisor has the > option to return early with a continue token with the expectation that > the guest will resume the bind operation until it completes. A quirk of > this interface

Re: arch/powerpc/radix: Fix kernel crash with mremap

2019-02-05 Thread Michael Ellerman
On Wed, 2019-01-23 at 06:21:38 UTC, "Aneesh Kumar K.V" wrote: > With support for split pmd lock, we use pmd page pmd_huge_pte pointer to store > the deposited page table. In those config when we move page tables we need to > make sure we move the depoisted page table to the right pmd page.

Re: [PATCH 1/4] powerpc/64s: Clear on-stack exception marker upon exception return

2019-02-05 Thread Michael Ellerman
Balbir Singh writes: > On Sat, Feb 2, 2019 at 12:14 PM Balbir Singh wrote: >> >> On Tue, Jan 22, 2019 at 10:57:21AM -0500, Joe Lawrence wrote: >> > From: Nicolai Stange >> > >> > The ppc64 specific implementation of the reliable stacktracer, >> > save_stack_trace_tsk_reliable(), bails out and

Re: [PATCH] hugetlb: allow to free gigantic pages regardless of the configuration

2019-02-05 Thread Michael Ellerman
Alexandre Ghiti writes: > From: Alexandre Ghiti > > On systems without CMA or (MEMORY_ISOLATION && COMPACTION) activated but > that support gigantic pages, boottime reserved gigantic pages can not be > freed at all. This patchs simply enables the possibility to hand back > those pages to memory

Re: [RFC PATCH] powerpc: fix get_arch_dma_ops() for NTB devices

2019-02-05 Thread Michael Ellerman
Christoph Hellwig writes: > On Wed, Jan 30, 2019 at 11:58:40PM +1100, Michael Ellerman wrote: >> Alexander Fomichev writes: >> >> > get_dma_ops() falls into arch-dependant get_arch_dma_ops(), which >> > historically returns NULL on PowerPC. Therefore dma_set_mask() fails. >> > This affects

Re: [PATCH] powerpc/prom_init: add __init markers to all functions

2019-02-05 Thread Michael Ellerman
Masahiro Yamada writes: > It is fragile to rely on the compiler's optimization to avoid the > section mismatch. Some functions may not be necessarily inlined > when the compiler's inlining heuristic changes. > > Add __init markers consistently. > > As for prom_getprop() and prom_getproplen(),

Re: [PATCH v02] powerpc/pseries: Check for ceded CPU's during LPAR migration

2019-02-05 Thread Michael Ellerman
Michael Bringmann writes: > See below. > > On 1/31/19 3:53 PM, Michael Bringmann wrote: >> On 1/30/19 11:38 PM, Michael Ellerman wrote: >>> Michael Bringmann writes: This patch is to check for cede'ed CPUs during LPM. Some extreme tests encountered a problem ehere Linux has put some

[PATCH v4 2/2] drivers: soc: fsl: add qixis driver

2019-02-05 Thread Pankaj Bansal
FPGA on LX2160AQDS/LX2160ARDB connected on I2C bus, so add qixis driver which is basically an i2c client driver to control FPGA. Also added platform driver for MMIO based FPGA, like the one available on LS2088ARDB/LS2088AQDS. Signed-off-by: Wang Dongsheng Signed-off-by: Pankaj Bansal ---

[PATCH v4 1/2] dt-bindings: soc: fsl: Document Qixis FPGA usage

2019-02-05 Thread Pankaj Bansal
an FPGA-based system controller, called “Qixis”, which manages several critical system features, including: • Reset sequencing • Power supply configuration • Board configuration • hardware configuration The qixis registers are accessible over one or more system-specific interfaces, typically I2C,

[PATCH v4 0/2] add qixis driver

2019-02-05 Thread Pankaj Bansal
FPGA on LX2160AQDS/LX2160ARDB connected on I2C bus, so add qixis driver which is basically an i2c client driver to control FPGA. Also added platform driver for MMIO based FPGA, like the one available on LS2088ARDB/LS2088AQDS. This driver is essential to control MDIO mux multiplexing. This

Re: [RFC/WIP] powerpc: Fix 32-bit handling of MSR_EE on exceptions

2019-02-05 Thread Michael Ellerman
Christophe Leroy writes: > Le 20/12/2018 à 23:35, Benjamin Herrenschmidt a écrit : >> /* * MSR_KERNEL is > 0x1 on 4xx/Book-E since it include MSR_CE. @@ -205,20 +208,46 @@ transfer_to_handler_cont: mflrr9 lwz r11,0(r9)

Re: [PATCH v02] powerpc/pseries: Check for ceded CPU's during LPAR migration

2019-02-05 Thread Michael Ellerman
Tyrel Datwyler writes: > On 01/31/2019 02:21 PM, Tyrel Datwyler wrote: >> On 01/31/2019 01:53 PM, Michael Bringmann wrote: >>> On 1/30/19 11:38 PM, Michael Ellerman wrote: Michael Bringmann writes: > This patch is to check for cede'ed CPUs during LPM. Some extreme > tests

Re: [PATCH v2] powerpc: drop page_is_ram() and walk_system_ram_range()

2019-02-05 Thread Michael Ellerman
Christophe Leroy writes: > Le 04/02/2019 à 11:24, Michael Ellerman a écrit : >> Christophe Leroy writes: >> >>> Since commit c40dd2f76644 ("powerpc: Add System RAM to /proc/iomem") >>> it is possible to use the generic walk_system_ram_range() and >>> the generic page_is_ram(). >>> >>> To enable

Re: [RFC/WIP] powerpc: Fix 32-bit handling of MSR_EE on exceptions

2019-02-05 Thread Christophe Leroy
Le 20/12/2018 à 23:35, Benjamin Herrenschmidt a écrit : /* * MSR_KERNEL is > 0x1 on 4xx/Book-E since it include MSR_CE. @@ -205,20 +208,46 @@ transfer_to_handler_cont: mflrr9 lwz r11,0(r9) /* virtual address of handler */ lwz