Re: [PATCH v2 -next] powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index

2018-10-09 Thread Michael Ellerman
YueHaibing writes: > 'aa_index' is defined as an unsigned value, but find_aa_index > may return -1 when dlpar_clone_property fails. So we use an rc > value to track the validation of finding the aa_index instead > of the 'aa_index' value itself > > Fixes: c05a5a40969e ("powerpc/pseries: Dynamic ad

Re: [linux-next][bisected e3fbcc7c] build error at drivers/pci/pcie/aer_inject.c:444:6: error: ‘struct pt_regs’ has no member named ‘ip

2018-10-09 Thread Michael Ellerman
fbcc7c4b130f81ea586183db561fa3ce9c6447 PCI/AER: Covertly inject errors with > ftrace hooks I don't see this commit in today's linux next (20181009) so presumably someone else has noticed and dropped the commit? cheers

Re: [PATCH v2 3/3] powerpc: machine check interrupt is a non-maskable interrupt

2018-10-09 Thread Christophe Leroy
On 10/09/2018 05:30 AM, Nicholas Piggin wrote: On Tue, 9 Oct 2018 06:46:30 +0200 Christophe LEROY wrote: Le 09/10/2018 à 06:32, Nicholas Piggin a écrit : On Mon, 8 Oct 2018 17:39:11 +0200 Christophe LEROY wrote: Hi Nick, Le 19/07/2017 à 08:59, Nicholas Piggin a écrit : Use nmi_ente

Re: [PATCH] powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y

2018-10-09 Thread Michael Ellerman
Benjamin Herrenschmidt writes: > On Mon, 2018-10-08 at 17:04 +1000, Nicholas Piggin wrote: >> On Mon, 08 Oct 2018 15:08:31 +1100 >> Benjamin Herrenschmidt wrote: >> >> > HMIs will crash the kernel due to >> > >> >BRANCH_LINK_TO_FAR(hmi_exception_realmode) >> > >> > Calling into the OPD ins

Re: [linux-next][bisected e3fbcc7c] build error at drivers/pci/pcie/aer_inject.c:444:6: error: ‘struct pt_regs’ has no member named ‘ip

2018-10-09 Thread Abdul Haleem
a47 PCI/AER: Abstract AER interrupt > > handling > > 7b23285f930a8dedcbf749661cd0f2cc27f79be6 PCI/AER: Reuse existing > > pcie_port_find_device() interface > > e3fbcc7c4b130f81ea586183db561fa3ce9c6447 PCI/AER: Covertly inject errors > > with ftrace hooks > > I

Re: [PATCH v6 0/9] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK

2018-10-09 Thread Nicholas Piggin
On Mon, 08 Oct 2018 20:59:56 +1100 Benjamin Herrenschmidt wrote: > On Mon, 2018-10-08 at 09:16 +, Christophe Leroy wrote: > > The purpose of this serie is to activate CONFIG_THREAD_INFO_IN_TASK which > > moves the thread_info into task_struct. > > We need to make sure we don't have code th

Re: [PATCH v2 3/3] powerpc: machine check interrupt is a non-maskable interrupt

2018-10-09 Thread Nicholas Piggin
On Tue, 9 Oct 2018 09:36:18 + Christophe Leroy wrote: > On 10/09/2018 05:30 AM, Nicholas Piggin wrote: > > On Tue, 9 Oct 2018 06:46:30 +0200 > > Christophe LEROY wrote: > > > >> Le 09/10/2018 à 06:32, Nicholas Piggin a écrit : > >>> On Mon, 8 Oct 2018 17:39:11 +0200 > >>> Christophe LER

Re: [PATCH v03 1/5] powerpc/drmem: Export 'dynamic-memory' loader

2018-10-09 Thread Michael Ellerman
Nathan Fontenot writes: > On 10/02/2018 08:00 PM, Michael Ellerman wrote: >> Michael Bringmann writes: >> >>> powerpc/drmem: Export many of the functions of DRMEM to parse >>> "ibm,dynamic-memory" and "ibm,dynamic-memory-v2" during hotplug >>> operations and for Post Migration events. >> >> Th

Re: [PATCH] powerpc/mobility: Extend start/stop topology update scope

2018-10-09 Thread Michael Ellerman
Michael Bringmann writes: > The PPC mobility code may receive RTAS requests to perform PRRN > topology changes at any time, including during LPAR migration > operations. In some configurations where the affinity of CPUs > or memory is being changed on that platform, the PRRN requests > may apply

Re: [PATCH] powerpc: signedness bug in update_flash_db()

2018-10-09 Thread Michael Ellerman
christophe leroy writes: > Le 01/10/2018 à 18:44, Dan Carpenter a écrit : >> The "count < sizeof(struct os_area_db)" comparison is type promoted to >> size_t so negative values of "count" are treated as very high values and >> we accidentally return success instead of a negative error code. >> >

Re: [PATCH 13/36] dt-bindings: arm: Convert PMU binding to json-schema

2018-10-09 Thread Will Deacon
Hi Rob, On Fri, Oct 05, 2018 at 11:58:25AM -0500, Rob Herring wrote: > Convert ARM PMU binding to DT schema format using json-schema. > > Cc: Will Deacon > Cc: Mark Rutland > Cc: linux-arm-ker...@lists.infradead.org > Cc: devicet...@vger.kernel.org > Signed-off-by: Rob Herring > --- > Documen

Re: [PATCH v2 3/3] powerpc: machine check interrupt is a non-maskable interrupt

2018-10-09 Thread Christophe LEROY
Le 09/10/2018 à 13:16, Nicholas Piggin a écrit : On Tue, 9 Oct 2018 09:36:18 + Christophe Leroy wrote: On 10/09/2018 05:30 AM, Nicholas Piggin wrote: On Tue, 9 Oct 2018 06:46:30 +0200 Christophe LEROY wrote: Le 09/10/2018 à 06:32, Nicholas Piggin a écrit : On Mon, 8 Oct 2018 17:

Re: [PATCH v2 3/3] powerpc: machine check interrupt is a non-maskable interrupt

2018-10-09 Thread Nicholas Piggin
On Tue, 9 Oct 2018 14:01:37 +0200 Christophe LEROY wrote: > Le 09/10/2018 à 13:16, Nicholas Piggin a écrit : > > On Tue, 9 Oct 2018 09:36:18 + > > Christophe Leroy wrote: > > > >> On 10/09/2018 05:30 AM, Nicholas Piggin wrote: > >>> On Tue, 9 Oct 2018 06:46:30 +0200 > >>> Christophe LER

Re: [linux-next][bisected e3fbcc7c] build error at drivers/pci/pcie/aer_inject.c:444:6: error: ‘struct pt_regs’ has no member named ‘ip

2018-10-09 Thread Bjorn Helgaas
.8.5 20150623 > > > config attached > > > > > > Recent code changes from these commits: > > > > > > c79ad38b36dd4967d67f83fc48bade37ee041a47 PCI/AER: Abstract AER interrupt > > > handling > > > 7b23285f930a8dedcbf749661cd0f2cc27f79be6 PCI/AER: Reu

Re: [PATCH] powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y

2018-10-09 Thread Benjamin Herrenschmidt
On Tue, 2018-10-09 at 21:37 +1100, Michael Ellerman wrote: > Technically yes. But I thought because we build with mcmodel=medium > we'll never actually get multiple TOCs in the kernel itself, so it > doesn't actually matter. > > So this seems to work for now: Ok, fine. I forgot about DOTSYM. Will

[PATCH 12/33] powerpc/cell: use the generic iommu bypass code

2018-10-09 Thread Christoph Hellwig
This gets rid of a lot of clumsy code and finally allows us to mark dma_iommu_ops const. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 2 +- arch/powerpc/include/asm/iommu.h | 6 ++ arch/powerpc/kernel/dma-iommu.c| 7 +- arch/powerpc/platforms/

[PATCH 08/33] powerpc/dma: handle iommu bypass in dma_iommu_ops

2018-10-09 Thread Christoph Hellwig
Add a new iommu_bypass flag to struct dev_archdata so that the dma_iommu implementation can handle the direct mapping transparently instead of switiching ops around. Setting of this flag is controlled by new pci_controller_ops method. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/as

[PATCH 09/33] powerpc/pseries: unwind dma_get_required_mask_pSeriesLP a bit

2018-10-09 Thread Christoph Hellwig
Call dma_get_required_mask_pSeriesLP directly instead of dma_iommu_ops to simply the code a bit. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/pseries/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/

[PATCH 11/33] powerpc/cell: move dma direct window setup out of dma_configure

2018-10-09 Thread Christoph Hellwig
Configure the dma settings at device setup time, and stop playing games with get_pci_dma_ops. This prepares for using the common dma_configure code later on. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/cell/iommu.c | 20 +++- 1 file changed, 11 insertions(+), 9 d

[PATCH 04/33] powerpc/dma: remove the unused dma_iommu_ops export

2018-10-09 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/powerpc/kernel/dma-iommu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index f9fe2080ceb9..2ca6cfaebf65 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-i

[PATCH 10/33] powerpc/pseries: use the generic iommu bypass code

2018-10-09 Thread Christoph Hellwig
Use the generic iommu bypass code instead of overriding set_dma_mask. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/pseries/iommu.c | 100 +++-- 1 file changed, 27 insertions(+), 73 deletions(-) diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerp

[PATCH 17/33] powerpc/powernv: use the generic iommu bypass code

2018-10-09 Thread Christoph Hellwig
Use the generic iommu bypass code instead of overriding set_dma_mask. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/powernv/pci-ioda.c | 92 ++- 1 file changed, 25 insertions(+), 67 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/pow

[PATCH 14/33] powerpc/dart: use the generic iommu bypass code

2018-10-09 Thread Christoph Hellwig
Use the generic iommu bypass code instead of overriding set_dma_mask. Signed-off-by: Christoph Hellwig --- arch/powerpc/sysdev/dart_iommu.c | 45 +++- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysde

[PATCH 18/33] powerpc/dma: stop overriding dma_get_required_mask

2018-10-09 Thread Christoph Hellwig
The ppc_md and pci_controller_ops methods are unused now and can be removed. The dma_nommu implementation is generic to the generic one except for using max_pfn instead of calling into the memblock API, and all other dma_map_ops instances implement a method of their own. Signed-off-by: Christoph

[PATCH 16/33] powerpc/powernv: remove dead npu-dma code

2018-10-09 Thread Christoph Hellwig
This code has been unused since it was merged and is in the way of cleaning up the DMA code, thus remove it. This effectively reverts commit 5d2aa710 ("powerpc/powernv: Add support for Nvlink NPUs"). Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/pci.h| 3 - arch/po

[PATCH 13/33] powerpc/dart: remove dead cleanup code in iommu_init_early_dart

2018-10-09 Thread Christoph Hellwig
If dart_init failed we didn't have a chance to setup dma or controller ops yet, so there is no point in resetting them. Signed-off-by: Christoph Hellwig --- arch/powerpc/sysdev/dart_iommu.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/arch/powerpc/sysdev/dart_i

[PATCH 20/33] powerpc/dma: remove the iommu fallback for coherent allocations

2018-10-09 Thread Christoph Hellwig
All iommu capable platforms now always use the iommu code with the internal bypass, so there is not need for this magic anymore. Signed-off-by: Christoph Hellwig --- arch/powerpc/Kconfig | 4 --- arch/powerpc/kernel/dma.c | 68 ++- 2 files changed, 2 ins

[PATCH 19/33] powerpc/pci: remove the dma_set_mask pci_controller ops methods

2018-10-09 Thread Christoph Hellwig
Unused now. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/pci-bridge.h | 2 -- arch/powerpc/kernel/dma.c | 7 --- 2 files changed, 9 deletions(-) diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index aace7033fa02..a5070

[PATCH 15/33] powerpc/powernv: remove pnv_pci_ioda_pe_single_vendor

2018-10-09 Thread Christoph Hellwig
This function is completely bogus - the fact that two PCIe devices come from the same vendor has absolutely nothing to say about the DMA capabilities and characteristics. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/powernv/pci-ioda.c | 28 ++- 1 file changed,

[PATCH 22/33] powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c

2018-10-09 Thread Christoph Hellwig
pci_dma_dev_setup_swiotlb is only used by the fsl_pci code, and closely related to it, so fsl_pci.c seems like a better place for it. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/swiotlb.h | 2 -- arch/powerpc/kernel/dma-swiotlb.c | 11 --- arch/powerpc/sysdev/fsl_pci.

[PATCH 23/33] powerpc/dma: remove max_direct_dma_addr

2018-10-09 Thread Christoph Hellwig
The max_direct_dma_addr duplicates the bus_dma_mask field in struct device. Use the generic field instead. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/device.h | 3 --- arch/powerpc/include/asm/dma-direct.h | 4 +--- arch/powerpc/kernel/dma-swiotlb.c | 20 ---

[PATCH 24/33] powerpc/dma: fix an off-by-one in dma_capable

2018-10-09 Thread Christoph Hellwig
We need to compare the last byte in the dma range and not the one after it for the bus_dma_mask, just like we do for the regular dma_mask. Fix this cleanly by merging the two comparisms into one. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-direct.h | 8 ++-- 1 file cha

[PATCH 25/33] cxl: drop the dma_set_mask callback from vphb

2018-10-09 Thread Christoph Hellwig
The CXL code never even looks at the dma mask, so there is no good reason for this sanity check. Remove it because it gets in the way of the dma ops refactoring. Signed-off-by: Christoph Hellwig --- drivers/misc/cxl/vphb.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers

[PATCH 21/33] powerpc/dma: remove get_pci_dma_ops

2018-10-09 Thread Christoph Hellwig
This function is only used by the Cell iommu code, which can keep track if it is using the iommu internally just as good. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/pci.h | 2 -- arch/powerpc/kernel/pci-common.c| 6 -- arch/powerpc/platforms/cell/iommu.c | 17 ++

[PATCH 28/33] powerpc/dma: use phys_to_dma instead of get_dma_offset

2018-10-09 Thread Christoph Hellwig
Use the standard portable helper instead of the powerpc specific one, which is about to go away. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/dma-swiotlb.c | 2 +- arch/powerpc/kernel/dma.c | 10 +- 2 files changed, 6 insertions(+),

[PATCH 27/33] dma-mapping, powerpc: simplify the arch dma_set_mask override

2018-10-09 Thread Christoph Hellwig
Instead of letting the architecture supply all of dma_set_mask just give it an additional hook selected by Kconfig. Signed-off-by: Christoph Hellwig --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/dma-mapping.h | 3 --- arch/powerpc/kernel/dma-swiotlb.c | 8 +++

[PATCH 29/33] powerpc/dma: remove get_dma_offset

2018-10-09 Thread Christoph Hellwig
Just fold the calculation into __phys_to_dma/__dma_to_phys as those are the only places that should know about it. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/dma-direct.h | 8 ++-- arch/powerpc/include/asm/dma-mapping.h | 16

[PATCH 31/33] powerpc/dma: remove dma_nommu_mmap_coherent

2018-10-09 Thread Christoph Hellwig
The coherent cache version of this function already is functionally identicall to the default version, and by defining the arch_dma_coherent_to_pfn hook the same is ture for the noncoherent version as well. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 4 ar

[PATCH 26/33] powerpc/fsl_pci: simplify fsl_pci_dma_set_mask

2018-10-09 Thread Christoph Hellwig
swiotlb will only bounce buffer the effectice dma address for the device is smaller than the actual DMA range. Instead of flipping between the swiotlb and nommu ops for FSL SOCs that have the second outbound window just don't set the bus dma_mask in this case. Signed-off-by: Christoph Hellwig --

[PATCH 33/33] powerpc/dma: trim the fat from

2018-10-09 Thread Christoph Hellwig
There is no need to provide anything but get_arch_dma_ops to . More the remaining declarations to and drop all the includes. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 29 -- arch/powerpc/include/asm/iommu.h | 10 + arch/

[PATCH 30/33] powerpc/dma: remove set_dma_offset

2018-10-09 Thread Christoph Hellwig
There is no good reason for this helper, just opencode it. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h| 6 -- arch/powerpc/kernel/pci-common.c | 2 +- arch/powerpc/platforms/cell/iommu.c | 4 ++-- arch/powerpc/platforms/powernv/pci-ioda.c |

[PATCH 32/33] powerpc/dma: use generic direct and swiotlb ops

2018-10-09 Thread Christoph Hellwig
- The ppc32 case of dma_nommu_dma_supported already was a no-op, and the 64-bit case came to the same conclusion as dma_direct_supported, so replace it with the generic version. - supports CMA - Note that the cache maintainance in the existing code is a bit odd as it implements both t

[PATCH 06/33] powerpc/dma: remove the no-op dma_nommu_unmap_{page, sg} routines

2018-10-09 Thread Christoph Hellwig
These methods are optional, no need to implement no-op versions. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/dma.c | 16 1 file changed, 16 deletions(-) diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index d6deb

[PATCH 03/33] powerpc/dma: remove the unused ISA_DMA_THRESHOLD export

2018-10-09 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index 8c507be12c3c..3cc2e449594c 100644 --- a/arch/powerpc/kernel/setup_32.c +++

[PATCH 01/33] powerpc: use mm zones more sensibly

2018-10-09 Thread Christoph Hellwig
Powerpc has somewhat odd usage where ZONE_DMA is used for all memory on common 64-bit configfs, and ZONE_DMA32 is used for 31-bit schemes. Move to a scheme closer to what other architectures use (and I dare to say the intent of the system): - ZONE_DMA: optionally for memory < 31-bit - ZONE_NORM

use generic DMA mapping code in powerpc V3

2018-10-09 Thread Christoph Hellwig
Hi all, this series switches the powerpc port to use the generic swiotlb and noncoherent dma ops, and to use more generic code for the coherent direct mapping, as well as removing a lot of dead code. The changes since v1 are to big to list and v2 was not posted in public. As this series is very

[PATCH 02/33] powerpc/dma: remove the unused ARCH_HAS_DMA_MMAP_COHERENT define

2018-10-09 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 8fa394520af6..f2a4a7142b1e 100644 --- a/arch/po

[PATCH 05/33] powerpc/dma: split the two __dma_alloc_coherent implementations

2018-10-09 Thread Christoph Hellwig
The implemementation for the CONFIG_NOT_COHERENT_CACHE case doesn't share any code with the one for systems with coherent caches. Split it off and merge it with the helpers in dma-noncoherent.c that have no other callers. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt --- ar

[PATCH 07/33] powerpc/dma: untangle vio_dma_mapping_ops from dma_iommu_ops

2018-10-09 Thread Christoph Hellwig
vio_dma_mapping_ops currently does a lot of indirect calls through dma_iommu_ops, which not only make the code harder to follow but are also expensive in the post-spectre world. Unwind the indirect calls by calling the ppc_iommu_* or iommu_* APIs directly applicable, or just use the dma_iommu_* me

[PATCH v3 00/24] ban the use of _PAGE_XXX flags outside platform specific code

2018-10-09 Thread Christophe Leroy
Today flags like for instance _PAGE_RW or _PAGE_USER are used through common parts of code. Using those directly in common parts of code have proven to lead to mistakes or misbehaviour, because their use is not always as trivial as one could think. For instance, (flags & _PAGE_USER) == 0 isn't eno

[PATCH v3 01/24] powerpc/32: Add ioremap_wt() and ioremap_coherent()

2018-10-09 Thread Christophe Leroy
Other arches have ioremap_wt() to map IO areas write-through. Implement it on PPC as well in order to avoid drivers using __ioremap(_PAGE_WRITETHRU) Also implement ioremap_coherent() to avoid drivers using __ioremap(_PAGE_COHERENT) Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/io

[PATCH v3 02/24] drivers/video/fbdev: use ioremap_wc/wt() instead of __ioremap()

2018-10-09 Thread Christophe Leroy
_PAGE_NO_CACHE is a platform specific flag. In addition, this flag is misleading because one would think it requests a noncached page whereas a noncached page is _PAGE_NO_CACHE | _PAGE_GUARDED _PAGE_NO_CACHE alone means write combined noncached page, so lets use ioremap_wc() instead. _PAGE_WRITET

[PATCH v3 03/24] drivers/block/z2ram: use ioremap_wt() instead of __ioremap(_PAGE_WRITETHRU)

2018-10-09 Thread Christophe Leroy
_PAGE_WRITETHRU is a target specific flag. Prefer generic functions. Acked-by: Geert Uytterhoeven Signed-off-by: Christophe Leroy --- drivers/block/z2ram.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c index d0c5bc4e0703..cfb

[PATCH v3 04/24] soc/fsl/qbman: use ioremap_cache() instead of ioremap_prot(0)

2018-10-09 Thread Christophe Leroy
ioremap_prot() with flag set to 0 relies on a hack in __ioremap_caller() which adds PAGE_KERNEL flags when the handed flags don't look like a valid set of flags (ie don't include _PAGE_PRESENT) The intention being to map cached memory, use ioremap_cache() instead. Signed-off-by: Christophe Leroy

