Re: [PATCH 02/20] kernel/dma/direct: refine dma_direct_alloc zone selection

2018-08-21 Thread Christoph Hellwig
On Thu, Aug 09, 2018 at 09:54:33AM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2018-07-30 at 18:38 +0200, Christoph Hellwig wrote: > > We need to take the DMA offset and encryption bit into account when > > selecting > > a zone. Add a helper that takes those into account and use it. > > That

Re: [PATCH 01/20] kernel/dma/direct: take DMA offset into account in dma_direct_supported

2018-08-21 Thread Christoph Hellwig
On Thu, Aug 09, 2018 at 09:44:18AM +1000, Benjamin Herrenschmidt wrote: > We do have the occasional device with things like 31-bit DMA > limitation. We know they happens to work because those systems > can't have enough memory to be a problem. This is why our current > DMA direct ops in powerpc jus

Re: [PATCH 08/20] powerpc/dma: remove the unused dma_nommu_ops export

2018-08-21 Thread Christoph Hellwig
On Thu, Aug 09, 2018 at 10:01:16AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2018-07-31 at 14:16 +0200, Christoph Hellwig wrote: > > It turns out cxl actually uses it. So for now skip this patch, > > although random code in drivers messing with dma ops will need to > > be sorted out sooner or

Re: [RFC PATCH 1/5] powerpc/64s/hash: convert SLB miss handlers to C

2018-08-21 Thread Nicholas Piggin
On Tue, 21 Aug 2018 16:46:02 +1000 Michael Ellerman wrote: > Nicholas Piggin writes: > > > This patch moves SLB miss handlers completely to C, using the standard > > exception handler macros to set up the stack and branch to C. > > > > This can be done because the segment containing the kernel

Re: [v5] powerpc/topology: Get topology for shared processors at boot

2018-08-21 Thread Srikar Dronamraju
* Michael Ellerman [2018-08-21 20:35:23]: > On Fri, 2018-08-17 at 14:54:39 UTC, Srikar Dronamraju wrote: > > On a shared lpar, Phyp will not update the cpu associativity at boot > > time. Just after the boot system does recognize itself as a shared lpar and > > trigger a request for correct cpu a

Re: [PATCH] crypto: vmx - Fix sleep-in-atomic bugs

2018-08-21 Thread Ondrej Mosnáček
CC: Paulo Flabiano Smorigo , linuxppc-dev@lists.ozlabs.org (Sorry, sent this before reading new e-mails in the thread...) ut 21. 8. 2018 o 17:18 Ondrej Mosnacek napísal(a): > > This patch fixes sleep-in-atomic bugs in AES-CBC and AES-XTS VMX > implementations. The problem is that the blkcipher_*

[PATCH 7/8] powerpc: enable building all dtbs

2018-08-21 Thread Rob Herring
Enable the 'dtbs' target for powerpc. This allows building all the dts files in arch/powerpc/boot/dts/ when COMPILE_TEST and OF_ALL_DTBS are enabled. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring --- arch/powerp

[PATCH 6/8] kbuild: consolidate Devicetree dtb build rules

