[PATCH 0/3] fix vmalloc_to_page for huge vmap mappings

2019-06-23 Thread Nicholas Piggin
This is a change broken out from the huge vmap vmalloc series as requested. There is a little bit of dependency juggling across trees, but patches are pretty trivial. Ideally if Andrew accepts this patch and queues it up for next, then the arch patches would be merged through those trees then patch

[PATCH 1/3] arm64: mm: Add p?d_large() definitions

2019-06-23 Thread Nicholas Piggin
walk_page_range() is going to be allowed to walk page tables other than those of user space. For this it needs to know when it has reached a 'leaf' entry in the page tables. This information will be provided by the p?d_large() functions/macros. For arm64, we already have p?d_sect() macros which we

[PATCH 2/3] powerpc/64s: Add p?d_large definitions

2019-06-23 Thread Nicholas Piggin
The subsequent patch to fix vmalloc_to_page with huge vmap requires HUGE_VMAP archs to provide p?d_large definitions for the non-pgd page table levels they support. Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Nicholas Piggin --- Upstream powerpc code does not enable HUGE_VMAP, but the powerp

[PATCH 3/3] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings

2019-06-23 Thread Nicholas Piggin
vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. Whether or not a vmap is huge depends on the architecture details, alignments, boot options, etc., which the caller can not be expected to know. Therefore HUGE_VMAP is a regression for vmalloc_to_page. This change teaches vmallo

Re: [PATCH] powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac

2019-06-23 Thread Michael Ellerman
On Thu, 2019-06-13 at 08:24:46 UTC, Christoph Hellwig wrote: > With the strict dma mask checking introduced with the switch to > the generic DMA direct code common wifi chips on 32-bit powerbooks > stopped working. Add a 30-bit ZONE_DMA to the 32-bit pmac builds > to allow them to reliably allocat

Re: [PATCH 1/3] KVM: PPC: Book3S HV: Invalidate ERAT when flushing guest TLB entries

2019-06-23 Thread Michael Ellerman
On Thu, 2019-06-20 at 01:46:49 UTC, Suraj Jitindar Singh wrote: > When a guest vcpu moves from one physical thread to another it is > necessary for the host to perform a tlb flush on the previous core if > another vcpu from the same guest is going to run there. This is because the > guest may use t

[PATCH 2/2] powerpc/64s/radix: keep kernel ERAT over local process/guest invalidates

2019-06-23 Thread Nicholas Piggin
ISAv3 radix modes provide SLBIA variants which can invalidate ERAT for effPID!=0 or for effLPID!=0, which allows user and guest invalidations to retain kernel/host ERAT entries. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/ppc-opcode.h | 8 arch/powerpc/kvm/book3s_hv_buil

[PATCH 1/2] powerpc/64s: Rename PPC_INVALIDATE_ERAT to PPC_ARCH_300_INVALIDATE_ERAT

2019-06-23 Thread Nicholas Piggin
This makes it clear to the caller that it can only be used on POWER9 and later CPUs. Signed-off-by: Nicholas Piggin --- I think I added a bug in machine checks at one point that I might have been able to avoid with this name :) arch/powerpc/include/asm/ppc-opcode.h | 2 +- arch/powerpc/kernel/

Re: [PATCH 1/2] powerpc/64s: Rename PPC_INVALIDATE_ERAT to PPC_ARCH_300_INVALIDATE_ERAT

2019-06-23 Thread Segher Boessenkool
On Sun, Jun 23, 2019 at 08:41:51PM +1000, Nicholas Piggin wrote: > This makes it clear to the caller that it can only be used on POWER9 > and later CPUs. > -#define PPC_INVALIDATE_ERAT PPC_SLBIA(7) > +#define PPC_ARCH_300_INVALIDATE_ERAT PPC_SLBIA(7) The architecture version is 3.0 (or 3.0B), no

Re: [PATCH 1/2] powerpc/64s: Rename PPC_INVALIDATE_ERAT to PPC_ARCH_300_INVALIDATE_ERAT

2019-06-23 Thread Nicholas Piggin
Segher Boessenkool's on June 23, 2019 10:03 pm: > On Sun, Jun 23, 2019 at 08:41:51PM +1000, Nicholas Piggin wrote: >> This makes it clear to the caller that it can only be used on POWER9 >> and later CPUs. > >> -#define PPC_INVALIDATE_ERAT PPC_SLBIA(7) >> +#define PPC_ARCH_300_INVALIDATE_ERAT

Re: [PATCH v2] powerpc/mm: mark more tlb functions as __always_inline

2019-06-23 Thread Masahiro Yamada
On Tue, May 21, 2019 at 10:19 PM Masahiro Yamada wrote: > > With CONFIG_OPTIMIZE_INLINING enabled, Laura Abbott reported error > with gcc 9.1.1: > > arch/powerpc/mm/book3s64/radix_tlb.c: In function '_tlbiel_pid': > arch/powerpc/mm/book3s64/radix_tlb.c:104:2: warning: asm operand 3 probably >

Re: [PATCH v2] powerpc/boot: pass CONFIG options in a simpler and more robust way

2019-06-23 Thread Masahiro Yamada
On Mon, May 13, 2019 at 11:24 PM Masahiro Yamada wrote: > > Commit 5e9dcb6188a4 ("powerpc/boot: Expose Kconfig symbols to wrapper") > was wrong, but commit e41b93a6be57 ("powerpc/boot: Fix build failures > with -j 1") was also wrong. > > The correct dependency is: > > $(obj)/serial.o: $(obj)/aut

[PATCH] i2c: remove casting dma_alloc

2019-06-23 Thread Vasyl Gomonovych
From: Vasyl Generated by: alloc_cast.cocci Signed-off-by: Vasyl --- drivers/i2c/busses/i2c-cpm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c index 187900594e3d..1213e1932ccb 100644 --- a/drivers/i2c/busses/