[PATCH v3 05/24] powerpc: don't use ioremap_prot() nor __ioremap() unless really needed.

2018-10-09 Thread Christophe Leroy
In many places, ioremap_prot() and __ioremap() can be replaced with higher level functions like ioremap(), ioremap_coherent(), ioremap_cache(), ioremap_wc() ... Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/btext.c | 2 +- arch/powerpc/kernel/crash_dump.c | 2 +-

[PATCH v3 06/24] powerpc/mm: properly set PAGE_KERNEL flags in ioremap()

2018-10-09 Thread Christophe Leroy
Set PAGE_KERNEL directly in the caller and do not rely on a hack adding PAGE_KERNEL flags when _PAGE_PRESENT is not set. As already done for PPC64, use pgprot_cache() helpers instead of _PAGE_XXX flags in PPC32 ioremap() derived functions. Signed-off-by: Christophe Leroy --- arch/powerpc/includ

[PATCH v3 07/24] powerpc: handover page flags with a pgprot_t parameter

2018-10-09 Thread Christophe Leroy
In order to avoid multiple conversions, handover directly a pgprot_t to map_kernel_page() as already done for radix. Do the same for __ioremap_caller() and __ioremap_at(). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 2 +- arch/powerpc/include/asm/book3s/6

[PATCH v3 08/24] powerpc/mm: don't use _PAGE_EXEC in book3s/32

