[PATCH v2] powerpc/pseries: Export raw per-CPU VPA data via debugfs

2018-09-25 Thread Aravinda Prasad
This patch exports the raw per-CPU VPA data via debugfs. A per-CPU file is created which exports the VPA data of that CPU to help debug some of the VPA related issues or to analyze the per-CPU VPA related statistics. Signed-off-by: Aravinda Prasad --- arch/powerpc/platforms/pseries/lpar.c |

Re: [PATCH 4/4] dma-mapping: clear dev->dma_ops in arch_teardown_dma_ops

2018-09-25 Thread Michael Ellerman
Christoph Hellwig writes: > Looking at the code I think this commit is simply broken for > architectures not using arch_setup_dma_ops, but instead setting up > the dma ops through arch specific magic. I arch_setup_dma_ops() called from of_dma_configure(), but pci_dma_configure() doesn't call

Re: [PATCH] powerpc/tm: Avoid possible userspace r1 corruption on reclaim

2018-09-25 Thread Michael Neuling
On Tue, 2018-09-25 at 22:00 +1000, Michael Ellerman wrote: > Michael Neuling writes: > > Current we store the userspace r1 to PACATMSCRATCH before finally > > saving it to the thread struct. > > > > In theory an exception could be taken here (like a machine check or > > SLB miss) that could

Re: [PATCH v5 18/22] powerpc/mm: Extend pte_fragment functionality to nohash/32

2018-09-25 Thread Aneesh Kumar K.V
Christophe Leroy writes: > In order to allow the 8xx to handle pte_fragments, this patch > extends the use of pte_fragments to nohash/32 platforms. > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/mmu_context.h | 2 +- > arch/powerpc/include/asm/nohash/32/mmu-40x.h |

Re: [PATCH v5 17/22] powerpc/mm: Move pgtable_t into platform headers

2018-09-25 Thread Aneesh Kumar K.V
Christophe Leroy writes: > This patch move pgtable_t into platform headers. > > It gets rid of the CONFIG_PPC_64K_PAGES case for PPC64 > as nohash/64 doesn't support CONFIG_PPC_64K_PAGES. > Reviewed-by: Aneesh Kumar K.V > Signed-off-by: Christophe Leroy > --- >

Re: [PATCH v5 16/22] powerpc/mm: move platform specific mmu-xxx.h in platform directories

2018-09-25 Thread Aneesh Kumar K.V
Christophe Leroy writes: > The purpose of this patch is to move platform specific > mmu-xxx.h files in platform directories like pte-xxx.h files. > > In the meantime this patch creates common nohash and > nohash/32 + nohash/64 mmu.h files for future common parts. > Reviewed-by: Aneesh Kumar K.V

Re: [PATCH v5 15/22] powerpc/mm: Avoid useless lock with single page fragments

2018-09-25 Thread Aneesh Kumar K.V
Christophe Leroy writes: > There is no point in taking the page table lock as pte_frag or > pmd_frag are always NULL when we have only one fragment. > Reviewed-by: Aneesh Kumar K.V > Signed-off-by: Christophe Leroy > --- > arch/powerpc/mm/pgtable-book3s64.c | 3 +++ >

Re: [PATCH v5 14/22] powerpc/mm: Move pte_fragment_alloc() to a common location

2018-09-25 Thread Aneesh Kumar K.V
Christophe Leroy writes: > In preparation of next patch which generalises the use of > pte_fragment_alloc() for all, this patch moves the related functions > in a place that is common to all subarches. > > The 8xx will need that for supporting 16k pages, as in that mode > page tables still have

Re: [PATCH v8 0/3] powerpc: Detection and scheduler optimization for POWER9 bigcore

2018-09-25 Thread Dave Hansen
On 09/22/2018 04:03 AM, Gautham R Shenoy wrote: > Without this patchset, the SMT domain would be defined as the group of > threads that share L2 cache. Could you try to make a more clear, concise statement about the current state of the art vs. what you want it to be? Right now, the sched

Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available

2018-09-25 Thread Li Yang
On Tue, Sep 25, 2018 at 2:47 PM Olof Johansson wrote: > > Hi, > > > On Thu, Aug 23, 2018 at 11:36 PM Alexandre Belloni > wrote: > > > > If the qman driver (qman_ccsr) doesn't probe or fail to probe before > > qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an > > unmapped

