[PATCH kernel 0/6] powerpc/powernv/iommu: Optimize memory use

2018-06-07 Thread Alexey Kardashevskiy
This patchset aims to reduce actual memory use for guests with sparse memory. The pseries guest uses dynamic DMA windows to map the entire guest RAM but it only actually maps onlined memory which may be not be contiguous. I hit this when tried passing through NVLink2-connected GPU RAM of NVIDIA

[PATCH kernel 5/6] powerpc/powernv: Rework TCE level allocation

2018-06-07 Thread Alexey Kardashevskiy
This moves actual pages allocation to a separate function which is going to be reused later in on-demand TCE allocation. While we are at it, remove unnecessary level size round up as the caller does this already. Signed-off-by: Alexey Kardashevskiy ---

[PATCH kernel 4/6] powerpc/powernv: Add indirect levels to it_userspace

2018-06-07 Thread Alexey Kardashevskiy
We want to support sparse memory and therefore huge chunks of DMA windows do not need to be mapped. If a DMA window big enough to require 2 or more indirect levels, and a DMA window is used to map all RAM (which is a default case for 64bit window), we can actually save some memory by not

[PATCH kernel 3/6] KVM: PPC: Make iommu_table::it_userspace big endian

2018-06-07 Thread Alexey Kardashevskiy
We are going to reuse multilevel TCE code for the userspace copy of the TCE table and since it is big endian, let's make the copy big endian too. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/iommu.h| 2 +- arch/powerpc/kvm/book3s_64_vio.c| 11 ++-

[PATCH kernel 2/6] powerpc/powernv: Move TCE manupulation code to its own file

2018-06-07 Thread Alexey Kardashevskiy
Right now we have allocation code in pci-ioda.c and traversing code in pci.c, let's keep them toghether. However both files are big enough already so let's move this business to a new file. While we at it, move the code which links IOMMU table groups to IOMMU tables as it is not specific to any

[PATCH kernel 1/6] powerpc/powernv: Remove useless wrapper

2018-06-07 Thread Alexey Kardashevskiy
This gets rid of a useless wrapper around pnv_pci_ioda2_table_free_pages(). Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv/pci-ioda.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c

Re: [RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Alex Williamson
On Fri, 8 Jun 2018 14:14:23 +1000 Alexey Kardashevskiy wrote: > On 8/6/18 1:44 pm, Alex Williamson wrote: > > On Fri, 8 Jun 2018 13:08:54 +1000 > > Alexey Kardashevskiy wrote: > > > >> On 8/6/18 8:15 am, Alex Williamson wrote: > >>> On Fri, 08 Jun 2018 07:54:02 +1000 > >>> Benjamin

RE: [v3, 00/10] Support DPAA PTP clock and timestamping

2018-06-07 Thread Y.b. Lu
> -Original Message- > From: Richard Cochran [mailto:richardcoch...@gmail.com] > Sent: Friday, June 8, 2018 12:27 PM > To: Y.b. Lu > Cc: net...@vger.kernel.org; Madalin-cristian Bucur > ; Rob Herring ; Shawn Guo > ; David S . Miller ; > devicet...@vger.kernel.org;

Re: [RFC PATCH kernel 5/5] vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] [10de:1db1] subdriver

2018-06-07 Thread Alex Williamson
On Fri, 8 Jun 2018 13:52:05 +1000 Alexey Kardashevskiy wrote: > On 8/6/18 1:35 pm, Alex Williamson wrote: > > On Fri, 8 Jun 2018 13:09:13 +1000 > > Alexey Kardashevskiy wrote: > >> On 8/6/18 3:04 am, Alex Williamson wrote: > >>> On Thu, 7 Jun 2018 18:44:20 +1000 > >>> Alexey Kardashevskiy

Re: [v3, 00/10] Support DPAA PTP clock and timestamping

2018-06-07 Thread Richard Cochran
On Thu, Jun 07, 2018 at 05:20:40PM +0800, Yangbo Lu wrote: > This patchset is to support DPAA FMAN PTP clock and HW timestamping. > It had been verified on both ARM platform and PPC platform. > - The patch #1 to patch #5 are to support DPAA FMAN 1588 timer in > ptp_qoriq driver. > - The patch #6

Re: [RFC PATCH kernel 1/5] vfio/spapr_tce: Simplify page contained test

2018-06-07 Thread David Gibson
On Thu, Jun 07, 2018 at 06:44:16PM +1000, Alexey Kardashevskiy wrote: > The test function takes a page struct pointer which is not used by > either of two callers in any other way, make it simple and just pass > a physical address there. > > This should cause no behavioral change now but later we

Re: [RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Alexey Kardashevskiy
On 8/6/18 1:44 pm, Alex Williamson wrote: > On Fri, 8 Jun 2018 13:08:54 +1000 > Alexey Kardashevskiy wrote: > >> On 8/6/18 8:15 am, Alex Williamson wrote: >>> On Fri, 08 Jun 2018 07:54:02 +1000 >>> Benjamin Herrenschmidt wrote: >>> On Thu, 2018-06-07 at 11:04 -0600, Alex Williamson

Re: [RFC PATCH kernel 5/5] vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] [10de:1db1] subdriver