2018-10-09 Thread Christophe Leroy
book3s/32 doesn't define _PAGE_EXEC, so no need to use it. All other platforms define _PAGE_EXEC so no need to check it is not NUL when not book3s/32. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 2 +- arch/powerpc/mm/pgtable.

[PATCH v3 10/24] powerpc/mm: add pte helpers to query and change pte flags

2018-10-09 Thread Christophe Leroy
In order to avoid using generic _PAGE_XXX flags in powerpc core functions, define helpers for all needed flags: - pte_mkuser() and pte_mkprivileged() to set/unset and/or unset/set _PAGE_USER and/or _PAGE_PRIVILEGED - pte_hashpte() to check if _PAGE_HASHPTE is set. - pte_ci() check if cache is inhib

[PATCH v3 09/24] powerpc/mm: move some nohash pte helpers in nohash/[32:64]/pgtable.h

2018-10-09 Thread Christophe Leroy
In order to allow their use in nohash/32/pgtable.h, we have to move the following helpers in nohash/[32:64]/pgtable.h: - pte_mkwrite() - pte_mkdirty() - pte_mkyoung() - pte_wrprotect() Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h

[PATCH v3 11/24] powerpc/mm: don't use _PAGE_EXEC for calling hash_preload()

2018-10-09 Thread Christophe Leroy
The 'access' parameter of hash_preload() is either 0 or _PAGE_EXEC. Among the two versions of hash_preload(), only the PPC64 one is doing something with this 'access' parameter. In order to remove the use of _PAGE_EXEC outside platform code, 'access' parameter is replaced by 'is_exec' which will b