Re: [PATCH 4/4] dma-mapping: clear dev->dma_ops in arch_teardown_dma_ops

2018-09-25 Thread Christoph Hellwig
Looking at the code I think this commit is simply broken for architectures not using arch_setup_dma_ops, but instead setting up the dma ops through arch specific magic. I'll revert the patch.

Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available

2018-09-25 Thread Olof Johansson
Hi, On Thu, Aug 23, 2018 at 11:36 PM Alexandre Belloni wrote: > > If the qman driver (qman_ccsr) doesn't probe or fail to probe before > qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an > unmapped page. > > This leads to a crash when probing qman_portal as the init_pcfg

Re: [RFC PATCH v1 1/9] timer: fix circular header dependency

2018-09-25 Thread Christophe Leroy
On 09/25/2018 12:15 PM, Christophe LEROY wrote: Le 25/09/2018 à 14:11, Mark Rutland a écrit : On Tue, Sep 25, 2018 at 07:34:15AM +0200, Christophe LEROY wrote: Le 24/09/2018 à 17:52, Christophe Leroy a écrit : When switching powerpc to CONFIG_THREAD_INFO_IN_TASK, include/sched.h has to

[PATCH v5 22/22] powerpc/8xx: set GUARDED attribute in the PMD directly

2018-09-25 Thread Christophe Leroy
On the 8xx, the GUARDED attribute of the pages is managed in the L1 entry, therefore to avoid having to copy it into L1 entry at each TLB miss, we set it in the PMD. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pte-8xx.h | 3 ++- arch/powerpc/kernel/head_8xx.S

[PATCH v5 21/22] powerpc/nohash32: allow setting GUARDED attribute in the PMD directly

2018-09-25 Thread Christophe Leroy
On the 8xx, the GUARDED attribute of the pages is managed in the L1 entry, therefore to avoid having to copy it into L1 entry at each TLB miss, we have to set it in the PMD In order to allow this, this patch splits the VM alloc space in two parts, one for VM alloc and non Guarded IO, and one for

[PATCH v5 20/22] powerpc/mm: reintroduce 16K pages with HW assistance on 8xx

2018-09-25 Thread Christophe Leroy
Using this HW assistance implies some constraints on the page table structure: - Regardless of the main page size used (4k or 16k), the level 1 table (PGD) contains 1024 entries and each PGD entry covers a 4Mbytes area which is managed by a level 2 table (PTE) containing also 1024 entries each

[PATCH v5 19/22] powerpc/8xx: Remove PTE_ATOMIC_UPDATES