2018-06-07 Thread Alexey Kardashevskiy
On 8/6/18 1:35 pm, Alex Williamson wrote: > On Fri, 8 Jun 2018 13:09:13 +1000 > Alexey Kardashevskiy wrote: >> On 8/6/18 3:04 am, Alex Williamson wrote: >>> On Thu, 7 Jun 2018 18:44:20 +1000 >>> Alexey Kardashevskiy wrote: diff --git a/drivers/vfio/pci/vfio_pci.c

Re: [RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Alex Williamson
On Fri, 8 Jun 2018 13:08:54 +1000 Alexey Kardashevskiy wrote: > On 8/6/18 8:15 am, Alex Williamson wrote: > > On Fri, 08 Jun 2018 07:54:02 +1000 > > Benjamin Herrenschmidt wrote: > > > >> On Thu, 2018-06-07 at 11:04 -0600, Alex Williamson wrote: > >>> > >>> Can we back up and discuss

Re: [RFC PATCH kernel 5/5] vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] [10de:1db1] subdriver

2018-06-07 Thread Alex Williamson
On Fri, 8 Jun 2018 13:09:13 +1000 Alexey Kardashevskiy wrote: > On 8/6/18 3:04 am, Alex Williamson wrote: > > On Thu, 7 Jun 2018 18:44:20 +1000 > > Alexey Kardashevskiy wrote: > >> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c > >> index 7bddf1e..38c9475 100644 > >> ---

[PATCH] powerpc: Don't let userspace trigger a kernel WARN_ON

2018-06-07 Thread Benjamin Herrenschmidt
In commit 2865d08dd9ea876524652f3900b4b3b9c8b22e77 "powerpc/mm: Move the DSISR_PROTFAULT sanity check", I completely missed the fact that an attempt at reading kernel memory *will* trip the warning. So this partially reverts it. We keep the test in a helper to keep the code clean, but we move it

Re: [RFC PATCH kernel 5/5] vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] [10de:1db1] subdriver

2018-06-07 Thread Alexey Kardashevskiy
On 8/6/18 3:04 am, Alex Williamson wrote: > On Thu, 7 Jun 2018 18:44:20 +1000 > Alexey Kardashevskiy wrote: > >> Some POWER9 chips come with special NVLink2 links which provide >> cacheable memory access to the RAM physically located on NVIDIA GPU. >> This memory is presented to a host via the