[PATCH v3 12/24] powerpc/mm: use pte helpers in generic code

2018-10-09 Thread Christophe Leroy
Get rid of platform specific _PAGE_ in powerpc common code and use helpers instead. mm/dump_linuxpagetables.c will be handled separately Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 9 +++-- arch/powerpc/include/asm/n

[PATCH v3 13/24] powerpc/mm: Split dump_pagelinuxtables flag_array table

2018-10-09 Thread Christophe Leroy
To reduce the complexity of flag_array, and allow the removal of default 0 value of non existing flags, lets have one flag_array table for each platform family with only the really existing flags. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/mm/Makefile

[PATCH v3 14/24] powerpc/mm: drop unused page flags

2018-10-09 Thread Christophe Leroy
The following page flags in pte-common.h can be dropped: _PAGE_ENDIAN is only used in mm/fsl_booke_mmu.c and is defined in asm/nohash/32/pte-fsl-booke.h _PAGE_4K_PFN is nowhere defined nor used _PAGE_READ, _PAGE_WRITE and _PAGE_PTE are only defined and used in book3s/64 The following page flags

[PATCH v3 15/24] powerpc/mm: move __P and __S tables in the common pgtable.h

2018-10-09 Thread Christophe Leroy
__P and __S flags are the same for all platform and should remain as is in the future, so avoid duplication. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/pgtable.h | 20 arch/powerpc/include/asm/pgtable.h | 1

