Re: [RESEND][PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.

2018-07-19 Thread Michael Ellerman
Michael Neuling writes: > On Fri, 2018-07-20 at 12:32 +1000, Michael Ellerman wrote: >> Michael Neuling writes: >> > On Wed, 2018-07-18 at 13:42 +0530, Gautham R Shenoy wrote: >> > > On Wed, Jul 18, 2018 at 09:24:19AM +1000, Michael Neuling wrote: >> > > > >> > > > > DEFINE(PPC_DBELL_SERVER

[PATCH v7 2/2] hwmon: ibmpowernv: Add attributes to enable/disable sensor groups

2018-07-19 Thread Shilpasri G Bhat
OPAL firmware provides the facility for some groups of sensors to be enabled/disabled at runtime to give the user the option of using the system resources for collecting these sensors or not. For example, on POWER9 systems, the On Chip Controller (OCC) gathers various system and chip level sensors

[PATCH v7 1/2] powernv:opal-sensor-groups: Add support to enable sensor groups

2018-07-19 Thread Shilpasri G Bhat
Adds support to enable/disable a sensor group at runtime. This can be used to select the sensor groups that needs to be copied to main memory by OCC. Sensor groups like power, temperature, current, voltage, frequency, utilization can be enabled/disabled at runtime. Signed-off-by: Shilpasri G Bhat

[PATCH v7 0/2] hwmon/powernv: Add attributes to enable/disable sensors

2018-07-19 Thread Shilpasri G Bhat
This patch series adds new attribute to enable or disable a sensor at runtime. Changes from v6: - Updated the commit message as per Stewart's suggestion - Use the compatible DT property instead of the path to find the node v6 : https://lkml.org/lkml/2018/7/18/806 v5 : https://lkml.org/lkml/2018/7

Re: [powerpc/powervm]Oops: Kernel access of bad area, sig: 11 [#1] while running stress-ng

2018-07-19 Thread vrbagal1
On 2018-07-19 19:03, Brian Foster wrote: cc linux-xfs On Thu, Jul 19, 2018 at 11:47:59AM +0530, vrbagal1 wrote: On 2018-07-10 19:12, Michael Ellerman wrote: > vrbagal1 writes: > > > On 2018-07-10 13:37, Nicholas Piggin wrote: > > > On Tue, 10 Jul 2018 11:58:40 +0530 > > > vrbagal1 wrote: > >

Re: [PATCH 4/7] x86,tlb: make lazy TLB mode lazier

2018-07-19 Thread Benjamin Herrenschmidt
On Thu, 2018-07-19 at 10:04 -0700, Andy Lutomirski wrote: > On Thu, Jul 19, 2018 at 9:45 AM, Andy Lutomirski wrote: > > [I added PeterZ and Vitaly -- can you see any way in which this would > > break something obscure? I don't.] Added Nick and Aneesh. We do have HW remote flushes on powerpc. >

Re: [PATCH v3] PCI: Data corruption happening due to race condition

2018-07-19 Thread Benjamin Herrenschmidt
On Thu, 2018-07-19 at 20:55 +0200, Lukas Wunner wrote: > On Thu, Jul 19, 2018 at 9:48 AM, Benjamin Herrenschmidt > > Indeed. However I'm not fan of the solution. Shouldn't we instead have > > some locking for the content of pci_dev? I've always been wary of us > > having other similar races in th

[RFC 4/4] virtio: Add platform specific DMA API translation for virito devices

2018-07-19 Thread Anshuman Khandual
This adds a hook which a platform can define in order to allow it to override virtio device's DMA OPS irrespective of whether it has the flag VIRTIO_F_IOMMU_PLATFORM set or not. We want to use this to do bounce-buffering of data on the new secure pSeries platform, currently under development, where

[RFC 3/4] virtio: Force virtio core to use DMA API callbacks for all virtio devices

2018-07-19 Thread Anshuman Khandual
Virtio core should use DMA API callbacks for all virtio devices which may generate either GAP or IOVA depending on VIRTIO_F_IOMMU_PLATFORM flag and resulting QEMU expectations. This implies that every virtio device needs to have a DMA OPS structure. This removes previous GPA fallback code paths. S

[RFC 2/4] virtio: Override device's DMA OPS with virtio_direct_dma_ops selectively

2018-07-19 Thread Anshuman Khandual
Now that virtio core always needs all virtio devices to have DMA OPS, we need to make sure that the structure it points is the right one. In the absence of VIRTIO_F_IOMMU_PLATFORM flag QEMU expects GPA from guest kernel. In such case, virtio device must use default virtio_direct_dma_ops DMA OPS str

[RFC 1/4] virtio: Define virtio_direct_dma_ops structure

2018-07-19 Thread Anshuman Khandual
Current implementation of DMA API inside virtio core calls device's DMA OPS callback functions when the flag VIRTIO_F_IOMMU_PLATFORM flag is set. But in absence of the flag, virtio core falls back calling basic transformation of the incoming SG addresses as GPA. Going forward virtio should only cal

[RFC 0/4] Virtio uses DMA API for all devices

2018-07-19 Thread Anshuman Khandual
This patch series is the follow up on the discussions we had before about the RFC titled [RFC,V2] virtio: Add platform specific DMA API translation for virito devices (https://patchwork.kernel.org/patch/10417371/). There were suggestions about doing away with two different paths of transactions wit

Re: [kernel,v7,1/2] vfio/spapr: Use IOMMU pageshift rather than pagesize

2018-07-19 Thread Paul Mackerras
On Thu, Jul 19, 2018 at 04:06:10PM +1000, Michael Ellerman wrote: > On Tue, 2018-07-17 at 07:19:12 UTC, Alexey Kardashevskiy wrote: > > The size is always equal to 1 page so let's use this. Later on this will > > be used for other checks which use page shifts to check the granularity > > of access.

Re: [RESEND][PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.

2018-07-19 Thread Michael Neuling
On Fri, 2018-07-20 at 12:32 +1000, Michael Ellerman wrote: > Michael Neuling writes: > > On Wed, 2018-07-18 at 13:42 +0530, Gautham R Shenoy wrote: > > > On Wed, Jul 18, 2018 at 09:24:19AM +1000, Michael Neuling wrote: > > > > > > > > > DEFINE(PPC_DBELL_SERVER, PPC_DBELL_SERVER); > > > > >

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

2018-07-19 Thread Michael Ellerman
Stephen Rothwell writes: > Hi all, > > Today's linux-next merge of the powerpc tree got a conflict in: > > drivers/vfio/vfio_iommu_spapr_tce.c > > between commit: > > 1463edca6734 ("vfio/spapr: Use IOMMU pageshift rather than pagesize") > > from the powerpc-fixes tree and commit: > > 00a5c5

Re: [RESEND][PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.

2018-07-19 Thread Michael Ellerman
Michael Neuling writes: > On Wed, 2018-07-18 at 13:42 +0530, Gautham R Shenoy wrote: >> On Wed, Jul 18, 2018 at 09:24:19AM +1000, Michael Neuling wrote: >> > >> > > DEFINE(PPC_DBELL_SERVER, PPC_DBELL_SERVER); >> > > diff --git a/arch/powerpc/kernel/idle_book3s.S >> > > b/arch/powerpc/ker

Re: [RESEND][PATCH] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop.

2018-07-19 Thread Michael Neuling
On Wed, 2018-07-18 at 13:42 +0530, Gautham R Shenoy wrote: > Hello Mikey, > > On Wed, Jul 18, 2018 at 09:24:19AM +1000, Michael Neuling wrote: > > > > > DEFINE(PPC_DBELL_SERVER, PPC_DBELL_SERVER); > > > diff --git a/arch/powerpc/kernel/idle_book3s.S > > > b/arch/powerpc/kernel/idle_book3s.S > >

linux-next: manual merge of the powerpc tree with the powerpc-fixes tree

2018-07-19 Thread Stephen Rothwell
Hi all, Today's linux-next merge of the powerpc tree got a conflict in: drivers/vfio/vfio_iommu_spapr_tce.c between commit: 1463edca6734 ("vfio/spapr: Use IOMMU pageshift rather than pagesize") from the powerpc-fixes tree and commit: 00a5c58d9499 ("KVM: PPC: Make iommu_table::it_userspa

Re: [PATCH v3] PCI: Data corruption happening due to race condition

2018-07-19 Thread Hari Vyas
Hi Bjonr, Ben On Thu, Jul 19, 2018 at 9:48 AM, Benjamin Herrenschmidt wrote: > On Wed, 2018-07-18 at 18:29 -0500, Bjorn Helgaas wrote: >> [+cc Paul, Michael, linuxppc-dev] >> > >/... > >> > Debugging revealed a race condition between pcie core driver >> > enabling is_added bit(pci_bus_add

Re: Improvements for the PS3

2018-07-19 Thread Fredrik Noring
Hi Geert, Geoff, > > > so I added a sleep with > > > > > > + msleep(1); > > I can't see where you added the sleep, but 10s seems excessive. > If the real reason is the need to wait for an interrupt for > ps3fb_sync_image(), > then waiting for 40 ms should be sufficient? Or am I missing s

Re: [PATCH v7 4/4] kexec_file: Load kernel at top of system RAM if required

2018-07-19 Thread Andrew Morton
On Thu, 19 Jul 2018 23:17:53 +0800 Baoquan He wrote: > Hi Andrew, > > On 07/18/18 at 03:33pm, Andrew Morton wrote: > > On Wed, 18 Jul 2018 10:49:44 +0800 Baoquan He wrote: > > > > > For kexec_file loading, if kexec_buf.top_down is 'true', the memory which > > > is used to load kernel/initrd/pu

Re: [PATCH] powerpc/msi: Remove VLA usage

2018-07-19 Thread Kees Cook
On Thu, Jul 19, 2018 at 5:17 AM, Michael Ellerman wrote: > Kees Cook writes: > >> On Fri, Jun 29, 2018 at 11:52 AM, Kees Cook wrote: >>> In the quest to remove all stack VLA usage from the kernel[1], this >>> switches from an unchanging variable to a constant expression to eliminate >>> the VLA

Re: [PATCH 4/7] x86,tlb: make lazy TLB mode lazier

2018-07-19 Thread Andy Lutomirski
On Thu, Jul 19, 2018 at 9:45 AM, Andy Lutomirski wrote: > [I added PeterZ and Vitaly -- can you see any way in which this would > break something obscure? I don't.] > > On Thu, Jul 19, 2018 at 7:14 AM, Rik van Riel wrote: >> I guess we can skip both switch_ldt and load_mm_cr4 if real_prev equals

Re: [PATCH v7 1/4] resource: Move reparent_resources() to kernel/resource.c and make it public

2018-07-19 Thread Baoquan He
On 07/18/18 at 07:37pm, Andy Shevchenko wrote: > On Wed, Jul 18, 2018 at 7:36 PM, Andy Shevchenko > wrote: > > On Wed, Jul 18, 2018 at 5:49 AM, Baoquan He wrote: > >> reparent_resources() is duplicated in arch/microblaze/pci/pci-common.c > >> and arch/powerpc/kernel/pci-common.c, so move it to ke

Re: [PATCH v7 4/4] kexec_file: Load kernel at top of system RAM if required

2018-07-19 Thread Baoquan He
Hi Andrew, On 07/18/18 at 03:33pm, Andrew Morton wrote: > On Wed, 18 Jul 2018 10:49:44 +0800 Baoquan He wrote: > > > For kexec_file loading, if kexec_buf.top_down is 'true', the memory which > > is used to load kernel/initrd/purgatory is supposed to be allocated from > > top to down. This is wha

Re: Improvements for the PS3

2018-07-19 Thread Geoff Levand
Hi Geert, Fredrik, On 07/19/2018 12:45 AM, Geert Uytterhoeven wrote: >> On 07/14/2018 09:49 AM, Fredrik Noring wrote: >>> >>> et voilà, the screen came alive and the kernel panic was revealed! It seems >>> the kernel panics so fast that the PS3 frame buffer is unprepared. This is, >>> of course, v

Re: [PATCH] powerpc/ps3: Set driver coherent_dma_mask

2018-07-19 Thread Alan Stern
On Thu, 19 Jul 2018, Geoff Levand wrote: > Hi Alan, > > On 07/19/2018 07:33 AM, Alan Stern wrote: > > On Wed, 18 Jul 2018, Geoff Levand wrote: > > > >> diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c > >> index 8c733492d8fe..454d8c624a3f 100644 > >> --- a/drivers/usb/host/

Re: [PATCH] powerpc/ps3: Set driver coherent_dma_mask

2018-07-19 Thread Geoff Levand
Hi Alan, On 07/19/2018 07:33 AM, Alan Stern wrote: > On Wed, 18 Jul 2018, Geoff Levand wrote: > >> diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c >> index 8c733492d8fe..454d8c624a3f 100644 >> --- a/drivers/usb/host/ehci-ps3.c >> +++ b/drivers/usb/host/ehci-ps3.c >> @@ -86,

Re: [PATCH] powerpc/ps3: Set driver coherent_dma_mask

2018-07-19 Thread Alan Stern
On Wed, 18 Jul 2018, Geoff Levand wrote: > Set the coherent_dma_mask for the PS3 ehci, ohci, and snd devices. > > Silences WARN_ON_ONCE messages emitted by the dma_alloc_attrs() routine. > > Reported-by: Fredrik Noring > Signed-off-by: Geoff Levand > --- > Hi Michael, > > This just silences s

[PATCH] powerpc/mm: Don't report PUDs as memory leaks when using kmemleak

2018-07-19 Thread Michael Ellerman
Paul Menzel reported that kmemleak was producing reports such as: unreferenced object 0xc000f8b8 (size 16384): comm "init", pid 1, jiffies 4294937416 (age 312.240s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0

Re: [powerpc/powervm]Oops: Kernel access of bad area, sig: 11 [#1] while running stress-ng

2018-07-19 Thread Brian Foster
cc linux-xfs On Thu, Jul 19, 2018 at 11:47:59AM +0530, vrbagal1 wrote: > On 2018-07-10 19:12, Michael Ellerman wrote: > > vrbagal1 writes: > > > > > On 2018-07-10 13:37, Nicholas Piggin wrote: > > > > On Tue, 10 Jul 2018 11:58:40 +0530 > > > > vrbagal1 wrote: > > > > > > > > > Hi, > > > > > >

Re: [PATCH v6 2/2] hwmon: ibmpowernv: Add attributes to enable/disable sensor groups

2018-07-19 Thread Guenter Roeck
On 07/18/2018 11:59 PM, Stewart Smith wrote: Shilpasri G Bhat writes: On-Chip-Controller(OCC) is an embedded micro-processor in POWER9 chip which measures various system and chip level sensors. These sensors comprises of environmental sensors (like power, temperature, current and voltage) and p

Re: [PATCH v5 5/7] powerpc/pseries: flush SLB contents on SLB MCE errors.

2018-07-19 Thread Michael Ellerman
Michal Suchánek writes: > On Tue, 3 Jul 2018 08:08:14 +1000 > "Nicholas Piggin" wrote: >> On Mon, 02 Jul 2018 11:17:06 > +0530 >> Mahesh J Salgaonkar wrote: >> > From: Mahesh Salgaonkar >> > diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c >> > index efdd16a79075..221271c96a5

Re: [PATCH] powerpc/msi: Remove VLA usage

2018-07-19 Thread Michael Ellerman
Kees Cook writes: > On Fri, Jun 29, 2018 at 11:52 AM, Kees Cook wrote: >> In the quest to remove all stack VLA usage from the kernel[1], this >> switches from an unchanging variable to a constant expression to eliminate >> the VLA generation. >> >> [1] >> https://lkml.kernel.org/r/CA+55aFzCG-zN

Re: [PATCH v4 4/6] powerpc/fsl: Enable cpu vulnerabilities reporting for NXP PPC BOOK3E

2018-07-19 Thread Michael Ellerman
LEROY Christophe writes: > Diana Madalina Craciun a écrit : >> On 7/17/2018 7:47 PM, LEROY Christophe wrote: >>> Diana Craciun a écrit : The NXP PPC Book3E platforms are not vulnerable to meltdown and Spectre v4, so make them PPC_BOOK3S_64 specific. Signed-off-by: Diana Craci

Re: [PATCH] powerpc/prom_init: remove linux,stdout-package property

2018-07-19 Thread Michael Ellerman
Murilo Opsfelder Araujo writes: > On Wed, Jul 18, 2018 at 07:37:37PM +1000, Michael Ellerman wrote: >> Murilo Opsfelder Araujo writes: >> > This property was added in 2004 by >> > >> > >> > https://github.com/mpe/linux-fullhistory/commit/689fe5072fe9a0dec914bfa4fa60aed1e54563e6 >> > >> > and

Re: [PATCH] powerpc/ps3: Set driver coherent_dma_mask

2018-07-19 Thread Michael Ellerman
Greg KH writes: > On Wed, Jul 18, 2018 at 03:08:33PM -0700, Geoff Levand wrote: >> Set the coherent_dma_mask for the PS3 ehci, ohci, and snd devices. >> >> Silences WARN_ON_ONCE messages emitted by the dma_alloc_attrs() routine. >> >> Reported-by: Fredrik Noring >> Signed-off-by: Geoff Levand

Re: [RFC PATCH v6 0/4] powerpc/fadump: Improvements and fixes for firmware-assisted dump.

2018-07-19 Thread Michal Hocko
On Wed 18-07-18 21:52:17, Mahesh Jagannath Salgaonkar wrote: > On 07/17/2018 05:22 PM, Michal Hocko wrote: > > On Tue 17-07-18 16:58:10, Mahesh Jagannath Salgaonkar wrote: > >> On 07/16/2018 01:56 PM, Michal Hocko wrote: > >>> On Mon 16-07-18 11:32:56, Mahesh J Salgaonkar wrote: > One of the p

Re: Improvements for the PS3

2018-07-19 Thread Geert Uytterhoeven
Hi Geoff, Frederik, On Thu, Jul 19, 2018 at 12:40 AM Geoff Levand wrote: > On 07/14/2018 09:49 AM, Fredrik Noring wrote: > > so I added a sleep with > > > > + msleep(1); I can't see where you added the sleep, but 10s seems excessive. If the real reason is the need to wait for an interrup