Re: [PATCH 2/3] powerpc/64s/radix: ioremap use ioremap_page_range

2019-06-23 Thread Nicholas Piggin
Christophe Leroy's on June 19, 2019 10:49 pm: > > > Le 19/06/2019 à 05:59, Nicholas Piggin a écrit : >> Christophe Leroy's on June 11, 2019 4:46 pm: >>> >>> >>> Le 10/06/2019 à 05:08, Nicholas Piggin a écrit : > > [snip] > diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/

Re: [PATCH 2/3] powerpc/64s/radix: ioremap use ioremap_page_range

2019-06-23 Thread Nicholas Piggin
Christophe Leroy's on June 20, 2019 2:25 am: > > > Le 19/06/2019 à 05:59, Nicholas Piggin a écrit : >> Christophe Leroy's on June 11, 2019 4:46 pm: >>> >>> >>> Le 10/06/2019 à 05:08, Nicholas Piggin a écrit : >> I would like to remove the early ioremap or make it into its own >> function. Re-impl

Re: [PATCH 05/13] powerpc/mce: Allow notifier callback to handle MCE

2019-06-23 Thread Mahesh Jagannath Salgaonkar
On 6/23/19 7:44 AM, Reza Arbab wrote: > Hi Mahesh, > > On Fri, Jun 21, 2019 at 12:35:08PM +0530, Mahesh Jagannath Salgaonkar > wrote: >> On 6/21/19 6:27 AM, Santosh Sivaraj wrote: >>> -    blocking_notifier_call_chain(&mce_notifier_list, 0, &evt); >>> +    rc = blocking_notifier_call_chain(&mce_no

Re: [PATCH v2 1/2] powerpc/powernv: Enhance opal message read interface

2019-06-23 Thread Vasant Hegde
On 06/05/2019 05:16 PM, Vasant Hegde wrote: Use "opal-msg-size" device tree property to allocate memory for "opal_msg". Michael, Can you please look into this patchset? Thanks -Vasant Cc: Mahesh Salgaonkar Cc: Jeremy Kerr Signed-off-by: Vasant Hegde --- arch/powerpc/platforms/power

[PATCH 1/5] arm64: don't use asm-generic/ptrace.h

2019-06-23 Thread Christoph Hellwig
Doing the indirection through macros for the regs accessors just makes them harder to read, so implement the helpers directly. Note that only the helpers actually used are implemented now. Signed-off-by: Christoph Hellwig Acked-by: Catalin Marinas --- arch/arm64/include/asm/ptrace.h | 31 +

remove asm-generic/ptrace.h v3

2019-06-23 Thread Christoph Hellwig
Hi all, asm-generic/ptrace.h is a little weird in that it doesn't actually implement any functionality, but it provided multiple layers of macros that just implement trivial inline functions. We implement those directly in the few architectures and be off with a much simpler design. I'm not sure

[PATCH 2/5] powerpc: don't use asm-generic/ptrace.h

2019-06-23 Thread Christoph Hellwig
Doing the indirection through macros for the regs accessors just makes them harder to read, so implement the helpers directly. Note that only the helpers actually used are implemented now. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/ptrace.h | 29 ++---

[PATCH 3/5] sh: don't use asm-generic/ptrace.h

2019-06-23 Thread Christoph Hellwig
Doing the indirection through macros for the regs accessors just makes them harder to read, so implement the helpers directly. Note that only the helpers actually used are implemented now. Signed-off-by: Christoph Hellwig --- arch/sh/include/asm/ptrace.h | 29 + 1 fi

[PATCH 4/5] x86: don't use asm-generic/ptrace.h

2019-06-23 Thread Christoph Hellwig
Doing the indirection through macros for the regs accessors just makes them harder to read, so implement the helpers directly. Note that only the helpers actually used are implemented now. Signed-off-by: Christoph Hellwig Acked-by: Ingo Molnar Acked-by: Oleg Nesterov --- arch/x86/include/asm/

[PATCH 5/5] asm-generic: remove ptrace.h

2019-06-23 Thread Christoph Hellwig
No one is using this header anymore. Signed-off-by: Christoph Hellwig Acked-by: Arnd Bergmann Acked-by: Oleg Nesterov --- MAINTAINERS| 1 - arch/mips/include/asm/ptrace.h | 5 --- include/asm-generic/ptrace.h | 73 -- 3 files changed, 79

Re: [PATCH 0/3] fix vmalloc_to_page for huge vmap mappings

2019-06-23 Thread Anshuman Khandual
Hello Nicholas, On 06/23/2019 03:14 PM, Nicholas Piggin wrote: > This is a change broken out from the huge vmap vmalloc series as > requested. There is a little bit of dependency juggling across Thanks for splitting up the previous series and sending this one out. > trees, but patches are prett

[PATCH v1] powerpc: Fix BUG_ON during memory unplug on radix

2019-06-23 Thread Bharata B Rao
We hit the following BUG_ON when memory hotplugged before reboot is unplugged after reboot: kernel BUG at arch/powerpc/mm/pgtable-frag.c:113! remove_pagetable+0x594/0x6a0 (unreliable) remove_pagetable+0x94/0x6a0 vmemmap_free+0x394/0x410 sparse_remove_one_section+0x26c/0x2e8 __remove_pages+0

Re: [PATCH 3/3] mm/vmalloc: fix vmalloc_to_page for huge vmap mappings

2019-06-23 Thread Anshuman Khandual
On 06/23/2019 03:14 PM, Nicholas Piggin wrote: > vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. > Whether or not a vmap is huge depends on the architecture details, > alignments, boot options, etc., which the caller can not be expected > to know. Therefore HUGE_VMAP is a r