[PATCH v4 2/5] watchdog: introduce arch_touch_nmi_watchdog()

2017-06-16 Thread Nicholas Piggin
For architectures that define HAVE_NMI_WATCHDOG, instead of having them provide the complete touch_nmi_watchdog() function, just have them provide arch_touch_nmi_watchdog(). This gives the generic code more flexibility in implementing this function, and arch implementations don't miss out on touch

[PATCH v4 3/5] watchdog: split up config options

2017-06-16 Thread Nicholas Piggin
Split SOFTLOCKUP_DETECTOR from LOCKUP_DETECTOR, and split HARDLOCKUP_DETECTOR_PERF from HARDLOCKUP_DETECTOR. LOCKUP_DETECTOR implies the general boot, sysctl, and programming interfaces for the lockup detectors. An architecture that wants to use a hard lockup detector must define HAVE_HARDLOCKUP_

[PATCH v4 4/5] watchdog: provide watchdog_reconfigure() for arch watchdogs

2017-06-16 Thread Nicholas Piggin
After reconfiguring watchdog sysctls etc., architecture specific watchdogs may not get all their parameters updated. watchdog_reconfigure() can be implemented to pull the new values in and set the arch NMI watchdog. Signed-off-by: Nicholas Piggin --- kernel/watchdog.c | 29 +

[PATCH v4 5/5] powerpc/64s: implement arch-specific hardlockup watchdog

2017-06-16 Thread Nicholas Piggin
Implement an arch-speicfic watchdog rather than use the perf-based hardlockup detector. The new watchdog takes the soft-NMI directly, rather than going through perf. Perf interrupts are to be made maskable in future, so that would prevent the perf detector from working in those regions. Additiona

Re: [PATCH V2] cxl: Export library to support IBM XSL

2017-06-16 Thread Andrew Donnellan
On 14/06/17 23:29, Christophe Lombard wrote: This patch exports a in-kernel 'library' API which can be called by other drivers to help interacting with an IBM XSL on a POWER9 system. The XSL (Translation Service Layer) is a stripped down version of the PSL (Power Service Layer) used in some card

Re: [PATCH V2] cxl: Export library to support IBM XSL

2017-06-16 Thread Frederic Barrat
Le 16/06/2017 à 09:13, Andrew Donnellan a écrit : +config CXL_LIB +bool +default n + How necessary is this? Are there any drivers using cxllib that we're trying to get in during this cycle? That was a Mellanox request, so that they can enable code in their driver. Like we've done

Re: [PATCH 06/44] iommu/dma: don't rely on DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
On Thu, Jun 08, 2017 at 02:59:07PM +0100, Robin Murphy wrote: > Hi Christoph, > > On 08/06/17 14:25, Christoph Hellwig wrote: > > DMA_ERROR_CODE is not a public API and will go away soon. dma dma-iommu > > driver already implements a proper ->mapping_error method, so it's only > > using the value

Re: [PATCH 33/44] openrisc: remove arch-specific dma_supported implementation

2017-06-16 Thread Christoph Hellwig
On Fri, Jun 09, 2017 at 02:20:42PM +0200, Geert Uytterhoeven wrote: > Hi Christoph, > > On Thu, Jun 8, 2017 at 3:25 PM, Christoph Hellwig wrote: > > This implementation is simply bogus - hexagon only has a simple > > openrisc? Yeah.