2018-08-21 Thread Rob Herring
There is nothing arch specific about building dtb files other than their location under /arch/*/boot/dts/. Keeping each arch aligned is a pain. The dependencies and supported targets are all slightly different. Also, a cross-compiler for each arch is needed, but really the host compiler preprocesso

[PATCH 0/8] Devicetree build consolidation

2018-08-21 Thread Rob Herring
This series addresses a couple of issues I have with building dts files. First, the ability to build all the dts files in the tree. This has been supported on most arches for some time with powerpc being the main exception. The reason powerpc wasn't supported was it needed a change in the location

[PATCH 1/8] powerpc: build .dtb files in dts directory

2018-08-21 Thread Rob Herring
Align powerpc with other architectures which build the dtb files in the same directory as the dts files. This is also in line with most other build targets which are located in the same directory as the source. This move will help enable the 'dtbs' target which builds all the dtbs regardless of ker

Re: [PATCH 5/5] arm64: dts: add LX2160ARDB board support

2018-08-21 Thread Rob Herring
On Mon, Aug 20, 2018 at 1:52 PM Vabhav Sharma wrote: > > LX2160A reference design board (RDB) is a high-performance > computing, evaluation, and development platform with LX2160A > SoC. > > Signed-off-by: Priyanka Jain > Signed-off-by: Sriram Dash > Signed-off-by: Vabhav Sharma > --- > arch/ar

[PATCH] selftests/powerpc: Do not fail on TM_CAUSE_RESCHED

2018-08-21 Thread Breno Leitao
There are cases where the test is not expecting to have the transaction aborted, but, the test process might have been rescheduled, either in the OS level or by KVM (if it is running on a KVM guest machine). The process reschedule will cause a treclaim/recheckpoint which will cause the transaction

[PATCH] powerpc/xive: Initialize symbol before usage

2018-08-21 Thread Breno Leitao
Function xive_native_get_ipi() might uses chip_id without it being initialized. This gives the following error on 'smatch' tool: error: uninitialized symbol 'chip_id' This patch simply sets chip_id initial value to 0. CC: Benjamin Herrenschmidt Signed-off-by: Breno Leitao --- arch/pow

[PATCH] powerpc/iommu: avoid derefence before pointer check

2018-08-21 Thread Breno Leitao
The tbl pointer is being derefenced by IOMMU_PAGE_SIZE prior the check if it is not NULL. Just moving the dereference code to after the check, where there will be guarantee that 'tbl' will not be NULL. CC: Alistair Popple Signed-off-by: Breno Leitao --- arch/powerpc/kernel/iommu.c | 2 +- 1 fi

[PATCH] powerpc/kernel: Fix potential spectre v1 in syscall

2018-08-21 Thread Breno Leitao
The rtas syscall reads a value from a user-provided structure and uses it to index an array, being a possible area for a potential spectre v1 attack. This is the code that exposes this problem. args.rets = &args.args[nargs]; The nargs is an user provided value, and the below code is an ex

Re: Odd SIGSEGV issue introduced by commit 6b31d5955cb29 ("mm, oom: fix potential data corruption when oom_reaper races with writer")

2018-08-21 Thread Ram Pai
On Tue, Aug 21, 2018 at 04:40:15PM +1000, Michael Ellerman wrote: > Christophe LEROY writes: > ... > > > > And I bisected its disappearance with commit 99cd1302327a2 ("powerpc: > > Deliver SEGV signal on pkey violation") > > Whoa that's weird. > > > Looking at those two commits, especially the

Re: [PATCH] crypto: vmx - Fix sleep-in-atomic bugs

2018-08-21 Thread Marcelo Henrique Cerri
On Tue, Aug 21, 2018 at 05:24:45PM +0200, Ondrej Mosnáček wrote: > CC: Paulo Flabiano Smorigo , > linuxppc-dev@lists.ozlabs.org > > (Sorry, sent this before reading new e-mails in the thread...) > > ut 21. 8. 2018 o 17:18 Ondrej Mosnacek napísal(a): > > > > This patch fixes sleep-in-atomic bugs

Re: BUG: libkcapi tests trigger sleep-in-atomic bug in VMX code (ppc64)

2018-08-21 Thread Marcelo Henrique Cerri
CC: Paulo Flabiano Smorigo Yes, I do believe that CTR is doing it right. Preemption only needs to be disabled during the aes_p8_cbc_encrypt() call, to avoid trashing the VSX registers during the AES operation. -- Regards, Marcelo On Tue, Aug 21, 2018 at 05:03:50PM +0200, Christophe LEROY wrote

Re: BUG: libkcapi tests trigger sleep-in-atomic bug in VMX code (ppc64)

2018-08-21 Thread Christophe LEROY
Le 21/08/2018 à 16:38, Ondrej Mosnáček a écrit : ut 21. 8. 2018 o 16:18 Stephan Mueller napísal(a): Am Dienstag, 21. August 2018, 14:48:11 CEST schrieb Ondrej Mosnáček: Hi Ondrej, Marcelo, (+Marcelo) Looking at crypto/algif_skcipher.c, I can see that skcipher_recvmsg() holds the socket l

[PATCH 0/2] i2c: remove deprecated attach_adapter callback

2018-08-21 Thread Wolfram Sang
So, I wanted to do this in the next cycle, but Linus seems to want it this cycle already [1], so here it is: Remove the attach_adapter callback from the 2.4 times by converting the last user to a custom probing mechanism based on deferred probing. We used this already in commit ac397c80de89 ("ALSA

[PATCH 2/2] i2c: remove deprecated attach_adapter callback

2018-08-21 Thread Wolfram Sang
There aren't any users left. Remove this callback from the 2.4 times. Phew, finally, that took years to reach... Signed-off-by: Wolfram Sang --- drivers/i2c/i2c-core-base.c | 11 +-- include/linux/i2c.h | 6 -- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/d

[PATCH 1/2] macintosh: therm_windtunnel: drop using attach_adapter

2018-08-21 Thread Wolfram Sang
As we now have deferred probing, we can use a custom mechanism and finally get rid of the legacy interface from the i2c core. Signed-off-by: Wolfram Sang --- drivers/macintosh/therm_windtunnel.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/driver

Re: [PATCH] powerpc/nohash: fix pte_access_permitted()

2018-08-21 Thread Christophe LEROY
Le 21/08/2018 à 16:25, Aneesh Kumar K.V a écrit : Christophe Leroy writes: Commit 5769beaf180a8 ("powerpc/mm: Add proper pte access check helper for other platforms") replaced generic pte_access_permitted() by an arch specific one. The generic one is defined as (pte_present(pte) && (!(writ

Re: [PATCH] powerpc/nohash: fix pte_access_permitted()

2018-08-21 Thread Aneesh Kumar K.V
Christophe Leroy writes: > Commit 5769beaf180a8 ("powerpc/mm: Add proper pte access check helper > for other platforms") replaced generic pte_access_permitted() by an > arch specific one. > > The generic one is defined as > (pte_present(pte) && (!(write) || pte_write(pte))) > > The arch specific

Re: [PATCH 1/2] sched/topology: Set correct numa topology type

2018-08-21 Thread Peter Zijlstra
On Tue, Aug 21, 2018 at 04:02:58AM -0700, Srikar Dronamraju wrote: > * Srikar Dronamraju [2018-08-10 22:30:18]: > > > With commit 051f3ca02e46 ("sched/topology: Introduce NUMA identity node > > sched domain") scheduler introduces an new numa level. However this > > leads to numa topology on 2 nod

[RFC PATCH 2/2] powerpc/mm: Increase the max addressable memory to 2PB

2018-08-21 Thread Aneesh Kumar K.V
Currently we limit the max addressable memory to 128TB. This patch increase the limit to 2PB. We can have devices like nvdimm which adds memory above 512TB limit. We still don't support regular system ram above 512TB. One of the challenge with that is the percpu allocator, that allocates per node

[RFC PATCH 1/2] powerpc/mm/hash: Rename get_ea_context to get_user_context

2018-08-21 Thread Aneesh Kumar K.V
We will be adding get_kernel_context later. Update function name to indicate this handle context allocation user space address. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/mmu.h | 4 ++-- arch/powerpc/include/asm/mmu_context.h | 2 +- arch/powerpc/mm/slb.c

Re: [RFC 00/15] PCI: turn some __weak functions into callbacks

2018-08-21 Thread Christoph Hellwig
On Tue, Aug 21, 2018 at 12:30:50PM +0100, David Woodhouse wrote: > On Mon, 2018-08-20 at 23:14 -0700, Christoph Hellwig wrote: > > On Fri, Aug 17, 2018 at 12:26:30PM +0200, Arnd Bergmann wrote: > > > Hi Bjorn and others, > > >  > > > Triggered by Christoph's patches, I had another go at converting

[PATCH] powerpc/nohash: fix pte_access_permitted()

2018-08-21 Thread Christophe Leroy
Commit 5769beaf180a8 ("powerpc/mm: Add proper pte access check helper for other platforms") replaced generic pte_access_permitted() by an arch specific one. The generic one is defined as (pte_present(pte) && (!(write) || pte_write(pte))) The arch specific one is open coded checking that _PAGE_USE

Re: [RFC 00/15] PCI: turn some __weak functions into callbacks

2018-08-21 Thread David Woodhouse
On Mon, 2018-08-20 at 23:14 -0700, Christoph Hellwig wrote: > On Fri, Aug 17, 2018 at 12:26:30PM +0200, Arnd Bergmann wrote: > > Hi Bjorn and others, > >  > > Triggered by Christoph's patches, I had another go at converting > > all of the remaining pci host bridge implementations to be based > > on

[PATCH v2] powerpc/64s/hash: convert SLB miss handlers to C

2018-08-21 Thread Nicholas Piggin
This patch moves SLB miss handlers completely to C, using the standard exception handler macros to set up the stack and branch to C. This can be done because the segment containing the kernel stack is always bolted, so accessing it with relocation on will not cause an SLB exception. Arbitrary ker

Re: [PATCH] powerpc/64s/hash: convert SLB miss handlers to C

2018-08-21 Thread Nicholas Piggin
On Tue, 21 Aug 2018 16:12:44 +1000 Benjamin Herrenschmidt wrote: > On Tue, 2018-08-21 at 15:13 +1000, Nicholas Piggin wrote: > > This patch moves SLB miss handlers completely to C, using the standard > > exception handler macros to set up the stack and branch to C. > > > > This can be done becau

Re: [PATCH 1/2] sched/topology: Set correct numa topology type

2018-08-21 Thread Srikar Dronamraju
* Srikar Dronamraju [2018-08-10 22:30:18]: > With commit 051f3ca02e46 ("sched/topology: Introduce NUMA identity node > sched domain") scheduler introduces an new numa level. However this > leads to numa topology on 2 node systems no more marked as NUMA_DIRECT. > After this commit, it gets reporte

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

2018-08-21 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 Signed-off-by: David Hildenbrand --- Documenta

[PATCH RFCv2 5/6] powerpc/powernv: hold device_hotplug_lock in memtrace_offline_pages()

2018-08-21 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 Signed-off-by: David Hildenbra

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

2018-08-21 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 Signed-off-by: David Hildenbrand --- arch/powerpc/platforms/powernv/memtrace.c | 2 ++ 1 file changed

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

2018-08-21 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), f

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

2018-08-21 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 device_hotplug

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

2018-08-21 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 So,

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

2018-08-21 Thread David Hildenbrand
This is the same approach as in the first RFC, but this time without exporting device_hotplug_lock (requested by Greg) and with some more details and documentation regarding locking. Tested only on x86 so far. -- Reading thro

Re: powerpc/fadump: cleanup crash memory ranges support

2018-08-21 Thread Michael Ellerman
On Fri, 2018-08-17 at 20:40:56 UTC, Hari Bathini wrote: > Commit 1bd6a1c4b80a ("powerpc/fadump: handle crash memory ranges array > index overflow") changed crash memory ranges to a dynamic array that > is reallocated on-demand with krealloc(). The relevant header for this > call was not included. T

Re: [v5] powerpc/topology: Get topology for shared processors at boot

2018-08-21 Thread Michael Ellerman
On Fri, 2018-08-17 at 14:54:39 UTC, Srikar Dronamraju wrote: > On a shared lpar, Phyp will not update the cpu associativity at boot > time. Just after the boot system does recognize itself as a shared lpar and > trigger a request for correct cpu associativity. But by then the scheduler > would have

Re: [v2] powerpc/powernv/pci: Work around races in PCI bridge enabling

2018-08-21 Thread Michael Ellerman
On Fri, 2018-08-17 at 07:30:39 UTC, Benjamin Herrenschmidt wrote: > The generic code is race when multiple children of a PCI bridge try to > enable it simultaneously. > > This leads to drivers trying to access a device through a not-yet-enabled > bridge, and this EEH errors under various circumsta

Re: powerpc/traps: Avoid rate limit messages from show unhandled signals

2018-08-21 Thread Michael Ellerman
On Fri, 2018-08-17 at 06:55:00 UTC, Michael Ellerman wrote: > In the recent commit to add an explicit ratelimit state when showing > unhandled signals, commit 35a52a10c3ac ("powerpc/traps: Use an > explicit ratelimit state for show_signal_msg()"), I put the check of > show_unhandled_signals and the

Re: powerpc/64s: idle_power4 fix PACA_IRQ_HARD_DIS accounting

2018-08-21 Thread Michael Ellerman
On Tue, 2018-08-07 at 13:21:56 UTC, Nicholas Piggin wrote: > When idle_power4 hard disables interrupts then finds a soft pending > interrupt, it returns with interrupts hard disabled but without > PACA_IRQ_HARD_DIS set. Commit 9b81c0211c ("powerpc/64s: make > PACA_IRQ_HARD_DIS track MSR[EE] closely

Re: [15/15] powerpc/powernv: provide a console flush operation for opal hvc driver

2018-08-21 Thread Michael Ellerman
On Mon, 2018-04-30 at 14:55:58 UTC, Nicholas Piggin wrote: > Provide the flush hv_op for the opal hvc driver. This will flush the > firmware console buffers without spinning with interrupts disabled. > > Cc: Benjamin Herrenschmidt > Cc: linuxppc-dev@lists.ozlabs.org > Signed-off-by: Nicholas Pigg

Re: [PATCH] poewrpc/mce: Fix SLB rebolting during MCE recovery path.

2018-08-21 Thread Nicholas Piggin
On Fri, 17 Aug 2018 14:51:47 +0530 Mahesh J Salgaonkar wrote: > From: Mahesh Salgaonkar > > With the powrpc next commit e7e81847478 (poewrpc/mce: Fix SLB rebolting > during MCE recovery path.), the SLB error recovery is broken. The > commit missed a crucial change of OR-ing index value to RB[52

Re: [PATCH 4/5] arm64: dts: add QorIQ LX2160A SoC support

2018-08-21 Thread Sudeep Holla
On Mon, Aug 20, 2018 at 12:17:15PM +0530, Vabhav Sharma wrote: > LX2160A SoC is based on Layerscape Chassis Generation 3.2 Architecture. > > LX2160A features an advanced 16 64-bit ARM v8 CortexA72 processor cores > in 8 cluster, CCN508, GICv3,two 64-bit DDR4 memory controller, 8 I2C > controllers,

Re: [RFC 00/15] PCI: turn some __weak functions into callbacks

2018-08-21 Thread Arnd Bergmann
On Tue, Aug 21, 2018 at 8:14 AM Christoph Hellwig wrote: > > On Fri, Aug 17, 2018 at 12:26:30PM +0200, Arnd Bergmann wrote: > > Hi Bjorn and others, > > > > Triggered by Christoph's patches, I had another go at converting > > all of the remaining pci host bridge implementations to be based > > on

Re: [PATCH] powerpc/64s/hash: convert SLB miss handlers to C

2018-08-21 Thread Nicholas Piggin
On Tue, 21 Aug 2018 16:12:44 +1000 Benjamin Herrenschmidt wrote: > On Tue, 2018-08-21 at 15:13 +1000, Nicholas Piggin wrote: > > This patch moves SLB miss handlers completely to C, using the standard > > exception handler macros to set up the stack and branch to C. > > > > This can be done becau