2018-09-25 Thread Christophe Leroy
commit 1bc54c03117b9 ("powerpc: rework 4xx PTE access and TLB miss") introduced non atomic PTE updates and started the work of removing PTE updates in TLB miss handlers, but kept PTE_ATOMIC_UPDATES for the 8xx with the following comment: /* Until my rework is finished, 8xx still needs atomic PTE

[PATCH v5 18/22] powerpc/mm: Extend pte_fragment functionality to nohash/32

2018-09-25 Thread Christophe Leroy
In order to allow the 8xx to handle pte_fragments, this patch extends the use of pte_fragments to nohash/32 platforms. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mmu_context.h | 2 +- arch/powerpc/include/asm/nohash/32/mmu-40x.h | 1 +

[PATCH v5 17/22] powerpc/mm: Move pgtable_t into platform headers

2018-09-25 Thread Christophe Leroy
This patch move pgtable_t into platform headers. It gets rid of the CONFIG_PPC_64K_PAGES case for PPC64 as nohash/64 doesn't support CONFIG_PPC_64K_PAGES. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/mmu-hash.h | 2 ++ arch/powerpc/include/asm/book3s/64/mmu.h |

[PATCH v5 16/22] powerpc/mm: move platform specific mmu-xxx.h in platform directories

2018-09-25 Thread Christophe Leroy
The purpose of this patch is to move platform specific mmu-xxx.h files in platform directories like pte-xxx.h files. In the meantime this patch creates common nohash and nohash/32 + nohash/64 mmu.h files for future common parts. Signed-off-by: Christophe Leroy ---

[PATCH v5 15/22] powerpc/mm: Avoid useless lock with single page fragments

2018-09-25 Thread Christophe Leroy
There is no point in taking the page table lock as pte_frag or pmd_frag are always NULL when we have only one fragment. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/pgtable-book3s64.c | 3 +++ arch/powerpc/mm/pgtable-frag.c | 3 +++ 2 files changed, 6 insertions(+) diff --git

[PATCH v5 14/22] powerpc/mm: Move pte_fragment_alloc() to a common location

2018-09-25 Thread Christophe Leroy
In preparation of next patch which generalises the use of pte_fragment_alloc() for all, this patch moves the related functions in a place that is common to all subarches. The 8xx will need that for supporting 16k pages, as in that mode page tables still have a size of 4k. Since pte_fragment with

[PATCH v5 13/22] powerpc/book3s32: Remove CONFIG_BOOKE dependent code

2018-09-25 Thread Christophe Leroy
BOOK3S/32 cannot be BOOKE, so remove useless code Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgalloc.h | 18 -- arch/powerpc/include/asm/book3s/32/pgtable.h | 14 -- 2 files changed, 32 deletions(-) diff --git

[PATCH v5 12/22] powerpc/mm: inline pte_alloc_one() and pte_alloc_one_kernel() in PPC32

2018-09-25 Thread Christophe Leroy
As in PPC64, inline pte_alloc_one() and pte_alloc_one_kernel() in PPC32. This will allow to switch nohash/32 to pte_fragment without impacting hash/32. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgalloc.h | 22 --

[PATCH v5 11/22] powerpc/mm: don't use pte_alloc_one_kernel() before slab is available

2018-09-25 Thread Christophe Leroy
In the same way as PPC64, let's handle pte allocation directly in kernel_map_page() when slab is not available. The new function early_pte_alloc_kernel() is put in as inline in platforms pgalloc.h, this will allow to have different ones later. It is not an issue because early_pte_alloc_kernel()

[PATCH v5 10/22] powerpc/8xx: regroup TLB handler routines

2018-09-25 Thread Christophe Leroy
As this is running with MMU off, the CPU only does speculative fetch for code in the same page. Following the significant size reduction of TLB handler routines, the side handlers can be brought back close to the main part, ie in the same page. Signed-off-by: Christophe Leroy ---

[PATCH v5 09/22] powerpc/8xx: don't use r12/SPRN_SPRG_SCRATCH2 in TLB Miss handlers

2018-09-25 Thread Christophe Leroy
This patch reworks the TLB Miss handler in order to not use r12 register, hence avoiding having to save it into SPRN_SPRG_SCRATCH2. In the DAR Fixup code we can now use SPRN_M_TW, freeing SPRN_SPRG_SCRATCH2. Then SPRN_SPRG_SCRATCH2 may be used for something else in the future. Signed-off-by:

[PATCH v5 08/22] powerpc/mm: Enable 512k hugepage support with HW assistance on the 8xx

2018-09-25 Thread Christophe Leroy
For using 512k pages with hardware assistance, the PTEs have to be spread every 128 bytes in the L2 table. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hugetlb.h | 4 +++- arch/powerpc/mm/hugetlbpage.c | 13 + arch/powerpc/mm/tlb_nohash.c | 3 +++ 3

[PATCH v5 07/22] powerpc/mm: Use hardware assistance in TLB handlers on the 8xx

2018-09-25 Thread Christophe Leroy
Today, on the 8xx the TLB handlers do SW tablewalk by doing all the calculation in ASM, in order to match with the Linux page table structure. The 8xx offers hardware assistance which allows significant size reduction of the TLB handlers, hence also reduces the time spent in the handlers.

[PATCH v5 06/22] powerpc/8xx: Temporarily disable 16k pages and 512k hugepages

2018-09-25 Thread Christophe Leroy
In preparation of making use of hardware assistance in TLB handlers, this patch temporarily disables 16K pages and 512K pages. The reason is that when using HW assistance in 4K pages mode, the linux model fit with the HW model for 4K pages and 8M pages. However for 16K pages and 512K mode some

[PATCH v5 05/22] powerpc/8xx: Move SW perf counters in first 32kb of memory

2018-09-25 Thread Christophe Leroy
In order to simplify time critical exceptions handling 8xx specific SW perf counters, this patch moves the counters into the beginning of memory. This is possible because .text is readable and the counters are never modified outside of the handlers. By doing this, we avoid having to set a second

[PATCH v5 04/22] powerpc/8xx: Use patch_site for perf counters setup

2018-09-25 Thread Christophe Leroy
The 8xx TLB miss routines are patched when (de)activating perf counters. This patch uses the new patch_site functionality in order to get a better code readability and avoid a label mess when dumping the code with 'objdump -d' Signed-off-by: Christophe Leroy ---

[PATCH v5 03/22] powerpc/8xx: Use patch_site for memory setup patching

2018-09-25 Thread Christophe Leroy
The 8xx TLB miss routines are patched at startup at several places. This patch uses the new patch_site functionality in order to get a better code readability and avoid a label mess when dumping the code with 'objdump -d' Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/mmu-8xx.h |

[PATCH v5 02/22] powerpc/code-patching: add a helper to get the address of a patch_site

2018-09-25 Thread Christophe Leroy
This patch adds a helper to get the address of a patch_site Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h index

[PATCH v5 01/22] Revert "powerpc/8xx: Use L1 entry APG to handle _PAGE_ACCESSED for CONFIG_SWAP"

2018-09-25 Thread Christophe Leroy
This reverts commit 4f94b2c7462d9720b2afa7e8e8d4c19446bb31ce. That commit was buggy, as it used rlwinm instead of rlwimi. Instead of fixing that bug, we revert the previous commit in order to reduce the dependency between L1 entries and L2 entries Fixes: 4f94b2c7462d9 ("powerpc/8xx: Use L1 entry

[PATCH v5 00/22] Implement use of HW assistance on TLB table walk on 8xx

2018-09-25 Thread Christophe Leroy
The purpose of this serie is to implement hardware assistance for TLB table walk on the 8xx. First part switches to patch_site instead of patch_instruction, as it makes the code clearer and avoids pollution with global symbols. Optimise access to perf counters (hence reduce number of registers

Re: [PATCH v4 15/20] powerpc/mm: Avoid useless lock with single page fragments

2018-09-25 Thread Christophe LEROY
Le 19/09/2018 à 04:56, Aneesh Kumar K.V a écrit : On 9/18/18 10:27 PM, Christophe Leroy wrote: There is no point in taking the page table lock as pte_frag is always NULL when we have only one fragment. Signed-off-by: Christophe Leroy ---   arch/powerpc/mm/pgtable-frag.c | 3 +++   1 file

Re: [PATCH v4 16/20] powerpc/mm: Extend pte_fragment functionality to nohash/32

2018-09-25 Thread Christophe LEROY
Le 19/09/2018 à 05:03, Aneesh Kumar K.V a écrit : On 9/18/18 10:27 PM, Christophe Leroy wrote: In order to allow the 8xx to handle pte_fragments, this patch extends the use of pte_fragments to nohash/32 platforms. Signed-off-by: Christophe Leroy ---   arch/powerpc/include/asm/mmu-40x.h 

Re: [PATCH v3 2/2] powerpc/64: add stack protector support

2018-09-25 Thread Christophe LEROY
Snowpatch reports failure on pmac32_defconfig, as follows: arch/powerpc/platforms/powermac/bootx_init.o: In function `bootx_printf': /var/lib/jenkins-slave/workspace/snowpatch/snowpatch-linux-sparse/linux/arch/powerpc/platforms/powermac/bootx_init.c:88: undefined reference to

Re: [PATCH] powerpc/tm: Fix userspace r13 corruption

2018-09-25 Thread Breno Leitao
Hi Mikey, On 09/25/2018 02:24 AM, Michael Neuling wrote: > On Mon, 2018-09-24 at 11:32 -0300, Breno Leitao wrote: >> Hi Mikey, >> >> On 09/24/2018 04:27 AM, Michael Neuling wrote: >>> When we treclaim we store the userspace checkpointed r13 to a scratch >>> SPR and then later save the scratch SPR

[PATCH] powerpc/powernv: Mark function as __noreturn

2018-09-25 Thread Breno Leitao
There is a mismatch between function pnv_platform_error_reboot() definition and declaration regarding function modifiers. In the declaration part, it contains the function attribute __noreturn, while function definition itself lacks it. This was reported by sparse tool as an error:

[PATCH v2] powerpc/traps: merge unrecoverable_exception() and nonrecoverable_exception()

2018-09-25 Thread Christophe Leroy
PPC32 uses nonrecoverable_exception() while PPC64 uses unrecoverable_exception(). Both functions are doing almost the same thing. This patch removes nonrecoverable_exception() Signed-off-by: Christophe Leroy --- v2: Removed call to debugger() as die() already calls debugger()

Re: [PATCH 1/2] iommu: Tidy up window attributes

2018-09-25 Thread Joerg Roedel
On Wed, Sep 19, 2018 at 11:12:57AM +0100, Robin Murphy wrote: > The external interface to get/set window attributes is already > abstracted behind iommu_domain_{get,set}_attr(), so there's no real > reason for the internal interface to be different. Since we only have > one window-based driver

Re: How to define some additional KBUILD_CFLAGS after building include/generated/asm-offsets.h ?

2018-09-25 Thread Michael Ellerman
Michael Ellerman writes: > Christophe LEROY writes: >> Le 24/09/2018 à 14:10, Michael Ellerman a écrit : >>> Christophe Leroy writes: I'm trying to implement TLS based stack protector in the Linux Kernel. For that I need to give to GCC the offset at which it will find the canary

[PATCH] powerpc/numa: Use associativity if VPHN hcall is successful

2018-09-25 Thread Srikar Dronamraju
Currently associativity is used to lookup node-id even if the preceding VPHN hcall failed. However this can cause CPU to be made part of the wrong node, (most likely to be node 0). This is because VPHN is not enabled on kvm guests. With 2ea6263 ("powerpc/topology: Get topology for shared

Re: [PATCH 2/3] powerpc: Add system call table generation support

2018-09-25 Thread Michael Ellerman
Arnd Bergmann writes: > On Tue, Sep 25, 2018 at 2:48 AM Michael Ellerman wrote: >> Arnd Bergmann writes: >> > On Tue, Sep 18, 2018 at 2:15 PM Firoz Khan wrote: >> >> On 14 September 2018 at 15:31, Arnd Bergmann wrote: >> >> > On Fri, Sep 14, 2018 at 10:33 AM Firoz Khan >> >> > wrote: >> >

Re: [RFC PATCH v1 1/9] timer: fix circular header dependency

2018-09-25 Thread Christophe LEROY
Le 25/09/2018 à 14:11, Mark Rutland a écrit : On Tue, Sep 25, 2018 at 07:34:15AM +0200, Christophe LEROY wrote: Le 24/09/2018 à 17:52, Christophe Leroy a écrit : When switching powerpc to CONFIG_THREAD_INFO_IN_TASK, include/sched.h has to be included in asm/smp.h for the following change,

Re: [PATCH v2 5/6] powerpc/powernv: hold device_hotplug_lock when calling memtrace_offline_pages()

2018-09-25 Thread Balbir Singh
On Tue, Sep 25, 2018 at 11:14:56AM +0200, David Hildenbrand wrote: > Let's perform all checking + offlining + removing under > device_hotplug_lock, so nobody can mess with these devices via > sysfs concurrently. > > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc:

Re: [RFC PATCH v1 1/9] timer: fix circular header dependency

2018-09-25 Thread Mark Rutland
On Tue, Sep 25, 2018 at 07:34:15AM +0200, Christophe LEROY wrote: > > > Le 24/09/2018 à 17:52, Christophe Leroy a écrit : > > When switching powerpc to CONFIG_THREAD_INFO_IN_TASK, include/sched.h > > has to be included in asm/smp.h for the following change, in order > > to avoid uncomplete

[RFC PATCH v2 9/9] powerpc/64: Modify CURRENT_THREAD_INFO()

2018-09-25 Thread Christophe Leroy
CURRENT_THREAD_INFO() now uses the PACA to retrieve 'current' pointer, it doesn't use 'sp' anymore. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/exception-64s.h | 4 ++-- arch/powerpc/include/asm/thread_info.h | 2 +- arch/powerpc/kernel/entry_64.S

[RFC PATCH v2 8/9] powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU

2018-09-25 Thread Christophe Leroy
Now that thread_info is similar to task_struct, it's address is in r2 so CURRENT_THREAD_INFO() macro is useless. This patch removes it. At the same time, as the 'cpu' field is not anymore in thread_info, this patch renames it to TASK_CPU. Signed-off-by: Christophe Leroy ---

[RFC PATCH v2 7/9] powerpc: 'current_set' is now a table of task_struct pointers

2018-09-25 Thread 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 both pointers to

[RFC PATCH v2 6/9] powerpc: regain entire stack space

2018-09-25 Thread Christophe Leroy
thread_info is not anymore in the stack, so the entire stack can now be used. In the meantime, all pointers to the stacks are not anymore pointers to thread_info so this patch changes them to void* Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/irq.h | 10 +-

[RFC PATCH v2 5/9] powerpc: Activate CONFIG_THREAD_INFO_IN_TASK

2018-09-25 Thread 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 determine if stack addresses are

[RFC PATCH v2 4/9] powerpc: Prepare for moving thread_info into task_struct

2018-09-25 Thread Christophe Leroy
This patch cleans the powerpc kernel before activating CONFIG_THREAD_INFO_IN_TASK: - The purpose of the pointer given to call_do_softirq() and call_do_irq() is to point the new stack ==> change it to void* - current_pt_regs() is in the stack, not in thread_info. - Don't use CURRENT_THREAD_INFO()

[RFC PATCH v2 3/9] powerpc: clear redundancies in asm-offset.c

2018-09-25 Thread Christophe Leroy
In order to be able to include asm-offset.h in smp.h for PPC32, all definitions which are conflicting with C need new names. TASK_SIZE is nowhere used in asm. PPC_DBELL_SERVER_SERVER and PPC_DBELL_SERVER_MSGTYPE are only needed on PPC64 in asm. MAS0 ... MAS7 conflict with 'struct tlbcam'

[RFC PATCH v2 2/9] powerpc: change name THREAD_INFO to TASK_STACK

2018-09-25 Thread Christophe Leroy
At the time being, the thread_info struct is located in the beginning of the stack. There is an asm const called THREAD_INFO which is the offset of the stack pointer in the task_struct. In preparation of moving thread_info into task_struct, this patch renames the THREAD_INFO const to TASK_STACK.

[RFC PATCH v2 1/9] book3s/64: avoid circular header inclusion in mmu-hash.h

2018-09-25 Thread 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.h the information from

[RFC PATCH v2 0/9] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK

2018-09-25 Thread Christophe Leroy
The purpose of this serie 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 determine if

Re: [PATCH] powerpc/tm: Avoid possible userspace r1 corruption on reclaim

2018-09-25 Thread Michael Ellerman
Michael Neuling writes: > Current we store the userspace r1 to PACATMSCRATCH before finally > saving it to the thread struct. > > In theory an exception could be taken here (like a machine check or > SLB miss) that could write PACATMSCRATCH and hence corrupt the > userspace r1. The SLB fault

[PATCH] powerpc/tm: Avoid possible userspace r1 corruption on reclaim

2018-09-25 Thread Michael Neuling
Current we store the userspace r1 to PACATMSCRATCH before finally saving it to the thread struct. In theory an exception could be taken here (like a machine check or SLB miss) that could write PACATMSCRATCH and hence corrupt the userspace r1. The SLB fault currently doesn't touch PACATMSCRATCH,

[PATCH v2 6/6] memory-hotplug.txt: Add some details about locking internals

2018-09-25 Thread David Hildenbrand
Let's document the magic a bit, especially why device_hotplug_lock is required when adding/removing memory and how it all play together with requests to online/offline memory from user space. Cc: Jonathan Corbet Cc: Michal Hocko Cc: Andrew Morton Reviewed-by: Pavel Tatashin Reviewed-by:

[PATCH v2 5/6] powerpc/powernv: hold device_hotplug_lock when calling memtrace_offline_pages()

2018-09-25 Thread David Hildenbrand
Let's perform all checking + offlining + removing under device_hotplug_lock, so nobody can mess with these devices via sysfs concurrently. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Rashmica Gupta Cc: Balbir Singh Cc: Michael Neuling Reviewed-by: Pavel Tatashin

[PATCH v2 4/6] powerpc/powernv: hold device_hotplug_lock when calling device_online()

2018-09-25 Thread David Hildenbrand
device_online() should be called with device_hotplug_lock() held. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Rashmica Gupta Cc: Balbir Singh Cc: Michael Neuling Reviewed-by: Pavel Tatashin Reviewed-by: Rashmica Gupta Signed-off-by: David Hildenbrand ---

[PATCH v2 3/6] mm/memory_hotplug: fix online/offline_pages called w.o. mem_hotplug_lock

2018-09-25 Thread David Hildenbrand
There seem to be some problems as result of 30467e0b3be ("mm, hotplug: fix concurrent memory hot-add deadlock"), which tried to fix a possible lock inversion reported and discussed in [1] due to the two locks a) device_lock() b) mem_hotplug_lock While add_memory() first takes b),

[PATCH v2 2/6] mm/memory_hotplug: make add_memory() take the device_hotplug_lock

2018-09-25 Thread David Hildenbrand
add_memory() currently does not take the device_hotplug_lock, however is aleady called under the lock from arch/powerpc/platforms/pseries/hotplug-memory.c drivers/acpi/acpi_memhotplug.c to synchronize against CPU hot-remove and similar. In general, we should hold the

[PATCH v2 1/6] mm/memory_hotplug: make remove_memory() take the device_hotplug_lock

2018-09-25 Thread David Hildenbrand
remove_memory() is exported right now but requires the device_hotplug_lock, which is not exported. So let's provide a variant that takes the lock and only export that one. The lock is already held in arch/powerpc/platforms/pseries/hotplug-memory.c drivers/acpi/acpi_memhotplug.c

[PATCH v2 0/6] mm: online/offline_pages called w.o. mem_hotplug_lock

2018-09-25 Thread David Hildenbrand
Reading through the code and studying how mem_hotplug_lock is to be used, I noticed that there are two places where we can end up calling device_online()/device_offline() - online_pages()/offline_pages() without the mem_hotplug_lock. And there are other places where we call

Re: [PATCH 0/7 v7] Support for fsl-mc bus and its devices in SMMU

2018-09-25 Thread Joerg Roedel
On Mon, Sep 10, 2018 at 07:19:14PM +0530, Nipun Gupta wrote: > Nipun Gupta (7): > Documentation: fsl-mc: add iommu-map device-tree binding for fsl-mc > bus > iommu/of: make of_pci_map_rid() available for other devices too > iommu/of: support iommu configuration for fsl-mc devices >

Re: [PATCH v2 7/7] net: stmmac: dwmac-meson8b: use xxxsetbits32

2018-09-25 Thread Neil Armstrong
Hi Florian, On 24/09/2018 21:17, Florian Fainelli wrote: > On 09/24/2018 12:04 PM, Corentin Labbe wrote: >> This patch convert meson stmmac glue driver to use all xxxsetbits32 >> functions. >> >> Signed-off-by: Corentin Labbe >> --- >> .../net/ethernet/stmicro/stmmac/dwmac-meson8b.c| 56

Re: Not able to boot cuImage for the target board with MPC8270 processor

2018-09-25 Thread sgosavi1
Hi All, I debugged the bootwrapper code by printing messages in RAM using memcpy. The bootwrapper code appears to be executing correctly. I ensured that the "serial_console_init" function has executed successfully. But I am still not able to get any of the "printf" output in the wrapper code on

Re: [RFC PATCH v1 1/9] timer: fix circular header dependency

2018-09-25 Thread Christophe LEROY
Le 25/09/2018 à 07:34, Christophe LEROY a écrit : Le 24/09/2018 à 17:52, Christophe Leroy a écrit : When switching powerpc to CONFIG_THREAD_INFO_IN_TASK, include/sched.h has to be included in asm/smp.h for the following change, in order to avoid uncomplete definition of task_struct:

Re: [PATCH] powerpc/pseries: Export raw per-CPU VPA data via debugfs

2018-09-25 Thread Aravinda Prasad
Hi Michael, On Monday 24 September 2018 05:12 PM, Michael Ellerman wrote: > Hi Aravinda, > > Aravinda Prasad writes: > >> This patch exports the raw per-CPU VPA data via debugfs. >> A per-CPU file is created which exports the VPA data of >> that CPU to help debug some of the VPA related issues

Re: [PATCH] powerpc/pseries: Disable CPU hotplug across migrations

2018-09-25 Thread Gautham R Shenoy
On Tue, Sep 25, 2018 at 10:42:05AM +1000, Michael Ellerman wrote: [..snip..] > I'm not suggesting we try to bring them online after we've disabled CPU > hotplug, if we detect that race we can just fail the migration. > > Can't we do: > - save mask of offline CPUs > - bring all offline CPUs

Re: [PATCH 2/3] powerpc: Add system call table generation support

2018-09-25 Thread Arnd Bergmann
On Tue, Sep 25, 2018 at 2:48 AM Michael Ellerman wrote: > Arnd Bergmann writes: > > On Tue, Sep 18, 2018 at 2:15 PM Firoz Khan wrote: > >> On 14 September 2018 at 15:31, Arnd Bergmann wrote: > >> > On Fri, Sep 14, 2018 at 10:33 AM Firoz Khan > >> > wrote: > > > > But all three existing