Re: [RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Alexey Kardashevskiy
On 8/6/18 8:15 am, Alex Williamson wrote: > On Fri, 08 Jun 2018 07:54:02 +1000 > Benjamin Herrenschmidt wrote: > >> On Thu, 2018-06-07 at 11:04 -0600, Alex Williamson wrote: >>> >>> Can we back up and discuss whether the IOMMU grouping of NVLink >>> connected devices makes sense? AIUI we have a

Re: pkeys on POWER: Access rights not reset on execve

2018-06-07 Thread Ram Pai
> > So the remaining question at this point is whether the Intel > behavior (default-deny instead of default-allow) is preferable. Florian, remind me what behavior needs to fixed? -- Ram Pai

[PATCH v2 09/12] macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver

2018-06-07 Thread Finn Thain
Now that the PowerMac via-pmu driver supports m68k PowerBooks, switch over to that driver and remove the via-pmu68k driver. Cc: Geert Uytterhoeven Tested-by: Stan Johnson Signed-off-by: Finn Thain --- arch/m68k/configs/mac_defconfig | 2 +- arch/m68k/configs/multi_defconfig | 2 +-

[PATCH v2 12/12] macintosh/via-pmu: Disambiguate interrupt statistics

2018-06-07 Thread Finn Thain
Some of the event counters are overloaded which makes it very difficult to interpret their values. Counter 0 is supposed to report CB1 interrupts but it can also count PMU_INT_WAITING_CHARGER events. Counter 1 is supposed to report GPIO interrupts but it can also count other events (depending

[PATCH v2 11/12] macintosh/via-pmu: Clean up interrupt statistics

2018-06-07 Thread Finn Thain
Replace an open-coded ffs() with the function call. Simplify an if-else cascade using a switch statement. Correct a typo and an indentation issue. Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven --- drivers/macintosh/via-pmu.c | 39

[PATCH v2 10/12] macintosh: Use common code to access RTC

2018-06-07 Thread Finn Thain
Now that the 68k Mac port has adopted the via-pmu driver, it must access the PMU RTC using the appropriate command format. The same code can now be used for both m68k and powerpc. Replace the RTC code that's duplicated in arch/powerpc and arch/m68k with common RTC accessors for Cuda and PMU

[PATCH v2 08/12] macintosh/via-pmu68k: Don't load driver on unsupported hardware

2018-06-07 Thread Finn Thain
Don't load the via-pmu68k driver on early PowerBooks. The M50753 PMU device found in those models was never supported by this driver. Attempting to load the driver usually causes a boot hang. Cc: Geert Uytterhoeven Signed-off-by: Finn Thain --- arch/m68k/mac/misc.c | 6 ++

[PATCH v2 06/12] macintosh/via-pmu: Add support for m68k PowerBooks

2018-06-07 Thread Finn Thain
Put #ifdefs around the Open Firmware, xmon, interrupt dispatch, battery and suspend code. Add the necessary interrupt handling to support m68k PowerBooks. The pmu_kind value is available to userspace using the PMU_IOC_GET_MODEL ioctl. It is not clear yet what hardware classes are be needed to

[PATCH v2 05/12] macintosh/via-pmu: Replace via pointer with via1 and via2 pointers

2018-06-07 Thread Finn Thain
On most PowerPC Macs, the PMU driver uses the shift register and IO port B from a single VIA chip. On 68k and early PowerPC PowerBooks, the driver uses the shift register from one VIA chip together with IO port B from another. Replace via with via1 and via2 to accommodate this. For the

[PATCH v2 07/12] macintosh/via-pmu: Make CONFIG_PPC_PMAC Kconfig deps explicit

2018-06-07 Thread Finn Thain
At present, CONFIG_ADB_PMU depends on CONFIG_PPC_PMAC. When this gets relaxed to CONFIG_PPC_PMAC || CONFIG_MAC, those Kconfig symbols with implicit deps on PPC_PMAC will need explicit deps. Add them now. No functional change. Tested-by: Stan Johnson Signed-off-by: Finn Thain ---

[PATCH v2 04/12] macintosh/via-pmu: Enhance state machine with new 'uninitialized' state

2018-06-07 Thread Finn Thain
On 68k Macs, the via/vias pointer can't be used to determine whether the PMU driver has been initialized. For portability, add a new state to indicate that via_find_pmu() succeeded. After via_find_pmu() executes, testing vias == NULL is equivalent to testing via == NULL. Replace these tests with

[PATCH v2 03/12] macintosh/via-pmu: Don't clear shift register interrupt flag twice

2018-06-07 Thread Finn Thain
The shift register interrupt flag gets cleared in via_pmu_interrupt() and once again in pmu_sr_intr(). Fix this theoretical race condition. Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven --- drivers/macintosh/via-pmu.c | 1 - 1 file changed, 1 deletion(-)

[PATCH v2 01/12] macintosh/via-pmu: Fix section mismatch warning

2018-06-07 Thread Finn Thain
The pmu_init() function has the __init qualifier, but the ops struct that holds a pointer to it does not. This causes a build warning. The driver works fine because the pointer is only dereferenced early. The function is so small that there's negligible benefit from using the __init qualifier.

[PATCH v2 02/12] macintosh/via-pmu: Add missing mmio accessors

2018-06-07 Thread Finn Thain
Add missing in_8() accessors to init_pmu() and pmu_sr_intr(). This fixes several sparse warnings: drivers/macintosh/via-pmu.c:536:29: warning: dereference of noderef expression drivers/macintosh/via-pmu.c:537:33: warning: dereference of noderef expression drivers/macintosh/via-pmu.c:1455:17:

[PATCH v2 00/12] macintosh: Resolve various PMU driver problems

2018-06-07 Thread Finn Thain
This series of patches has the following aims. 1) Eliminate duplicated code. Linux presently has two drivers for the 68HC05-based PMU devices found in Macs: via-pmu and via-pmu68k. There's no value in having separate PMU drivers for each architecture. 2) Avoid further work on via-pmu68k

Re: [PATCH 1/3] powerpc: make CPU selection logic generic in Makefile

2018-06-07 Thread Nicholas Piggin
On Thu, 7 Jun 2018 10:10:18 + (UTC) Christophe Leroy wrote: > At the time being, when adding a new CPU for selection, both > Kconfig.cputype and Makefile have to be modified. > > This patch moves into Kconfig.cputype the name of the CPU to me > passed to the -mcpu= argument. Seems like a

Re: [v3 PATCH 5/5] powerpc/pseries: Display machine check error details.

2018-06-07 Thread Nicholas Piggin
On Thu, 07 Jun 2018 22:59:04 +0530 Mahesh J Salgaonkar wrote: > From: Mahesh Salgaonkar > > Extract the MCE error details from RTAS extended log and display it to > console. > > With this patch you should now see mce logs like below: > > [ 142.371818] Severe Machine check interrupt

Re: [v3 PATCH 4/5] powerpc/pseries: Dump and flush SLB contents on SLB MCE errors.

2018-06-07 Thread Nicholas Piggin
On Thu, 07 Jun 2018 22:58:55 +0530 Mahesh J Salgaonkar wrote: > From: Mahesh Salgaonkar > > If we get a machine check exceptions due to SLB errors then dump the > current SLB contents which will be very much helpful in debugging the > root cause of SLB errors. On pseries, as of today system

Re: [v3 PATCH 2/5] powerpc/pseries: Fix endainness while restoring of r3 in MCE handler.

2018-06-07 Thread Nicholas Piggin
On Thu, 07 Jun 2018 22:58:33 +0530 Mahesh J Salgaonkar wrote: > From: Mahesh Salgaonkar > > During Machine Check interrupt on pseries platform, register r3 points > RTAS extended event log passed by hypervisor. Since hypervisor uses r3 > to pass pointer to rtas log, it stores the original r3

Re: [v3 PATCH 1/5] powerpc/pseries: convert rtas_log_buf to linear allocation.

2018-06-07 Thread Nicholas Piggin
On Thu, 07 Jun 2018 22:58:11 +0530 Mahesh J Salgaonkar wrote: > From: Mahesh Salgaonkar > > rtas_log_buf is a buffer to hold RTAS event data that are communicated > to kernel by hypervisor. This buffer is then used to pass RTAS event > data to user through proc fs. This buffer is allocated

Re: [RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Alex Williamson
On Fri, 08 Jun 2018 10:58:54 +1000 Benjamin Herrenschmidt wrote: > On Thu, 2018-06-07 at 18:34 -0600, Alex Williamson wrote: > > > We *can* allow individual GPUs to be passed through, either if somebody > > > designs a system without cross links, or if the user is ok with the > > > security risk

Re: [RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Benjamin Herrenschmidt
On Thu, 2018-06-07 at 18:34 -0600, Alex Williamson wrote: > > We *can* allow individual GPUs to be passed through, either if somebody > > designs a system without cross links, or if the user is ok with the > > security risk as the guest driver will not enable them if it doesn't > > "find" both

Re: [RFC PATCH -tip v5 18/27] powerpc/kprobes: Don't call the ->break_handler() in arm kprobes code

2018-06-07 Thread Masami Hiramatsu
On Thu, 07 Jun 2018 22:07:26 +0530 "Naveen N. Rao" wrote: > Masami Hiramatsu wrote: > > On Thu, 07 Jun 2018 17:07:00 +0530 > > "Naveen N. Rao" wrote: > > > >> Masami Hiramatsu wrote: > >> > Don't call the ->break_handler() from the arm kprobes code, > >>

Re: [RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Alex Williamson
On Fri, 08 Jun 2018 09:20:30 +1000 Benjamin Herrenschmidt wrote: > On Thu, 2018-06-07 at 16:15 -0600, Alex Williamson wrote: > > On Fri, 08 Jun 2018 07:54:02 +1000 > > Benjamin Herrenschmidt wrote: > > > > > On Thu, 2018-06-07 at 11:04 -0600, Alex Williamson wrote: > > > > > > > > Can we

Re: linux-next: manual merge of the powerpc tree with the kbuild tree

2018-06-07 Thread Stephen Rothwell
Hi all, On Thu, 31 May 2018 09:32:16 +1000 Stephen Rothwell wrote: > > Today's linux-next merge of the powerpc tree got a conflict in: > > arch/powerpc/kernel/module_64.c > > between commit: > > 06aeb9e3f2bc ("powerpc/kbuild: move -mprofile-kernel check to Kconfig") > > from the kbuild

Re: [RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Benjamin Herrenschmidt
On Thu, 2018-06-07 at 16:15 -0600, Alex Williamson wrote: > On Fri, 08 Jun 2018 07:54:02 +1000 > Benjamin Herrenschmidt wrote: > > > On Thu, 2018-06-07 at 11:04 -0600, Alex Williamson wrote: > > > > > > Can we back up and discuss whether the IOMMU grouping of NVLink > > > connected devices

Re: [RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Alex Williamson
On Fri, 08 Jun 2018 07:54:02 +1000 Benjamin Herrenschmidt wrote: > On Thu, 2018-06-07 at 11:04 -0600, Alex Williamson wrote: > > > > Can we back up and discuss whether the IOMMU grouping of NVLink > > connected devices makes sense? AIUI we have a PCI view of these > > devices and from that

Re: [RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Benjamin Herrenschmidt
On Thu, 2018-06-07 at 11:04 -0600, Alex Williamson wrote: > > Can we back up and discuss whether the IOMMU grouping of NVLink > connected devices makes sense? AIUI we have a PCI view of these > devices and from that perspective they're isolated. That's the view of > the device used to generate

Re: [RFC PATCH 0/4] powerpc/pseries: Machien check handler improvements.

2018-06-07 Thread Michal Suchánek
On Wed, 06 Jun 2018 10:06:23 +0530 Mahesh J Salgaonkar wrote: > This patch series includes some improvement to Machine check handler > for pseries. Patch 1 fixes an issue where machine check handler > crashes kernel while accessing vmalloc-ed buffer while in nmi context. > Patch 3 dumps the SLB

UBSAN: Undefined behaviour in ../include/linux/percpu_counter.h:137:13

2018-06-07 Thread Mathieu Malaterre
Hi there, I have a reproducible UBSAN appearing in dmesg after a while on my G4 (*). Could anyone suggest a way to diagnose the actual root issue here (or is it just a false positive) ? Thanks, (*) [41877.514338]

[v3 PATCH 5/5] powerpc/pseries: Display machine check error details.

2018-06-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Extract the MCE error details from RTAS extended log and display it to console. With this patch you should now see mce logs like below: [ 142.371818] Severe Machine check interrupt [Recovered] [ 142.371822] NIP [dca301b8]: init_module+0x1b8/0x338

[v3 PATCH 4/5] powerpc/pseries: Dump and flush SLB contents on SLB MCE errors.

2018-06-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar If we get a machine check exceptions due to SLB errors then dump the current SLB contents which will be very much helpful in debugging the root cause of SLB errors. On pseries, as of today system crashes on SLB errors. These are soft errors and can be fixed by flushing

[v3 PATCH 3/5] powerpc/pseries: Define MCE error event section.

2018-06-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar On pseries, the machine check error details are part of RTAS extended event log passed under Machine check exception section. This patch adds the definition of rtas MCE event section and related helper functions. Signed-off-by: Mahesh Salgaonkar ---

[v3 PATCH 2/5] powerpc/pseries: Fix endainness while restoring of r3 in MCE handler.

2018-06-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar During Machine Check interrupt on pseries platform, register r3 points RTAS extended event log passed by hypervisor. Since hypervisor uses r3 to pass pointer to rtas log, it stores the original r3 value at the start of the memory (first 8 bytes) pointed by r3. Since

[v3 PATCH 1/5] powerpc/pseries: convert rtas_log_buf to linear allocation.

2018-06-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar rtas_log_buf is a buffer to hold RTAS event data that are communicated to kernel by hypervisor. This buffer is then used to pass RTAS event data to user through proc fs. This buffer is allocated from vmalloc (non-linear mapping) area. On Machine check interrupt, register

[v3 PATCH 0/5] powerpc/pseries: Machien check handler improvements.

2018-06-07 Thread Mahesh J Salgaonkar
This patch series includes some improvement to Machine check handler for pseries. Patch 1 fixes an issue where machine check handler crashes kernel while accessing vmalloc-ed buffer while in nmi context. Patch 2 fixes endain bug while restoring of r3 in MCE handler. Patch 4 dumps the SLB contents

Re: [RFC PATCH kernel 4/5] vfio_pci: Allow mapping extra regions

2018-06-07 Thread Alex Williamson
On Thu, 7 Jun 2018 18:44:19 +1000 Alexey Kardashevskiy wrote: What's an "extra region", -ENOCOMMITLOG > Signed-off-by: Alexey Kardashevskiy > --- > drivers/vfio/pci/vfio_pci_private.h | 3 +++ > drivers/vfio/pci/vfio_pci.c | 10 -- > 2 files changed, 11 insertions(+), 2

Re: [RFC PATCH kernel 5/5] vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] [10de:1db1] subdriver

2018-06-07 Thread Alex Williamson
On Thu, 7 Jun 2018 18:44:20 +1000 Alexey Kardashevskiy wrote: > Some POWER9 chips come with special NVLink2 links which provide > cacheable memory access to the RAM physically located on NVIDIA GPU. > This memory is presented to a host via the device tree but remains > offline until the NVIDIA

Re: [RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Alex Williamson
On Thu, 7 Jun 2018 18:44:15 +1000 Alexey Kardashevskiy wrote: > Here is an rfc of some patches adding psaa-through support > for NVIDIA V100 GPU found in some POWER9 boxes. > > The example P9 system has 6 GPUs, each accompanied with 2 bridges > representing the hardware links (aka NVLink2): >

Re: [RFC PATCH -tip v5 18/27] powerpc/kprobes: Don't call the ->break_handler() in arm kprobes code

2018-06-07 Thread Naveen N. Rao
Masami Hiramatsu wrote: On Thu, 07 Jun 2018 17:07:00 +0530 "Naveen N. Rao" wrote: Masami Hiramatsu wrote: > Don't call the ->break_handler() from the arm kprobes code, ^^^ powerpc > because it was only used by jprobes which got removed. > > This

Re: [v2 PATCH 0/5] powerpc/pseries: Machien check handler improvements.

2018-06-07 Thread Mahesh Jagannath Salgaonkar
On 06/07/2018 04:15 PM, Nicholas Piggin wrote: > On Thu, 07 Jun 2018 15:36:25 +0530 > Mahesh J Salgaonkar wrote: > >> This patch series includes some improvement to Machine check handler >> for pseries. Patch 1 fixes an issue where machine check handler crashes >> kernel while accessing

Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-06-07 Thread Michael S. Tsirkin
On Wed, Jun 06, 2018 at 10:23:06PM -0700, Christoph Hellwig wrote: > On Thu, May 31, 2018 at 08:43:58PM +0300, Michael S. Tsirkin wrote: > > Pls work on a long term solution. Short term needs can be served by > > enabling the iommu platform in qemu. > > So, I spent some time looking at converting

Re: Fwd: [powerpc/Baremetal]Kernel OOPS while executing memory hotplug on Power8 baremetal

2018-06-07 Thread Jens Axboe
On 6/7/18 8:45 AM, Jens Axboe wrote: > On 6/7/18 4:37 AM, vrbagal1 wrote: >> On 2018-06-07 13:12, Bart Van Assche wrote: >>> On Thu, 2018-06-07 at 12:56 +0530, Venkat Rao B wrote: On Thursday 07 June 2018 12:46 PM, Bart Van Assche wrote: > On Thu, 2018-06-07 at 12:38 +0530, vrbagal1

[RFC PATCH 2/5] powerpc: Flush checkpointed gpr state for 32-bit processes in ptrace

2018-06-07 Thread Pedro Franco de Carvalho
Currently ptrace doesn't flush the register state when the checkpointed GPRs of a 32-bit thread are accessed. This can cause core dumps to have stale data in the checkpointed GPR note. --- arch/powerpc/kernel/ptrace.c | 20 1 file changed, 20 insertions(+) diff --git

[RFC PATCH 4/5] powerpc: Add VSX regset to compat_regsets

2018-06-07 Thread Pedro Franco de Carvalho
This patch copies the the missing VSX regset to the compat_regsets array. Not having this regset can cause issues in fs/binfmt_elf.c in the fill_thread_core_info function, which iterates over all the regsets defined in compat_regsets to fill note info for a core dump of a 32-bit thread. However,

[RFC PATCH 5/5] powerpc: Add PMU regset to compat_regsets

2018-06-07 Thread Pedro Franco de Carvalho
This patch allows setting and getting PMU registers from 32-bit threads. --- arch/powerpc/kernel/ptrace.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 2da0668a96dc..3a9c4ae65429 100644 --- a/arch/powerpc/kernel/ptrace.c

[RFC PATCH 3/5] powerpc: Fix pmu get/set functions

2018-06-07 Thread Pedro Franco de Carvalho
The PMU regset exposed through ptrace has 5 64-bit words, which are all copied in and out. However, mmcr0 in the thread_struct is an unsigned, which causes pmu_set to clobber the next variable in the thread_struct (used_ebb), and pmu_get to return the same variable in one half of the mmcr0 slot.

[RFC PATCH 1/5] powerpc: Fix inverted active predicate for setting the EBB regset

2018-06-07 Thread Pedro Franco de Carvalho
Currently, the ebb_set function for writing to the EBB regset returns ENODATA when ebb is active in the thread, and copies in the data when it is inactive. This patch inverts the condition so that it matches ebb_get and ebb_active. --- arch/powerpc/kernel/ptrace.c | 2 +- 1 file changed, 1

[RFC PATCH 0/5] powerpc: Misc. ptrace regset fixes

2018-06-07 Thread Pedro Franco de Carvalho
This series attempts to fix a few issues with ptrace regsets. Patch 1 simply inverts the active predicate for ebb_set. I don't know if there was a reason for having opposite predicates in ebb_get/ebb_set, but I assumed this was a typo. Patch 2 adds the usual HTM prologue for regsets to the

Re: Fwd: [powerpc/Baremetal]Kernel OOPS while executing memory hotplug on Power8 baremetal

2018-06-07 Thread Jens Axboe
On 6/7/18 4:37 AM, vrbagal1 wrote: > On 2018-06-07 13:12, Bart Van Assche wrote: >> On Thu, 2018-06-07 at 12:56 +0530, Venkat Rao B wrote: >>> On Thursday 07 June 2018 12:46 PM, Bart Van Assche wrote: On Thu, 2018-06-07 at 12:38 +0530, vrbagal1 wrote: > Observing Kernel oops and machine

Re: [RFC PATCH -tip v5 18/27] powerpc/kprobes: Don't call the ->break_handler() in arm kprobes code

2018-06-07 Thread Masami Hiramatsu
On Thu, 07 Jun 2018 17:07:00 +0530 "Naveen N. Rao" wrote: > Masami Hiramatsu wrote: > > Don't call the ->break_handler() from the arm kprobes code, > ^^^ powerpc > > > because it was only used by jprobes which got removed. > > > > This also makes

Re: [RFC PATCH -tip v5 07/27] powerpc/kprobes: Remove jprobe powerpc implementation

2018-06-07 Thread Masami Hiramatsu
On Thu, 07 Jun 2018 17:01:23 +0530 "Naveen N. Rao" wrote: > Masami Hiramatsu wrote: > > Remove arch dependent setjump/longjump functions > > and unused fields in kprobe_ctlblk for jprobes > > from arch/powerpc. This also reverts commits > > related __is_active_jprobe() function. > > > >

Re: Fwd: [powerpc/Baremetal]Kernel OOPS while executing memory hotplug on Power8 baremetal

2018-06-07 Thread Michael Ellerman
vrbagal1 writes: > On 2018-06-07 13:12, Bart Van Assche wrote: >> On Thu, 2018-06-07 at 12:56 +0530, Venkat Rao B wrote: >>> On Thursday 07 June 2018 12:46 PM, Bart Van Assche wrote: >>> > On Thu, 2018-06-07 at 12:38 +0530, vrbagal1 wrote: >>> > > Observing Kernel oops and machine reboots while

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

2018-06-07 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Linus, Please pull powerpc updates for 4.18: The following changes since commit 6da6c0db5316275015e8cc2959f12a17584aeb64: Linux v4.17-rc3 (2018-04-29 14:17:42 -0700) are available in the git repository at:

Re: [RFC PATCH -tip v5 24/27] bpf: error-inject: kprobes: Clear current_kprobe and enable preempt in kprobe

2018-06-07 Thread Naveen N. Rao
Masami Hiramatsu wrote: Clear current_kprobe and enable preemption in kprobe even if pre_handler returns !0. This simplifies function override using kprobes. Jprobe used to require to keep the preemption disabled and keep current_kprobe until it returned to original function entry. For this

Re: [RFC PATCH -tip v5 18/27] powerpc/kprobes: Don't call the ->break_handler() in arm kprobes code

2018-06-07 Thread Naveen N. Rao
Masami Hiramatsu wrote: Don't call the ->break_handler() from the arm kprobes code, ^^^ powerpc because it was only used by jprobes which got removed. This also makes skip_singlestep() a static function since only ftrace-kprobe.c is using this

Re: [RFC PATCH -tip v5 07/27] powerpc/kprobes: Remove jprobe powerpc implementation

2018-06-07 Thread Naveen N. Rao
Masami Hiramatsu wrote: Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/powerpc. This also reverts commits related __is_active_jprobe() function. Signed-off-by: Masami Hiramatsu Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc:

Re: [v2 PATCH 0/5] powerpc/pseries: Machien check handler improvements.

2018-06-07 Thread Nicholas Piggin
On Thu, 07 Jun 2018 15:36:25 +0530 Mahesh J Salgaonkar wrote: > This patch series includes some improvement to Machine check handler > for pseries. Patch 1 fixes an issue where machine check handler crashes > kernel while accessing vmalloc-ed buffer while in nmi context. > Patch 3 dumps the SLB

Re: Fwd: [powerpc/Baremetal]Kernel OOPS while executing memory hotplug on Power8 baremetal

2018-06-07 Thread vrbagal1
On 2018-06-07 13:12, Bart Van Assche wrote: On Thu, 2018-06-07 at 12:56 +0530, Venkat Rao B wrote: On Thursday 07 June 2018 12:46 PM, Bart Van Assche wrote: > On Thu, 2018-06-07 at 12:38 +0530, vrbagal1 wrote: > > Observing Kernel oops and machine reboots while executing memory hotplug > > test

[PATCH 3/3] powerpc: Allow CPU selection of e300core variants

2018-06-07 Thread Christophe Leroy
GCC supports -mcpu=e300c2 and -mcpu=e300c3 This patch gives the opportunity to tune kernel to one of those two types. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/Kconfig.cputype | 10 ++ 1 file changed, 10 insertions(+) diff --git

[PATCH 2/3] powerpc: Allow CPU selection also on PPC32

2018-06-07 Thread Christophe Leroy
This patch extends to PPC32 the capability to select the exact CPU type. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/Kconfig.cputype | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/Kconfig.cputype

[PATCH 1/3] powerpc: make CPU selection logic generic in Makefile

2018-06-07 Thread Christophe Leroy
At the time being, when adding a new CPU for selection, both Kconfig.cputype and Makefile have to be modified. This patch moves into Kconfig.cputype the name of the CPU to me passed to the -mcpu= argument. Signed-off-by: Christophe Leroy --- arch/powerpc/Makefile | 8 +---

[v2 PATCH 5/5] powerpc/pseries: Fix endainness while restoring of

2018-06-07 Thread Mahesh J Salgaonkar
r3 in MCE handler. From: Mahesh Salgaonkar During Machine Check interrupt on pseries platform, register r3 points RTAS extended event log passed by hypervisor. Since hypervisor uses r3 to pass pointer to rtas log, it stores the original r3 value at the start of the memory (first 8 bytes)

[v2 PATCH 4/5] powerpc/pseries: Display machine check error details.

2018-06-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Extract the MCE eror details from RTAS extended log and display it to console. With this patch you should now see mce logs like below: [ 142.371818] Severe Machine check interrupt [Recovered] [ 142.371822] NIP [dca301b8]: init_module+0x1b8/0x338

[v2 PATCH 3/5] powerpc/pseries: Dump and flush SLB contents on SLB MCE errors.

2018-06-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar If we get a machine check exceptions due to SLB errors then dump the current SLB contents which will be very much helpful in debugging the root cause of SLB errors. On pseries, as of today system crashes on SLB errors. These are soft errors and can be fixed by flushing

[v2 PATCH 2/5] powerpc/pseries: Define MCE error event section.

2018-06-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar On pseries, the machine check error details are part of RTAS extended event log passed under Machine check exception section. This patch adds the definition of rtas MCE event section and related helper functions. Signed-off-by: Mahesh Salgaonkar ---

[v2 PATCH 1/5] powerpc/pseries: convert rtas_log_buf to linear allocation.

2018-06-07 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar rtas_log_buf is a buffer to hold RTAS event data that are communicated to kernel by hypervisor. This buffer is then used to pass RTAS event data to user through proc fs. This buffer is allocated from vmalloc (non-linear mapping) area. On Machine check interrupt, register

[v2 PATCH 0/5] powerpc/pseries: Machien check handler improvements.

2018-06-07 Thread Mahesh J Salgaonkar
This patch series includes some improvement to Machine check handler for pseries. Patch 1 fixes an issue where machine check handler crashes kernel while accessing vmalloc-ed buffer while in nmi context. Patch 3 dumps the SLB contents on SLB MCE errors to improve the debugability. Patch 4

[PATCH v3] powerpc: Add support for function error injection

2018-06-07 Thread Naveen N. Rao
We implement regs_set_return_value() and override_function_with_return() for this purpose. On powerpc, a return from a function (blr) just branches to the location contained in the link register. So, we can just update pt_regs rather than redirecting execution to a dummy function that returns.

[v3, 10/10] dpaa_eth: add the get_ts_info interface for ethtool

2018-06-07 Thread Yangbo Lu
Added the get_ts_info interface for ethtool to check the timestamping capability. Signed-off-by: Yangbo Lu --- Changes for v2: - Removed ifdef for hw timestamp. Changes for v3: - None. --- drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 39 1 files

[v3, 09/10] dpaa_eth: add support for hardware timestamping

2018-06-07 Thread Yangbo Lu
This patch is to add hardware timestamping support for dpaa_eth. On Rx, timestamping is enabled for all frames. On Tx, we only instruct the hardware to timestamp the frames marked accordingly by the stack. Signed-off-by: Yangbo Lu --- Changes for v2: - Removed ifdef for timestamp code.

[v3, 08/10] fsl/fman: define frame description command UPD

2018-06-07 Thread Yangbo Lu
Defined frame description command FM_FD_CMD_UPD for prepended data updating. Signed-off-by: Yangbo Lu --- Changes for v2: - None. Changes for v3: - None. --- drivers/net/ethernet/freescale/fman/fman.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git

[v3, 07/10] fsl/fman_port: support getting timestamp

2018-06-07 Thread Yangbo Lu
This patch is to add fman_port_get_tstamp() interface to get timestamp. Signed-off-by: Yangbo Lu --- Changes for v2: - None. Changes for v3: - Moved endianness conversion from dpaa to fman API. --- drivers/net/ethernet/freescale/fman/fman_port.c | 12

[v3, 06/10] fsl/fman: add set_tstamp interface

2018-06-07 Thread Yangbo Lu
This patch is to add set_tstamp interface for memac, dtsec, and 10GEC controllers to configure HW timestamping. Signed-off-by: Yangbo Lu --- Changes for v2: - None. Changes for v3: - None. --- drivers/net/ethernet/freescale/fman/fman_dtsec.c | 27 ++

[v3, 05/10] arm64: dts: fsl: move ptp timer out of fman

2018-06-07 Thread Yangbo Lu
This patch is to move ptp timer node out of fman. Because ptp timer will be probed by ptp_qoriq driver, it should be an independent device in case of conflict memory mapping. Signed-off-by: Yangbo Lu --- Changes for v2: - Fixed address-cells for ptp-timer. Changes for v3: - None.

[v3, 04/10] powerpc/mpc85xx: move ptp timer out of fman in dts

2018-06-07 Thread Yangbo Lu
This patch is to move ptp timer node out of fman. Because ptp timer will be probed by ptp_qoriq driver, it should be an independent device in case of conflict memory mapping. Signed-off-by: Yangbo Lu --- Changes for v2: - None. Changes for v3: - None. ---

[v3, 03/10] dt-binding: ptp_qoriq: add DPAA FMan support

2018-06-07 Thread Yangbo Lu
This patch is to add bindings description for DPAA FMan 1588 timer, and also remove its description in fsl-fman dt-bindings document. Signed-off-by: Yangbo Lu --- Changes for v2: - None. Changes for v3: - None. --- Documentation/devicetree/bindings/net/fsl-fman.txt | 25

[v3, 02/10] ptp: support DPAA FMan 1588 timer in ptp_qoriq

2018-06-07 Thread Yangbo Lu
This patch is to support DPAA (Data Path Acceleration Architecture) 1588 timer by adding "fsl,fman-ptp-timer" compatible, sharing interrupt with FMan, adding FSL_DPAA_ETH dependency, and fixing up register offset. Signed-off-by: Yangbo Lu --- Changes for v2: - None. Changes for v3:

[v3, 01/10] fsl/fman: share the event interrupt

2018-06-07 Thread Yangbo Lu
This patch is to share fman event interrupt because the 1588 timer driver will also use this interrupt. Signed-off-by: Yangbo Lu --- Changes for v2: - None. Changes for v3: - None. --- drivers/net/ethernet/freescale/fman/fman.c |3 ++- 1 files changed, 2 insertions(+), 1

[v3, 00/10] Support DPAA PTP clock and timestamping

2018-06-07 Thread Yangbo Lu
This patchset is to support DPAA FMAN PTP clock and HW timestamping. It had been verified on both ARM platform and PPC platform. - The patch #1 to patch #5 are to support DPAA FMAN 1588 timer in ptp_qoriq driver. - The patch #6 to patch #10 are to add HW timestamping support in DPAA ethernet

RE: [v2, 09/10] dpaa_eth: add support for hardware timestamping

2018-06-07 Thread Y.b. Lu
Hi Madalin, > -Original Message- > From: Madalin-cristian Bucur > Sent: Thursday, June 7, 2018 4:24 PM > To: Y.b. Lu ; net...@vger.kernel.org; Richard Cochran > ; Rob Herring ; Shawn > Guo ; David S . Miller > Cc: devicet...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; >

[RFC PATCH kernel 1/5] vfio/spapr_tce: Simplify page contained test

2018-06-07 Thread Alexey Kardashevskiy
The test function takes a page struct pointer which is not used by either of two callers in any other way, make it simple and just pass a physical address there. This should cause no behavioral change now but later we may start supporting host addresses for memory devices which are not backed

[RFC PATCH kernel 0/5] powerpc/P9/vfio: Pass through NVIDIA Tesla V100

2018-06-07 Thread Alexey Kardashevskiy
Here is an rfc of some patches adding psaa-through support for NVIDIA V100 GPU found in some POWER9 boxes. The example P9 system has 6 GPUs, each accompanied with 2 bridges representing the hardware links (aka NVLink2): 4 0004:04:00.0 3D: NVIDIA Corporation GV100GL [Tesla V100 SXM2] (rev a1)

  1   2   >