[PATCH v3 16/24] powerpc/book3s/32: do not include pte-common.h

2018-10-09 Thread Christophe Leroy
As done for book3s/64, add necessary flags/defines in book3s/32/pgtable.h and do not include pte-common.h It allows in the meantime to remove all related hash definitions from pte-common.h and to also remove _PAGE_EXEC default as _PAGE_EXEC is defined on all platforms except book3s/32. Reviewed-b

[PATCH v3 17/24] powerpc/mm: Move pte_user() into nohash/pgtable.h

2018-10-09 Thread Christophe Leroy
Now the pte-common.h is only for nohash platforms, lets move pte_user() helper out of pte-common.h to put it together with other helpers. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/pgtable.h | 10 ++ arch/powerpc/include/asm/pte-com

[PATCH v3 18/24] powerpc/mm: Distribute platform specific PAGE and PMD flags and definitions

2018-10-09 Thread Christophe Leroy
The base kernel PAGE_ definition sets are more or less platform specific. Lets distribute them close to platform _PAGE_XXX flags definition, and customise them to their exact platform flags. Also defines _PAGE_PSIZE and _PTE_NONE_MASK for each platform allthough they are defined as 0. Do the

[PATCH v3 19/24] powerpc/nohash/64: do not include pte-common.h

2018-10-09 Thread Christophe Leroy
nohash/64 only uses book3e PTE flags, so it doesn't need pte-common.h This also allows to drop PAGE_SAO and H_PAGE_4K_PFN from pte_common.h as they are only used by PPC64 Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/64/pgtable.h | 16 +++