Re: [PATCH 25/44] arm: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
On Thu, Jun 08, 2017 at 03:43:14PM +0100, Russell King - ARM Linux wrote: > BOn Thu, Jun 08, 2017 at 03:25:50PM +0200, Christoph Hellwig wrote: > > +static int dmabounce_mapping_error(struct device *dev, dma_addr_t dma_addr) > > +{ > > + if (dev->archdata.dmabounce) > > + return 0; > >

Re: [PATCH 27/44] sparc: remove leon_dma_ops

2017-06-16 Thread Christoph Hellwig
On Mon, Jun 12, 2017 at 10:06:26AM +0200, Andreas Larsson wrote: > Yes, it is needed. LEON systems are AMBA bus based. The common case here is > DMA over AMBA buses. Some LEON systems have PCI bridges, but in general > CONFIG_PCI is not a given. Ok, and even for AMBA we use the pci ops, so I'll

Re: [PATCH 28/44] sparc: remove arch specific dma_supported implementations

2017-06-16 Thread Christoph Hellwig
On Fri, Jun 09, 2017 at 12:22:48AM +1000, Julian Calaby wrote: > I'm guessing there's a few places that have DMA ops but DMA isn't > actually supported. Why not have a common method for this, maybe > "dma_not_supported"? It's not common at all. Except for sbus all dma API user first call set_dma_

Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-16 Thread Anshuman Khandual
On 06/06/2017 06:35 AM, Ram Pai wrote: > The value of the AMR register at the time of the exception > is made available in gp_regs[PT_AMR] of the siginfo. But its already available there in uctxt->uc_mcontext.regs->amr while inside the signal delivery context in the user space. The pt_regs already

Re: [PATCH] ppc64/perf: Fix oops when kthread execs user process

2017-06-16 Thread Ravi Bangoria
Hi Michael, On Friday 16 June 2017 10:42 AM, Michael Ellerman wrote: > > That function (perf_get_regs_user()) didn't exist until 4.7, ie: > > ed4a4ef85cf5 ("powerpc/perf: Add support for sampling interrupt register > state") > > So there must be something else going on. > > I'll hold off on mergi

Re: [kernel] powerpc/debug: Add missing warn flag to WARN_ON's non-builtin path

2017-06-16 Thread Michael Ellerman
On Wed, 2017-06-14 at 03:01:25 UTC, Alexey Kardashevskiy wrote: > When trapped on WARN_ON(), report_bug() is expected to return > BUG_TRAP_TYPE_WARN so the caller could increment NIP by 4 and continue. > The __builtin_constant_p() path of the PPC's WARN_ON() calls (indirectly) > __WARN_FLAGS() whic

Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-16 Thread Benjamin Herrenschmidt
On Fri, 2017-06-16 at 14:50 +0530, Anshuman Khandual wrote: > On 06/06/2017 06:35 AM, Ram Pai wrote: > > The value of the AMR register at the time of the exception > > is made available in gp_regs[PT_AMR] of the siginfo. > > But its already available there in uctxt->uc_mcontext.regs->amr > while i

Re: [Oops][next-20170614][] powerpc boot fails with WARNING: CPU: 12 PID: 0 at mm/memblock.c

2017-06-16 Thread Michael Ellerman
Stephen Rothwell writes: > On Fri, 16 Jun 2017 11:13:35 +1000 Stephen Rothwell > wrote: >> On Fri, 16 Jun 2017 10:57:22 +1000 Michael Ellerman >> wrote: >> > "Rowand, Frank" writes: >> > > On Thursday, June 15, 2017 2:25 AM, Abdul Haleem >> > > [mailto:abdha...@linux.vnet.ibm.com] wrote:

Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-16 Thread Michael Ellerman
Ram Pai writes: > diff --git a/arch/powerpc/include/uapi/asm/ptrace.h > b/arch/powerpc/include/uapi/asm/ptrace.h > index 8036b38..109d0c2 100644 > --- a/arch/powerpc/include/uapi/asm/ptrace.h > +++ b/arch/powerpc/include/uapi/asm/ptrace.h > @@ -49,6 +49,8 @@ struct pt_regs { > unsigned long

[GIT PULL] Please pull powerpc/linux.git powerpc-4.12-6 tag

2017-06-16 Thread Michael Ellerman
Hi Linus, Please pull some more powerpc fixes for 4.12: The following changes since commit c6ee9619e2edd9912316f7e2eaf9ffa14fafe9f9: powerpc/book3s64: Move PPC_DT_CPU_FTRs and enable it by default (2017-06-08 20:42:57 +1000) are available in the git repository at: git://git.kernel.org/pub

Re: [PATCH v4 0/5] Improve watchdog config for arch watchdogs

2017-06-16 Thread Don Zickus
(adding Andrew) On Fri, Jun 16, 2017 at 04:57:10PM +1000, Nicholas Piggin wrote: > This is the latest series to make the hardlockup watchdog more > easily replaceable by arch code. The last patch provides some > justification for why we want to do this (existing sparc watchdog > is another that co

clean up and modularize arch dma_mapping interface V2

2017-06-16 Thread Christoph Hellwig
Hi all, for a while we have a generic implementation of the dma mapping routines that call into per-arch or per-device operations. But right now there still are various bits in the interfaces where don't clearly operate on these ops. This series tries to clean up a lot of those (but not all yet,

[PATCH 01/44] firmware/ivc: use dma_mapping_error

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is not supposed to be used by drivers. Signed-off-by: Christoph Hellwig Acked-by: Thierry Reding --- drivers/firmware/tegra/ivc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/tegra/ivc.c b/drivers/firmware/tegra/ivc.c index 29ecfd815320

[PATCH 02/44] ibmveth: properly unwind on init errors

2017-06-16 Thread Christoph Hellwig
That way the driver doesn't have to rely on DMA_ERROR_CODE, which is not a public API and going away. Signed-off-by: Christoph Hellwig Acked-by: David S. Miller --- drivers/net/ethernet/ibm/ibmveth.c | 159 + 1 file changed, 74 insertions(+), 85 deletions(-)

[PATCH 03/44] dmaengine: ioat: don't use DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is not a public API and will go away. Instead properly unwind based on the loop counter. Signed-off-by: Christoph Hellwig Acked-by: Dave Jiang Acked-By: Vinod Koul --- drivers/dma/ioat/init.c | 24 +++- 1 file changed, 7 insertions(+), 17 deletions(-) diff

[PATCH 04/44] drm/exynos: don't use DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE already isn't a valid API to user for drivers and will go away soon. exynos_drm_fb_dma_addr uses it a an error return when the passed in index is invalid, but the callers never check for it but instead pass the address straight to the hardware. Add a WARN_ON instead and just return

[PATCH 05/44] drm/armada: don't abuse DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
dev_addr isn't even a dma_addr_t, and DMA_ERROR_CODE has never been a valid driver API. Add a bool mapped flag instead. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/armada/armada_fb.c | 2 +- drivers/gpu/drm/armada/armada_gem.c | 5 ++--- drivers/gpu/drm/armada/armada_gem.h | 1 + 3 fi

[PATCH 06/44] iommu/dma: don't rely on DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is not a public API and will go away soon. dma dma-iommu driver already implements a proper ->mapping_error method, so it's only using the value internally. Add a new local define using the value that arm64 which is the only current user of dma-iommu. Signed-off-by: Christoph Hell

[PATCH 09/44] c6x: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/c6x/include/asm/dma-mapping.h | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/c6x/include/asm/dma-mapping.h b/arch/c6x/include/asm/dma-mapping.h index aca9f755e4f8..05daf1038111 100644 --- a/arch/c6x/include/asm/dma-mapping.h +++ b/arch/c6x/

[PATCH 07/44] xen-swiotlb: consolidate xen_swiotlb_dma_ops

2017-06-16 Thread Christoph Hellwig
ARM and x86 had duplicated versions of the dma_ops structure, the only difference is that x86 hasn't wired up the set_dma_mask, mmap, and get_sgtable ops yet. On x86 all of them are identical to the generic version, so they aren't needed but harmless. All the symbols used only for xen_swiotlb_dma

[PATCH 08/44] xen-swiotlb: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig Reviewed-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c inde

[PATCH 10/44] ia64: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
All ia64 dma_mapping_ops instances already have a mapping_error member. Signed-off-by: Christoph Hellwig --- arch/ia64/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h index 73ec3c6f4cfe..3ce

[PATCH 11/44] m32r: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
dma-noop is the only dma_mapping_ops instance for m32r and does not return errors. Signed-off-by: Christoph Hellwig --- arch/m32r/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/m32r/include/asm/dma-mapping.h b/arch/m32r/include/asm/dma-mapping.h index c01d9f

[PATCH 12/44] microblaze: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
microblaze does not return errors for dma_map_page. Signed-off-by: Christoph Hellwig --- arch/microblaze/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h index 3fad5e722a66..e15cd

[PATCH 13/44] openrisc: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
openrisc does not return errors for dma_map_page. Signed-off-by: Christoph Hellwig --- arch/openrisc/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/openrisc/include/asm/dma-mapping.h b/arch/openrisc/include/asm/dma-mapping.h index 0c0075f17145..a4ea139c2ef9

[PATCH 14/44] sh: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
sh does not return errors for dma_map_page. Signed-off-by: Christoph Hellwig --- arch/sh/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h index d99008af5f73..9b06be07db4d 100644 --- a/arch/sh/inc

[PATCH 15/44] xtensa: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
xtensa already implements the mapping_error method for its only dma_map_ops instance. Signed-off-by: Christoph Hellwig --- arch/xtensa/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/xtensa/include/asm/dma-mapping.h b/arch/xtensa/include/asm/dma-mapping.h ind

[PATCH 16/44] arm64: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
The dma alloc interface returns an error by return NULL, and the mapping interfaces rely on the mapping_error method, which the dummy ops already implement correctly. Thus remove the DMA_ERROR_CODE define. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy --- arch/arm64/include/asm/dm

[PATCH 17/44] hexagon: switch to use ->mapping_error for error reporting

2017-06-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Acked-by: Richard Kuo --- arch/hexagon/include/asm/dma-mapping.h | 2 -- arch/hexagon/kernel/dma.c | 12 +--- arch/hexagon/kernel/hexagon_ksyms.c| 1 - 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/hexagon/include/

[PATCH 18/44] iommu/amd: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig --- drivers/iommu/amd_iommu.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 63cacf5d6cf2..d41280e869de 1

[PATCH 19/44] s390: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
s390 can also use noop_dma_ops, and while that currently does not return errors it will so in the future. Implementing the mapping_error method is the proper way to have per-ops error conditions. Signed-off-by: Christoph Hellwig Acked-by: Gerald Schaefer --- arch/s390/include/asm/dma-mapping.h

[PATCH 20/44] sparc: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig Acked-by: David S. Miller --- arch/sparc/include/asm/dma-mapping.h | 2 -- arch/sparc/kernel/iommu.c| 12 +--- arch/sparc/kernel/iommu_common.h | 2 ++ arch/sparc/kernel/pci_sun4v

[PATCH 21/44] powerpc: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Instead define a ->mapping_error method for all IOMMU based dma operation instances. The direct ops don't ever return an error and don't need a ->mapping_error method. Signed-off-by: Christoph Hellwig Acked-by: Michael Ellerman --- arch

[PATCH 22/44] x86/pci-nommu: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig --- arch/x86/kernel/pci-nommu.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c index a88952ef371c..085fe6ce4049 10064

[PATCH 23/44] x86/calgary: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig --- arch/x86/kernel/pci-calgary_64.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index f

[PATCH 24/44] x86: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
All dma_map_ops instances now handle their errors through ->mapping_error. Signed-off-by: Christoph Hellwig --- arch/x86/include/asm/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index 08a0838b83fb..c35

[PATCH 25/44] arm: implement ->mapping_error

2017-06-16 Thread Christoph Hellwig
DMA_ERROR_CODE is going to go away, so don't rely on it. Signed-off-by: Christoph Hellwig --- arch/arm/common/dmabounce.c| 13 +--- arch/arm/include/asm/dma-iommu.h | 2 ++ arch/arm/include/asm/dma-mapping.h | 1 - arch/arm/mm/dma-mapping.c | 41 +

[PATCH 26/44] dma-mapping: remove DMA_ERROR_CODE

2017-06-16 Thread Christoph Hellwig
And update the documentation - dma_mapping_error has been supported everywhere for a long time. Signed-off-by: Christoph Hellwig --- Documentation/DMA-API-HOWTO.txt | 31 +-- include/linux/dma-mapping.h | 5 - 2 files changed, 5 insertions(+), 31 deletions(-)

[PATCH 27/44] sparc: remove leon_dma_ops

2017-06-16 Thread Christoph Hellwig
We can just use pci32_dma_ops directly. Signed-off-by: Christoph Hellwig Acked-by: David S. Miller --- arch/sparc/include/asm/dma-mapping.h | 3 +-- arch/sparc/kernel/ioport.c | 5 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/sparc/include/asm/dma-mapping.

[PATCH 28/44] sparc: remove arch specific dma_supported implementations

2017-06-16 Thread Christoph Hellwig
Usually dma_supported decisions are done by the dma_map_ops instance. Switch sparc to that model by providing a ->dma_supported instance for sbus that always returns false, and implementations tailored to the sun4u and sun4v cases for sparc64, and leave it unimplemented for PCI on sparc32, which me

[PATCH 29/44] dma-noop: remove dma_supported and mapping_error methods

2017-06-16 Thread Christoph Hellwig
These just duplicate the default behavior if no method is provided. Signed-off-by: Christoph Hellwig --- lib/dma-noop.c | 12 1 file changed, 12 deletions(-) diff --git a/lib/dma-noop.c b/lib/dma-noop.c index de26c8b68f34..643a074f139d 100644 --- a/lib/dma-noop.c +++ b/lib/dma-noop

[PATCH 30/44] dma-virt: remove dma_supported and mapping_error methods

2017-06-16 Thread Christoph Hellwig
These just duplicate the default behavior if no method is provided. Signed-off-by: Christoph Hellwig --- lib/dma-virt.c | 12 1 file changed, 12 deletions(-) diff --git a/lib/dma-virt.c b/lib/dma-virt.c index dcd4df1f7174..5c4f11329721 100644 --- a/lib/dma-virt.c +++ b/lib/dma-virt

[PATCH 31/44] hexagon: remove arch-specific dma_supported implementation

2017-06-16 Thread Christoph Hellwig
This implementation is simply bogus - hexagon only has a simple direct mapped DMA implementation and thus doesn't care about the address. Signed-off-by: Christoph Hellwig Acked-by: Richard Kuo --- arch/hexagon/include/asm/dma-mapping.h | 2 -- arch/hexagon/kernel/dma.c | 9

[PATCH 32/44] hexagon: remove the unused dma_is_consistent prototype

2017-06-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/hexagon/include/asm/dma-mapping.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/hexagon/include/asm/dma-mapping.h b/arch/hexagon/include/asm/dma-mapping.h index 9c15cb5271a6..463dbc18f853 100644 --- a/arch/hexagon/include/asm/dma-mapping.h +++

[PATCH 33/44] openrisc: remove arch-specific dma_supported implementation

2017-06-16 Thread Christoph Hellwig
This implementation is simply bogus - openrisc only has a simple direct mapped DMA implementation and thus doesn't care about the address. Signed-off-by: Christoph Hellwig --- arch/openrisc/include/asm/dma-mapping.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/arch/openrisc/include/

[PATCH 34/44] arm: remove arch specific dma_supported implementation

2017-06-16 Thread Christoph Hellwig
And instead wire it up as method for all the dma_map_ops instances. Note that the code seems a little fishy for dmabounce and iommu, but for now I'd like to preserve the existing behavior 1:1. Signed-off-by: Christoph Hellwig --- arch/arm/common/dmabounce.c| 1 + arch/arm/include/asm/dm

[PATCH 35/44] x86: remove arch specific dma_supported implementation

2017-06-16 Thread Christoph Hellwig
And instead wire it up as method for all the dma_map_ops instances. Note that this also means the arch specific check will be fully instead of partially applied in the AMD iommu driver. Signed-off-by: Christoph Hellwig --- arch/x86/include/asm/dma-mapping.h | 3 --- arch/x86/include/asm/iommu.h

[PATCH 36/44] dma-mapping: remove HAVE_ARCH_DMA_SUPPORTED

2017-06-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index a57875309bfd..3e5908656226 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -549,7 +54

[PATCH 37/44] mips/loongson64: implement ->dma_supported instead of ->set_dma_mask

2017-06-16 Thread Christoph Hellwig
Same behavior, less code duplication. Signed-off-by: Christoph Hellwig --- arch/mips/loongson64/common/dma-swiotlb.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/arch/mips/loongson64/common/dma-swiotlb.c b/arch/mips/loongson64/common/dma-swiotlb.c ind

[PATCH 39/44] xen-swiotlb: remove xen_swiotlb_set_dma_mask

2017-06-16 Thread Christoph Hellwig
This just duplicates the generic implementation. Signed-off-by: Christoph Hellwig --- drivers/xen/swiotlb-xen.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index c3a04b2d7532..82fc54f8eb77 100644 --- a/drivers/xen/swiotlb

[PATCH 38/44] arm: implement ->dma_supported instead of ->set_dma_mask

2017-06-16 Thread Christoph Hellwig
Same behavior, less code duplication. Signed-off-by: Christoph Hellwig --- arch/arm/common/dmabounce.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index 6ecd5be5d37e..9a92de63426f 100644 --- a/arch/arm/commo

[PATCH 40/44] tile: remove dma_supported and mapping_error methods

2017-06-16 Thread Christoph Hellwig
These just duplicate the default behavior if no method is provided. Signed-off-by: Christoph Hellwig --- arch/tile/kernel/pci-dma.c | 30 -- 1 file changed, 30 deletions(-) diff --git a/arch/tile/kernel/pci-dma.c b/arch/tile/kernel/pci-dma.c index 569bb6dd154a..f2abe

[PATCH 42/44] powerpc/cell: use the dma_supported method for ops switching

2017-06-16 Thread Christoph Hellwig
Besides removing the last instance of the set_dma_mask method this also reduced the code duplication. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/cell/iommu.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/platforms/cel

[PATCH 43/44] dma-mapping: remove the set_dma_mask method

2017-06-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/powerpc/kernel/dma.c | 4 include/linux/dma-mapping.h | 6 -- 2 files changed, 10 deletions(-) diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index 41c749586bd2..466c9f07b288 100644 --- a/arch/powerpc/kernel/dma.c +++ b/arc

[PATCH 44/44] powerpc: merge __dma_set_mask into dma_set_mask

2017-06-16 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/dma-mapping.h | 1 - arch/powerpc/kernel/dma.c | 13 - 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 73a

[PATCH 41/44] powerpc/cell: clean up fixed mapping dma_ops initialization

2017-06-16 Thread Christoph Hellwig
By the time cell_pci_dma_dev_setup calls cell_dma_dev_setup no device can have the fixed map_ops set yet as it's only set by the set_dma_mask method. So move the setup for the fixed case to be only called in that place instead of indirecting through cell_dma_dev_setup. Signed-off-by: Christoph He

Re: [PATCH v4 2/5] watchdog: introduce arch_touch_nmi_watchdog()

2017-06-16 Thread Andrew Morton
On Fri, 16 Jun 2017 16:57:12 +1000 Nicholas Piggin wrote: > For architectures that define HAVE_NMI_WATCHDOG, instead of having > them provide the complete touch_nmi_watchdog() function, just have > them provide arch_touch_nmi_watchdog(). > > This gives the generic code more flexibility in implem

Re: [PATCH v4 4/5] watchdog: provide watchdog_reconfigure() for arch watchdogs

2017-06-16 Thread Andrew Morton
On Fri, 16 Jun 2017 16:57:14 +1000 Nicholas Piggin wrote: > After reconfiguring watchdog sysctls etc., architecture specific > watchdogs may not get all their parameters updated. > > watchdog_reconfigure() can be implemented to pull the new values > in and set the arch NMI watchdog. > I'll upd

Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-16 Thread Ram Pai
On Fri, Jun 16, 2017 at 02:50:13PM +0530, Anshuman Khandual wrote: > On 06/06/2017 06:35 AM, Ram Pai wrote: > > The value of the AMR register at the time of the exception > > is made available in gp_regs[PT_AMR] of the siginfo. > > But its already available there in uctxt->uc_mcontext.regs->amr >

Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-16 Thread Ram Pai
On Fri, Jun 16, 2017 at 08:33:01PM +1000, Benjamin Herrenschmidt wrote: > On Fri, 2017-06-16 at 14:50 +0530, Anshuman Khandual wrote: > > On 06/06/2017 06:35 AM, Ram Pai wrote: > > > The value of the AMR register at the time of the exception > > > is made available in gp_regs[PT_AMR] of the siginfo

Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-16 Thread Ram Pai
On Fri, Jun 16, 2017 at 09:18:29PM +1000, Michael Ellerman wrote: > Ram Pai writes: > > diff --git a/arch/powerpc/include/uapi/asm/ptrace.h > > b/arch/powerpc/include/uapi/asm/ptrace.h > > index 8036b38..109d0c2 100644 > > --- a/arch/powerpc/include/uapi/asm/ptrace.h > > +++ b/arch/powerpc/includ

Re: [RFC PATCH 7/7 v1]powerpc: Deliver SEGV signal on protection key violation.

2017-06-16 Thread Benjamin Herrenschmidt
On Fri, 2017-06-16 at 12:15 -0700, Ram Pai wrote: > gp_regs size is not changed, nor is the layout. A unused field in > the gp_regs is used to fill in the AMR contents. Old binaries will not > be knowing about this unused field, and hence should not break. > > New binaries can leverage this alread

Re: [PATCH v4 0/5] Improve watchdog config for arch watchdogs

2017-06-16 Thread Babu Moger
Tested on sparc: Tested-by: Babu Moger Reviewed patch #1, #2, #3 Reviewed-by: Babu Moger On 6/16/2017 9:50 AM, Don Zickus wrote: (adding Andrew) On Fri, Jun 16, 2017 at 04:57:10PM +1000, Nicholas Piggin wrote: This is the latest series to make the hardlockup watchdog more easily replace

Re: [PATCH 03/44] dmaengine: ioat: don't use DMA_ERROR_CODE

2017-06-16 Thread Alexander Duyck
On Fri, Jun 16, 2017 at 11:10 AM, Christoph Hellwig wrote: > DMA_ERROR_CODE is not a public API and will go away. Instead properly > unwind based on the loop counter. > > Signed-off-by: Christoph Hellwig > Acked-by: Dave Jiang > Acked-By: Vinod Koul > --- > drivers/dma/ioat/init.c | 24 ++

Re: [PATCH v4 2/5] watchdog: introduce arch_touch_nmi_watchdog()

2017-06-16 Thread Nicholas Piggin
On Fri, 16 Jun 2017 11:21:17 -0700 Andrew Morton wrote: > On Fri, 16 Jun 2017 16:57:12 +1000 Nicholas Piggin wrote: > > > For architectures that define HAVE_NMI_WATCHDOG, instead of having > > them provide the complete touch_nmi_watchdog() function, just have > > them provide arch_touch_nmi_wat

Re: [PATCH v4 4/5] watchdog: provide watchdog_reconfigure() for arch watchdogs

2017-06-16 Thread Nicholas Piggin
On Fri, 16 Jun 2017 11:24:07 -0700 Andrew Morton wrote: > On Fri, 16 Jun 2017 16:57:14 +1000 Nicholas Piggin wrote: > > > After reconfiguring watchdog sysctls etc., architecture specific > > watchdogs may not get all their parameters updated. > > > > watchdog_reconfigure() can be implemented t

[RFC v2 00/12] powerpc: Memory Protection Keys

2017-06-16 Thread Ram Pai
Memory protection keys enable applications to protect its address space from inadvertent access or corruption from itself. The overall idea: A process allocates a key and associates it with a address range withinits address space. The process than can dynamically set read/wri

[RFC v2 01/12] powerpc: Free up four 64K PTE bits in 4K backed hpte pages.

2017-06-16 Thread Ram Pai
Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6 in the 4K backed hpte pages. These bits continue to be used for 64K backed hpte pages in this patch, but will be freed up in the next patch. The patch does the following change to the 64K PTE format H_PAGE_BUSY moves from bit 3 to bit 9 H_

[RFC v2 02/12] powerpc: Free up four 64K PTE bits in 64K backed hpte pages.

2017-06-16 Thread Ram Pai
Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6 in the 64K backed hpte pages. This along with the earlier patch will entirely free up the four bits from 64K PTE. This patch does the following change to 64K PTE that is backed by 64K hpte. H_PAGE_F_SECOND which occupied bit 4 moves to the

[RFC v2 03/12] powerpc: Implement sys_pkey_alloc and sys_pkey_free system call.

2017-06-16 Thread Ram Pai
Sys_pkey_alloc() allocates and returns available pkey Sys_pkey_free() frees up the pkey. Total 32 keys are supported on powerpc. However pkey 0,1 and 31 are reserved. So effectively we have 29 pkeys. Signed-off-by: Ram Pai --- arch/powerpc/Kconfig | 15 arch/power

[RFC v2 04/12] powerpc: store and restore the pkey state across context switches.

2017-06-16 Thread Ram Pai
Signed-off-by: Ram Pai --- arch/powerpc/include/asm/processor.h | 5 + arch/powerpc/kernel/process.c| 18 ++ 2 files changed, 23 insertions(+) diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index a2123f2..1f714df 100644 ---

[RFC v2 05/12] powerpc: Implementation for sys_mprotect_pkey() system call.

2017-06-16 Thread Ram Pai
This system call, associates the pkey with PTE of all pages corresponding to the given address range. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/pgtable.h | 22 ++- arch/powerpc/include/asm/mman.h | 29 + arch/powerpc/include/asm/pkeys.h |

[RFC v2 06/12] powerpc: Program HPTE key protection bits.

2017-06-16 Thread Ram Pai
Map the PTE protection key bits to the HPTE key protection bits, while creatiing HPTE entries. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 5 + arch/powerpc/include/asm/pkeys.h | 7 +++ arch/powerpc/mm/hash_utils_64.c | 5 +

[RFC v2 07/12] powerpc: Macro the mask used for checking DSI exception

2017-06-16 Thread Ram Pai
Replace the magic number used to check for DSI exception with a meaningful value. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/reg.h | 9 - arch/powerpc/kernel/exceptions-64s.S | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/re

[RFC v2 08/12] powerpc: Handle exceptions caused by violation of pkey protection.

2017-06-16 Thread Ram Pai
Handle Data and Instruction exceptions caused by memory protection-key. Signed-off-by: Ram Pai (cherry picked from commit a5e5217619a0c475fe0cacc3b0cf1d3d33c79a09) Conflicts: arch/powerpc/include/asm/reg.h arch/powerpc/kernel/exceptions-64s.S --- arch/powerpc/include/asm/mmu_con

[RFC v2 09/12] powerpc: Deliver SEGV signal on pkey violation.

2017-06-16 Thread Ram Pai
The value of the AMR register at the time of exception is made available in gp_regs[PT_AMR] of the siginfo. This field can be used to reprogram the permission bits of any valid pkey. Similarly the value of the pkey, whose protection got violated, is made available at si_pkey field of the siginfo

[RFC v2 10/12] powerpc: Read AMR only if pkey-violation caused the exception.

2017-06-16 Thread Ram Pai
Signed-off-by: Ram Pai --- arch/powerpc/kernel/exceptions-64s.S | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 8db9ef8..a4de1b4 100644 --- a/arch/powerpc/kernel/exceptions-64s

[RFC v2 11/12]Documentation: Documentation updates.

2017-06-16 Thread Ram Pai
The Documentaton file is moved from x86 into the generic area, since this feature is now supported by more than one archs. Signed-off-by: Ram Pai --- Documentation/vm/protection-keys.txt | 110 ++ Documentation/x86/protection-keys.txt | 85 --

[RFC v2 12/12]selftest: Updated protection key selftest

2017-06-16 Thread Ram Pai
Added test support for PowerPC implementation off protection keys. Signed-off-by: Ram Pai --- tools/testing/selftests/vm/Makefile |1 + tools/testing/selftests/vm/pkey-helpers.h | 365 +++ tools/testing/selftests/vm/protection_keys.c | 1451 + tool