[PATCH 4/7] powerpc/powernv/pci: Safety fixes for pseudobypass TCE

2018-06-23 Thread Timothy Pearson
allocation Signed-off-by: Russell Currey --- arch/powerpc/platforms/powernv/pci-dma.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-dma.c b/arch/powerpc/platforms/powernv/pci-dma.c index 1d5409be343e..237940a2a052 100644 ---

[PATCH 3/7] powerpc/powernv/pci: Track DMA and TCE tables in debugfs

2018-06-23 Thread Timothy Pearson
Add a new debugfs entry to trigger dumping out the tracking table and TCEs for a given PE, for example PE 0x4 of PHB 2: echo 0x4 > /sys/kernel/debug/powerpc/PCI0002/sketchy This will result in the table being dumped out in dmesg. Signed-off-by: Russell Currey ---

[PATCH 7/7] powerpc/powernv/pci: Don't use the lower 4G TCEs in

2018-06-23 Thread Timothy Pearson
pseudo-DMA mode Four TCEs are reserved for legacy 32-bit DMA mappings in psuedo DMA mode. Mark these with an invalid address to avoid their use by the TCE cache mapper. Signed-off-by: Timothy Pearson --- arch/powerpc/platforms/powernv/pci-ioda.c | 8 +++- 1 file changed, 7 insertions(+),

[PATCH 5/7] powerpc/powernv/pci: Export

2018-06-23 Thread Timothy Pearson
pnv_pci_ioda2_tce_invalidate_pe Pseudo DMA support requires a method to invalidate the TCE cache Export pnv_pci_ioda2_tce_invalidate_pe for use by the pseudo DMA mapper. Signed-off-by: Timothy Pearson --- arch/powerpc/platforms/powernv/pci-ioda.c | 2 +- arch/powerpc/platforms/powernv/pci.h

[PATCH 6/7] powerpc/powernv/pci: Invalidate TCE cache after DMA map

2018-06-23 Thread Timothy Pearson
setup Per the IODA2, TCEs must be invalidated after their settings have been changed. Invalidate the cache after the address is changed during TCE allocation when using pseudo DMA. Signed-off-by: Timothy Pearson --- arch/powerpc/platforms/powernv/pci-dma.c | 3 +-- 1 file changed, 1

[PATCH 1/7] powerpc/powernv/pci: Track largest available TCE order

2018-06-23 Thread Timothy Pearson
per PHB Knowing the largest possible TCE size of a PHB is useful, so get it out of the device tree. This relies on the property being added in OPAL. It is assumed that any PHB4 or later machine would be running firmware that implemented this property, and otherwise assumed to be PHB3, which

[PATCH 2/7] powerpc/powernv: DMA operations for discontiguous

2018-06-23 Thread Timothy Pearson
allocation Cognitive DMA is a new set of DMA operations that solve some issues for devices that want to address more than 32 bits but can't address the 59 bits required to enable direct DMA. The previous implementation for POWER8/PHB3 worked around this by configuring a bypass from the default

[PATCH 0/7] Add initial version of "cognitive DMA"

2018-06-23 Thread Timothy Pearson
POWER9 (PHB4) requires all peripherals using DMA to be either restricted to 32-bit windows or capable of accessing the entire 64 bits of memory space. Some devices, such as most GPUs, can only address up to a certain number of bits (approximately 40, in many cases), while at the same time it is

Re: [PATCH] powerpc/xmon: avoid warnings about variables that might be clobbered by ‘longjmp’

2018-06-23 Thread Segher Boessenkool
On Sat, Jun 23, 2018 at 06:59:27PM +0200, christophe leroy wrote: > > > Le 22/06/2018 à 21:27, Mathieu Malaterre a écrit : > >Move initialization of variables after data definitions. This silence > >warnings treated as error with W=1: > > > > arch/powerpc/xmon/xmon.c:3389:14: error: variable

Re: [PATCH] powerpc/mm: remove warning about ‘type’ being set

2018-06-23 Thread christophe leroy
Le 22/06/2018 à 21:27, Mathieu Malaterre a écrit : ‘type’ is only used when CONFIG_DEBUG_HIGHMEM is set. So add a possibly unused tag to variable. Remove warning treated as error with W=1: arch/powerpc/mm/highmem.c:59:6: error: variable ‘type’ set but not used

Re: [PATCH] powerpc/xmon: avoid warnings about variables that might be clobbered by ‘longjmp’

2018-06-23 Thread christophe leroy
Le 22/06/2018 à 21:27, Mathieu Malaterre a écrit : Move initialization of variables after data definitions. This silence warnings treated as error with W=1: arch/powerpc/xmon/xmon.c:3389:14: error: variable ‘name’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]

Re: [PATCH v2 0/6] powerpc/pkeys: fixes to pkeys

2018-06-23 Thread Michael Ellerman
Ram Pai writes: > On Thu, Jun 21, 2018 at 08:28:47PM +1000, Michael Ellerman wrote: >> Florian Weimer writes: >> > On 06/19/2018 02:40 PM, Michael Ellerman wrote: >> >>> I tested the whole series with the new selftests, with the printamr.c >> >>> program I posted earlier, and the glibc test for

[GIT PULL] Please pull powerpc/linux.git powerpc-4.18-2 tag

2018-06-23 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Linus, Please pull powerpc fixes for 4.18: The following changes since commit ce397d215ccd07b8ae3f71db689aedb85d56ab40: Linux 4.18-rc1 (2018-06-17 08:04:49 +0900) are available in the git repository at:

Re: powerpc/64s: Fix build failures with CONFIG_NMI_IPI=n

2018-06-23 Thread Michael Ellerman
On Tue, 2018-06-19 at 23:04:54 UTC, Michael Ellerman wrote: > I broke the build when CONFIG_NMI_IPI=n with my recent commit to add > arch_trigger_cpumask_backtrace(), eg: > > stacktrace.c:(.text+0x1b0): undefined reference to `.smp_send_safe_nmi_ipi' > > We should rework the CONFIG symbols

Re: powerpc/mm/hash/4k: Free hugetlb page table caches correctly.

2018-06-23 Thread Michael Ellerman
On Thu, 2018-06-14 at 10:31:52 UTC, "Aneesh Kumar K.V" wrote: > With 4k page size for hugetlb we allocate hugepage directories from its on > slab > cache. With patch 0c4d26802 ("powerpc/book3s64/mm: Simplify the rcu callback > for page table free") > we missed to free these allocated hugepd

Re: powerpc/64s/radix: Fix radix_kvm_prefetch_workaround paca access of not possible CPU

2018-06-23 Thread Michael Ellerman
On Tue, 2018-06-12 at 09:38:08 UTC, Nicholas Piggin wrote: > If possible CPUs are limited (e.g., by kexec), then the kvm prefetch > workaround function can access the paca pointer for a !possible CPU. > > Fixes: d2e60075a3d44 ("powerpc/64: Use array of paca pointers and allocate > pacas

Re: [PATCH v2 0/3] Resolve -Wattribute-alias warnings from SYSCALL_DEFINEx()

2018-06-23 Thread Masahiro Yamada
2018-06-20 5:14 GMT+09:00 Paul Burton : > This series introduces infrastructure allowing compiler diagnostics to > be disabled or their severity modified for specific pieces of code, with > suitable abstractions to prevent that code from becoming tied to a > specific compiler. > > This