[PATCH v3 20/24] powerpc/mm: Allow platforms to redefine some helpers

2018-10-09 Thread Christophe Leroy
The 40xx defines _PAGE_HWWRITE while others don't. The 8xx defines _PAGE_RO instead of _PAGE_RW. The 8xx defines _PAGE_PRIVILEGED instead of _PAGE_USER. The 8xx defines _PAGE_HUGE and _PAGE_NA while others don't. Lets those platforms redefine pte_write(), pte_wrprotect() and pte_mkwrite() and get

[PATCH v3 21/24] powerpc/mm: Define platform default caches related flags

2018-10-09 Thread Christophe Leroy
Cache related flags like _PAGE_COHERENT and _PAGE_WRITETHRU are defined on most platforms. The platforms not defining them don't define any alternative. So we can give them a NUL value directly for those platforms directly. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/

[PATCH v3 22/24] powerpc/mm: Get rid of pte-common.h

2018-10-09 Thread Christophe Leroy
Do not include pte-common.h in nohash/32/pgtable.h As that was the last includer, get rid of pte-common.h Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 23 +-- arch/powerpc/include/asm/pte-common.h|

[PATCH v3 23/24] powerpc/8xx: change name of a few page flags to avoid confusion

2018-10-09 Thread Christophe Leroy
_PAGE_PRIVILEGED corresponds to the SH bit which doesn't protect against user access but only disables ASID verification on kernel accesses. User access is controlled with _PMD_USER flag. Name it _PAGE_SH instead of _PAGE_PRIVILEGED _PAGE_HUGE corresponds to the SPS bit which doesn't really tells

[PATCH v3 24/24] powerpc/book3s64: Avoid multiple endian conversion in pte helpers

2018-10-09 Thread Christophe Leroy
In the same spirit as already done in pte query helpers, this patch changes pte setting helpers to perform endian conversions on the constants rather than on the pte value. In the meantime, it changes pte_access_permitted() to use pte helpers for the same reason. Signed-off-by: Christophe Leroy

[PATCH v3 -next] powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index

2018-10-09 Thread YueHaibing
'aa_index' is defined as an unsigned value, but find_aa_index may return -1 when dlpar_clone_property fails. So change find_aa_index return value type to bool, which indicate 'aa_index' whether found or not. Fixes: c05a5a40969e ("powerpc/pseries: Dynamic add entires to associativity lookup array

Re: [PATCH v2 -next] powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index

2018-10-09 Thread YueHaibing
On 2018/10/9 15:00, Michael Ellerman wrote: > YueHaibing writes: >> 'aa_index' is defined as an unsigned value, but find_aa_index >> may return -1 when dlpar_clone_property fails. So we use an rc >> value to track the validation of finding the aa_index instead >> of the 'aa_index' value itself >>

Re: [PATCH v3 03/24] drivers/block/z2ram: use ioremap_wt() instead of __ioremap(_PAGE_WRITETHRU)

2018-10-09 Thread Bart Van Assche
On Tue, 2018-10-09 at 13:51 +, Christophe Leroy wrote: > _PAGE_WRITETHRU is a target specific flag. Prefer generic functions. > > Acked-by: Geert Uytterhoeven > Signed-off-by: Christophe Leroy Hi Geert, All patches that have been applied to this driver since 2005 are API refactoring patche

Re: [PATCH v3 03/24] drivers/block/z2ram: use ioremap_wt() instead of __ioremap(_PAGE_WRITETHRU)

2018-10-09 Thread Geert Uytterhoeven
Hi Bart, CC debian-68k, linux-m68k On Tue, Oct 9, 2018 at 5:00 PM Bart Van Assche wrote: > On Tue, 2018-10-09 at 13:51 +, Christophe Leroy wrote: > > _PAGE_WRITETHRU is a target specific flag. Prefer generic functions. > > > > Acked-by: Geert Uytterhoeven > > Signed-off-by: Christophe Leroy

[PATCH] powerpc: remove redundant 'default n' from Kconfig-s

2018-10-09 Thread Bartlomiej Zolnierkiewicz
'default n' is the default value for any bool or tristate Kconfig setting so there is no need to write it explicitly. Also since commit f467c5640c29 ("kconfig: only write '# CONFIG_FOO is not set' for visible symbols") the Kconfig behavior is the same regardless of 'default n' being present or not

Re: [PATCH 13/36] dt-bindings: arm: Convert PMU binding to json-schema

2018-10-09 Thread Rob Herring
On Tue, Oct 9, 2018 at 6:57 AM Will Deacon wrote: > > Hi Rob, > > On Fri, Oct 05, 2018 at 11:58:25AM -0500, Rob Herring wrote: > > Convert ARM PMU binding to DT schema format using json-schema. > > > > Cc: Will Deacon > > Cc: Mark Rutland > > Cc: linux-arm-ker...@lists.infradead.org > > Cc: devi

Re: [PATCH 09/16] of: overlay: validate overlay properties #address-cells and #size-cells

2018-10-09 Thread Alan Tull
On Mon, Oct 8, 2018 at 7:02 PM Frank Rowand wrote: > > On 10/08/18 11:46, Alan Tull wrote: > > On Mon, Oct 8, 2018 at 10:57 AM Alan Tull wrote: > >> > >> On Thu, Oct 4, 2018 at 11:14 PM wrote: > >>> > >>> From: Frank Rowand > >>> > >>> If overlay properties #address-cells or #size-cells are alr

[PATCH v02] powerpc/mobility: Extend start/stop topology update scope

2018-10-09 Thread Michael Bringmann
The PPC mobility code may receive RTAS requests to perform PRRN topology changes at any time, including during LPAR migration operations. In some configurations where the affinity of CPUs or memory is being changed on that platform, the PRRN requests may apply or refer to outdated information prio

Re: [PATCH 05/16] of: overlay: use prop add changeset entry for property in new nodes

2018-10-09 Thread Alan Tull
On Thu, Oct 4, 2018 at 11:14 PM wrote: > > From: Frank Rowand > Hi Frank, > The changeset entry 'update property' was used for new properties in > an overlay instead of 'add property'. > > The decision of whether to use 'update property' was based on whether > the property already exists in the

[PATCH v04 0/5] powerpc/migration: Affinity fix for memory

2018-10-09 Thread Michael Bringmann
The migration of LPARs across Power systems affects many attributes including that of the associativity of memory blocks. The patches in this set execute when a system is coming up fresh upon a migration target. They are intended to, * Recognize changes to the associativity of memory recorded in

[PATCH v04 1/5] powerpc/drmem: Export 'dynamic-memory' loader

2018-10-09 Thread Michael Bringmann
powerpc/drmem: Export many of the functions of DRMEM to parse "ibm,dynamic-memory" and "ibm,dynamic-memory-v2" during hotplug operations and for Post Migration events. Also modify the DRMEM initialization code to allow it to, * Be called after system initialization * Provide a separate user copy

[PATCH v04 2/5] powerpc/drmem: Add internal_flags feature

2018-10-09 Thread Michael Bringmann
powerpc/drmem: Add internal_flags field to each LMB to allow marking of kernel software-specific operations that need not be exported to other users. For instance, if information about selected LMBs needs to be maintained for subsequent passes through the system, it can be encoded into the LMB arr

[PATCH v04 3/5] migration/memory: Add hotplug READD_MULTIPLE

2018-10-09 Thread Michael Bringmann
migration/memory: This patch adds a new pseries hotplug action for CPU and memory operations, PSERIES_HP_ELOG_ACTION_READD_MULTIPLE. This is a variant of the READD operation which performs the action upon multiple instances of the resource at one time. The operation is to be triggered by device-tr

[PATCH v04 3/4] migration/memory: Evaluate LMB assoc changes

2018-10-09 Thread Michael Bringmann
migration/memory: This patch adds code that recognizes changes to the associativity of memory blocks described by the device-tree properties in order to drive equivalent 'hotplug' operations to update local and general kernel data structures to reflect those changes. These differences may include:

[PATCH v04 4/4] migration/memory: Support 'ibm,dynamic-memory-v2'

2018-10-09 Thread Michael Bringmann
migration/memory: This patch adds recognition for changes to the associativity of memory blocks described by 'ibm,dynamic-memory-v2'. If the associativity of an LMB has changed, it should be readded to the system in order to update local and general kernel data structures. This patch builds upon pr

Re: [PATCH] memblock: stop using implicit alignement to SMP_CACHE_BYTES

2018-10-09 Thread Paul Burton
Hi Mike, On Fri, Oct 05, 2018 at 12:07:04AM +0300, Mike Rapoport wrote: > When a memblock allocation APIs are called with align = 0, the alignment is > implicitly set to SMP_CACHE_BYTES. > > Replace all such uses of memblock APIs with the 'align' parameter explicitly > set to SMP_CACHE_BYTES and

[PATCH 0/2] powerpc/boot: Fix serial output in boot wrapper

2018-10-09 Thread Joel Stanley
While doing some work on the wrapper I noticed we no longer get serial output on a powernv system. This is because we compile out the opal code. As it turns out, none of the system-specific serial outputs will be compiled in. This series fixes that. Tested on Qemu powernv, Romulus and Palmetto. J

[PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper

2018-10-09 Thread Joel Stanley
Currently the wrapper is built without including anything in $(src)/include/, which means there are no CONFIG_ symbols defined. This means the platform specific serial drivers were never enabled. We now copy the definitions into the boot directory, so any C file can now include autoconf.h to depen

[PATCH 2/2] powerpc/boot: Fix opal console in boot wrapper

2018-10-09 Thread Joel Stanley
As of commit 10c77dba40ff ("powerpc/boot: Fix build failure in 32-bit boot wrapper") the opal code is hidden behind CONFIG_PPC64_BOOT_WRAPPER, but the boot wrapper avoids include/linux, so it does not get the normal Kconfig flags. We can drop the guard entirely as in commit f8e8e69cea49 ("powerpc/

Re: [PATCH 05/16] of: overlay: use prop add changeset entry for property in new nodes

2018-10-09 Thread Frank Rowand
On 10/09/18 13:28, Alan Tull wrote: > On Thu, Oct 4, 2018 at 11:14 PM wrote: >> >> From: Frank Rowand >> > > Hi Frank, > >> The changeset entry 'update property' was used for new properties in >> an overlay instead of 'add property'. >> >> The decision of whether to use 'update property' was ba

Re: [PATCH 15/36] dt-bindings: arm: Convert Actions Semi bindings to jsonschema

2018-10-09 Thread Joe Perches
On Sat, 2018-10-06 at 12:40 +0200, Andreas Färber wrote: > > +++ b/Documentation/devicetree/bindings/arm/actions.yaml [] > > + > > +title: Actions Semi platforms device tree bindings > > + > > +maintainers: > > + - Andreas Färber > > Mani is now officially reviewer and the closest I have to a >

[PATCH 0/2] powerpc/boot: Build wrapper with optimisations

2018-10-09 Thread Joel Stanley
We currently build the wrapper with Os. This builds it with O2 instead, reducing boot time when decompressing a compressed kernel. See patch 2 for details. I've given this a spin with CONFIG_KERNEL_XZ on P9 and P8 as the petitboot kernel. Joel Stanley (2): powerpc/boot: Disable vector instructi

[PATCH 1/2] powerpc/boot: Disable vector instructions

2018-10-09 Thread Joel Stanley
This will avoid auto-vectorisation when building with higher optimisation levels. We don't know if the machine can support VSX and even if it's present it's probably not going to be enabled at this point in boot. Signed-off-by: Joel Stanley --- arch/powerpc/boot/Makefile | 4 ++-- 1 file change

[PATCH 2/2] powerpc/boot: Build boot wrapper with optimisations

2018-10-09 Thread Joel Stanley
The boot wrapper is currently built with -Os. By building with O2 we can meaningfully reduce the time decompressing the kernel. I tested by comparing 10 runs of each option in Qemu and on hardware. The kernel is compressed with KERNEL_XZ built with GCC 8.2.0-7ubuntu1. The values are counts of the

[PATCH] powerpc/topology: Update numa mask when cpu node mapping changes

2018-10-09 Thread Srikar Dronamraju
Commit 2ea626306810 ("powerpc/topology: Get topology for shared processors at boot") will update the cpu node topology for shared lpars on PowerVM. However shared lpars on PowerVM also support VPHN and PRRN events. On receiving a VPHN, PRRN events, cpu to node mapping might change. Scheduler main

Re: [PATCH 21/36] dt-bindings: arm: Convert TI davinci board/soc bindings to json-schema

2018-10-09 Thread Sekhar Nori
On Friday 05 October 2018 10:28 PM, Rob Herring wrote: > Convert TI Davinci SoC bindings to DT schema format using json-schema. > > Cc: Sekhar Nori > Cc: Kevin Hilman > Cc: Mark Rutland > Cc: devicet...@vger.kernel.org > Signed-off-by: Rob Herring > --- > .../devicetree/bindings/arm/davinci.t

  1   2   >